diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 8773ee6d..94e76b28 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,125 +1,63 @@ -# GitHub Copilot Token Tracker Extension Instructions +# GitHub Copilot Token Tracker — Repository Instructions -This document provides instructions for AI agents to effectively contribute to the "Copilot Token Tracker" VS Code extension. +This document provides top-level guidance for AI agents contributing to this repository. Detailed, folder-specific instructions live in `.github/instructions/` and are applied automatically by Copilot when you work inside those folders. -## Architecture Overview +## Repository Structure -The entire extension's logic is contained within the `CopilotTokenTracker` class in `src/extension.ts`. Its primary function is to track GitHub Copilot token usage by reading and parsing session log files. - -- **Activation**: The extension activates on VS Code startup via the `onStartupFinished` event in `package.json`. The `activate` function in `src/extension.ts` instantiates `CopilotTokenTracker`. - -- **Data Source**: The core data comes from `.json` log files generated by the GitHub Copilot Chat extension. The `getCopilotSessionFiles` method locates these files in the user's OS-specific AppData directory for VS Code (e.g., `.../Code/User/workspaceStorage/.../chatSessions` and `.../Code/User/globalStorage/emptyWindowChatSessions`). - -- **Data Flow**: - 1. A timer in the `constructor` calls `updateTokenStats()` every 5 minutes. - 2. `updateTokenStats()` calls `calculateDetailedStats()` to aggregate data. - 3. `calculateDetailedStats()` reads all session files found by `getCopilotSessionFiles()`. - 4. For each file, it calculates token counts (`estimateTokensFromSession`), interactions (`countInteractionsInSession`), and per-model usage (`getModelUsageFromSession`). - 5. Token counts are *estimated* using character-to-token ratios defined in the `tokenEstimators` class property. This is a key convention. - -- **Thinking Token Tracking**: Models that use extended thinking (e.g., Claude) produce `kind: "thinking"` response items in session logs. These are tracked separately: - - `estimateTokensFromSession` and `estimateTokensFromJsonlSession` return `{ tokens, thinkingTokens }`. The `tokens` field is the **grand total** (input + output + thinking). The `thinkingTokens` field is a **breakdown** showing what portion of the total was thinking — it is NOT subtracted from `tokens`. - - `SessionFileCache` stores `thinkingTokens` alongside `tokens`. - - `extractResponseData` separates `responseText` and `thinkingText` so the logviewer can display them independently per turn. - - `getModelUsageFromSession` does NOT separate thinking — thinking tokens are counted as `outputTokens` in the per-model breakdown. This is intentional since it keeps cost estimation simple. - - **Critical invariant**: When computing token totals for display (per-turn, per-session, per-period), always include thinking tokens. In the logviewer, `totalTokens = input + output + thinking`. In stats aggregation, `sessionData.tokens` already includes thinking. Never subtract thinking from a total. - - `CACHE_VERSION` must be bumped when changing how tokens are counted so stale caches are invalidated. +``` +/ +├── build.ps1 ← Root build orchestrator (all projects) +├── vscode-extension/ ← VS Code extension (TypeScript / Node.js) +├── cli/ ← Command-line tool (TypeScript / Node.js) +├── visualstudio-extension/ ← Visual Studio extension (C# / .NET, planned) +├── docs/ ← Shared documentation +└── .github/ + ├── copilot-instructions.md ← This file + └── instructions/ + ├── vscode-extension.instructions.md ← VS Code extension guide + ├── cli.instructions.md ← CLI guide + ├── visualstudio-extension.instructions.md ← Visual Studio extension guide + └── workflows.instructions.md ← CI/CD workflow security guide +``` -- **OpenCode Support**: The extension also reads session data from [OpenCode](https://opencode.ai), a terminal-based coding agent. OpenCode stores its data in `~/.local/share/opencode/` (Linux/macOS) or the equivalent XDG data directory. +## Sub-project Instructions - - **Dual storage backends**: OpenCode originally stored sessions as individual JSON files under `storage/session/`, `storage/message/`, and `storage/part/`. It later migrated to a SQLite database (`opencode.db`) in the same data directory. The extension supports **both** backends — it tries the SQLite DB first and falls back to JSON files. - - **SQLite reading**: The extension uses `sql.js` (a pure JS/WASM SQLite reader, no native dependencies) to read `opencode.db`. The WASM binary (`sql-wasm.wasm`) is copied to `dist/` during the esbuild step. The sql.js module is lazy-loaded and cached in `_sqlJsModule`. - - **DB schema**: The `opencode.db` database has tables `session` (id, slug, title, directory, time_created, time_updated), `message` (id, session_id, time_created, data JSON), and `part` (id, message_id, session_id, time_created, data JSON). The `data` column in `message` contains JSON with `{role, model: {providerID, modelID}, tokens: {total, input, output, reasoning, cache: {read, write}}}`. - - **Virtual path scheme**: Since the existing architecture is file-path-based, DB-stored sessions use virtual paths of the form `/opencode.db#ses_`. Detection helpers: `isOpenCodeDbSession()` checks for the `opencode.db#ses_` pattern, `getOpenCodeSessionId()` parses both virtual paths and `ses_.json` filenames. - - **Async methods**: `getOpenCodeMessagesForSession(filePath)` and `getOpenCodePartsForMessage(messageId)` are the primary data access methods — they try DB first, fall back to JSON. The OpenCode token/interaction/model methods (`getTokensFromOpenCodeSession`, `countOpenCodeInteractions`, `getOpenCodeModelUsage`) are all async. - - **`statSessionFile()`**: A helper that resolves DB virtual paths to `fs.promises.stat()` on the `opencode.db` file itself. **All `fs.promises.stat(sessionFile)` calls in loops that process session files must use `this.statSessionFile()` instead**, to avoid failures on DB virtual paths. - - **Key invariant**: When adding new code that processes session file paths (stat calls, path splitting, folder grouping), always check `isOpenCodeDbSession()` first and handle the virtual path appropriately (use `statSessionFile()` for stats, use `getOpenCodeDataDir()` for folder grouping). +| Folder | Instructions file | +|---|---| +| `vscode-extension/` | `.github/instructions/vscode-extension.instructions.md` | +| `cli/` | `.github/instructions/cli.instructions.md` | +| `visualstudio-extension/` | `.github/instructions/visualstudio-extension.instructions.md` | +| `.github/workflows/` | `.github/instructions/workflows.instructions.md` | -- **UI Components**: - 1. **Status Bar**: A `vscode.StatusBarItem` (`statusBarItem`) shows a brief summary. Its tooltip provides more detail. - 2. **Details Panel**: The `copilot-token-tracker.showDetails` command opens a `vscode.WebviewPanel`. The content for this panel is generated dynamically as an HTML string by the `getDetailsHtml` method. +## Building Everything -## Developer Workflow +Use the root orchestrator from the repo root: -- **Setup**: Run `npm install` to install dependencies. -- **Build**: Run `npm run compile` to lint and build the extension using `esbuild`. The output is a single file: `dist/extension.js`. -- **Watch Mode**: For active development, use `npm run watch`. This will automatically recompile the extension on file changes. -- **Testing/Debugging**: Press `F5` in VS Code to open the Extension Development Host. This will launch a new VS Code window with the extension running. `console.log` statements from `src/extension.ts` will appear in the Developer Tools console of this new window (Help > Toggle Developer Tools). +```powershell +./build.ps1 # build all projects +./build.ps1 -Project vscode # build VS Code extension only +./build.ps1 -Project cli # build CLI only +./build.ps1 -Project vscode -Target test # run tests +``` -**Important build guidance:** After making changes to source code or related files (TypeScript, JavaScript, JSON, or other code files used by the extension), always run `npm run compile` to validate that the project still builds and lints cleanly before opening a pull request or releasing. You do not need to run the full compile step for documentation-only changes (Markdown files), but you should run it after any edits that touch source, configuration, or JSON data files. +Individual project builds: +```bash +cd vscode-extension && npm run compile # VS Code extension +cd cli && npm run build # CLI +``` ## Development Guidelines -- **Minimal Changes**: Only modify files that are directly needed for the actual changes being implemented. Avoid touching unrelated files, configuration files, or dependencies unless absolutely necessary for the feature or fix. -- **Focused Modifications**: Make surgical, precise changes that address the specific requirements without affecting other functionality. -- **Preserve Existing Structure**: Maintain the existing code organization and file structure. Don't refactor or reorganize code unless it's essential for the task. - -## Logging Best Practices - -**CRITICAL**: Do NOT add debug logging statements like `this.log('[DEBUG] message')` or `console.log('[DEBUG] ...')` for troubleshooting during development. This approach has been found to flood the output channel and cause messages to disappear. - -### Why DEBUG Logs Are Problematic - -**Extension Host Flooding**: When DEBUG log statements are added to frequently-called methods in `extension.ts` (e.g., cache lookups, file processing loops, webview message handlers), they can generate hundreds of log entries per operation. VS Code's OutputChannel has a buffer limit, and excessive logging causes older messages to be pushed out and lost. This was observed when: -- Cache hit/miss logging was added to session file processing -- JSONL content reference counting was logged for each file -- Webview message handlers logged every incoming message with full JSON payloads -- Session data was logged with repository counts on each webview update - -**Symptom**: After operations like clearing the cache, expected log messages would disappear from the Output panel because they were pushed out of the buffer by DEBUG logs. - -### Extension vs Webview Logging - -These are two completely separate logging systems: - -| Context | Method | Destination | Visibility | -|---------|--------|-------------|------------| -| Extension (`src/extension.ts`) | `this.log()`, `this.warn()`, `this.error()` | VS Code Output Channel | Output panel → "Copilot Token Tracker" | -| Webview (`src/webview/*/main.ts`) | `console.log()` | Browser DevTools | Help → Toggle Developer Tools in webview | - -- Clearing the output channel (`outputChannel.clear()`) does NOT affect webview console logs -- Webview console.log statements do NOT appear in the Output panel -- DEBUG prefixes in webviews were removed to maintain consistency with extension guidelines - -### Best Practices - -- **Use Existing Logs**: The extension already has comprehensive logging. Review existing log statements before adding new ones. -- **Minimal Logging**: Only add logging if absolutely necessary for a new feature. Keep messages concise. -- **Remove Debug Logs**: Any temporary debug logging added during development MUST be removed before committing. -- **Log Methods**: Use appropriate severity: - - `log(message)` - Standard informational messages - - `warn(message)` - Warnings or recoverable errors - - `error(message)` - Critical errors -- **No Debug Prefixes**: Avoid `[DEBUG]` markers. The log output is already timestamped. -- **Avoid High-Frequency Logging**: Never log inside loops that process many items (files, sessions, cache entries). - -### Debugging Without Logs - -Prefer VS Code's debugger with breakpoints rather than adding log statements: -1. Press `F5` to launch Extension Development Host -2. Set breakpoints in `src/extension.ts` -3. Use the Debug Console to inspect variables - -## Key Files & Conventions - -- **`src/extension.ts`**: The single source file containing all logic. - - `CopilotTokenTracker`: The main class. - - `calculateDetailedStats()`: The primary data aggregation method. - - `getDetailsHtml()`: The method responsible for rendering the webview's HTML content. All styling is inlined within this method's template string. -- **`src/README.md`**: **IMPORTANT**: Contains detailed instructions for updating the JSON data files. Always consult this file when updating tokenEstimators.json or modelPricing.json. It includes structure definitions, update procedures, and current pricing information. -- **`src/tokenEstimators.json`**: Character-to-token ratio estimators for different AI models. See `src/README.md` for update instructions. -- **`src/modelPricing.json`**: Model pricing data with input/output costs per million tokens. Includes metadata about pricing sources and last update date. See `src/README.md` for detailed update instructions and current pricing sources. -- **`docs/FLUENCY-LEVELS.md`**: Documents the scoring rules for the Copilot Fluency Score dashboard (4 stages, 6 categories, thresholds, and boosters). **Keep this file up to date** when changing the `calculateMaturityScores()` method in `src/extension.ts`. -- **`package.json`**: Defines activation events, commands, and build scripts. -- **`esbuild.js`**: The build script that bundles the TypeScript source and JSON data files. Also copies `sql-wasm.wasm` from `node_modules/sql.js/dist/` to `dist/` for OpenCode SQLite support. -- **`src/types/json.d.ts`**: Type declarations for JSON module imports and the `sql.js` module. +- **Minimal Changes**: Only modify files directly needed for the task. Avoid touching unrelated files. +- **Focused Modifications**: Make surgical, precise changes without affecting other functionality. +- **Preserve Existing Structure**: Don't refactor or reorganize unless essential for the task. ## Coding Agent Data Sources When running as the GitHub Copilot Coding Agent (bootstrapped via `.github/workflows/copilot-setup-steps.yml`), additional data files may be available in the workspace root. These are downloaded from Azure Storage during the agent's setup phase and are **not** present in local development. -- **`./session-logs/`**: Raw Copilot Chat session log files (last 7 days) from Azure Blob Storage. Contains full conversation history including prompts, responses, and model info. -- **`./usage-data/usage-agg-daily.json`**: Aggregated daily token usage data (last 30 days) from Azure Table Storage. Contains per-day, per-model, per-workspace token counts and interaction counts. +- **`./session-logs/`**: Raw Copilot Chat session log files (last 7 days) from Azure Blob Storage. +- **`./usage-data/usage-agg-daily.json`**: Aggregated daily token usage data (last 30 days) from Azure Table Storage. These files are only available when the repository's `copilot` GitHub environment has `COPILOT_STORAGE_ACCOUNT` configured. See the `session-log-data` skill in `.github/skills/session-log-data/SKILL.md` for data schemas, analysis examples, and cost estimation. @@ -143,84 +81,20 @@ Do not enter retry loops trying to capture terminal output. These patterns waste ### What to do instead -1. **Use `npm` scripts for standard operations.** The project defines scripts for common tasks: +1. **Use `npm` scripts for standard operations** (from inside `vscode-extension/`): - `npm run compile` — lint + build - `npm run compile-tests` — compile test files to `out/` - - `npm run test:node` — compile + run a single test file + - `npm run test:node` — compile + run unit tests - `npm run test:coverage` — compile + run tests with coverage thresholds -2. **Use `get_errors` to validate compilation.** After edits, call `get_errors` on the changed files instead of running `tsc` in the terminal. This is more reliable than parsing terminal output. +2. **Use `get_errors` to validate compilation.** After edits, call `get_errors` on the changed files instead of running `tsc` in the terminal. -3. **Run tests in small batches.** Instead of running all 25+ test files in one command, run one file at a time: +3. **Run tests in small batches.** Instead of running all test files in one command, run one file at a time: ```bash + cd vscode-extension node --require ./out/test/unit/vscode-shim-register.js --test out/test/unit/sessionParser.test.js ``` - Small commands are more likely to return output before the capture times out. - -4. **Accept a single run.** If a test command runs without returning output, do **not** re-run it. Instead, move on and note that the tests were executed but output was not captured. The user can verify locally. - -5. **Use `runTests` tool when available.** Prefer the dedicated test-runner tool over terminal commands for running tests, though note it may not support the Node.js built-in test runner (`node --test`). - -6. **Write output to the workspace (not `/tmp/`).** If you must capture output to a file, write it inside the workspace (e.g., `test-results.txt` in the repo root) where `read_file` can reliably access it. Add the file to `.gitignore` if it doesn't already match. Clean it up after reading. - -## Webview Navigation Buttons - -To maintain a consistent, VS Code-native look across all webview panels (Details, Chart, Usage Analysis, Diagnostics), use the VS Code Webview UI Toolkit for top-level navigation buttons. - -- **Use `vscode-button`**: Prefer the toolkit button component for header navigation controls instead of custom ` + + + + + + + + + + + + + + + + + + + + diff --git a/visualstudio-extension/src/CopilotTokenTracker/Data/CliBridge.cs b/visualstudio-extension/src/CopilotTokenTracker/Data/CliBridge.cs new file mode 100644 index 00000000..a8c69a18 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Data/CliBridge.cs @@ -0,0 +1,327 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text.Json; +using System.Threading.Tasks; + +namespace CopilotTokenTracker.Data +{ + /// + /// Bridges to the bundled CLI executable (copilot-token-tracker.exe) to + /// retrieve token usage stats. This avoids duplicating session discovery, parsing, + /// and aggregation logic that already lives in the shared TypeScript codebase. + /// + /// The CLI exe is a Node.js SEA (Single Executable Application) built from + /// cli/ and copied into cli-bundle/ at build time. + /// + internal static class CliBridge + { + private const string ExeName = "copilot-token-tracker.exe"; + private const int TimeoutMs = 60_000; // 60 s after the cache is warm + private const int InitialTimeoutMs = 180_000; // 3 min — first run scans all sessions + + /// + /// Set to true after the CLI has returned valid data at least once. + /// Subsequent calls use the shorter because the CLI + /// reads its own on-disk cache instead of re-scanning all sessions. + /// + private static volatile bool _hasSucceededOnce = false; + + /// Last successfully fetched stats, used to serve cached data immediately. + private static volatile DetailedStats? _cachedStats; + private static DateTime _cachedStatsAt = DateTime.MinValue; + private static readonly TimeSpan CacheTtl = TimeSpan.FromMinutes(5); + + /// + /// In-flight Task for usage --json. When a second caller arrives while + /// this is non-null, it receives the same Task instead of spawning a second process. + /// Cleared back to null once the Task completes. + /// + private static Task? _inflightUsageTask; + private static readonly object _usageLock = new object(); + + // ── Public API ───────────────────────────────────────────────────────── + + /// + /// Returns the most recently fetched stats from the in-memory cache, or + /// null if no successful fetch has completed yet. + /// + public static DetailedStats? GetCachedStats() => _cachedStats; + + /// + /// Runs the CLI usage --json command and deserializes the result + /// into a instance. + /// If a call is already in progress, returns the same Task (no duplicate process). + /// If cached data is still within , returns it immediately + /// without re-running the CLI. + /// Returns null when the CLI exe is missing or the command fails. + /// + public static Task GetUsageStatsAsync() + { + lock (_usageLock) + { + // Return fresh cached data without launching the CLI again + if (_cachedStats != null && (DateTime.UtcNow - _cachedStatsAt) < CacheTtl) + { + Utilities.OutputLogger.Log("CLI bridge: returning in-memory cached stats"); + return System.Threading.Tasks.Task.FromResult(_cachedStats); + } + + if (_inflightUsageTask != null) + { + Utilities.OutputLogger.Log("CLI bridge: usage --json already in flight, reusing existing call"); + return _inflightUsageTask; + } + + _inflightUsageTask = RunGetUsageStatsAsync(); + _ = _inflightUsageTask.ContinueWith(_ => + { + lock (_usageLock) { _inflightUsageTask = null; } + }, System.Threading.Tasks.TaskContinuationOptions.ExecuteSynchronously); + + return _inflightUsageTask; + } + } + + private static async Task RunGetUsageStatsAsync() + { + var exePath = FindCliExe(); + if (exePath == null) + { + Utilities.OutputLogger.LogWarning("CLI bridge: bundled exe not found — falling back to built-in parser"); + return null; + } + + var timeoutMs = _hasSucceededOnce ? TimeoutMs : InitialTimeoutMs; + Utilities.OutputLogger.Log($"CLI bridge: running {exePath} usage --json (timeout {timeoutMs / 1000}s)"); + + var (exitCode, stdout, stderr) = await RunProcessAsync(exePath, "usage --json", timeoutMs); + + if (exitCode != 0) + { + Utilities.OutputLogger.LogWarning($"CLI bridge: exit code {exitCode}"); + if (!string.IsNullOrWhiteSpace(stderr)) + { + Utilities.OutputLogger.LogWarning($"CLI bridge stderr: {stderr}"); + } + return null; + } + + if (string.IsNullOrWhiteSpace(stdout)) + { + Utilities.OutputLogger.LogWarning("CLI bridge: empty stdout"); + return null; + } + + try + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + }; + var result = JsonSerializer.Deserialize(stdout, options); + if (result != null) + { + _hasSucceededOnce = true; + _cachedStats = result; + _cachedStatsAt = DateTime.UtcNow; + Utilities.OutputLogger.Log("CLI bridge: stats deserialized successfully"); + } + return result; + } + catch (JsonException ex) + { + Utilities.OutputLogger.LogError("CLI bridge: JSON parse error", ex); + return null; + } + } + + /// + /// Runs the CLI chart --json command and returns the raw JSON string. + /// Returns null when the CLI exe is missing or the command fails. + /// + public static async Task GetChartDataJsonAsync() + { + var exePath = FindCliExe(); + if (exePath == null) + { + Utilities.OutputLogger.LogWarning("CLI bridge: bundled exe not found for chart"); + return null; + } + + var timeoutMs = _hasSucceededOnce ? TimeoutMs : InitialTimeoutMs; + Utilities.OutputLogger.Log($"CLI bridge: running {exePath} chart --json"); + + var (exitCode, stdout, stderr) = await RunProcessAsync(exePath, "chart --json", timeoutMs); + + if (exitCode != 0) + { + Utilities.OutputLogger.LogWarning($"CLI bridge (chart): exit code {exitCode}"); + if (!string.IsNullOrWhiteSpace(stderr)) + Utilities.OutputLogger.LogWarning($"CLI bridge (chart) stderr: {stderr}"); + return null; + } + + if (string.IsNullOrWhiteSpace(stdout)) + { + Utilities.OutputLogger.LogWarning("CLI bridge (chart): empty stdout"); + return null; + } + + Utilities.OutputLogger.Log("CLI bridge: chart data received"); + return stdout.Trim(); + } + + /// + /// Runs the CLI usage-analysis --json command and returns the raw JSON string. + /// Returns null when the CLI exe is missing or the command fails. + /// + public static async Task GetUsageAnalysisJsonAsync() + { + var exePath = FindCliExe(); + if (exePath == null) + { + Utilities.OutputLogger.LogWarning("CLI bridge: bundled exe not found for usage-analysis"); + return null; + } + + var timeoutMs = _hasSucceededOnce ? TimeoutMs : InitialTimeoutMs; + Utilities.OutputLogger.Log($"CLI bridge: running {exePath} usage-analysis --json"); + + var (exitCode, stdout, stderr) = await RunProcessAsync(exePath, "usage-analysis --json", timeoutMs); + + if (exitCode != 0) + { + Utilities.OutputLogger.LogWarning($"CLI bridge (usage-analysis): exit code {exitCode}"); + if (!string.IsNullOrWhiteSpace(stderr)) + Utilities.OutputLogger.LogWarning($"CLI bridge (usage-analysis) stderr: {stderr}"); + return null; + } + + if (string.IsNullOrWhiteSpace(stdout)) + { + Utilities.OutputLogger.LogWarning("CLI bridge (usage-analysis): empty stdout"); + return null; + } + + Utilities.OutputLogger.Log("CLI bridge: usage-analysis data received"); + return stdout.Trim(); + } + + /// + /// Runs the CLI fluency --json command and deserializes the result + /// into a instance. + /// Returns null when the CLI exe is missing or the command fails. + /// + public static async Task GetMaturityAsync() + { + var exePath = FindCliExe(); + if (exePath == null) + { + Utilities.OutputLogger.LogWarning("CLI bridge: bundled exe not found for fluency"); + return null; + } + + Utilities.OutputLogger.Log($"CLI bridge: running {exePath} fluency --json"); + + var (exitCode, stdout, stderr) = await RunProcessAsync(exePath, "fluency --json"); + + if (exitCode != 0) + { + Utilities.OutputLogger.LogWarning($"CLI bridge (fluency): exit code {exitCode}"); + if (!string.IsNullOrWhiteSpace(stderr)) + { + Utilities.OutputLogger.LogWarning($"CLI bridge (fluency) stderr: {stderr}"); + } + return null; + } + + if (string.IsNullOrWhiteSpace(stdout)) + { + Utilities.OutputLogger.LogWarning("CLI bridge (fluency): empty stdout"); + return null; + } + + try + { + var options = new JsonSerializerOptions + { + PropertyNameCaseInsensitive = true, + }; + var result = JsonSerializer.Deserialize(stdout, options); + if (result != null) + { + Utilities.OutputLogger.Log("CLI bridge: maturity data deserialized successfully"); + } + return result; + } + catch (JsonException ex) + { + Utilities.OutputLogger.LogError("CLI bridge (fluency): JSON parse error", ex); + return null; + } + } + + /// Returns true when the bundled CLI exe is available. + public static bool IsAvailable() => FindCliExe() != null; + + // ── Internals ────────────────────────────────────────────────────────── + + /// + /// Looks for the CLI exe next to this assembly (inside the VSIX install folder) + /// under the cli-bundle/ subfolder. + /// + private static string? FindCliExe() + { + var asmDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + if (asmDir == null) { return null; } + + var candidate = Path.Combine(asmDir, "cli-bundle", ExeName); + return File.Exists(candidate) ? candidate : null; + } + + /// + /// Starts a process, captures stdout and stderr, and waits up to . + /// Uses event-based output reading to avoid the classic ReadToEnd/WaitForExit deadlock. + /// + private static Task<(int ExitCode, string Stdout, string Stderr)> RunProcessAsync( + string fileName, string arguments, int timeoutMs = TimeoutMs) + { + return Task.Run(() => + { + var stdoutBuilder = new System.Text.StringBuilder(); + var stderrBuilder = new System.Text.StringBuilder(); + + using var proc = new Process(); + proc.StartInfo = new ProcessStartInfo + { + FileName = fileName, + Arguments = arguments, + UseShellExecute = false, + RedirectStandardOutput = true, + RedirectStandardError = true, + CreateNoWindow = true, + StandardOutputEncoding = System.Text.Encoding.UTF8, + StandardErrorEncoding = System.Text.Encoding.UTF8, + }; + + proc.OutputDataReceived += (_, e) => { if (e.Data != null) stdoutBuilder.AppendLine(e.Data); }; + proc.ErrorDataReceived += (_, e) => { if (e.Data != null) stderrBuilder.AppendLine(e.Data); }; + + proc.Start(); + proc.BeginOutputReadLine(); + proc.BeginErrorReadLine(); + + if (!proc.WaitForExit(timeoutMs)) + { + try { proc.Kill(); } catch { /* best effort */ } + Utilities.OutputLogger.LogWarning($"CLI bridge: process killed after {timeoutMs / 1000}s timeout"); + return (-1, string.Empty, "Process timed out"); + } + + return (proc.ExitCode, stdoutBuilder.ToString(), stderrBuilder.ToString()); + }); + } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/Data/Models.cs b/visualstudio-extension/src/CopilotTokenTracker/Data/Models.cs new file mode 100644 index 00000000..5112ea3f --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Data/Models.cs @@ -0,0 +1,269 @@ +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace CopilotTokenTracker.Data +{ + // ── Top-level payload sent to the webview ─────────────────────────────────── + + internal sealed class DetailedStats + { + [JsonPropertyName("today")] + public PeriodStats Today { get; set; } = new PeriodStats(); + + [JsonPropertyName("month")] + public PeriodStats Month { get; set; } = new PeriodStats(); + + [JsonPropertyName("lastMonth")] + public PeriodStats LastMonth { get; set; } = new PeriodStats(); + + [JsonPropertyName("last30Days")] + public PeriodStats Last30Days { get; set; } = new PeriodStats(); + + [JsonPropertyName("lastUpdated")] + public string LastUpdated { get; set; } = string.Empty; + + [JsonPropertyName("backendConfigured")] + public bool BackendConfigured { get; set; } + } + + // ── Per-period aggregated statistics ──────────────────────────────────────── + + internal sealed class PeriodStats + { + [JsonPropertyName("tokens")] + public long Tokens { get; set; } + + [JsonPropertyName("thinkingTokens")] + public long ThinkingTokens { get; set; } + + [JsonPropertyName("estimatedTokens")] + public long EstimatedTokens { get; set; } + + [JsonPropertyName("actualTokens")] + public long ActualTokens { get; set; } + + [JsonPropertyName("sessions")] + public int Sessions { get; set; } + + [JsonPropertyName("avgInteractionsPerSession")] + public double AvgInteractionsPerSession { get; set; } + + [JsonPropertyName("avgTokensPerSession")] + public double AvgTokensPerSession { get; set; } + + [JsonPropertyName("modelUsage")] + public Dictionary ModelUsage { get; set; } = new Dictionary(); + + [JsonPropertyName("editorUsage")] + public Dictionary EditorUsage { get; set; } = new Dictionary(); + + [JsonPropertyName("co2")] + public double Co2 { get; set; } + + [JsonPropertyName("treesEquivalent")] + public double TreesEquivalent { get; set; } + + [JsonPropertyName("waterUsage")] + public double WaterUsage { get; set; } + + [JsonPropertyName("estimatedCost")] + public double EstimatedCost { get; set; } + } + + // ── Per-model token breakdown ──────────────────────────────────────────────── + + internal sealed class ModelStats + { + [JsonPropertyName("inputTokens")] + public long InputTokens { get; set; } + + [JsonPropertyName("outputTokens")] + public long OutputTokens { get; set; } + } + + // ── Per-editor token breakdown ─────────────────────────────────────────────── + + internal sealed class EditorStats + { + [JsonPropertyName("tokens")] + public long Tokens { get; set; } + + [JsonPropertyName("sessions")] + public int Sessions { get; set; } + } + + // ── Environmental stats payload ────────────────────────────────────────────── + + /// + /// Projected to the environmental webview as window.__INITIAL_ENVIRONMENTAL__. + /// Fields mirror the TypeScript EnvironmentalStats type. + /// + internal sealed class EnvironmentalStats + { + [JsonPropertyName("today")] + public EnvironmentalPeriod Today { get; set; } = new EnvironmentalPeriod(); + + [JsonPropertyName("month")] + public EnvironmentalPeriod Month { get; set; } = new EnvironmentalPeriod(); + + [JsonPropertyName("lastMonth")] + public EnvironmentalPeriod LastMonth { get; set; } = new EnvironmentalPeriod(); + + [JsonPropertyName("last30Days")] + public EnvironmentalPeriod Last30Days { get; set; } = new EnvironmentalPeriod(); + + [JsonPropertyName("lastUpdated")] + public string LastUpdated { get; set; } = string.Empty; + + [JsonPropertyName("backendConfigured")] + public bool BackendConfigured { get; set; } + } + + internal sealed class EnvironmentalPeriod + { + [JsonPropertyName("tokens")] + public long Tokens { get; set; } + + [JsonPropertyName("co2")] + public double Co2 { get; set; } + + [JsonPropertyName("treesEquivalent")] + public double TreesEquivalent { get; set; } + + [JsonPropertyName("waterUsage")] + public double WaterUsage { get; set; } + } + + // ── Maturity / Fluency Score payload ──────────────────────────────────────── + + /// + /// Projected to the maturity webview as window.__INITIAL_MATURITY__. + /// Fields mirror the TypeScript MaturityData type. + /// + internal sealed class MaturityData + { + [JsonPropertyName("overallStage")] + public int OverallStage { get; set; } + + [JsonPropertyName("overallLabel")] + public string OverallLabel { get; set; } = string.Empty; + + [JsonPropertyName("categories")] + public List Categories { get; set; } = new List(); + + [JsonPropertyName("period")] + public UsageAnalysisPeriod Period { get; set; } = new UsageAnalysisPeriod(); + + [JsonPropertyName("lastUpdated")] + public string LastUpdated { get; set; } = string.Empty; + + [JsonPropertyName("backendConfigured")] + public bool BackendConfigured { get; set; } + } + + internal sealed class CategoryScore + { + [JsonPropertyName("category")] + public string Category { get; set; } = string.Empty; + + [JsonPropertyName("icon")] + public string Icon { get; set; } = string.Empty; + + [JsonPropertyName("stage")] + public int Stage { get; set; } + + [JsonPropertyName("evidence")] + public List Evidence { get; set; } = new List(); + + [JsonPropertyName("tips")] + public List Tips { get; set; } = new List(); + } + + /// + /// Minimal representation of UsageAnalysisPeriod needed by the maturity webview. + /// Only the fields rendered by the webview are included. + /// + internal sealed class UsageAnalysisPeriod + { + [JsonPropertyName("sessions")] + public int Sessions { get; set; } + + [JsonPropertyName("modeUsage")] + public ModeUsage ModeUsage { get; set; } = new ModeUsage(); + + [JsonPropertyName("toolCalls")] + public ToolCallUsage ToolCalls { get; set; } = new ToolCallUsage(); + + [JsonPropertyName("mcpTools")] + public McpToolUsage McpTools { get; set; } = new McpToolUsage(); + + [JsonPropertyName("contextReferences")] + public ContextReferenceUsage ContextReferences { get; set; } = new ContextReferenceUsage(); + + [JsonPropertyName("repositories")] + public List Repositories { get; set; } = new List(); + + [JsonPropertyName("repositoriesWithCustomization")] + public List RepositoriesWithCustomization { get; set; } = new List(); + } + + internal sealed class ModeUsage + { + [JsonPropertyName("ask")] + public int Ask { get; set; } + + [JsonPropertyName("edit")] + public int Edit { get; set; } + + [JsonPropertyName("agent")] + public int Agent { get; set; } + + [JsonPropertyName("plan")] + public int Plan { get; set; } + + [JsonPropertyName("customAgent")] + public int CustomAgent { get; set; } + } + + internal sealed class ToolCallUsage + { + [JsonPropertyName("total")] + public int Total { get; set; } + + [JsonPropertyName("byTool")] + public Dictionary ByTool { get; set; } = new Dictionary(); + } + + internal sealed class McpToolUsage + { + [JsonPropertyName("total")] + public int Total { get; set; } + + [JsonPropertyName("byServer")] + public Dictionary ByServer { get; set; } = new Dictionary(); + + [JsonPropertyName("byTool")] + public Dictionary ByTool { get; set; } = new Dictionary(); + } + + internal sealed class ContextReferenceUsage + { + [JsonPropertyName("file")] + public int File { get; set; } + + [JsonPropertyName("selection")] + public int Selection { get; set; } + + [JsonPropertyName("codebase")] + public int Codebase { get; set; } + + [JsonPropertyName("workspace")] + public int Workspace { get; set; } + + [JsonPropertyName("terminal")] + public int Terminal { get; set; } + + [JsonPropertyName("vscode")] + public int Vscode { get; set; } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/Data/StatsBuilder.cs b/visualstudio-extension/src/CopilotTokenTracker/Data/StatsBuilder.cs new file mode 100644 index 00000000..f1197e3a --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Data/StatsBuilder.cs @@ -0,0 +1,75 @@ +using System; +using System.Threading.Tasks; + +namespace CopilotTokenTracker.Data +{ + /// + /// Delegates token usage stats to the bundled CLI executable. + /// All session discovery, parsing, and aggregation live in the shared TypeScript codebase. + /// + internal static class StatsBuilder + { + public static async Task BuildAsync() + { + var stats = await CliBridge.GetUsageStatsAsync(); + if (stats != null) { return stats; } + + Utilities.OutputLogger.LogWarning("CLI bridge returned no data — is the bundled CLI exe present?"); + return null; + } + + /// + /// Builds the payload for the environmental view + /// by mapping the period-level co2/water/tree data from the usage stats. + /// + public static async Task BuildEnvironmentalAsync() + { + var usage = await BuildAsync(); + if (usage == null) + { + return new EnvironmentalStats + { + LastUpdated = DateTime.UtcNow.ToString("o"), + }; + } + return new EnvironmentalStats + { + LastUpdated = usage.LastUpdated, + BackendConfigured = usage.BackendConfigured, + Today = MapEnvironmentalPeriod(usage.Today), + Month = MapEnvironmentalPeriod(usage.Month), + LastMonth = MapEnvironmentalPeriod(usage.LastMonth), + Last30Days = MapEnvironmentalPeriod(usage.Last30Days), + }; + } + + /// + /// Builds the payload for the maturity/fluency-score view + /// by calling the CLI fluency --json command. + /// + public static async Task BuildMaturityAsync() + { + var maturity = await CliBridge.GetMaturityAsync(); + if (maturity != null) { return maturity; } + + Utilities.OutputLogger.LogWarning("Fluency data unavailable — returning empty maturity data"); + return new MaturityData + { + OverallStage = 1, + OverallLabel = "Stage 1: Copilot Skeptic", + LastUpdated = DateTime.UtcNow.ToString("o"), + }; + } + + // ── Helpers ────────────────────────────────────────────────────────────── + + private static EnvironmentalPeriod MapEnvironmentalPeriod(PeriodStats p) + => new EnvironmentalPeriod + { + Tokens = p.Tokens, + Co2 = p.Co2, + TreesEquivalent = p.TreesEquivalent, + WaterUsage = p.WaterUsage, + }; + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/Properties/AssemblyInfo.cs b/visualstudio-extension/src/CopilotTokenTracker/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..8f59948b --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Properties/AssemblyInfo.cs @@ -0,0 +1,16 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("CopilotTokenTracker")] +[assembly: AssemblyDescription("Shows GitHub Copilot token usage statistics inside Visual Studio.")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("RobBos")] +[assembly: AssemblyProduct("CopilotTokenTracker")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/visualstudio-extension/src/CopilotTokenTracker/Properties/Settings.Designer.cs b/visualstudio-extension/src/CopilotTokenTracker/Properties/Settings.Designer.cs new file mode 100644 index 00000000..eea8421b --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace CopilotTokenTracker.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "18.4.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/Properties/Settings.settings b/visualstudio-extension/src/CopilotTokenTracker/Properties/Settings.settings new file mode 100644 index 00000000..049245f4 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Properties/Settings.settings @@ -0,0 +1,6 @@ + + + + + + diff --git a/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerControl.xaml b/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerControl.xaml new file mode 100644 index 00000000..60a9933f --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerControl.xaml @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerControl.xaml.cs b/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerControl.xaml.cs new file mode 100644 index 00000000..8fb548c0 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerControl.xaml.cs @@ -0,0 +1,324 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Text.Json; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using CopilotTokenTracker.Data; +using CopilotTokenTracker.WebBridge; +using Microsoft.VisualStudio.Shell; +using Microsoft.Web.WebView2.Core; + +namespace CopilotTokenTracker.ToolWindow +{ + public partial class TokenTrackerControl : UserControl + { + private bool _webViewReady; + private string _currentView = "details"; + + /// + /// Last rendered HTML per view name. Populated by ; + /// served instantly on navigation so the user never waits for a redundant CLI call. + /// + private readonly Dictionary _viewHtmlCache = new Dictionary(); + + public TokenTrackerControl() + { + InitializeComponent(); + Loaded += OnLoaded; + } + + // ── Initialisation ────────────────────────────────────────────────────── + + private void OnLoaded(object sender, RoutedEventArgs e) + { + Loaded -= OnLoaded; + // Use JoinableTaskFactory.RunAsync (VS threading best practice, avoids VSTHRD100/VSTHRD001) + _ = ThreadHelper.JoinableTaskFactory.RunAsync(async () => + { + try { await InitWebViewAsync(); } + catch (Exception ex) { FallbackText.Text = $"WebView2 initialisation failed:\n{ex.Message}"; } + }); + } + + private async Task InitWebViewAsync() + { + try + { + // Use a writable user-data folder so WebView2 works inside the + // VS experimental instance (the default location is often denied). + var userDataFolder = Path.Combine( + Path.GetTempPath(), + "CopilotTokenTracker-WebView2"); + var env = await CoreWebView2Environment.CreateAsync( + userDataFolder: userDataFolder); + + await WebView.EnsureCoreWebView2Async(env); + + // Disable unnecessary browser chrome + WebView.CoreWebView2.Settings.IsStatusBarEnabled = false; + WebView.CoreWebView2.Settings.AreDefaultContextMenusEnabled = false; + WebView.CoreWebView2.Settings.AreDevToolsEnabled = true; // useful while developing + + // Map virtual host → folder containing the bundled .js files + var webviewDir = Path.Combine( + Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, + "webview"); + + if (Directory.Exists(webviewDir)) + { + WebView.CoreWebView2.SetVirtualHostNameToFolderMapping( + "copilot-tracker.local", + webviewDir, + CoreWebView2HostResourceAccessKind.Allow); + } + + // Handle navigation commands posted by JS (e.g. tab switches) + WebView.CoreWebView2.WebMessageReceived += OnWebMessageReceived; + + _webViewReady = true; + WebView.Visibility = Visibility.Visible; + FallbackText.Visibility = Visibility.Collapsed; + + await RefreshAsync(); + } + catch (Exception ex) + { + FallbackText.Text = $"WebView2 initialisation failed:\n{ex.Message}\n\n" + + "Make sure the WebView2 Runtime is installed."; + } + } + + // ── Public API ───────────────────────────────────────────────────────── + + public async Task RefreshAsync() + { + if (!_webViewReady) { return; } + + Utilities.OutputLogger.Log($"Loading view: {_currentView}"); + + // Show a text overlay while data is loading. We deliberately avoid + // calling NavigateToString here so we don't trigger a navigation that + // immediately gets cancelled, which leaves WebView2 in a black state. + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + FallbackText.Text = "Loading…"; + FallbackText.Visibility = Visibility.Visible; + + try + { + var statsJson = await FetchStatsJsonAsync(_currentView); + var html = ThemedHtmlBuilder.Build(_currentView, statsJson); + + // Store in cache so subsequent navigations to this view are instant + _viewHtmlCache[_currentView] = html; + + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + WebView.CoreWebView2.NavigateToString(html); + FallbackText.Visibility = Visibility.Collapsed; + Utilities.OutputLogger.Log($"View loaded: {_currentView}"); + } + catch (Exception ex) + { + Utilities.OutputLogger.LogError($"RefreshAsync: failed to load view '{_currentView}'", ex); + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + FallbackText.Text = $"Error loading token data:\n{ex.Message}"; + } + } + + /// + /// Resets the current view back to the default (details) and refreshes. + /// Use this when a view is stuck or rendering incorrectly. + /// + public async Task ResetViewAsync() + { + Utilities.OutputLogger.Log($"Resetting view (was: {_currentView}) → details"); + _viewHtmlCache.Clear(); // discard all cached HTML so next navigation fetches fresh data + _currentView = "details"; + await RefreshAsync(); + } + + // ── Data fetching ────────────────────────────────────────────────────── + + private static async Task FetchStatsJsonAsync(string view) + { + var serOpts = new JsonSerializerOptions { PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; + + switch (view) + { + case "chart": + { + var raw = await CliBridge.GetChartDataJsonAsync(); + if (!string.IsNullOrWhiteSpace(raw)) { return raw!; } + // Fallback: empty chart payload + return JsonSerializer.Serialize(new + { + labels = Array.Empty(), + tokensData = Array.Empty(), + sessionsData = Array.Empty(), + modelDatasets = Array.Empty(), + editorDatasets = Array.Empty(), + editorTotalsMap = new { }, + repositoryDatasets = Array.Empty(), + repositoryTotalsMap = new { }, + dailyCount = 0, + totalTokens = 0, + avgTokensPerDay = 0, + totalSessions = 0, + lastUpdated = DateTime.UtcNow.ToString("o"), + backendConfigured = false, + }, serOpts); + } + case "usage": + { + var raw = await CliBridge.GetUsageAnalysisJsonAsync(); + if (!string.IsNullOrWhiteSpace(raw)) { return raw!; } + // Fallback: empty usage payload + return JsonSerializer.Serialize(new + { + today = new { }, + last30Days = new { }, + month = new { }, + locale = "en-US", + lastUpdated = DateTime.UtcNow.ToString("o"), + backendConfigured = false, + }, serOpts); + } + case "environmental": + { + var envStats = await StatsBuilder.BuildEnvironmentalAsync(); + return JsonSerializer.Serialize(envStats, serOpts); + } + case "maturity": + { + var maturity = await StatsBuilder.BuildMaturityAsync(); + return JsonSerializer.Serialize(maturity, serOpts); + } + default: + { + var stats = await StatsBuilder.BuildAsync() ?? new DetailedStats + { + LastUpdated = DateTime.UtcNow.ToString("o"), + }; + return JsonSerializer.Serialize(stats, serOpts); + } + } + } + + // ── Loading overlay & navigation ────────────────────────────────────── + + /// + /// Injects a full-page spinner overlay into the currently visible WebView page. + /// The overlay disappears naturally when NavigateToString replaces the page. + /// + private async Task ShowLoadingOverlayAsync() + { + if (!_webViewReady) { return; } + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + await WebView.CoreWebView2.ExecuteScriptAsync( + "(function(){" + + " if(document.getElementById('__vs-loading-overlay__')){return;}" + + " var s=document.createElement('style');" + + " s.textContent='@keyframes __vs-spin__{to{transform:rotate(360deg)}}';" + + " document.head.appendChild(s);" + + " var o=document.createElement('div');" + + " o.id='__vs-loading-overlay__';" + + " o.style.cssText='position:fixed;inset:0;background:rgba(20,20,20,0.82);display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:99999;pointer-events:none;';" + + " o.innerHTML='
" + + "
Loading\u2026
';" + + " document.body.appendChild(o);" + + "})();"); + } + + /// Shows loading overlay, changes the current view, then refreshes. + private async Task NavigateToViewAsync(string view) + { + _currentView = view; + + // If we have cached HTML for this view, render it instantly without hitting the CLI + if (_viewHtmlCache.TryGetValue(view, out var cachedHtml)) + { + Utilities.OutputLogger.Log($"Serving cached HTML for view: {view}"); + await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); + WebView.CoreWebView2.NavigateToString(cachedHtml); + return; + } + + // First visit — show spinner and fetch fresh data + await ShowLoadingOverlayAsync(); + await RefreshAsync(); + } + + // ── Incoming messages from JS ────────────────────────────────────────── + + private void OnWebMessageReceived(object? sender, CoreWebView2WebMessageReceivedEventArgs e) + { + try + { + using var doc = JsonDocument.Parse(e.WebMessageAsJson); + var root = doc.RootElement; + + if (!root.TryGetProperty("command", out var cmdProp)) { return; } + + _ = ThreadHelper.JoinableTaskFactory.RunAsync(async () => + { + var cmd = cmdProp.GetString(); + Utilities.OutputLogger.Log($"WebMessage received: {cmd} (current view: {_currentView})"); + + switch (cmd) + { + case "refresh": + await RefreshAsync(); + break; + + case "showDetails": + await NavigateToViewAsync("details"); + break; + + case "showChart": + await NavigateToViewAsync("chart"); + break; + + case "showUsageAnalysis": + await NavigateToViewAsync("usage"); + break; + + case "showDiagnostics": + // Diagnostics view is not supported in Visual Studio — redirect to details + Utilities.OutputLogger.LogWarning("Diagnostics view is not supported in Visual Studio; redirecting to details"); + await NavigateToViewAsync("details"); + break; + + case "showEnvironmental": + await NavigateToViewAsync("environmental"); + break; + + case "showMaturity": + await NavigateToViewAsync("maturity"); + break; + + case "showDashboard": + // Dashboard view not yet implemented — fall back to details + await NavigateToViewAsync("details"); + break; + + case "jsError": + { + var jsMsg = root.TryGetProperty("message", out var jsMsgProp) ? jsMsgProp.GetString() : "(no message)"; + var jsSrc = root.TryGetProperty("source", out var jsSrcProp) ? jsSrcProp.GetString() : ""; + var jsLine = root.TryGetProperty("line", out var jsLineProp) ? jsLineProp.GetInt32() : 0; + Utilities.OutputLogger.LogError($"WebView JS error in view '{_currentView}': {jsMsg} at {jsSrc}:{jsLine}"); + break; + } + + default: + Utilities.OutputLogger.LogWarning($"Unknown WebMessage command: {cmd}"); + break; + } + }); + } + catch (Exception parseEx) { Utilities.OutputLogger.LogWarning($"OnWebMessageReceived: malformed message — {parseEx.Message}"); } + } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerToolWindow.cs b/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerToolWindow.cs new file mode 100644 index 00000000..b6188437 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/ToolWindow/TokenTrackerToolWindow.cs @@ -0,0 +1,47 @@ +using System; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Microsoft.VisualStudio.Shell; + +namespace CopilotTokenTracker.ToolWindow +{ + /// + /// The "Copilot Token Tracker" tool window that hosts the WebView2-based dashboard. + /// + [Guid(ToolWindowGuidString)] + public sealed class TokenTrackerToolWindow : ToolWindowPane + { + public const string ToolWindowGuidString = "A2B3C4D5-E6F7-A8B9-C0D1-E2F3A4B5C6D7"; + + private TokenTrackerControl? _control; + + public TokenTrackerToolWindow() : base(null) + { + Caption = "Copilot Token Tracker"; + } + + protected override void OnCreate() + { + base.OnCreate(); + _control = new TokenTrackerControl(); + Content = _control; + } + + /// Triggers a data refresh of the embedded webview. + public Task RefreshAsync() + { + if (_control == null) { return Task.CompletedTask; } + return _control.RefreshAsync(); + } + + /// + /// Resets the current view to the default (details) and refreshes. + /// Use this when a view is stuck or rendering incorrectly. + /// + public Task ResetViewAsync() + { + if (_control == null) { return Task.CompletedTask; } + return _control.ResetViewAsync(); + } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/Utilities/OutputLogger.cs b/visualstudio-extension/src/CopilotTokenTracker/Utilities/OutputLogger.cs new file mode 100644 index 00000000..2df333d5 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/Utilities/OutputLogger.cs @@ -0,0 +1,87 @@ +using System; +using Microsoft.VisualStudio; +using Microsoft.VisualStudio.Shell; +using Microsoft.VisualStudio.Shell.Interop; + +namespace CopilotTokenTracker.Utilities +{ + /// + /// Writes log messages to a custom pane in Visual Studio's Output window. + /// + public static class OutputLogger + { + private static IVsOutputWindowPane? _pane; + private static readonly Guid PaneGuid = new Guid("A1B2C3D4-5E6F-7A8B-9C0D-1E2F3A4B5C6D"); + private const string PaneName = "Copilot Token Tracker"; + + /// + /// Initializes the output pane. Call this during package initialization. + /// + public static void Initialize(IServiceProvider serviceProvider) + { + ThreadHelper.ThrowIfNotOnUIThread(); + + if (_pane != null) return; + + var outputWindow = serviceProvider.GetService(typeof(SVsOutputWindow)) as IVsOutputWindow; + if (outputWindow == null) + { + return; + } + + // Try to get existing pane or create a new one + Guid paneGuid = PaneGuid; + int hr = outputWindow.GetPane(ref paneGuid, out _pane); + if (ErrorHandler.Failed(hr) || _pane == null) + { + paneGuid = PaneGuid; + outputWindow.CreatePane(ref paneGuid, PaneName, fInitVisible: 1, fClearWithSolution: 0); + paneGuid = PaneGuid; + outputWindow.GetPane(ref paneGuid, out _pane); + } + + _pane?.Activate(); + } + + /// + /// Logs an informational message to the output pane. + /// Thread-safe: can be called from any thread. + /// + public static void Log(string message) + { + WriteToPane($"[{DateTime.Now:HH:mm:ss}] {message}"); + } + + /// + /// Logs an error message to the output pane. + /// Thread-safe: can be called from any thread. + /// + public static void LogError(string message, Exception? ex = null) + { + var errorMsg = ex != null ? $"{message}: {ex.Message}" : message; + WriteToPane($"[{DateTime.Now:HH:mm:ss}] ERROR: {errorMsg}"); + } + + /// + /// Logs a warning message to the output pane. + /// Thread-safe: can be called from any thread. + /// + public static void LogWarning(string message) + { + WriteToPane($"[{DateTime.Now:HH:mm:ss}] WARNING: {message}"); + } + + private static void WriteToPane(string message) + { + try + { + // OutputStringThreadSafe is already thread-safe, but we need to ensure _pane is not null + _pane?.OutputStringThreadSafe(message + Environment.NewLine); + } + catch + { + // Silently fail if logging doesn't work - don't break the extension + } + } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/WebBridge/ThemedHtmlBuilder.cs b/visualstudio-extension/src/CopilotTokenTracker/WebBridge/ThemedHtmlBuilder.cs new file mode 100644 index 00000000..3184859f --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/WebBridge/ThemedHtmlBuilder.cs @@ -0,0 +1,365 @@ +using System; +using System.IO; +using System.Net; +using System.Reflection; + +namespace CopilotTokenTracker.WebBridge +{ + /// + /// Builds the full HTML page that hosts a compiled webview bundle. + /// + /// Layout injected before the bundle script: + /// <style> — VS theme colours mapped to --vscode-* CSS variables + /// <script> — vscode-shim.js (acquireVsCodeApi + WebView2 relay) + /// <script> — window.__INITIAL_{VIEW}__ = <statsJson>; + /// + /// The bundle is loaded from the virtual-host mapping: + /// https://copilot-tracker.local/{view}.js + /// (mapped by TokenTrackerControl to the local webview/ install folder) + /// + internal static class ThemedHtmlBuilder + { + // ── Public API ───────────────────────────────────────────────────────── + + /// + /// Returns a complete HTML document for . + /// + /// must already be a serialised JSON string. + /// + public static string Build(string view, string statsJson) + { + var shim = LoadShim(); + var themeCss = BuildThemeCss(); + var globalKey = ViewToGlobalKey(view); + var vsHideJs = BuildVsHideScript(view); + + // Prevent injection in the JSON payload (OWASP XSS defence) + var safeJson = statsJson.Replace("<", "\\u003c").Replace(">", "\\u003e"); + + return $@" + + + + + + + + + +
+ +{vsHideJs} + +"; + } + + /// + /// Returns a small inline script that hides VS-unsupported sections after the + /// bundle has rendered them into the DOM. Uses a MutationObserver so it still + /// works even when the bundle renders asynchronously. + /// + private static string BuildVsHideScript(string view) + { + if (view == "maturity") { return BuildVsHideScriptMaturity(); } + if (view != "usage") { return string.Empty; } + + // Hide the Customization Files section, the Missed Potential section, and the + // Repository Hygiene section — none of which have data in Visual Studio. + return @""; + } + + /// + /// Returns a JS block for the maturity view that rewrites VS Code-specific MCP + /// registry links to IDE-neutral GitHub Copilot docs links. + /// + private static string BuildVsHideScriptMaturity() + { + // Replace "VS Code MCP registry" anchor text/hrefs with the GitHub Copilot MCP docs. + // Done via MutationObserver so it runs after the bundle renders asynchronously. + return @""; + } + public static string BuildLoadingHtml(string view) + { + var themeCss = BuildThemeCss(); + return $@" + + + + + + + +
+
+
Loading Copilot usage data…
+
+ +"; + } + + /// + /// Returns a lightweight HTML page that displays an error message when data + /// could not be loaded. + /// + public static string BuildErrorHtml(string message) + { + var themeCss = BuildThemeCss(); + var safeMsg = WebUtility.HtmlEncode(message); + return $@" + + + + + + + +
+
+
Error loading Copilot usage data
+
{safeMsg}
+
+ +"; + } + + // ── Private helpers ──────────────────────────────────────────────────── + + private static string ViewToGlobalKey(string view) + => view switch + { + "details" => "__INITIAL_DETAILS__", + "chart" => "__INITIAL_CHART__", + "usage" => "__INITIAL_USAGE__", + "diagnostics" => "__INITIAL_DIAGNOSTICS__", + "environmental" => "__INITIAL_ENVIRONMENTAL__", + "maturity" => "__INITIAL_MATURITY__", + _ => "__INITIAL_DETAILS__", + }; + + private static string LoadShim() + { + var asm = Assembly.GetExecutingAssembly(); + // Resource name = default namespace + relative path with '.' separators + using var stream = asm.GetManifestResourceStream( + "CopilotTokenTracker.WebBridge.vscode-shim.js"); + + if (stream == null) { return "/* vscode-shim.js not found */"; } + + using var reader = new StreamReader(stream); + return reader.ReadToEnd(); + } + + // ── Theme CSS ────────────────────────────────────────────────────────── + + private static string BuildThemeCss() + { + // Attempt to read VS environment colours via the PlatformUI API. + // Fall back to sensible dark-theme defaults on any failure. + var bg = TryGetVsColor( + Microsoft.VisualStudio.PlatformUI.EnvironmentColors.ToolWindowBackgroundColorKey, + "#1e1e1e"); + var fg = TryGetVsColor( + Microsoft.VisualStudio.PlatformUI.EnvironmentColors.ToolWindowTextColorKey, + "#d4d4d4"); + var sidebarBg = TryGetVsColor( + Microsoft.VisualStudio.PlatformUI.EnvironmentColors.EnvironmentBackgroundColorKey, + "#252526"); + var border = TryGetVsColor( + Microsoft.VisualStudio.PlatformUI.EnvironmentColors.PanelBorderColorKey, + "#3f3f46"); + var btnBg = TryGetVsColor( + Microsoft.VisualStudio.PlatformUI.EnvironmentColors.CommandBarMouseOverBackgroundBeginColorKey, + "#0e639c"); + + return $@":root {{ + --vscode-editor-background: {bg}; + --vscode-editor-foreground: {fg}; + --vscode-sideBar-background: {sidebarBg}; + --vscode-editorWidget-background: {sidebarBg}; + --vscode-descriptionForeground: #808080; + --vscode-disabledForeground: #6b6b6b; + --vscode-panel-border: {border}; + --vscode-widget-border: {border}; + --vscode-button-background: {btnBg}; + --vscode-button-foreground: #ffffff; + --vscode-button-hoverBackground: #1177bb; + --vscode-button-secondaryBackground: #3a3d41; + --vscode-button-secondaryForeground: {fg}; + --vscode-button-secondaryHoverBackground:#45494e; + --vscode-badge-background: {btnBg}; + --vscode-badge-foreground: #ffffff; + --vscode-focusBorder: {btnBg}; + --vscode-list-hoverBackground: #2a2d2e; + --vscode-list-activeSelectionBackground: #094771; + --vscode-list-activeSelectionForeground: #ffffff; + --vscode-textLink-foreground: #4fc3f7; + --vscode-textLink-activeForeground: #4fc3f7; + --vscode-charts-foreground: {fg}; + --vscode-charts-lines: {border}; + --vscode-charts-red: #f48771; + --vscode-charts-blue: #75beff; + --vscode-charts-yellow: #cca700; + --vscode-charts-orange: #d18616; + --vscode-charts-green: #89d185; + --vscode-charts-purple: #b180d7; +}}"; + } + + /// + /// Queries the VS theme service for a colour, returns on failure. + /// Must be called on the UI thread (or will simply fall back). + /// + private static string TryGetVsColor(Microsoft.VisualStudio.Shell.ThemeResourceKey colorKey, string fallback) + { + try + { + var color = Microsoft.VisualStudio.PlatformUI.VSColorTheme.GetThemedColor(colorKey); + return $"#{color.R:X2}{color.G:X2}{color.B:X2}"; + } + catch + { + return fallback; + } + } + } +} diff --git a/visualstudio-extension/src/CopilotTokenTracker/WebBridge/vscode-shim.js b/visualstudio-extension/src/CopilotTokenTracker/WebBridge/vscode-shim.js new file mode 100644 index 00000000..e196462e --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/WebBridge/vscode-shim.js @@ -0,0 +1,84 @@ +/** + * VS Code API compatibility shim for WebView2 (Visual Studio extension). + * + * This script is injected as an EmbeddedResource and emitted into every HTML + * page before any webview bundle script runs. It provides: + * + * 1. acquireVsCodeApi() — returns a vscode-like object whose postMessage() + * forwards to window.chrome.webview.postMessage() so the host receives it. + * + * 2. Relay of host→webview messages arriving on window.chrome.webview as + * standard window 'message' events, which is what the existing bundle + * listeners (window.addEventListener('message', …)) already expect. + * + * The shim must be idempotent (safe to run more than once without side-effects). + */ +(function (global) { + 'use strict'; + + if (global._vsCodeApiAcquired) { return; } + global._vsCodeApiAcquired = true; + + var _state = {}; + var _vsApi = null; + + // ── acquireVsCodeApi ────────────────────────────────────────────────────── + + global.acquireVsCodeApi = function acquireVsCodeApi() { + if (_vsApi) { return _vsApi; } + + _vsApi = { + /** + * Posts a message to the .NET host. + * Pass the value directly — WebView2 serialises objects to JSON so the + * host receives a proper JSON object via WebMessageAsJson. + * Pre-stringifying would cause double-encoding (the host would see a + * JSON string instead of a JSON object and postMessage routing would fail). + */ + postMessage: function (msg) { + if (global.chrome && global.chrome.webview) { + global.chrome.webview.postMessage(msg); + } + }, + + setState: function (newState) { + _state = newState || {}; + }, + + getState: function () { + return _state; + }, + }; + + return _vsApi; + }; + + // ── Host → webview message relay ───────────────────────────────────────── + + function setupWebViewRelay() { + if (!global.chrome || !global.chrome.webview) { return; } + + global.chrome.webview.addEventListener('message', function (event) { + var data = event.data; + + // WebView2 delivers messages as strings by default. Parse JSON + // so listeners receive an object, matching VS Code extension behaviour. + if (typeof data === 'string') { + try { data = JSON.parse(data); } catch (_) { /* leave as string */ } + } + + global.dispatchEvent(new MessageEvent('message', { data: data })); + }); + } + + // The WebView2 chrome object may not be present during unit testing + // (e.g. in a plain browser), so guard the relay setup. + if (global.chrome && global.chrome.webview) { + setupWebViewRelay(); + } else { + // Retry once the page finishes loading, in case chrome.webview is + // not yet available when this script first runs. + global.addEventListener('load', setupWebViewRelay, { once: true }); + } + +}(window)); diff --git a/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.dgspec.json b/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.dgspec.json new file mode 100644 index 00000000..6483fc02 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.dgspec.json @@ -0,0 +1,96 @@ +{ + "format": 1, + "restore": { + "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj": {} + }, + "projects": { + "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj", + "projectName": "CopilotTokenTracker", + "projectPath": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj", + "packagesPath": "C:\\Users\\RobBos\\.nuget\\packages\\", + "outputPath": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\obj\\", + "projectStyle": "PackageReference", + "skipContentFileWrite": true, + "UsingMicrosoftNETSdk": false, + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\RobBos\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net472" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net472": { + "projectReferences": {} + } + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net472": { + "dependencies": { + "Microsoft.VSSDK.BuildTools": { + "target": "Package", + "version": "[17.6.2164, )", + "noWarn": [ + "NU1604" + ] + }, + "Microsoft.VisualStudio.SDK": { + "include": "Compile, Build, Native, ContentFiles, Analyzers, BuildTransitive", + "target": "Package", + "version": "[17.6.36389, )", + "noWarn": [ + "NU1604" + ] + }, + "Microsoft.Web.WebView2": { + "target": "Package", + "version": "[1.0.2478.35, )" + }, + "Newtonsoft.Json": { + "target": "Package", + "version": "[13.0.3, )" + }, + "System.Text.Json": { + "target": "Package", + "version": "[8.0.5, )" + } + } + } + }, + "runtimes": { + "win": { + "#import": [] + }, + "win-arm": { + "#import": [] + }, + "win-arm64": { + "#import": [] + }, + "win-x64": { + "#import": [] + }, + "win-x86": { + "#import": [] + } + } + } + } +} \ No newline at end of file diff --git a/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.g.props b/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.g.props new file mode 100644 index 00000000..a6048d03 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.g.props @@ -0,0 +1,31 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + $(UserProfile)\.nuget\packages\ + C:\Users\RobBos\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages + PackageReference + 7.0.0 + + + + + + + + + + + + C:\Users\RobBos\.nuget\packages\microsoft.visualstudio.threading.analyzers\17.6.40 + C:\Users\RobBos\.nuget\packages\microsoft.web.webview2\1.0.2478.35 + C:\Users\RobBos\.nuget\packages\microsoft.vssdk.compatibilityanalyzer\17.6.2164 + C:\Users\RobBos\.nuget\packages\microsoft.codeanalysis.bannedapianalyzers\3.3.2 + C:\Users\RobBos\.nuget\packages\microsoft.visualstudio.sdk.analyzers\16.10.10 + C:\Users\RobBos\.nuget\packages\microsoft.vssdk.buildtools\17.6.2164 + C:\Users\RobBos\.nuget\packages\microsoft.visualstudio.composition.analyzers\17.6.17 + C:\Users\RobBos\.nuget\packages\microsoft.servicehub.analyzers\4.2.102 + + \ No newline at end of file diff --git a/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.g.targets b/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.g.targets new file mode 100644 index 00000000..5b23f794 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/obj/CopilotTokenTracker.csproj.nuget.g.targets @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/visualstudio-extension/src/CopilotTokenTracker/obj/project.assets.json b/visualstudio-extension/src/CopilotTokenTracker/obj/project.assets.json new file mode 100644 index 00000000..f50684fe --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/obj/project.assets.json @@ -0,0 +1,18277 @@ +{ + "version": 3, + "targets": { + ".NETFramework,Version=v4.7.2": { + "envdte/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90a/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90a.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "MessagePack/2.5.108": { + "type": "package", + "dependencies": { + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.NET.StringTools": "17.4.0", + "System.Collections.Immutable": "6.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/netstandard2.0/MessagePack.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "MessagePack.Annotations/2.5.108": { + "type": "package", + "compile": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "type": "package", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "Microsoft.Build.Framework/17.6.3": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.2.2146", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/Microsoft.Build.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "type": "package", + "build": { + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props": {}, + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets": {} + } + }, + "Microsoft.CSharp/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "Microsoft.IO.Redist/6.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.IO.Redist.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "type": "package" + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.VisualStudio.Composition": "17.4.16", + "Microsoft.VisualStudio.Threading": "17.6.40", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.ServiceHub.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "type": "package", + "compile": { + "lib/net472/Microsoft.ServiceHub.Resources.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CommandBars.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Validation": "17.0.71", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Composition.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "type": "package" + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Threading": "17.6.40", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Shell.15.0": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.6.11" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Editor.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.GraphModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "StreamJsonRpc": "2.15.26", + "System.ComponentModel.Composition": "7.0.0", + "System.Private.Uri": "4.3.2" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Text.Logic": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.ComponentModelHost": "17.6.252", + "Microsoft.VisualStudio.CoreUtility": "17.6.252", + "Microsoft.VisualStudio.ImageCatalog": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.28", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Framework": "4.2.100", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.CommandBars": "17.6.36389", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Debugger.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.14.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.15.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.16.0": "17.6.36389", + "Microsoft.VisualStudio.Designer.Interfaces": "17.6.36389", + "Microsoft.VisualStudio.Editor": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Language.Intellisense": "17.6.268", + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces": "17.6.268", + "Microsoft.VisualStudio.Language.StandardClassification": "17.6.268", + "Microsoft.VisualStudio.LanguageServer.Client": "17.6.42", + "Microsoft.VisualStudio.OLE.Interop": "17.6.36389", + "Microsoft.VisualStudio.Package.LanguageService.15.0": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Design": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0": "14.0.0", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.TextManager.Interop": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TextTemplating.VSHost": "17.6.36389", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.VCProjectEngine": "17.6.36389", + "Microsoft.VisualStudio.VSHelp": "17.6.36389", + "Microsoft.VisualStudio.VSHelp80": "17.6.36389", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.VisualStudio.WCFReference.Interop": "17.6.36389", + "Microsoft.VisualStudio.Web.BrowserLink.12.0": "12.0.0", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0", + "VSLangProj": "17.6.36389", + "VSLangProj100": "17.6.36389", + "VSLangProj110": "17.6.36389", + "VSLangProj140": "17.6.36389", + "VSLangProj150": "17.6.36389", + "VSLangProj157": "17.6.36389", + "VSLangProj158": "17.6.36389", + "VSLangProj165": "17.6.36389", + "VSLangProj2": "17.6.36389", + "VSLangProj80": "17.6.36389", + "VSLangProj90": "17.6.36389", + "envdte": "17.6.36389", + "envdte100": "17.6.36389", + "envdte80": "17.6.36389", + "envdte90": "17.6.36389", + "envdte90a": "17.6.36389", + "stdole": "17.6.36389" + } + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "type": "package", + "dependencies": { + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.VisualStudio.Threading.Analyzers": "16.10.56" + }, + "build": { + "build/Microsoft.VisualStudio.SDK.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "type": "package", + "compile": { + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net35/_._": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets": {} + } + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll": {} + }, + "runtime": { + "lib/net40/_._": {} + } + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Newtonsoft.Json": "13.0.1", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.Telemetry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Data.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.0.71", + "Microsoft.Win32.Registry": "5.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Threading.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "type": "package", + "build": { + "build/Microsoft.VisualStudio.Threading.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Utilities.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "type": "package", + "compile": { + "lib/net45/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net40/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VsSDK.CompatibilityAnalyzer": "17.6.2164" + }, + "build": { + "build/Microsoft.VSSDK.BuildTools.props": {}, + "build/Microsoft.VSSDK.BuildTools.targets": {} + } + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "type": "package", + "frameworkAssemblies": [ + "System.IO.Compression", + "System.IO.Compression.FileSystem", + "WindowsBase" + ], + "build": { + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props": {}, + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets": {} + } + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "type": "package", + "compile": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.Web.WebView2.targets": {} + }, + "runtimeTargets": { + "runtimes/win-arm64/native/WebView2Loader.dll": { + "assetType": "native", + "rid": "win-arm64" + }, + "runtimes/win-x64/native/WebView2Loader.dll": { + "assetType": "native", + "rid": "win-x64" + }, + "runtimes/win-x86/native/WebView2Loader.dll": { + "assetType": "native", + "rid": "win-x86" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "compile": { + "ref/net46/Microsoft.Win32.Primitives.dll": {} + }, + "runtime": { + "lib/net46/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/net461/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net461/_._": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "Nerdbank.Streams/2.9.112": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.VisualStudio.Threading": "17.1.46", + "Microsoft.VisualStudio.Validation": "17.0.53", + "System.IO.Pipelines": "6.0.3", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Nerdbank.Streams.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "stdole/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/stdole.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "StreamJsonRpc/2.15.29": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/StreamJsonRpc.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net45/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.ComponentModel.Composition/7.0.0": { + "type": "package", + "compile": { + "lib/net462/_._": {} + }, + "runtime": { + "lib/net462/_._": {} + } + }, + "System.Composition/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0" + }, + "compile": { + "lib/net461/_._": {} + }, + "runtime": { + "lib/net461/_._": {} + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.AttributedModel/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.AttributedModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Convention/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Convention.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Hosting/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Runtime/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.Runtime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.TypedParts/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.TypedParts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Diagnostics.DiagnosticSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.IO.Pipelines/7.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "System", + "mscorlib" + ], + "compile": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "System.Numerics", + "mscorlib" + ], + "compile": { + "ref/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + }, + "compile": { + "ref/netstandard/_._": {} + } + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Metadata/7.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/net462/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "compile": { + "ref/net472/System.Reflection.TypeExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/6.0.0": { + "type": "package", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net461/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net461/_._": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/net461/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + }, + "runtimeTargets": { + "runtimes/win/lib/net461/_._": { + "assetType": "runtime", + "rid": "win" + } + } + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Text.Json/8.0.5": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/System.Text.Json.targets": {} + } + }, + "System.Threading.AccessControl/7.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net462/System.Threading.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Threading.Tasks.Dataflow.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + } + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net47/System.ValueTuple.dll": {} + }, + "runtime": { + "lib/net47/System.ValueTuple.dll": { + "related": ".xml" + } + } + }, + "VSLangProj/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj110/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj110.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj140/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj140.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj150/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj150.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj157/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj157.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj158/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj158.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj165/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj165.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj2/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj2.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + } + }, + ".NETFramework,Version=v4.7.2/win": { + "envdte/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90a/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90a.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "MessagePack/2.5.108": { + "type": "package", + "dependencies": { + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.NET.StringTools": "17.4.0", + "System.Collections.Immutable": "6.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/netstandard2.0/MessagePack.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "MessagePack.Annotations/2.5.108": { + "type": "package", + "compile": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "type": "package", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "Microsoft.Build.Framework/17.6.3": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.2.2146", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/Microsoft.Build.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "type": "package", + "build": { + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props": {}, + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets": {} + } + }, + "Microsoft.CSharp/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "Microsoft.IO.Redist/6.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.IO.Redist.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "type": "package" + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.VisualStudio.Composition": "17.4.16", + "Microsoft.VisualStudio.Threading": "17.6.40", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.ServiceHub.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "type": "package", + "compile": { + "lib/net472/Microsoft.ServiceHub.Resources.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CommandBars.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Validation": "17.0.71", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Composition.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "type": "package" + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Threading": "17.6.40", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Shell.15.0": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.6.11" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Editor.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.GraphModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "StreamJsonRpc": "2.15.26", + "System.ComponentModel.Composition": "7.0.0", + "System.Private.Uri": "4.3.2" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Text.Logic": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.ComponentModelHost": "17.6.252", + "Microsoft.VisualStudio.CoreUtility": "17.6.252", + "Microsoft.VisualStudio.ImageCatalog": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.28", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Framework": "4.2.100", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.CommandBars": "17.6.36389", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Debugger.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.14.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.15.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.16.0": "17.6.36389", + "Microsoft.VisualStudio.Designer.Interfaces": "17.6.36389", + "Microsoft.VisualStudio.Editor": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Language.Intellisense": "17.6.268", + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces": "17.6.268", + "Microsoft.VisualStudio.Language.StandardClassification": "17.6.268", + "Microsoft.VisualStudio.LanguageServer.Client": "17.6.42", + "Microsoft.VisualStudio.OLE.Interop": "17.6.36389", + "Microsoft.VisualStudio.Package.LanguageService.15.0": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Design": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0": "14.0.0", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.TextManager.Interop": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TextTemplating.VSHost": "17.6.36389", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.VCProjectEngine": "17.6.36389", + "Microsoft.VisualStudio.VSHelp": "17.6.36389", + "Microsoft.VisualStudio.VSHelp80": "17.6.36389", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.VisualStudio.WCFReference.Interop": "17.6.36389", + "Microsoft.VisualStudio.Web.BrowserLink.12.0": "12.0.0", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0", + "VSLangProj": "17.6.36389", + "VSLangProj100": "17.6.36389", + "VSLangProj110": "17.6.36389", + "VSLangProj140": "17.6.36389", + "VSLangProj150": "17.6.36389", + "VSLangProj157": "17.6.36389", + "VSLangProj158": "17.6.36389", + "VSLangProj165": "17.6.36389", + "VSLangProj2": "17.6.36389", + "VSLangProj80": "17.6.36389", + "VSLangProj90": "17.6.36389", + "envdte": "17.6.36389", + "envdte100": "17.6.36389", + "envdte80": "17.6.36389", + "envdte90": "17.6.36389", + "envdte90a": "17.6.36389", + "stdole": "17.6.36389" + } + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "type": "package", + "dependencies": { + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.VisualStudio.Threading.Analyzers": "16.10.56" + }, + "build": { + "build/Microsoft.VisualStudio.SDK.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "type": "package", + "compile": { + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net35/_._": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets": {} + } + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll": {} + }, + "runtime": { + "lib/net40/_._": {} + } + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Newtonsoft.Json": "13.0.1", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.Telemetry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Data.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.0.71", + "Microsoft.Win32.Registry": "5.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Threading.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "type": "package", + "build": { + "build/Microsoft.VisualStudio.Threading.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Utilities.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "type": "package", + "compile": { + "lib/net45/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net40/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VsSDK.CompatibilityAnalyzer": "17.6.2164" + }, + "build": { + "build/Microsoft.VSSDK.BuildTools.props": {}, + "build/Microsoft.VSSDK.BuildTools.targets": {} + } + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "type": "package", + "frameworkAssemblies": [ + "System.IO.Compression", + "System.IO.Compression.FileSystem", + "WindowsBase" + ], + "build": { + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props": {}, + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets": {} + } + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "type": "package", + "compile": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.Web.WebView2.targets": {} + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "dependencies": { + "runtime.win.Microsoft.Win32.Primitives": "4.3.0" + }, + "compile": { + "ref/net46/Microsoft.Win32.Primitives.dll": {} + }, + "runtime": { + "lib/net46/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/net461/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "Nerdbank.Streams/2.9.112": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.VisualStudio.Threading": "17.1.46", + "Microsoft.VisualStudio.Validation": "17.0.53", + "System.IO.Pipelines": "6.0.3", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Nerdbank.Streams.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "runtime.win.Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "compile": { + "ref/netstandard/_._": {} + }, + "runtime": { + "runtimes/win/lib/net/_._": {} + } + }, + "stdole/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/stdole.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "StreamJsonRpc/2.15.29": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/StreamJsonRpc.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net45/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.ComponentModel.Composition/7.0.0": { + "type": "package", + "compile": { + "lib/net462/_._": {} + }, + "runtime": { + "lib/net462/_._": {} + } + }, + "System.Composition/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0" + }, + "compile": { + "lib/net461/_._": {} + }, + "runtime": { + "lib/net461/_._": {} + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.AttributedModel/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.AttributedModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Convention/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Convention.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Hosting/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Runtime/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.Runtime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.TypedParts/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.TypedParts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Diagnostics.DiagnosticSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.IO.Pipelines/7.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "System", + "mscorlib" + ], + "compile": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "System.Numerics", + "mscorlib" + ], + "compile": { + "ref/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + }, + "compile": { + "ref/netstandard/_._": {} + } + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Metadata/7.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/net462/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "compile": { + "ref/net472/System.Reflection.TypeExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/6.0.0": { + "type": "package", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net461/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/net461/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Text.Json/8.0.5": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/System.Text.Json.targets": {} + } + }, + "System.Threading.AccessControl/7.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net462/System.Threading.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Threading.Tasks.Dataflow.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + } + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net47/System.ValueTuple.dll": {} + }, + "runtime": { + "lib/net47/System.ValueTuple.dll": { + "related": ".xml" + } + } + }, + "VSLangProj/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj110/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj110.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj140/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj140.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj150/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj150.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj157/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj157.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj158/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj158.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj165/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj165.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj2/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj2.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + } + }, + ".NETFramework,Version=v4.7.2/win-arm": { + "envdte/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90a/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90a.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "MessagePack/2.5.108": { + "type": "package", + "dependencies": { + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.NET.StringTools": "17.4.0", + "System.Collections.Immutable": "6.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/netstandard2.0/MessagePack.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "MessagePack.Annotations/2.5.108": { + "type": "package", + "compile": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "type": "package", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "Microsoft.Build.Framework/17.6.3": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.2.2146", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/Microsoft.Build.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "type": "package", + "build": { + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props": {}, + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets": {} + } + }, + "Microsoft.CSharp/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "Microsoft.IO.Redist/6.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.IO.Redist.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "type": "package" + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.VisualStudio.Composition": "17.4.16", + "Microsoft.VisualStudio.Threading": "17.6.40", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.ServiceHub.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "type": "package", + "compile": { + "lib/net472/Microsoft.ServiceHub.Resources.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CommandBars.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Validation": "17.0.71", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Composition.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "type": "package" + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Threading": "17.6.40", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Shell.15.0": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.6.11" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Editor.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.GraphModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "StreamJsonRpc": "2.15.26", + "System.ComponentModel.Composition": "7.0.0", + "System.Private.Uri": "4.3.2" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Text.Logic": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.ComponentModelHost": "17.6.252", + "Microsoft.VisualStudio.CoreUtility": "17.6.252", + "Microsoft.VisualStudio.ImageCatalog": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.28", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Framework": "4.2.100", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.CommandBars": "17.6.36389", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Debugger.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.14.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.15.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.16.0": "17.6.36389", + "Microsoft.VisualStudio.Designer.Interfaces": "17.6.36389", + "Microsoft.VisualStudio.Editor": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Language.Intellisense": "17.6.268", + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces": "17.6.268", + "Microsoft.VisualStudio.Language.StandardClassification": "17.6.268", + "Microsoft.VisualStudio.LanguageServer.Client": "17.6.42", + "Microsoft.VisualStudio.OLE.Interop": "17.6.36389", + "Microsoft.VisualStudio.Package.LanguageService.15.0": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Design": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0": "14.0.0", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.TextManager.Interop": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TextTemplating.VSHost": "17.6.36389", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.VCProjectEngine": "17.6.36389", + "Microsoft.VisualStudio.VSHelp": "17.6.36389", + "Microsoft.VisualStudio.VSHelp80": "17.6.36389", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.VisualStudio.WCFReference.Interop": "17.6.36389", + "Microsoft.VisualStudio.Web.BrowserLink.12.0": "12.0.0", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0", + "VSLangProj": "17.6.36389", + "VSLangProj100": "17.6.36389", + "VSLangProj110": "17.6.36389", + "VSLangProj140": "17.6.36389", + "VSLangProj150": "17.6.36389", + "VSLangProj157": "17.6.36389", + "VSLangProj158": "17.6.36389", + "VSLangProj165": "17.6.36389", + "VSLangProj2": "17.6.36389", + "VSLangProj80": "17.6.36389", + "VSLangProj90": "17.6.36389", + "envdte": "17.6.36389", + "envdte100": "17.6.36389", + "envdte80": "17.6.36389", + "envdte90": "17.6.36389", + "envdte90a": "17.6.36389", + "stdole": "17.6.36389" + } + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "type": "package", + "dependencies": { + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.VisualStudio.Threading.Analyzers": "16.10.56" + }, + "build": { + "build/Microsoft.VisualStudio.SDK.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "type": "package", + "compile": { + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net35/_._": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets": {} + } + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll": {} + }, + "runtime": { + "lib/net40/_._": {} + } + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Newtonsoft.Json": "13.0.1", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.Telemetry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Data.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.0.71", + "Microsoft.Win32.Registry": "5.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Threading.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "type": "package", + "build": { + "build/Microsoft.VisualStudio.Threading.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Utilities.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "type": "package", + "compile": { + "lib/net45/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net40/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VsSDK.CompatibilityAnalyzer": "17.6.2164" + }, + "build": { + "build/Microsoft.VSSDK.BuildTools.props": {}, + "build/Microsoft.VSSDK.BuildTools.targets": {} + } + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "type": "package", + "frameworkAssemblies": [ + "System.IO.Compression", + "System.IO.Compression.FileSystem", + "WindowsBase" + ], + "build": { + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props": {}, + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets": {} + } + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "type": "package", + "compile": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.Web.WebView2.targets": {} + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "compile": { + "ref/net46/Microsoft.Win32.Primitives.dll": {} + }, + "runtime": { + "lib/net46/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/net461/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "Nerdbank.Streams/2.9.112": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.VisualStudio.Threading": "17.1.46", + "Microsoft.VisualStudio.Validation": "17.0.53", + "System.IO.Pipelines": "6.0.3", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Nerdbank.Streams.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "stdole/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/stdole.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "StreamJsonRpc/2.15.29": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/StreamJsonRpc.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net45/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.ComponentModel.Composition/7.0.0": { + "type": "package", + "compile": { + "lib/net462/_._": {} + }, + "runtime": { + "lib/net462/_._": {} + } + }, + "System.Composition/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0" + }, + "compile": { + "lib/net461/_._": {} + }, + "runtime": { + "lib/net461/_._": {} + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.AttributedModel/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.AttributedModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Convention/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Convention.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Hosting/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Runtime/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.Runtime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.TypedParts/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.TypedParts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Diagnostics.DiagnosticSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.IO.Pipelines/7.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "System", + "mscorlib" + ], + "compile": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "System.Numerics", + "mscorlib" + ], + "compile": { + "ref/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + }, + "compile": { + "ref/netstandard/_._": {} + } + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Metadata/7.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/net462/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "compile": { + "ref/net472/System.Reflection.TypeExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/6.0.0": { + "type": "package", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net461/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/net461/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Text.Json/8.0.5": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/System.Text.Json.targets": {} + } + }, + "System.Threading.AccessControl/7.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net462/System.Threading.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Threading.Tasks.Dataflow.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + } + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net47/System.ValueTuple.dll": {} + }, + "runtime": { + "lib/net47/System.ValueTuple.dll": { + "related": ".xml" + } + } + }, + "VSLangProj/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj110/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj110.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj140/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj140.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj150/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj150.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj157/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj157.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj158/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj158.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj165/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj165.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj2/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj2.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + } + }, + ".NETFramework,Version=v4.7.2/win-arm64": { + "envdte/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90a/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90a.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "MessagePack/2.5.108": { + "type": "package", + "dependencies": { + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.NET.StringTools": "17.4.0", + "System.Collections.Immutable": "6.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/netstandard2.0/MessagePack.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "MessagePack.Annotations/2.5.108": { + "type": "package", + "compile": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "type": "package", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "Microsoft.Build.Framework/17.6.3": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.2.2146", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/Microsoft.Build.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "type": "package", + "build": { + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props": {}, + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets": {} + } + }, + "Microsoft.CSharp/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "Microsoft.IO.Redist/6.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.IO.Redist.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "type": "package" + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.VisualStudio.Composition": "17.4.16", + "Microsoft.VisualStudio.Threading": "17.6.40", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.ServiceHub.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "type": "package", + "compile": { + "lib/net472/Microsoft.ServiceHub.Resources.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CommandBars.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Validation": "17.0.71", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Composition.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "type": "package" + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Threading": "17.6.40", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Shell.15.0": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.6.11" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Editor.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.GraphModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "StreamJsonRpc": "2.15.26", + "System.ComponentModel.Composition": "7.0.0", + "System.Private.Uri": "4.3.2" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Text.Logic": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.ComponentModelHost": "17.6.252", + "Microsoft.VisualStudio.CoreUtility": "17.6.252", + "Microsoft.VisualStudio.ImageCatalog": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.28", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Framework": "4.2.100", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.CommandBars": "17.6.36389", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Debugger.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.14.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.15.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.16.0": "17.6.36389", + "Microsoft.VisualStudio.Designer.Interfaces": "17.6.36389", + "Microsoft.VisualStudio.Editor": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Language.Intellisense": "17.6.268", + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces": "17.6.268", + "Microsoft.VisualStudio.Language.StandardClassification": "17.6.268", + "Microsoft.VisualStudio.LanguageServer.Client": "17.6.42", + "Microsoft.VisualStudio.OLE.Interop": "17.6.36389", + "Microsoft.VisualStudio.Package.LanguageService.15.0": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Design": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0": "14.0.0", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.TextManager.Interop": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TextTemplating.VSHost": "17.6.36389", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.VCProjectEngine": "17.6.36389", + "Microsoft.VisualStudio.VSHelp": "17.6.36389", + "Microsoft.VisualStudio.VSHelp80": "17.6.36389", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.VisualStudio.WCFReference.Interop": "17.6.36389", + "Microsoft.VisualStudio.Web.BrowserLink.12.0": "12.0.0", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0", + "VSLangProj": "17.6.36389", + "VSLangProj100": "17.6.36389", + "VSLangProj110": "17.6.36389", + "VSLangProj140": "17.6.36389", + "VSLangProj150": "17.6.36389", + "VSLangProj157": "17.6.36389", + "VSLangProj158": "17.6.36389", + "VSLangProj165": "17.6.36389", + "VSLangProj2": "17.6.36389", + "VSLangProj80": "17.6.36389", + "VSLangProj90": "17.6.36389", + "envdte": "17.6.36389", + "envdte100": "17.6.36389", + "envdte80": "17.6.36389", + "envdte90": "17.6.36389", + "envdte90a": "17.6.36389", + "stdole": "17.6.36389" + } + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "type": "package", + "dependencies": { + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.VisualStudio.Threading.Analyzers": "16.10.56" + }, + "build": { + "build/Microsoft.VisualStudio.SDK.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "type": "package", + "compile": { + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net35/_._": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets": {} + } + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll": {} + }, + "runtime": { + "lib/net40/_._": {} + } + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Newtonsoft.Json": "13.0.1", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.Telemetry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Data.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.0.71", + "Microsoft.Win32.Registry": "5.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Threading.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "type": "package", + "build": { + "build/Microsoft.VisualStudio.Threading.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Utilities.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "type": "package", + "compile": { + "lib/net45/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net40/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VsSDK.CompatibilityAnalyzer": "17.6.2164" + }, + "build": { + "build/Microsoft.VSSDK.BuildTools.props": {}, + "build/Microsoft.VSSDK.BuildTools.targets": {} + } + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "type": "package", + "frameworkAssemblies": [ + "System.IO.Compression", + "System.IO.Compression.FileSystem", + "WindowsBase" + ], + "build": { + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props": {}, + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets": {} + } + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "type": "package", + "compile": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "native": { + "runtimes/win-arm64/native/WebView2Loader.dll": {} + }, + "build": { + "build/Microsoft.Web.WebView2.targets": {} + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "compile": { + "ref/net46/Microsoft.Win32.Primitives.dll": {} + }, + "runtime": { + "lib/net46/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/net461/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "Nerdbank.Streams/2.9.112": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.VisualStudio.Threading": "17.1.46", + "Microsoft.VisualStudio.Validation": "17.0.53", + "System.IO.Pipelines": "6.0.3", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Nerdbank.Streams.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "stdole/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/stdole.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "StreamJsonRpc/2.15.29": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/StreamJsonRpc.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net45/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.ComponentModel.Composition/7.0.0": { + "type": "package", + "compile": { + "lib/net462/_._": {} + }, + "runtime": { + "lib/net462/_._": {} + } + }, + "System.Composition/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0" + }, + "compile": { + "lib/net461/_._": {} + }, + "runtime": { + "lib/net461/_._": {} + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.AttributedModel/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.AttributedModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Convention/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Convention.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Hosting/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Runtime/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.Runtime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.TypedParts/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.TypedParts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Diagnostics.DiagnosticSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.IO.Pipelines/7.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "System", + "mscorlib" + ], + "compile": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "System.Numerics", + "mscorlib" + ], + "compile": { + "ref/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + }, + "compile": { + "ref/netstandard/_._": {} + } + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Metadata/7.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/net462/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "compile": { + "ref/net472/System.Reflection.TypeExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/6.0.0": { + "type": "package", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net461/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/net461/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Text.Json/8.0.5": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/System.Text.Json.targets": {} + } + }, + "System.Threading.AccessControl/7.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net462/System.Threading.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Threading.Tasks.Dataflow.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + } + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net47/System.ValueTuple.dll": {} + }, + "runtime": { + "lib/net47/System.ValueTuple.dll": { + "related": ".xml" + } + } + }, + "VSLangProj/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj110/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj110.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj140/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj140.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj150/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj150.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj157/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj157.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj158/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj158.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj165/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj165.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj2/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj2.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + } + }, + ".NETFramework,Version=v4.7.2/win-x64": { + "envdte/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90a/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90a.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "MessagePack/2.5.108": { + "type": "package", + "dependencies": { + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.NET.StringTools": "17.4.0", + "System.Collections.Immutable": "6.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/netstandard2.0/MessagePack.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "MessagePack.Annotations/2.5.108": { + "type": "package", + "compile": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "type": "package", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "Microsoft.Build.Framework/17.6.3": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.2.2146", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/Microsoft.Build.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "type": "package", + "build": { + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props": {}, + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets": {} + } + }, + "Microsoft.CSharp/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "Microsoft.IO.Redist/6.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.IO.Redist.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "type": "package" + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.VisualStudio.Composition": "17.4.16", + "Microsoft.VisualStudio.Threading": "17.6.40", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.ServiceHub.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "type": "package", + "compile": { + "lib/net472/Microsoft.ServiceHub.Resources.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CommandBars.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Validation": "17.0.71", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Composition.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "type": "package" + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Threading": "17.6.40", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Shell.15.0": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.6.11" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Editor.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.GraphModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "StreamJsonRpc": "2.15.26", + "System.ComponentModel.Composition": "7.0.0", + "System.Private.Uri": "4.3.2" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Text.Logic": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.ComponentModelHost": "17.6.252", + "Microsoft.VisualStudio.CoreUtility": "17.6.252", + "Microsoft.VisualStudio.ImageCatalog": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.28", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Framework": "4.2.100", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.CommandBars": "17.6.36389", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Debugger.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.14.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.15.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.16.0": "17.6.36389", + "Microsoft.VisualStudio.Designer.Interfaces": "17.6.36389", + "Microsoft.VisualStudio.Editor": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Language.Intellisense": "17.6.268", + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces": "17.6.268", + "Microsoft.VisualStudio.Language.StandardClassification": "17.6.268", + "Microsoft.VisualStudio.LanguageServer.Client": "17.6.42", + "Microsoft.VisualStudio.OLE.Interop": "17.6.36389", + "Microsoft.VisualStudio.Package.LanguageService.15.0": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Design": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0": "14.0.0", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.TextManager.Interop": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TextTemplating.VSHost": "17.6.36389", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.VCProjectEngine": "17.6.36389", + "Microsoft.VisualStudio.VSHelp": "17.6.36389", + "Microsoft.VisualStudio.VSHelp80": "17.6.36389", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.VisualStudio.WCFReference.Interop": "17.6.36389", + "Microsoft.VisualStudio.Web.BrowserLink.12.0": "12.0.0", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0", + "VSLangProj": "17.6.36389", + "VSLangProj100": "17.6.36389", + "VSLangProj110": "17.6.36389", + "VSLangProj140": "17.6.36389", + "VSLangProj150": "17.6.36389", + "VSLangProj157": "17.6.36389", + "VSLangProj158": "17.6.36389", + "VSLangProj165": "17.6.36389", + "VSLangProj2": "17.6.36389", + "VSLangProj80": "17.6.36389", + "VSLangProj90": "17.6.36389", + "envdte": "17.6.36389", + "envdte100": "17.6.36389", + "envdte80": "17.6.36389", + "envdte90": "17.6.36389", + "envdte90a": "17.6.36389", + "stdole": "17.6.36389" + } + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "type": "package", + "dependencies": { + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.VisualStudio.Threading.Analyzers": "16.10.56" + }, + "build": { + "build/Microsoft.VisualStudio.SDK.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "type": "package", + "compile": { + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net35/_._": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets": {} + } + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll": {} + }, + "runtime": { + "lib/net40/_._": {} + } + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Newtonsoft.Json": "13.0.1", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.Telemetry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Data.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.0.71", + "Microsoft.Win32.Registry": "5.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Threading.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "type": "package", + "build": { + "build/Microsoft.VisualStudio.Threading.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Utilities.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "type": "package", + "compile": { + "lib/net45/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net40/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VsSDK.CompatibilityAnalyzer": "17.6.2164" + }, + "build": { + "build/Microsoft.VSSDK.BuildTools.props": {}, + "build/Microsoft.VSSDK.BuildTools.targets": {} + } + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "type": "package", + "frameworkAssemblies": [ + "System.IO.Compression", + "System.IO.Compression.FileSystem", + "WindowsBase" + ], + "build": { + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props": {}, + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets": {} + } + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "type": "package", + "compile": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "native": { + "runtimes/win-x64/native/WebView2Loader.dll": {} + }, + "build": { + "build/Microsoft.Web.WebView2.targets": {} + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "dependencies": { + "runtime.win.Microsoft.Win32.Primitives": "4.3.0" + }, + "compile": { + "ref/net46/Microsoft.Win32.Primitives.dll": {} + }, + "runtime": { + "lib/net46/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/net461/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "Nerdbank.Streams/2.9.112": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.VisualStudio.Threading": "17.1.46", + "Microsoft.VisualStudio.Validation": "17.0.53", + "System.IO.Pipelines": "6.0.3", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Nerdbank.Streams.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "runtime.win.Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "compile": { + "ref/netstandard/_._": {} + }, + "runtime": { + "runtimes/win/lib/net/_._": {} + } + }, + "stdole/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/stdole.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "StreamJsonRpc/2.15.29": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/StreamJsonRpc.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net45/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.ComponentModel.Composition/7.0.0": { + "type": "package", + "compile": { + "lib/net462/_._": {} + }, + "runtime": { + "lib/net462/_._": {} + } + }, + "System.Composition/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0" + }, + "compile": { + "lib/net461/_._": {} + }, + "runtime": { + "lib/net461/_._": {} + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.AttributedModel/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.AttributedModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Convention/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Convention.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Hosting/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Runtime/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.Runtime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.TypedParts/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.TypedParts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Diagnostics.DiagnosticSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.IO.Pipelines/7.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "System", + "mscorlib" + ], + "compile": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "System.Numerics", + "mscorlib" + ], + "compile": { + "ref/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + }, + "compile": { + "ref/netstandard/_._": {} + } + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Metadata/7.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/net462/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "compile": { + "ref/net472/System.Reflection.TypeExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/6.0.0": { + "type": "package", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net461/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/net461/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Text.Json/8.0.5": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/System.Text.Json.targets": {} + } + }, + "System.Threading.AccessControl/7.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net462/System.Threading.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Threading.Tasks.Dataflow.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + } + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net47/System.ValueTuple.dll": {} + }, + "runtime": { + "lib/net47/System.ValueTuple.dll": { + "related": ".xml" + } + } + }, + "VSLangProj/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj110/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj110.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj140/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj140.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj150/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj150.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj157/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj157.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj158/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj158.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj165/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj165.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj2/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj2.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + } + }, + ".NETFramework,Version=v4.7.2/win-x86": { + "envdte/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "envdte90a/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/envdte90a.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "MessagePack/2.5.108": { + "type": "package", + "dependencies": { + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.NET.StringTools": "17.4.0", + "System.Collections.Immutable": "6.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Emit.Lightweight": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/netstandard2.0/MessagePack.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "MessagePack.Annotations/2.5.108": { + "type": "package", + "compile": { + "lib/netstandard2.0/MessagePack.Annotations.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "type": "package", + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "Microsoft.Build.Framework/17.6.3": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.2.2146", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/Microsoft.Build.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "type": "package", + "build": { + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props": {}, + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets": {} + } + }, + "Microsoft.CSharp/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "Microsoft.IO.Redist/6.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.IO.Redist.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.NET.StringTools/17.6.3": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "ref/net472/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".pdb;.xml" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "compile": { + "lib/netstandard1.0/_._": {} + }, + "runtime": { + "lib/netstandard1.0/_._": {} + } + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "type": "package" + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.VisualStudio.Composition": "17.4.16", + "Microsoft.VisualStudio.Threading": "17.6.40", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.ServiceHub.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "type": "package", + "compile": { + "lib/net472/Microsoft.ServiceHub.Resources.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CommandBars.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Validation": "17.0.71", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Reflection.Emit": "4.7.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Composition.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "type": "package" + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Threading": "17.6.40", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Shell.15.0": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.6.11" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Editor.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.GraphModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "StreamJsonRpc": "2.15.26", + "System.ComponentModel.Composition": "7.0.0", + "System.Private.Uri": "4.3.2" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Imaging": "17.6.35829", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Text.Logic": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.ComponentModelHost": "17.6.252", + "Microsoft.VisualStudio.CoreUtility": "17.6.252", + "Microsoft.VisualStudio.ImageCatalog": "17.6.35829", + "Microsoft.VisualStudio.Interop": "17.6.35829", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.28", + "Microsoft.VisualStudio.Text.Logic": "17.6.252", + "Microsoft.VisualStudio.Utilities": "17.6.35829", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.26", + "System.Collections.Immutable": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "type": "package", + "dependencies": { + "Microsoft.ServiceHub.Framework": "4.2.100", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.CommandBars": "17.6.36389", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Debugger.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.14.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.15.0": "17.6.36389", + "Microsoft.VisualStudio.Debugger.Interop.16.0": "17.6.36389", + "Microsoft.VisualStudio.Designer.Interfaces": "17.6.36389", + "Microsoft.VisualStudio.Editor": "17.6.268", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.Language": "17.6.268", + "Microsoft.VisualStudio.Language.Intellisense": "17.6.268", + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces": "17.6.268", + "Microsoft.VisualStudio.Language.StandardClassification": "17.6.268", + "Microsoft.VisualStudio.LanguageServer.Client": "17.6.42", + "Microsoft.VisualStudio.OLE.Interop": "17.6.36389", + "Microsoft.VisualStudio.Package.LanguageService.15.0": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Design": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0": "14.0.0", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268", + "Microsoft.VisualStudio.Text.UI.Wpf": "17.6.268", + "Microsoft.VisualStudio.TextManager.Interop": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.10.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.11.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.12.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.8.0": "17.6.36389", + "Microsoft.VisualStudio.TextManager.Interop.9.0": "17.6.36389", + "Microsoft.VisualStudio.TextTemplating.VSHost": "17.6.36389", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.VCProjectEngine": "17.6.36389", + "Microsoft.VisualStudio.VSHelp": "17.6.36389", + "Microsoft.VisualStudio.VSHelp80": "17.6.36389", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.VisualStudio.WCFReference.Interop": "17.6.36389", + "Microsoft.VisualStudio.Web.BrowserLink.12.0": "12.0.0", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0", + "VSLangProj": "17.6.36389", + "VSLangProj100": "17.6.36389", + "VSLangProj110": "17.6.36389", + "VSLangProj140": "17.6.36389", + "VSLangProj150": "17.6.36389", + "VSLangProj157": "17.6.36389", + "VSLangProj158": "17.6.36389", + "VSLangProj165": "17.6.36389", + "VSLangProj2": "17.6.36389", + "VSLangProj80": "17.6.36389", + "VSLangProj90": "17.6.36389", + "envdte": "17.6.36389", + "envdte100": "17.6.36389", + "envdte80": "17.6.36389", + "envdte90": "17.6.36389", + "envdte90a": "17.6.36389", + "stdole": "17.6.36389" + } + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "type": "package", + "dependencies": { + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.VisualStudio.Threading.Analyzers": "16.10.56" + }, + "build": { + "build/Microsoft.VisualStudio.SDK.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "type": "package", + "compile": { + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net35/_._": { + "related": ".xml" + } + }, + "build": { + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets": {} + } + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Imaging": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.ProjectAggregator": "17.6.36387", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.CodeAnalysis.BannedApiAnalyzers": "3.3.2", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.ComponentModelHost": "17.6.268", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.ImageCatalog": "17.6.36389", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Sdk.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Shell.15.0": "17.6.36389", + "Microsoft.VisualStudio.Shell.Framework": "17.6.36389", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.Build.Framework": "17.6.3", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Analyzers": "4.2.102", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.GraphModel": "17.6.36389", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.36387", + "Microsoft.VisualStudio.Interop": "17.6.36389", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.6.2115", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities": "17.6.36389", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Text.Encodings.Web": "7.0.0", + "System.Text.Json": "7.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll": {} + }, + "runtime": { + "lib/net40/_._": {} + } + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.7.0", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Newtonsoft.Json": "13.0.1", + "System.Runtime.CompilerServices.Unsafe": "5.0.0" + }, + "compile": { + "lib/net45/Microsoft.VisualStudio.Telemetry.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Threading": "17.6.40" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Data.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "System.ComponentModel.Composition": "7.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.CoreUtility": "17.6.268", + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime": "17.6.35829", + "Microsoft.VisualStudio.Text.Data": "17.6.268", + "Microsoft.VisualStudio.Text.Logic": "17.6.268", + "Microsoft.VisualStudio.Text.UI": "17.6.268" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Validation": "17.6.11", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Validation": "17.0.71", + "Microsoft.Win32.Registry": "5.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Threading.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "type": "package", + "build": { + "build/Microsoft.VisualStudio.Threading.Analyzers.targets": {} + } + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "MessagePack.Annotations": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.IO.Redist": "6.0.0", + "Microsoft.NET.StringTools": "17.6.3", + "Microsoft.ServiceHub.Framework": "4.2.102", + "Microsoft.ServiceHub.Resources": "4.2.8", + "Microsoft.VisualStudio.Composition": "17.6.17", + "Microsoft.VisualStudio.Composition.Analyzers": "17.6.17", + "Microsoft.VisualStudio.RemoteControl": "16.3.52", + "Microsoft.VisualStudio.RpcContracts": "17.6.13", + "Microsoft.VisualStudio.Telemetry": "17.6.46", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Microsoft.VisualStudio.Utilities.Internal": "16.3.42", + "Microsoft.VisualStudio.Validation": "17.6.11", + "Microsoft.Win32.Registry": "5.0.0", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.3", + "StreamJsonRpc": "2.15.29", + "System.Buffers": "4.5.1", + "System.Collections.Immutable": "7.0.0", + "System.ComponentModel.Composition": "7.0.0", + "System.Composition": "7.0.0", + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Memory": "4.5.5", + "System.Numerics.Vectors": "4.5.0", + "System.Reflection.Metadata": "7.0.0", + "System.Reflection.TypeExtensions": "4.7.0", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0", + "System.Threading.AccessControl": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.Utilities.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "type": "package", + "compile": { + "lib/net45/_._": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "type": "package", + "compile": { + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "type": "package", + "compile": { + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll": {} + }, + "runtime": { + "lib/net472/_._": {} + } + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "type": "package", + "compile": { + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net40/_._": { + "related": ".xml" + } + } + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.SDK.Analyzers": "16.10.10", + "Microsoft.VsSDK.CompatibilityAnalyzer": "17.6.2164" + }, + "build": { + "build/Microsoft.VSSDK.BuildTools.props": {}, + "build/Microsoft.VSSDK.BuildTools.targets": {} + } + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "type": "package", + "frameworkAssemblies": [ + "System.IO.Compression", + "System.IO.Compression.FileSystem", + "WindowsBase" + ], + "build": { + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props": {}, + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets": {} + } + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "type": "package", + "compile": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Microsoft.Web.WebView2.Core.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.WinForms.dll": { + "related": ".xml" + }, + "lib/net45/Microsoft.Web.WebView2.Wpf.dll": { + "related": ".xml" + } + }, + "native": { + "runtimes/win-x86/native/WebView2Loader.dll": {} + }, + "build": { + "build/Microsoft.Web.WebView2.targets": {} + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "dependencies": { + "runtime.win.Microsoft.Win32.Primitives": "4.3.0" + }, + "compile": { + "ref/net46/Microsoft.Win32.Primitives.dll": {} + }, + "runtime": { + "lib/net46/_._": {} + } + }, + "Microsoft.Win32.Registry/5.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "5.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "ref/net461/Microsoft.Win32.Registry.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "Nerdbank.Streams/2.9.112": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "6.0.0", + "Microsoft.VisualStudio.Threading": "17.1.46", + "Microsoft.VisualStudio.Validation": "17.0.53", + "System.IO.Pipelines": "6.0.3", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/netstandard2.0/Nerdbank.Streams.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "Newtonsoft.Json/13.0.3": { + "type": "package", + "compile": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net45/Newtonsoft.Json.dll": { + "related": ".xml" + } + } + }, + "runtime.win.Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "compile": { + "ref/netstandard/_._": {} + }, + "runtime": { + "runtimes/win/lib/net/_._": {} + } + }, + "stdole/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/stdole.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "StreamJsonRpc/2.15.29": { + "type": "package", + "dependencies": { + "MessagePack": "2.5.108", + "Microsoft.Bcl.AsyncInterfaces": "7.0.0", + "Microsoft.VisualStudio.Threading": "17.6.40", + "Microsoft.VisualStudio.Threading.Analyzers": "17.6.40", + "Nerdbank.Streams": "2.9.112", + "Newtonsoft.Json": "13.0.1", + "System.Collections.Immutable": "7.0.0", + "System.Diagnostics.DiagnosticSource": "7.0.1", + "System.IO.Pipelines": "7.0.0", + "System.Threading.Tasks.Dataflow": "7.0.0" + }, + "compile": { + "lib/netstandard2.0/StreamJsonRpc.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/netstandard2.0/_._": { + "related": ".xml" + } + } + }, + "System.Buffers/4.5.1": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net45/System.Buffers.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Buffers.dll": { + "related": ".xml" + } + } + }, + "System.Collections.Immutable/7.0.0": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Collections.Immutable.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.ComponentModel.Composition/7.0.0": { + "type": "package", + "compile": { + "lib/net462/_._": {} + }, + "runtime": { + "lib/net462/_._": {} + } + }, + "System.Composition/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Convention": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0", + "System.Composition.TypedParts": "7.0.0" + }, + "compile": { + "lib/net461/_._": {} + }, + "runtime": { + "lib/net461/_._": {} + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.AttributedModel/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.AttributedModel.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Convention/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Convention.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Hosting/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.Hosting.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.Runtime/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Composition.Runtime.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Composition.TypedParts/7.0.0": { + "type": "package", + "dependencies": { + "System.Composition.AttributedModel": "7.0.0", + "System.Composition.Hosting": "7.0.0", + "System.Composition.Runtime": "7.0.0" + }, + "compile": { + "lib/net462/System.Composition.TypedParts.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "type": "package", + "dependencies": { + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Diagnostics.DiagnosticSource.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.IO.Pipelines/7.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "compile": { + "lib/net462/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Memory/4.5.5": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "System", + "mscorlib" + ], + "compile": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Memory.dll": { + "related": ".xml" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "System.Numerics", + "mscorlib" + ], + "compile": { + "ref/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net46/System.Numerics.Vectors.dll": { + "related": ".xml" + } + } + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + }, + "compile": { + "ref/netstandard/_._": {} + } + }, + "System.Reflection.Emit/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "type": "package", + "compile": { + "ref/net45/_._": {} + }, + "runtime": { + "lib/net45/_._": {} + } + }, + "System.Reflection.Metadata/7.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Immutable": "7.0.0", + "System.Memory": "4.5.5" + }, + "compile": { + "lib/net462/System.Reflection.Metadata.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Reflection.TypeExtensions/4.7.0": { + "type": "package", + "compile": { + "ref/net472/System.Reflection.TypeExtensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll": { + "related": ".xml" + } + } + }, + "System.Security.AccessControl/6.0.0": { + "type": "package", + "dependencies": { + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net461/System.Security.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Security.Principal.Windows/5.0.0": { + "type": "package", + "compile": { + "ref/net461/System.Security.Principal.Windows.dll": { + "related": ".xml" + } + }, + "runtime": { + "runtimes/win/lib/net461/_._": { + "related": ".xml" + } + } + }, + "System.Text.Encodings.Web/8.0.0": { + "type": "package", + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0" + }, + "compile": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Text.Json/8.0.5": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "8.0.0", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.5", + "System.Runtime.CompilerServices.Unsafe": "6.0.0", + "System.Text.Encodings.Web": "8.0.0", + "System.Threading.Tasks.Extensions": "4.5.4", + "System.ValueTuple": "4.5.0" + }, + "compile": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/System.Text.Json.targets": {} + } + }, + "System.Threading.AccessControl/7.0.0": { + "type": "package", + "dependencies": { + "System.Security.AccessControl": "6.0.0", + "System.Security.Principal.Windows": "5.0.0" + }, + "compile": { + "lib/net462/System.Threading.AccessControl.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "type": "package", + "compile": { + "lib/net462/System.Threading.Tasks.Dataflow.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net462/_._": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net462/_._": {} + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.5.3" + }, + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net461/System.Threading.Tasks.Extensions.dll": { + "related": ".xml" + } + } + }, + "System.ValueTuple/4.5.0": { + "type": "package", + "frameworkAssemblies": [ + "mscorlib" + ], + "compile": { + "ref/net47/System.ValueTuple.dll": {} + }, + "runtime": { + "lib/net47/System.ValueTuple.dll": { + "related": ".xml" + } + } + }, + "VSLangProj/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj100/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj100.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj110/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj110.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj140/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj140.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj150/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj150.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj157/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj157.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj158/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj158.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj165/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj165.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj2/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj2.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj80/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj80.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + }, + "VSLangProj90/17.6.36389": { + "type": "package", + "dependencies": { + "Microsoft.VisualStudio.Interop": "17.6.36389" + }, + "compile": { + "lib/net472/VSLangProj90.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net472/_._": { + "related": ".xml" + } + } + } + } + }, + "libraries": { + "envdte/17.6.36389": { + "sha512": "Ipa3iCx1QO2DpTueYINPN5ADbaqyHhHIljlY7sWWBwEpAHzHbf4rISmj4fMkKH/vCx9ccjJyfwEE/5Y6oS3Jqg==", + "type": "package", + "path": "envdte/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "envdte.17.6.36389.nupkg.sha512", + "envdte.nuspec", + "lib/net20/envdte.dll", + "lib/net20/envdte.xml", + "lib/net45/envdte.dll", + "lib/net45/envdte.xml", + "lib/net472/envdte.dll", + "lib/net472/envdte.xml", + "lib/net6.0/envdte.dll", + "lib/net6.0/envdte.xml", + "lib/netstandard2.0/envdte.dll", + "lib/netstandard2.0/envdte.xml" + ] + }, + "envdte100/17.6.36389": { + "sha512": "VnObugWVaXP53TftFyVk+VHvhyuLJlM9LhJIwt9UCWm6Dw5Hc6ZWkrFSF+h7CtnYS2a/MpQkM7lVk5JRo0kyUg==", + "type": "package", + "path": "envdte100/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "envdte100.17.6.36389.nupkg.sha512", + "envdte100.nuspec", + "lib/net20/envdte100.dll", + "lib/net20/envdte100.xml", + "lib/net45/envdte100.dll", + "lib/net45/envdte100.xml", + "lib/net472/envdte100.dll", + "lib/net472/envdte100.xml", + "lib/net6.0/envdte100.dll", + "lib/net6.0/envdte100.xml", + "lib/netstandard2.0/envdte100.dll", + "lib/netstandard2.0/envdte100.xml" + ] + }, + "envdte80/17.6.36389": { + "sha512": "sNwY3rU7lQCPxhSqddwKsNgm+A5lgAt/TH71QOucXfM+lCGHacwPA5slcDzIWXtNJwsjNE5sOQ5LQeo1rf9lhQ==", + "type": "package", + "path": "envdte80/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "envdte80.17.6.36389.nupkg.sha512", + "envdte80.nuspec", + "lib/net20/envdte80.dll", + "lib/net20/envdte80.xml", + "lib/net45/envdte80.dll", + "lib/net45/envdte80.xml", + "lib/net472/envdte80.dll", + "lib/net472/envdte80.xml", + "lib/net6.0/envdte80.dll", + "lib/net6.0/envdte80.xml", + "lib/netstandard2.0/envdte80.dll", + "lib/netstandard2.0/envdte80.xml" + ] + }, + "envdte90/17.6.36389": { + "sha512": "R7RBJSZpQvHZlKxWDFoEnyxdGSPXgL9qYloEghjtR6j6fdAwqUT+sWbSSwwZiaUhtC1q0e7kTXZuoDM9IMmPdQ==", + "type": "package", + "path": "envdte90/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "envdte90.17.6.36389.nupkg.sha512", + "envdte90.nuspec", + "lib/net20/envdte90.dll", + "lib/net20/envdte90.xml", + "lib/net45/envdte90.dll", + "lib/net45/envdte90.xml", + "lib/net472/envdte90.dll", + "lib/net472/envdte90.xml", + "lib/net6.0/envdte90.dll", + "lib/net6.0/envdte90.xml", + "lib/netstandard2.0/envdte90.dll", + "lib/netstandard2.0/envdte90.xml" + ] + }, + "envdte90a/17.6.36389": { + "sha512": "+Q0sfa3NDKTERrAJu/rVu+P+xc0V1sb7rW0tlJUBnw2hIKa0Jj8CCoFtyyK+jm8nnzpSNtQw7qyNoANZsqTvww==", + "type": "package", + "path": "envdte90a/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "envdte90a.17.6.36389.nupkg.sha512", + "envdte90a.nuspec", + "lib/net20/envdte90a.dll", + "lib/net20/envdte90a.xml", + "lib/net45/envdte90a.dll", + "lib/net45/envdte90a.xml", + "lib/net472/envdte90a.dll", + "lib/net472/envdte90a.xml", + "lib/net6.0/envdte90a.dll", + "lib/net6.0/envdte90a.xml", + "lib/netstandard2.0/envdte90a.dll", + "lib/netstandard2.0/envdte90a.xml" + ] + }, + "MessagePack/2.5.108": { + "sha512": "kcVRbdWP3xNWLZmmpm4DFO+kuXf6mUR2mHZ27WoZIEFIv9hazuUd80injXhNrZnlq/FklAdCsLOil5M76I4Ndg==", + "type": "package", + "path": "messagepack/2.5.108", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net6.0/MessagePack.dll", + "lib/net6.0/MessagePack.xml", + "lib/netstandard2.0/MessagePack.dll", + "lib/netstandard2.0/MessagePack.xml", + "messagepack.2.5.108.nupkg.sha512", + "messagepack.nuspec" + ] + }, + "MessagePack.Annotations/2.5.108": { + "sha512": "28aNCvfJClgwaKr26gf2S6LT+C1PNyPxiG+ihYpy8uCJsRLJEDoCt2I0Uk5hqOPQ8P8hI0ESy520oMkZkPmsOQ==", + "type": "package", + "path": "messagepack.annotations/2.5.108", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/netstandard2.0/MessagePack.Annotations.dll", + "lib/netstandard2.0/MessagePack.Annotations.xml", + "messagepack.annotations.2.5.108.nupkg.sha512", + "messagepack.annotations.nuspec" + ] + }, + "Microsoft.Bcl.AsyncInterfaces/8.0.0": { + "sha512": "3WA9q9yVqJp222P3x1wYIGDAkpjAku0TMUaaQV22g6L67AI0LdOIrVS7Ht2vJfLHGSPVuqN94vIr15qn+HEkHw==", + "type": "package", + "path": "microsoft.bcl.asyncinterfaces/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/Microsoft.Bcl.AsyncInterfaces.targets", + "buildTransitive/net462/_._", + "lib/net462/Microsoft.Bcl.AsyncInterfaces.dll", + "lib/net462/Microsoft.Bcl.AsyncInterfaces.xml", + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll", + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.xml", + "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.dll", + "lib/netstandard2.1/Microsoft.Bcl.AsyncInterfaces.xml", + "microsoft.bcl.asyncinterfaces.8.0.0.nupkg.sha512", + "microsoft.bcl.asyncinterfaces.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.Build.Framework/17.6.3": { + "sha512": "rmLkJflFxc9jGkq6kd3CHdZp8T7txNM95pYo4p0fRG4/PDE1bWyvTF98qQA/pCjousO/oqEURKEDCQBj5A0dqA==", + "type": "package", + "path": "microsoft.build.framework/17.6.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "MSBuild-NuGet-Icon.png", + "README.md", + "lib/net472/Microsoft.Build.Framework.dll", + "lib/net472/Microsoft.Build.Framework.pdb", + "lib/net472/Microsoft.Build.Framework.xml", + "lib/net7.0/Microsoft.Build.Framework.dll", + "lib/net7.0/Microsoft.Build.Framework.pdb", + "lib/net7.0/Microsoft.Build.Framework.xml", + "microsoft.build.framework.17.6.3.nupkg.sha512", + "microsoft.build.framework.nuspec", + "notices/THIRDPARTYNOTICES.txt", + "ref/net472/Microsoft.Build.Framework.dll", + "ref/net472/Microsoft.Build.Framework.xml", + "ref/net7.0/Microsoft.Build.Framework.dll", + "ref/net7.0/Microsoft.Build.Framework.xml", + "ref/netstandard2.0/Microsoft.Build.Framework.dll", + "ref/netstandard2.0/Microsoft.Build.Framework.xml" + ] + }, + "Microsoft.CodeAnalysis.BannedApiAnalyzers/3.3.2": { + "sha512": "LlcsDRSYfkJFWOdDpysY/4Ph4llHc8DLOc3roFTz9+216vl+vwVGfbys2rcSmhZCTDv/0kxSs2oOdd9SX2NiVg==", + "type": "package", + "path": "microsoft.codeanalysis.bannedapianalyzers/3.3.2", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "EULA.rtf", + "ThirdPartyNotices.rtf", + "analyzers/dotnet/cs/Microsoft.CodeAnalysis.BannedApiAnalyzers.dll", + "analyzers/dotnet/cs/Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers.dll", + "analyzers/dotnet/cs/cs/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/de/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/es/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/fr/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/it/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/ja/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/ko/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/pl/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/pt-BR/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/ru/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/tr/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/zh-Hans/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/cs/zh-Hant/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/Microsoft.CodeAnalysis.BannedApiAnalyzers.dll", + "analyzers/dotnet/vb/Microsoft.CodeAnalysis.VisualBasic.BannedApiAnalyzers.dll", + "analyzers/dotnet/vb/cs/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/de/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/es/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/fr/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/it/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/ja/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/ko/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/pl/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/pt-BR/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/ru/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/tr/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/zh-Hans/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "analyzers/dotnet/vb/zh-Hant/Microsoft.CodeAnalysis.BannedApiAnalyzers.resources.dll", + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.props", + "build/Microsoft.CodeAnalysis.BannedApiAnalyzers.targets", + "build/config/AnalysisLevel_2_9_8_AllDisabledByDefault.editorconfig", + "build/config/AnalysisLevel_2_9_8_AllEnabledByDefault.editorconfig", + "build/config/AnalysisLevel_2_9_8_Default.editorconfig", + "documentation/Analyzer Configuration.md", + "documentation/Microsoft.CodeAnalysis.BannedApiAnalyzers.md", + "documentation/Microsoft.CodeAnalysis.BannedApiAnalyzers.sarif", + "editorconfig/AllRulesDefault/.editorconfig", + "editorconfig/AllRulesDisabled/.editorconfig", + "editorconfig/AllRulesEnabled/.editorconfig", + "editorconfig/ApiDesignRulesDefault/.editorconfig", + "editorconfig/ApiDesignRulesEnabled/.editorconfig", + "editorconfig/DataflowRulesDefault/.editorconfig", + "editorconfig/DataflowRulesEnabled/.editorconfig", + "editorconfig/PortedFromFxCopRulesDefault/.editorconfig", + "editorconfig/PortedFromFxCopRulesEnabled/.editorconfig", + "microsoft.codeanalysis.bannedapianalyzers.3.3.2.nupkg.sha512", + "microsoft.codeanalysis.bannedapianalyzers.nuspec", + "rulesets/AllRulesDefault.ruleset", + "rulesets/AllRulesDisabled.ruleset", + "rulesets/AllRulesEnabled.ruleset", + "rulesets/ApiDesignRulesDefault.ruleset", + "rulesets/ApiDesignRulesEnabled.ruleset", + "rulesets/DataflowRulesDefault.ruleset", + "rulesets/DataflowRulesEnabled.ruleset", + "rulesets/PortedFromFxCopRulesDefault.ruleset", + "rulesets/PortedFromFxCopRulesEnabled.ruleset", + "tools/install.ps1", + "tools/uninstall.ps1" + ] + }, + "Microsoft.CSharp/4.7.0": { + "sha512": "pTj+D3uJWyN3My70i2Hqo+OXixq3Os2D1nJ2x92FFo6sk8fYS1m1WLNTs0Dc1uPaViH0YvEEwvzddQ7y4rhXmA==", + "type": "package", + "path": "microsoft.csharp/4.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/netcore50/Microsoft.CSharp.dll", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.3/Microsoft.CSharp.dll", + "lib/netstandard2.0/Microsoft.CSharp.dll", + "lib/netstandard2.0/Microsoft.CSharp.xml", + "lib/portable-net45+win8+wp8+wpa81/_._", + "lib/uap10.0.16299/_._", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "microsoft.csharp.4.7.0.nupkg.sha512", + "microsoft.csharp.nuspec", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcore50/Microsoft.CSharp.dll", + "ref/netcore50/Microsoft.CSharp.xml", + "ref/netcore50/de/Microsoft.CSharp.xml", + "ref/netcore50/es/Microsoft.CSharp.xml", + "ref/netcore50/fr/Microsoft.CSharp.xml", + "ref/netcore50/it/Microsoft.CSharp.xml", + "ref/netcore50/ja/Microsoft.CSharp.xml", + "ref/netcore50/ko/Microsoft.CSharp.xml", + "ref/netcore50/ru/Microsoft.CSharp.xml", + "ref/netcore50/zh-hans/Microsoft.CSharp.xml", + "ref/netcore50/zh-hant/Microsoft.CSharp.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.0/Microsoft.CSharp.dll", + "ref/netstandard1.0/Microsoft.CSharp.xml", + "ref/netstandard1.0/de/Microsoft.CSharp.xml", + "ref/netstandard1.0/es/Microsoft.CSharp.xml", + "ref/netstandard1.0/fr/Microsoft.CSharp.xml", + "ref/netstandard1.0/it/Microsoft.CSharp.xml", + "ref/netstandard1.0/ja/Microsoft.CSharp.xml", + "ref/netstandard1.0/ko/Microsoft.CSharp.xml", + "ref/netstandard1.0/ru/Microsoft.CSharp.xml", + "ref/netstandard1.0/zh-hans/Microsoft.CSharp.xml", + "ref/netstandard1.0/zh-hant/Microsoft.CSharp.xml", + "ref/netstandard2.0/Microsoft.CSharp.dll", + "ref/netstandard2.0/Microsoft.CSharp.xml", + "ref/portable-net45+win8+wp8+wpa81/_._", + "ref/uap10.0.16299/_._", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Microsoft.IO.Redist/6.0.0": { + "sha512": "uxXZ8pAcYtIJm8iqu/0e+CkM/VSwfgbHpnCDu7s8+gn/VUD5R6PxH3RGZFPaHgTisrlwD+BIyL5TqG6qwuZtOQ==", + "type": "package", + "path": "microsoft.io.redist/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net472/Microsoft.IO.Redist.dll", + "lib/net472/Microsoft.IO.Redist.xml", + "microsoft.io.redist.6.0.0.nupkg.sha512", + "microsoft.io.redist.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "Microsoft.NET.StringTools/17.6.3": { + "sha512": "N0ZIanl1QCgvUumEL1laasU0a7sOE5ZwLZVTn0pAePnfhq8P7SvTjF8Axq+CnavuQkmdQpGNXQ1efZtu5kDFbA==", + "type": "package", + "path": "microsoft.net.stringtools/17.6.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "MSBuild-NuGet-Icon.png", + "README.md", + "lib/net472/Microsoft.NET.StringTools.dll", + "lib/net472/Microsoft.NET.StringTools.pdb", + "lib/net472/Microsoft.NET.StringTools.xml", + "lib/net7.0/Microsoft.NET.StringTools.dll", + "lib/net7.0/Microsoft.NET.StringTools.pdb", + "lib/net7.0/Microsoft.NET.StringTools.xml", + "lib/netstandard2.0/Microsoft.NET.StringTools.dll", + "lib/netstandard2.0/Microsoft.NET.StringTools.pdb", + "lib/netstandard2.0/Microsoft.NET.StringTools.xml", + "microsoft.net.stringtools.17.6.3.nupkg.sha512", + "microsoft.net.stringtools.nuspec", + "notices/THIRDPARTYNOTICES.txt", + "ref/net472/Microsoft.NET.StringTools.dll", + "ref/net472/Microsoft.NET.StringTools.xml", + "ref/net7.0/Microsoft.NET.StringTools.dll", + "ref/net7.0/Microsoft.NET.StringTools.xml", + "ref/netstandard2.0/Microsoft.NET.StringTools.dll", + "ref/netstandard2.0/Microsoft.NET.StringTools.xml" + ] + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "sha512": "TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "type": "package", + "path": "microsoft.netcore.platforms/1.1.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.platforms.1.1.1.nupkg.sha512", + "microsoft.netcore.platforms.nuspec", + "runtime.json" + ] + }, + "Microsoft.NETCore.Targets/1.1.3": { + "sha512": "3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "type": "package", + "path": "microsoft.netcore.targets/1.1.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/netstandard1.0/_._", + "microsoft.netcore.targets.1.1.3.nupkg.sha512", + "microsoft.netcore.targets.nuspec", + "runtime.json" + ] + }, + "Microsoft.ServiceHub.Analyzers/4.2.102": { + "sha512": "dk/5quUffMW81tNP8BEkKYGUp5yXNvNglqclGnRVK24l6xIuxAijMOAEezz57yBhxz+oEOQLDOaUX4hcXdFRyQ==", + "type": "package", + "path": "microsoft.servicehub.analyzers/4.2.102", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "analyzers/Microsoft.ServiceHub.Analyzers.dll", + "analyzers/cs/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/de/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/es/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/fr/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/it/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/ja/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/ko/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/pl/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/pt-BR/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/ru/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/tr/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/zh-Hans/Microsoft.ServiceHub.Analyzers.resources.dll", + "analyzers/zh-Hant/Microsoft.ServiceHub.Analyzers.resources.dll", + "microsoft.servicehub.analyzers.4.2.102.nupkg.sha512", + "microsoft.servicehub.analyzers.nuspec", + "tools/install.ps1", + "tools/uninstall.ps1" + ] + }, + "Microsoft.ServiceHub.Framework/4.2.102": { + "sha512": "J1DMsHdwQsvquBtXNssNx6/KATTKmV8MvJpWxuag538fljfzNkV9NtA9AIuucVwWHriLWNOnXXk/nqWhdI9GZw==", + "type": "package", + "path": "microsoft.servicehub.framework/4.2.102", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "lib/net472/Microsoft.ServiceHub.Framework.dll", + "lib/net472/Microsoft.ServiceHub.Framework.xml", + "lib/net472/cs/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/de/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/es/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/fr/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/it/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/ja/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/ko/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/pl/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/pt-BR/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/ru/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/tr/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/zh-Hans/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net472/zh-Hant/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/Microsoft.ServiceHub.Framework.dll", + "lib/net6.0/Microsoft.ServiceHub.Framework.xml", + "lib/net6.0/cs/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/de/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/es/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/fr/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/it/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/ja/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/ko/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/pl/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/pt-BR/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/ru/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/tr/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/zh-Hans/Microsoft.ServiceHub.Framework.resources.dll", + "lib/net6.0/zh-Hant/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/Microsoft.ServiceHub.Framework.dll", + "lib/netstandard2.0/Microsoft.ServiceHub.Framework.xml", + "lib/netstandard2.0/cs/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/de/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/es/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/fr/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/it/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/ja/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/ko/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/pl/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/ru/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/tr/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.ServiceHub.Framework.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.ServiceHub.Framework.resources.dll", + "microsoft.servicehub.framework.4.2.102.nupkg.sha512", + "microsoft.servicehub.framework.nuspec" + ] + }, + "Microsoft.ServiceHub.Resources/4.2.8": { + "sha512": "qgutaUttPzy0afqXyxUXDTh2CvtlJfgO3TFpMW81P1Mhc6zbntpI+hvD2pTp8gmnFmJsPabk2xkP1WsG023RGg==", + "type": "package", + "path": "microsoft.servicehub.resources/4.2.8", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "lib/net472/Microsoft.ServiceHub.Resources.dll", + "lib/net472/Microsoft.ServiceHub.Resources.xml", + "lib/net472/cs/Microsoft.ServiceHub.Resources.dll", + "lib/net472/de/Microsoft.ServiceHub.Resources.dll", + "lib/net472/es/Microsoft.ServiceHub.Resources.dll", + "lib/net472/fr/Microsoft.ServiceHub.Resources.dll", + "lib/net472/it/Microsoft.ServiceHub.Resources.dll", + "lib/net472/ja/Microsoft.ServiceHub.Resources.dll", + "lib/net472/ko/Microsoft.ServiceHub.Resources.dll", + "lib/net472/pl/Microsoft.ServiceHub.Resources.dll", + "lib/net472/pt-BR/Microsoft.ServiceHub.Resources.dll", + "lib/net472/ru/Microsoft.ServiceHub.Resources.dll", + "lib/net472/tr/Microsoft.ServiceHub.Resources.dll", + "lib/net472/zh-Hans/Microsoft.ServiceHub.Resources.dll", + "lib/net472/zh-Hant/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/Microsoft.ServiceHub.Resources.xml", + "lib/netstandard2.0/cs/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/de/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/es/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/fr/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/it/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/ja/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/ko/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/pl/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/ru/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/tr/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.ServiceHub.Resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.ServiceHub.Resources.dll", + "microsoft.servicehub.resources.4.2.8.nupkg.sha512", + "microsoft.servicehub.resources.nuspec" + ] + }, + "Microsoft.VisualStudio.CommandBars/17.6.36389": { + "sha512": "QIauZnxkCVbP0ZVleIPZLlrEcmE4/7ZteZ+1dwFwF802ObCUK+IBLWK39PaQ0iN1eKoFSaqoKk6Zi1xqM5m5LQ==", + "type": "package", + "path": "microsoft.visualstudio.commandbars/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.CommandBars.dll", + "lib/net20/Microsoft.VisualStudio.CommandBars.xml", + "lib/net45/Microsoft.VisualStudio.CommandBars.dll", + "lib/net45/Microsoft.VisualStudio.CommandBars.xml", + "lib/net472/Microsoft.VisualStudio.CommandBars.dll", + "lib/net472/Microsoft.VisualStudio.CommandBars.xml", + "lib/net6.0/Microsoft.VisualStudio.CommandBars.dll", + "lib/net6.0/Microsoft.VisualStudio.CommandBars.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.CommandBars.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.CommandBars.xml", + "microsoft.visualstudio.commandbars.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.commandbars.nuspec" + ] + }, + "Microsoft.VisualStudio.ComponentModelHost/17.6.268": { + "sha512": "6DCKKZzmJEsXcyBLC2ypPe1G1X0ZkwygRR8H2MV7Z8LYoJn4LaG64K1oZg3bEoTrZz/K8SAjBWjr2QxMhSPBYw==", + "type": "package", + "path": "microsoft.visualstudio.componentmodelhost/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.dll", + "lib/net472/Microsoft.VisualStudio.ComponentModelHost.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.ComponentModelHost.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.ComponentModelHost.xml", + "microsoft.visualstudio.componentmodelhost.17.6.268.nupkg.sha512", + "microsoft.visualstudio.componentmodelhost.nuspec" + ] + }, + "Microsoft.VisualStudio.Composition/17.6.17": { + "sha512": "W78+hH7BG5d/UPUcT2YyrjOC/fGk0+k3CRhYwjeI+QyXZkNjNlrkKSu9Jbf61VI0nZTHfJhrWxz3LLUkk1zf9g==", + "type": "package", + "path": "microsoft.visualstudio.composition/17.6.17", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Composition.dll", + "lib/net472/Microsoft.VisualStudio.Composition.xml", + "lib/net472/cs/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/Microsoft.VisualStudio.Composition.dll", + "lib/net6.0/Microsoft.VisualStudio.Composition.xml", + "lib/net6.0/cs/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/de/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/es/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/fr/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/it/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/ja/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/ko/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/pl/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/pt-BR/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/ru/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/tr/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/zh-Hans/Microsoft.VisualStudio.Composition.resources.dll", + "lib/net6.0/zh-Hant/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Composition.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Composition.xml", + "lib/netstandard2.0/cs/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/de/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/es/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/fr/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/it/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/ja/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/ko/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/pl/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/ru/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/tr/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.VisualStudio.Composition.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.VisualStudio.Composition.resources.dll", + "microsoft.visualstudio.composition.17.6.17.nupkg.sha512", + "microsoft.visualstudio.composition.nuspec" + ] + }, + "Microsoft.VisualStudio.Composition.Analyzers/17.6.17": { + "sha512": "wNa0BYQW/azgfNq00DnMPql6z1O63vRjsIHD1ZQJWcXIIOVqaEuPe+HZgjuB37eCYEByed/4ITud2251/MFMWQ==", + "type": "package", + "path": "microsoft.visualstudio.composition.analyzers/17.6.17", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "PackageIcon.png", + "analyzers/dotnet/Microsoft.VisualStudio.Composition.Analyzers.dll", + "analyzers/dotnet/cs/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/de/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/es/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/fr/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/it/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/ja/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/ko/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/pl/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/pt-BR/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/ru/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/tr/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/zh-Hans/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "analyzers/dotnet/zh-Hant/Microsoft.VisualStudio.Composition.Analyzers.resources.dll", + "microsoft.visualstudio.composition.analyzers.17.6.17.nupkg.sha512", + "microsoft.visualstudio.composition.analyzers.nuspec", + "tools/install.ps1", + "tools/uninstall.ps1" + ] + }, + "Microsoft.VisualStudio.CoreUtility/17.6.268": { + "sha512": "hCnY7cXe20cLf4+V/CHtmpfMag5nxRSLFXaf027tJ9SSuK9j3fY+UpkJpccHGVVGmk9MsrEqY99BIHpMLiDj4w==", + "type": "package", + "path": "microsoft.visualstudio.coreutility/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.CoreUtility.dll", + "lib/net472/Microsoft.VisualStudio.CoreUtility.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.CoreUtility.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.CoreUtility.xml", + "microsoft.visualstudio.coreutility.17.6.268.nupkg.sha512", + "microsoft.visualstudio.coreutility.nuspec" + ] + }, + "Microsoft.VisualStudio.Debugger.Interop.12.0/17.6.36389": { + "sha512": "3PzOPxka39XMvuwq9OrplbwNZH/apoRjQ4qDYlpbmPZiLVj8hGMm/XmuGHdqyYj8KINwU+5CRhFc9ITOcI6Z/g==", + "type": "package", + "path": "microsoft.visualstudio.debugger.interop.12.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.12.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Debugger.Interop.12.0.dll", + "microsoft.visualstudio.debugger.interop.12.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.debugger.interop.12.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Debugger.Interop.14.0/17.6.36389": { + "sha512": "rFlRsMTTJLQMUoUKg1LXWVdgs6EvHXSK0E/Ocvs8irV2R6uv865SGlvka1bBYXbi06pUHGjlNM0FHc1mOJR6/A==", + "type": "package", + "path": "microsoft.visualstudio.debugger.interop.14.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.14.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Debugger.Interop.14.0.dll", + "microsoft.visualstudio.debugger.interop.14.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.debugger.interop.14.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Debugger.Interop.15.0/17.6.36389": { + "sha512": "Q5wxhXS0lCBi5sgQXl3yCJ8kmEp8jApIicTJgr86wVnYiFfSwfbkBF+wdNNmKv/iuNdQ9pEBJfa/jSoBreDMxg==", + "type": "package", + "path": "microsoft.visualstudio.debugger.interop.15.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.15.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Debugger.Interop.15.0.dll", + "microsoft.visualstudio.debugger.interop.15.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.debugger.interop.15.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Debugger.Interop.16.0/17.6.36389": { + "sha512": "JqOGdD8lA/mv14qMuj4Sa3zmJRkJQzbl6SKV8OCrWz2mPRNkPjSzu7tEO4TJ2WkdquWE2amtfw7epz25JUKEvQ==", + "type": "package", + "path": "microsoft.visualstudio.debugger.interop.16.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Debugger.Interop.16.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Debugger.Interop.16.0.dll", + "microsoft.visualstudio.debugger.interop.16.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.debugger.interop.16.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Designer.Interfaces/17.6.36389": { + "sha512": "vOXuyFlfXCTLM++RlEJ4NvMlSKktlZh7hNxtE8bXn59ANbc0ZfL3I5i+Z5yj8LW6bVKTYjYYmx3smZfvlR1tzg==", + "type": "package", + "path": "microsoft.visualstudio.designer.interfaces/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Designer.Interfaces.dll", + "lib/net20/Microsoft.VisualStudio.Designer.Interfaces.xml", + "lib/net45/Microsoft.VisualStudio.Designer.Interfaces.dll", + "lib/net45/Microsoft.VisualStudio.Designer.Interfaces.xml", + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.dll", + "lib/net472/Microsoft.VisualStudio.Designer.Interfaces.xml", + "lib/net6.0/Microsoft.VisualStudio.Designer.Interfaces.dll", + "lib/net6.0/Microsoft.VisualStudio.Designer.Interfaces.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Designer.Interfaces.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Designer.Interfaces.xml", + "microsoft.visualstudio.designer.interfaces.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.designer.interfaces.nuspec" + ] + }, + "Microsoft.VisualStudio.Editor/17.6.268": { + "sha512": "NtvaMUG58E8Z0JVZsI7qXZIEdTEll4UCn2z/yY4nZlqmJFMgb1AUgQ6pEM6z9+8Y7Lc82W8IwY1sJYXL9wBsRg==", + "type": "package", + "path": "microsoft.visualstudio.editor/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Editor.dll", + "lib/net472/Microsoft.VisualStudio.Editor.xml", + "microsoft.visualstudio.editor.17.6.268.nupkg.sha512", + "microsoft.visualstudio.editor.nuspec" + ] + }, + "Microsoft.VisualStudio.GraphModel/17.6.36389": { + "sha512": "ERAPR0f0fHl7VqFo3copHGjNmF5mxbtZh1z9N5eZtYtpP8846n2C8wOE3QCsReppmkz0WGitfnMxNirQ/C9j7g==", + "type": "package", + "path": "microsoft.visualstudio.graphmodel/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.GraphModel.dll", + "lib/net472/Microsoft.VisualStudio.GraphModel.xml", + "lib/net472/cs/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.GraphModel.resources.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.GraphModel.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.GraphModel.xml", + "microsoft.visualstudio.graphmodel.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.graphmodel.nuspec" + ] + }, + "Microsoft.VisualStudio.ImageCatalog/17.6.36389": { + "sha512": "gQitNRdaMVez4K+9BTvkTxnuJ96coi+/sQvRTTb4F+83hOYHHH0UiKjmgEQpjUDPxG7KlbeNN/j9cMfdX6zZgw==", + "type": "package", + "path": "microsoft.visualstudio.imagecatalog/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.ImageCatalog.dll", + "lib/net472/en/Microsoft.VisualStudio.ImageCatalog.resources.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.ImageCatalog.dll", + "lib/net6.0-windows8.0/en/Microsoft.VisualStudio.ImageCatalog.resources.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.ImageCatalog.dll", + "microsoft.visualstudio.imagecatalog.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.imagecatalog.nuspec" + ] + }, + "Microsoft.VisualStudio.Imaging/17.6.36389": { + "sha512": "twCQTtCPDBe8xkq94CgIsIa68dn7WZJosZCs2rILHR/KnQiv2X6hCpUhov90q4nh9x9S6OoLj3BCl2lBqDm1xg==", + "type": "package", + "path": "microsoft.visualstudio.imaging/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Imaging.dll", + "lib/net472/Microsoft.VisualStudio.Imaging.xml", + "lib/net472/cs/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/en/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Imaging.resources.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Imaging.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Imaging.xml", + "lib/net6.0-windows8.0/en/Microsoft.VisualStudio.Imaging.resources.dll", + "microsoft.visualstudio.imaging.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.imaging.nuspec" + ] + }, + "Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime/17.6.36387": { + "sha512": "l4deplq0ZCF9hjMRSxH0s/v/W1yHCu6liUgMG5UyOXQqeWJ2YQ/aghOoZ3Du1ZAdhiP/OzXg2YZUCVynGga3KA==", + "type": "package", + "path": "microsoft.visualstudio.imaging.interop.14.0.designtime/17.6.36387", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll", + "lib/net20/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.xml", + "lib/net45/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll", + "lib/net45/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.xml", + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll", + "lib/net472/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.xml", + "microsoft.visualstudio.imaging.interop.14.0.designtime.17.6.36387.nupkg.sha512", + "microsoft.visualstudio.imaging.interop.14.0.designtime.nuspec" + ] + }, + "Microsoft.VisualStudio.Interop/17.6.36389": { + "sha512": "XIuDWL5EW6w6Ybd6+6QkjtIaoE+QlTbHyPb0bKP4lu3Mo6HfN2e2Nb92l2cCRQdVxGyqKcS0H6S2N8XRu3hEVw==", + "type": "package", + "path": "microsoft.visualstudio.interop/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Interop.dll", + "lib/net20/Microsoft.VisualStudio.Interop.xml", + "lib/net45/Microsoft.VisualStudio.Interop.dll", + "lib/net45/Microsoft.VisualStudio.Interop.xml", + "lib/net472/Microsoft.VisualStudio.Interop.dll", + "lib/net472/Microsoft.VisualStudio.Interop.xml", + "lib/net6.0/Microsoft.VisualStudio.Interop.dll", + "lib/net6.0/Microsoft.VisualStudio.Interop.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Interop.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Interop.xml", + "microsoft.visualstudio.interop.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.interop.nuspec" + ] + }, + "Microsoft.VisualStudio.Language/17.6.268": { + "sha512": "8+6cJ/cBl3mltTWqZbwD57KeJNP7wsLjEnAIJcjIGXXbRHScx+ob6uQOreqV54sGv3ovPchfeITHwbEPUOFG5Q==", + "type": "package", + "path": "microsoft.visualstudio.language/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Language.dll", + "lib/net472/Microsoft.VisualStudio.Language.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Language.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Language.xml", + "microsoft.visualstudio.language.17.6.268.nupkg.sha512", + "microsoft.visualstudio.language.nuspec" + ] + }, + "Microsoft.VisualStudio.Language.Intellisense/17.6.268": { + "sha512": "KAqw8ZdGibeJFs9/jwR+5xQHTlXDDKN8CSDjPl+sKcB+8EjmAFVdXaNFoLapZ4pYKABNzlBzzjo/6QjJxs/HZg==", + "type": "package", + "path": "microsoft.visualstudio.language.intellisense/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.dll", + "lib/net472/Microsoft.VisualStudio.Language.Intellisense.xml", + "microsoft.visualstudio.language.intellisense.17.6.268.nupkg.sha512", + "microsoft.visualstudio.language.intellisense.nuspec" + ] + }, + "Microsoft.VisualStudio.Language.NavigateTo.Interfaces/17.6.268": { + "sha512": "ePCJCUFRxCajP1TTcDFygkluLmjx2SFCOhNWdkIJTf9JKDYtr7GdsXxnBbIelrx2TSEqd1BrnWOSYnKE0AUCpg==", + "type": "package", + "path": "microsoft.visualstudio.language.navigateto.interfaces/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.dll", + "lib/net472/Microsoft.VisualStudio.Language.NavigateTo.Interfaces.xml", + "microsoft.visualstudio.language.navigateto.interfaces.17.6.268.nupkg.sha512", + "microsoft.visualstudio.language.navigateto.interfaces.nuspec" + ] + }, + "Microsoft.VisualStudio.Language.StandardClassification/17.6.268": { + "sha512": "2pSOPqAxo40MmqeaOb+7EYcWRYqJOJOCdz2bw/TEhbLtbyPfFVHQw2pbWhNiIY7Lk4xIeB/KjLXuJ+9xsGYjrQ==", + "type": "package", + "path": "microsoft.visualstudio.language.standardclassification/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.dll", + "lib/net472/Microsoft.VisualStudio.Language.StandardClassification.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Language.StandardClassification.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Language.StandardClassification.xml", + "microsoft.visualstudio.language.standardclassification.17.6.268.nupkg.sha512", + "microsoft.visualstudio.language.standardclassification.nuspec" + ] + }, + "Microsoft.VisualStudio.LanguageServer.Client/17.6.42": { + "sha512": "sHg2C+w5tn4bIjchQZ8h4K4CVetpyu1MW9B62t46dLlYkxkloJqXXOZf9pvOSs3hYOIfyDCSJ+kP8pFp0IN2kg==", + "type": "package", + "path": "microsoft.visualstudio.languageserver.client/17.6.42", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.dll", + "lib/net472/Microsoft.VisualStudio.LanguageServer.Client.xml", + "lib/net472/cs/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.LanguageServer.Client.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.LanguageServer.Client.xml", + "lib/netstandard2.0/cs/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/de/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/es/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/fr/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/it/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/ja/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/ko/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/pl/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/ru/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/tr/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.VisualStudio.LanguageServer.Client.resources.dll", + "license.txt", + "microsoft.visualstudio.languageserver.client.17.6.42.nupkg.sha512", + "microsoft.visualstudio.languageserver.client.nuspec" + ] + }, + "Microsoft.VisualStudio.OLE.Interop/17.6.36389": { + "sha512": "rxPvy/dyvE60k4QhTC5j3K3vSPi5ih7e8d+nRn8oBf9ZI4wSQjh4Blh3uA2GS2FBsy4wbVXE2+R3Z4ztTDMNUA==", + "type": "package", + "path": "microsoft.visualstudio.ole.interop/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.OLE.Interop.dll", + "lib/net20/Microsoft.VisualStudio.OLE.Interop.xml", + "lib/net45/Microsoft.VisualStudio.OLE.Interop.dll", + "lib/net45/Microsoft.VisualStudio.OLE.Interop.xml", + "lib/net472/Microsoft.VisualStudio.OLE.Interop.dll", + "lib/net472/Microsoft.VisualStudio.OLE.Interop.xml", + "lib/net6.0/Microsoft.VisualStudio.OLE.Interop.dll", + "lib/net6.0/Microsoft.VisualStudio.OLE.Interop.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.OLE.Interop.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.OLE.Interop.xml", + "microsoft.visualstudio.ole.interop.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.ole.interop.nuspec" + ] + }, + "Microsoft.VisualStudio.Package.LanguageService.15.0/17.6.36389": { + "sha512": "o57faKgj7m0lhV75bnPwHoBnz6wh3Ga0Vmy5sUPz2WdhhAOaXomHW8OfAnFsa5oJltO0M0wmqmNGo7vWHFgkDg==", + "type": "package", + "path": "microsoft.visualstudio.package.languageservice.15.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.dll", + "lib/net472/Microsoft.VisualStudio.Package.LanguageService.15.0.xml", + "lib/net472/cs/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Package.LanguageService.15.0.resources.dll", + "microsoft.visualstudio.package.languageservice.15.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.package.languageservice.15.0.nuspec" + ] + }, + "Microsoft.VisualStudio.ProjectAggregator/17.6.36387": { + "sha512": "7ApV0BeNhHn8z5u7jfJjmszrW2q+eRkRK0dah5oJ65QJLw2tyePdTjB3376aTUzNZdlB5I4SfQ77/NcZG1MiGg==", + "type": "package", + "path": "microsoft.visualstudio.projectaggregator/17.6.36387", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.dll", + "lib/net472/Microsoft.VisualStudio.ProjectAggregator.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.ProjectAggregator.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.ProjectAggregator.xml", + "microsoft.visualstudio.projectaggregator.17.6.36387.nupkg.sha512", + "microsoft.visualstudio.projectaggregator.nuspec" + ] + }, + "Microsoft.VisualStudio.RemoteControl/16.3.52": { + "sha512": "+MgP1+Rtt1uJZyqhf7+H6KAQ57wc7v00ixuLhEgFggIbmW2/29YXfPK7gLvXw+vU7vimuM47cqAHrnB7RWYqtg==", + "type": "package", + "path": "microsoft.visualstudio.remotecontrol/16.3.52", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "PackageIcon.png", + "lib/net45/Microsoft.VisualStudio.RemoteControl.dll", + "lib/net45/Microsoft.VisualStudio.RemoteControl.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.RemoteControl.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.RemoteControl.xml", + "microsoft.visualstudio.remotecontrol.16.3.52.nupkg.sha512", + "microsoft.visualstudio.remotecontrol.nuspec" + ] + }, + "Microsoft.VisualStudio.RpcContracts/17.6.13": { + "sha512": "5nO6sHprMquSPZIzBQiUm0Qk1x0ParM7A4ka7L6EuttHJHIk3evRXLShmpmYsGHCFMR4zg9VH1bfM05996nDVA==", + "type": "package", + "path": "microsoft.visualstudio.rpccontracts/17.6.13", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE", + "NOTICE", + "PackageIcon.png", + "lib/net6.0/Microsoft.VisualStudio.RpcContracts.dll", + "lib/net6.0/Microsoft.VisualStudio.RpcContracts.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.RpcContracts.xml", + "microsoft.visualstudio.rpccontracts.17.6.13.nupkg.sha512", + "microsoft.visualstudio.rpccontracts.nuspec" + ] + }, + "Microsoft.VisualStudio.SDK/17.6.36389": { + "sha512": "G8ksgSCPCB4OaGMuNXWJnO+0e2gSgBMxts7eGMRwnR0WCkb/w3QQrKaxKcf3U1V4jC67A+KmTo9KuUNtX+xZ0g==", + "type": "package", + "path": "microsoft.visualstudio.sdk/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "microsoft.visualstudio.sdk.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.sdk.nuspec" + ] + }, + "Microsoft.VisualStudio.SDK.Analyzers/16.10.10": { + "sha512": "LuhBHy7MJJ5SjpS7J2GuHqPyL1VeqXUwYc+mTagaUCzXbNwJmLcSUAioCyQyAzPIn6qtnzuM5Lz6ULOQS3ifUA==", + "type": "package", + "path": "microsoft.visualstudio.sdk.analyzers/16.10.10", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "PackageIcon.png", + "analyzers/cs/Microsoft.VisualStudio.SDK.Analyzers.CodeFixes.dll", + "analyzers/cs/Microsoft.VisualStudio.SDK.Analyzers.CodeFixes.pdb", + "analyzers/cs/Microsoft.VisualStudio.SDK.Analyzers.dll", + "analyzers/cs/Microsoft.VisualStudio.SDK.Analyzers.pdb", + "build/AdditionalFiles/BannedSymbols.txt", + "build/AdditionalFiles/vs-threading.LegacyThreadSwitchingMembers.txt", + "build/AdditionalFiles/vs-threading.MainThreadAssertingMethods.txt", + "build/AdditionalFiles/vs-threading.MainThreadSwitchingMethods.txt", + "build/AdditionalFiles/vs-threading.MembersRequiringMainThread.txt", + "build/Microsoft.VisualStudio.SDK.Analyzers.targets", + "microsoft.visualstudio.sdk.analyzers.16.10.10.nupkg.sha512", + "microsoft.visualstudio.sdk.analyzers.nuspec", + "tools/install.ps1", + "tools/uninstall.ps1" + ] + }, + "Microsoft.VisualStudio.Setup.Configuration.Interop/3.6.2115": { + "sha512": "oI3F7o12Z46O8v3lbdR3ToiB+8NNjIqmFrFFRQMpTCPuvwfoKwy+TkyxcRVR0rnaZ57F60c/ofqg9qEMJdIb8w==", + "type": "package", + "path": "microsoft.visualstudio.setup.configuration.interop/3.6.2115", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "build/Microsoft.VisualStudio.Setup.Configuration.Interop.targets", + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.dll", + "lib/net35/Microsoft.VisualStudio.Setup.Configuration.Interop.xml", + "lib/netstandard2.1/Microsoft.VisualStudio.Setup.Configuration.Interop.dll", + "lib/netstandard2.1/Microsoft.VisualStudio.Setup.Configuration.Interop.xml", + "microsoft.visualstudio.setup.configuration.interop.3.6.2115.nupkg.sha512", + "microsoft.visualstudio.setup.configuration.interop.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.15.0/17.6.36389": { + "sha512": "can/Bo1Zq/zFQXJgBuZg/GRbMFtZ93QkVLyGOqM1twyqOc6UzlaUgO/aK0pB6n5Mti6IG7oehroG13Rhg0RPpw==", + "type": "package", + "path": "microsoft.visualstudio.shell.15.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Shell.15.0.dll", + "lib/net472/Microsoft.VisualStudio.Shell.15.0.xml", + "lib/net472/cs/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Shell.15.0.resources.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Shell.15.0.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Shell.15.0.xml", + "microsoft.visualstudio.shell.15.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.15.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Design/17.6.36389": { + "sha512": "rh3rzAj+h82U6Fg6qx03XiaGntSJ5qJjwJMESzkbOk61p66nuVbeYMd5Oq+8Kx+YH+NgHKJXr16CqYUvHSx/Ww==", + "type": "package", + "path": "microsoft.visualstudio.shell.design/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Shell.Design.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Design.xml", + "lib/net472/cs/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Shell.Design.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Shell.Design.resources.dll", + "microsoft.visualstudio.shell.design.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.design.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Framework/17.6.36389": { + "sha512": "+nMuikijhR6WQeA6iIAMeTeInSzra4skPVskXOHxj6ECGhBJvi5B6T1TX5B016YUADgnqDwlKlgRYmUEQfIbOQ==", + "type": "package", + "path": "microsoft.visualstudio.shell.framework/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Shell.Framework.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Framework.xml", + "lib/net472/cs/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Shell.Framework.resources.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Shell.Framework.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Shell.Framework.xml", + "microsoft.visualstudio.shell.framework.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.framework.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Interop/17.6.36389": { + "sha512": "kiMf6YDh1Yt+JPvUveiwOyvLGpXI0WWCjv/nubFV507I1jrRK0ux5DnYnWQ3J/AmvpAJ3Gj6QL2add84rXJi+g==", + "type": "package", + "path": "microsoft.visualstudio.shell.interop/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.dll", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.xml", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.dll", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.xml", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.xml", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.dll", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.xml", + "microsoft.visualstudio.shell.interop.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.interop.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Interop.10.0/17.6.36389": { + "sha512": "ciVnSl4i+pQwHYevCZ6+9cP5ZrWthvQV5B1PQjuTbx18z+ni6OjXJbolCwQOpL18rP9EvEpugHp6gE+JAs7jsw==", + "type": "package", + "path": "microsoft.visualstudio.shell.interop.10.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.10.0.dll", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.10.0.xml", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.10.0.dll", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.10.0.xml", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.10.0.xml", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.10.0.dll", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.10.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.10.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.10.0.xml", + "microsoft.visualstudio.shell.interop.10.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.interop.10.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Interop.11.0/17.6.36389": { + "sha512": "3hS0ulDFHjC6ETVZsSOZDLedLAhDL5zRwL1pAcen1qKe6QLfvSexI5hKYH18jN3vYoXh7+4gOgOaJ4pKFGtAdQ==", + "type": "package", + "path": "microsoft.visualstudio.shell.interop.11.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.11.0.dll", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.11.0.xml", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.11.0.dll", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.11.0.xml", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.11.0.xml", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.11.0.dll", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.11.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.11.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.11.0.xml", + "microsoft.visualstudio.shell.interop.11.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.interop.11.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Interop.12.0/17.6.36389": { + "sha512": "vr2LgVzVBWCnBcGu4PG2S/GabxjF+anpFARzAaR6H0WolMJ8v4CDYOCfS6SGZ+s5hj1+PZNTLd7LFwnidokuKw==", + "type": "package", + "path": "microsoft.visualstudio.shell.interop.12.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.12.0.dll", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.12.0.xml", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.12.0.dll", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.12.0.xml", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.12.0.xml", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.12.0.dll", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.12.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.12.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.12.0.xml", + "microsoft.visualstudio.shell.interop.12.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.interop.12.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Interop.8.0/17.6.36389": { + "sha512": "cKd52rPBki0RDtk2IXqGzY38VCUT27Uc1P8kaa5PUnnxfsrxLfPInCRk6/U1024lLB/iE23NKo0xT8uvrSVecw==", + "type": "package", + "path": "microsoft.visualstudio.shell.interop.8.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.8.0.dll", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.8.0.xml", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.8.0.dll", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.8.0.xml", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.8.0.xml", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.8.0.dll", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.8.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.8.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.8.0.xml", + "microsoft.visualstudio.shell.interop.8.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.interop.8.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Shell.Interop.9.0/17.6.36389": { + "sha512": "cN4c0yPoL1zqyP8/LxW6VFJKBAW+IimBpneYyhAr66fa7Jh3T11/IkhTP8Cn8fvIZkNgr0nImQ36n3LtvYh0lA==", + "type": "package", + "path": "microsoft.visualstudio.shell.interop.9.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.9.0.dll", + "lib/net20/Microsoft.VisualStudio.Shell.Interop.9.0.xml", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.9.0.dll", + "lib/net45/Microsoft.VisualStudio.Shell.Interop.9.0.xml", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.dll", + "lib/net472/Microsoft.VisualStudio.Shell.Interop.9.0.xml", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.9.0.dll", + "lib/net6.0/Microsoft.VisualStudio.Shell.Interop.9.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.9.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Shell.Interop.9.0.xml", + "microsoft.visualstudio.shell.interop.9.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.shell.interop.9.0.nuspec" + ] + }, + "Microsoft.VisualStudio.TaskRunnerExplorer.14.0/14.0.0": { + "sha512": "iZpAv8bEWjkyxFF1GIcSOfldqP/umopJKnJGKHa0vg8KR7ZY3u3dWtJmwO4w3abIx+176SIkQe78y5A+/Md7FA==", + "type": "package", + "path": "microsoft.visualstudio.taskrunnerexplorer.14.0/14.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net40/Microsoft.VisualStudio.TaskRunnerExplorer.14.0.dll", + "microsoft.visualstudio.taskrunnerexplorer.14.0.14.0.0.nupkg.sha512", + "microsoft.visualstudio.taskrunnerexplorer.14.0.nuspec" + ] + }, + "Microsoft.VisualStudio.Telemetry/17.6.46": { + "sha512": "1/hoYc2oPOnVx34kxsjHB/lwt/w4dHPltp8iztUmTVcLS0kcvIajDLlMCEkxN1BfPm7OmWSpJlY1CNzxNHMcmg==", + "type": "package", + "path": "microsoft.visualstudio.telemetry/17.6.46", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "PackageIcon.png", + "lib/net45/Microsoft.VisualStudio.Telemetry.dll", + "lib/net45/Microsoft.VisualStudio.Telemetry.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Telemetry.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Telemetry.xml", + "microsoft.visualstudio.telemetry.17.6.46.nupkg.sha512", + "microsoft.visualstudio.telemetry.nuspec" + ] + }, + "Microsoft.VisualStudio.Text.Data/17.6.268": { + "sha512": "aaYH491VMAOIHUQw6/CIjRhF/DHWyjMfZdfUtw+71FbWJb+xCrxPl3AcUysHqo79JdubacXsXWnkD6SZVGa0Gg==", + "type": "package", + "path": "microsoft.visualstudio.text.data/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Text.Data.dll", + "lib/net472/Microsoft.VisualStudio.Text.Data.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Text.Data.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Text.Data.xml", + "microsoft.visualstudio.text.data.17.6.268.nupkg.sha512", + "microsoft.visualstudio.text.data.nuspec" + ] + }, + "Microsoft.VisualStudio.Text.Logic/17.6.268": { + "sha512": "7dH7BbK0VaNd7qX74nD1SzjJMF4Sn5j9etcL0uxIVetXN7zhyWz307prkyN1JoRCLJQKwPAK2CP3NuL3td9D7A==", + "type": "package", + "path": "microsoft.visualstudio.text.logic/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Text.Logic.dll", + "lib/net472/Microsoft.VisualStudio.Text.Logic.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Text.Logic.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Text.Logic.xml", + "microsoft.visualstudio.text.logic.17.6.268.nupkg.sha512", + "microsoft.visualstudio.text.logic.nuspec" + ] + }, + "Microsoft.VisualStudio.Text.UI/17.6.268": { + "sha512": "nnV+n0XccVOsr0PC2mo5MTHAV+zHKJGk7NriLJ9UbexKRi203CPsQU+t9JxAN6ucgoCLe3DyowknPf3KAQkl5Q==", + "type": "package", + "path": "microsoft.visualstudio.text.ui/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Text.UI.dll", + "lib/net472/Microsoft.VisualStudio.Text.UI.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Text.UI.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Text.UI.xml", + "microsoft.visualstudio.text.ui.17.6.268.nupkg.sha512", + "microsoft.visualstudio.text.ui.nuspec" + ] + }, + "Microsoft.VisualStudio.Text.UI.Wpf/17.6.268": { + "sha512": "6i0rXz7RQbT4nLdErealR1ig+gKSL+9kr+68AGamzQuuqR8SZK8vbPYQyuk1U2BDcZq/A7wvTYaDJawbPwYgyA==", + "type": "package", + "path": "microsoft.visualstudio.text.ui.wpf/17.6.268", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.dll", + "lib/net472/Microsoft.VisualStudio.Text.UI.Wpf.xml", + "microsoft.visualstudio.text.ui.wpf.17.6.268.nupkg.sha512", + "microsoft.visualstudio.text.ui.wpf.nuspec" + ] + }, + "Microsoft.VisualStudio.TextManager.Interop/17.6.36389": { + "sha512": "GenqHFfwL+PbMcMFdXT4ZSjG5J9SD+kHRzVuNYzpGn2MMGCj3L8Nv09yz5sfUFOX5RkR5DxXJsOB6XOjnK8RZA==", + "type": "package", + "path": "microsoft.visualstudio.textmanager.interop/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.dll", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.xml", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.dll", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.xml", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.dll", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.xml", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.dll", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.xml", + "microsoft.visualstudio.textmanager.interop.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.textmanager.interop.nuspec" + ] + }, + "Microsoft.VisualStudio.TextManager.Interop.10.0/17.6.36389": { + "sha512": "EwFOc6VwZCV4YL2+zxjs1cHiqrBP0PdosHwLwJVvllyVqpXV/IHlVrLgA7+E9wGZ+xUUY+V8vqa7aZzamYoGPQ==", + "type": "package", + "path": "microsoft.visualstudio.textmanager.interop.10.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.10.0.dll", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.10.0.xml", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.10.0.dll", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.10.0.xml", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.dll", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.10.0.xml", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.10.0.dll", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.10.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.10.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.10.0.xml", + "microsoft.visualstudio.textmanager.interop.10.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.textmanager.interop.10.0.nuspec" + ] + }, + "Microsoft.VisualStudio.TextManager.Interop.11.0/17.6.36389": { + "sha512": "gcyClAwJpffHoeUYANhHL7ZZg9wjc9L4la9FlLCjllvCesC5w0JqJJGo+DqGxTwx2wvnuw/yZ/GHnyGsKKm/JQ==", + "type": "package", + "path": "microsoft.visualstudio.textmanager.interop.11.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.11.0.dll", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.11.0.xml", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.11.0.dll", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.11.0.xml", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.dll", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.11.0.xml", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.11.0.dll", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.11.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.11.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.11.0.xml", + "microsoft.visualstudio.textmanager.interop.11.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.textmanager.interop.11.0.nuspec" + ] + }, + "Microsoft.VisualStudio.TextManager.Interop.12.0/17.6.36389": { + "sha512": "YYLgywXiXOwqCdGd8uGTcMPA4sQcjaGom2RAkjzIgkxtUBH50eOzAwsaujZkxFEaR9PMJb89FjOsShaTE1R53Q==", + "type": "package", + "path": "microsoft.visualstudio.textmanager.interop.12.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.12.0.dll", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.12.0.xml", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.12.0.dll", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.12.0.xml", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.dll", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.12.0.xml", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.12.0.dll", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.12.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.12.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.12.0.xml", + "microsoft.visualstudio.textmanager.interop.12.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.textmanager.interop.12.0.nuspec" + ] + }, + "Microsoft.VisualStudio.TextManager.Interop.8.0/17.6.36389": { + "sha512": "6Rzm6+hCN1wr4gcw7SoOml6et9n0WWMBes56PQlSedNSxkRJIeoqMaT1oP66Cks0O5js8kK01j4cMQMdaLHCJw==", + "type": "package", + "path": "microsoft.visualstudio.textmanager.interop.8.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.8.0.dll", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.8.0.xml", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.8.0.dll", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.8.0.xml", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.dll", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.8.0.xml", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.8.0.dll", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.8.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.8.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.8.0.xml", + "microsoft.visualstudio.textmanager.interop.8.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.textmanager.interop.8.0.nuspec" + ] + }, + "Microsoft.VisualStudio.TextManager.Interop.9.0/17.6.36389": { + "sha512": "pcopP5Slx49GJURMUwWhh2WVN9UAzifw8XmvgiEdEFA3eeYUFxb6CoAQTaBXwIAMEnw2xo3Zw2N0C24IbHSIjw==", + "type": "package", + "path": "microsoft.visualstudio.textmanager.interop.9.0/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.9.0.dll", + "lib/net20/Microsoft.VisualStudio.TextManager.Interop.9.0.xml", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.9.0.dll", + "lib/net45/Microsoft.VisualStudio.TextManager.Interop.9.0.xml", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.dll", + "lib/net472/Microsoft.VisualStudio.TextManager.Interop.9.0.xml", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.9.0.dll", + "lib/net6.0/Microsoft.VisualStudio.TextManager.Interop.9.0.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.9.0.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.TextManager.Interop.9.0.xml", + "microsoft.visualstudio.textmanager.interop.9.0.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.textmanager.interop.9.0.nuspec" + ] + }, + "Microsoft.VisualStudio.TextTemplating.VSHost/17.6.36389": { + "sha512": "vt1arGIrjBal0pqdnBA4qp0pD94YPHdLhoEb35iuXgc3C8hnqhmq3yMn9ICdc7ID6ULxVV7yXThf9L4parzWWQ==", + "type": "package", + "path": "microsoft.visualstudio.texttemplating.vshost/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.dll", + "lib/net472/Microsoft.VisualStudio.TextTemplating.VSHost.xml", + "microsoft.visualstudio.texttemplating.vshost.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.texttemplating.vshost.nuspec" + ] + }, + "Microsoft.VisualStudio.Threading/17.6.40": { + "sha512": "hLa/0xargG7p3bF7aeq2/lRYn/bVnfZXurUWVHx+MNqxxAUjIDMKi4OIOWbYQ/DTkbn9gv8TLvgso+6EtHVQQg==", + "type": "package", + "path": "microsoft.visualstudio.threading/17.6.40", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Threading.dll", + "lib/net472/Microsoft.VisualStudio.Threading.xml", + "lib/net472/cs/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/Microsoft.VisualStudio.Threading.dll", + "lib/net6.0-windows7.0/Microsoft.VisualStudio.Threading.xml", + "lib/net6.0-windows7.0/cs/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/de/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/es/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/fr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/it/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/ja/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/ko/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/pl/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/pt-BR/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/ru/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/tr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/zh-Hans/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0-windows7.0/zh-Hant/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/Microsoft.VisualStudio.Threading.dll", + "lib/net6.0/Microsoft.VisualStudio.Threading.xml", + "lib/net6.0/cs/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/de/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/es/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/fr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/it/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/ja/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/ko/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/pl/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/pt-BR/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/ru/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/tr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/zh-Hans/Microsoft.VisualStudio.Threading.resources.dll", + "lib/net6.0/zh-Hant/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Threading.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Threading.xml", + "lib/netstandard2.0/cs/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/de/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/es/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/fr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/it/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/ja/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/ko/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/pl/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/ru/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/tr/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.VisualStudio.Threading.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.VisualStudio.Threading.resources.dll", + "microsoft.visualstudio.threading.17.6.40.nupkg.sha512", + "microsoft.visualstudio.threading.nuspec" + ] + }, + "Microsoft.VisualStudio.Threading.Analyzers/17.6.40": { + "sha512": "uU8vYr/Nx3ldEWcsbiHiyAX1G7od3eFK1+Aga6ZvgCvU+nQkcXYVkIMcSEkIDWkFaldx1dkoVvX3KRNQD0R7dw==", + "type": "package", + "path": "microsoft.visualstudio.threading.analyzers/17.6.40", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "PackageIcon.png", + "analyzers/cs/Microsoft.VisualStudio.Threading.Analyzers.CSharp.dll", + "analyzers/cs/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.dll", + "analyzers/cs/Microsoft.VisualStudio.Threading.Analyzers.dll", + "analyzers/cs/cs/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/de/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/es/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/fr/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/it/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/ja/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/ko/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/pl/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/pt-BR/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/ru/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/tr/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/zh-Hans/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/cs/zh-Hant/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.dll", + "analyzers/vb/Microsoft.VisualStudio.Threading.Analyzers.VisualBasic.dll", + "analyzers/vb/Microsoft.VisualStudio.Threading.Analyzers.dll", + "analyzers/vb/cs/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/de/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/es/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/fr/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/it/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/ja/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/ko/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/pl/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/pt-BR/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/ru/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/tr/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/zh-Hans/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "analyzers/vb/zh-Hant/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes.resources.dll", + "build/AdditionalFiles/vs-threading.LegacyThreadSwitchingMembers.txt", + "build/AdditionalFiles/vs-threading.MainThreadAssertingMethods.txt", + "build/AdditionalFiles/vs-threading.MainThreadSwitchingMethods.txt", + "build/AdditionalFiles/vs-threading.MembersRequiringMainThread.txt", + "build/Microsoft.VisualStudio.Threading.Analyzers.targets", + "microsoft.visualstudio.threading.analyzers.17.6.40.nupkg.sha512", + "microsoft.visualstudio.threading.analyzers.nuspec", + "tools/install.ps1", + "tools/uninstall.ps1" + ] + }, + "Microsoft.VisualStudio.Utilities/17.6.36389": { + "sha512": "VVr9yCeFdzeeR/4I2fLpFrUHOaQYDm83Mu0WUCmrslLCroTacm4iOxsZPOR6hze5eKdXzI2D16RgienBjBJetw==", + "type": "package", + "path": "microsoft.visualstudio.utilities/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.Utilities.dll", + "lib/net472/Microsoft.VisualStudio.Utilities.xml", + "lib/net472/cs/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/de/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/en/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/es/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/fr/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/it/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/ja/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/ko/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/pl/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/pt-BR/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/ru/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/tr/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/zh-Hans/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net472/zh-Hant/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Utilities.dll", + "lib/net6.0-windows8.0/Microsoft.VisualStudio.Utilities.xml", + "lib/net6.0-windows8.0/en/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/Microsoft.VisualStudio.Utilities.dll", + "lib/net6.0/Microsoft.VisualStudio.Utilities.xml", + "lib/net6.0/cs/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/de/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/en/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/es/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/fr/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/it/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/ja/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/ko/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/pl/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/pt-BR/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/ru/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/tr/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/zh-Hans/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/net6.0/zh-Hant/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Utilities.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Utilities.xml", + "lib/netstandard2.0/cs/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/de/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/en/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/es/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/fr/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/it/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/ja/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/ko/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/pl/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/ru/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/tr/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.VisualStudio.Utilities.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.VisualStudio.Utilities.resources.dll", + "microsoft.visualstudio.utilities.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.utilities.nuspec" + ] + }, + "Microsoft.VisualStudio.Utilities.Internal/16.3.42": { + "sha512": "com/WkhcYqWZi6JFcqHOMGnmEEA1bErS4m2gyLMmTJ5qUDcGcP6bP6XYjMc4WrTmqkutqwLo+Wufyps5qAx6nw==", + "type": "package", + "path": "microsoft.visualstudio.utilities.internal/16.3.42", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "PackageIcon.png", + "lib/net45/Microsoft.VisualStudio.Utilities.Internal.dll", + "lib/net45/Microsoft.VisualStudio.Utilities.Internal.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.Utilities.Internal.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Utilities.Internal.xml", + "microsoft.visualstudio.utilities.internal.16.3.42.nupkg.sha512", + "microsoft.visualstudio.utilities.internal.nuspec" + ] + }, + "Microsoft.VisualStudio.Validation/17.6.11": { + "sha512": "J+9L/iac6c8cwcgVSCMuoIYOlD1Jw4mbZ8XMe1IZVj8p8+3dJ46LnnkIkTRMjK7xs9UtU9MoUp1JGhWoN6fAEw==", + "type": "package", + "path": "microsoft.visualstudio.validation/17.6.11", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "PackageIcon.png", + "README.md", + "lib/net6.0/Microsoft.VisualStudio.Validation.dll", + "lib/net6.0/Microsoft.VisualStudio.Validation.xml", + "lib/net6.0/cs/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/de/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/es/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/fr/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/it/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/ja/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/ko/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/pl/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/pt-BR/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/ru/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/tr/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/zh-Hans/Microsoft.VisualStudio.Validation.resources.dll", + "lib/net6.0/zh-Hant/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.Validation.xml", + "lib/netstandard2.0/cs/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/de/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/es/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/fr/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/it/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/ja/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/ko/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/pl/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/pt-BR/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/ru/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/tr/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/zh-Hans/Microsoft.VisualStudio.Validation.resources.dll", + "lib/netstandard2.0/zh-Hant/Microsoft.VisualStudio.Validation.resources.dll", + "microsoft.visualstudio.validation.17.6.11.nupkg.sha512", + "microsoft.visualstudio.validation.nuspec" + ] + }, + "Microsoft.VisualStudio.VCProjectEngine/17.6.36389": { + "sha512": "b3SKi534lw/rWw2sUytIeoWvVIbaw7W8/MOE1QTVTYVayUx+21yuhjr3+GBmAdMCCpwj8KHraBBF/s5S0DjRlw==", + "type": "package", + "path": "microsoft.visualstudio.vcprojectengine/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net472/Microsoft.VisualStudio.VCProjectEngine.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.VCProjectEngine.dll", + "microsoft.visualstudio.vcprojectengine.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.vcprojectengine.nuspec" + ] + }, + "Microsoft.VisualStudio.VSHelp/17.6.36389": { + "sha512": "grAduqM0IUFqggEm8i/lTUnQRUjJFFFWw3avIUY8Tsnw1Y5CFg5FAm3Zn6I2EDItQ7RnbqF6JhG+s4lxnpc6BA==", + "type": "package", + "path": "microsoft.visualstudio.vshelp/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.VSHelp.dll", + "lib/net20/Microsoft.VisualStudio.VSHelp.xml", + "lib/net45/Microsoft.VisualStudio.VSHelp.dll", + "lib/net45/Microsoft.VisualStudio.VSHelp.xml", + "lib/net472/Microsoft.VisualStudio.VSHelp.dll", + "lib/net472/Microsoft.VisualStudio.VSHelp.xml", + "lib/net6.0/Microsoft.VisualStudio.VSHelp.dll", + "lib/net6.0/Microsoft.VisualStudio.VSHelp.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.VSHelp.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.VSHelp.xml", + "microsoft.visualstudio.vshelp.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.vshelp.nuspec" + ] + }, + "Microsoft.VisualStudio.VSHelp80/17.6.36389": { + "sha512": "MYI2Vy7pZa9cqOdIT6YB+ffVM2KztMS/fJM7NfBIAbFlT5ReRSz8JCD6xf/9uBR6KTSXeT8zrSWF74pBjhY+BQ==", + "type": "package", + "path": "microsoft.visualstudio.vshelp80/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.VSHelp80.dll", + "lib/net20/Microsoft.VisualStudio.VSHelp80.xml", + "lib/net45/Microsoft.VisualStudio.VSHelp80.dll", + "lib/net45/Microsoft.VisualStudio.VSHelp80.xml", + "lib/net472/Microsoft.VisualStudio.VSHelp80.dll", + "lib/net472/Microsoft.VisualStudio.VSHelp80.xml", + "lib/net6.0/Microsoft.VisualStudio.VSHelp80.dll", + "lib/net6.0/Microsoft.VisualStudio.VSHelp80.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.VSHelp80.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.VSHelp80.xml", + "microsoft.visualstudio.vshelp80.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.vshelp80.nuspec" + ] + }, + "Microsoft.VisualStudio.WCFReference.Interop/17.6.36389": { + "sha512": "QFMi0THvj4gvJjXuFqg9c94Xu0vsSIhRH9ZsLZdqTPS+skIdTskxLNO5P/e70wLlMRlO6IkQbe7yKv6D0kKEyw==", + "type": "package", + "path": "microsoft.visualstudio.wcfreference.interop/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/Microsoft.VisualStudio.WCFReference.Interop.dll", + "lib/net20/Microsoft.VisualStudio.WCFReference.Interop.xml", + "lib/net45/Microsoft.VisualStudio.WCFReference.Interop.dll", + "lib/net45/Microsoft.VisualStudio.WCFReference.Interop.xml", + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.dll", + "lib/net472/Microsoft.VisualStudio.WCFReference.Interop.xml", + "lib/net6.0/Microsoft.VisualStudio.WCFReference.Interop.dll", + "lib/net6.0/Microsoft.VisualStudio.WCFReference.Interop.xml", + "lib/netstandard2.0/Microsoft.VisualStudio.WCFReference.Interop.dll", + "lib/netstandard2.0/Microsoft.VisualStudio.WCFReference.Interop.xml", + "microsoft.visualstudio.wcfreference.interop.17.6.36389.nupkg.sha512", + "microsoft.visualstudio.wcfreference.interop.nuspec" + ] + }, + "Microsoft.VisualStudio.Web.BrowserLink.12.0/12.0.0": { + "sha512": "HeuaZh8+wNVdwx7VF8guFGH2Z2zH+FYxWBsRNp+FjjlmrhCfM7GUQV5azaTv/bN5TPaK8ALJoP9UX5o1FB5k1A==", + "type": "package", + "path": "microsoft.visualstudio.web.browserlink.12.0/12.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.dll", + "lib/net40/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/cs/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/de/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/es/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/fr/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/it/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/ja/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/ko/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/pl/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/pt-br/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/ru/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/tr/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/za-Hant/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "lib/net40/zh-Hans/Microsoft.VisualStudio.Web.BrowserLink.12.0.xml", + "microsoft.visualstudio.web.browserlink.12.0.12.0.0.nupkg.sha512", + "microsoft.visualstudio.web.browserlink.12.0.nuspec" + ] + }, + "Microsoft.VSSDK.BuildTools/17.6.2164": { + "sha512": "SIyMfFGhGfJ4NLgbwW157ylbR0OCZJrxy7ge+jX14Fmhedj+SLQG9duqc0FRnIvMq4e1EmLNEAHE2wvXu1h+/w==", + "type": "package", + "path": "microsoft.vssdk.buildtools/17.6.2164", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "NOTICE.txt", + "PackageIcon.png", + "build/Microsoft.VSSDK.BuildTools.props", + "build/Microsoft.VSSDK.BuildTools.targets", + "microsoft.vssdk.buildtools.17.6.2164.nupkg.sha512", + "microsoft.vssdk.buildtools.nuspec", + "tools/vssdk/Empty.resx", + "tools/vssdk/MessagePack.Annotations.dll", + "tools/vssdk/MessagePack.dll", + "tools/vssdk/Microsoft.Bcl.AsyncInterfaces.dll", + "tools/vssdk/Microsoft.IO.Redist.dll", + "tools/vssdk/Microsoft.Internal.VisualStudio.Shell.Framework.dll", + "tools/vssdk/Microsoft.VisualStudio.ExtensionEngine.dll", + "tools/vssdk/Microsoft.VisualStudio.ExtensionEngineContract.dll", + "tools/vssdk/Microsoft.VisualStudio.Sdk.BuildTasks.17.0.dll", + "tools/vssdk/Microsoft.VisualStudio.Sdk.BuildTasks.dll", + "tools/vssdk/Microsoft.VisualStudio.Sdk.Common.targets", + "tools/vssdk/Microsoft.VisualStudio.Setup.Common.dll", + "tools/vssdk/Microsoft.VisualStudio.Shell.15.0.dll", + "tools/vssdk/Microsoft.VisualStudio.Shell.Framework.dll", + "tools/vssdk/Microsoft.VisualStudio.Threading.dll", + "tools/vssdk/Microsoft.VisualStudio.Validation.dll", + "tools/vssdk/Microsoft.VsSDK.Cpp.Overrides.targets", + "tools/vssdk/Microsoft.VsSDK.Cpp.targets", + "tools/vssdk/Microsoft.VsSDK.targets", + "tools/vssdk/Nerdbank.Streams.dll", + "tools/vssdk/Newtonsoft.Json.dll", + "tools/vssdk/PkgDefMgmt.dll", + "tools/vssdk/ProjectItemsSchema.xml", + "tools/vssdk/System.IO.Pipelines.dll", + "tools/vssdk/System.Reflection.Metadata.dll", + "tools/vssdk/System.Threading.Tasks.Extensions.dll", + "tools/vssdk/bin/ConvertCTCToVSCT.pl", + "tools/vssdk/bin/CreatePkgDef.exe", + "tools/vssdk/bin/CreatePkgDef.exe.config", + "tools/vssdk/bin/DebugSamples.dll", + "tools/vssdk/bin/RegRiched20.exe", + "tools/vssdk/bin/VSCT.exe", + "tools/vssdk/bin/VSCTCompress.dll", + "tools/vssdk/bin/VSCTLibrary.dll", + "tools/vssdk/bin/VsixCommandLine.dll", + "tools/vssdk/bin/VsixPublisher.exe", + "tools/vssdk/bin/VsixPublisher.exe.config", + "tools/vssdk/bin/VsixUtil.exe", + "tools/vssdk/bin/VsixUtil.exe.config", + "tools/vssdk/bin/arm64/CreatePkgDef.exe", + "tools/vssdk/bin/arm64/CreatePkgDef.exe.config", + "tools/vssdk/bin/arm64/lib/Microsoft.VisualStudio.Shell.Framework.dll", + "tools/vssdk/bin/lib/Dia2Lib.dll", + "tools/vssdk/bin/lib/MessagePack.Annotations.dll", + "tools/vssdk/bin/lib/MessagePack.dll", + "tools/vssdk/bin/lib/Microsoft.Bcl.AsyncInterfaces.dll", + "tools/vssdk/bin/lib/Microsoft.Build.Framework.dll", + "tools/vssdk/bin/lib/Microsoft.Diagnostics.FastSerialization.dll", + "tools/vssdk/bin/lib/Microsoft.Diagnostics.Tracing.TraceEvent.dll", + "tools/vssdk/bin/lib/Microsoft.IO.Redist.dll", + "tools/vssdk/bin/lib/Microsoft.Internal.Performance.CodeMarkers.DesignTime.dll", + "tools/vssdk/bin/lib/Microsoft.Internal.VisualStudio.Interop.dll", + "tools/vssdk/bin/lib/Microsoft.Internal.VisualStudio.Shell.Framework.dll", + "tools/vssdk/bin/lib/Microsoft.ServiceHub.Framework.dll", + "tools/vssdk/bin/lib/Microsoft.ServiceHub.Resources.dll", + "tools/vssdk/bin/lib/Microsoft.TeamFoundation.Common.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.ComponentModelHost.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Composition.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.CoreUtility.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.ExtensionEngine.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.ExtensionEngineContract.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.GraphModel.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.ImageCatalog.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Imaging.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Interop.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.ProjectAggregator.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.RemoteControl.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.RpcContracts.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Services.Common.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Services.WebApi.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Setup.Common.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Setup.Configuration.Interop.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Setup.Download.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Setup.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Shell.15.0.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Shell.Framework.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Telemetry.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Text.Data.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Threading.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Utilities.Internal.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Utilities.dll", + "tools/vssdk/bin/lib/Microsoft.VisualStudio.Validation.dll", + "tools/vssdk/bin/lib/Microsoft.Win32.Registry.dll", + "tools/vssdk/bin/lib/Nerdbank.Streams.dll", + "tools/vssdk/bin/lib/Newtonsoft.Json.dll", + "tools/vssdk/bin/lib/Nuget.Packaging.Extraction.dll", + "tools/vssdk/bin/lib/OSExtensions.dll", + "tools/vssdk/bin/lib/StreamJsonRpc.dll", + "tools/vssdk/bin/lib/System.Buffers.dll", + "tools/vssdk/bin/lib/System.Collections.Immutable.dll", + "tools/vssdk/bin/lib/System.Composition.AttributedModel.dll", + "tools/vssdk/bin/lib/System.Composition.Convention.dll", + "tools/vssdk/bin/lib/System.Composition.Hosting.dll", + "tools/vssdk/bin/lib/System.Composition.Runtime.dll", + "tools/vssdk/bin/lib/System.Composition.TypedParts.dll", + "tools/vssdk/bin/lib/System.Diagnostics.DiagnosticSource.dll", + "tools/vssdk/bin/lib/System.IO.Pipelines.dll", + "tools/vssdk/bin/lib/System.Memory.dll", + "tools/vssdk/bin/lib/System.Net.Http.Formatting.dll", + "tools/vssdk/bin/lib/System.Numerics.Vectors.dll", + "tools/vssdk/bin/lib/System.Reflection.Metadata.dll", + "tools/vssdk/bin/lib/System.Reflection.TypeExtensions.dll", + "tools/vssdk/bin/lib/System.Runtime.CompilerServices.Unsafe.dll", + "tools/vssdk/bin/lib/System.Security.AccessControl.dll", + "tools/vssdk/bin/lib/System.Security.Principal.Windows.dll", + "tools/vssdk/bin/lib/System.Threading.AccessControl.dll", + "tools/vssdk/bin/lib/System.Threading.Tasks.Dataflow.dll", + "tools/vssdk/bin/lib/System.Threading.Tasks.Extensions.dll", + "tools/vssdk/bin/lib/System.ValueTuple.dll", + "tools/vssdk/bin/lib/TraceReloggerLib.dll", + "tools/vssdk/bin/lib/VsixCommandLine.dll", + "tools/vssdk/bin/lib/VsixPublisher.exe", + "tools/vssdk/bin/lib/vsixpublisher/System.Runtime.CompilerServices.Unsafe.dll", + "tools/vssdk/bin/x86/CreatePkgDef.exe", + "tools/vssdk/bin/x86/CreatePkgDef.exe.config", + "tools/vssdk/bin/x86/VSCTCompress.dll", + "tools/vssdk/bin/x86/lib/Microsoft.VisualStudio.Shell.Framework.dll", + "tools/vssdk/inc/AppIDCmdUsed.vsct", + "tools/vssdk/inc/EmulatorCmdUsed.vsct", + "tools/vssdk/inc/KnownImageIds.vsct", + "tools/vssdk/inc/Menus.vsct", + "tools/vssdk/inc/MnuHelpIds.h", + "tools/vssdk/inc/RazorCmdId.h", + "tools/vssdk/inc/RazorCmdUsed.vsct", + "tools/vssdk/inc/RazorGuids.h", + "tools/vssdk/inc/SharedCmdDef.vsct", + "tools/vssdk/inc/SharedCmdPlace.vsct", + "tools/vssdk/inc/ShellCmdDef.vsct", + "tools/vssdk/inc/ShellCmdPlace.vsct", + "tools/vssdk/inc/VsDbgCmd.h", + "tools/vssdk/inc/VsDbgCmdPlace.vsct", + "tools/vssdk/inc/VsDbgCmdUsed.vsct", + "tools/vssdk/inc/editids.h", + "tools/vssdk/inc/sccmnid.h", + "tools/vssdk/inc/sharedids.h", + "tools/vssdk/inc/stdidcmd.h", + "tools/vssdk/inc/venusids.h", + "tools/vssdk/inc/venusmenu.vsct", + "tools/vssdk/inc/virtkeys.h", + "tools/vssdk/inc/vsdebugguids.h", + "tools/vssdk/inc/vsshlids.h", + "tools/vssdk/inc/wbids.h", + "tools/vssdk/offreg.dll", + "tools/vssdk/schemas/PackageLanguagePackManifestSchema.xsd", + "tools/vssdk/schemas/PackageManifestSchema.Assets.xsd", + "tools/vssdk/schemas/PackageManifestSchema.Dependencies.xsd", + "tools/vssdk/schemas/PackageManifestSchema.DesignNamespace.xsd", + "tools/vssdk/schemas/PackageManifestSchema.Installation.xsd", + "tools/vssdk/schemas/PackageManifestSchema.Installer.xsd", + "tools/vssdk/schemas/PackageManifestSchema.Metadata.xsd", + "tools/vssdk/schemas/PackageManifestSchema.Prerequisites.xsd", + "tools/vssdk/schemas/PackageManifestSchema.xsd", + "tools/vssdk/schemas/VSIXLanguagePackSchema.xsd", + "tools/vssdk/schemas/VSIXManifestSchema.xsd" + ] + }, + "Microsoft.VsSDK.CompatibilityAnalyzer/17.6.2164": { + "sha512": "9BqGG+sMd6SAHz5DutKyMj8s/pmZwA8L6+dluoYZarRlNb5+1uv7vwREnJ3Wtisj6wNpLxrJn4ueE7LAsOPLLw==", + "type": "package", + "path": "microsoft.vssdk.compatibilityanalyzer/17.6.2164", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "PackageIcon.png", + "build/Microsoft.VsSDK.CompatibilityAnalyzer.props", + "build/Microsoft.VsSDK.CompatibilityAnalyzer.targets", + "license.txt", + "microsoft.vssdk.compatibilityanalyzer.17.6.2164.nupkg.sha512", + "microsoft.vssdk.compatibilityanalyzer.nuspec", + "tools/net472/Microsoft.VisualStudio.Sdk.CompatibilityAnalyzerTasks.dll", + "tools/net472/VsixCompatibilityAnalyzer.dll", + "tools/net6.0/Microsoft.VisualStudio.Sdk.CompatibilityAnalyzerTasks.dll", + "tools/net6.0/System.IO.Packaging.dll", + "tools/net6.0/VsixCompatibilityAnalyzer.dll" + ] + }, + "Microsoft.Web.WebView2/1.0.2478.35": { + "sha512": "iDlxm6Gv4CU64ch4nc4DZXLbb5VRYNJb3IjGC+zJdEVIHjqt8Fed3JeThXIhpIwf49ke4e/CULYJXfNiG0sNhg==", + "type": "package", + "path": "microsoft.web.webview2/1.0.2478.35", + "hasTools": true, + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "NOTICE.txt", + "WebView2.idl", + "WebView2.tlb", + "build/Common.targets", + "build/Microsoft.Web.WebView2.targets", + "build/WebView2Rules.Project.xml", + "build/native/Microsoft.Web.WebView2.targets", + "build/native/arm64/WebView2Loader.dll", + "build/native/arm64/WebView2Loader.dll.lib", + "build/native/arm64/WebView2LoaderStatic.lib", + "build/native/include-winrt/WebView2Interop.h", + "build/native/include-winrt/WebView2Interop.idl", + "build/native/include-winrt/WebView2Interop.tlb", + "build/native/include/WebView2.h", + "build/native/include/WebView2EnvironmentOptions.h", + "build/native/x64/WebView2Loader.dll", + "build/native/x64/WebView2Loader.dll.lib", + "build/native/x64/WebView2LoaderStatic.lib", + "build/native/x86/WebView2Loader.dll", + "build/native/x86/WebView2Loader.dll.lib", + "build/native/x86/WebView2LoaderStatic.lib", + "build/wv2winrt.targets", + "lib/Microsoft.Web.WebView2.Core.winmd", + "lib/net45/Microsoft.Web.WebView2.Core.dll", + "lib/net45/Microsoft.Web.WebView2.Core.xml", + "lib/net45/Microsoft.Web.WebView2.WinForms.dll", + "lib/net45/Microsoft.Web.WebView2.WinForms.xml", + "lib/net45/Microsoft.Web.WebView2.Wpf.dll", + "lib/net45/Microsoft.Web.WebView2.Wpf.xml", + "lib/netcoreapp3.0/Microsoft.Web.WebView2.Core.dll", + "lib/netcoreapp3.0/Microsoft.Web.WebView2.Core.xml", + "lib/netcoreapp3.0/Microsoft.Web.WebView2.WinForms.dll", + "lib/netcoreapp3.0/Microsoft.Web.WebView2.WinForms.xml", + "lib/netcoreapp3.0/Microsoft.Web.WebView2.Wpf.dll", + "lib/netcoreapp3.0/Microsoft.Web.WebView2.Wpf.xml", + "microsoft.web.webview2.1.0.2478.35.nupkg.sha512", + "microsoft.web.webview2.nuspec", + "runtimes/win-arm64/native/WebView2Loader.dll", + "runtimes/win-arm64/native_uap/Microsoft.Web.WebView2.Core.dll", + "runtimes/win-x64/native/WebView2Loader.dll", + "runtimes/win-x64/native_uap/Microsoft.Web.WebView2.Core.dll", + "runtimes/win-x86/native/WebView2Loader.dll", + "runtimes/win-x86/native_uap/Microsoft.Web.WebView2.Core.dll", + "tools/VisualStudioToolsManifest.xml", + "tools/wv2winrt/Antlr3.Runtime.dll", + "tools/wv2winrt/Antlr4.StringTemplate.dll", + "tools/wv2winrt/System.Buffers.dll", + "tools/wv2winrt/System.CommandLine.DragonFruit.dll", + "tools/wv2winrt/System.CommandLine.Rendering.dll", + "tools/wv2winrt/System.CommandLine.dll", + "tools/wv2winrt/System.Memory.dll", + "tools/wv2winrt/System.Numerics.Vectors.dll", + "tools/wv2winrt/System.Runtime.CompilerServices.Unsafe.dll", + "tools/wv2winrt/codegen_util.dll", + "tools/wv2winrt/concrt140_app.dll", + "tools/wv2winrt/cs/System.CommandLine.resources.dll", + "tools/wv2winrt/de/System.CommandLine.resources.dll", + "tools/wv2winrt/es/System.CommandLine.resources.dll", + "tools/wv2winrt/fr/System.CommandLine.resources.dll", + "tools/wv2winrt/it/System.CommandLine.resources.dll", + "tools/wv2winrt/ja/System.CommandLine.resources.dll", + "tools/wv2winrt/ko/System.CommandLine.resources.dll", + "tools/wv2winrt/msvcp140_1_app.dll", + "tools/wv2winrt/msvcp140_2_app.dll", + "tools/wv2winrt/msvcp140_app.dll", + "tools/wv2winrt/pl/System.CommandLine.resources.dll", + "tools/wv2winrt/pt-BR/System.CommandLine.resources.dll", + "tools/wv2winrt/ru/System.CommandLine.resources.dll", + "tools/wv2winrt/tr/System.CommandLine.resources.dll", + "tools/wv2winrt/type_hierarchy.dll", + "tools/wv2winrt/vcamp140_app.dll", + "tools/wv2winrt/vccorlib140_app.dll", + "tools/wv2winrt/vcomp140_app.dll", + "tools/wv2winrt/vcruntime140_app.dll", + "tools/wv2winrt/winrt_winmd.dll", + "tools/wv2winrt/winrt_winmd.winmd", + "tools/wv2winrt/wv2winrt.exe", + "tools/wv2winrt/wv2winrt.exe.config", + "tools/wv2winrt/wv2winrt.xml", + "tools/wv2winrt/zh-Hans/System.CommandLine.resources.dll", + "tools/wv2winrt/zh-Hant/System.CommandLine.resources.dll" + ] + }, + "Microsoft.Win32.Primitives/4.3.0": { + "sha512": "9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "type": "package", + "path": "microsoft.win32.primitives/4.3.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/Microsoft.Win32.Primitives.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "microsoft.win32.primitives.4.3.0.nupkg.sha512", + "microsoft.win32.primitives.nuspec", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/Microsoft.Win32.Primitives.dll", + "ref/netstandard1.3/Microsoft.Win32.Primitives.dll", + "ref/netstandard1.3/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Primitives.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Primitives.xml", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._" + ] + }, + "Microsoft.Win32.Registry/5.0.0": { + "sha512": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", + "type": "package", + "path": "microsoft.win32.registry/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.dll", + "lib/net461/Microsoft.Win32.Registry.xml", + "lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "microsoft.win32.registry.5.0.0.nupkg.sha512", + "microsoft.win32.registry.nuspec", + "ref/net46/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.dll", + "ref/net461/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/Microsoft.Win32.Registry.dll", + "ref/netstandard1.3/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/de/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/es/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/fr/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/it/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ja/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ko/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/ru/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hans/Microsoft.Win32.Registry.xml", + "ref/netstandard1.3/zh-hant/Microsoft.Win32.Registry.xml", + "ref/netstandard2.0/Microsoft.Win32.Registry.dll", + "ref/netstandard2.0/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/net46/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/net461/Microsoft.Win32.Registry.xml", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.dll", + "runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.xml", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "Nerdbank.Streams/2.9.112": { + "sha512": "SEEoiRbeDZ/FoPmAEgVWIngdM1PCqeZd61P5P/7jVn16k/ObjTxhiMozajlYoQftL/yYTYkH/MqaE1XGMssazw==", + "type": "package", + "path": "nerdbank.streams/2.9.112", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "lib/netstandard2.0/Nerdbank.Streams.dll", + "lib/netstandard2.0/Nerdbank.Streams.xml", + "lib/netstandard2.1/Nerdbank.Streams.dll", + "lib/netstandard2.1/Nerdbank.Streams.xml", + "nerdbank.streams.2.9.112.nupkg.sha512", + "nerdbank.streams.nuspec" + ] + }, + "Newtonsoft.Json/13.0.3": { + "sha512": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==", + "type": "package", + "path": "newtonsoft.json/13.0.3", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.md", + "README.md", + "lib/net20/Newtonsoft.Json.dll", + "lib/net20/Newtonsoft.Json.xml", + "lib/net35/Newtonsoft.Json.dll", + "lib/net35/Newtonsoft.Json.xml", + "lib/net40/Newtonsoft.Json.dll", + "lib/net40/Newtonsoft.Json.xml", + "lib/net45/Newtonsoft.Json.dll", + "lib/net45/Newtonsoft.Json.xml", + "lib/net6.0/Newtonsoft.Json.dll", + "lib/net6.0/Newtonsoft.Json.xml", + "lib/netstandard1.0/Newtonsoft.Json.dll", + "lib/netstandard1.0/Newtonsoft.Json.xml", + "lib/netstandard1.3/Newtonsoft.Json.dll", + "lib/netstandard1.3/Newtonsoft.Json.xml", + "lib/netstandard2.0/Newtonsoft.Json.dll", + "lib/netstandard2.0/Newtonsoft.Json.xml", + "newtonsoft.json.13.0.3.nupkg.sha512", + "newtonsoft.json.nuspec", + "packageIcon.png" + ] + }, + "runtime.win.Microsoft.Win32.Primitives/4.3.0": { + "sha512": "NU51SEt/ZaD2MF48sJ17BIqx7rjeNNLXUevfMOjqQIetdndXwYjZfZsT6jD+rSWp/FYxjesdK4xUSl4OTEI0jw==", + "type": "package", + "path": "runtime.win.microsoft.win32.primitives/4.3.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "ref/netstandard/_._", + "runtime.win.microsoft.win32.primitives.4.3.0.nupkg.sha512", + "runtime.win.microsoft.win32.primitives.nuspec", + "runtimes/win/lib/net/_._", + "runtimes/win/lib/netstandard1.3/Microsoft.Win32.Primitives.dll" + ] + }, + "stdole/17.6.36389": { + "sha512": "pODDhxBEF9l/nmB6tgdSrLydJ68+DwlBoL+8IXxMpjOJrN0VzsaQ91hMcnnhZV0Y+v9Y4F3ApCtTVNwIawpeJw==", + "type": "package", + "path": "stdole/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/stdole.dll", + "lib/net20/stdole.xml", + "lib/net45/stdole.dll", + "lib/net45/stdole.xml", + "lib/net472/stdole.dll", + "lib/net472/stdole.xml", + "lib/net6.0/stdole.dll", + "lib/net6.0/stdole.xml", + "lib/netstandard2.0/stdole.dll", + "lib/netstandard2.0/stdole.xml", + "stdole.17.6.36389.nupkg.sha512", + "stdole.nuspec" + ] + }, + "StreamJsonRpc/2.15.29": { + "sha512": "qe4YV1fG30uxeRswBhOkrlx0EJwoSvf+MED9znBSvHWPGs6zb/0pCAKkgeN2ei0gCH3pY3hltMZpWBzjQxS2wg==", + "type": "package", + "path": "streamjsonrpc/2.15.29", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "NOTICE", + "PackageIcon.png", + "lib/netstandard2.0/StreamJsonRpc.dll", + "lib/netstandard2.0/StreamJsonRpc.xml", + "lib/netstandard2.0/cs/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/de/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/es/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/fr/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/it/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/ja/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/ko/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/pl/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/pt-BR/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/ru/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/tr/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/zh-Hans/StreamJsonRpc.resources.dll", + "lib/netstandard2.0/zh-Hant/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/StreamJsonRpc.dll", + "lib/netstandard2.1/StreamJsonRpc.xml", + "lib/netstandard2.1/cs/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/de/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/es/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/fr/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/it/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/ja/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/ko/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/pl/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/pt-BR/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/ru/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/tr/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/zh-Hans/StreamJsonRpc.resources.dll", + "lib/netstandard2.1/zh-Hant/StreamJsonRpc.resources.dll", + "streamjsonrpc.2.15.29.nupkg.sha512", + "streamjsonrpc.nuspec" + ] + }, + "System.Buffers/4.5.1": { + "sha512": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "type": "package", + "path": "system.buffers/4.5.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Buffers.dll", + "lib/net461/System.Buffers.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Buffers.dll", + "lib/netstandard1.1/System.Buffers.xml", + "lib/netstandard2.0/System.Buffers.dll", + "lib/netstandard2.0/System.Buffers.xml", + "lib/uap10.0.16299/_._", + "ref/net45/System.Buffers.dll", + "ref/net45/System.Buffers.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Buffers.dll", + "ref/netstandard1.1/System.Buffers.xml", + "ref/netstandard2.0/System.Buffers.dll", + "ref/netstandard2.0/System.Buffers.xml", + "ref/uap10.0.16299/_._", + "system.buffers.4.5.1.nupkg.sha512", + "system.buffers.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Collections.Immutable/7.0.0": { + "sha512": "dQPcs0U1IKnBdRDBkrCTi1FoajSTBzLcVTpjO4MBCMC7f4pDOIPzgBoX8JjG7X6uZRJ8EBxsi8+DR1JuwjnzOQ==", + "type": "package", + "path": "system.collections.immutable/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "README.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Collections.Immutable.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Collections.Immutable.targets", + "lib/net462/System.Collections.Immutable.dll", + "lib/net462/System.Collections.Immutable.xml", + "lib/net6.0/System.Collections.Immutable.dll", + "lib/net6.0/System.Collections.Immutable.xml", + "lib/net7.0/System.Collections.Immutable.dll", + "lib/net7.0/System.Collections.Immutable.xml", + "lib/netstandard2.0/System.Collections.Immutable.dll", + "lib/netstandard2.0/System.Collections.Immutable.xml", + "system.collections.immutable.7.0.0.nupkg.sha512", + "system.collections.immutable.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.ComponentModel.Composition/7.0.0": { + "sha512": "orv0h38ZVPCPo/FW0LGv8/TigXwX8cIwXeQcaNYhikkqELDm8sUFLMcof/Sjcq5EvYCm5NA7MV3hG4u75H44UQ==", + "type": "package", + "path": "system.componentmodel.composition/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.ComponentModel.Composition.targets", + "lib/net462/_._", + "lib/net6.0/System.ComponentModel.Composition.dll", + "lib/net6.0/System.ComponentModel.Composition.xml", + "lib/net7.0/System.ComponentModel.Composition.dll", + "lib/net7.0/System.ComponentModel.Composition.xml", + "lib/netstandard2.0/System.ComponentModel.Composition.dll", + "lib/netstandard2.0/System.ComponentModel.Composition.xml", + "system.componentmodel.composition.7.0.0.nupkg.sha512", + "system.componentmodel.composition.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Composition/7.0.0": { + "sha512": "tRwgcAkDd85O8Aq6zHDANzQaq380cek9lbMg5Qma46u5BZXq/G+XvIYmu+UI+BIIZ9zssXLYrkTykEqxxvhcmg==", + "type": "package", + "path": "system.composition/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Composition.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Composition.targets", + "lib/net461/_._", + "lib/netcoreapp2.0/_._", + "lib/netstandard2.0/_._", + "system.composition.7.0.0.nupkg.sha512", + "system.composition.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Composition.AttributedModel/7.0.0": { + "sha512": "2QzClqjElKxgI1jK1Jztnq44/8DmSuTSGGahXqQ4TdEV0h9s2KikQZIgcEqVzR7OuWDFPGLHIprBJGQEPr8fAQ==", + "type": "package", + "path": "system.composition.attributedmodel/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Composition.AttributedModel.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Composition.AttributedModel.targets", + "lib/net462/System.Composition.AttributedModel.dll", + "lib/net462/System.Composition.AttributedModel.xml", + "lib/net6.0/System.Composition.AttributedModel.dll", + "lib/net6.0/System.Composition.AttributedModel.xml", + "lib/net7.0/System.Composition.AttributedModel.dll", + "lib/net7.0/System.Composition.AttributedModel.xml", + "lib/netstandard2.0/System.Composition.AttributedModel.dll", + "lib/netstandard2.0/System.Composition.AttributedModel.xml", + "system.composition.attributedmodel.7.0.0.nupkg.sha512", + "system.composition.attributedmodel.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Composition.Convention/7.0.0": { + "sha512": "IMhTlpCs4HmlD8B+J8/kWfwX7vrBBOs6xyjSTzBlYSs7W4OET4tlkR/Sg9NG8jkdJH9Mymq0qGdYS1VPqRTBnQ==", + "type": "package", + "path": "system.composition.convention/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Composition.Convention.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Composition.Convention.targets", + "lib/net462/System.Composition.Convention.dll", + "lib/net462/System.Composition.Convention.xml", + "lib/net6.0/System.Composition.Convention.dll", + "lib/net6.0/System.Composition.Convention.xml", + "lib/net7.0/System.Composition.Convention.dll", + "lib/net7.0/System.Composition.Convention.xml", + "lib/netstandard2.0/System.Composition.Convention.dll", + "lib/netstandard2.0/System.Composition.Convention.xml", + "system.composition.convention.7.0.0.nupkg.sha512", + "system.composition.convention.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Composition.Hosting/7.0.0": { + "sha512": "eB6gwN9S+54jCTBJ5bpwMOVerKeUfGGTYCzz3QgDr1P55Gg/Wb27ShfPIhLMjmZ3MoAKu8uUSv6fcCdYJTN7Bg==", + "type": "package", + "path": "system.composition.hosting/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Composition.Hosting.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Composition.Hosting.targets", + "lib/net462/System.Composition.Hosting.dll", + "lib/net462/System.Composition.Hosting.xml", + "lib/net6.0/System.Composition.Hosting.dll", + "lib/net6.0/System.Composition.Hosting.xml", + "lib/net7.0/System.Composition.Hosting.dll", + "lib/net7.0/System.Composition.Hosting.xml", + "lib/netstandard2.0/System.Composition.Hosting.dll", + "lib/netstandard2.0/System.Composition.Hosting.xml", + "system.composition.hosting.7.0.0.nupkg.sha512", + "system.composition.hosting.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Composition.Runtime/7.0.0": { + "sha512": "aZJ1Zr5Txe925rbo4742XifEyW0MIni1eiUebmcrP3HwLXZ3IbXUj4MFMUH/RmnJOAQiS401leg/2Sz1MkApDw==", + "type": "package", + "path": "system.composition.runtime/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Composition.Runtime.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Composition.Runtime.targets", + "lib/net462/System.Composition.Runtime.dll", + "lib/net462/System.Composition.Runtime.xml", + "lib/net6.0/System.Composition.Runtime.dll", + "lib/net6.0/System.Composition.Runtime.xml", + "lib/net7.0/System.Composition.Runtime.dll", + "lib/net7.0/System.Composition.Runtime.xml", + "lib/netstandard2.0/System.Composition.Runtime.dll", + "lib/netstandard2.0/System.Composition.Runtime.xml", + "system.composition.runtime.7.0.0.nupkg.sha512", + "system.composition.runtime.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Composition.TypedParts/7.0.0": { + "sha512": "ZK0KNPfbtxVceTwh+oHNGUOYV2WNOHReX2AXipuvkURC7s/jPwoWfsu3SnDBDgofqbiWr96geofdQ2erm/KTHg==", + "type": "package", + "path": "system.composition.typedparts/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Composition.TypedParts.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Composition.TypedParts.targets", + "lib/net462/System.Composition.TypedParts.dll", + "lib/net462/System.Composition.TypedParts.xml", + "lib/net6.0/System.Composition.TypedParts.dll", + "lib/net6.0/System.Composition.TypedParts.xml", + "lib/net7.0/System.Composition.TypedParts.dll", + "lib/net7.0/System.Composition.TypedParts.xml", + "lib/netstandard2.0/System.Composition.TypedParts.dll", + "lib/netstandard2.0/System.Composition.TypedParts.xml", + "system.composition.typedparts.7.0.0.nupkg.sha512", + "system.composition.typedparts.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Diagnostics.DiagnosticSource/7.0.1": { + "sha512": "T9SLFxzDp0SreCffRDXSAS5G+lq6E8qP4knHS2IBjwCdx2KEvGnGZsq7gFpselYOda7l6gXsJMD93TQsFj/URA==", + "type": "package", + "path": "system.diagnostics.diagnosticsource/7.0.1", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Diagnostics.DiagnosticSource.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Diagnostics.DiagnosticSource.targets", + "lib/net462/System.Diagnostics.DiagnosticSource.dll", + "lib/net462/System.Diagnostics.DiagnosticSource.xml", + "lib/net6.0/System.Diagnostics.DiagnosticSource.dll", + "lib/net6.0/System.Diagnostics.DiagnosticSource.xml", + "lib/net7.0/System.Diagnostics.DiagnosticSource.dll", + "lib/net7.0/System.Diagnostics.DiagnosticSource.xml", + "lib/netstandard2.0/System.Diagnostics.DiagnosticSource.dll", + "lib/netstandard2.0/System.Diagnostics.DiagnosticSource.xml", + "system.diagnostics.diagnosticsource.7.0.1.nupkg.sha512", + "system.diagnostics.diagnosticsource.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.IO.Pipelines/7.0.0": { + "sha512": "jRn6JYnNPW6xgQazROBLSfpdoczRw694vO5kKvMcNnpXuolEixUyw6IBuBs2Y2mlSX/LdLvyyWmfXhaI3ND1Yg==", + "type": "package", + "path": "system.io.pipelines/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.IO.Pipelines.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.IO.Pipelines.targets", + "lib/net462/System.IO.Pipelines.dll", + "lib/net462/System.IO.Pipelines.xml", + "lib/net6.0/System.IO.Pipelines.dll", + "lib/net6.0/System.IO.Pipelines.xml", + "lib/net7.0/System.IO.Pipelines.dll", + "lib/net7.0/System.IO.Pipelines.xml", + "lib/netstandard2.0/System.IO.Pipelines.dll", + "lib/netstandard2.0/System.IO.Pipelines.xml", + "system.io.pipelines.7.0.0.nupkg.sha512", + "system.io.pipelines.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Memory/4.5.5": { + "sha512": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==", + "type": "package", + "path": "system.memory/4.5.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net461/System.Memory.dll", + "lib/net461/System.Memory.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.1/System.Memory.dll", + "lib/netstandard1.1/System.Memory.xml", + "lib/netstandard2.0/System.Memory.dll", + "lib/netstandard2.0/System.Memory.xml", + "ref/netcoreapp2.1/_._", + "system.memory.4.5.5.nupkg.sha512", + "system.memory.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Numerics.Vectors/4.5.0": { + "sha512": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "type": "package", + "path": "system.numerics.vectors/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Numerics.Vectors.dll", + "lib/net46/System.Numerics.Vectors.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.0/System.Numerics.Vectors.dll", + "lib/netstandard1.0/System.Numerics.Vectors.xml", + "lib/netstandard2.0/System.Numerics.Vectors.dll", + "lib/netstandard2.0/System.Numerics.Vectors.xml", + "lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll", + "lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.xml", + "lib/uap10.0.16299/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/System.Numerics.Vectors.dll", + "ref/net45/System.Numerics.Vectors.xml", + "ref/net46/System.Numerics.Vectors.dll", + "ref/net46/System.Numerics.Vectors.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.0/System.Numerics.Vectors.dll", + "ref/netstandard1.0/System.Numerics.Vectors.xml", + "ref/netstandard2.0/System.Numerics.Vectors.dll", + "ref/netstandard2.0/System.Numerics.Vectors.xml", + "ref/uap10.0.16299/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "system.numerics.vectors.4.5.0.nupkg.sha512", + "system.numerics.vectors.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Private.Uri/4.3.2": { + "sha512": "o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "type": "package", + "path": "system.private.uri/4.3.2", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "ThirdPartyNotices.txt", + "dotnet_library_license.txt", + "ref/netstandard/_._", + "system.private.uri.4.3.2.nupkg.sha512", + "system.private.uri.nuspec" + ] + }, + "System.Reflection.Emit/4.7.0": { + "sha512": "VR4kk8XLKebQ4MZuKuIni/7oh+QGFmZW3qORd1GvBq/8026OpW501SzT/oypwiQl4TvT8ErnReh/NzY9u+C6wQ==", + "type": "package", + "path": "system.reflection.emit/4.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Emit.dll", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.1/System.Reflection.Emit.dll", + "lib/netstandard1.1/System.Reflection.Emit.xml", + "lib/netstandard1.3/System.Reflection.Emit.dll", + "lib/netstandard2.0/System.Reflection.Emit.dll", + "lib/netstandard2.0/System.Reflection.Emit.xml", + "lib/netstandard2.1/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.1/System.Reflection.Emit.dll", + "ref/netstandard1.1/System.Reflection.Emit.xml", + "ref/netstandard1.1/de/System.Reflection.Emit.xml", + "ref/netstandard1.1/es/System.Reflection.Emit.xml", + "ref/netstandard1.1/fr/System.Reflection.Emit.xml", + "ref/netstandard1.1/it/System.Reflection.Emit.xml", + "ref/netstandard1.1/ja/System.Reflection.Emit.xml", + "ref/netstandard1.1/ko/System.Reflection.Emit.xml", + "ref/netstandard1.1/ru/System.Reflection.Emit.xml", + "ref/netstandard1.1/zh-hans/System.Reflection.Emit.xml", + "ref/netstandard1.1/zh-hant/System.Reflection.Emit.xml", + "ref/netstandard2.0/System.Reflection.Emit.dll", + "ref/netstandard2.0/System.Reflection.Emit.xml", + "ref/netstandard2.1/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/aot/lib/netcore50/System.Reflection.Emit.dll", + "runtimes/aot/lib/netcore50/System.Reflection.Emit.xml", + "system.reflection.emit.4.7.0.nupkg.sha512", + "system.reflection.emit.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Reflection.Emit.Lightweight/4.7.0": { + "sha512": "a4OLB4IITxAXJeV74MDx49Oq2+PsF6Sml54XAFv+2RyWwtDBcabzoxiiJRhdhx+gaohLh4hEGCLQyBozXoQPqA==", + "type": "package", + "path": "system.reflection.emit.lightweight/4.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Emit.Lightweight.dll", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.0/System.Reflection.Emit.Lightweight.dll", + "lib/netstandard1.0/System.Reflection.Emit.Lightweight.xml", + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll", + "lib/netstandard2.0/System.Reflection.Emit.Lightweight.dll", + "lib/netstandard2.0/System.Reflection.Emit.Lightweight.xml", + "lib/netstandard2.1/_._", + "lib/portable-net45+wp8/_._", + "lib/wp80/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.0/System.Reflection.Emit.Lightweight.dll", + "ref/netstandard1.0/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/de/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/es/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/fr/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/it/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/ja/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/ko/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/ru/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/zh-hans/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard1.0/zh-hant/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard2.0/System.Reflection.Emit.Lightweight.dll", + "ref/netstandard2.0/System.Reflection.Emit.Lightweight.xml", + "ref/netstandard2.1/_._", + "ref/portable-net45+wp8/_._", + "ref/wp80/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/aot/lib/netcore50/System.Reflection.Emit.Lightweight.dll", + "runtimes/aot/lib/netcore50/System.Reflection.Emit.Lightweight.xml", + "system.reflection.emit.lightweight.4.7.0.nupkg.sha512", + "system.reflection.emit.lightweight.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Reflection.Metadata/7.0.0": { + "sha512": "MclTG61lsD9sYdpNz9xsKBzjsmsfCtcMZYXz/IUr2zlhaTaABonlr1ESeompTgM+Xk+IwtGYU7/voh3YWB/fWw==", + "type": "package", + "path": "system.reflection.metadata/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "README.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Reflection.Metadata.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Reflection.Metadata.targets", + "lib/net462/System.Reflection.Metadata.dll", + "lib/net462/System.Reflection.Metadata.xml", + "lib/net6.0/System.Reflection.Metadata.dll", + "lib/net6.0/System.Reflection.Metadata.xml", + "lib/net7.0/System.Reflection.Metadata.dll", + "lib/net7.0/System.Reflection.Metadata.xml", + "lib/netstandard2.0/System.Reflection.Metadata.dll", + "lib/netstandard2.0/System.Reflection.Metadata.xml", + "system.reflection.metadata.7.0.0.nupkg.sha512", + "system.reflection.metadata.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Reflection.TypeExtensions/4.7.0": { + "sha512": "VybpaOQQhqE6siHppMktjfGBw1GCwvCqiufqmP8F1nj7fTUNtW35LOEt3UZTEsECfo+ELAl/9o9nJx3U91i7vA==", + "type": "package", + "path": "system.reflection.typeextensions/4.7.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Reflection.TypeExtensions.dll", + "lib/net461/System.Reflection.TypeExtensions.dll", + "lib/net461/System.Reflection.TypeExtensions.xml", + "lib/netcore50/System.Reflection.TypeExtensions.dll", + "lib/netcoreapp1.0/System.Reflection.TypeExtensions.dll", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.3/System.Reflection.TypeExtensions.dll", + "lib/netstandard1.3/System.Reflection.TypeExtensions.xml", + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll", + "lib/netstandard1.5/System.Reflection.TypeExtensions.xml", + "lib/netstandard2.0/System.Reflection.TypeExtensions.dll", + "lib/netstandard2.0/System.Reflection.TypeExtensions.xml", + "lib/uap10.0.16299/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Reflection.TypeExtensions.dll", + "ref/net461/System.Reflection.TypeExtensions.dll", + "ref/net461/System.Reflection.TypeExtensions.xml", + "ref/net472/System.Reflection.TypeExtensions.dll", + "ref/net472/System.Reflection.TypeExtensions.xml", + "ref/netcoreapp2.0/_._", + "ref/netstandard1.3/System.Reflection.TypeExtensions.dll", + "ref/netstandard1.3/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/de/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/es/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/fr/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/it/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/ja/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/ko/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/ru/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/zh-hans/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.3/zh-hant/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/System.Reflection.TypeExtensions.dll", + "ref/netstandard1.5/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/de/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/es/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/fr/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/it/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/ja/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/ko/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/ru/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/zh-hans/System.Reflection.TypeExtensions.xml", + "ref/netstandard1.5/zh-hant/System.Reflection.TypeExtensions.xml", + "ref/netstandard2.0/System.Reflection.TypeExtensions.dll", + "ref/netstandard2.0/System.Reflection.TypeExtensions.xml", + "ref/uap10.0.16299/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "runtimes/aot/lib/netcore50/System.Reflection.TypeExtensions.dll", + "runtimes/aot/lib/uap10.0.16299/_._", + "system.reflection.typeextensions.4.7.0.nupkg.sha512", + "system.reflection.typeextensions.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Runtime.CompilerServices.Unsafe/6.0.0": { + "sha512": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==", + "type": "package", + "path": "system.runtime.compilerservices.unsafe/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net461/System.Runtime.CompilerServices.Unsafe.xml", + "lib/net6.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/net6.0/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netcoreapp3.1/System.Runtime.CompilerServices.Unsafe.xml", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll", + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.xml", + "system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512", + "system.runtime.compilerservices.unsafe.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Security.AccessControl/6.0.0": { + "sha512": "AUADIc0LIEQe7MzC+I0cl0rAT8RrTAKFHl53yHjEUzNVIaUlhFY11vc2ebiVJzVBuOzun6F7FBA+8KAbGTTedQ==", + "type": "package", + "path": "system.security.accesscontrol/6.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/netcoreapp2.0/System.Security.AccessControl.targets", + "buildTransitive/netcoreapp3.1/_._", + "lib/net461/System.Security.AccessControl.dll", + "lib/net461/System.Security.AccessControl.xml", + "lib/net6.0/System.Security.AccessControl.dll", + "lib/net6.0/System.Security.AccessControl.xml", + "lib/netstandard2.0/System.Security.AccessControl.dll", + "lib/netstandard2.0/System.Security.AccessControl.xml", + "runtimes/win/lib/net461/System.Security.AccessControl.dll", + "runtimes/win/lib/net461/System.Security.AccessControl.xml", + "runtimes/win/lib/net6.0/System.Security.AccessControl.dll", + "runtimes/win/lib/net6.0/System.Security.AccessControl.xml", + "runtimes/win/lib/netstandard2.0/System.Security.AccessControl.dll", + "runtimes/win/lib/netstandard2.0/System.Security.AccessControl.xml", + "system.security.accesscontrol.6.0.0.nupkg.sha512", + "system.security.accesscontrol.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Security.Principal.Windows/5.0.0": { + "sha512": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==", + "type": "package", + "path": "system.security.principal.windows/5.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/net46/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.dll", + "lib/net461/System.Security.Principal.Windows.xml", + "lib/netstandard1.3/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.dll", + "lib/netstandard2.0/System.Security.Principal.Windows.xml", + "lib/uap10.0.16299/_._", + "ref/net46/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.dll", + "ref/net461/System.Security.Principal.Windows.xml", + "ref/netcoreapp3.0/System.Security.Principal.Windows.dll", + "ref/netcoreapp3.0/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/System.Security.Principal.Windows.dll", + "ref/netstandard1.3/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/de/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/es/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/fr/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/it/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ja/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ko/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/ru/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hans/System.Security.Principal.Windows.xml", + "ref/netstandard1.3/zh-hant/System.Security.Principal.Windows.xml", + "ref/netstandard2.0/System.Security.Principal.Windows.dll", + "ref/netstandard2.0/System.Security.Principal.Windows.xml", + "ref/uap10.0.16299/_._", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/unix/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/net46/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.dll", + "runtimes/win/lib/net461/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.0/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.dll", + "runtimes/win/lib/netcoreapp2.1/System.Security.Principal.Windows.xml", + "runtimes/win/lib/netstandard1.3/System.Security.Principal.Windows.dll", + "runtimes/win/lib/uap10.0.16299/_._", + "system.security.principal.windows.5.0.0.nupkg.sha512", + "system.security.principal.windows.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.Text.Encodings.Web/8.0.0": { + "sha512": "yev/k9GHAEGx2Rg3/tU6MQh4HGBXJs70y7j1LaM1i/ER9po+6nnQ6RRqTJn1E7Xu0fbIFK80Nh5EoODxrbxwBQ==", + "type": "package", + "path": "system.text.encodings.web/8.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Text.Encodings.Web.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Text.Encodings.Web.targets", + "lib/net462/System.Text.Encodings.Web.dll", + "lib/net462/System.Text.Encodings.Web.xml", + "lib/net6.0/System.Text.Encodings.Web.dll", + "lib/net6.0/System.Text.Encodings.Web.xml", + "lib/net7.0/System.Text.Encodings.Web.dll", + "lib/net7.0/System.Text.Encodings.Web.xml", + "lib/net8.0/System.Text.Encodings.Web.dll", + "lib/net8.0/System.Text.Encodings.Web.xml", + "lib/netstandard2.0/System.Text.Encodings.Web.dll", + "lib/netstandard2.0/System.Text.Encodings.Web.xml", + "runtimes/browser/lib/net6.0/System.Text.Encodings.Web.dll", + "runtimes/browser/lib/net6.0/System.Text.Encodings.Web.xml", + "runtimes/browser/lib/net7.0/System.Text.Encodings.Web.dll", + "runtimes/browser/lib/net7.0/System.Text.Encodings.Web.xml", + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll", + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.xml", + "system.text.encodings.web.8.0.0.nupkg.sha512", + "system.text.encodings.web.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Text.Json/8.0.5": { + "sha512": "0f1B50Ss7rqxXiaBJyzUu9bWFOO2/zSlifZ/UNMdiIpDYe4cY4LQQicP4nirK1OS31I43rn062UIJ1Q9bpmHpg==", + "type": "package", + "path": "system.text.json/8.0.5", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/System.Text.Json.SourceGeneration.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/System.Text.Json.SourceGeneration.resources.dll", + "buildTransitive/net461/System.Text.Json.targets", + "buildTransitive/net462/System.Text.Json.targets", + "buildTransitive/net6.0/System.Text.Json.targets", + "buildTransitive/netcoreapp2.0/System.Text.Json.targets", + "buildTransitive/netstandard2.0/System.Text.Json.targets", + "lib/net462/System.Text.Json.dll", + "lib/net462/System.Text.Json.xml", + "lib/net6.0/System.Text.Json.dll", + "lib/net6.0/System.Text.Json.xml", + "lib/net7.0/System.Text.Json.dll", + "lib/net7.0/System.Text.Json.xml", + "lib/net8.0/System.Text.Json.dll", + "lib/net8.0/System.Text.Json.xml", + "lib/netstandard2.0/System.Text.Json.dll", + "lib/netstandard2.0/System.Text.Json.xml", + "system.text.json.8.0.5.nupkg.sha512", + "system.text.json.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Threading.AccessControl/7.0.0": { + "sha512": "J3pA1tD7H8ZKzKczlAYgMG0ZO227YsmoyyOh/YttwtomokMhNbPRwlf5h37a+xQE420nGVuvwsFoV5YBUY+TpA==", + "type": "package", + "path": "system.threading.accesscontrol/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Threading.AccessControl.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Threading.AccessControl.targets", + "lib/net462/System.Threading.AccessControl.dll", + "lib/net462/System.Threading.AccessControl.xml", + "lib/net6.0/System.Threading.AccessControl.dll", + "lib/net6.0/System.Threading.AccessControl.xml", + "lib/net7.0/System.Threading.AccessControl.dll", + "lib/net7.0/System.Threading.AccessControl.xml", + "lib/netstandard2.0/System.Threading.AccessControl.dll", + "lib/netstandard2.0/System.Threading.AccessControl.xml", + "runtimes/win/lib/net6.0/System.Threading.AccessControl.dll", + "runtimes/win/lib/net6.0/System.Threading.AccessControl.xml", + "runtimes/win/lib/net7.0/System.Threading.AccessControl.dll", + "runtimes/win/lib/net7.0/System.Threading.AccessControl.xml", + "system.threading.accesscontrol.7.0.0.nupkg.sha512", + "system.threading.accesscontrol.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Threading.Tasks.Dataflow/7.0.0": { + "sha512": "BmSJ4b0e2nlplV/RdWVxvH7WECTHACofv06dx/JwOYc0n56eK1jIWdQKNYYsReSO4w8n1QA5stOzSQcfaVBkJg==", + "type": "package", + "path": "system.threading.tasks.dataflow/7.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Threading.Tasks.Dataflow.targets", + "buildTransitive/net462/_._", + "buildTransitive/net6.0/_._", + "buildTransitive/netcoreapp2.0/System.Threading.Tasks.Dataflow.targets", + "lib/net462/System.Threading.Tasks.Dataflow.dll", + "lib/net462/System.Threading.Tasks.Dataflow.xml", + "lib/net6.0/System.Threading.Tasks.Dataflow.dll", + "lib/net6.0/System.Threading.Tasks.Dataflow.xml", + "lib/net7.0/System.Threading.Tasks.Dataflow.dll", + "lib/net7.0/System.Threading.Tasks.Dataflow.xml", + "lib/netstandard2.0/System.Threading.Tasks.Dataflow.dll", + "lib/netstandard2.0/System.Threading.Tasks.Dataflow.xml", + "lib/netstandard2.1/System.Threading.Tasks.Dataflow.dll", + "lib/netstandard2.1/System.Threading.Tasks.Dataflow.xml", + "system.threading.tasks.dataflow.7.0.0.nupkg.sha512", + "system.threading.tasks.dataflow.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "sha512": "zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "type": "package", + "path": "system.threading.tasks.extensions/4.5.4", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.Threading.Tasks.Extensions.dll", + "lib/net461/System.Threading.Tasks.Extensions.xml", + "lib/netcoreapp2.1/_._", + "lib/netstandard1.0/System.Threading.Tasks.Extensions.dll", + "lib/netstandard1.0/System.Threading.Tasks.Extensions.xml", + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll", + "lib/netstandard2.0/System.Threading.Tasks.Extensions.xml", + "lib/portable-net45+win8+wp8+wpa81/System.Threading.Tasks.Extensions.dll", + "lib/portable-net45+win8+wp8+wpa81/System.Threading.Tasks.Extensions.xml", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/netcoreapp2.1/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "system.threading.tasks.extensions.4.5.4.nupkg.sha512", + "system.threading.tasks.extensions.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "System.ValueTuple/4.5.0": { + "sha512": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==", + "type": "package", + "path": "system.valuetuple/4.5.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.TXT", + "THIRD-PARTY-NOTICES.TXT", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net461/System.ValueTuple.dll", + "lib/net461/System.ValueTuple.xml", + "lib/net47/System.ValueTuple.dll", + "lib/net47/System.ValueTuple.xml", + "lib/netcoreapp2.0/_._", + "lib/netstandard1.0/System.ValueTuple.dll", + "lib/netstandard1.0/System.ValueTuple.xml", + "lib/netstandard2.0/_._", + "lib/portable-net40+sl4+win8+wp8/System.ValueTuple.dll", + "lib/portable-net40+sl4+win8+wp8/System.ValueTuple.xml", + "lib/uap10.0.16299/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "lib/xamarintvos10/_._", + "lib/xamarinwatchos10/_._", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net461/System.ValueTuple.dll", + "ref/net47/System.ValueTuple.dll", + "ref/netcoreapp2.0/_._", + "ref/netstandard2.0/_._", + "ref/portable-net40+sl4+win8+wp8/System.ValueTuple.dll", + "ref/uap10.0.16299/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "ref/xamarintvos10/_._", + "ref/xamarinwatchos10/_._", + "system.valuetuple.4.5.0.nupkg.sha512", + "system.valuetuple.nuspec", + "useSharedDesignerContext.txt", + "version.txt" + ] + }, + "VSLangProj/17.6.36389": { + "sha512": "1ic2oRZqrAwrWoQAtm56TDIS2bV5jZIoJltWjncpOblYO5bKUEOZS5jDdvbLl2dxIrEHb9uB5hFOaiglLm8RnQ==", + "type": "package", + "path": "vslangproj/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj.dll", + "lib/net20/VSLangProj.xml", + "lib/net45/VSLangProj.dll", + "lib/net45/VSLangProj.xml", + "lib/net472/VSLangProj.dll", + "lib/net472/VSLangProj.xml", + "lib/net6.0/VSLangProj.dll", + "lib/net6.0/VSLangProj.xml", + "lib/netstandard2.0/VSLangProj.dll", + "lib/netstandard2.0/VSLangProj.xml", + "vslangproj.17.6.36389.nupkg.sha512", + "vslangproj.nuspec" + ] + }, + "VSLangProj100/17.6.36389": { + "sha512": "Qzq5DTcoYS0sV+E9h/FzPA840NzpOKSaRkw165AwTVuVibM+PkhOlQ0aAkqwMFdaC+CrhSq5/DjF605IU2qftg==", + "type": "package", + "path": "vslangproj100/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj100.dll", + "lib/net20/VSLangProj100.xml", + "lib/net45/VSLangProj100.dll", + "lib/net45/VSLangProj100.xml", + "lib/net472/VSLangProj100.dll", + "lib/net472/VSLangProj100.xml", + "lib/net6.0/VSLangProj100.dll", + "lib/net6.0/VSLangProj100.xml", + "lib/netstandard2.0/VSLangProj100.dll", + "lib/netstandard2.0/VSLangProj100.xml", + "vslangproj100.17.6.36389.nupkg.sha512", + "vslangproj100.nuspec" + ] + }, + "VSLangProj110/17.6.36389": { + "sha512": "BlSUPPKnChbxtrGRXYKiq+v0IYCI3JJ8BQfkTYDCJi84oGweTW7dPqmxvx3oOvLfoW2PZaIM2fMgNLF1F0K9Jg==", + "type": "package", + "path": "vslangproj110/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj110.dll", + "lib/net20/VSLangProj110.xml", + "lib/net45/VSLangProj110.dll", + "lib/net45/VSLangProj110.xml", + "lib/net472/VSLangProj110.dll", + "lib/net472/VSLangProj110.xml", + "lib/net6.0/VSLangProj110.dll", + "lib/net6.0/VSLangProj110.xml", + "lib/netstandard2.0/VSLangProj110.dll", + "lib/netstandard2.0/VSLangProj110.xml", + "vslangproj110.17.6.36389.nupkg.sha512", + "vslangproj110.nuspec" + ] + }, + "VSLangProj140/17.6.36389": { + "sha512": "GmdzT3zOxqX5P0t64M6QFrSe3nv5pU2ayOjY8j+ZC6YRJY+MyiP5pz6YbUNkRySSR7eM1uHkjPiHAjHJnSq1Pg==", + "type": "package", + "path": "vslangproj140/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj140.dll", + "lib/net20/VSLangProj140.xml", + "lib/net45/VSLangProj140.dll", + "lib/net45/VSLangProj140.xml", + "lib/net472/VSLangProj140.dll", + "lib/net472/VSLangProj140.xml", + "lib/net6.0/VSLangProj140.dll", + "lib/net6.0/VSLangProj140.xml", + "lib/netstandard2.0/VSLangProj140.dll", + "lib/netstandard2.0/VSLangProj140.xml", + "vslangproj140.17.6.36389.nupkg.sha512", + "vslangproj140.nuspec" + ] + }, + "VSLangProj150/17.6.36389": { + "sha512": "kYkfgI2FtbxcWAjEee2kGwLHmHXRo2YoORC1eV2Jr3I4l58QUAHmlzB1rWUZnUs/nXA5ulJcio+XVWaFDubOqQ==", + "type": "package", + "path": "vslangproj150/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj150.dll", + "lib/net20/VSLangProj150.xml", + "lib/net45/VSLangProj150.dll", + "lib/net45/VSLangProj150.xml", + "lib/net472/VSLangProj150.dll", + "lib/net472/VSLangProj150.xml", + "lib/net6.0/VSLangProj150.dll", + "lib/net6.0/VSLangProj150.xml", + "lib/netstandard2.0/VSLangProj150.dll", + "lib/netstandard2.0/VSLangProj150.xml", + "vslangproj150.17.6.36389.nupkg.sha512", + "vslangproj150.nuspec" + ] + }, + "VSLangProj157/17.6.36389": { + "sha512": "XkUoqiBkuyFesAyj70rM7EFq27uYkU4+FaTAkrMZvw81GpvgKmXGZUg6ViOWCmH6fBj2DQ1a1QtyiExi+6zsIA==", + "type": "package", + "path": "vslangproj157/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj157.dll", + "lib/net20/VSLangProj157.xml", + "lib/net45/VSLangProj157.dll", + "lib/net45/VSLangProj157.xml", + "lib/net472/VSLangProj157.dll", + "lib/net472/VSLangProj157.xml", + "lib/net6.0/VSLangProj157.dll", + "lib/net6.0/VSLangProj157.xml", + "lib/netstandard2.0/VSLangProj157.dll", + "lib/netstandard2.0/VSLangProj157.xml", + "vslangproj157.17.6.36389.nupkg.sha512", + "vslangproj157.nuspec" + ] + }, + "VSLangProj158/17.6.36389": { + "sha512": "Wn83ZlwUR90In4/9dphMSP+66C5btMnVgbepZDEahp/vge/Pe63bJGRXQRS3P45Ml5fcpyTIy8JXXMvrSP4EiA==", + "type": "package", + "path": "vslangproj158/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj158.dll", + "lib/net20/VSLangProj158.xml", + "lib/net45/VSLangProj158.dll", + "lib/net45/VSLangProj158.xml", + "lib/net472/VSLangProj158.dll", + "lib/net472/VSLangProj158.xml", + "lib/net6.0/VSLangProj158.dll", + "lib/net6.0/VSLangProj158.xml", + "lib/netstandard2.0/VSLangProj158.dll", + "lib/netstandard2.0/VSLangProj158.xml", + "vslangproj158.17.6.36389.nupkg.sha512", + "vslangproj158.nuspec" + ] + }, + "VSLangProj165/17.6.36389": { + "sha512": "I1KxmiBTPJnsdicOgJiinXPz08o/+UC8a6+nheSZF1Q2RdwB5bs1tWSZlc+pPuE2DokfAdyntkpCp1w03DkJcw==", + "type": "package", + "path": "vslangproj165/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj165.dll", + "lib/net20/VSLangProj165.xml", + "lib/net45/VSLangProj165.dll", + "lib/net45/VSLangProj165.xml", + "lib/net472/VSLangProj165.dll", + "lib/net472/VSLangProj165.xml", + "lib/net6.0/VSLangProj165.dll", + "lib/net6.0/VSLangProj165.xml", + "lib/netstandard2.0/VSLangProj165.dll", + "lib/netstandard2.0/VSLangProj165.xml", + "vslangproj165.17.6.36389.nupkg.sha512", + "vslangproj165.nuspec" + ] + }, + "VSLangProj2/17.6.36389": { + "sha512": "qRCwZw8OLJM4x5QQNquBWivYsZv75WJAE2tOad3ViBsnlAUi+kZtDqZVYjOyTi6ztnkCnINpu+opbFJi/ENCDw==", + "type": "package", + "path": "vslangproj2/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj2.dll", + "lib/net20/VSLangProj2.xml", + "lib/net45/VSLangProj2.dll", + "lib/net45/VSLangProj2.xml", + "lib/net472/VSLangProj2.dll", + "lib/net472/VSLangProj2.xml", + "lib/net6.0/VSLangProj2.dll", + "lib/net6.0/VSLangProj2.xml", + "lib/netstandard2.0/VSLangProj2.dll", + "lib/netstandard2.0/VSLangProj2.xml", + "vslangproj2.17.6.36389.nupkg.sha512", + "vslangproj2.nuspec" + ] + }, + "VSLangProj80/17.6.36389": { + "sha512": "t/2hJME6MSyhv6KnO5+Pk5D36PuQ98l9pHY3/6Dst1xMa8dAJaqftZaD3Lprr1VwKdFLiSF++f11kp1ZLy8qJQ==", + "type": "package", + "path": "vslangproj80/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj80.dll", + "lib/net20/VSLangProj80.xml", + "lib/net45/VSLangProj80.dll", + "lib/net45/VSLangProj80.xml", + "lib/net472/VSLangProj80.dll", + "lib/net472/VSLangProj80.xml", + "lib/net6.0/VSLangProj80.dll", + "lib/net6.0/VSLangProj80.xml", + "lib/netstandard2.0/VSLangProj80.dll", + "lib/netstandard2.0/VSLangProj80.xml", + "vslangproj80.17.6.36389.nupkg.sha512", + "vslangproj80.nuspec" + ] + }, + "VSLangProj90/17.6.36389": { + "sha512": "a6bBAQF5UzzDXL+3+tJtrurg3zLnlzToDqjfbPHmIFI690j7vazRH9vBHBMlxSfyCyHZSUS5cFZZ/zbzUJTwAA==", + "type": "package", + "path": "vslangproj90/17.6.36389", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "LICENSE.txt", + "PackageIcon.png", + "lib/net20/VSLangProj90.dll", + "lib/net20/VSLangProj90.xml", + "lib/net45/VSLangProj90.dll", + "lib/net45/VSLangProj90.xml", + "lib/net472/VSLangProj90.dll", + "lib/net472/VSLangProj90.xml", + "lib/net6.0/VSLangProj90.dll", + "lib/net6.0/VSLangProj90.xml", + "lib/netstandard2.0/VSLangProj90.dll", + "lib/netstandard2.0/VSLangProj90.xml", + "vslangproj90.17.6.36389.nupkg.sha512", + "vslangproj90.nuspec" + ] + } + }, + "projectFileDependencyGroups": { + ".NETFramework,Version=v4.7.2": [ + "Microsoft.VSSDK.BuildTools >= 17.6.2164", + "Microsoft.VisualStudio.SDK >= 17.6.36389", + "Microsoft.Web.WebView2 >= 1.0.2478.35", + "Newtonsoft.Json >= 13.0.3", + "System.Text.Json >= 8.0.5" + ] + }, + "packageFolders": { + "C:\\Users\\RobBos\\.nuget\\packages\\": {}, + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj", + "projectName": "CopilotTokenTracker", + "projectPath": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj", + "packagesPath": "C:\\Users\\RobBos\\.nuget\\packages\\", + "outputPath": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\obj\\", + "projectStyle": "PackageReference", + "skipContentFileWrite": true, + "UsingMicrosoftNETSdk": false, + "fallbackFolders": [ + "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages" + ], + "configFilePaths": [ + "C:\\Users\\RobBos\\AppData\\Roaming\\NuGet\\NuGet.Config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config", + "C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config" + ], + "originalTargetFrameworks": [ + "net472" + ], + "sources": { + "C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {}, + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net472": { + "projectReferences": {} + } + }, + "restoreAuditProperties": { + "enableAudit": "true", + "auditLevel": "low", + "auditMode": "direct" + } + }, + "frameworks": { + "net472": { + "dependencies": { + "Microsoft.VSSDK.BuildTools": { + "target": "Package", + "version": "[17.6.2164, )", + "noWarn": [ + "NU1604" + ] + }, + "Microsoft.VisualStudio.SDK": { + "include": "Compile, Build, Native, ContentFiles, Analyzers, BuildTransitive", + "target": "Package", + "version": "[17.6.36389, )", + "noWarn": [ + "NU1604" + ] + }, + "Microsoft.Web.WebView2": { + "target": "Package", + "version": "[1.0.2478.35, )" + }, + "Newtonsoft.Json": { + "target": "Package", + "version": "[13.0.3, )" + }, + "System.Text.Json": { + "target": "Package", + "version": "[8.0.5, )" + } + } + } + }, + "runtimes": { + "win": { + "#import": [] + }, + "win-arm": { + "#import": [] + }, + "win-arm64": { + "#import": [] + }, + "win-x64": { + "#import": [] + }, + "win-x86": { + "#import": [] + } + } + } +} \ No newline at end of file diff --git a/visualstudio-extension/src/CopilotTokenTracker/obj/project.nuget.cache b/visualstudio-extension/src/CopilotTokenTracker/obj/project.nuget.cache new file mode 100644 index 00000000..e7dbfd2d --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/obj/project.nuget.cache @@ -0,0 +1,136 @@ +{ + "version": 2, + "dgSpecHash": "5Hm9IbDP0Hc=", + "success": true, + "projectFilePath": "C:\\Users\\RobBos\\code\\repos\\rajbos\\github-copilot-token-usage\\visualstudio-extension\\src\\CopilotTokenTracker\\CopilotTokenTracker.csproj", + "expectedPackageFiles": [ + "C:\\Users\\RobBos\\.nuget\\packages\\envdte\\17.6.36389\\envdte.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\envdte100\\17.6.36389\\envdte100.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\envdte80\\17.6.36389\\envdte80.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\envdte90\\17.6.36389\\envdte90.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\envdte90a\\17.6.36389\\envdte90a.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\messagepack\\2.5.108\\messagepack.2.5.108.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\messagepack.annotations\\2.5.108\\messagepack.annotations.2.5.108.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.bcl.asyncinterfaces\\8.0.0\\microsoft.bcl.asyncinterfaces.8.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.build.framework\\17.6.3\\microsoft.build.framework.17.6.3.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.codeanalysis.bannedapianalyzers\\3.3.2\\microsoft.codeanalysis.bannedapianalyzers.3.3.2.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.csharp\\4.7.0\\microsoft.csharp.4.7.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.io.redist\\6.0.0\\microsoft.io.redist.6.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.net.stringtools\\17.6.3\\microsoft.net.stringtools.17.6.3.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.netcore.platforms\\1.1.1\\microsoft.netcore.platforms.1.1.1.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.netcore.targets\\1.1.3\\microsoft.netcore.targets.1.1.3.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.servicehub.analyzers\\4.2.102\\microsoft.servicehub.analyzers.4.2.102.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.servicehub.framework\\4.2.102\\microsoft.servicehub.framework.4.2.102.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.servicehub.resources\\4.2.8\\microsoft.servicehub.resources.4.2.8.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.commandbars\\17.6.36389\\microsoft.visualstudio.commandbars.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.componentmodelhost\\17.6.268\\microsoft.visualstudio.componentmodelhost.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.composition\\17.6.17\\microsoft.visualstudio.composition.17.6.17.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.composition.analyzers\\17.6.17\\microsoft.visualstudio.composition.analyzers.17.6.17.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.coreutility\\17.6.268\\microsoft.visualstudio.coreutility.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.debugger.interop.12.0\\17.6.36389\\microsoft.visualstudio.debugger.interop.12.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.debugger.interop.14.0\\17.6.36389\\microsoft.visualstudio.debugger.interop.14.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.debugger.interop.15.0\\17.6.36389\\microsoft.visualstudio.debugger.interop.15.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.debugger.interop.16.0\\17.6.36389\\microsoft.visualstudio.debugger.interop.16.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.designer.interfaces\\17.6.36389\\microsoft.visualstudio.designer.interfaces.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.editor\\17.6.268\\microsoft.visualstudio.editor.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.graphmodel\\17.6.36389\\microsoft.visualstudio.graphmodel.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.imagecatalog\\17.6.36389\\microsoft.visualstudio.imagecatalog.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.imaging\\17.6.36389\\microsoft.visualstudio.imaging.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.imaging.interop.14.0.designtime\\17.6.36387\\microsoft.visualstudio.imaging.interop.14.0.designtime.17.6.36387.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.interop\\17.6.36389\\microsoft.visualstudio.interop.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.language\\17.6.268\\microsoft.visualstudio.language.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.language.intellisense\\17.6.268\\microsoft.visualstudio.language.intellisense.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.language.navigateto.interfaces\\17.6.268\\microsoft.visualstudio.language.navigateto.interfaces.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.language.standardclassification\\17.6.268\\microsoft.visualstudio.language.standardclassification.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.languageserver.client\\17.6.42\\microsoft.visualstudio.languageserver.client.17.6.42.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.ole.interop\\17.6.36389\\microsoft.visualstudio.ole.interop.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.package.languageservice.15.0\\17.6.36389\\microsoft.visualstudio.package.languageservice.15.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.projectaggregator\\17.6.36387\\microsoft.visualstudio.projectaggregator.17.6.36387.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.remotecontrol\\16.3.52\\microsoft.visualstudio.remotecontrol.16.3.52.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.rpccontracts\\17.6.13\\microsoft.visualstudio.rpccontracts.17.6.13.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.sdk\\17.6.36389\\microsoft.visualstudio.sdk.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.sdk.analyzers\\16.10.10\\microsoft.visualstudio.sdk.analyzers.16.10.10.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.setup.configuration.interop\\3.6.2115\\microsoft.visualstudio.setup.configuration.interop.3.6.2115.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.15.0\\17.6.36389\\microsoft.visualstudio.shell.15.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.design\\17.6.36389\\microsoft.visualstudio.shell.design.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.framework\\17.6.36389\\microsoft.visualstudio.shell.framework.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.interop\\17.6.36389\\microsoft.visualstudio.shell.interop.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.interop.10.0\\17.6.36389\\microsoft.visualstudio.shell.interop.10.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.interop.11.0\\17.6.36389\\microsoft.visualstudio.shell.interop.11.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.interop.12.0\\17.6.36389\\microsoft.visualstudio.shell.interop.12.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.interop.8.0\\17.6.36389\\microsoft.visualstudio.shell.interop.8.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.shell.interop.9.0\\17.6.36389\\microsoft.visualstudio.shell.interop.9.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.taskrunnerexplorer.14.0\\14.0.0\\microsoft.visualstudio.taskrunnerexplorer.14.0.14.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.telemetry\\17.6.46\\microsoft.visualstudio.telemetry.17.6.46.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.text.data\\17.6.268\\microsoft.visualstudio.text.data.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.text.logic\\17.6.268\\microsoft.visualstudio.text.logic.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.text.ui\\17.6.268\\microsoft.visualstudio.text.ui.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.text.ui.wpf\\17.6.268\\microsoft.visualstudio.text.ui.wpf.17.6.268.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.textmanager.interop\\17.6.36389\\microsoft.visualstudio.textmanager.interop.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.textmanager.interop.10.0\\17.6.36389\\microsoft.visualstudio.textmanager.interop.10.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.textmanager.interop.11.0\\17.6.36389\\microsoft.visualstudio.textmanager.interop.11.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.textmanager.interop.12.0\\17.6.36389\\microsoft.visualstudio.textmanager.interop.12.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.textmanager.interop.8.0\\17.6.36389\\microsoft.visualstudio.textmanager.interop.8.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.textmanager.interop.9.0\\17.6.36389\\microsoft.visualstudio.textmanager.interop.9.0.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.texttemplating.vshost\\17.6.36389\\microsoft.visualstudio.texttemplating.vshost.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.threading\\17.6.40\\microsoft.visualstudio.threading.17.6.40.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.threading.analyzers\\17.6.40\\microsoft.visualstudio.threading.analyzers.17.6.40.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.utilities\\17.6.36389\\microsoft.visualstudio.utilities.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.utilities.internal\\16.3.42\\microsoft.visualstudio.utilities.internal.16.3.42.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.validation\\17.6.11\\microsoft.visualstudio.validation.17.6.11.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.vcprojectengine\\17.6.36389\\microsoft.visualstudio.vcprojectengine.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.vshelp\\17.6.36389\\microsoft.visualstudio.vshelp.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.vshelp80\\17.6.36389\\microsoft.visualstudio.vshelp80.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.wcfreference.interop\\17.6.36389\\microsoft.visualstudio.wcfreference.interop.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.visualstudio.web.browserlink.12.0\\12.0.0\\microsoft.visualstudio.web.browserlink.12.0.12.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.vssdk.buildtools\\17.6.2164\\microsoft.vssdk.buildtools.17.6.2164.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.vssdk.compatibilityanalyzer\\17.6.2164\\microsoft.vssdk.compatibilityanalyzer.17.6.2164.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.web.webview2\\1.0.2478.35\\microsoft.web.webview2.1.0.2478.35.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.win32.primitives\\4.3.0\\microsoft.win32.primitives.4.3.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\microsoft.win32.registry\\5.0.0\\microsoft.win32.registry.5.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\nerdbank.streams\\2.9.112\\nerdbank.streams.2.9.112.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\newtonsoft.json\\13.0.3\\newtonsoft.json.13.0.3.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\runtime.win.microsoft.win32.primitives\\4.3.0\\runtime.win.microsoft.win32.primitives.4.3.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\stdole\\17.6.36389\\stdole.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\streamjsonrpc\\2.15.29\\streamjsonrpc.2.15.29.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.buffers\\4.5.1\\system.buffers.4.5.1.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.collections.immutable\\7.0.0\\system.collections.immutable.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.componentmodel.composition\\7.0.0\\system.componentmodel.composition.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.composition\\7.0.0\\system.composition.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.composition.attributedmodel\\7.0.0\\system.composition.attributedmodel.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.composition.convention\\7.0.0\\system.composition.convention.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.composition.hosting\\7.0.0\\system.composition.hosting.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.composition.runtime\\7.0.0\\system.composition.runtime.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.composition.typedparts\\7.0.0\\system.composition.typedparts.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.diagnostics.diagnosticsource\\7.0.1\\system.diagnostics.diagnosticsource.7.0.1.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.io.pipelines\\7.0.0\\system.io.pipelines.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.memory\\4.5.5\\system.memory.4.5.5.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.numerics.vectors\\4.5.0\\system.numerics.vectors.4.5.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.private.uri\\4.3.2\\system.private.uri.4.3.2.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.reflection.emit\\4.7.0\\system.reflection.emit.4.7.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.reflection.emit.lightweight\\4.7.0\\system.reflection.emit.lightweight.4.7.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.reflection.metadata\\7.0.0\\system.reflection.metadata.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.reflection.typeextensions\\4.7.0\\system.reflection.typeextensions.4.7.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\6.0.0\\system.runtime.compilerservices.unsafe.6.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.security.accesscontrol\\6.0.0\\system.security.accesscontrol.6.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.text.encodings.web\\8.0.0\\system.text.encodings.web.8.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.text.json\\8.0.5\\system.text.json.8.0.5.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.threading.accesscontrol\\7.0.0\\system.threading.accesscontrol.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.threading.tasks.dataflow\\7.0.0\\system.threading.tasks.dataflow.7.0.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.threading.tasks.extensions\\4.5.4\\system.threading.tasks.extensions.4.5.4.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\system.valuetuple\\4.5.0\\system.valuetuple.4.5.0.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj\\17.6.36389\\vslangproj.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj100\\17.6.36389\\vslangproj100.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj110\\17.6.36389\\vslangproj110.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj140\\17.6.36389\\vslangproj140.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj150\\17.6.36389\\vslangproj150.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj157\\17.6.36389\\vslangproj157.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj158\\17.6.36389\\vslangproj158.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj165\\17.6.36389\\vslangproj165.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj2\\17.6.36389\\vslangproj2.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj80\\17.6.36389\\vslangproj80.17.6.36389.nupkg.sha512", + "C:\\Users\\RobBos\\.nuget\\packages\\vslangproj90\\17.6.36389\\vslangproj90.17.6.36389.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/visualstudio-extension/src/CopilotTokenTracker/source.extension.vsixmanifest b/visualstudio-extension/src/CopilotTokenTracker/source.extension.vsixmanifest new file mode 100644 index 00000000..b64b1bc3 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/source.extension.vsixmanifest @@ -0,0 +1,52 @@ + + + + + Copilot Token Tracker + + Shows GitHub Copilot token usage statistics inside Visual Studio. + Displays today's and last-30-days token usage, per-model breakdown, + and detailed session analysis — powered by the same webview panels + as the VS Code extension. + + GitHub Copilot, token usage, AI, productivity + + + + + + amd64 + + + amd64 + + + amd64 + + + + + + + + + + + + + + + diff --git a/visualstudio-extension/src/CopilotTokenTracker/webview/chart.js b/visualstudio-extension/src/CopilotTokenTracker/webview/chart.js new file mode 100644 index 00000000..51b6efb2 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/webview/chart.js @@ -0,0 +1,35108 @@ +"use strict"; +(() => { + var __defProp = Object.defineProperty; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); + }; + var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + + // node_modules/@kurkle/color/dist/color.esm.js + function round(v) { + return v + 0.5 | 0; + } + function p2b(v) { + return lim(round(v * 2.55), 0, 255); + } + function n2b(v) { + return lim(round(v * 255), 0, 255); + } + function b2n(v) { + return lim(round(v / 2.55) / 100, 0, 1); + } + function n2p(v) { + return lim(round(v * 100), 0, 100); + } + function hexParse(str) { + var len = str.length; + var ret; + if (str[0] === "#") { + if (len === 4 || len === 5) { + ret = { + r: 255 & map$1[str[1]] * 17, + g: 255 & map$1[str[2]] * 17, + b: 255 & map$1[str[3]] * 17, + a: len === 5 ? map$1[str[4]] * 17 : 255 + }; + } else if (len === 7 || len === 9) { + ret = { + r: map$1[str[1]] << 4 | map$1[str[2]], + g: map$1[str[3]] << 4 | map$1[str[4]], + b: map$1[str[5]] << 4 | map$1[str[6]], + a: len === 9 ? map$1[str[7]] << 4 | map$1[str[8]] : 255 + }; + } + } + return ret; + } + function hexString(v) { + var f = isShort(v) ? h1 : h2; + return v ? "#" + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f) : void 0; + } + function hsl2rgbn(h, s, l) { + const a = s * Math.min(l, 1 - l); + const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1); + return [f(0), f(8), f(4)]; + } + function hsv2rgbn(h, s, v) { + const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0); + return [f(5), f(3), f(1)]; + } + function hwb2rgbn(h, w, b) { + const rgb = hsl2rgbn(h, 1, 0.5); + let i; + if (w + b > 1) { + i = 1 / (w + b); + w *= i; + b *= i; + } + for (i = 0; i < 3; i++) { + rgb[i] *= 1 - w - b; + rgb[i] += w; + } + return rgb; + } + function hueValue(r, g, b, d, max) { + if (r === max) { + return (g - b) / d + (g < b ? 6 : 0); + } + if (g === max) { + return (b - r) / d + 2; + } + return (r - g) / d + 4; + } + function rgb2hsl(v) { + const range2 = 255; + const r = v.r / range2; + const g = v.g / range2; + const b = v.b / range2; + const max = Math.max(r, g, b); + const min = Math.min(r, g, b); + const l = (max + min) / 2; + let h, s, d; + if (max !== min) { + d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + h = hueValue(r, g, b, d, max); + h = h * 60 + 0.5; + } + return [h | 0, s || 0, l]; + } + function calln(f, a, b, c) { + return (Array.isArray(a) ? f(a[0], a[1], a[2]) : f(a, b, c)).map(n2b); + } + function hsl2rgb(h, s, l) { + return calln(hsl2rgbn, h, s, l); + } + function hwb2rgb(h, w, b) { + return calln(hwb2rgbn, h, w, b); + } + function hsv2rgb(h, s, v) { + return calln(hsv2rgbn, h, s, v); + } + function hue(h) { + return (h % 360 + 360) % 360; + } + function hueParse(str) { + const m = HUE_RE.exec(str); + let a = 255; + let v; + if (!m) { + return; + } + if (m[5] !== v) { + a = m[6] ? p2b(+m[5]) : n2b(+m[5]); + } + const h = hue(+m[2]); + const p1 = +m[3] / 100; + const p2 = +m[4] / 100; + if (m[1] === "hwb") { + v = hwb2rgb(h, p1, p2); + } else if (m[1] === "hsv") { + v = hsv2rgb(h, p1, p2); + } else { + v = hsl2rgb(h, p1, p2); + } + return { + r: v[0], + g: v[1], + b: v[2], + a + }; + } + function rotate(v, deg) { + var h = rgb2hsl(v); + h[0] = hue(h[0] + deg); + h = hsl2rgb(h); + v.r = h[0]; + v.g = h[1]; + v.b = h[2]; + } + function hslString(v) { + if (!v) { + return; + } + const a = rgb2hsl(v); + const h = a[0]; + const s = n2p(a[1]); + const l = n2p(a[2]); + return v.a < 255 ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})` : `hsl(${h}, ${s}%, ${l}%)`; + } + function unpack() { + const unpacked = {}; + const keys = Object.keys(names$1); + const tkeys = Object.keys(map); + let i, j, k, ok, nk; + for (i = 0; i < keys.length; i++) { + ok = nk = keys[i]; + for (j = 0; j < tkeys.length; j++) { + k = tkeys[j]; + nk = nk.replace(k, map[k]); + } + k = parseInt(names$1[ok], 16); + unpacked[nk] = [k >> 16 & 255, k >> 8 & 255, k & 255]; + } + return unpacked; + } + function nameParse(str) { + if (!names) { + names = unpack(); + names.transparent = [0, 0, 0, 0]; + } + const a = names[str.toLowerCase()]; + return a && { + r: a[0], + g: a[1], + b: a[2], + a: a.length === 4 ? a[3] : 255 + }; + } + function rgbParse(str) { + const m = RGB_RE.exec(str); + let a = 255; + let r, g, b; + if (!m) { + return; + } + if (m[7] !== r) { + const v = +m[7]; + a = m[8] ? p2b(v) : lim(v * 255, 0, 255); + } + r = +m[1]; + g = +m[3]; + b = +m[5]; + r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255)); + g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255)); + b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255)); + return { + r, + g, + b, + a + }; + } + function rgbString(v) { + return v && (v.a < 255 ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})` : `rgb(${v.r}, ${v.g}, ${v.b})`); + } + function interpolate(rgb1, rgb2, t) { + const r = from(b2n(rgb1.r)); + const g = from(b2n(rgb1.g)); + const b = from(b2n(rgb1.b)); + return { + r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))), + g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))), + b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))), + a: rgb1.a + t * (rgb2.a - rgb1.a) + }; + } + function modHSL(v, i, ratio) { + if (v) { + let tmp = rgb2hsl(v); + tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1)); + tmp = hsl2rgb(tmp); + v.r = tmp[0]; + v.g = tmp[1]; + v.b = tmp[2]; + } + } + function clone(v, proto) { + return v ? Object.assign(proto || {}, v) : v; + } + function fromObject(input) { + var v = { r: 0, g: 0, b: 0, a: 255 }; + if (Array.isArray(input)) { + if (input.length >= 3) { + v = { r: input[0], g: input[1], b: input[2], a: 255 }; + if (input.length > 3) { + v.a = n2b(input[3]); + } + } + } else { + v = clone(input, { r: 0, g: 0, b: 0, a: 1 }); + v.a = n2b(v.a); + } + return v; + } + function functionParse(str) { + if (str.charAt(0) === "r") { + return rgbParse(str); + } + return hueParse(str); + } + var lim, map$1, hex, h1, h2, eq, isShort, alpha, HUE_RE, map, names$1, names, RGB_RE, to, from, Color; + var init_color_esm = __esm({ + "node_modules/@kurkle/color/dist/color.esm.js"() { + lim = (v, l, h) => Math.max(Math.min(v, h), l); + map$1 = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 }; + hex = [..."0123456789ABCDEF"]; + h1 = (b) => hex[b & 15]; + h2 = (b) => hex[(b & 240) >> 4] + hex[b & 15]; + eq = (b) => (b & 240) >> 4 === (b & 15); + isShort = (v) => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a); + alpha = (a, f) => a < 255 ? f(a) : ""; + HUE_RE = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/; + map = { + x: "dark", + Z: "light", + Y: "re", + X: "blu", + W: "gr", + V: "medium", + U: "slate", + A: "ee", + T: "ol", + S: "or", + B: "ra", + C: "lateg", + D: "ights", + R: "in", + Q: "turquois", + E: "hi", + P: "ro", + O: "al", + N: "le", + M: "de", + L: "yello", + F: "en", + K: "ch", + G: "arks", + H: "ea", + I: "ightg", + J: "wh" + }; + names$1 = { + OiceXe: "f0f8ff", + antiquewEte: "faebd7", + aqua: "ffff", + aquamarRe: "7fffd4", + azuY: "f0ffff", + beige: "f5f5dc", + bisque: "ffe4c4", + black: "0", + blanKedOmond: "ffebcd", + Xe: "ff", + XeviTet: "8a2be2", + bPwn: "a52a2a", + burlywood: "deb887", + caMtXe: "5f9ea0", + KartYuse: "7fff00", + KocTate: "d2691e", + cSO: "ff7f50", + cSnflowerXe: "6495ed", + cSnsilk: "fff8dc", + crimson: "dc143c", + cyan: "ffff", + xXe: "8b", + xcyan: "8b8b", + xgTMnPd: "b8860b", + xWay: "a9a9a9", + xgYF: "6400", + xgYy: "a9a9a9", + xkhaki: "bdb76b", + xmagFta: "8b008b", + xTivegYF: "556b2f", + xSange: "ff8c00", + xScEd: "9932cc", + xYd: "8b0000", + xsOmon: "e9967a", + xsHgYF: "8fbc8f", + xUXe: "483d8b", + xUWay: "2f4f4f", + xUgYy: "2f4f4f", + xQe: "ced1", + xviTet: "9400d3", + dAppRk: "ff1493", + dApskyXe: "bfff", + dimWay: "696969", + dimgYy: "696969", + dodgerXe: "1e90ff", + fiYbrick: "b22222", + flSOwEte: "fffaf0", + foYstWAn: "228b22", + fuKsia: "ff00ff", + gaRsbSo: "dcdcdc", + ghostwEte: "f8f8ff", + gTd: "ffd700", + gTMnPd: "daa520", + Way: "808080", + gYF: "8000", + gYFLw: "adff2f", + gYy: "808080", + honeyMw: "f0fff0", + hotpRk: "ff69b4", + RdianYd: "cd5c5c", + Rdigo: "4b0082", + ivSy: "fffff0", + khaki: "f0e68c", + lavFMr: "e6e6fa", + lavFMrXsh: "fff0f5", + lawngYF: "7cfc00", + NmoncEffon: "fffacd", + ZXe: "add8e6", + ZcSO: "f08080", + Zcyan: "e0ffff", + ZgTMnPdLw: "fafad2", + ZWay: "d3d3d3", + ZgYF: "90ee90", + ZgYy: "d3d3d3", + ZpRk: "ffb6c1", + ZsOmon: "ffa07a", + ZsHgYF: "20b2aa", + ZskyXe: "87cefa", + ZUWay: "778899", + ZUgYy: "778899", + ZstAlXe: "b0c4de", + ZLw: "ffffe0", + lime: "ff00", + limegYF: "32cd32", + lRF: "faf0e6", + magFta: "ff00ff", + maPon: "800000", + VaquamarRe: "66cdaa", + VXe: "cd", + VScEd: "ba55d3", + VpurpN: "9370db", + VsHgYF: "3cb371", + VUXe: "7b68ee", + VsprRggYF: "fa9a", + VQe: "48d1cc", + VviTetYd: "c71585", + midnightXe: "191970", + mRtcYam: "f5fffa", + mistyPse: "ffe4e1", + moccasR: "ffe4b5", + navajowEte: "ffdead", + navy: "80", + Tdlace: "fdf5e6", + Tive: "808000", + TivedBb: "6b8e23", + Sange: "ffa500", + SangeYd: "ff4500", + ScEd: "da70d6", + pOegTMnPd: "eee8aa", + pOegYF: "98fb98", + pOeQe: "afeeee", + pOeviTetYd: "db7093", + papayawEp: "ffefd5", + pHKpuff: "ffdab9", + peru: "cd853f", + pRk: "ffc0cb", + plum: "dda0dd", + powMrXe: "b0e0e6", + purpN: "800080", + YbeccapurpN: "663399", + Yd: "ff0000", + Psybrown: "bc8f8f", + PyOXe: "4169e1", + saddNbPwn: "8b4513", + sOmon: "fa8072", + sandybPwn: "f4a460", + sHgYF: "2e8b57", + sHshell: "fff5ee", + siFna: "a0522d", + silver: "c0c0c0", + skyXe: "87ceeb", + UXe: "6a5acd", + UWay: "708090", + UgYy: "708090", + snow: "fffafa", + sprRggYF: "ff7f", + stAlXe: "4682b4", + tan: "d2b48c", + teO: "8080", + tEstN: "d8bfd8", + tomato: "ff6347", + Qe: "40e0d0", + viTet: "ee82ee", + JHt: "f5deb3", + wEte: "ffffff", + wEtesmoke: "f5f5f5", + Lw: "ffff00", + LwgYF: "9acd32" + }; + RGB_RE = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/; + to = (v) => v <= 31308e-7 ? v * 12.92 : Math.pow(v, 1 / 2.4) * 1.055 - 0.055; + from = (v) => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); + Color = class _Color { + constructor(input) { + if (input instanceof _Color) { + return input; + } + const type = typeof input; + let v; + if (type === "object") { + v = fromObject(input); + } else if (type === "string") { + v = hexParse(input) || nameParse(input) || functionParse(input); + } + this._rgb = v; + this._valid = !!v; + } + get valid() { + return this._valid; + } + get rgb() { + var v = clone(this._rgb); + if (v) { + v.a = b2n(v.a); + } + return v; + } + set rgb(obj) { + this._rgb = fromObject(obj); + } + rgbString() { + return this._valid ? rgbString(this._rgb) : void 0; + } + hexString() { + return this._valid ? hexString(this._rgb) : void 0; + } + hslString() { + return this._valid ? hslString(this._rgb) : void 0; + } + mix(color2, weight) { + if (color2) { + const c1 = this.rgb; + const c2 = color2.rgb; + let w2; + const p = weight === w2 ? 0.5 : weight; + const w = 2 * p - 1; + const a = c1.a - c2.a; + const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2; + w2 = 1 - w1; + c1.r = 255 & w1 * c1.r + w2 * c2.r + 0.5; + c1.g = 255 & w1 * c1.g + w2 * c2.g + 0.5; + c1.b = 255 & w1 * c1.b + w2 * c2.b + 0.5; + c1.a = p * c1.a + (1 - p) * c2.a; + this.rgb = c1; + } + return this; + } + interpolate(color2, t) { + if (color2) { + this._rgb = interpolate(this._rgb, color2._rgb, t); + } + return this; + } + clone() { + return new _Color(this.rgb); + } + alpha(a) { + this._rgb.a = n2b(a); + return this; + } + clearer(ratio) { + const rgb = this._rgb; + rgb.a *= 1 - ratio; + return this; + } + greyscale() { + const rgb = this._rgb; + const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11); + rgb.r = rgb.g = rgb.b = val; + return this; + } + opaquer(ratio) { + const rgb = this._rgb; + rgb.a *= 1 + ratio; + return this; + } + negate() { + const v = this._rgb; + v.r = 255 - v.r; + v.g = 255 - v.g; + v.b = 255 - v.b; + return this; + } + lighten(ratio) { + modHSL(this._rgb, 2, ratio); + return this; + } + darken(ratio) { + modHSL(this._rgb, 2, -ratio); + return this; + } + saturate(ratio) { + modHSL(this._rgb, 1, ratio); + return this; + } + desaturate(ratio) { + modHSL(this._rgb, 1, -ratio); + return this; + } + rotate(deg) { + rotate(this._rgb, deg); + return this; + } + }; + } + }); + + // node_modules/chart.js/dist/chunks/helpers.dataset.js + function noop() { + } + function isNullOrUndef(value) { + return value === null || value === void 0; + } + function isArray(value) { + if (Array.isArray && Array.isArray(value)) { + return true; + } + const type = Object.prototype.toString.call(value); + if (type.slice(0, 7) === "[object" && type.slice(-6) === "Array]") { + return true; + } + return false; + } + function isObject(value) { + return value !== null && Object.prototype.toString.call(value) === "[object Object]"; + } + function isNumberFinite(value) { + return (typeof value === "number" || value instanceof Number) && isFinite(+value); + } + function finiteOrDefault(value, defaultValue) { + return isNumberFinite(value) ? value : defaultValue; + } + function valueOrDefault(value, defaultValue) { + return typeof value === "undefined" ? defaultValue : value; + } + function callback(fn, args, thisArg) { + if (fn && typeof fn.call === "function") { + return fn.apply(thisArg, args); + } + } + function each(loopable, fn, thisArg, reverse) { + let i, len, keys; + if (isArray(loopable)) { + len = loopable.length; + if (reverse) { + for (i = len - 1; i >= 0; i--) { + fn.call(thisArg, loopable[i], i); + } + } else { + for (i = 0; i < len; i++) { + fn.call(thisArg, loopable[i], i); + } + } + } else if (isObject(loopable)) { + keys = Object.keys(loopable); + len = keys.length; + for (i = 0; i < len; i++) { + fn.call(thisArg, loopable[keys[i]], keys[i]); + } + } + } + function _elementsEqual(a0, a1) { + let i, ilen, v0, v1; + if (!a0 || !a1 || a0.length !== a1.length) { + return false; + } + for (i = 0, ilen = a0.length; i < ilen; ++i) { + v0 = a0[i]; + v1 = a1[i]; + if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) { + return false; + } + } + return true; + } + function clone2(source) { + if (isArray(source)) { + return source.map(clone2); + } + if (isObject(source)) { + const target = /* @__PURE__ */ Object.create(null); + const keys = Object.keys(source); + const klen = keys.length; + let k = 0; + for (; k < klen; ++k) { + target[keys[k]] = clone2(source[keys[k]]); + } + return target; + } + return source; + } + function isValidKey(key) { + return [ + "__proto__", + "prototype", + "constructor" + ].indexOf(key) === -1; + } + function _merger(key, target, source, options) { + if (!isValidKey(key)) { + return; + } + const tval = target[key]; + const sval = source[key]; + if (isObject(tval) && isObject(sval)) { + merge(tval, sval, options); + } else { + target[key] = clone2(sval); + } + } + function merge(target, source, options) { + const sources = isArray(source) ? source : [ + source + ]; + const ilen = sources.length; + if (!isObject(target)) { + return target; + } + options = options || {}; + const merger = options.merger || _merger; + let current; + for (let i = 0; i < ilen; ++i) { + current = sources[i]; + if (!isObject(current)) { + continue; + } + const keys = Object.keys(current); + for (let k = 0, klen = keys.length; k < klen; ++k) { + merger(keys[k], target, current, options); + } + } + return target; + } + function mergeIf(target, source) { + return merge(target, source, { + merger: _mergerIf + }); + } + function _mergerIf(key, target, source) { + if (!isValidKey(key)) { + return; + } + const tval = target[key]; + const sval = source[key]; + if (isObject(tval) && isObject(sval)) { + mergeIf(tval, sval); + } else if (!Object.prototype.hasOwnProperty.call(target, key)) { + target[key] = clone2(sval); + } + } + function _splitKey(key) { + const parts = key.split("."); + const keys = []; + let tmp = ""; + for (const part of parts) { + tmp += part; + if (tmp.endsWith("\\")) { + tmp = tmp.slice(0, -1) + "."; + } else { + keys.push(tmp); + tmp = ""; + } + } + return keys; + } + function _getKeyResolver(key) { + const keys = _splitKey(key); + return (obj) => { + for (const k of keys) { + if (k === "") { + break; + } + obj = obj && obj[k]; + } + return obj; + }; + } + function resolveObjectKey(obj, key) { + const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key)); + return resolver(obj); + } + function _capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + function _isClickEvent(e) { + return e.type === "mouseup" || e.type === "click" || e.type === "contextmenu"; + } + function almostEquals(x, y, epsilon) { + return Math.abs(x - y) < epsilon; + } + function niceNum(range2) { + const roundedRange = Math.round(range2); + range2 = almostEquals(range2, roundedRange, range2 / 1e3) ? roundedRange : range2; + const niceRange = Math.pow(10, Math.floor(log10(range2))); + const fraction = range2 / niceRange; + const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10; + return niceFraction * niceRange; + } + function _factorize(value) { + const result = []; + const sqrt = Math.sqrt(value); + let i; + for (i = 1; i < sqrt; i++) { + if (value % i === 0) { + result.push(i); + result.push(value / i); + } + } + if (sqrt === (sqrt | 0)) { + result.push(sqrt); + } + result.sort((a, b) => a - b).pop(); + return result; + } + function isNonPrimitive(n) { + return typeof n === "symbol" || typeof n === "object" && n !== null && !(Symbol.toPrimitive in n || "toString" in n || "valueOf" in n); + } + function isNumber(n) { + return !isNonPrimitive(n) && !isNaN(parseFloat(n)) && isFinite(n); + } + function almostWhole(x, epsilon) { + const rounded = Math.round(x); + return rounded - epsilon <= x && rounded + epsilon >= x; + } + function _setMinAndMaxByKey(array, target, property) { + let i, ilen, value; + for (i = 0, ilen = array.length; i < ilen; i++) { + value = array[i][property]; + if (!isNaN(value)) { + target.min = Math.min(target.min, value); + target.max = Math.max(target.max, value); + } + } + } + function toRadians(degrees) { + return degrees * (PI / 180); + } + function toDegrees(radians) { + return radians * (180 / PI); + } + function _decimalPlaces(x) { + if (!isNumberFinite(x)) { + return; + } + let e = 1; + let p = 0; + while (Math.round(x * e) / e !== x) { + e *= 10; + p++; + } + return p; + } + function getAngleFromPoint(centrePoint, anglePoint) { + const distanceFromXCenter = anglePoint.x - centrePoint.x; + const distanceFromYCenter = anglePoint.y - centrePoint.y; + const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter); + let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter); + if (angle < -0.5 * PI) { + angle += TAU; + } + return { + angle, + distance: radialDistanceFromCenter + }; + } + function distanceBetweenPoints(pt1, pt2) { + return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2)); + } + function _angleDiff(a, b) { + return (a - b + PITAU) % TAU - PI; + } + function _normalizeAngle(a) { + return (a % TAU + TAU) % TAU; + } + function _angleBetween(angle, start, end, sameAngleIsFullCircle) { + const a = _normalizeAngle(angle); + const s = _normalizeAngle(start); + const e = _normalizeAngle(end); + const angleToStart = _normalizeAngle(s - a); + const angleToEnd = _normalizeAngle(e - a); + const startToAngle = _normalizeAngle(a - s); + const endToAngle = _normalizeAngle(a - e); + return a === s || a === e || sameAngleIsFullCircle && s === e || angleToStart > angleToEnd && startToAngle < endToAngle; + } + function _limitValue(value, min, max) { + return Math.max(min, Math.min(max, value)); + } + function _int16Range(value) { + return _limitValue(value, -32768, 32767); + } + function _isBetween(value, start, end, epsilon = 1e-6) { + return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon; + } + function _lookup(table, value, cmp) { + cmp = cmp || ((index2) => table[index2] < value); + let hi = table.length - 1; + let lo = 0; + let mid; + while (hi - lo > 1) { + mid = lo + hi >> 1; + if (cmp(mid)) { + lo = mid; + } else { + hi = mid; + } + } + return { + lo, + hi + }; + } + function _filterBetween(values, min, max) { + let start = 0; + let end = values.length; + while (start < end && values[start] < min) { + start++; + } + while (end > start && values[end - 1] > max) { + end--; + } + return start > 0 || end < values.length ? values.slice(start, end) : values; + } + function listenArrayEvents(array, listener) { + if (array._chartjs) { + array._chartjs.listeners.push(listener); + return; + } + Object.defineProperty(array, "_chartjs", { + configurable: true, + enumerable: false, + value: { + listeners: [ + listener + ] + } + }); + arrayEvents.forEach((key) => { + const method = "_onData" + _capitalize(key); + const base = array[key]; + Object.defineProperty(array, key, { + configurable: true, + enumerable: false, + value(...args) { + const res = base.apply(this, args); + array._chartjs.listeners.forEach((object) => { + if (typeof object[method] === "function") { + object[method](...args); + } + }); + return res; + } + }); + }); + } + function unlistenArrayEvents(array, listener) { + const stub = array._chartjs; + if (!stub) { + return; + } + const listeners = stub.listeners; + const index2 = listeners.indexOf(listener); + if (index2 !== -1) { + listeners.splice(index2, 1); + } + if (listeners.length > 0) { + return; + } + arrayEvents.forEach((key) => { + delete array[key]; + }); + delete array._chartjs; + } + function _arrayUnique(items) { + const set2 = new Set(items); + if (set2.size === items.length) { + return items; + } + return Array.from(set2); + } + function throttled(fn, thisArg) { + let argsToUse = []; + let ticking = false; + return function(...args) { + argsToUse = args; + if (!ticking) { + ticking = true; + requestAnimFrame.call(window, () => { + ticking = false; + fn.apply(thisArg, argsToUse); + }); + } + }; + } + function debounce(fn, delay) { + let timeout; + return function(...args) { + if (delay) { + clearTimeout(timeout); + timeout = setTimeout(fn, delay, args); + } else { + fn.apply(this, args); + } + return delay; + }; + } + function _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) { + const pointCount = points.length; + let start = 0; + let count = pointCount; + if (meta._sorted) { + const { iScale, vScale, _parsed } = meta; + const spanGaps = meta.dataset ? meta.dataset.options ? meta.dataset.options.spanGaps : null : null; + const axis = iScale.axis; + const { min, max, minDefined, maxDefined } = iScale.getUserBounds(); + if (minDefined) { + start = Math.min( + // @ts-expect-error Need to type _parsed + _lookupByKey(_parsed, axis, min).lo, + // @ts-expect-error Need to fix types on _lookupByKey + animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo + ); + if (spanGaps) { + const distanceToDefinedLo = _parsed.slice(0, start + 1).reverse().findIndex((point) => !isNullOrUndef(point[vScale.axis])); + start -= Math.max(0, distanceToDefinedLo); + } + start = _limitValue(start, 0, pointCount - 1); + } + if (maxDefined) { + let end = Math.max( + // @ts-expect-error Need to type _parsed + _lookupByKey(_parsed, iScale.axis, max, true).hi + 1, + // @ts-expect-error Need to fix types on _lookupByKey + animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1 + ); + if (spanGaps) { + const distanceToDefinedHi = _parsed.slice(end - 1).findIndex((point) => !isNullOrUndef(point[vScale.axis])); + end += Math.max(0, distanceToDefinedHi); + } + count = _limitValue(end, start, pointCount) - start; + } else { + count = pointCount - start; + } + } + return { + start, + count + }; + } + function _scaleRangesChanged(meta) { + const { xScale, yScale, _scaleRanges } = meta; + const newRanges = { + xmin: xScale.min, + xmax: xScale.max, + ymin: yScale.min, + ymax: yScale.max + }; + if (!_scaleRanges) { + meta._scaleRanges = newRanges; + return true; + } + const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max; + Object.assign(_scaleRanges, newRanges); + return changed; + } + function isPatternOrGradient(value) { + if (value && typeof value === "object") { + const type = value.toString(); + return type === "[object CanvasPattern]" || type === "[object CanvasGradient]"; + } + return false; + } + function color(value) { + return isPatternOrGradient(value) ? value : new Color(value); + } + function getHoverColor(value) { + return isPatternOrGradient(value) ? value : new Color(value).saturate(0.5).darken(0.1).hexString(); + } + function applyAnimationsDefaults(defaults2) { + defaults2.set("animation", { + delay: void 0, + duration: 1e3, + easing: "easeOutQuart", + fn: void 0, + from: void 0, + loop: void 0, + to: void 0, + type: void 0 + }); + defaults2.describe("animation", { + _fallback: false, + _indexable: false, + _scriptable: (name) => name !== "onProgress" && name !== "onComplete" && name !== "fn" + }); + defaults2.set("animations", { + colors: { + type: "color", + properties: colors + }, + numbers: { + type: "number", + properties: numbers + } + }); + defaults2.describe("animations", { + _fallback: "animation" + }); + defaults2.set("transitions", { + active: { + animation: { + duration: 400 + } + }, + resize: { + animation: { + duration: 0 + } + }, + show: { + animations: { + colors: { + from: "transparent" + }, + visible: { + type: "boolean", + duration: 0 + } + } + }, + hide: { + animations: { + colors: { + to: "transparent" + }, + visible: { + type: "boolean", + easing: "linear", + fn: (v) => v | 0 + } + } + } + }); + } + function applyLayoutsDefaults(defaults2) { + defaults2.set("layout", { + autoPadding: true, + padding: { + top: 0, + right: 0, + bottom: 0, + left: 0 + } + }); + } + function getNumberFormat(locale, options) { + options = options || {}; + const cacheKey = locale + JSON.stringify(options); + let formatter = intlCache.get(cacheKey); + if (!formatter) { + formatter = new Intl.NumberFormat(locale, options); + intlCache.set(cacheKey, formatter); + } + return formatter; + } + function formatNumber(num, locale, options) { + return getNumberFormat(locale, options).format(num); + } + function calculateDelta(tickValue, ticks) { + let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value; + if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) { + delta = tickValue - Math.floor(tickValue); + } + return delta; + } + function applyScaleDefaults(defaults2) { + defaults2.set("scale", { + display: true, + offset: false, + reverse: false, + beginAtZero: false, + bounds: "ticks", + clip: true, + grace: 0, + grid: { + display: true, + lineWidth: 1, + drawOnChartArea: true, + drawTicks: true, + tickLength: 8, + tickWidth: (_ctx, options) => options.lineWidth, + tickColor: (_ctx, options) => options.color, + offset: false + }, + border: { + display: true, + dash: [], + dashOffset: 0, + width: 1 + }, + title: { + display: false, + text: "", + padding: { + top: 4, + bottom: 4 + } + }, + ticks: { + minRotation: 0, + maxRotation: 50, + mirror: false, + textStrokeWidth: 0, + textStrokeColor: "", + padding: 3, + display: true, + autoSkip: true, + autoSkipPadding: 3, + labelOffset: 0, + callback: Ticks.formatters.values, + minor: {}, + major: {}, + align: "center", + crossAlign: "near", + showLabelBackdrop: false, + backdropColor: "rgba(255, 255, 255, 0.75)", + backdropPadding: 2 + } + }); + defaults2.route("scale.ticks", "color", "", "color"); + defaults2.route("scale.grid", "color", "", "borderColor"); + defaults2.route("scale.border", "color", "", "borderColor"); + defaults2.route("scale.title", "color", "", "color"); + defaults2.describe("scale", { + _fallback: false, + _scriptable: (name) => !name.startsWith("before") && !name.startsWith("after") && name !== "callback" && name !== "parser", + _indexable: (name) => name !== "borderDash" && name !== "tickBorderDash" && name !== "dash" + }); + defaults2.describe("scales", { + _fallback: "scale" + }); + defaults2.describe("scale.ticks", { + _scriptable: (name) => name !== "backdropPadding" && name !== "callback", + _indexable: (name) => name !== "backdropPadding" + }); + } + function getScope$1(node, key) { + if (!key) { + return node; + } + const keys = key.split("."); + for (let i = 0, n = keys.length; i < n; ++i) { + const k = keys[i]; + node = node[k] || (node[k] = /* @__PURE__ */ Object.create(null)); + } + return node; + } + function set(root, scope, values) { + if (typeof scope === "string") { + return merge(getScope$1(root, scope), values); + } + return merge(getScope$1(root, ""), scope); + } + function toFontString(font) { + if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) { + return null; + } + return (font.style ? font.style + " " : "") + (font.weight ? font.weight + " " : "") + font.size + "px " + font.family; + } + function _measureText(ctx, data, gc, longest, string) { + let textWidth = data[string]; + if (!textWidth) { + textWidth = data[string] = ctx.measureText(string).width; + gc.push(string); + } + if (textWidth > longest) { + longest = textWidth; + } + return longest; + } + function _longestText(ctx, font, arrayOfThings, cache2) { + cache2 = cache2 || {}; + let data = cache2.data = cache2.data || {}; + let gc = cache2.garbageCollect = cache2.garbageCollect || []; + if (cache2.font !== font) { + data = cache2.data = {}; + gc = cache2.garbageCollect = []; + cache2.font = font; + } + ctx.save(); + ctx.font = font; + let longest = 0; + const ilen = arrayOfThings.length; + let i, j, jlen, thing, nestedThing; + for (i = 0; i < ilen; i++) { + thing = arrayOfThings[i]; + if (thing !== void 0 && thing !== null && !isArray(thing)) { + longest = _measureText(ctx, data, gc, longest, thing); + } else if (isArray(thing)) { + for (j = 0, jlen = thing.length; j < jlen; j++) { + nestedThing = thing[j]; + if (nestedThing !== void 0 && nestedThing !== null && !isArray(nestedThing)) { + longest = _measureText(ctx, data, gc, longest, nestedThing); + } + } + } + } + ctx.restore(); + const gcLen = gc.length / 2; + if (gcLen > arrayOfThings.length) { + for (i = 0; i < gcLen; i++) { + delete data[gc[i]]; + } + gc.splice(0, gcLen); + } + return longest; + } + function _alignPixel(chart2, pixel, width) { + const devicePixelRatio = chart2.currentDevicePixelRatio; + const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0; + return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth; + } + function clearCanvas(canvas, ctx) { + if (!ctx && !canvas) { + return; + } + ctx = ctx || canvas.getContext("2d"); + ctx.save(); + ctx.resetTransform(); + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.restore(); + } + function drawPoint(ctx, options, x, y) { + drawPointLegend(ctx, options, x, y, null); + } + function drawPointLegend(ctx, options, x, y, w) { + let type, xOffset, yOffset, size, cornerRadius2, width, xOffsetW, yOffsetW; + const style = options.pointStyle; + const rotation = options.rotation; + const radius = options.radius; + let rad = (rotation || 0) * RAD_PER_DEG; + if (style && typeof style === "object") { + type = style.toString(); + if (type === "[object HTMLImageElement]" || type === "[object HTMLCanvasElement]") { + ctx.save(); + ctx.translate(x, y); + ctx.rotate(rad); + ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height); + ctx.restore(); + return; + } + } + if (isNaN(radius) || radius <= 0) { + return; + } + ctx.beginPath(); + switch (style) { + // Default includes circle + default: + if (w) { + ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU); + } else { + ctx.arc(x, y, radius, 0, TAU); + } + ctx.closePath(); + break; + case "triangle": + width = w ? w / 2 : radius; + ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + rad += TWO_THIRDS_PI; + ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius); + ctx.closePath(); + break; + case "rectRounded": + cornerRadius2 = radius * 0.516; + size = radius - cornerRadius2; + xOffset = Math.cos(rad + QUARTER_PI) * size; + xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius2 : size); + yOffset = Math.sin(rad + QUARTER_PI) * size; + yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius2 : size); + ctx.arc(x - xOffsetW, y - yOffset, cornerRadius2, rad - PI, rad - HALF_PI); + ctx.arc(x + yOffsetW, y - xOffset, cornerRadius2, rad - HALF_PI, rad); + ctx.arc(x + xOffsetW, y + yOffset, cornerRadius2, rad, rad + HALF_PI); + ctx.arc(x - yOffsetW, y + xOffset, cornerRadius2, rad + HALF_PI, rad + PI); + ctx.closePath(); + break; + case "rect": + if (!rotation) { + size = Math.SQRT1_2 * radius; + width = w ? w / 2 : size; + ctx.rect(x - width, y - size, 2 * width, 2 * size); + break; + } + rad += QUARTER_PI; + /* falls through */ + case "rectRot": + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + ctx.closePath(); + break; + case "crossRot": + rad += QUARTER_PI; + /* falls through */ + case "cross": + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + break; + case "star": + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + rad += QUARTER_PI; + xOffsetW = Math.cos(rad) * (w ? w / 2 : radius); + xOffset = Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + yOffsetW = Math.sin(rad) * (w ? w / 2 : radius); + ctx.moveTo(x - xOffsetW, y - yOffset); + ctx.lineTo(x + xOffsetW, y + yOffset); + ctx.moveTo(x + yOffsetW, y - xOffset); + ctx.lineTo(x - yOffsetW, y + xOffset); + break; + case "line": + xOffset = w ? w / 2 : Math.cos(rad) * radius; + yOffset = Math.sin(rad) * radius; + ctx.moveTo(x - xOffset, y - yOffset); + ctx.lineTo(x + xOffset, y + yOffset); + break; + case "dash": + ctx.moveTo(x, y); + ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius); + break; + case false: + ctx.closePath(); + break; + } + ctx.fill(); + if (options.borderWidth > 0) { + ctx.stroke(); + } + } + function _isPointInArea(point, area, margin) { + margin = margin || 0.5; + return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin; + } + function clipArea(ctx, area) { + ctx.save(); + ctx.beginPath(); + ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top); + ctx.clip(); + } + function unclipArea(ctx) { + ctx.restore(); + } + function _steppedLineTo(ctx, previous, target, flip, mode) { + if (!previous) { + return ctx.lineTo(target.x, target.y); + } + if (mode === "middle") { + const midpoint = (previous.x + target.x) / 2; + ctx.lineTo(midpoint, previous.y); + ctx.lineTo(midpoint, target.y); + } else if (mode === "after" !== !!flip) { + ctx.lineTo(previous.x, target.y); + } else { + ctx.lineTo(target.x, previous.y); + } + ctx.lineTo(target.x, target.y); + } + function _bezierCurveTo(ctx, previous, target, flip) { + if (!previous) { + return ctx.lineTo(target.x, target.y); + } + ctx.bezierCurveTo(flip ? previous.cp1x : previous.cp2x, flip ? previous.cp1y : previous.cp2y, flip ? target.cp2x : target.cp1x, flip ? target.cp2y : target.cp1y, target.x, target.y); + } + function setRenderOpts(ctx, opts) { + if (opts.translation) { + ctx.translate(opts.translation[0], opts.translation[1]); + } + if (!isNullOrUndef(opts.rotation)) { + ctx.rotate(opts.rotation); + } + if (opts.color) { + ctx.fillStyle = opts.color; + } + if (opts.textAlign) { + ctx.textAlign = opts.textAlign; + } + if (opts.textBaseline) { + ctx.textBaseline = opts.textBaseline; + } + } + function decorateText(ctx, x, y, line, opts) { + if (opts.strikethrough || opts.underline) { + const metrics = ctx.measureText(line); + const left = x - metrics.actualBoundingBoxLeft; + const right = x + metrics.actualBoundingBoxRight; + const top = y - metrics.actualBoundingBoxAscent; + const bottom = y + metrics.actualBoundingBoxDescent; + const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom; + ctx.strokeStyle = ctx.fillStyle; + ctx.beginPath(); + ctx.lineWidth = opts.decorationWidth || 2; + ctx.moveTo(left, yDecoration); + ctx.lineTo(right, yDecoration); + ctx.stroke(); + } + } + function drawBackdrop(ctx, opts) { + const oldColor = ctx.fillStyle; + ctx.fillStyle = opts.color; + ctx.fillRect(opts.left, opts.top, opts.width, opts.height); + ctx.fillStyle = oldColor; + } + function renderText(ctx, text, x, y, font, opts = {}) { + const lines = isArray(text) ? text : [ + text + ]; + const stroke = opts.strokeWidth > 0 && opts.strokeColor !== ""; + let i, line; + ctx.save(); + ctx.font = font.string; + setRenderOpts(ctx, opts); + for (i = 0; i < lines.length; ++i) { + line = lines[i]; + if (opts.backdrop) { + drawBackdrop(ctx, opts.backdrop); + } + if (stroke) { + if (opts.strokeColor) { + ctx.strokeStyle = opts.strokeColor; + } + if (!isNullOrUndef(opts.strokeWidth)) { + ctx.lineWidth = opts.strokeWidth; + } + ctx.strokeText(line, x, y, opts.maxWidth); + } + ctx.fillText(line, x, y, opts.maxWidth); + decorateText(ctx, x, y, line, opts); + y += Number(font.lineHeight); + } + ctx.restore(); + } + function addRoundedRectPath(ctx, rect) { + const { x, y, w, h, radius } = rect; + ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true); + ctx.lineTo(x, y + h - radius.bottomLeft); + ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true); + ctx.lineTo(x + w - radius.bottomRight, y + h); + ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true); + ctx.lineTo(x + w, y + radius.topRight); + ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true); + ctx.lineTo(x + radius.topLeft, y); + } + function toLineHeight(value, size) { + const matches2 = ("" + value).match(LINE_HEIGHT); + if (!matches2 || matches2[1] === "normal") { + return size * 1.2; + } + value = +matches2[2]; + switch (matches2[3]) { + case "px": + return value; + case "%": + value /= 100; + break; + } + return size * value; + } + function _readValueToProps(value, props) { + const ret = {}; + const objProps = isObject(props); + const keys = objProps ? Object.keys(props) : props; + const read = isObject(value) ? objProps ? (prop) => valueOrDefault(value[prop], value[props[prop]]) : (prop) => value[prop] : () => value; + for (const prop of keys) { + ret[prop] = numberOrZero(read(prop)); + } + return ret; + } + function toTRBL(value) { + return _readValueToProps(value, { + top: "y", + right: "x", + bottom: "y", + left: "x" + }); + } + function toTRBLCorners(value) { + return _readValueToProps(value, [ + "topLeft", + "topRight", + "bottomLeft", + "bottomRight" + ]); + } + function toPadding(value) { + const obj = toTRBL(value); + obj.width = obj.left + obj.right; + obj.height = obj.top + obj.bottom; + return obj; + } + function toFont(options, fallback) { + options = options || {}; + fallback = fallback || defaults.font; + let size = valueOrDefault(options.size, fallback.size); + if (typeof size === "string") { + size = parseInt(size, 10); + } + let style = valueOrDefault(options.style, fallback.style); + if (style && !("" + style).match(FONT_STYLE)) { + console.warn('Invalid font style specified: "' + style + '"'); + style = void 0; + } + const font = { + family: valueOrDefault(options.family, fallback.family), + lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size), + size, + style, + weight: valueOrDefault(options.weight, fallback.weight), + string: "" + }; + font.string = toFontString(font); + return font; + } + function resolve(inputs, context, index2, info) { + let cacheable = true; + let i, ilen, value; + for (i = 0, ilen = inputs.length; i < ilen; ++i) { + value = inputs[i]; + if (value === void 0) { + continue; + } + if (context !== void 0 && typeof value === "function") { + value = value(context); + cacheable = false; + } + if (index2 !== void 0 && isArray(value)) { + value = value[index2 % value.length]; + cacheable = false; + } + if (value !== void 0) { + if (info && !cacheable) { + info.cacheable = false; + } + return value; + } + } + } + function _addGrace(minmax, grace, beginAtZero) { + const { min, max } = minmax; + const change = toDimension(grace, (max - min) / 2); + const keepZero = (value, add) => beginAtZero && value === 0 ? 0 : value + add; + return { + min: keepZero(min, -Math.abs(change)), + max: keepZero(max, change) + }; + } + function createContext(parentContext, context) { + return Object.assign(Object.create(parentContext), context); + } + function _createResolver(scopes, prefixes = [ + "" + ], rootScopes, fallback, getTarget = () => scopes[0]) { + const finalRootScopes = rootScopes || scopes; + if (typeof fallback === "undefined") { + fallback = _resolve("_fallback", scopes); + } + const cache2 = { + [Symbol.toStringTag]: "Object", + _cacheable: true, + _scopes: scopes, + _rootScopes: finalRootScopes, + _fallback: fallback, + _getTarget: getTarget, + override: (scope) => _createResolver([ + scope, + ...scopes + ], prefixes, finalRootScopes, fallback) + }; + return new Proxy(cache2, { + /** + * A trap for the delete operator. + */ + deleteProperty(target, prop) { + delete target[prop]; + delete target._keys; + delete scopes[0][prop]; + return true; + }, + /** + * A trap for getting property values. + */ + get(target, prop) { + return _cached(target, prop, () => _resolveWithPrefixes(prop, prefixes, scopes, target)); + }, + /** + * A trap for Object.getOwnPropertyDescriptor. + * Also used by Object.hasOwnProperty. + */ + getOwnPropertyDescriptor(target, prop) { + return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop); + }, + /** + * A trap for Object.getPrototypeOf. + */ + getPrototypeOf() { + return Reflect.getPrototypeOf(scopes[0]); + }, + /** + * A trap for the in operator. + */ + has(target, prop) { + return getKeysFromAllScopes(target).includes(prop); + }, + /** + * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. + */ + ownKeys(target) { + return getKeysFromAllScopes(target); + }, + /** + * A trap for setting property values. + */ + set(target, prop, value) { + const storage = target._storage || (target._storage = getTarget()); + target[prop] = storage[prop] = value; + delete target._keys; + return true; + } + }); + } + function _attachContext(proxy, context, subProxy, descriptorDefaults) { + const cache2 = { + _cacheable: false, + _proxy: proxy, + _context: context, + _subProxy: subProxy, + _stack: /* @__PURE__ */ new Set(), + _descriptors: _descriptors(proxy, descriptorDefaults), + setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults), + override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults) + }; + return new Proxy(cache2, { + /** + * A trap for the delete operator. + */ + deleteProperty(target, prop) { + delete target[prop]; + delete proxy[prop]; + return true; + }, + /** + * A trap for getting property values. + */ + get(target, prop, receiver) { + return _cached(target, prop, () => _resolveWithContext(target, prop, receiver)); + }, + /** + * A trap for Object.getOwnPropertyDescriptor. + * Also used by Object.hasOwnProperty. + */ + getOwnPropertyDescriptor(target, prop) { + return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? { + enumerable: true, + configurable: true + } : void 0 : Reflect.getOwnPropertyDescriptor(proxy, prop); + }, + /** + * A trap for Object.getPrototypeOf. + */ + getPrototypeOf() { + return Reflect.getPrototypeOf(proxy); + }, + /** + * A trap for the in operator. + */ + has(target, prop) { + return Reflect.has(proxy, prop); + }, + /** + * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols. + */ + ownKeys() { + return Reflect.ownKeys(proxy); + }, + /** + * A trap for setting property values. + */ + set(target, prop, value) { + proxy[prop] = value; + delete target[prop]; + return true; + } + }); + } + function _descriptors(proxy, defaults2 = { + scriptable: true, + indexable: true + }) { + const { _scriptable = defaults2.scriptable, _indexable = defaults2.indexable, _allKeys = defaults2.allKeys } = proxy; + return { + allKeys: _allKeys, + scriptable: _scriptable, + indexable: _indexable, + isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable, + isIndexable: isFunction(_indexable) ? _indexable : () => _indexable + }; + } + function _cached(target, prop, resolve2) { + if (Object.prototype.hasOwnProperty.call(target, prop) || prop === "constructor") { + return target[prop]; + } + const value = resolve2(); + target[prop] = value; + return value; + } + function _resolveWithContext(target, prop, receiver) { + const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target; + let value = _proxy[prop]; + if (isFunction(value) && descriptors2.isScriptable(prop)) { + value = _resolveScriptable(prop, value, target, receiver); + } + if (isArray(value) && value.length) { + value = _resolveArray(prop, value, target, descriptors2.isIndexable); + } + if (needsSubResolver(prop, value)) { + value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors2); + } + return value; + } + function _resolveScriptable(prop, getValue, target, receiver) { + const { _proxy, _context, _subProxy, _stack } = target; + if (_stack.has(prop)) { + throw new Error("Recursion detected: " + Array.from(_stack).join("->") + "->" + prop); + } + _stack.add(prop); + let value = getValue(_context, _subProxy || receiver); + _stack.delete(prop); + if (needsSubResolver(prop, value)) { + value = createSubResolver(_proxy._scopes, _proxy, prop, value); + } + return value; + } + function _resolveArray(prop, value, target, isIndexable) { + const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target; + if (typeof _context.index !== "undefined" && isIndexable(prop)) { + return value[_context.index % value.length]; + } else if (isObject(value[0])) { + const arr = value; + const scopes = _proxy._scopes.filter((s) => s !== arr); + value = []; + for (const item of arr) { + const resolver = createSubResolver(scopes, _proxy, prop, item); + value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors2)); + } + } + return value; + } + function resolveFallback(fallback, prop, value) { + return isFunction(fallback) ? fallback(prop, value) : fallback; + } + function addScopes(set2, parentScopes, key, parentFallback, value) { + for (const parent of parentScopes) { + const scope = getScope(key, parent); + if (scope) { + set2.add(scope); + const fallback = resolveFallback(scope._fallback, key, value); + if (typeof fallback !== "undefined" && fallback !== key && fallback !== parentFallback) { + return fallback; + } + } else if (scope === false && typeof parentFallback !== "undefined" && key !== parentFallback) { + return null; + } + } + return false; + } + function createSubResolver(parentScopes, resolver, prop, value) { + const rootScopes = resolver._rootScopes; + const fallback = resolveFallback(resolver._fallback, prop, value); + const allScopes = [ + ...parentScopes, + ...rootScopes + ]; + const set2 = /* @__PURE__ */ new Set(); + set2.add(value); + let key = addScopesFromKey(set2, allScopes, prop, fallback || prop, value); + if (key === null) { + return false; + } + if (typeof fallback !== "undefined" && fallback !== prop) { + key = addScopesFromKey(set2, allScopes, fallback, key, value); + if (key === null) { + return false; + } + } + return _createResolver(Array.from(set2), [ + "" + ], rootScopes, fallback, () => subGetTarget(resolver, prop, value)); + } + function addScopesFromKey(set2, allScopes, key, fallback, item) { + while (key) { + key = addScopes(set2, allScopes, key, fallback, item); + } + return key; + } + function subGetTarget(resolver, prop, value) { + const parent = resolver._getTarget(); + if (!(prop in parent)) { + parent[prop] = {}; + } + const target = parent[prop]; + if (isArray(target) && isObject(value)) { + return value; + } + return target || {}; + } + function _resolveWithPrefixes(prop, prefixes, scopes, proxy) { + let value; + for (const prefix of prefixes) { + value = _resolve(readKey(prefix, prop), scopes); + if (typeof value !== "undefined") { + return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value; + } + } + } + function _resolve(key, scopes) { + for (const scope of scopes) { + if (!scope) { + continue; + } + const value = scope[key]; + if (typeof value !== "undefined") { + return value; + } + } + } + function getKeysFromAllScopes(target) { + let keys = target._keys; + if (!keys) { + keys = target._keys = resolveKeysFromAllScopes(target._scopes); + } + return keys; + } + function resolveKeysFromAllScopes(scopes) { + const set2 = /* @__PURE__ */ new Set(); + for (const scope of scopes) { + for (const key of Object.keys(scope).filter((k) => !k.startsWith("_"))) { + set2.add(key); + } + } + return Array.from(set2); + } + function _parseObjectDataRadialScale(meta, data, start, count) { + const { iScale } = meta; + const { key = "r" } = this._parsing; + const parsed = new Array(count); + let i, ilen, index2, item; + for (i = 0, ilen = count; i < ilen; ++i) { + index2 = i + start; + item = data[index2]; + parsed[i] = { + r: iScale.parse(resolveObjectKey(item, key), index2) + }; + } + return parsed; + } + function splineCurve(firstPoint, middlePoint, afterPoint, t) { + const previous = firstPoint.skip ? middlePoint : firstPoint; + const current = middlePoint; + const next = afterPoint.skip ? middlePoint : afterPoint; + const d01 = distanceBetweenPoints(current, previous); + const d12 = distanceBetweenPoints(next, current); + let s01 = d01 / (d01 + d12); + let s12 = d12 / (d01 + d12); + s01 = isNaN(s01) ? 0 : s01; + s12 = isNaN(s12) ? 0 : s12; + const fa = t * s01; + const fb = t * s12; + return { + previous: { + x: current.x - fa * (next.x - previous.x), + y: current.y - fa * (next.y - previous.y) + }, + next: { + x: current.x + fb * (next.x - previous.x), + y: current.y + fb * (next.y - previous.y) + } + }; + } + function monotoneAdjust(points, deltaK, mK) { + const pointsLen = points.length; + let alphaK, betaK, tauK, squaredMagnitude, pointCurrent; + let pointAfter = getPoint(points, 0); + for (let i = 0; i < pointsLen - 1; ++i) { + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent || !pointAfter) { + continue; + } + if (almostEquals(deltaK[i], 0, EPSILON)) { + mK[i] = mK[i + 1] = 0; + continue; + } + alphaK = mK[i] / deltaK[i]; + betaK = mK[i + 1] / deltaK[i]; + squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2); + if (squaredMagnitude <= 9) { + continue; + } + tauK = 3 / Math.sqrt(squaredMagnitude); + mK[i] = alphaK * tauK * deltaK[i]; + mK[i + 1] = betaK * tauK * deltaK[i]; + } + } + function monotoneCompute(points, mK, indexAxis = "x") { + const valueAxis = getValueAxis(indexAxis); + const pointsLen = points.length; + let delta, pointBefore, pointCurrent; + let pointAfter = getPoint(points, 0); + for (let i = 0; i < pointsLen; ++i) { + pointBefore = pointCurrent; + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent) { + continue; + } + const iPixel = pointCurrent[indexAxis]; + const vPixel = pointCurrent[valueAxis]; + if (pointBefore) { + delta = (iPixel - pointBefore[indexAxis]) / 3; + pointCurrent[`cp1${indexAxis}`] = iPixel - delta; + pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i]; + } + if (pointAfter) { + delta = (pointAfter[indexAxis] - iPixel) / 3; + pointCurrent[`cp2${indexAxis}`] = iPixel + delta; + pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i]; + } + } + } + function splineCurveMonotone(points, indexAxis = "x") { + const valueAxis = getValueAxis(indexAxis); + const pointsLen = points.length; + const deltaK = Array(pointsLen).fill(0); + const mK = Array(pointsLen); + let i, pointBefore, pointCurrent; + let pointAfter = getPoint(points, 0); + for (i = 0; i < pointsLen; ++i) { + pointBefore = pointCurrent; + pointCurrent = pointAfter; + pointAfter = getPoint(points, i + 1); + if (!pointCurrent) { + continue; + } + if (pointAfter) { + const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis]; + deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0; + } + mK[i] = !pointBefore ? deltaK[i] : !pointAfter ? deltaK[i - 1] : sign(deltaK[i - 1]) !== sign(deltaK[i]) ? 0 : (deltaK[i - 1] + deltaK[i]) / 2; + } + monotoneAdjust(points, deltaK, mK); + monotoneCompute(points, mK, indexAxis); + } + function capControlPoint(pt, min, max) { + return Math.max(Math.min(pt, max), min); + } + function capBezierPoints(points, area) { + let i, ilen, point, inArea, inAreaPrev; + let inAreaNext = _isPointInArea(points[0], area); + for (i = 0, ilen = points.length; i < ilen; ++i) { + inAreaPrev = inArea; + inArea = inAreaNext; + inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area); + if (!inArea) { + continue; + } + point = points[i]; + if (inAreaPrev) { + point.cp1x = capControlPoint(point.cp1x, area.left, area.right); + point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom); + } + if (inAreaNext) { + point.cp2x = capControlPoint(point.cp2x, area.left, area.right); + point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom); + } + } + } + function _updateBezierControlPoints(points, options, area, loop, indexAxis) { + let i, ilen, point, controlPoints; + if (options.spanGaps) { + points = points.filter((pt) => !pt.skip); + } + if (options.cubicInterpolationMode === "monotone") { + splineCurveMonotone(points, indexAxis); + } else { + let prev = loop ? points[points.length - 1] : points[0]; + for (i = 0, ilen = points.length; i < ilen; ++i) { + point = points[i]; + controlPoints = splineCurve(prev, point, points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen], options.tension); + point.cp1x = controlPoints.previous.x; + point.cp1y = controlPoints.previous.y; + point.cp2x = controlPoints.next.x; + point.cp2y = controlPoints.next.y; + prev = point; + } + } + if (options.capBezierPoints) { + capBezierPoints(points, area); + } + } + function _isDomSupported() { + return typeof window !== "undefined" && typeof document !== "undefined"; + } + function _getParentNode(domNode) { + let parent = domNode.parentNode; + if (parent && parent.toString() === "[object ShadowRoot]") { + parent = parent.host; + } + return parent; + } + function parseMaxStyle(styleValue, node, parentProperty) { + let valueInPixels; + if (typeof styleValue === "string") { + valueInPixels = parseInt(styleValue, 10); + if (styleValue.indexOf("%") !== -1) { + valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty]; + } + } else { + valueInPixels = styleValue; + } + return valueInPixels; + } + function getStyle(el2, property) { + return getComputedStyle2(el2).getPropertyValue(property); + } + function getPositionedStyle(styles, style, suffix) { + const result = {}; + suffix = suffix ? "-" + suffix : ""; + for (let i = 0; i < 4; i++) { + const pos = positions[i]; + result[pos] = parseFloat(styles[style + "-" + pos + suffix]) || 0; + } + result.width = result.left + result.right; + result.height = result.top + result.bottom; + return result; + } + function getCanvasPosition(e, canvas) { + const touches = e.touches; + const source = touches && touches.length ? touches[0] : e; + const { offsetX, offsetY } = source; + let box = false; + let x, y; + if (useOffsetPos(offsetX, offsetY, e.target)) { + x = offsetX; + y = offsetY; + } else { + const rect = canvas.getBoundingClientRect(); + x = source.clientX - rect.left; + y = source.clientY - rect.top; + box = true; + } + return { + x, + y, + box + }; + } + function getRelativePosition(event, chart2) { + if ("native" in event) { + return event; + } + const { canvas, currentDevicePixelRatio } = chart2; + const style = getComputedStyle2(canvas); + const borderBox = style.boxSizing === "border-box"; + const paddings = getPositionedStyle(style, "padding"); + const borders = getPositionedStyle(style, "border", "width"); + const { x, y, box } = getCanvasPosition(event, canvas); + const xOffset = paddings.left + (box && borders.left); + const yOffset = paddings.top + (box && borders.top); + let { width, height } = chart2; + if (borderBox) { + width -= paddings.width + borders.width; + height -= paddings.height + borders.height; + } + return { + x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio), + y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio) + }; + } + function getContainerSize(canvas, width, height) { + let maxWidth, maxHeight; + if (width === void 0 || height === void 0) { + const container = canvas && _getParentNode(canvas); + if (!container) { + width = canvas.clientWidth; + height = canvas.clientHeight; + } else { + const rect = container.getBoundingClientRect(); + const containerStyle = getComputedStyle2(container); + const containerBorder = getPositionedStyle(containerStyle, "border", "width"); + const containerPadding = getPositionedStyle(containerStyle, "padding"); + width = rect.width - containerPadding.width - containerBorder.width; + height = rect.height - containerPadding.height - containerBorder.height; + maxWidth = parseMaxStyle(containerStyle.maxWidth, container, "clientWidth"); + maxHeight = parseMaxStyle(containerStyle.maxHeight, container, "clientHeight"); + } + } + return { + width, + height, + maxWidth: maxWidth || INFINITY, + maxHeight: maxHeight || INFINITY + }; + } + function getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) { + const style = getComputedStyle2(canvas); + const margins = getPositionedStyle(style, "margin"); + const maxWidth = parseMaxStyle(style.maxWidth, canvas, "clientWidth") || INFINITY; + const maxHeight = parseMaxStyle(style.maxHeight, canvas, "clientHeight") || INFINITY; + const containerSize = getContainerSize(canvas, bbWidth, bbHeight); + let { width, height } = containerSize; + if (style.boxSizing === "content-box") { + const borders = getPositionedStyle(style, "border", "width"); + const paddings = getPositionedStyle(style, "padding"); + width -= paddings.width + borders.width; + height -= paddings.height + borders.height; + } + width = Math.max(0, width - margins.width); + height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height); + width = round1(Math.min(width, maxWidth, containerSize.maxWidth)); + height = round1(Math.min(height, maxHeight, containerSize.maxHeight)); + if (width && !height) { + height = round1(width / 2); + } + const maintainHeight = bbWidth !== void 0 || bbHeight !== void 0; + if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) { + height = containerSize.height; + width = round1(Math.floor(height * aspectRatio)); + } + return { + width, + height + }; + } + function retinaScale(chart2, forceRatio, forceStyle) { + const pixelRatio = forceRatio || 1; + const deviceHeight = round1(chart2.height * pixelRatio); + const deviceWidth = round1(chart2.width * pixelRatio); + chart2.height = round1(chart2.height); + chart2.width = round1(chart2.width); + const canvas = chart2.canvas; + if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) { + canvas.style.height = `${chart2.height}px`; + canvas.style.width = `${chart2.width}px`; + } + if (chart2.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) { + chart2.currentDevicePixelRatio = pixelRatio; + canvas.height = deviceHeight; + canvas.width = deviceWidth; + chart2.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0); + return true; + } + return false; + } + function readUsedSize(element, property) { + const value = getStyle(element, property); + const matches2 = value && value.match(/^(\d+)(\.\d+)?px$/); + return matches2 ? +matches2[1] : void 0; + } + function _pointInLine(p1, p2, t, mode) { + return { + x: p1.x + t * (p2.x - p1.x), + y: p1.y + t * (p2.y - p1.y) + }; + } + function _steppedInterpolation(p1, p2, t, mode) { + return { + x: p1.x + t * (p2.x - p1.x), + y: mode === "middle" ? t < 0.5 ? p1.y : p2.y : mode === "after" ? t < 1 ? p1.y : p2.y : t > 0 ? p2.y : p1.y + }; + } + function _bezierInterpolation(p1, p2, t, mode) { + const cp1 = { + x: p1.cp2x, + y: p1.cp2y + }; + const cp2 = { + x: p2.cp1x, + y: p2.cp1y + }; + const a = _pointInLine(p1, cp1, t); + const b = _pointInLine(cp1, cp2, t); + const c = _pointInLine(cp2, p2, t); + const d = _pointInLine(a, b, t); + const e = _pointInLine(b, c, t); + return _pointInLine(d, e, t); + } + function getRtlAdapter(rtl, rectX, width) { + return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter(); + } + function overrideTextDirection(ctx, direction) { + let style, original; + if (direction === "ltr" || direction === "rtl") { + style = ctx.canvas.style; + original = [ + style.getPropertyValue("direction"), + style.getPropertyPriority("direction") + ]; + style.setProperty("direction", direction, "important"); + ctx.prevTextDirection = original; + } + } + function restoreTextDirection(ctx, original) { + if (original !== void 0) { + delete ctx.prevTextDirection; + ctx.canvas.style.setProperty("direction", original[0], original[1]); + } + } + function propertyFn(property) { + if (property === "angle") { + return { + between: _angleBetween, + compare: _angleDiff, + normalize: _normalizeAngle + }; + } + return { + between: _isBetween, + compare: (a, b) => a - b, + normalize: (x) => x + }; + } + function normalizeSegment({ start, end, count, loop, style }) { + return { + start: start % count, + end: end % count, + loop: loop && (end - start + 1) % count === 0, + style + }; + } + function getSegment(segment, points, bounds) { + const { property, start: startBound, end: endBound } = bounds; + const { between, normalize } = propertyFn(property); + const count = points.length; + let { start, end, loop } = segment; + let i, ilen; + if (loop) { + start += count; + end += count; + for (i = 0, ilen = count; i < ilen; ++i) { + if (!between(normalize(points[start % count][property]), startBound, endBound)) { + break; + } + start--; + end--; + } + start %= count; + end %= count; + } + if (end < start) { + end += count; + } + return { + start, + end, + loop, + style: segment.style + }; + } + function _boundSegment(segment, points, bounds) { + if (!bounds) { + return [ + segment + ]; + } + const { property, start: startBound, end: endBound } = bounds; + const count = points.length; + const { compare, between, normalize } = propertyFn(property); + const { start, end, loop, style } = getSegment(segment, points, bounds); + const result = []; + let inside = false; + let subStart = null; + let value, point, prevValue; + const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0; + const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value); + const shouldStart = () => inside || startIsBefore(); + const shouldStop = () => !inside || endIsBefore(); + for (let i = start, prev = start; i <= end; ++i) { + point = points[i % count]; + if (point.skip) { + continue; + } + value = normalize(point[property]); + if (value === prevValue) { + continue; + } + inside = between(value, startBound, endBound); + if (subStart === null && shouldStart()) { + subStart = compare(value, startBound) === 0 ? i : prev; + } + if (subStart !== null && shouldStop()) { + result.push(normalizeSegment({ + start: subStart, + end: i, + loop, + count, + style + })); + subStart = null; + } + prev = i; + prevValue = value; + } + if (subStart !== null) { + result.push(normalizeSegment({ + start: subStart, + end, + loop, + count, + style + })); + } + return result; + } + function _boundSegments(line, bounds) { + const result = []; + const segments = line.segments; + for (let i = 0; i < segments.length; i++) { + const sub = _boundSegment(segments[i], line.points, bounds); + if (sub.length) { + result.push(...sub); + } + } + return result; + } + function findStartAndEnd(points, count, loop, spanGaps) { + let start = 0; + let end = count - 1; + if (loop && !spanGaps) { + while (start < count && !points[start].skip) { + start++; + } + } + while (start < count && points[start].skip) { + start++; + } + start %= count; + if (loop) { + end += start; + } + while (end > start && points[end % count].skip) { + end--; + } + end %= count; + return { + start, + end + }; + } + function solidSegments(points, start, max, loop) { + const count = points.length; + const result = []; + let last = start; + let prev = points[start]; + let end; + for (end = start + 1; end <= max; ++end) { + const cur = points[end % count]; + if (cur.skip || cur.stop) { + if (!prev.skip) { + loop = false; + result.push({ + start: start % count, + end: (end - 1) % count, + loop + }); + start = last = cur.stop ? end : null; + } + } else { + last = end; + if (prev.skip) { + start = end; + } + } + prev = cur; + } + if (last !== null) { + result.push({ + start: start % count, + end: last % count, + loop + }); + } + return result; + } + function _computeSegments(line, segmentOptions) { + const points = line.points; + const spanGaps = line.options.spanGaps; + const count = points.length; + if (!count) { + return []; + } + const loop = !!line._loop; + const { start, end } = findStartAndEnd(points, count, loop, spanGaps); + if (spanGaps === true) { + return splitByStyles(line, [ + { + start, + end, + loop + } + ], points, segmentOptions); + } + const max = end < start ? end + count : end; + const completeLoop = !!line._fullLoop && start === 0 && end === count - 1; + return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions); + } + function splitByStyles(line, segments, points, segmentOptions) { + if (!segmentOptions || !segmentOptions.setContext || !points) { + return segments; + } + return doSplitByStyles(line, segments, points, segmentOptions); + } + function doSplitByStyles(line, segments, points, segmentOptions) { + const chartContext = line._chart.getContext(); + const baseStyle = readStyle(line.options); + const { _datasetIndex: datasetIndex, options: { spanGaps } } = line; + const count = points.length; + const result = []; + let prevStyle = baseStyle; + let start = segments[0].start; + let i = start; + function addStyle(s, e, l, st) { + const dir = spanGaps ? -1 : 1; + if (s === e) { + return; + } + s += count; + while (points[s % count].skip) { + s -= dir; + } + while (points[e % count].skip) { + e += dir; + } + if (s % count !== e % count) { + result.push({ + start: s % count, + end: e % count, + loop: l, + style: st + }); + prevStyle = st; + start = e % count; + } + } + for (const segment of segments) { + start = spanGaps ? start : segment.start; + let prev = points[start % count]; + let style; + for (i = start + 1; i <= segment.end; i++) { + const pt = points[i % count]; + style = readStyle(segmentOptions.setContext(createContext(chartContext, { + type: "segment", + p0: prev, + p1: pt, + p0DataIndex: (i - 1) % count, + p1DataIndex: i % count, + datasetIndex + }))); + if (styleChanged(style, prevStyle)) { + addStyle(start, i - 1, segment.loop, prevStyle); + } + prev = pt; + prevStyle = style; + } + if (start < i - 1) { + addStyle(start, i - 1, segment.loop, prevStyle); + } + } + return result; + } + function readStyle(options) { + return { + backgroundColor: options.backgroundColor, + borderCapStyle: options.borderCapStyle, + borderDash: options.borderDash, + borderDashOffset: options.borderDashOffset, + borderJoinStyle: options.borderJoinStyle, + borderWidth: options.borderWidth, + borderColor: options.borderColor + }; + } + function styleChanged(style, prevStyle) { + if (!prevStyle) { + return false; + } + const cache2 = []; + const replacer = function(key, value) { + if (!isPatternOrGradient(value)) { + return value; + } + if (!cache2.includes(value)) { + cache2.push(value); + } + return cache2.indexOf(value); + }; + return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer); + } + function getSizeForArea(scale, chartArea, field) { + return scale.options.clip ? scale[field] : chartArea[field]; + } + function getDatasetArea(meta, chartArea) { + const { xScale, yScale } = meta; + if (xScale && yScale) { + return { + left: getSizeForArea(xScale, chartArea, "left"), + right: getSizeForArea(xScale, chartArea, "right"), + top: getSizeForArea(yScale, chartArea, "top"), + bottom: getSizeForArea(yScale, chartArea, "bottom") + }; + } + return chartArea; + } + function getDatasetClipArea(chart2, meta) { + const clip = meta._clip; + if (clip.disabled) { + return false; + } + const area = getDatasetArea(meta, chart2.chartArea); + return { + left: clip.left === false ? 0 : area.left - (clip.left === true ? 0 : clip.left), + right: clip.right === false ? chart2.width : area.right + (clip.right === true ? 0 : clip.right), + top: clip.top === false ? 0 : area.top - (clip.top === true ? 0 : clip.top), + bottom: clip.bottom === false ? chart2.height : area.bottom + (clip.bottom === true ? 0 : clip.bottom) + }; + } + var uid, toPercentage, toDimension, keyResolvers, defined, isFunction, setsEqual, PI, TAU, PITAU, INFINITY, RAD_PER_DEG, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, log10, sign, _lookupByKey, _rlookupByKey, arrayEvents, requestAnimFrame, _toLeftRightCenter, _alignStartEnd, _textX, atEdge, elasticIn, elasticOut, effects, numbers, colors, intlCache, formatters, Ticks, overrides, descriptors, Defaults, defaults, LINE_HEIGHT, FONT_STYLE, numberOrZero, readKey, needsSubResolver, getScope, EPSILON, getPoint, getValueAxis, getComputedStyle2, positions, useOffsetPos, round1, supportsEventListenerOptions, getRightToLeftAdapter, getLeftToRightAdapter; + var init_helpers_dataset = __esm({ + "node_modules/chart.js/dist/chunks/helpers.dataset.js"() { + init_color_esm(); + uid = /* @__PURE__ */ (() => { + let id = 0; + return () => id++; + })(); + toPercentage = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 : +value / dimension; + toDimension = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 * dimension : +value; + keyResolvers = { + // Chart.helpers.core resolveObjectKey should resolve empty key to root object + "": (v) => v, + // default resolvers + x: (o) => o.x, + y: (o) => o.y + }; + defined = (value) => typeof value !== "undefined"; + isFunction = (value) => typeof value === "function"; + setsEqual = (a, b) => { + if (a.size !== b.size) { + return false; + } + for (const item of a) { + if (!b.has(item)) { + return false; + } + } + return true; + }; + PI = Math.PI; + TAU = 2 * PI; + PITAU = TAU + PI; + INFINITY = Number.POSITIVE_INFINITY; + RAD_PER_DEG = PI / 180; + HALF_PI = PI / 2; + QUARTER_PI = PI / 4; + TWO_THIRDS_PI = PI * 2 / 3; + log10 = Math.log10; + sign = Math.sign; + _lookupByKey = (table, key, value, last) => _lookup(table, value, last ? (index2) => { + const ti = table[index2][key]; + return ti < value || ti === value && table[index2 + 1][key] === value; + } : (index2) => table[index2][key] < value); + _rlookupByKey = (table, key, value) => _lookup(table, value, (index2) => table[index2][key] >= value); + arrayEvents = [ + "push", + "pop", + "shift", + "splice", + "unshift" + ]; + requestAnimFrame = (function() { + if (typeof window === "undefined") { + return function(callback2) { + return callback2(); + }; + } + return window.requestAnimationFrame; + })(); + _toLeftRightCenter = (align) => align === "start" ? "left" : align === "end" ? "right" : "center"; + _alignStartEnd = (align, start, end) => align === "start" ? start : align === "end" ? end : (start + end) / 2; + _textX = (align, left, right, rtl) => { + const check = rtl ? "left" : "right"; + return align === check ? right : align === "center" ? (left + right) / 2 : left; + }; + atEdge = (t) => t === 0 || t === 1; + elasticIn = (t, s, p) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p)); + elasticOut = (t, s, p) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1; + effects = { + linear: (t) => t, + easeInQuad: (t) => t * t, + easeOutQuad: (t) => -t * (t - 2), + easeInOutQuad: (t) => (t /= 0.5) < 1 ? 0.5 * t * t : -0.5 * (--t * (t - 2) - 1), + easeInCubic: (t) => t * t * t, + easeOutCubic: (t) => (t -= 1) * t * t + 1, + easeInOutCubic: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t : 0.5 * ((t -= 2) * t * t + 2), + easeInQuart: (t) => t * t * t * t, + easeOutQuart: (t) => -((t -= 1) * t * t * t - 1), + easeInOutQuart: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2), + easeInQuint: (t) => t * t * t * t * t, + easeOutQuint: (t) => (t -= 1) * t * t * t * t + 1, + easeInOutQuint: (t) => (t /= 0.5) < 1 ? 0.5 * t * t * t * t * t : 0.5 * ((t -= 2) * t * t * t * t + 2), + easeInSine: (t) => -Math.cos(t * HALF_PI) + 1, + easeOutSine: (t) => Math.sin(t * HALF_PI), + easeInOutSine: (t) => -0.5 * (Math.cos(PI * t) - 1), + easeInExpo: (t) => t === 0 ? 0 : Math.pow(2, 10 * (t - 1)), + easeOutExpo: (t) => t === 1 ? 1 : -Math.pow(2, -10 * t) + 1, + easeInOutExpo: (t) => atEdge(t) ? t : t < 0.5 ? 0.5 * Math.pow(2, 10 * (t * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2), + easeInCirc: (t) => t >= 1 ? t : -(Math.sqrt(1 - t * t) - 1), + easeOutCirc: (t) => Math.sqrt(1 - (t -= 1) * t), + easeInOutCirc: (t) => (t /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1), + easeInElastic: (t) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3), + easeOutElastic: (t) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3), + easeInOutElastic(t) { + const s = 0.1125; + const p = 0.45; + return atEdge(t) ? t : t < 0.5 ? 0.5 * elasticIn(t * 2, s, p) : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p); + }, + easeInBack(t) { + const s = 1.70158; + return t * t * ((s + 1) * t - s); + }, + easeOutBack(t) { + const s = 1.70158; + return (t -= 1) * t * ((s + 1) * t + s) + 1; + }, + easeInOutBack(t) { + let s = 1.70158; + if ((t /= 0.5) < 1) { + return 0.5 * (t * t * (((s *= 1.525) + 1) * t - s)); + } + return 0.5 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2); + }, + easeInBounce: (t) => 1 - effects.easeOutBounce(1 - t), + easeOutBounce(t) { + const m = 7.5625; + const d = 2.75; + if (t < 1 / d) { + return m * t * t; + } + if (t < 2 / d) { + return m * (t -= 1.5 / d) * t + 0.75; + } + if (t < 2.5 / d) { + return m * (t -= 2.25 / d) * t + 0.9375; + } + return m * (t -= 2.625 / d) * t + 0.984375; + }, + easeInOutBounce: (t) => t < 0.5 ? effects.easeInBounce(t * 2) * 0.5 : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5 + }; + numbers = [ + "x", + "y", + "borderWidth", + "radius", + "tension" + ]; + colors = [ + "color", + "borderColor", + "backgroundColor" + ]; + intlCache = /* @__PURE__ */ new Map(); + formatters = { + values(value) { + return isArray(value) ? value : "" + value; + }, + numeric(tickValue, index2, ticks) { + if (tickValue === 0) { + return "0"; + } + const locale = this.chart.options.locale; + let notation; + let delta = tickValue; + if (ticks.length > 1) { + const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value)); + if (maxTick < 1e-4 || maxTick > 1e15) { + notation = "scientific"; + } + delta = calculateDelta(tickValue, ticks); + } + const logDelta = log10(Math.abs(delta)); + const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0); + const options = { + notation, + minimumFractionDigits: numDecimal, + maximumFractionDigits: numDecimal + }; + Object.assign(options, this.options.ticks.format); + return formatNumber(tickValue, locale, options); + }, + logarithmic(tickValue, index2, ticks) { + if (tickValue === 0) { + return "0"; + } + const remain = ticks[index2].significand || tickValue / Math.pow(10, Math.floor(log10(tickValue))); + if ([ + 1, + 2, + 3, + 5, + 10, + 15 + ].includes(remain) || index2 > 0.8 * ticks.length) { + return formatters.numeric.call(this, tickValue, index2, ticks); + } + return ""; + } + }; + Ticks = { + formatters + }; + overrides = /* @__PURE__ */ Object.create(null); + descriptors = /* @__PURE__ */ Object.create(null); + Defaults = class { + constructor(_descriptors2, _appliers) { + this.animation = void 0; + this.backgroundColor = "rgba(0,0,0,0.1)"; + this.borderColor = "rgba(0,0,0,0.1)"; + this.color = "#666"; + this.datasets = {}; + this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio(); + this.elements = {}; + this.events = [ + "mousemove", + "mouseout", + "click", + "touchstart", + "touchmove" + ]; + this.font = { + family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", + size: 12, + style: "normal", + lineHeight: 1.2, + weight: null + }; + this.hover = {}; + this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor); + this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor); + this.hoverColor = (ctx, options) => getHoverColor(options.color); + this.indexAxis = "x"; + this.interaction = { + mode: "nearest", + intersect: true, + includeInvisible: false + }; + this.maintainAspectRatio = true; + this.onHover = null; + this.onClick = null; + this.parsing = true; + this.plugins = {}; + this.responsive = true; + this.scale = void 0; + this.scales = {}; + this.showLine = true; + this.drawActiveElementsOnTop = true; + this.describe(_descriptors2); + this.apply(_appliers); + } + set(scope, values) { + return set(this, scope, values); + } + get(scope) { + return getScope$1(this, scope); + } + describe(scope, values) { + return set(descriptors, scope, values); + } + override(scope, values) { + return set(overrides, scope, values); + } + route(scope, name, targetScope, targetName) { + const scopeObject = getScope$1(this, scope); + const targetScopeObject = getScope$1(this, targetScope); + const privateName = "_" + name; + Object.defineProperties(scopeObject, { + [privateName]: { + value: scopeObject[name], + writable: true + }, + [name]: { + enumerable: true, + get() { + const local = this[privateName]; + const target = targetScopeObject[targetName]; + if (isObject(local)) { + return Object.assign({}, target, local); + } + return valueOrDefault(local, target); + }, + set(value) { + this[privateName] = value; + } + } + }); + } + apply(appliers) { + appliers.forEach((apply) => apply(this)); + } + }; + defaults = /* @__PURE__ */ new Defaults({ + _scriptable: (name) => !name.startsWith("on"), + _indexable: (name) => name !== "events", + hover: { + _fallback: "interaction" + }, + interaction: { + _scriptable: false, + _indexable: false + } + }, [ + applyAnimationsDefaults, + applyLayoutsDefaults, + applyScaleDefaults + ]); + LINE_HEIGHT = /^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/; + FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/; + numberOrZero = (v) => +v || 0; + readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name; + needsSubResolver = (prop, value) => isObject(value) && prop !== "adapters" && (Object.getPrototypeOf(value) === null || value.constructor === Object); + getScope = (key, parent) => key === true ? parent : typeof key === "string" ? resolveObjectKey(parent, key) : void 0; + EPSILON = Number.EPSILON || 1e-14; + getPoint = (points, i) => i < points.length && !points[i].skip && points[i]; + getValueAxis = (indexAxis) => indexAxis === "x" ? "y" : "x"; + getComputedStyle2 = (element) => element.ownerDocument.defaultView.getComputedStyle(element, null); + positions = [ + "top", + "right", + "bottom", + "left" + ]; + useOffsetPos = (x, y, target) => (x > 0 || y > 0) && (!target || !target.shadowRoot); + round1 = (v) => Math.round(v * 10) / 10; + supportsEventListenerOptions = (function() { + let passiveSupported = false; + try { + const options = { + get passive() { + passiveSupported = true; + return false; + } + }; + if (_isDomSupported()) { + window.addEventListener("test", null, options); + window.removeEventListener("test", null, options); + } + } catch (e) { + } + return passiveSupported; + })(); + getRightToLeftAdapter = function(rectX, width) { + return { + x(x) { + return rectX + rectX + width - x; + }, + setWidth(w) { + width = w; + }, + textAlign(align) { + if (align === "center") { + return align; + } + return align === "right" ? "left" : "right"; + }, + xPlus(x, value) { + return x - value; + }, + leftForLtr(x, itemWidth) { + return x - itemWidth; + } + }; + }; + getLeftToRightAdapter = function() { + return { + x(x) { + return x; + }, + setWidth(w) { + }, + textAlign(align) { + return align; + }, + xPlus(x, value) { + return x + value; + }, + leftForLtr(x, _itemWidth) { + return x; + } + }; + }; + } + }); + + // node_modules/chart.js/dist/chart.js + function awaitAll(animations, properties) { + const running = []; + const keys = Object.keys(properties); + for (let i = 0; i < keys.length; i++) { + const anim = animations[keys[i]]; + if (anim && anim.active()) { + running.push(anim.wait()); + } + } + return Promise.all(running); + } + function resolveTargetOptions(target, newOptions) { + if (!newOptions) { + return; + } + let options = target.options; + if (!options) { + target.options = newOptions; + return; + } + if (options.$shared) { + target.options = options = Object.assign({}, options, { + $shared: false, + $animations: {} + }); + } + return options; + } + function scaleClip(scale, allowedOverflow) { + const opts = scale && scale.options || {}; + const reverse = opts.reverse; + const min = opts.min === void 0 ? allowedOverflow : 0; + const max = opts.max === void 0 ? allowedOverflow : 0; + return { + start: reverse ? max : min, + end: reverse ? min : max + }; + } + function defaultClip(xScale, yScale, allowedOverflow) { + if (allowedOverflow === false) { + return false; + } + const x = scaleClip(xScale, allowedOverflow); + const y = scaleClip(yScale, allowedOverflow); + return { + top: y.end, + right: x.end, + bottom: y.start, + left: x.start + }; + } + function toClip(value) { + let t, r, b, l; + if (isObject(value)) { + t = value.top; + r = value.right; + b = value.bottom; + l = value.left; + } else { + t = r = b = l = value; + } + return { + top: t, + right: r, + bottom: b, + left: l, + disabled: value === false + }; + } + function getSortedDatasetIndices(chart2, filterVisible) { + const keys = []; + const metasets = chart2._getSortedDatasetMetas(filterVisible); + let i, ilen; + for (i = 0, ilen = metasets.length; i < ilen; ++i) { + keys.push(metasets[i].index); + } + return keys; + } + function applyStack(stack, value, dsIndex, options = {}) { + const keys = stack.keys; + const singleMode = options.mode === "single"; + let i, ilen, datasetIndex, otherValue; + if (value === null) { + return; + } + let found = false; + for (i = 0, ilen = keys.length; i < ilen; ++i) { + datasetIndex = +keys[i]; + if (datasetIndex === dsIndex) { + found = true; + if (options.all) { + continue; + } + break; + } + otherValue = stack.values[datasetIndex]; + if (isNumberFinite(otherValue) && (singleMode || value === 0 || sign(value) === sign(otherValue))) { + value += otherValue; + } + } + if (!found && !options.all) { + return 0; + } + return value; + } + function convertObjectDataToArray(data, meta) { + const { iScale, vScale } = meta; + const iAxisKey = iScale.axis === "x" ? "x" : "y"; + const vAxisKey = vScale.axis === "x" ? "x" : "y"; + const keys = Object.keys(data); + const adata = new Array(keys.length); + let i, ilen, key; + for (i = 0, ilen = keys.length; i < ilen; ++i) { + key = keys[i]; + adata[i] = { + [iAxisKey]: key, + [vAxisKey]: data[key] + }; + } + return adata; + } + function isStacked(scale, meta) { + const stacked = scale && scale.options.stacked; + return stacked || stacked === void 0 && meta.stack !== void 0; + } + function getStackKey(indexScale, valueScale, meta) { + return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`; + } + function getUserBounds(scale) { + const { min, max, minDefined, maxDefined } = scale.getUserBounds(); + return { + min: minDefined ? min : Number.NEGATIVE_INFINITY, + max: maxDefined ? max : Number.POSITIVE_INFINITY + }; + } + function getOrCreateStack(stacks, stackKey, indexValue) { + const subStack = stacks[stackKey] || (stacks[stackKey] = {}); + return subStack[indexValue] || (subStack[indexValue] = {}); + } + function getLastIndexInStack(stack, vScale, positive, type) { + for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) { + const value = stack[meta.index]; + if (positive && value > 0 || !positive && value < 0) { + return meta.index; + } + } + return null; + } + function updateStacks(controller, parsed) { + const { chart: chart2, _cachedMeta: meta } = controller; + const stacks = chart2._stacks || (chart2._stacks = {}); + const { iScale, vScale, index: datasetIndex } = meta; + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const key = getStackKey(iScale, vScale, meta); + const ilen = parsed.length; + let stack; + for (let i = 0; i < ilen; ++i) { + const item = parsed[i]; + const { [iAxis]: index2, [vAxis]: value } = item; + const itemStacks = item._stacks || (item._stacks = {}); + stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index2); + stack[datasetIndex] = value; + stack._top = getLastIndexInStack(stack, vScale, true, meta.type); + stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type); + const visualValues = stack._visualValues || (stack._visualValues = {}); + visualValues[datasetIndex] = value; + } + } + function getFirstScaleId(chart2, axis) { + const scales2 = chart2.scales; + return Object.keys(scales2).filter((key) => scales2[key].axis === axis).shift(); + } + function createDatasetContext(parent, index2) { + return createContext(parent, { + active: false, + dataset: void 0, + datasetIndex: index2, + index: index2, + mode: "default", + type: "dataset" + }); + } + function createDataContext(parent, index2, element) { + return createContext(parent, { + active: false, + dataIndex: index2, + parsed: void 0, + raw: void 0, + element, + index: index2, + mode: "default", + type: "data" + }); + } + function clearStacks(meta, items) { + const datasetIndex = meta.controller.index; + const axis = meta.vScale && meta.vScale.axis; + if (!axis) { + return; + } + items = items || meta._parsed; + for (const parsed of items) { + const stacks = parsed._stacks; + if (!stacks || stacks[axis] === void 0 || stacks[axis][datasetIndex] === void 0) { + return; + } + delete stacks[axis][datasetIndex]; + if (stacks[axis]._visualValues !== void 0 && stacks[axis]._visualValues[datasetIndex] !== void 0) { + delete stacks[axis]._visualValues[datasetIndex]; + } + } + } + function getAllScaleValues(scale, type) { + if (!scale._cache.$bar) { + const visibleMetas = scale.getMatchingVisibleMetas(type); + let values = []; + for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) { + values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale)); + } + scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b)); + } + return scale._cache.$bar; + } + function computeMinSampleSize(meta) { + const scale = meta.iScale; + const values = getAllScaleValues(scale, meta.type); + let min = scale._length; + let i, ilen, curr, prev; + const updateMinAndPrev = () => { + if (curr === 32767 || curr === -32768) { + return; + } + if (defined(prev)) { + min = Math.min(min, Math.abs(curr - prev) || min); + } + prev = curr; + }; + for (i = 0, ilen = values.length; i < ilen; ++i) { + curr = scale.getPixelForValue(values[i]); + updateMinAndPrev(); + } + prev = void 0; + for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) { + curr = scale.getPixelForTick(i); + updateMinAndPrev(); + } + return min; + } + function computeFitCategoryTraits(index2, ruler, options, stackCount) { + const thickness = options.barThickness; + let size, ratio; + if (isNullOrUndef(thickness)) { + size = ruler.min * options.categoryPercentage; + ratio = options.barPercentage; + } else { + size = thickness * stackCount; + ratio = 1; + } + return { + chunk: size / stackCount, + ratio, + start: ruler.pixels[index2] - size / 2 + }; + } + function computeFlexCategoryTraits(index2, ruler, options, stackCount) { + const pixels = ruler.pixels; + const curr = pixels[index2]; + let prev = index2 > 0 ? pixels[index2 - 1] : null; + let next = index2 < pixels.length - 1 ? pixels[index2 + 1] : null; + const percent = options.categoryPercentage; + if (prev === null) { + prev = curr - (next === null ? ruler.end - ruler.start : next - curr); + } + if (next === null) { + next = curr + curr - prev; + } + const start = curr - (curr - Math.min(prev, next)) / 2 * percent; + const size = Math.abs(next - prev) / 2 * percent; + return { + chunk: size / stackCount, + ratio: options.barPercentage, + start + }; + } + function parseFloatBar(entry, item, vScale, i) { + const startValue = vScale.parse(entry[0], i); + const endValue = vScale.parse(entry[1], i); + const min = Math.min(startValue, endValue); + const max = Math.max(startValue, endValue); + let barStart = min; + let barEnd = max; + if (Math.abs(min) > Math.abs(max)) { + barStart = max; + barEnd = min; + } + item[vScale.axis] = barEnd; + item._custom = { + barStart, + barEnd, + start: startValue, + end: endValue, + min, + max + }; + } + function parseValue(entry, item, vScale, i) { + if (isArray(entry)) { + parseFloatBar(entry, item, vScale, i); + } else { + item[vScale.axis] = vScale.parse(entry, i); + } + return item; + } + function parseArrayOrPrimitive(meta, data, start, count) { + const iScale = meta.iScale; + const vScale = meta.vScale; + const labels = iScale.getLabels(); + const singleScale = iScale === vScale; + const parsed = []; + let i, ilen, item, entry; + for (i = start, ilen = start + count; i < ilen; ++i) { + entry = data[i]; + item = {}; + item[iScale.axis] = singleScale || iScale.parse(labels[i], i); + parsed.push(parseValue(entry, item, vScale, i)); + } + return parsed; + } + function isFloatBar(custom) { + return custom && custom.barStart !== void 0 && custom.barEnd !== void 0; + } + function barSign(size, vScale, actualBase) { + if (size !== 0) { + return sign(size); + } + return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1); + } + function borderProps(properties) { + let reverse, start, end, top, bottom; + if (properties.horizontal) { + reverse = properties.base > properties.x; + start = "left"; + end = "right"; + } else { + reverse = properties.base < properties.y; + start = "bottom"; + end = "top"; + } + if (reverse) { + top = "end"; + bottom = "start"; + } else { + top = "start"; + bottom = "end"; + } + return { + start, + end, + reverse, + top, + bottom + }; + } + function setBorderSkipped(properties, options, stack, index2) { + let edge = options.borderSkipped; + const res = {}; + if (!edge) { + properties.borderSkipped = res; + return; + } + if (edge === true) { + properties.borderSkipped = { + top: true, + right: true, + bottom: true, + left: true + }; + return; + } + const { start, end, reverse, top, bottom } = borderProps(properties); + if (edge === "middle" && stack) { + properties.enableBorderRadius = true; + if ((stack._top || 0) === index2) { + edge = top; + } else if ((stack._bottom || 0) === index2) { + edge = bottom; + } else { + res[parseEdge(bottom, start, end, reverse)] = true; + edge = top; + } + } + res[parseEdge(edge, start, end, reverse)] = true; + properties.borderSkipped = res; + } + function parseEdge(edge, a, b, reverse) { + if (reverse) { + edge = swap(edge, a, b); + edge = startEnd(edge, b, a); + } else { + edge = startEnd(edge, a, b); + } + return edge; + } + function swap(orig, v1, v2) { + return orig === v1 ? v2 : orig === v2 ? v1 : orig; + } + function startEnd(v, start, end) { + return v === "start" ? start : v === "end" ? end : v; + } + function setInflateAmount(properties, { inflateAmount }, ratio) { + properties.inflateAmount = inflateAmount === "auto" ? ratio === 1 ? 0.33 : 0 : inflateAmount; + } + function getRatioAndOffset(rotation, circumference, cutout) { + let ratioX = 1; + let ratioY = 1; + let offsetX = 0; + let offsetY = 0; + if (circumference < TAU) { + const startAngle = rotation; + const endAngle = startAngle + circumference; + const startX = Math.cos(startAngle); + const startY = Math.sin(startAngle); + const endX = Math.cos(endAngle); + const endY = Math.sin(endAngle); + const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout); + const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout); + const maxX = calcMax(0, startX, endX); + const maxY = calcMax(HALF_PI, startY, endY); + const minX = calcMin(PI, startX, endX); + const minY = calcMin(PI + HALF_PI, startY, endY); + ratioX = (maxX - minX) / 2; + ratioY = (maxY - minY) / 2; + offsetX = -(maxX + minX) / 2; + offsetY = -(maxY + minY) / 2; + } + return { + ratioX, + ratioY, + offsetX, + offsetY + }; + } + function abstract() { + throw new Error("This method is not implemented: Check that a complete date adapter is provided."); + } + function binarySearch(metaset, axis, value, intersect2) { + const { controller, data, _sorted } = metaset; + const iScale = controller._cachedMeta.iScale; + const spanGaps = metaset.dataset ? metaset.dataset.options ? metaset.dataset.options.spanGaps : null : null; + if (iScale && axis === iScale.axis && axis !== "r" && _sorted && data.length) { + const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey; + if (!intersect2) { + const result = lookupMethod(data, axis, value); + if (spanGaps) { + const { vScale } = controller._cachedMeta; + const { _parsed } = metaset; + const distanceToDefinedLo = _parsed.slice(0, result.lo + 1).reverse().findIndex((point) => !isNullOrUndef(point[vScale.axis])); + result.lo -= Math.max(0, distanceToDefinedLo); + const distanceToDefinedHi = _parsed.slice(result.hi).findIndex((point) => !isNullOrUndef(point[vScale.axis])); + result.hi += Math.max(0, distanceToDefinedHi); + } + return result; + } else if (controller._sharedOptions) { + const el2 = data[0]; + const range2 = typeof el2.getRange === "function" && el2.getRange(axis); + if (range2) { + const start = lookupMethod(data, axis, value - range2); + const end = lookupMethod(data, axis, value + range2); + return { + lo: start.lo, + hi: end.hi + }; + } + } + } + return { + lo: 0, + hi: data.length - 1 + }; + } + function evaluateInteractionItems(chart2, axis, position, handler, intersect2) { + const metasets = chart2.getSortedVisibleDatasetMetas(); + const value = position[axis]; + for (let i = 0, ilen = metasets.length; i < ilen; ++i) { + const { index: index2, data } = metasets[i]; + const { lo, hi } = binarySearch(metasets[i], axis, value, intersect2); + for (let j = lo; j <= hi; ++j) { + const element = data[j]; + if (!element.skip) { + handler(element, index2, j); + } + } + } + } + function getDistanceMetricForAxis(axis) { + const useX = axis.indexOf("x") !== -1; + const useY = axis.indexOf("y") !== -1; + return function(pt1, pt2) { + const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0; + const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0; + return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2)); + }; + } + function getIntersectItems(chart2, position, axis, useFinalPosition, includeInvisible) { + const items = []; + if (!includeInvisible && !chart2.isPointInArea(position)) { + return items; + } + const evaluationFunc = function(element, datasetIndex, index2) { + if (!includeInvisible && !_isPointInArea(element, chart2.chartArea, 0)) { + return; + } + if (element.inRange(position.x, position.y, useFinalPosition)) { + items.push({ + element, + datasetIndex, + index: index2 + }); + } + }; + evaluateInteractionItems(chart2, axis, position, evaluationFunc, true); + return items; + } + function getNearestRadialItems(chart2, position, axis, useFinalPosition) { + let items = []; + function evaluationFunc(element, datasetIndex, index2) { + const { startAngle, endAngle } = element.getProps([ + "startAngle", + "endAngle" + ], useFinalPosition); + const { angle } = getAngleFromPoint(element, { + x: position.x, + y: position.y + }); + if (_angleBetween(angle, startAngle, endAngle)) { + items.push({ + element, + datasetIndex, + index: index2 + }); + } + } + evaluateInteractionItems(chart2, axis, position, evaluationFunc); + return items; + } + function getNearestCartesianItems(chart2, position, axis, intersect2, useFinalPosition, includeInvisible) { + let items = []; + const distanceMetric = getDistanceMetricForAxis(axis); + let minDistance = Number.POSITIVE_INFINITY; + function evaluationFunc(element, datasetIndex, index2) { + const inRange3 = element.inRange(position.x, position.y, useFinalPosition); + if (intersect2 && !inRange3) { + return; + } + const center = element.getCenterPoint(useFinalPosition); + const pointInArea = !!includeInvisible || chart2.isPointInArea(center); + if (!pointInArea && !inRange3) { + return; + } + const distance = distanceMetric(position, center); + if (distance < minDistance) { + items = [ + { + element, + datasetIndex, + index: index2 + } + ]; + minDistance = distance; + } else if (distance === minDistance) { + items.push({ + element, + datasetIndex, + index: index2 + }); + } + } + evaluateInteractionItems(chart2, axis, position, evaluationFunc); + return items; + } + function getNearestItems(chart2, position, axis, intersect2, useFinalPosition, includeInvisible) { + if (!includeInvisible && !chart2.isPointInArea(position)) { + return []; + } + return axis === "r" && !intersect2 ? getNearestRadialItems(chart2, position, axis, useFinalPosition) : getNearestCartesianItems(chart2, position, axis, intersect2, useFinalPosition, includeInvisible); + } + function getAxisItems(chart2, position, axis, intersect2, useFinalPosition) { + const items = []; + const rangeMethod = axis === "x" ? "inXRange" : "inYRange"; + let intersectsItem = false; + evaluateInteractionItems(chart2, axis, position, (element, datasetIndex, index2) => { + if (element[rangeMethod] && element[rangeMethod](position[axis], useFinalPosition)) { + items.push({ + element, + datasetIndex, + index: index2 + }); + intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition); + } + }); + if (intersect2 && !intersectsItem) { + return []; + } + return items; + } + function filterByPosition(array, position) { + return array.filter((v) => v.pos === position); + } + function filterDynamicPositionByAxis(array, axis) { + return array.filter((v) => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis); + } + function sortByWeight(array, reverse) { + return array.sort((a, b) => { + const v0 = reverse ? b : a; + const v1 = reverse ? a : b; + return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight; + }); + } + function wrapBoxes(boxes) { + const layoutBoxes = []; + let i, ilen, box, pos, stack, stackWeight; + for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) { + box = boxes[i]; + ({ position: pos, options: { stack, stackWeight = 1 } } = box); + layoutBoxes.push({ + index: i, + box, + pos, + horizontal: box.isHorizontal(), + weight: box.weight, + stack: stack && pos + stack, + stackWeight + }); + } + return layoutBoxes; + } + function buildStacks(layouts2) { + const stacks = {}; + for (const wrap of layouts2) { + const { stack, pos, stackWeight } = wrap; + if (!stack || !STATIC_POSITIONS.includes(pos)) { + continue; + } + const _stack = stacks[stack] || (stacks[stack] = { + count: 0, + placed: 0, + weight: 0, + size: 0 + }); + _stack.count++; + _stack.weight += stackWeight; + } + return stacks; + } + function setLayoutDims(layouts2, params) { + const stacks = buildStacks(layouts2); + const { vBoxMaxWidth, hBoxMaxHeight } = params; + let i, ilen, layout; + for (i = 0, ilen = layouts2.length; i < ilen; ++i) { + layout = layouts2[i]; + const { fullSize } = layout.box; + const stack = stacks[layout.stack]; + const factor = stack && layout.stackWeight / stack.weight; + if (layout.horizontal) { + layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth; + layout.height = hBoxMaxHeight; + } else { + layout.width = vBoxMaxWidth; + layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight; + } + } + return stacks; + } + function buildLayoutBoxes(boxes) { + const layoutBoxes = wrapBoxes(boxes); + const fullSize = sortByWeight(layoutBoxes.filter((wrap) => wrap.box.fullSize), true); + const left = sortByWeight(filterByPosition(layoutBoxes, "left"), true); + const right = sortByWeight(filterByPosition(layoutBoxes, "right")); + const top = sortByWeight(filterByPosition(layoutBoxes, "top"), true); + const bottom = sortByWeight(filterByPosition(layoutBoxes, "bottom")); + const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, "x"); + const centerVertical = filterDynamicPositionByAxis(layoutBoxes, "y"); + return { + fullSize, + leftAndTop: left.concat(top), + rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal), + chartArea: filterByPosition(layoutBoxes, "chartArea"), + vertical: left.concat(right).concat(centerVertical), + horizontal: top.concat(bottom).concat(centerHorizontal) + }; + } + function getCombinedMax(maxPadding, chartArea, a, b) { + return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]); + } + function updateMaxPadding(maxPadding, boxPadding) { + maxPadding.top = Math.max(maxPadding.top, boxPadding.top); + maxPadding.left = Math.max(maxPadding.left, boxPadding.left); + maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom); + maxPadding.right = Math.max(maxPadding.right, boxPadding.right); + } + function updateDims(chartArea, params, layout, stacks) { + const { pos, box } = layout; + const maxPadding = chartArea.maxPadding; + if (!isObject(pos)) { + if (layout.size) { + chartArea[pos] -= layout.size; + } + const stack = stacks[layout.stack] || { + size: 0, + count: 1 + }; + stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width); + layout.size = stack.size / stack.count; + chartArea[pos] += layout.size; + } + if (box.getPadding) { + updateMaxPadding(maxPadding, box.getPadding()); + } + const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, "left", "right")); + const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, "top", "bottom")); + const widthChanged = newWidth !== chartArea.w; + const heightChanged = newHeight !== chartArea.h; + chartArea.w = newWidth; + chartArea.h = newHeight; + return layout.horizontal ? { + same: widthChanged, + other: heightChanged + } : { + same: heightChanged, + other: widthChanged + }; + } + function handleMaxPadding(chartArea) { + const maxPadding = chartArea.maxPadding; + function updatePos(pos) { + const change = Math.max(maxPadding[pos] - chartArea[pos], 0); + chartArea[pos] += change; + return change; + } + chartArea.y += updatePos("top"); + chartArea.x += updatePos("left"); + updatePos("right"); + updatePos("bottom"); + } + function getMargins(horizontal, chartArea) { + const maxPadding = chartArea.maxPadding; + function marginForPositions(positions2) { + const margin = { + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + positions2.forEach((pos) => { + margin[pos] = Math.max(chartArea[pos], maxPadding[pos]); + }); + return margin; + } + return horizontal ? marginForPositions([ + "left", + "right" + ]) : marginForPositions([ + "top", + "bottom" + ]); + } + function fitBoxes(boxes, chartArea, params, stacks) { + const refitBoxes = []; + let i, ilen, layout, box, refit, changed; + for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) { + layout = boxes[i]; + box = layout.box; + box.update(layout.width || chartArea.w, layout.height || chartArea.h, getMargins(layout.horizontal, chartArea)); + const { same, other } = updateDims(chartArea, params, layout, stacks); + refit |= same && refitBoxes.length; + changed = changed || other; + if (!box.fullSize) { + refitBoxes.push(layout); + } + } + return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed; + } + function setBoxDims(box, left, top, width, height) { + box.top = top; + box.left = left; + box.right = left + width; + box.bottom = top + height; + box.width = width; + box.height = height; + } + function placeBoxes(boxes, chartArea, params, stacks) { + const userPadding = params.padding; + let { x, y } = chartArea; + for (const layout of boxes) { + const box = layout.box; + const stack = stacks[layout.stack] || { + count: 1, + placed: 0, + weight: 1 + }; + const weight = layout.stackWeight / stack.weight || 1; + if (layout.horizontal) { + const width = chartArea.w * weight; + const height = stack.size || box.height; + if (defined(stack.start)) { + y = stack.start; + } + if (box.fullSize) { + setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height); + } else { + setBoxDims(box, chartArea.left + stack.placed, y, width, height); + } + stack.start = y; + stack.placed += width; + y = box.bottom; + } else { + const height = chartArea.h * weight; + const width = stack.size || box.width; + if (defined(stack.start)) { + x = stack.start; + } + if (box.fullSize) { + setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top); + } else { + setBoxDims(box, x, chartArea.top + stack.placed, width, height); + } + stack.start = x; + stack.placed += height; + x = box.right; + } + } + chartArea.x = x; + chartArea.y = y; + } + function initCanvas(canvas, aspectRatio) { + const style = canvas.style; + const renderHeight = canvas.getAttribute("height"); + const renderWidth = canvas.getAttribute("width"); + canvas[EXPANDO_KEY] = { + initial: { + height: renderHeight, + width: renderWidth, + style: { + display: style.display, + height: style.height, + width: style.width + } + } + }; + style.display = style.display || "block"; + style.boxSizing = style.boxSizing || "border-box"; + if (isNullOrEmpty(renderWidth)) { + const displayWidth = readUsedSize(canvas, "width"); + if (displayWidth !== void 0) { + canvas.width = displayWidth; + } + } + if (isNullOrEmpty(renderHeight)) { + if (canvas.style.height === "") { + canvas.height = canvas.width / (aspectRatio || 2); + } else { + const displayHeight = readUsedSize(canvas, "height"); + if (displayHeight !== void 0) { + canvas.height = displayHeight; + } + } + } + return canvas; + } + function addListener(node, type, listener) { + if (node) { + node.addEventListener(type, listener, eventListenerOptions); + } + } + function removeListener(chart2, type, listener) { + if (chart2 && chart2.canvas) { + chart2.canvas.removeEventListener(type, listener, eventListenerOptions); + } + } + function fromNativeEvent(event, chart2) { + const type = EVENT_TYPES[event.type] || event.type; + const { x, y } = getRelativePosition(event, chart2); + return { + type, + chart: chart2, + native: event, + x: x !== void 0 ? x : null, + y: y !== void 0 ? y : null + }; + } + function nodeListContains(nodeList, canvas) { + for (const node of nodeList) { + if (node === canvas || node.contains(canvas)) { + return true; + } + } + } + function createAttachObserver(chart2, type, listener) { + const canvas = chart2.canvas; + const observer = new MutationObserver((entries) => { + let trigger = false; + for (const entry of entries) { + trigger = trigger || nodeListContains(entry.addedNodes, canvas); + trigger = trigger && !nodeListContains(entry.removedNodes, canvas); + } + if (trigger) { + listener(); + } + }); + observer.observe(document, { + childList: true, + subtree: true + }); + return observer; + } + function createDetachObserver(chart2, type, listener) { + const canvas = chart2.canvas; + const observer = new MutationObserver((entries) => { + let trigger = false; + for (const entry of entries) { + trigger = trigger || nodeListContains(entry.removedNodes, canvas); + trigger = trigger && !nodeListContains(entry.addedNodes, canvas); + } + if (trigger) { + listener(); + } + }); + observer.observe(document, { + childList: true, + subtree: true + }); + return observer; + } + function onWindowResize() { + const dpr = window.devicePixelRatio; + if (dpr === oldDevicePixelRatio) { + return; + } + oldDevicePixelRatio = dpr; + drpListeningCharts.forEach((resize, chart2) => { + if (chart2.currentDevicePixelRatio !== dpr) { + resize(); + } + }); + } + function listenDevicePixelRatioChanges(chart2, resize) { + if (!drpListeningCharts.size) { + window.addEventListener("resize", onWindowResize); + } + drpListeningCharts.set(chart2, resize); + } + function unlistenDevicePixelRatioChanges(chart2) { + drpListeningCharts.delete(chart2); + if (!drpListeningCharts.size) { + window.removeEventListener("resize", onWindowResize); + } + } + function createResizeObserver(chart2, type, listener) { + const canvas = chart2.canvas; + const container = canvas && _getParentNode(canvas); + if (!container) { + return; + } + const resize = throttled((width, height) => { + const w = container.clientWidth; + listener(width, height); + if (w < container.clientWidth) { + listener(); + } + }, window); + const observer = new ResizeObserver((entries) => { + const entry = entries[0]; + const width = entry.contentRect.width; + const height = entry.contentRect.height; + if (width === 0 && height === 0) { + return; + } + resize(width, height); + }); + observer.observe(container); + listenDevicePixelRatioChanges(chart2, resize); + return observer; + } + function releaseObserver(chart2, type, observer) { + if (observer) { + observer.disconnect(); + } + if (type === "resize") { + unlistenDevicePixelRatioChanges(chart2); + } + } + function createProxyAndListen(chart2, type, listener) { + const canvas = chart2.canvas; + const proxy = throttled((event) => { + if (chart2.ctx !== null) { + listener(fromNativeEvent(event, chart2)); + } + }, chart2); + addListener(canvas, type, proxy); + return proxy; + } + function _detectPlatform(canvas) { + if (!_isDomSupported() || typeof OffscreenCanvas !== "undefined" && canvas instanceof OffscreenCanvas) { + return BasicPlatform; + } + return DomPlatform; + } + function autoSkip(scale, ticks) { + const tickOpts = scale.options.ticks; + const determinedMaxTicks = determineMaxTicks(scale); + const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks); + const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : []; + const numMajorIndices = majorIndices.length; + const first = majorIndices[0]; + const last = majorIndices[numMajorIndices - 1]; + const newTicks = []; + if (numMajorIndices > ticksLimit) { + skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit); + return newTicks; + } + const spacing = calculateSpacing(majorIndices, ticks, ticksLimit); + if (numMajorIndices > 0) { + let i, ilen; + const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null; + skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first); + for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) { + skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]); + } + skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing); + return newTicks; + } + skip(ticks, newTicks, spacing); + return newTicks; + } + function determineMaxTicks(scale) { + const offset = scale.options.offset; + const tickLength = scale._tickSize(); + const maxScale = scale._length / tickLength + (offset ? 0 : 1); + const maxChart = scale._maxLength / tickLength; + return Math.floor(Math.min(maxScale, maxChart)); + } + function calculateSpacing(majorIndices, ticks, ticksLimit) { + const evenMajorSpacing = getEvenSpacing(majorIndices); + const spacing = ticks.length / ticksLimit; + if (!evenMajorSpacing) { + return Math.max(spacing, 1); + } + const factors = _factorize(evenMajorSpacing); + for (let i = 0, ilen = factors.length - 1; i < ilen; i++) { + const factor = factors[i]; + if (factor > spacing) { + return factor; + } + } + return Math.max(spacing, 1); + } + function getMajorIndices(ticks) { + const result = []; + let i, ilen; + for (i = 0, ilen = ticks.length; i < ilen; i++) { + if (ticks[i].major) { + result.push(i); + } + } + return result; + } + function skipMajors(ticks, newTicks, majorIndices, spacing) { + let count = 0; + let next = majorIndices[0]; + let i; + spacing = Math.ceil(spacing); + for (i = 0; i < ticks.length; i++) { + if (i === next) { + newTicks.push(ticks[i]); + count++; + next = majorIndices[count * spacing]; + } + } + } + function skip(ticks, newTicks, spacing, majorStart, majorEnd) { + const start = valueOrDefault(majorStart, 0); + const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length); + let count = 0; + let length, i, next; + spacing = Math.ceil(spacing); + if (majorEnd) { + length = majorEnd - majorStart; + spacing = length / Math.floor(length / spacing); + } + next = start; + while (next < 0) { + count++; + next = Math.round(start + count * spacing); + } + for (i = Math.max(start, 0); i < end; i++) { + if (i === next) { + newTicks.push(ticks[i]); + count++; + next = Math.round(start + count * spacing); + } + } + } + function getEvenSpacing(arr) { + const len = arr.length; + let i, diff; + if (len < 2) { + return false; + } + for (diff = arr[0], i = 1; i < len; ++i) { + if (arr[i] - arr[i - 1] !== diff) { + return false; + } + } + return diff; + } + function sample(arr, numItems) { + const result = []; + const increment = arr.length / numItems; + const len = arr.length; + let i = 0; + for (; i < len; i += increment) { + result.push(arr[Math.floor(i)]); + } + return result; + } + function getPixelForGridLine(scale, index2, offsetGridLines) { + const length = scale.ticks.length; + const validIndex2 = Math.min(index2, length - 1); + const start = scale._startPixel; + const end = scale._endPixel; + const epsilon = 1e-6; + let lineValue = scale.getPixelForTick(validIndex2); + let offset; + if (offsetGridLines) { + if (length === 1) { + offset = Math.max(lineValue - start, end - lineValue); + } else if (index2 === 0) { + offset = (scale.getPixelForTick(1) - lineValue) / 2; + } else { + offset = (lineValue - scale.getPixelForTick(validIndex2 - 1)) / 2; + } + lineValue += validIndex2 < index2 ? offset : -offset; + if (lineValue < start - epsilon || lineValue > end + epsilon) { + return; + } + } + return lineValue; + } + function garbageCollect(caches, length) { + each(caches, (cache2) => { + const gc = cache2.gc; + const gcLen = gc.length / 2; + let i; + if (gcLen > length) { + for (i = 0; i < gcLen; ++i) { + delete cache2.data[gc[i]]; + } + gc.splice(0, gcLen); + } + }); + } + function getTickMarkLength(options) { + return options.drawTicks ? options.tickLength : 0; + } + function getTitleHeight(options, fallback) { + if (!options.display) { + return 0; + } + const font = toFont(options.font, fallback); + const padding = toPadding(options.padding); + const lines = isArray(options.text) ? options.text.length : 1; + return lines * font.lineHeight + padding.height; + } + function createScaleContext(parent, scale) { + return createContext(parent, { + scale, + type: "scale" + }); + } + function createTickContext(parent, index2, tick) { + return createContext(parent, { + tick, + index: index2, + type: "tick" + }); + } + function titleAlign(align, position, reverse) { + let ret = _toLeftRightCenter(align); + if (reverse && position !== "right" || !reverse && position === "right") { + ret = reverseAlign(ret); + } + return ret; + } + function titleArgs(scale, offset, position, align) { + const { top, left, bottom, right, chart: chart2 } = scale; + const { chartArea, scales: scales2 } = chart2; + let rotation = 0; + let maxWidth, titleX, titleY; + const height = bottom - top; + const width = right - left; + if (scale.isHorizontal()) { + titleX = _alignStartEnd(align, left, right); + if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + titleY = scales2[positionAxisID].getPixelForValue(value) + height - offset; + } else if (position === "center") { + titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset; + } else { + titleY = offsetFromEdge(scale, position, offset); + } + maxWidth = right - left; + } else { + if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + titleX = scales2[positionAxisID].getPixelForValue(value) - width + offset; + } else if (position === "center") { + titleX = (chartArea.left + chartArea.right) / 2 - width + offset; + } else { + titleX = offsetFromEdge(scale, position, offset); + } + titleY = _alignStartEnd(align, bottom, top); + rotation = position === "left" ? -HALF_PI : HALF_PI; + } + return { + titleX, + titleY, + maxWidth, + rotation + }; + } + function registerDefaults(item, scope, parentScope) { + const itemDefaults = merge(/* @__PURE__ */ Object.create(null), [ + parentScope ? defaults.get(parentScope) : {}, + defaults.get(scope), + item.defaults + ]); + defaults.set(scope, itemDefaults); + if (item.defaultRoutes) { + routeDefaults(scope, item.defaultRoutes); + } + if (item.descriptors) { + defaults.describe(scope, item.descriptors); + } + } + function routeDefaults(scope, routes) { + Object.keys(routes).forEach((property) => { + const propertyParts = property.split("."); + const sourceName = propertyParts.pop(); + const sourceScope = [ + scope + ].concat(propertyParts).join("."); + const parts = routes[property].split("."); + const targetName = parts.pop(); + const targetScope = parts.join("."); + defaults.route(sourceScope, sourceName, targetScope, targetName); + }); + } + function isIChartComponent(proto) { + return "id" in proto && "defaults" in proto; + } + function allPlugins(config) { + const localIds = {}; + const plugins2 = []; + const keys = Object.keys(registry.plugins.items); + for (let i = 0; i < keys.length; i++) { + plugins2.push(registry.getPlugin(keys[i])); + } + const local = config.plugins || []; + for (let i = 0; i < local.length; i++) { + const plugin = local[i]; + if (plugins2.indexOf(plugin) === -1) { + plugins2.push(plugin); + localIds[plugin.id] = true; + } + } + return { + plugins: plugins2, + localIds + }; + } + function getOpts(options, all2) { + if (!all2 && options === false) { + return null; + } + if (options === true) { + return {}; + } + return options; + } + function createDescriptors(chart2, { plugins: plugins2, localIds }, options, all2) { + const result = []; + const context = chart2.getContext(); + for (const plugin of plugins2) { + const id = plugin.id; + const opts = getOpts(options[id], all2); + if (opts === null) { + continue; + } + result.push({ + plugin, + options: pluginOpts(chart2.config, { + plugin, + local: localIds[id] + }, opts, context) + }); + } + return result; + } + function pluginOpts(config, { plugin, local }, opts, context) { + const keys = config.pluginScopeKeys(plugin); + const scopes = config.getOptionScopes(opts, keys); + if (local && plugin.defaults) { + scopes.push(plugin.defaults); + } + return config.createResolver(scopes, context, [ + "" + ], { + scriptable: false, + indexable: false, + allKeys: true + }); + } + function getIndexAxis(type, options) { + const datasetDefaults = defaults.datasets[type] || {}; + const datasetOptions = (options.datasets || {})[type] || {}; + return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || "x"; + } + function getAxisFromDefaultScaleID(id, indexAxis) { + let axis = id; + if (id === "_index_") { + axis = indexAxis; + } else if (id === "_value_") { + axis = indexAxis === "x" ? "y" : "x"; + } + return axis; + } + function getDefaultScaleIDFromAxis(axis, indexAxis) { + return axis === indexAxis ? "_index_" : "_value_"; + } + function idMatchesAxis(id) { + if (id === "x" || id === "y" || id === "r") { + return id; + } + } + function axisFromPosition(position) { + if (position === "top" || position === "bottom") { + return "x"; + } + if (position === "left" || position === "right") { + return "y"; + } + } + function determineAxis(id, ...scaleOptions) { + if (idMatchesAxis(id)) { + return id; + } + for (const opts of scaleOptions) { + const axis = opts.axis || axisFromPosition(opts.position) || id.length > 1 && idMatchesAxis(id[0].toLowerCase()); + if (axis) { + return axis; + } + } + throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`); + } + function getAxisFromDataset(id, axis, dataset) { + if (dataset[axis + "AxisID"] === id) { + return { + axis + }; + } + } + function retrieveAxisFromDatasets(id, config) { + if (config.data && config.data.datasets) { + const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id); + if (boundDs.length) { + return getAxisFromDataset(id, "x", boundDs[0]) || getAxisFromDataset(id, "y", boundDs[0]); + } + } + return {}; + } + function mergeScaleConfig(config, options) { + const chartDefaults = overrides[config.type] || { + scales: {} + }; + const configScales = options.scales || {}; + const chartIndexAxis = getIndexAxis(config.type, options); + const scales2 = /* @__PURE__ */ Object.create(null); + Object.keys(configScales).forEach((id) => { + const scaleConf = configScales[id]; + if (!isObject(scaleConf)) { + return console.error(`Invalid scale configuration for scale: ${id}`); + } + if (scaleConf._proxy) { + return console.warn(`Ignoring resolver passed as options for scale: ${id}`); + } + const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]); + const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis); + const defaultScaleOptions = chartDefaults.scales || {}; + scales2[id] = mergeIf(/* @__PURE__ */ Object.create(null), [ + { + axis + }, + scaleConf, + defaultScaleOptions[axis], + defaultScaleOptions[defaultId] + ]); + }); + config.data.datasets.forEach((dataset) => { + const type = dataset.type || config.type; + const indexAxis = dataset.indexAxis || getIndexAxis(type, options); + const datasetDefaults = overrides[type] || {}; + const defaultScaleOptions = datasetDefaults.scales || {}; + Object.keys(defaultScaleOptions).forEach((defaultID) => { + const axis = getAxisFromDefaultScaleID(defaultID, indexAxis); + const id = dataset[axis + "AxisID"] || axis; + scales2[id] = scales2[id] || /* @__PURE__ */ Object.create(null); + mergeIf(scales2[id], [ + { + axis + }, + configScales[id], + defaultScaleOptions[defaultID] + ]); + }); + }); + Object.keys(scales2).forEach((key) => { + const scale = scales2[key]; + mergeIf(scale, [ + defaults.scales[scale.type], + defaults.scale + ]); + }); + return scales2; + } + function initOptions(config) { + const options = config.options || (config.options = {}); + options.plugins = valueOrDefault(options.plugins, {}); + options.scales = mergeScaleConfig(config, options); + } + function initData(data) { + data = data || {}; + data.datasets = data.datasets || []; + data.labels = data.labels || []; + return data; + } + function initConfig(config) { + config = config || {}; + config.data = initData(config.data); + initOptions(config); + return config; + } + function cachedKeys(cacheKey, generate) { + let keys = keyCache.get(cacheKey); + if (!keys) { + keys = generate(); + keyCache.set(cacheKey, keys); + keysCached.add(keys); + } + return keys; + } + function getResolver(resolverCache, scopes, prefixes) { + let cache2 = resolverCache.get(scopes); + if (!cache2) { + cache2 = /* @__PURE__ */ new Map(); + resolverCache.set(scopes, cache2); + } + const cacheKey = prefixes.join(); + let cached = cache2.get(cacheKey); + if (!cached) { + const resolver = _createResolver(scopes, prefixes); + cached = { + resolver, + subPrefixes: prefixes.filter((p) => !p.toLowerCase().includes("hover")) + }; + cache2.set(cacheKey, cached); + } + return cached; + } + function needContext(proxy, names2) { + const { isScriptable, isIndexable } = _descriptors(proxy); + for (const prop of names2) { + const scriptable = isScriptable(prop); + const indexable = isIndexable(prop); + const value = (indexable || scriptable) && proxy[prop]; + if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) { + return true; + } + } + return false; + } + function positionIsHorizontal(position, axis) { + return position === "top" || position === "bottom" || KNOWN_POSITIONS.indexOf(position) === -1 && axis === "x"; + } + function compare2Level(l1, l2) { + return function(a, b) { + return a[l1] === b[l1] ? a[l2] - b[l2] : a[l1] - b[l1]; + }; + } + function onAnimationsComplete(context) { + const chart2 = context.chart; + const animationOptions = chart2.options.animation; + chart2.notifyPlugins("afterRender"); + callback(animationOptions && animationOptions.onComplete, [ + context + ], chart2); + } + function onAnimationProgress(context) { + const chart2 = context.chart; + const animationOptions = chart2.options.animation; + callback(animationOptions && animationOptions.onProgress, [ + context + ], chart2); + } + function getCanvas(item) { + if (_isDomSupported() && typeof item === "string") { + item = document.getElementById(item); + } else if (item && item.length) { + item = item[0]; + } + if (item && item.canvas) { + item = item.canvas; + } + return item; + } + function moveNumericKeys(obj, start, move) { + const keys = Object.keys(obj); + for (const key of keys) { + const intKey = +key; + if (intKey >= start) { + const value = obj[key]; + delete obj[key]; + if (move > 0 || intKey > start) { + obj[intKey + move] = value; + } + } + } + } + function determineLastEvent(e, lastEvent, inChartArea, isClick) { + if (!inChartArea || e.type === "mouseout") { + return null; + } + if (isClick) { + return lastEvent; + } + return e; + } + function invalidatePlugins() { + return each(Chart.instances, (chart2) => chart2._plugins.invalidate()); + } + function clipSelf(ctx, element, endAngle) { + const { startAngle, x, y, outerRadius, innerRadius, options } = element; + const { borderWidth: borderWidth2, borderJoinStyle } = options; + const outerAngleClip = Math.min(borderWidth2 / outerRadius, _normalizeAngle(startAngle - endAngle)); + ctx.beginPath(); + ctx.arc(x, y, outerRadius - borderWidth2 / 2, startAngle + outerAngleClip / 2, endAngle - outerAngleClip / 2); + if (innerRadius > 0) { + const innerAngleClip = Math.min(borderWidth2 / innerRadius, _normalizeAngle(startAngle - endAngle)); + ctx.arc(x, y, innerRadius + borderWidth2 / 2, endAngle - innerAngleClip / 2, startAngle + innerAngleClip / 2, true); + } else { + const clipWidth = Math.min(borderWidth2 / 2, outerRadius * _normalizeAngle(startAngle - endAngle)); + if (borderJoinStyle === "round") { + ctx.arc(x, y, clipWidth, endAngle - PI / 2, startAngle + PI / 2, true); + } else if (borderJoinStyle === "bevel") { + const r = 2 * clipWidth * clipWidth; + const endX = -r * Math.cos(endAngle + PI / 2) + x; + const endY = -r * Math.sin(endAngle + PI / 2) + y; + const startX = r * Math.cos(startAngle + PI / 2) + x; + const startY = r * Math.sin(startAngle + PI / 2) + y; + ctx.lineTo(endX, endY); + ctx.lineTo(startX, startY); + } + } + ctx.closePath(); + ctx.moveTo(0, 0); + ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height); + ctx.clip("evenodd"); + } + function clipArc(ctx, element, endAngle) { + const { startAngle, pixelMargin, x, y, outerRadius, innerRadius } = element; + let angleMargin = pixelMargin / outerRadius; + ctx.beginPath(); + ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin); + if (innerRadius > pixelMargin) { + angleMargin = pixelMargin / innerRadius; + ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true); + } else { + ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI); + } + ctx.closePath(); + ctx.clip(); + } + function toRadiusCorners(value) { + return _readValueToProps(value, [ + "outerStart", + "outerEnd", + "innerStart", + "innerEnd" + ]); + } + function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) { + const o = toRadiusCorners(arc.options.borderRadius); + const halfThickness = (outerRadius - innerRadius) / 2; + const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2); + const computeOuterLimit = (val) => { + const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2; + return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit)); + }; + return { + outerStart: computeOuterLimit(o.outerStart), + outerEnd: computeOuterLimit(o.outerEnd), + innerStart: _limitValue(o.innerStart, 0, innerLimit), + innerEnd: _limitValue(o.innerEnd, 0, innerLimit) + }; + } + function rThetaToXY(r, theta, x, y) { + return { + x: x + r * Math.cos(theta), + y: y + r * Math.sin(theta) + }; + } + function pathArc(ctx, element, offset, spacing, end, circular) { + const { x, y, startAngle: start, pixelMargin, innerRadius: innerR } = element; + const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0); + const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0; + let spacingOffset = 0; + const alpha2 = end - start; + if (spacing) { + const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0; + const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0; + const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2; + const adjustedAngle = avNogSpacingRadius !== 0 ? alpha2 * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha2; + spacingOffset = (alpha2 - adjustedAngle) / 2; + } + const beta = Math.max(1e-3, alpha2 * outerRadius - offset / PI) / outerRadius; + const angleOffset = (alpha2 - beta) / 2; + const startAngle = start + angleOffset + spacingOffset; + const endAngle = end - angleOffset - spacingOffset; + const { outerStart, outerEnd, innerStart, innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle); + const outerStartAdjustedRadius = outerRadius - outerStart; + const outerEndAdjustedRadius = outerRadius - outerEnd; + const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius; + const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius; + const innerStartAdjustedRadius = innerRadius + innerStart; + const innerEndAdjustedRadius = innerRadius + innerEnd; + const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius; + const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius; + ctx.beginPath(); + if (circular) { + const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2; + ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle); + ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle); + if (outerEnd > 0) { + const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI); + } + const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y); + ctx.lineTo(p4.x, p4.y); + if (innerEnd > 0) { + const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI); + } + const innerMidAdjustedAngle = (endAngle - innerEnd / innerRadius + (startAngle + innerStart / innerRadius)) / 2; + ctx.arc(x, y, innerRadius, endAngle - innerEnd / innerRadius, innerMidAdjustedAngle, true); + ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + innerStart / innerRadius, true); + if (innerStart > 0) { + const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI); + } + const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y); + ctx.lineTo(p8.x, p8.y); + if (outerStart > 0) { + const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y); + ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle); + } + } else { + ctx.moveTo(x, y); + const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x; + const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y; + ctx.lineTo(outerStartX, outerStartY); + const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x; + const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y; + ctx.lineTo(outerEndX, outerEndY); + } + ctx.closePath(); + } + function drawArc(ctx, element, offset, spacing, circular) { + const { fullCircles, startAngle, circumference } = element; + let endAngle = element.endAngle; + if (fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + for (let i = 0; i < fullCircles; ++i) { + ctx.fill(); + } + if (!isNaN(circumference)) { + endAngle = startAngle + (circumference % TAU || TAU); + } + } + pathArc(ctx, element, offset, spacing, endAngle, circular); + ctx.fill(); + return endAngle; + } + function drawBorder(ctx, element, offset, spacing, circular) { + const { fullCircles, startAngle, circumference, options } = element; + const { borderWidth: borderWidth2, borderJoinStyle, borderDash, borderDashOffset, borderRadius } = options; + const inner = options.borderAlign === "inner"; + if (!borderWidth2) { + return; + } + ctx.setLineDash(borderDash || []); + ctx.lineDashOffset = borderDashOffset; + if (inner) { + ctx.lineWidth = borderWidth2 * 2; + ctx.lineJoin = borderJoinStyle || "round"; + } else { + ctx.lineWidth = borderWidth2; + ctx.lineJoin = borderJoinStyle || "bevel"; + } + let endAngle = element.endAngle; + if (fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + for (let i = 0; i < fullCircles; ++i) { + ctx.stroke(); + } + if (!isNaN(circumference)) { + endAngle = startAngle + (circumference % TAU || TAU); + } + } + if (inner) { + clipArc(ctx, element, endAngle); + } + if (options.selfJoin && endAngle - startAngle >= PI && borderRadius === 0 && borderJoinStyle !== "miter") { + clipSelf(ctx, element, endAngle); + } + if (!fullCircles) { + pathArc(ctx, element, offset, spacing, endAngle, circular); + ctx.stroke(); + } + } + function setStyle(ctx, options, style = options) { + ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle); + ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash)); + ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset); + ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle); + ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth); + ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor); + } + function lineTo(ctx, previous, target) { + ctx.lineTo(target.x, target.y); + } + function getLineMethod(options) { + if (options.stepped) { + return _steppedLineTo; + } + if (options.tension || options.cubicInterpolationMode === "monotone") { + return _bezierCurveTo; + } + return lineTo; + } + function pathVars(points, segment, params = {}) { + const count = points.length; + const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params; + const { start: segmentStart, end: segmentEnd } = segment; + const start = Math.max(paramsStart, segmentStart); + const end = Math.min(paramsEnd, segmentEnd); + const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd; + return { + count, + start, + loop: segment.loop, + ilen: end < start && !outside ? count + end - start : end - start + }; + } + function pathSegment(ctx, line, segment, params) { + const { points, options } = line; + const { count, start, loop, ilen } = pathVars(points, segment, params); + const lineMethod = getLineMethod(options); + let { move = true, reverse } = params || {}; + let i, point, prev; + for (i = 0; i <= ilen; ++i) { + point = points[(start + (reverse ? ilen - i : i)) % count]; + if (point.skip) { + continue; + } else if (move) { + ctx.moveTo(point.x, point.y); + move = false; + } else { + lineMethod(ctx, prev, point, reverse, options.stepped); + } + prev = point; + } + if (loop) { + point = points[(start + (reverse ? ilen : 0)) % count]; + lineMethod(ctx, prev, point, reverse, options.stepped); + } + return !!loop; + } + function fastPathSegment(ctx, line, segment, params) { + const points = line.points; + const { count, start, ilen } = pathVars(points, segment, params); + const { move = true, reverse } = params || {}; + let avgX = 0; + let countX = 0; + let i, point, prevX, minY, maxY, lastY; + const pointIndex = (index2) => (start + (reverse ? ilen - index2 : index2)) % count; + const drawX = () => { + if (minY !== maxY) { + ctx.lineTo(avgX, maxY); + ctx.lineTo(avgX, minY); + ctx.lineTo(avgX, lastY); + } + }; + if (move) { + point = points[pointIndex(0)]; + ctx.moveTo(point.x, point.y); + } + for (i = 0; i <= ilen; ++i) { + point = points[pointIndex(i)]; + if (point.skip) { + continue; + } + const x = point.x; + const y = point.y; + const truncX = x | 0; + if (truncX === prevX) { + if (y < minY) { + minY = y; + } else if (y > maxY) { + maxY = y; + } + avgX = (countX * avgX + x) / ++countX; + } else { + drawX(); + ctx.lineTo(x, y); + prevX = truncX; + countX = 0; + minY = maxY = y; + } + lastY = y; + } + drawX(); + } + function _getSegmentMethod(line) { + const opts = line.options; + const borderDash = opts.borderDash && opts.borderDash.length; + const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== "monotone" && !opts.stepped && !borderDash; + return useFastPath ? fastPathSegment : pathSegment; + } + function _getInterpolationMethod(options) { + if (options.stepped) { + return _steppedInterpolation; + } + if (options.tension || options.cubicInterpolationMode === "monotone") { + return _bezierInterpolation; + } + return _pointInLine; + } + function strokePathWithCache(ctx, line, start, count) { + let path = line._path; + if (!path) { + path = line._path = new Path2D(); + if (line.path(path, start, count)) { + path.closePath(); + } + } + setStyle(ctx, line.options); + ctx.stroke(path); + } + function strokePathDirect(ctx, line, start, count) { + const { segments, options } = line; + const segmentMethod = _getSegmentMethod(line); + for (const segment of segments) { + setStyle(ctx, options, segment.style); + ctx.beginPath(); + if (segmentMethod(ctx, line, segment, { + start, + end: start + count - 1 + })) { + ctx.closePath(); + } + ctx.stroke(); + } + } + function draw(ctx, line, start, count) { + if (usePath2D && !line.options.segment) { + strokePathWithCache(ctx, line, start, count); + } else { + strokePathDirect(ctx, line, start, count); + } + } + function inRange$1(el2, pos, axis, useFinalPosition) { + const options = el2.options; + const { [axis]: value } = el2.getProps([ + axis + ], useFinalPosition); + return Math.abs(pos - value) < options.radius + options.hitRadius; + } + function getBarBounds(bar, useFinalPosition) { + const { x, y, base, width, height } = bar.getProps([ + "x", + "y", + "base", + "width", + "height" + ], useFinalPosition); + let left, right, top, bottom, half; + if (bar.horizontal) { + half = height / 2; + left = Math.min(x, base); + right = Math.max(x, base); + top = y - half; + bottom = y + half; + } else { + half = width / 2; + left = x - half; + right = x + half; + top = Math.min(y, base); + bottom = Math.max(y, base); + } + return { + left, + top, + right, + bottom + }; + } + function skipOrLimit(skip2, value, min, max) { + return skip2 ? 0 : _limitValue(value, min, max); + } + function parseBorderWidth(bar, maxW, maxH) { + const value = bar.options.borderWidth; + const skip2 = bar.borderSkipped; + const o = toTRBL(value); + return { + t: skipOrLimit(skip2.top, o.top, 0, maxH), + r: skipOrLimit(skip2.right, o.right, 0, maxW), + b: skipOrLimit(skip2.bottom, o.bottom, 0, maxH), + l: skipOrLimit(skip2.left, o.left, 0, maxW) + }; + } + function parseBorderRadius(bar, maxW, maxH) { + const { enableBorderRadius } = bar.getProps([ + "enableBorderRadius" + ]); + const value = bar.options.borderRadius; + const o = toTRBLCorners(value); + const maxR = Math.min(maxW, maxH); + const skip2 = bar.borderSkipped; + const enableBorder = enableBorderRadius || isObject(value); + return { + topLeft: skipOrLimit(!enableBorder || skip2.top || skip2.left, o.topLeft, 0, maxR), + topRight: skipOrLimit(!enableBorder || skip2.top || skip2.right, o.topRight, 0, maxR), + bottomLeft: skipOrLimit(!enableBorder || skip2.bottom || skip2.left, o.bottomLeft, 0, maxR), + bottomRight: skipOrLimit(!enableBorder || skip2.bottom || skip2.right, o.bottomRight, 0, maxR) + }; + } + function boundingRects(bar) { + const bounds = getBarBounds(bar); + const width = bounds.right - bounds.left; + const height = bounds.bottom - bounds.top; + const border = parseBorderWidth(bar, width / 2, height / 2); + const radius = parseBorderRadius(bar, width / 2, height / 2); + return { + outer: { + x: bounds.left, + y: bounds.top, + w: width, + h: height, + radius + }, + inner: { + x: bounds.left + border.l, + y: bounds.top + border.t, + w: width - border.l - border.r, + h: height - border.t - border.b, + radius: { + topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)), + topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)), + bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)), + bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)) + } + } + }; + } + function inRange(bar, x, y, useFinalPosition) { + const skipX = x === null; + const skipY = y === null; + const skipBoth = skipX && skipY; + const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition); + return bounds && (skipX || _isBetween(x, bounds.left, bounds.right)) && (skipY || _isBetween(y, bounds.top, bounds.bottom)); + } + function hasRadius(radius) { + return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight; + } + function addNormalRectPath(ctx, rect) { + ctx.rect(rect.x, rect.y, rect.w, rect.h); + } + function inflateRect(rect, amount, refRect = {}) { + const x = rect.x !== refRect.x ? -amount : 0; + const y = rect.y !== refRect.y ? -amount : 0; + const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x; + const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y; + return { + x: rect.x + x, + y: rect.y + y, + w: rect.w + w, + h: rect.h + h, + radius: rect.radius + }; + } + function getBorderColor(i) { + return BORDER_COLORS[i % BORDER_COLORS.length]; + } + function getBackgroundColor(i) { + return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length]; + } + function colorizeDefaultDataset(dataset, i) { + dataset.borderColor = getBorderColor(i); + dataset.backgroundColor = getBackgroundColor(i); + return ++i; + } + function colorizeDoughnutDataset(dataset, i) { + dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++)); + return i; + } + function colorizePolarAreaDataset(dataset, i) { + dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++)); + return i; + } + function getColorizer(chart2) { + let i = 0; + return (dataset, datasetIndex) => { + const controller = chart2.getDatasetMeta(datasetIndex).controller; + if (controller instanceof DoughnutController) { + i = colorizeDoughnutDataset(dataset, i); + } else if (controller instanceof PolarAreaController) { + i = colorizePolarAreaDataset(dataset, i); + } else if (controller) { + i = colorizeDefaultDataset(dataset, i); + } + }; + } + function containsColorsDefinitions(descriptors2) { + let k; + for (k in descriptors2) { + if (descriptors2[k].borderColor || descriptors2[k].backgroundColor) { + return true; + } + } + return false; + } + function containsColorsDefinition(descriptor) { + return descriptor && (descriptor.borderColor || descriptor.backgroundColor); + } + function containsDefaultColorsDefenitions() { + return defaults.borderColor !== "rgba(0,0,0,0.1)" || defaults.backgroundColor !== "rgba(0,0,0,0.1)"; + } + function lttbDecimation(data, start, count, availableWidth, options) { + const samples = options.samples || availableWidth; + if (samples >= count) { + return data.slice(start, start + count); + } + const decimated = []; + const bucketWidth = (count - 2) / (samples - 2); + let sampledIndex = 0; + const endIndex = start + count - 1; + let a = start; + let i, maxAreaPoint, maxArea, area, nextA; + decimated[sampledIndex++] = data[a]; + for (i = 0; i < samples - 2; i++) { + let avgX = 0; + let avgY = 0; + let j; + const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start; + const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start; + const avgRangeLength = avgRangeEnd - avgRangeStart; + for (j = avgRangeStart; j < avgRangeEnd; j++) { + avgX += data[j].x; + avgY += data[j].y; + } + avgX /= avgRangeLength; + avgY /= avgRangeLength; + const rangeOffs = Math.floor(i * bucketWidth) + 1 + start; + const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start; + const { x: pointAx, y: pointAy } = data[a]; + maxArea = area = -1; + for (j = rangeOffs; j < rangeTo; j++) { + area = 0.5 * Math.abs((pointAx - avgX) * (data[j].y - pointAy) - (pointAx - data[j].x) * (avgY - pointAy)); + if (area > maxArea) { + maxArea = area; + maxAreaPoint = data[j]; + nextA = j; + } + } + decimated[sampledIndex++] = maxAreaPoint; + a = nextA; + } + decimated[sampledIndex++] = data[endIndex]; + return decimated; + } + function minMaxDecimation(data, start, count, availableWidth) { + let avgX = 0; + let countX = 0; + let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY; + const decimated = []; + const endIndex = start + count - 1; + const xMin = data[start].x; + const xMax = data[endIndex].x; + const dx = xMax - xMin; + for (i = start; i < start + count; ++i) { + point = data[i]; + x = (point.x - xMin) / dx * availableWidth; + y = point.y; + const truncX = x | 0; + if (truncX === prevX) { + if (y < minY) { + minY = y; + minIndex = i; + } else if (y > maxY) { + maxY = y; + maxIndex = i; + } + avgX = (countX * avgX + point.x) / ++countX; + } else { + const lastIndex = i - 1; + if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) { + const intermediateIndex1 = Math.min(minIndex, maxIndex); + const intermediateIndex2 = Math.max(minIndex, maxIndex); + if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) { + decimated.push({ + ...data[intermediateIndex1], + x: avgX + }); + } + if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) { + decimated.push({ + ...data[intermediateIndex2], + x: avgX + }); + } + } + if (i > 0 && lastIndex !== startIndex) { + decimated.push(data[lastIndex]); + } + decimated.push(point); + prevX = truncX; + countX = 0; + minY = maxY = y; + minIndex = maxIndex = startIndex = i; + } + } + return decimated; + } + function cleanDecimatedDataset(dataset) { + if (dataset._decimated) { + const data = dataset._data; + delete dataset._decimated; + delete dataset._data; + Object.defineProperty(dataset, "data", { + configurable: true, + enumerable: true, + writable: true, + value: data + }); + } + } + function cleanDecimatedData(chart2) { + chart2.data.datasets.forEach((dataset) => { + cleanDecimatedDataset(dataset); + }); + } + function getStartAndCountOfVisiblePointsSimplified(meta, points) { + const pointCount = points.length; + let start = 0; + let count; + const { iScale } = meta; + const { min, max, minDefined, maxDefined } = iScale.getUserBounds(); + if (minDefined) { + start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1); + } + if (maxDefined) { + count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start; + } else { + count = pointCount - start; + } + return { + start, + count + }; + } + function _segments(line, target, property) { + const segments = line.segments; + const points = line.points; + const tpoints = target.points; + const parts = []; + for (const segment of segments) { + let { start, end } = segment; + end = _findSegmentEnd(start, end, points); + const bounds = _getBounds(property, points[start], points[end], segment.loop); + if (!target.segments) { + parts.push({ + source: segment, + target: bounds, + start: points[start], + end: points[end] + }); + continue; + } + const targetSegments = _boundSegments(target, bounds); + for (const tgt of targetSegments) { + const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop); + const fillSources = _boundSegment(segment, points, subBounds); + for (const fillSource of fillSources) { + parts.push({ + source: fillSource, + target: tgt, + start: { + [property]: _getEdge(bounds, subBounds, "start", Math.max) + }, + end: { + [property]: _getEdge(bounds, subBounds, "end", Math.min) + } + }); + } + } + } + return parts; + } + function _getBounds(property, first, last, loop) { + if (loop) { + return; + } + let start = first[property]; + let end = last[property]; + if (property === "angle") { + start = _normalizeAngle(start); + end = _normalizeAngle(end); + } + return { + property, + start, + end + }; + } + function _pointsFromSegments(boundary, line) { + const { x = null, y = null } = boundary || {}; + const linePoints = line.points; + const points = []; + line.segments.forEach(({ start, end }) => { + end = _findSegmentEnd(start, end, linePoints); + const first = linePoints[start]; + const last = linePoints[end]; + if (y !== null) { + points.push({ + x: first.x, + y + }); + points.push({ + x: last.x, + y + }); + } else if (x !== null) { + points.push({ + x, + y: first.y + }); + points.push({ + x, + y: last.y + }); + } + }); + return points; + } + function _findSegmentEnd(start, end, points) { + for (; end > start; end--) { + const point = points[end]; + if (!isNaN(point.x) && !isNaN(point.y)) { + break; + } + } + return end; + } + function _getEdge(a, b, prop, fn) { + if (a && b) { + return fn(a[prop], b[prop]); + } + return a ? a[prop] : b ? b[prop] : 0; + } + function _createBoundaryLine(boundary, line) { + let points = []; + let _loop = false; + if (isArray(boundary)) { + _loop = true; + points = boundary; + } else { + points = _pointsFromSegments(boundary, line); + } + return points.length ? new LineElement({ + points, + options: { + tension: 0 + }, + _loop, + _fullLoop: _loop + }) : null; + } + function _shouldApplyFill(source) { + return source && source.fill !== false; + } + function _resolveTarget(sources, index2, propagate) { + const source = sources[index2]; + let fill2 = source.fill; + const visited = [ + index2 + ]; + let target; + if (!propagate) { + return fill2; + } + while (fill2 !== false && visited.indexOf(fill2) === -1) { + if (!isNumberFinite(fill2)) { + return fill2; + } + target = sources[fill2]; + if (!target) { + return false; + } + if (target.visible) { + return fill2; + } + visited.push(fill2); + fill2 = target.fill; + } + return false; + } + function _decodeFill(line, index2, count) { + const fill2 = parseFillOption(line); + if (isObject(fill2)) { + return isNaN(fill2.value) ? false : fill2; + } + let target = parseFloat(fill2); + if (isNumberFinite(target) && Math.floor(target) === target) { + return decodeTargetIndex(fill2[0], index2, target, count); + } + return [ + "origin", + "start", + "end", + "stack", + "shape" + ].indexOf(fill2) >= 0 && fill2; + } + function decodeTargetIndex(firstCh, index2, target, count) { + if (firstCh === "-" || firstCh === "+") { + target = index2 + target; + } + if (target === index2 || target < 0 || target >= count) { + return false; + } + return target; + } + function _getTargetPixel(fill2, scale) { + let pixel = null; + if (fill2 === "start") { + pixel = scale.bottom; + } else if (fill2 === "end") { + pixel = scale.top; + } else if (isObject(fill2)) { + pixel = scale.getPixelForValue(fill2.value); + } else if (scale.getBasePixel) { + pixel = scale.getBasePixel(); + } + return pixel; + } + function _getTargetValue(fill2, scale, startValue) { + let value; + if (fill2 === "start") { + value = startValue; + } else if (fill2 === "end") { + value = scale.options.reverse ? scale.min : scale.max; + } else if (isObject(fill2)) { + value = fill2.value; + } else { + value = scale.getBaseValue(); + } + return value; + } + function parseFillOption(line) { + const options = line.options; + const fillOption = options.fill; + let fill2 = valueOrDefault(fillOption && fillOption.target, fillOption); + if (fill2 === void 0) { + fill2 = !!options.backgroundColor; + } + if (fill2 === false || fill2 === null) { + return false; + } + if (fill2 === true) { + return "origin"; + } + return fill2; + } + function _buildStackLine(source) { + const { scale, index: index2, line } = source; + const points = []; + const segments = line.segments; + const sourcePoints = line.points; + const linesBelow = getLinesBelow(scale, index2); + linesBelow.push(_createBoundaryLine({ + x: null, + y: scale.bottom + }, line)); + for (let i = 0; i < segments.length; i++) { + const segment = segments[i]; + for (let j = segment.start; j <= segment.end; j++) { + addPointsBelow(points, sourcePoints[j], linesBelow); + } + } + return new LineElement({ + points, + options: {} + }); + } + function getLinesBelow(scale, index2) { + const below = []; + const metas = scale.getMatchingVisibleMetas("line"); + for (let i = 0; i < metas.length; i++) { + const meta = metas[i]; + if (meta.index === index2) { + break; + } + if (!meta.hidden) { + below.unshift(meta.dataset); + } + } + return below; + } + function addPointsBelow(points, sourcePoint, linesBelow) { + const postponed = []; + for (let j = 0; j < linesBelow.length; j++) { + const line = linesBelow[j]; + const { first, last, point } = findPoint(line, sourcePoint, "x"); + if (!point || first && last) { + continue; + } + if (first) { + postponed.unshift(point); + } else { + points.push(point); + if (!last) { + break; + } + } + } + points.push(...postponed); + } + function findPoint(line, sourcePoint, property) { + const point = line.interpolate(sourcePoint, property); + if (!point) { + return {}; + } + const pointValue = point[property]; + const segments = line.segments; + const linePoints = line.points; + let first = false; + let last = false; + for (let i = 0; i < segments.length; i++) { + const segment = segments[i]; + const firstValue = linePoints[segment.start][property]; + const lastValue = linePoints[segment.end][property]; + if (_isBetween(pointValue, firstValue, lastValue)) { + first = pointValue === firstValue; + last = pointValue === lastValue; + break; + } + } + return { + first, + last, + point + }; + } + function _getTarget(source) { + const { chart: chart2, fill: fill2, line } = source; + if (isNumberFinite(fill2)) { + return getLineByIndex(chart2, fill2); + } + if (fill2 === "stack") { + return _buildStackLine(source); + } + if (fill2 === "shape") { + return true; + } + const boundary = computeBoundary(source); + if (boundary instanceof simpleArc) { + return boundary; + } + return _createBoundaryLine(boundary, line); + } + function getLineByIndex(chart2, index2) { + const meta = chart2.getDatasetMeta(index2); + const visible = meta && chart2.isDatasetVisible(index2); + return visible ? meta.dataset : null; + } + function computeBoundary(source) { + const scale = source.scale || {}; + if (scale.getPointPositionForValue) { + return computeCircularBoundary(source); + } + return computeLinearBoundary(source); + } + function computeLinearBoundary(source) { + const { scale = {}, fill: fill2 } = source; + const pixel = _getTargetPixel(fill2, scale); + if (isNumberFinite(pixel)) { + const horizontal = scale.isHorizontal(); + return { + x: horizontal ? pixel : null, + y: horizontal ? null : pixel + }; + } + return null; + } + function computeCircularBoundary(source) { + const { scale, fill: fill2 } = source; + const options = scale.options; + const length = scale.getLabels().length; + const start = options.reverse ? scale.max : scale.min; + const value = _getTargetValue(fill2, scale, start); + const target = []; + if (options.grid.circular) { + const center = scale.getPointPositionForValue(0, start); + return new simpleArc({ + x: center.x, + y: center.y, + radius: scale.getDistanceFromCenterForValue(value) + }); + } + for (let i = 0; i < length; ++i) { + target.push(scale.getPointPositionForValue(i, value)); + } + return target; + } + function _drawfill(ctx, source, area) { + const target = _getTarget(source); + const { chart: chart2, index: index2, line, scale, axis } = source; + const lineOpts = line.options; + const fillOption = lineOpts.fill; + const color2 = lineOpts.backgroundColor; + const { above = color2, below = color2 } = fillOption || {}; + const meta = chart2.getDatasetMeta(index2); + const clip = getDatasetClipArea(chart2, meta); + if (target && line.points.length) { + clipArea(ctx, area); + doFill(ctx, { + line, + target, + above, + below, + area, + scale, + axis, + clip + }); + unclipArea(ctx); + } + } + function doFill(ctx, cfg) { + const { line, target, above, below, area, scale, clip } = cfg; + const property = line._loop ? "angle" : cfg.axis; + ctx.save(); + let fillColor = below; + if (below !== above) { + if (property === "x") { + clipVertical(ctx, target, area.top); + fill(ctx, { + line, + target, + color: above, + scale, + property, + clip + }); + ctx.restore(); + ctx.save(); + clipVertical(ctx, target, area.bottom); + } else if (property === "y") { + clipHorizontal(ctx, target, area.left); + fill(ctx, { + line, + target, + color: below, + scale, + property, + clip + }); + ctx.restore(); + ctx.save(); + clipHorizontal(ctx, target, area.right); + fillColor = above; + } + } + fill(ctx, { + line, + target, + color: fillColor, + scale, + property, + clip + }); + ctx.restore(); + } + function clipVertical(ctx, target, clipY) { + const { segments, points } = target; + let first = true; + let lineLoop = false; + ctx.beginPath(); + for (const segment of segments) { + const { start, end } = segment; + const firstPoint = points[start]; + const lastPoint = points[_findSegmentEnd(start, end, points)]; + if (first) { + ctx.moveTo(firstPoint.x, firstPoint.y); + first = false; + } else { + ctx.lineTo(firstPoint.x, clipY); + ctx.lineTo(firstPoint.x, firstPoint.y); + } + lineLoop = !!target.pathSegment(ctx, segment, { + move: lineLoop + }); + if (lineLoop) { + ctx.closePath(); + } else { + ctx.lineTo(lastPoint.x, clipY); + } + } + ctx.lineTo(target.first().x, clipY); + ctx.closePath(); + ctx.clip(); + } + function clipHorizontal(ctx, target, clipX) { + const { segments, points } = target; + let first = true; + let lineLoop = false; + ctx.beginPath(); + for (const segment of segments) { + const { start, end } = segment; + const firstPoint = points[start]; + const lastPoint = points[_findSegmentEnd(start, end, points)]; + if (first) { + ctx.moveTo(firstPoint.x, firstPoint.y); + first = false; + } else { + ctx.lineTo(clipX, firstPoint.y); + ctx.lineTo(firstPoint.x, firstPoint.y); + } + lineLoop = !!target.pathSegment(ctx, segment, { + move: lineLoop + }); + if (lineLoop) { + ctx.closePath(); + } else { + ctx.lineTo(clipX, lastPoint.y); + } + } + ctx.lineTo(clipX, target.first().y); + ctx.closePath(); + ctx.clip(); + } + function fill(ctx, cfg) { + const { line, target, property, color: color2, scale, clip } = cfg; + const segments = _segments(line, target, property); + for (const { source: src, target: tgt, start, end } of segments) { + const { style: { backgroundColor = color2 } = {} } = src; + const notShape = target !== true; + ctx.save(); + ctx.fillStyle = backgroundColor; + clipBounds(ctx, scale, clip, notShape && _getBounds(property, start, end)); + ctx.beginPath(); + const lineLoop = !!line.pathSegment(ctx, src); + let loop; + if (notShape) { + if (lineLoop) { + ctx.closePath(); + } else { + interpolatedLineTo(ctx, target, end, property); + } + const targetLoop = !!target.pathSegment(ctx, tgt, { + move: lineLoop, + reverse: true + }); + loop = lineLoop && targetLoop; + if (!loop) { + interpolatedLineTo(ctx, target, start, property); + } + } + ctx.closePath(); + ctx.fill(loop ? "evenodd" : "nonzero"); + ctx.restore(); + } + } + function clipBounds(ctx, scale, clip, bounds) { + const chartArea = scale.chart.chartArea; + const { property, start, end } = bounds || {}; + if (property === "x" || property === "y") { + let left, top, right, bottom; + if (property === "x") { + left = start; + top = chartArea.top; + right = end; + bottom = chartArea.bottom; + } else { + left = chartArea.left; + top = start; + right = chartArea.right; + bottom = end; + } + ctx.beginPath(); + if (clip) { + left = Math.max(left, clip.left); + right = Math.min(right, clip.right); + top = Math.max(top, clip.top); + bottom = Math.min(bottom, clip.bottom); + } + ctx.rect(left, top, right - left, bottom - top); + ctx.clip(); + } + } + function interpolatedLineTo(ctx, target, point, property) { + const interpolatedPoint = target.interpolate(point, property); + if (interpolatedPoint) { + ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y); + } + } + function calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) { + const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx); + const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight); + return { + itemWidth, + itemHeight + }; + } + function calculateItemWidth(legendItem, boxWidth, labelFont, ctx) { + let legendItemText = legendItem.text; + if (legendItemText && typeof legendItemText !== "string") { + legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b); + } + return boxWidth + labelFont.size / 2 + ctx.measureText(legendItemText).width; + } + function calculateItemHeight(_itemHeight, legendItem, fontLineHeight) { + let itemHeight = _itemHeight; + if (typeof legendItem.text !== "string") { + itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight); + } + return itemHeight; + } + function calculateLegendItemHeight(legendItem, fontLineHeight) { + const labelHeight = legendItem.text ? legendItem.text.length : 0; + return fontLineHeight * labelHeight; + } + function isListened(type, opts) { + if ((type === "mousemove" || type === "mouseout") && (opts.onHover || opts.onLeave)) { + return true; + } + if (opts.onClick && (type === "click" || type === "mouseup")) { + return true; + } + return false; + } + function createTitle(chart2, titleOpts) { + const title = new Title({ + ctx: chart2.ctx, + options: titleOpts, + chart: chart2 + }); + layouts.configure(chart2, title, titleOpts); + layouts.addBox(chart2, title); + chart2.titleBlock = title; + } + function pushOrConcat(base, toPush) { + if (toPush) { + if (isArray(toPush)) { + Array.prototype.push.apply(base, toPush); + } else { + base.push(toPush); + } + } + return base; + } + function splitNewlines(str) { + if ((typeof str === "string" || str instanceof String) && str.indexOf("\n") > -1) { + return str.split("\n"); + } + return str; + } + function createTooltipItem(chart2, item) { + const { element, datasetIndex, index: index2 } = item; + const controller = chart2.getDatasetMeta(datasetIndex).controller; + const { label, value } = controller.getLabelAndValue(index2); + return { + chart: chart2, + label, + parsed: controller.getParsed(index2), + raw: chart2.data.datasets[datasetIndex].data[index2], + formattedValue: value, + dataset: controller.getDataset(), + dataIndex: index2, + datasetIndex, + element + }; + } + function getTooltipSize(tooltip, options) { + const ctx = tooltip.chart.ctx; + const { body, footer, title } = tooltip; + const { boxWidth, boxHeight } = options; + const bodyFont = toFont(options.bodyFont); + const titleFont = toFont(options.titleFont); + const footerFont = toFont(options.footerFont); + const titleLineCount = title.length; + const footerLineCount = footer.length; + const bodyLineItemCount = body.length; + const padding = toPadding(options.padding); + let height = padding.height; + let width = 0; + let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0); + combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length; + if (titleLineCount) { + height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom; + } + if (combinedBodyLength) { + const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight; + height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing; + } + if (footerLineCount) { + height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing; + } + let widthPadding = 0; + const maxLineWidth = function(line) { + width = Math.max(width, ctx.measureText(line).width + widthPadding); + }; + ctx.save(); + ctx.font = titleFont.string; + each(tooltip.title, maxLineWidth); + ctx.font = bodyFont.string; + each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth); + widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0; + each(body, (bodyItem) => { + each(bodyItem.before, maxLineWidth); + each(bodyItem.lines, maxLineWidth); + each(bodyItem.after, maxLineWidth); + }); + widthPadding = 0; + ctx.font = footerFont.string; + each(tooltip.footer, maxLineWidth); + ctx.restore(); + width += padding.width; + return { + width, + height + }; + } + function determineYAlign(chart2, size) { + const { y, height } = size; + if (y < height / 2) { + return "top"; + } else if (y > chart2.height - height / 2) { + return "bottom"; + } + return "center"; + } + function doesNotFitWithAlign(xAlign, chart2, options, size) { + const { x, width } = size; + const caret = options.caretSize + options.caretPadding; + if (xAlign === "left" && x + width + caret > chart2.width) { + return true; + } + if (xAlign === "right" && x - width - caret < 0) { + return true; + } + } + function determineXAlign(chart2, options, size, yAlign) { + const { x, width } = size; + const { width: chartWidth, chartArea: { left, right } } = chart2; + let xAlign = "center"; + if (yAlign === "center") { + xAlign = x <= (left + right) / 2 ? "left" : "right"; + } else if (x <= width / 2) { + xAlign = "left"; + } else if (x >= chartWidth - width / 2) { + xAlign = "right"; + } + if (doesNotFitWithAlign(xAlign, chart2, options, size)) { + xAlign = "center"; + } + return xAlign; + } + function determineAlignment(chart2, options, size) { + const yAlign = size.yAlign || options.yAlign || determineYAlign(chart2, size); + return { + xAlign: size.xAlign || options.xAlign || determineXAlign(chart2, options, size, yAlign), + yAlign + }; + } + function alignX(size, xAlign) { + let { x, width } = size; + if (xAlign === "right") { + x -= width; + } else if (xAlign === "center") { + x -= width / 2; + } + return x; + } + function alignY(size, yAlign, paddingAndSize) { + let { y, height } = size; + if (yAlign === "top") { + y += paddingAndSize; + } else if (yAlign === "bottom") { + y -= height + paddingAndSize; + } else { + y -= height / 2; + } + return y; + } + function getBackgroundPoint(options, size, alignment, chart2) { + const { caretSize, caretPadding, cornerRadius: cornerRadius2 } = options; + const { xAlign, yAlign } = alignment; + const paddingAndSize = caretSize + caretPadding; + const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius2); + let x = alignX(size, xAlign); + const y = alignY(size, yAlign, paddingAndSize); + if (yAlign === "center") { + if (xAlign === "left") { + x += paddingAndSize; + } else if (xAlign === "right") { + x -= paddingAndSize; + } + } else if (xAlign === "left") { + x -= Math.max(topLeft, bottomLeft) + caretSize; + } else if (xAlign === "right") { + x += Math.max(topRight, bottomRight) + caretSize; + } + return { + x: _limitValue(x, 0, chart2.width - size.width), + y: _limitValue(y, 0, chart2.height - size.height) + }; + } + function getAlignedX(tooltip, align, options) { + const padding = toPadding(options.padding); + return align === "center" ? tooltip.x + tooltip.width / 2 : align === "right" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left; + } + function getBeforeAfterBodyLines(callback2) { + return pushOrConcat([], splitNewlines(callback2)); + } + function createTooltipContext(parent, tooltip, tooltipItems) { + return createContext(parent, { + tooltip, + tooltipItems, + type: "tooltip" + }); + } + function overrideCallbacks(callbacks, context) { + const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks; + return override ? callbacks.override(override) : callbacks; + } + function invokeCallbackWithFallback(callbacks, name, ctx, arg) { + const result = callbacks[name].call(ctx, arg); + if (typeof result === "undefined") { + return defaultCallbacks[name].call(ctx, arg); + } + return result; + } + function findOrAddLabel(labels, raw, index2, addedLabels) { + const first = labels.indexOf(raw); + if (first === -1) { + return addIfString(labels, raw, index2, addedLabels); + } + const last = labels.lastIndexOf(raw); + return first !== last ? index2 : first; + } + function _getLabelForValue(value) { + const labels = this.getLabels(); + if (value >= 0 && value < labels.length) { + return labels[value]; + } + return value; + } + function generateTicks$1(generationOptions, dataRange) { + const ticks = []; + const MIN_SPACING = 1e-14; + const { bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds } = generationOptions; + const unit = step || 1; + const maxSpaces = maxTicks - 1; + const { min: rmin, max: rmax } = dataRange; + const minDefined = !isNullOrUndef(min); + const maxDefined = !isNullOrUndef(max); + const countDefined = !isNullOrUndef(count); + const minSpacing = (rmax - rmin) / (maxDigits + 1); + let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit; + let factor, niceMin, niceMax, numSpaces; + if (spacing < MIN_SPACING && !minDefined && !maxDefined) { + return [ + { + value: rmin + }, + { + value: rmax + } + ]; + } + numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing); + if (numSpaces > maxSpaces) { + spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit; + } + if (!isNullOrUndef(precision)) { + factor = Math.pow(10, precision); + spacing = Math.ceil(spacing * factor) / factor; + } + if (bounds === "ticks") { + niceMin = Math.floor(rmin / spacing) * spacing; + niceMax = Math.ceil(rmax / spacing) * spacing; + } else { + niceMin = rmin; + niceMax = rmax; + } + if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1e3)) { + numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks)); + spacing = (max - min) / numSpaces; + niceMin = min; + niceMax = max; + } else if (countDefined) { + niceMin = minDefined ? min : niceMin; + niceMax = maxDefined ? max : niceMax; + numSpaces = count - 1; + spacing = (niceMax - niceMin) / numSpaces; + } else { + numSpaces = (niceMax - niceMin) / spacing; + if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1e3)) { + numSpaces = Math.round(numSpaces); + } else { + numSpaces = Math.ceil(numSpaces); + } + } + const decimalPlaces = Math.max(_decimalPlaces(spacing), _decimalPlaces(niceMin)); + factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision); + niceMin = Math.round(niceMin * factor) / factor; + niceMax = Math.round(niceMax * factor) / factor; + let j = 0; + if (minDefined) { + if (includeBounds && niceMin !== min) { + ticks.push({ + value: min + }); + if (niceMin < min) { + j++; + } + if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) { + j++; + } + } else if (niceMin < min) { + j++; + } + } + for (; j < numSpaces; ++j) { + const tickValue = Math.round((niceMin + j * spacing) * factor) / factor; + if (maxDefined && tickValue > max) { + break; + } + ticks.push({ + value: tickValue + }); + } + if (maxDefined && includeBounds && niceMax !== max) { + if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) { + ticks[ticks.length - 1].value = max; + } else { + ticks.push({ + value: max + }); + } + } else if (!maxDefined || niceMax === max) { + ticks.push({ + value: niceMax + }); + } + return ticks; + } + function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) { + const rad = toRadians(minRotation); + const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 1e-3; + const length = 0.75 * minSpacing * ("" + value).length; + return Math.min(minSpacing / ratio, length); + } + function isMajor(tickVal) { + const remain = tickVal / Math.pow(10, log10Floor(tickVal)); + return remain === 1; + } + function steps(min, max, rangeExp) { + const rangeStep = Math.pow(10, rangeExp); + const start = Math.floor(min / rangeStep); + const end = Math.ceil(max / rangeStep); + return end - start; + } + function startExp(min, max) { + const range2 = max - min; + let rangeExp = log10Floor(range2); + while (steps(min, max, rangeExp) > 10) { + rangeExp++; + } + while (steps(min, max, rangeExp) < 10) { + rangeExp--; + } + return Math.min(rangeExp, log10Floor(min)); + } + function generateTicks(generationOptions, { min, max }) { + min = finiteOrDefault(generationOptions.min, min); + const ticks = []; + const minExp = log10Floor(min); + let exp = startExp(min, max); + let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1; + const stepSize = Math.pow(10, exp); + const base = minExp > exp ? Math.pow(10, minExp) : 0; + const start = Math.round((min - base) * precision) / precision; + const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10; + let significand = Math.floor((start - offset) / Math.pow(10, exp)); + let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision); + while (value < max) { + ticks.push({ + value, + major: isMajor(value), + significand + }); + if (significand >= 10) { + significand = significand < 15 ? 15 : 20; + } else { + significand++; + } + if (significand >= 20) { + exp++; + significand = 2; + precision = exp >= 0 ? 1 : precision; + } + value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision; + } + const lastTick = finiteOrDefault(generationOptions.max, value); + ticks.push({ + value: lastTick, + major: isMajor(lastTick), + significand + }); + return ticks; + } + function getTickBackdropHeight(opts) { + const tickOpts = opts.ticks; + if (tickOpts.display && opts.display) { + const padding = toPadding(tickOpts.backdropPadding); + return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height; + } + return 0; + } + function measureLabelSize(ctx, font, label) { + label = isArray(label) ? label : [ + label + ]; + return { + w: _longestText(ctx, font.string, label), + h: label.length * font.lineHeight + }; + } + function determineLimits(angle, pos, size, min, max) { + if (angle === min || angle === max) { + return { + start: pos - size / 2, + end: pos + size / 2 + }; + } else if (angle < min || angle > max) { + return { + start: pos - size, + end: pos + }; + } + return { + start: pos, + end: pos + size + }; + } + function fitWithPointLabels(scale) { + const orig = { + l: scale.left + scale._padding.left, + r: scale.right - scale._padding.right, + t: scale.top + scale._padding.top, + b: scale.bottom - scale._padding.bottom + }; + const limits = Object.assign({}, orig); + const labelSizes = []; + const padding = []; + const valueCount = scale._pointLabels.length; + const pointLabelOpts = scale.options.pointLabels; + const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0; + for (let i = 0; i < valueCount; i++) { + const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i)); + padding[i] = opts.padding; + const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle); + const plFont = toFont(opts.font); + const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]); + labelSizes[i] = textSize; + const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle); + const angle = Math.round(toDegrees(angleRadians)); + const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180); + const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270); + updateLimits(limits, orig, angleRadians, hLimits, vLimits); + } + scale.setCenterPoint(orig.l - limits.l, limits.r - orig.r, orig.t - limits.t, limits.b - orig.b); + scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding); + } + function updateLimits(limits, orig, angle, hLimits, vLimits) { + const sin = Math.abs(Math.sin(angle)); + const cos = Math.abs(Math.cos(angle)); + let x = 0; + let y = 0; + if (hLimits.start < orig.l) { + x = (orig.l - hLimits.start) / sin; + limits.l = Math.min(limits.l, orig.l - x); + } else if (hLimits.end > orig.r) { + x = (hLimits.end - orig.r) / sin; + limits.r = Math.max(limits.r, orig.r + x); + } + if (vLimits.start < orig.t) { + y = (orig.t - vLimits.start) / cos; + limits.t = Math.min(limits.t, orig.t - y); + } else if (vLimits.end > orig.b) { + y = (vLimits.end - orig.b) / cos; + limits.b = Math.max(limits.b, orig.b + y); + } + } + function createPointLabelItem(scale, index2, itemOpts) { + const outerDistance = scale.drawingArea; + const { extra, additionalAngle, padding, size } = itemOpts; + const pointLabelPosition = scale.getPointPosition(index2, outerDistance + extra + padding, additionalAngle); + const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI))); + const y = yForAngle(pointLabelPosition.y, size.h, angle); + const textAlign = getTextAlignForAngle(angle); + const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign); + return { + visible: true, + x: pointLabelPosition.x, + y, + textAlign, + left, + top: y, + right: left + size.w, + bottom: y + size.h + }; + } + function isNotOverlapped(item, area) { + if (!area) { + return true; + } + const { left, top, right, bottom } = item; + const apexesInArea = _isPointInArea({ + x: left, + y: top + }, area) || _isPointInArea({ + x: left, + y: bottom + }, area) || _isPointInArea({ + x: right, + y: top + }, area) || _isPointInArea({ + x: right, + y: bottom + }, area); + return !apexesInArea; + } + function buildPointLabelItems(scale, labelSizes, padding) { + const items = []; + const valueCount = scale._pointLabels.length; + const opts = scale.options; + const { centerPointLabels, display: display2 } = opts.pointLabels; + const itemOpts = { + extra: getTickBackdropHeight(opts) / 2, + additionalAngle: centerPointLabels ? PI / valueCount : 0 + }; + let area; + for (let i = 0; i < valueCount; i++) { + itemOpts.padding = padding[i]; + itemOpts.size = labelSizes[i]; + const item = createPointLabelItem(scale, i, itemOpts); + items.push(item); + if (display2 === "auto") { + item.visible = isNotOverlapped(item, area); + if (item.visible) { + area = item; + } + } + } + return items; + } + function getTextAlignForAngle(angle) { + if (angle === 0 || angle === 180) { + return "center"; + } else if (angle < 180) { + return "left"; + } + return "right"; + } + function leftForTextAlign(x, w, align) { + if (align === "right") { + x -= w; + } else if (align === "center") { + x -= w / 2; + } + return x; + } + function yForAngle(y, h, angle) { + if (angle === 90 || angle === 270) { + y -= h / 2; + } else if (angle > 270 || angle < 90) { + y -= h; + } + return y; + } + function drawPointLabelBox(ctx, opts, item) { + const { left, top, right, bottom } = item; + const { backdropColor } = opts; + if (!isNullOrUndef(backdropColor)) { + const borderRadius = toTRBLCorners(opts.borderRadius); + const padding = toPadding(opts.backdropPadding); + ctx.fillStyle = backdropColor; + const backdropLeft = left - padding.left; + const backdropTop = top - padding.top; + const backdropWidth = right - left + padding.width; + const backdropHeight = bottom - top + padding.height; + if (Object.values(borderRadius).some((v) => v !== 0)) { + ctx.beginPath(); + addRoundedRectPath(ctx, { + x: backdropLeft, + y: backdropTop, + w: backdropWidth, + h: backdropHeight, + radius: borderRadius + }); + ctx.fill(); + } else { + ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight); + } + } + } + function drawPointLabels(scale, labelCount) { + const { ctx, options: { pointLabels } } = scale; + for (let i = labelCount - 1; i >= 0; i--) { + const item = scale._pointLabelItems[i]; + if (!item.visible) { + continue; + } + const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i)); + drawPointLabelBox(ctx, optsAtIndex, item); + const plFont = toFont(optsAtIndex.font); + const { x, y, textAlign } = item; + renderText(ctx, scale._pointLabels[i], x, y + plFont.lineHeight / 2, plFont, { + color: optsAtIndex.color, + textAlign, + textBaseline: "middle" + }); + } + } + function pathRadiusLine(scale, radius, circular, labelCount) { + const { ctx } = scale; + if (circular) { + ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU); + } else { + let pointPosition = scale.getPointPosition(0, radius); + ctx.moveTo(pointPosition.x, pointPosition.y); + for (let i = 1; i < labelCount; i++) { + pointPosition = scale.getPointPosition(i, radius); + ctx.lineTo(pointPosition.x, pointPosition.y); + } + } + } + function drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) { + const ctx = scale.ctx; + const circular = gridLineOpts.circular; + const { color: color2, lineWidth } = gridLineOpts; + if (!circular && !labelCount || !color2 || !lineWidth || radius < 0) { + return; + } + ctx.save(); + ctx.strokeStyle = color2; + ctx.lineWidth = lineWidth; + ctx.setLineDash(borderOpts.dash || []); + ctx.lineDashOffset = borderOpts.dashOffset; + ctx.beginPath(); + pathRadiusLine(scale, radius, circular, labelCount); + ctx.closePath(); + ctx.stroke(); + ctx.restore(); + } + function createPointLabelContext(parent, index2, label) { + return createContext(parent, { + label, + index: index2, + type: "pointLabel" + }); + } + function sorter(a, b) { + return a - b; + } + function parse(scale, input) { + if (isNullOrUndef(input)) { + return null; + } + const adapter = scale._adapter; + const { parser, round: round2, isoWeekday } = scale._parseOpts; + let value = input; + if (typeof parser === "function") { + value = parser(value); + } + if (!isNumberFinite(value)) { + value = typeof parser === "string" ? adapter.parse(value, parser) : adapter.parse(value); + } + if (value === null) { + return null; + } + if (round2) { + value = round2 === "week" && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, "isoWeek", isoWeekday) : adapter.startOf(value, round2); + } + return +value; + } + function determineUnitForAutoTicks(minUnit, min, max, capacity) { + const ilen = UNITS.length; + for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) { + const interval = INTERVALS[UNITS[i]]; + const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER; + if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) { + return UNITS[i]; + } + } + return UNITS[ilen - 1]; + } + function determineUnitForFormatting(scale, numTicks, minUnit, min, max) { + for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) { + const unit = UNITS[i]; + if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) { + return unit; + } + } + return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0]; + } + function determineMajorUnit(unit) { + for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) { + if (INTERVALS[UNITS[i]].common) { + return UNITS[i]; + } + } + } + function addTick(ticks, time, timestamps) { + if (!timestamps) { + ticks[time] = true; + } else if (timestamps.length) { + const { lo, hi } = _lookup(timestamps, time); + const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi]; + ticks[timestamp] = true; + } + } + function setMajorTicks(scale, ticks, map3, majorUnit) { + const adapter = scale._adapter; + const first = +adapter.startOf(ticks[0].value, majorUnit); + const last = ticks[ticks.length - 1].value; + let major, index2; + for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) { + index2 = map3[major]; + if (index2 >= 0) { + ticks[index2].major = true; + } + } + return ticks; + } + function ticksFromTimestamps(scale, values, majorUnit) { + const ticks = []; + const map3 = {}; + const ilen = values.length; + let i, value; + for (i = 0; i < ilen; ++i) { + value = values[i]; + map3[value] = i; + ticks.push({ + value, + major: false + }); + } + return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map3, majorUnit); + } + function interpolate2(table, val, reverse) { + let lo = 0; + let hi = table.length - 1; + let prevSource, nextSource, prevTarget, nextTarget; + if (reverse) { + if (val >= table[lo].pos && val <= table[hi].pos) { + ({ lo, hi } = _lookupByKey(table, "pos", val)); + } + ({ pos: prevSource, time: prevTarget } = table[lo]); + ({ pos: nextSource, time: nextTarget } = table[hi]); + } else { + if (val >= table[lo].time && val <= table[hi].time) { + ({ lo, hi } = _lookupByKey(table, "time", val)); + } + ({ time: prevSource, pos: prevTarget } = table[lo]); + ({ time: nextSource, pos: nextTarget } = table[hi]); + } + const span = nextSource - prevSource; + return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget; + } + var Animator, animator, transparent, interpolators, Animation, Animations, isDirectUpdateMode, cloneIfNotShared, createStack, DatasetController, BarController, BubbleController, DoughnutController, LineController, PolarAreaController, PieController, RadarController, ScatterController, controllers, DateAdapterBase, adapters, Interaction, STATIC_POSITIONS, layouts, BasePlatform, BasicPlatform, EXPANDO_KEY, EVENT_TYPES, isNullOrEmpty, eventListenerOptions, drpListeningCharts, oldDevicePixelRatio, DomPlatform, Element2, reverseAlign, offsetFromEdge, getTicksLimit, Scale, TypedRegistry, Registry, registry, PluginService, keyCache, keysCached, addIfFound, Config, hasFunction, version, KNOWN_POSITIONS, instances, getChart, Chart, ArcElement, usePath2D, LineElement, PointElement, BarElement, elements, BORDER_COLORS, BACKGROUND_COLORS, plugin_colors, plugin_decimation, simpleArc, index, getBoxSize, itemsEqual, Legend, plugin_legend, Title, plugin_title, map2, plugin_subtitle, positioners, defaultCallbacks, Tooltip, plugin_tooltip, plugins, addIfString, validIndex, CategoryScale, LinearScaleBase, LinearScale, log10Floor, changeExponent, LogarithmicScale, RadialLinearScale, INTERVALS, UNITS, TimeScale, TimeSeriesScale, scales, registerables; + var init_chart = __esm({ + "node_modules/chart.js/dist/chart.js"() { + init_helpers_dataset(); + Animator = class { + constructor() { + this._request = null; + this._charts = /* @__PURE__ */ new Map(); + this._running = false; + this._lastDate = void 0; + } + _notify(chart2, anims, date, type) { + const callbacks = anims.listeners[type]; + const numSteps = anims.duration; + callbacks.forEach((fn) => fn({ + chart: chart2, + initial: anims.initial, + numSteps, + currentStep: Math.min(date - anims.start, numSteps) + })); + } + _refresh() { + if (this._request) { + return; + } + this._running = true; + this._request = requestAnimFrame.call(window, () => { + this._update(); + this._request = null; + if (this._running) { + this._refresh(); + } + }); + } + _update(date = Date.now()) { + let remaining = 0; + this._charts.forEach((anims, chart2) => { + if (!anims.running || !anims.items.length) { + return; + } + const items = anims.items; + let i = items.length - 1; + let draw2 = false; + let item; + for (; i >= 0; --i) { + item = items[i]; + if (item._active) { + if (item._total > anims.duration) { + anims.duration = item._total; + } + item.tick(date); + draw2 = true; + } else { + items[i] = items[items.length - 1]; + items.pop(); + } + } + if (draw2) { + chart2.draw(); + this._notify(chart2, anims, date, "progress"); + } + if (!items.length) { + anims.running = false; + this._notify(chart2, anims, date, "complete"); + anims.initial = false; + } + remaining += items.length; + }); + this._lastDate = date; + if (remaining === 0) { + this._running = false; + } + } + _getAnims(chart2) { + const charts = this._charts; + let anims = charts.get(chart2); + if (!anims) { + anims = { + running: false, + initial: true, + items: [], + listeners: { + complete: [], + progress: [] + } + }; + charts.set(chart2, anims); + } + return anims; + } + listen(chart2, event, cb) { + this._getAnims(chart2).listeners[event].push(cb); + } + add(chart2, items) { + if (!items || !items.length) { + return; + } + this._getAnims(chart2).items.push(...items); + } + has(chart2) { + return this._getAnims(chart2).items.length > 0; + } + start(chart2) { + const anims = this._charts.get(chart2); + if (!anims) { + return; + } + anims.running = true; + anims.start = Date.now(); + anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0); + this._refresh(); + } + running(chart2) { + if (!this._running) { + return false; + } + const anims = this._charts.get(chart2); + if (!anims || !anims.running || !anims.items.length) { + return false; + } + return true; + } + stop(chart2) { + const anims = this._charts.get(chart2); + if (!anims || !anims.items.length) { + return; + } + const items = anims.items; + let i = items.length - 1; + for (; i >= 0; --i) { + items[i].cancel(); + } + anims.items = []; + this._notify(chart2, anims, Date.now(), "complete"); + } + remove(chart2) { + return this._charts.delete(chart2); + } + }; + animator = /* @__PURE__ */ new Animator(); + transparent = "transparent"; + interpolators = { + boolean(from2, to2, factor) { + return factor > 0.5 ? to2 : from2; + }, + color(from2, to2, factor) { + const c0 = color(from2 || transparent); + const c1 = c0.valid && color(to2 || transparent); + return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to2; + }, + number(from2, to2, factor) { + return from2 + (to2 - from2) * factor; + } + }; + Animation = class { + constructor(cfg, target, prop, to2) { + const currentValue = target[prop]; + to2 = resolve([ + cfg.to, + to2, + currentValue, + cfg.from + ]); + const from2 = resolve([ + cfg.from, + currentValue, + to2 + ]); + this._active = true; + this._fn = cfg.fn || interpolators[cfg.type || typeof from2]; + this._easing = effects[cfg.easing] || effects.linear; + this._start = Math.floor(Date.now() + (cfg.delay || 0)); + this._duration = this._total = Math.floor(cfg.duration); + this._loop = !!cfg.loop; + this._target = target; + this._prop = prop; + this._from = from2; + this._to = to2; + this._promises = void 0; + } + active() { + return this._active; + } + update(cfg, to2, date) { + if (this._active) { + this._notify(false); + const currentValue = this._target[this._prop]; + const elapsed = date - this._start; + const remain = this._duration - elapsed; + this._start = date; + this._duration = Math.floor(Math.max(remain, cfg.duration)); + this._total += elapsed; + this._loop = !!cfg.loop; + this._to = resolve([ + cfg.to, + to2, + currentValue, + cfg.from + ]); + this._from = resolve([ + cfg.from, + currentValue, + to2 + ]); + } + } + cancel() { + if (this._active) { + this.tick(Date.now()); + this._active = false; + this._notify(false); + } + } + tick(date) { + const elapsed = date - this._start; + const duration = this._duration; + const prop = this._prop; + const from2 = this._from; + const loop = this._loop; + const to2 = this._to; + let factor; + this._active = from2 !== to2 && (loop || elapsed < duration); + if (!this._active) { + this._target[prop] = to2; + this._notify(true); + return; + } + if (elapsed < 0) { + this._target[prop] = from2; + return; + } + factor = elapsed / duration % 2; + factor = loop && factor > 1 ? 2 - factor : factor; + factor = this._easing(Math.min(1, Math.max(0, factor))); + this._target[prop] = this._fn(from2, to2, factor); + } + wait() { + const promises = this._promises || (this._promises = []); + return new Promise((res, rej) => { + promises.push({ + res, + rej + }); + }); + } + _notify(resolved) { + const method = resolved ? "res" : "rej"; + const promises = this._promises || []; + for (let i = 0; i < promises.length; i++) { + promises[i][method](); + } + } + }; + Animations = class { + constructor(chart2, config) { + this._chart = chart2; + this._properties = /* @__PURE__ */ new Map(); + this.configure(config); + } + configure(config) { + if (!isObject(config)) { + return; + } + const animationOptions = Object.keys(defaults.animation); + const animatedProps = this._properties; + Object.getOwnPropertyNames(config).forEach((key) => { + const cfg = config[key]; + if (!isObject(cfg)) { + return; + } + const resolved = {}; + for (const option of animationOptions) { + resolved[option] = cfg[option]; + } + (isArray(cfg.properties) && cfg.properties || [ + key + ]).forEach((prop) => { + if (prop === key || !animatedProps.has(prop)) { + animatedProps.set(prop, resolved); + } + }); + }); + } + _animateOptions(target, values) { + const newOptions = values.options; + const options = resolveTargetOptions(target, newOptions); + if (!options) { + return []; + } + const animations = this._createAnimations(options, newOptions); + if (newOptions.$shared) { + awaitAll(target.options.$animations, newOptions).then(() => { + target.options = newOptions; + }, () => { + }); + } + return animations; + } + _createAnimations(target, values) { + const animatedProps = this._properties; + const animations = []; + const running = target.$animations || (target.$animations = {}); + const props = Object.keys(values); + const date = Date.now(); + let i; + for (i = props.length - 1; i >= 0; --i) { + const prop = props[i]; + if (prop.charAt(0) === "$") { + continue; + } + if (prop === "options") { + animations.push(...this._animateOptions(target, values)); + continue; + } + const value = values[prop]; + let animation = running[prop]; + const cfg = animatedProps.get(prop); + if (animation) { + if (cfg && animation.active()) { + animation.update(cfg, value, date); + continue; + } else { + animation.cancel(); + } + } + if (!cfg || !cfg.duration) { + target[prop] = value; + continue; + } + running[prop] = animation = new Animation(cfg, target, prop, value); + animations.push(animation); + } + return animations; + } + update(target, values) { + if (this._properties.size === 0) { + Object.assign(target, values); + return; + } + const animations = this._createAnimations(target, values); + if (animations.length) { + animator.add(this._chart, animations); + return true; + } + } + }; + isDirectUpdateMode = (mode) => mode === "reset" || mode === "none"; + cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached); + createStack = (canStack, meta, chart2) => canStack && !meta.hidden && meta._stacked && { + keys: getSortedDatasetIndices(chart2, true), + values: null + }; + DatasetController = class { + constructor(chart2, datasetIndex) { + this.chart = chart2; + this._ctx = chart2.ctx; + this.index = datasetIndex; + this._cachedDataOpts = {}; + this._cachedMeta = this.getMeta(); + this._type = this._cachedMeta.type; + this.options = void 0; + this._parsing = false; + this._data = void 0; + this._objectData = void 0; + this._sharedOptions = void 0; + this._drawStart = void 0; + this._drawCount = void 0; + this.enableOptionSharing = false; + this.supportsDecimation = false; + this.$context = void 0; + this._syncList = []; + this.datasetElementType = new.target.datasetElementType; + this.dataElementType = new.target.dataElementType; + this.initialize(); + } + initialize() { + const meta = this._cachedMeta; + this.configure(); + this.linkScales(); + meta._stacked = isStacked(meta.vScale, meta); + this.addElements(); + if (this.options.fill && !this.chart.isPluginEnabled("filler")) { + console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options"); + } + } + updateIndex(datasetIndex) { + if (this.index !== datasetIndex) { + clearStacks(this._cachedMeta); + } + this.index = datasetIndex; + } + linkScales() { + const chart2 = this.chart; + const meta = this._cachedMeta; + const dataset = this.getDataset(); + const chooseId = (axis, x, y, r) => axis === "x" ? x : axis === "r" ? r : y; + const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart2, "x")); + const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart2, "y")); + const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart2, "r")); + const indexAxis = meta.indexAxis; + const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid); + const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid); + meta.xScale = this.getScaleForId(xid); + meta.yScale = this.getScaleForId(yid); + meta.rScale = this.getScaleForId(rid); + meta.iScale = this.getScaleForId(iid); + meta.vScale = this.getScaleForId(vid); + } + getDataset() { + return this.chart.data.datasets[this.index]; + } + getMeta() { + return this.chart.getDatasetMeta(this.index); + } + getScaleForId(scaleID) { + return this.chart.scales[scaleID]; + } + _getOtherScale(scale) { + const meta = this._cachedMeta; + return scale === meta.iScale ? meta.vScale : meta.iScale; + } + reset() { + this._update("reset"); + } + _destroy() { + const meta = this._cachedMeta; + if (this._data) { + unlistenArrayEvents(this._data, this); + } + if (meta._stacked) { + clearStacks(meta); + } + } + _dataCheck() { + const dataset = this.getDataset(); + const data = dataset.data || (dataset.data = []); + const _data = this._data; + if (isObject(data)) { + const meta = this._cachedMeta; + this._data = convertObjectDataToArray(data, meta); + } else if (_data !== data) { + if (_data) { + unlistenArrayEvents(_data, this); + const meta = this._cachedMeta; + clearStacks(meta); + meta._parsed = []; + } + if (data && Object.isExtensible(data)) { + listenArrayEvents(data, this); + } + this._syncList = []; + this._data = data; + } + } + addElements() { + const meta = this._cachedMeta; + this._dataCheck(); + if (this.datasetElementType) { + meta.dataset = new this.datasetElementType(); + } + } + buildOrUpdateElements(resetNewElements) { + const meta = this._cachedMeta; + const dataset = this.getDataset(); + let stackChanged = false; + this._dataCheck(); + const oldStacked = meta._stacked; + meta._stacked = isStacked(meta.vScale, meta); + if (meta.stack !== dataset.stack) { + stackChanged = true; + clearStacks(meta); + meta.stack = dataset.stack; + } + this._resyncElements(resetNewElements); + if (stackChanged || oldStacked !== meta._stacked) { + updateStacks(this, meta._parsed); + meta._stacked = isStacked(meta.vScale, meta); + } + } + configure() { + const config = this.chart.config; + const scopeKeys = config.datasetScopeKeys(this._type); + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true); + this.options = config.createResolver(scopes, this.getContext()); + this._parsing = this.options.parsing; + this._cachedDataOpts = {}; + } + parse(start, count) { + const { _cachedMeta: meta, _data: data } = this; + const { iScale, _stacked } = meta; + const iAxis = iScale.axis; + let sorted = start === 0 && count === data.length ? true : meta._sorted; + let prev = start > 0 && meta._parsed[start - 1]; + let i, cur, parsed; + if (this._parsing === false) { + meta._parsed = data; + meta._sorted = true; + parsed = data; + } else { + if (isArray(data[start])) { + parsed = this.parseArrayData(meta, data, start, count); + } else if (isObject(data[start])) { + parsed = this.parseObjectData(meta, data, start, count); + } else { + parsed = this.parsePrimitiveData(meta, data, start, count); + } + const isNotInOrderComparedToPrev = () => cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis]; + for (i = 0; i < count; ++i) { + meta._parsed[i + start] = cur = parsed[i]; + if (sorted) { + if (isNotInOrderComparedToPrev()) { + sorted = false; + } + prev = cur; + } + } + meta._sorted = sorted; + } + if (_stacked) { + updateStacks(this, parsed); + } + } + parsePrimitiveData(meta, data, start, count) { + const { iScale, vScale } = meta; + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const labels = iScale.getLabels(); + const singleScale = iScale === vScale; + const parsed = new Array(count); + let i, ilen, index2; + for (i = 0, ilen = count; i < ilen; ++i) { + index2 = i + start; + parsed[i] = { + [iAxis]: singleScale || iScale.parse(labels[index2], index2), + [vAxis]: vScale.parse(data[index2], index2) + }; + } + return parsed; + } + parseArrayData(meta, data, start, count) { + const { xScale, yScale } = meta; + const parsed = new Array(count); + let i, ilen, index2, item; + for (i = 0, ilen = count; i < ilen; ++i) { + index2 = i + start; + item = data[index2]; + parsed[i] = { + x: xScale.parse(item[0], index2), + y: yScale.parse(item[1], index2) + }; + } + return parsed; + } + parseObjectData(meta, data, start, count) { + const { xScale, yScale } = meta; + const { xAxisKey = "x", yAxisKey = "y" } = this._parsing; + const parsed = new Array(count); + let i, ilen, index2, item; + for (i = 0, ilen = count; i < ilen; ++i) { + index2 = i + start; + item = data[index2]; + parsed[i] = { + x: xScale.parse(resolveObjectKey(item, xAxisKey), index2), + y: yScale.parse(resolveObjectKey(item, yAxisKey), index2) + }; + } + return parsed; + } + getParsed(index2) { + return this._cachedMeta._parsed[index2]; + } + getDataElement(index2) { + return this._cachedMeta.data[index2]; + } + applyStack(scale, parsed, mode) { + const chart2 = this.chart; + const meta = this._cachedMeta; + const value = parsed[scale.axis]; + const stack = { + keys: getSortedDatasetIndices(chart2, true), + values: parsed._stacks[scale.axis]._visualValues + }; + return applyStack(stack, value, meta.index, { + mode + }); + } + updateRangeFromParsed(range2, scale, parsed, stack) { + const parsedValue = parsed[scale.axis]; + let value = parsedValue === null ? NaN : parsedValue; + const values = stack && parsed._stacks[scale.axis]; + if (stack && values) { + stack.values = values; + value = applyStack(stack, parsedValue, this._cachedMeta.index); + } + range2.min = Math.min(range2.min, value); + range2.max = Math.max(range2.max, value); + } + getMinMax(scale, canStack) { + const meta = this._cachedMeta; + const _parsed = meta._parsed; + const sorted = meta._sorted && scale === meta.iScale; + const ilen = _parsed.length; + const otherScale = this._getOtherScale(scale); + const stack = createStack(canStack, meta, this.chart); + const range2 = { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY + }; + const { min: otherMin, max: otherMax } = getUserBounds(otherScale); + let i, parsed; + function _skip() { + parsed = _parsed[i]; + const otherValue = parsed[otherScale.axis]; + return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue; + } + for (i = 0; i < ilen; ++i) { + if (_skip()) { + continue; + } + this.updateRangeFromParsed(range2, scale, parsed, stack); + if (sorted) { + break; + } + } + if (sorted) { + for (i = ilen - 1; i >= 0; --i) { + if (_skip()) { + continue; + } + this.updateRangeFromParsed(range2, scale, parsed, stack); + break; + } + } + return range2; + } + getAllParsedValues(scale) { + const parsed = this._cachedMeta._parsed; + const values = []; + let i, ilen, value; + for (i = 0, ilen = parsed.length; i < ilen; ++i) { + value = parsed[i][scale.axis]; + if (isNumberFinite(value)) { + values.push(value); + } + } + return values; + } + getMaxOverflow() { + return false; + } + getLabelAndValue(index2) { + const meta = this._cachedMeta; + const iScale = meta.iScale; + const vScale = meta.vScale; + const parsed = this.getParsed(index2); + return { + label: iScale ? "" + iScale.getLabelForValue(parsed[iScale.axis]) : "", + value: vScale ? "" + vScale.getLabelForValue(parsed[vScale.axis]) : "" + }; + } + _update(mode) { + const meta = this._cachedMeta; + this.update(mode || "default"); + meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow()))); + } + update(mode) { + } + draw() { + const ctx = this._ctx; + const chart2 = this.chart; + const meta = this._cachedMeta; + const elements3 = meta.data || []; + const area = chart2.chartArea; + const active = []; + const start = this._drawStart || 0; + const count = this._drawCount || elements3.length - start; + const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop; + let i; + if (meta.dataset) { + meta.dataset.draw(ctx, area, start, count); + } + for (i = start; i < start + count; ++i) { + const element = elements3[i]; + if (element.hidden) { + continue; + } + if (element.active && drawActiveElementsOnTop) { + active.push(element); + } else { + element.draw(ctx, area); + } + } + for (i = 0; i < active.length; ++i) { + active[i].draw(ctx, area); + } + } + getStyle(index2, active) { + const mode = active ? "active" : "default"; + return index2 === void 0 && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index2 || 0, mode); + } + getContext(index2, active, mode) { + const dataset = this.getDataset(); + let context; + if (index2 >= 0 && index2 < this._cachedMeta.data.length) { + const element = this._cachedMeta.data[index2]; + context = element.$context || (element.$context = createDataContext(this.getContext(), index2, element)); + context.parsed = this.getParsed(index2); + context.raw = dataset.data[index2]; + context.index = context.dataIndex = index2; + } else { + context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index)); + context.dataset = dataset; + context.index = context.datasetIndex = this.index; + } + context.active = !!active; + context.mode = mode; + return context; + } + resolveDatasetElementOptions(mode) { + return this._resolveElementOptions(this.datasetElementType.id, mode); + } + resolveDataElementOptions(index2, mode) { + return this._resolveElementOptions(this.dataElementType.id, mode, index2); + } + _resolveElementOptions(elementType, mode = "default", index2) { + const active = mode === "active"; + const cache2 = this._cachedDataOpts; + const cacheKey = elementType + "-" + mode; + const cached = cache2[cacheKey]; + const sharing = this.enableOptionSharing && defined(index2); + if (cached) { + return cloneIfNotShared(cached, sharing); + } + const config = this.chart.config; + const scopeKeys = config.datasetElementScopeKeys(this._type, elementType); + const prefixes = active ? [ + `${elementType}Hover`, + "hover", + elementType, + "" + ] : [ + elementType, + "" + ]; + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); + const names2 = Object.keys(defaults.elements[elementType]); + const context = () => this.getContext(index2, active, mode); + const values = config.resolveNamedOptions(scopes, names2, context, prefixes); + if (values.$shared) { + values.$shared = sharing; + cache2[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing)); + } + return values; + } + _resolveAnimations(index2, transition, active) { + const chart2 = this.chart; + const cache2 = this._cachedDataOpts; + const cacheKey = `animation-${transition}`; + const cached = cache2[cacheKey]; + if (cached) { + return cached; + } + let options; + if (chart2.options.animation !== false) { + const config = this.chart.config; + const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition); + const scopes = config.getOptionScopes(this.getDataset(), scopeKeys); + options = config.createResolver(scopes, this.getContext(index2, active, transition)); + } + const animations = new Animations(chart2, options && options.animations); + if (options && options._cacheable) { + cache2[cacheKey] = Object.freeze(animations); + } + return animations; + } + getSharedOptions(options) { + if (!options.$shared) { + return; + } + return this._sharedOptions || (this._sharedOptions = Object.assign({}, options)); + } + includeOptions(mode, sharedOptions) { + return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled; + } + _getSharedOptions(start, mode) { + const firstOpts = this.resolveDataElementOptions(start, mode); + const previouslySharedOptions = this._sharedOptions; + const sharedOptions = this.getSharedOptions(firstOpts); + const includeOptions = this.includeOptions(mode, sharedOptions) || sharedOptions !== previouslySharedOptions; + this.updateSharedOptions(sharedOptions, mode, firstOpts); + return { + sharedOptions, + includeOptions + }; + } + updateElement(element, index2, properties, mode) { + if (isDirectUpdateMode(mode)) { + Object.assign(element, properties); + } else { + this._resolveAnimations(index2, mode).update(element, properties); + } + } + updateSharedOptions(sharedOptions, mode, newOptions) { + if (sharedOptions && !isDirectUpdateMode(mode)) { + this._resolveAnimations(void 0, mode).update(sharedOptions, newOptions); + } + } + _setStyle(element, index2, mode, active) { + element.active = active; + const options = this.getStyle(index2, active); + this._resolveAnimations(index2, mode, active).update(element, { + options: !active && this.getSharedOptions(options) || options + }); + } + removeHoverStyle(element, datasetIndex, index2) { + this._setStyle(element, index2, "active", false); + } + setHoverStyle(element, datasetIndex, index2) { + this._setStyle(element, index2, "active", true); + } + _removeDatasetHoverStyle() { + const element = this._cachedMeta.dataset; + if (element) { + this._setStyle(element, void 0, "active", false); + } + } + _setDatasetHoverStyle() { + const element = this._cachedMeta.dataset; + if (element) { + this._setStyle(element, void 0, "active", true); + } + } + _resyncElements(resetNewElements) { + const data = this._data; + const elements3 = this._cachedMeta.data; + for (const [method, arg1, arg2] of this._syncList) { + this[method](arg1, arg2); + } + this._syncList = []; + const numMeta = elements3.length; + const numData = data.length; + const count = Math.min(numData, numMeta); + if (count) { + this.parse(0, count); + } + if (numData > numMeta) { + this._insertElements(numMeta, numData - numMeta, resetNewElements); + } else if (numData < numMeta) { + this._removeElements(numData, numMeta - numData); + } + } + _insertElements(start, count, resetNewElements = true) { + const meta = this._cachedMeta; + const data = meta.data; + const end = start + count; + let i; + const move = (arr) => { + arr.length += count; + for (i = arr.length - 1; i >= end; i--) { + arr[i] = arr[i - count]; + } + }; + move(data); + for (i = start; i < end; ++i) { + data[i] = new this.dataElementType(); + } + if (this._parsing) { + move(meta._parsed); + } + this.parse(start, count); + if (resetNewElements) { + this.updateElements(data, start, count, "reset"); + } + } + updateElements(element, start, count, mode) { + } + _removeElements(start, count) { + const meta = this._cachedMeta; + if (this._parsing) { + const removed = meta._parsed.splice(start, count); + if (meta._stacked) { + clearStacks(meta, removed); + } + } + meta.data.splice(start, count); + } + _sync(args) { + if (this._parsing) { + this._syncList.push(args); + } else { + const [method, arg1, arg2] = args; + this[method](arg1, arg2); + } + this.chart._dataChanges.push([ + this.index, + ...args + ]); + } + _onDataPush() { + const count = arguments.length; + this._sync([ + "_insertElements", + this.getDataset().data.length - count, + count + ]); + } + _onDataPop() { + this._sync([ + "_removeElements", + this._cachedMeta.data.length - 1, + 1 + ]); + } + _onDataShift() { + this._sync([ + "_removeElements", + 0, + 1 + ]); + } + _onDataSplice(start, count) { + if (count) { + this._sync([ + "_removeElements", + start, + count + ]); + } + const newCount = arguments.length - 2; + if (newCount) { + this._sync([ + "_insertElements", + start, + newCount + ]); + } + } + _onDataUnshift() { + this._sync([ + "_insertElements", + 0, + arguments.length + ]); + } + }; + __publicField(DatasetController, "defaults", {}); + __publicField(DatasetController, "datasetElementType", null); + __publicField(DatasetController, "dataElementType", null); + BarController = class extends DatasetController { + parsePrimitiveData(meta, data, start, count) { + return parseArrayOrPrimitive(meta, data, start, count); + } + parseArrayData(meta, data, start, count) { + return parseArrayOrPrimitive(meta, data, start, count); + } + parseObjectData(meta, data, start, count) { + const { iScale, vScale } = meta; + const { xAxisKey = "x", yAxisKey = "y" } = this._parsing; + const iAxisKey = iScale.axis === "x" ? xAxisKey : yAxisKey; + const vAxisKey = vScale.axis === "x" ? xAxisKey : yAxisKey; + const parsed = []; + let i, ilen, item, obj; + for (i = start, ilen = start + count; i < ilen; ++i) { + obj = data[i]; + item = {}; + item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i); + parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i)); + } + return parsed; + } + updateRangeFromParsed(range2, scale, parsed, stack) { + super.updateRangeFromParsed(range2, scale, parsed, stack); + const custom = parsed._custom; + if (custom && scale === this._cachedMeta.vScale) { + range2.min = Math.min(range2.min, custom.min); + range2.max = Math.max(range2.max, custom.max); + } + } + getMaxOverflow() { + return 0; + } + getLabelAndValue(index2) { + const meta = this._cachedMeta; + const { iScale, vScale } = meta; + const parsed = this.getParsed(index2); + const custom = parsed._custom; + const value = isFloatBar(custom) ? "[" + custom.start + ", " + custom.end + "]" : "" + vScale.getLabelForValue(parsed[vScale.axis]); + return { + label: "" + iScale.getLabelForValue(parsed[iScale.axis]), + value + }; + } + initialize() { + this.enableOptionSharing = true; + super.initialize(); + const meta = this._cachedMeta; + meta.stack = this.getDataset().stack; + } + update(mode) { + const meta = this._cachedMeta; + this.updateElements(meta.data, 0, meta.data.length, mode); + } + updateElements(bars, start, count, mode) { + const reset = mode === "reset"; + const { index: index2, _cachedMeta: { vScale } } = this; + const base = vScale.getBasePixel(); + const horizontal = vScale.isHorizontal(); + const ruler = this._getRuler(); + const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode); + for (let i = start; i < start + count; i++) { + const parsed = this.getParsed(i); + const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? { + base, + head: base + } : this._calculateBarValuePixels(i); + const ipixels = this._calculateBarIndexPixels(i, ruler); + const stack = (parsed._stacks || {})[vScale.axis]; + const properties = { + horizontal, + base: vpixels.base, + enableBorderRadius: !stack || isFloatBar(parsed._custom) || index2 === stack._top || index2 === stack._bottom, + x: horizontal ? vpixels.head : ipixels.center, + y: horizontal ? ipixels.center : vpixels.head, + height: horizontal ? ipixels.size : Math.abs(vpixels.size), + width: horizontal ? Math.abs(vpixels.size) : ipixels.size + }; + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? "active" : mode); + } + const options = properties.options || bars[i].options; + setBorderSkipped(properties, options, stack, index2); + setInflateAmount(properties, options, ruler.ratio); + this.updateElement(bars[i], i, properties, mode); + } + } + _getStacks(last, dataIndex) { + const { iScale } = this._cachedMeta; + const metasets = iScale.getMatchingVisibleMetas(this._type).filter((meta) => meta.controller.options.grouped); + const stacked = iScale.options.stacked; + const stacks = []; + const currentParsed = this._cachedMeta.controller.getParsed(dataIndex); + const iScaleValue = currentParsed && currentParsed[iScale.axis]; + const skipNull = (meta) => { + const parsed = meta._parsed.find((item) => item[iScale.axis] === iScaleValue); + const val = parsed && parsed[meta.vScale.axis]; + if (isNullOrUndef(val) || isNaN(val)) { + return true; + } + }; + for (const meta of metasets) { + if (dataIndex !== void 0 && skipNull(meta)) { + continue; + } + if (stacked === false || stacks.indexOf(meta.stack) === -1 || stacked === void 0 && meta.stack === void 0) { + stacks.push(meta.stack); + } + if (meta.index === last) { + break; + } + } + if (!stacks.length) { + stacks.push(void 0); + } + return stacks; + } + _getStackCount(index2) { + return this._getStacks(void 0, index2).length; + } + _getAxisCount() { + return this._getAxis().length; + } + getFirstScaleIdForIndexAxis() { + const scales2 = this.chart.scales; + const indexScaleId = this.chart.options.indexAxis; + return Object.keys(scales2).filter((key) => scales2[key].axis === indexScaleId).shift(); + } + _getAxis() { + const axis = {}; + const firstScaleAxisId = this.getFirstScaleIdForIndexAxis(); + for (const dataset of this.chart.data.datasets) { + axis[valueOrDefault(this.chart.options.indexAxis === "x" ? dataset.xAxisID : dataset.yAxisID, firstScaleAxisId)] = true; + } + return Object.keys(axis); + } + _getStackIndex(datasetIndex, name, dataIndex) { + const stacks = this._getStacks(datasetIndex, dataIndex); + const index2 = name !== void 0 ? stacks.indexOf(name) : -1; + return index2 === -1 ? stacks.length - 1 : index2; + } + _getRuler() { + const opts = this.options; + const meta = this._cachedMeta; + const iScale = meta.iScale; + const pixels = []; + let i, ilen; + for (i = 0, ilen = meta.data.length; i < ilen; ++i) { + pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i)); + } + const barThickness = opts.barThickness; + const min = barThickness || computeMinSampleSize(meta); + return { + min, + pixels, + start: iScale._startPixel, + end: iScale._endPixel, + stackCount: this._getStackCount(), + scale: iScale, + grouped: opts.grouped, + ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage + }; + } + _calculateBarValuePixels(index2) { + const { _cachedMeta: { vScale, _stacked, index: datasetIndex }, options: { base: baseValue, minBarLength } } = this; + const actualBase = baseValue || 0; + const parsed = this.getParsed(index2); + const custom = parsed._custom; + const floating = isFloatBar(custom); + let value = parsed[vScale.axis]; + let start = 0; + let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value; + let head, size; + if (length !== value) { + start = length - value; + length = value; + } + if (floating) { + value = custom.barStart; + length = custom.barEnd - custom.barStart; + if (value !== 0 && sign(value) !== sign(custom.barEnd)) { + start = 0; + } + start += value; + } + const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start; + let base = vScale.getPixelForValue(startValue); + if (this.chart.getDataVisibility(index2)) { + head = vScale.getPixelForValue(start + length); + } else { + head = base; + } + size = head - base; + if (Math.abs(size) < minBarLength) { + size = barSign(size, vScale, actualBase) * minBarLength; + if (value === actualBase) { + base -= size / 2; + } + const startPixel = vScale.getPixelForDecimal(0); + const endPixel = vScale.getPixelForDecimal(1); + const min = Math.min(startPixel, endPixel); + const max = Math.max(startPixel, endPixel); + base = Math.max(Math.min(base, max), min); + head = base + size; + if (_stacked && !floating) { + parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base); + } + } + if (base === vScale.getPixelForValue(actualBase)) { + const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2; + base += halfGrid; + size -= halfGrid; + } + return { + size, + base, + head, + center: head + size / 2 + }; + } + _calculateBarIndexPixels(index2, ruler) { + const scale = ruler.scale; + const options = this.options; + const skipNull = options.skipNull; + const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity); + let center, size; + const axisCount = this._getAxisCount(); + if (ruler.grouped) { + const stackCount = skipNull ? this._getStackCount(index2) : ruler.stackCount; + const range2 = options.barThickness === "flex" ? computeFlexCategoryTraits(index2, ruler, options, stackCount * axisCount) : computeFitCategoryTraits(index2, ruler, options, stackCount * axisCount); + const axisID = this.chart.options.indexAxis === "x" ? this.getDataset().xAxisID : this.getDataset().yAxisID; + const axisNumber = this._getAxis().indexOf(valueOrDefault(axisID, this.getFirstScaleIdForIndexAxis())); + const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index2 : void 0) + axisNumber; + center = range2.start + range2.chunk * stackIndex + range2.chunk / 2; + size = Math.min(maxBarThickness, range2.chunk * range2.ratio); + } else { + center = scale.getPixelForValue(this.getParsed(index2)[scale.axis], index2); + size = Math.min(maxBarThickness, ruler.min * ruler.ratio); + } + return { + base: center - size / 2, + head: center + size / 2, + center, + size + }; + } + draw() { + const meta = this._cachedMeta; + const vScale = meta.vScale; + const rects = meta.data; + const ilen = rects.length; + let i = 0; + for (; i < ilen; ++i) { + if (this.getParsed(i)[vScale.axis] !== null && !rects[i].hidden) { + rects[i].draw(this._ctx); + } + } + } + }; + __publicField(BarController, "id", "bar"); + __publicField(BarController, "defaults", { + datasetElementType: false, + dataElementType: "bar", + categoryPercentage: 0.8, + barPercentage: 0.9, + grouped: true, + animations: { + numbers: { + type: "number", + properties: [ + "x", + "y", + "base", + "width", + "height" + ] + } + } + }); + __publicField(BarController, "overrides", { + scales: { + _index_: { + type: "category", + offset: true, + grid: { + offset: true + } + }, + _value_: { + type: "linear", + beginAtZero: true + } + } + }); + BubbleController = class extends DatasetController { + initialize() { + this.enableOptionSharing = true; + super.initialize(); + } + parsePrimitiveData(meta, data, start, count) { + const parsed = super.parsePrimitiveData(meta, data, start, count); + for (let i = 0; i < parsed.length; i++) { + parsed[i]._custom = this.resolveDataElementOptions(i + start).radius; + } + return parsed; + } + parseArrayData(meta, data, start, count) { + const parsed = super.parseArrayData(meta, data, start, count); + for (let i = 0; i < parsed.length; i++) { + const item = data[start + i]; + parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius); + } + return parsed; + } + parseObjectData(meta, data, start, count) { + const parsed = super.parseObjectData(meta, data, start, count); + for (let i = 0; i < parsed.length; i++) { + const item = data[start + i]; + parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius); + } + return parsed; + } + getMaxOverflow() { + const data = this._cachedMeta.data; + let max = 0; + for (let i = data.length - 1; i >= 0; --i) { + max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2); + } + return max > 0 && max; + } + getLabelAndValue(index2) { + const meta = this._cachedMeta; + const labels = this.chart.data.labels || []; + const { xScale, yScale } = meta; + const parsed = this.getParsed(index2); + const x = xScale.getLabelForValue(parsed.x); + const y = yScale.getLabelForValue(parsed.y); + const r = parsed._custom; + return { + label: labels[index2] || "", + value: "(" + x + ", " + y + (r ? ", " + r : "") + ")" + }; + } + update(mode) { + const points = this._cachedMeta.data; + this.updateElements(points, 0, points.length, mode); + } + updateElements(points, start, count, mode) { + const reset = mode === "reset"; + const { iScale, vScale } = this._cachedMeta; + const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + for (let i = start; i < start + count; i++) { + const point = points[i]; + const parsed = !reset && this.getParsed(i); + const properties = {}; + const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]); + const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]); + properties.skip = isNaN(iPixel) || isNaN(vPixel); + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? "active" : mode); + if (reset) { + properties.options.radius = 0; + } + } + this.updateElement(point, i, properties, mode); + } + } + resolveDataElementOptions(index2, mode) { + const parsed = this.getParsed(index2); + let values = super.resolveDataElementOptions(index2, mode); + if (values.$shared) { + values = Object.assign({}, values, { + $shared: false + }); + } + const radius = values.radius; + if (mode !== "active") { + values.radius = 0; + } + values.radius += valueOrDefault(parsed && parsed._custom, radius); + return values; + } + }; + __publicField(BubbleController, "id", "bubble"); + __publicField(BubbleController, "defaults", { + datasetElementType: false, + dataElementType: "point", + animations: { + numbers: { + type: "number", + properties: [ + "x", + "y", + "borderWidth", + "radius" + ] + } + } + }); + __publicField(BubbleController, "overrides", { + scales: { + x: { + type: "linear" + }, + y: { + type: "linear" + } + } + }); + DoughnutController = class extends DatasetController { + constructor(chart2, datasetIndex) { + super(chart2, datasetIndex); + this.enableOptionSharing = true; + this.innerRadius = void 0; + this.outerRadius = void 0; + this.offsetX = void 0; + this.offsetY = void 0; + } + linkScales() { + } + parse(start, count) { + const data = this.getDataset().data; + const meta = this._cachedMeta; + if (this._parsing === false) { + meta._parsed = data; + } else { + let getter = (i2) => +data[i2]; + if (isObject(data[start])) { + const { key = "value" } = this._parsing; + getter = (i2) => +resolveObjectKey(data[i2], key); + } + let i, ilen; + for (i = start, ilen = start + count; i < ilen; ++i) { + meta._parsed[i] = getter(i); + } + } + } + _getRotation() { + return toRadians(this.options.rotation - 90); + } + _getCircumference() { + return toRadians(this.options.circumference); + } + _getRotationExtents() { + let min = TAU; + let max = -TAU; + for (let i = 0; i < this.chart.data.datasets.length; ++i) { + if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) { + const controller = this.chart.getDatasetMeta(i).controller; + const rotation = controller._getRotation(); + const circumference = controller._getCircumference(); + min = Math.min(min, rotation); + max = Math.max(max, rotation + circumference); + } + } + return { + rotation: min, + circumference: max - min + }; + } + update(mode) { + const chart2 = this.chart; + const { chartArea } = chart2; + const meta = this._cachedMeta; + const arcs = meta.data; + const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing; + const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0); + const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1); + const chartWeight = this._getRingWeight(this.index); + const { circumference, rotation } = this._getRotationExtents(); + const { ratioX, ratioY, offsetX, offsetY } = getRatioAndOffset(rotation, circumference, cutout); + const maxWidth = (chartArea.width - spacing) / ratioX; + const maxHeight = (chartArea.height - spacing) / ratioY; + const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0); + const outerRadius = toDimension(this.options.radius, maxRadius); + const innerRadius = Math.max(outerRadius * cutout, 0); + const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal(); + this.offsetX = offsetX * outerRadius; + this.offsetY = offsetY * outerRadius; + meta.total = this.calculateTotal(); + this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index); + this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0); + this.updateElements(arcs, 0, arcs.length, mode); + } + _circumference(i, reset) { + const opts = this.options; + const meta = this._cachedMeta; + const circumference = this._getCircumference(); + if (reset && opts.animation.animateRotate || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) { + return 0; + } + return this.calculateCircumference(meta._parsed[i] * circumference / TAU); + } + updateElements(arcs, start, count, mode) { + const reset = mode === "reset"; + const chart2 = this.chart; + const chartArea = chart2.chartArea; + const opts = chart2.options; + const animationOpts = opts.animation; + const centerX = (chartArea.left + chartArea.right) / 2; + const centerY = (chartArea.top + chartArea.bottom) / 2; + const animateScale = reset && animationOpts.animateScale; + const innerRadius = animateScale ? 0 : this.innerRadius; + const outerRadius = animateScale ? 0 : this.outerRadius; + const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode); + let startAngle = this._getRotation(); + let i; + for (i = 0; i < start; ++i) { + startAngle += this._circumference(i, reset); + } + for (i = start; i < start + count; ++i) { + const circumference = this._circumference(i, reset); + const arc = arcs[i]; + const properties = { + x: centerX + this.offsetX, + y: centerY + this.offsetY, + startAngle, + endAngle: startAngle + circumference, + circumference, + outerRadius, + innerRadius + }; + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? "active" : mode); + } + startAngle += circumference; + this.updateElement(arc, i, properties, mode); + } + } + calculateTotal() { + const meta = this._cachedMeta; + const metaData = meta.data; + let total = 0; + let i; + for (i = 0; i < metaData.length; i++) { + const value = meta._parsed[i]; + if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) { + total += Math.abs(value); + } + } + return total; + } + calculateCircumference(value) { + const total = this._cachedMeta.total; + if (total > 0 && !isNaN(value)) { + return TAU * (Math.abs(value) / total); + } + return 0; + } + getLabelAndValue(index2) { + const meta = this._cachedMeta; + const chart2 = this.chart; + const labels = chart2.data.labels || []; + const value = formatNumber(meta._parsed[index2], chart2.options.locale); + return { + label: labels[index2] || "", + value + }; + } + getMaxBorderWidth(arcs) { + let max = 0; + const chart2 = this.chart; + let i, ilen, meta, controller, options; + if (!arcs) { + for (i = 0, ilen = chart2.data.datasets.length; i < ilen; ++i) { + if (chart2.isDatasetVisible(i)) { + meta = chart2.getDatasetMeta(i); + arcs = meta.data; + controller = meta.controller; + break; + } + } + } + if (!arcs) { + return 0; + } + for (i = 0, ilen = arcs.length; i < ilen; ++i) { + options = controller.resolveDataElementOptions(i); + if (options.borderAlign !== "inner") { + max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0); + } + } + return max; + } + getMaxOffset(arcs) { + let max = 0; + for (let i = 0, ilen = arcs.length; i < ilen; ++i) { + const options = this.resolveDataElementOptions(i); + max = Math.max(max, options.offset || 0, options.hoverOffset || 0); + } + return max; + } + _getRingWeightOffset(datasetIndex) { + let ringWeightOffset = 0; + for (let i = 0; i < datasetIndex; ++i) { + if (this.chart.isDatasetVisible(i)) { + ringWeightOffset += this._getRingWeight(i); + } + } + return ringWeightOffset; + } + _getRingWeight(datasetIndex) { + return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0); + } + _getVisibleDatasetWeightTotal() { + return this._getRingWeightOffset(this.chart.data.datasets.length) || 1; + } + }; + __publicField(DoughnutController, "id", "doughnut"); + __publicField(DoughnutController, "defaults", { + datasetElementType: false, + dataElementType: "arc", + animation: { + animateRotate: true, + animateScale: false + }, + animations: { + numbers: { + type: "number", + properties: [ + "circumference", + "endAngle", + "innerRadius", + "outerRadius", + "startAngle", + "x", + "y", + "offset", + "borderWidth", + "spacing" + ] + } + }, + cutout: "50%", + rotation: 0, + circumference: 360, + radius: "100%", + spacing: 0, + indexAxis: "r" + }); + __publicField(DoughnutController, "descriptors", { + _scriptable: (name) => name !== "spacing", + _indexable: (name) => name !== "spacing" && !name.startsWith("borderDash") && !name.startsWith("hoverBorderDash") + }); + __publicField(DoughnutController, "overrides", { + aspectRatio: 1, + plugins: { + legend: { + labels: { + generateLabels(chart2) { + const data = chart2.data; + const { labels: { pointStyle, textAlign, color: color2, useBorderRadius, borderRadius } } = chart2.legend.options; + if (data.labels.length && data.datasets.length) { + return data.labels.map((label, i) => { + const meta = chart2.getDatasetMeta(0); + const style = meta.controller.getStyle(i); + return { + text: label, + fillStyle: style.backgroundColor, + fontColor: color2, + hidden: !chart2.getDataVisibility(i), + lineDash: style.borderDash, + lineDashOffset: style.borderDashOffset, + lineJoin: style.borderJoinStyle, + lineWidth: style.borderWidth, + strokeStyle: style.borderColor, + textAlign, + pointStyle, + borderRadius: useBorderRadius && (borderRadius || style.borderRadius), + index: i + }; + }); + } + return []; + } + }, + onClick(e, legendItem, legend) { + legend.chart.toggleDataVisibility(legendItem.index); + legend.chart.update(); + } + } + } + }); + LineController = class extends DatasetController { + initialize() { + this.enableOptionSharing = true; + this.supportsDecimation = true; + super.initialize(); + } + update(mode) { + const meta = this._cachedMeta; + const { dataset: line, data: points = [], _dataset } = meta; + const animationsDisabled = this.chart._animationsDisabled; + let { start, count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled); + this._drawStart = start; + this._drawCount = count; + if (_scaleRangesChanged(meta)) { + start = 0; + count = points.length; + } + line._chart = this.chart; + line._datasetIndex = this.index; + line._decimated = !!_dataset._decimated; + line.points = points; + const options = this.resolveDatasetElementOptions(mode); + if (!this.options.showLine) { + options.borderWidth = 0; + } + options.segment = this.options.segment; + this.updateElement(line, void 0, { + animated: !animationsDisabled, + options + }, mode); + this.updateElements(points, start, count, mode); + } + updateElements(points, start, count, mode) { + const reset = mode === "reset"; + const { iScale, vScale, _stacked, _dataset } = this._cachedMeta; + const { sharedOptions, includeOptions } = this._getSharedOptions(start, mode); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const { spanGaps, segment } = this.options; + const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; + const directUpdate = this.chart._animationsDisabled || reset || mode === "none"; + const end = start + count; + const pointsCount = points.length; + let prevParsed = start > 0 && this.getParsed(start - 1); + for (let i = 0; i < pointsCount; ++i) { + const point = points[i]; + const properties = directUpdate ? point : {}; + if (i < start || i >= end) { + properties.skip = true; + continue; + } + const parsed = this.getParsed(i); + const nullData = isNullOrUndef(parsed[vAxis]); + const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); + const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); + properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; + properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength; + if (segment) { + properties.parsed = parsed; + properties.raw = _dataset.data[i]; + } + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? "active" : mode); + } + if (!directUpdate) { + this.updateElement(point, i, properties, mode); + } + prevParsed = parsed; + } + } + getMaxOverflow() { + const meta = this._cachedMeta; + const dataset = meta.dataset; + const border = dataset.options && dataset.options.borderWidth || 0; + const data = meta.data || []; + if (!data.length) { + return border; + } + const firstPoint = data[0].size(this.resolveDataElementOptions(0)); + const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1)); + return Math.max(border, firstPoint, lastPoint) / 2; + } + draw() { + const meta = this._cachedMeta; + meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis); + super.draw(); + } + }; + __publicField(LineController, "id", "line"); + __publicField(LineController, "defaults", { + datasetElementType: "line", + dataElementType: "point", + showLine: true, + spanGaps: false + }); + __publicField(LineController, "overrides", { + scales: { + _index_: { + type: "category" + }, + _value_: { + type: "linear" + } + } + }); + PolarAreaController = class extends DatasetController { + constructor(chart2, datasetIndex) { + super(chart2, datasetIndex); + this.innerRadius = void 0; + this.outerRadius = void 0; + } + getLabelAndValue(index2) { + const meta = this._cachedMeta; + const chart2 = this.chart; + const labels = chart2.data.labels || []; + const value = formatNumber(meta._parsed[index2].r, chart2.options.locale); + return { + label: labels[index2] || "", + value + }; + } + parseObjectData(meta, data, start, count) { + return _parseObjectDataRadialScale.bind(this)(meta, data, start, count); + } + update(mode) { + const arcs = this._cachedMeta.data; + this._updateRadius(); + this.updateElements(arcs, 0, arcs.length, mode); + } + getMinMax() { + const meta = this._cachedMeta; + const range2 = { + min: Number.POSITIVE_INFINITY, + max: Number.NEGATIVE_INFINITY + }; + meta.data.forEach((element, index2) => { + const parsed = this.getParsed(index2).r; + if (!isNaN(parsed) && this.chart.getDataVisibility(index2)) { + if (parsed < range2.min) { + range2.min = parsed; + } + if (parsed > range2.max) { + range2.max = parsed; + } + } + }); + return range2; + } + _updateRadius() { + const chart2 = this.chart; + const chartArea = chart2.chartArea; + const opts = chart2.options; + const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top); + const outerRadius = Math.max(minSize / 2, 0); + const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0); + const radiusLength = (outerRadius - innerRadius) / chart2.getVisibleDatasetCount(); + this.outerRadius = outerRadius - radiusLength * this.index; + this.innerRadius = this.outerRadius - radiusLength; + } + updateElements(arcs, start, count, mode) { + const reset = mode === "reset"; + const chart2 = this.chart; + const opts = chart2.options; + const animationOpts = opts.animation; + const scale = this._cachedMeta.rScale; + const centerX = scale.xCenter; + const centerY = scale.yCenter; + const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI; + let angle = datasetStartAngle; + let i; + const defaultAngle = 360 / this.countVisibleElements(); + for (i = 0; i < start; ++i) { + angle += this._computeAngle(i, mode, defaultAngle); + } + for (i = start; i < start + count; i++) { + const arc = arcs[i]; + let startAngle = angle; + let endAngle = angle + this._computeAngle(i, mode, defaultAngle); + let outerRadius = chart2.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0; + angle = endAngle; + if (reset) { + if (animationOpts.animateScale) { + outerRadius = 0; + } + if (animationOpts.animateRotate) { + startAngle = endAngle = datasetStartAngle; + } + } + const properties = { + x: centerX, + y: centerY, + innerRadius: 0, + outerRadius, + startAngle, + endAngle, + options: this.resolveDataElementOptions(i, arc.active ? "active" : mode) + }; + this.updateElement(arc, i, properties, mode); + } + } + countVisibleElements() { + const meta = this._cachedMeta; + let count = 0; + meta.data.forEach((element, index2) => { + if (!isNaN(this.getParsed(index2).r) && this.chart.getDataVisibility(index2)) { + count++; + } + }); + return count; + } + _computeAngle(index2, mode, defaultAngle) { + return this.chart.getDataVisibility(index2) ? toRadians(this.resolveDataElementOptions(index2, mode).angle || defaultAngle) : 0; + } + }; + __publicField(PolarAreaController, "id", "polarArea"); + __publicField(PolarAreaController, "defaults", { + dataElementType: "arc", + animation: { + animateRotate: true, + animateScale: true + }, + animations: { + numbers: { + type: "number", + properties: [ + "x", + "y", + "startAngle", + "endAngle", + "innerRadius", + "outerRadius" + ] + } + }, + indexAxis: "r", + startAngle: 0 + }); + __publicField(PolarAreaController, "overrides", { + aspectRatio: 1, + plugins: { + legend: { + labels: { + generateLabels(chart2) { + const data = chart2.data; + if (data.labels.length && data.datasets.length) { + const { labels: { pointStyle, color: color2 } } = chart2.legend.options; + return data.labels.map((label, i) => { + const meta = chart2.getDatasetMeta(0); + const style = meta.controller.getStyle(i); + return { + text: label, + fillStyle: style.backgroundColor, + strokeStyle: style.borderColor, + fontColor: color2, + lineWidth: style.borderWidth, + pointStyle, + hidden: !chart2.getDataVisibility(i), + index: i + }; + }); + } + return []; + } + }, + onClick(e, legendItem, legend) { + legend.chart.toggleDataVisibility(legendItem.index); + legend.chart.update(); + } + } + }, + scales: { + r: { + type: "radialLinear", + angleLines: { + display: false + }, + beginAtZero: true, + grid: { + circular: true + }, + pointLabels: { + display: false + }, + startAngle: 0 + } + } + }); + PieController = class extends DoughnutController { + }; + __publicField(PieController, "id", "pie"); + __publicField(PieController, "defaults", { + cutout: 0, + rotation: 0, + circumference: 360, + radius: "100%" + }); + RadarController = class extends DatasetController { + getLabelAndValue(index2) { + const vScale = this._cachedMeta.vScale; + const parsed = this.getParsed(index2); + return { + label: vScale.getLabels()[index2], + value: "" + vScale.getLabelForValue(parsed[vScale.axis]) + }; + } + parseObjectData(meta, data, start, count) { + return _parseObjectDataRadialScale.bind(this)(meta, data, start, count); + } + update(mode) { + const meta = this._cachedMeta; + const line = meta.dataset; + const points = meta.data || []; + const labels = meta.iScale.getLabels(); + line.points = points; + if (mode !== "resize") { + const options = this.resolveDatasetElementOptions(mode); + if (!this.options.showLine) { + options.borderWidth = 0; + } + const properties = { + _loop: true, + _fullLoop: labels.length === points.length, + options + }; + this.updateElement(line, void 0, properties, mode); + } + this.updateElements(points, 0, points.length, mode); + } + updateElements(points, start, count, mode) { + const scale = this._cachedMeta.rScale; + const reset = mode === "reset"; + for (let i = start; i < start + count; i++) { + const point = points[i]; + const options = this.resolveDataElementOptions(i, point.active ? "active" : mode); + const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r); + const x = reset ? scale.xCenter : pointPosition.x; + const y = reset ? scale.yCenter : pointPosition.y; + const properties = { + x, + y, + angle: pointPosition.angle, + skip: isNaN(x) || isNaN(y), + options + }; + this.updateElement(point, i, properties, mode); + } + } + }; + __publicField(RadarController, "id", "radar"); + __publicField(RadarController, "defaults", { + datasetElementType: "line", + dataElementType: "point", + indexAxis: "r", + showLine: true, + elements: { + line: { + fill: "start" + } + } + }); + __publicField(RadarController, "overrides", { + aspectRatio: 1, + scales: { + r: { + type: "radialLinear" + } + } + }); + ScatterController = class extends DatasetController { + getLabelAndValue(index2) { + const meta = this._cachedMeta; + const labels = this.chart.data.labels || []; + const { xScale, yScale } = meta; + const parsed = this.getParsed(index2); + const x = xScale.getLabelForValue(parsed.x); + const y = yScale.getLabelForValue(parsed.y); + return { + label: labels[index2] || "", + value: "(" + x + ", " + y + ")" + }; + } + update(mode) { + const meta = this._cachedMeta; + const { data: points = [] } = meta; + const animationsDisabled = this.chart._animationsDisabled; + let { start, count } = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled); + this._drawStart = start; + this._drawCount = count; + if (_scaleRangesChanged(meta)) { + start = 0; + count = points.length; + } + if (this.options.showLine) { + if (!this.datasetElementType) { + this.addElements(); + } + const { dataset: line, _dataset } = meta; + line._chart = this.chart; + line._datasetIndex = this.index; + line._decimated = !!_dataset._decimated; + line.points = points; + const options = this.resolveDatasetElementOptions(mode); + options.segment = this.options.segment; + this.updateElement(line, void 0, { + animated: !animationsDisabled, + options + }, mode); + } else if (this.datasetElementType) { + delete meta.dataset; + this.datasetElementType = false; + } + this.updateElements(points, start, count, mode); + } + addElements() { + const { showLine } = this.options; + if (!this.datasetElementType && showLine) { + this.datasetElementType = this.chart.registry.getElement("line"); + } + super.addElements(); + } + updateElements(points, start, count, mode) { + const reset = mode === "reset"; + const { iScale, vScale, _stacked, _dataset } = this._cachedMeta; + const firstOpts = this.resolveDataElementOptions(start, mode); + const sharedOptions = this.getSharedOptions(firstOpts); + const includeOptions = this.includeOptions(mode, sharedOptions); + const iAxis = iScale.axis; + const vAxis = vScale.axis; + const { spanGaps, segment } = this.options; + const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY; + const directUpdate = this.chart._animationsDisabled || reset || mode === "none"; + let prevParsed = start > 0 && this.getParsed(start - 1); + for (let i = start; i < start + count; ++i) { + const point = points[i]; + const parsed = this.getParsed(i); + const properties = directUpdate ? point : {}; + const nullData = isNullOrUndef(parsed[vAxis]); + const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i); + const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i); + properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData; + properties.stop = i > 0 && Math.abs(parsed[iAxis] - prevParsed[iAxis]) > maxGapLength; + if (segment) { + properties.parsed = parsed; + properties.raw = _dataset.data[i]; + } + if (includeOptions) { + properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? "active" : mode); + } + if (!directUpdate) { + this.updateElement(point, i, properties, mode); + } + prevParsed = parsed; + } + this.updateSharedOptions(sharedOptions, mode, firstOpts); + } + getMaxOverflow() { + const meta = this._cachedMeta; + const data = meta.data || []; + if (!this.options.showLine) { + let max = 0; + for (let i = data.length - 1; i >= 0; --i) { + max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2); + } + return max > 0 && max; + } + const dataset = meta.dataset; + const border = dataset.options && dataset.options.borderWidth || 0; + if (!data.length) { + return border; + } + const firstPoint = data[0].size(this.resolveDataElementOptions(0)); + const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1)); + return Math.max(border, firstPoint, lastPoint) / 2; + } + }; + __publicField(ScatterController, "id", "scatter"); + __publicField(ScatterController, "defaults", { + datasetElementType: false, + dataElementType: "point", + showLine: false, + fill: false + }); + __publicField(ScatterController, "overrides", { + interaction: { + mode: "point" + }, + scales: { + x: { + type: "linear" + }, + y: { + type: "linear" + } + } + }); + controllers = /* @__PURE__ */ Object.freeze({ + __proto__: null, + BarController, + BubbleController, + DoughnutController, + LineController, + PieController, + PolarAreaController, + RadarController, + ScatterController + }); + DateAdapterBase = class _DateAdapterBase { + constructor(options) { + __publicField(this, "options"); + this.options = options || {}; + } + /** + * Override default date adapter methods. + * Accepts type parameter to define options type. + * @example + * Chart._adapters._date.override<{myAdapterOption: string}>({ + * init() { + * console.log(this.options.myAdapterOption); + * } + * }) + */ + static override(members) { + Object.assign(_DateAdapterBase.prototype, members); + } + // eslint-disable-next-line @typescript-eslint/no-empty-function + init() { + } + formats() { + return abstract(); + } + parse() { + return abstract(); + } + format() { + return abstract(); + } + add() { + return abstract(); + } + diff() { + return abstract(); + } + startOf() { + return abstract(); + } + endOf() { + return abstract(); + } + }; + adapters = { + _date: DateAdapterBase + }; + Interaction = { + evaluateInteractionItems, + modes: { + index(chart2, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart2); + const axis = options.axis || "x"; + const includeInvisible = options.includeInvisible || false; + const items = options.intersect ? getIntersectItems(chart2, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart2, position, axis, false, useFinalPosition, includeInvisible); + const elements3 = []; + if (!items.length) { + return []; + } + chart2.getSortedVisibleDatasetMetas().forEach((meta) => { + const index2 = items[0].index; + const element = meta.data[index2]; + if (element && !element.skip) { + elements3.push({ + element, + datasetIndex: meta.index, + index: index2 + }); + } + }); + return elements3; + }, + dataset(chart2, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart2); + const axis = options.axis || "xy"; + const includeInvisible = options.includeInvisible || false; + let items = options.intersect ? getIntersectItems(chart2, position, axis, useFinalPosition, includeInvisible) : getNearestItems(chart2, position, axis, false, useFinalPosition, includeInvisible); + if (items.length > 0) { + const datasetIndex = items[0].datasetIndex; + const data = chart2.getDatasetMeta(datasetIndex).data; + items = []; + for (let i = 0; i < data.length; ++i) { + items.push({ + element: data[i], + datasetIndex, + index: i + }); + } + } + return items; + }, + point(chart2, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart2); + const axis = options.axis || "xy"; + const includeInvisible = options.includeInvisible || false; + return getIntersectItems(chart2, position, axis, useFinalPosition, includeInvisible); + }, + nearest(chart2, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart2); + const axis = options.axis || "xy"; + const includeInvisible = options.includeInvisible || false; + return getNearestItems(chart2, position, axis, options.intersect, useFinalPosition, includeInvisible); + }, + x(chart2, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart2); + return getAxisItems(chart2, position, "x", options.intersect, useFinalPosition); + }, + y(chart2, e, options, useFinalPosition) { + const position = getRelativePosition(e, chart2); + return getAxisItems(chart2, position, "y", options.intersect, useFinalPosition); + } + } + }; + STATIC_POSITIONS = [ + "left", + "top", + "right", + "bottom" + ]; + layouts = { + addBox(chart2, item) { + if (!chart2.boxes) { + chart2.boxes = []; + } + item.fullSize = item.fullSize || false; + item.position = item.position || "top"; + item.weight = item.weight || 0; + item._layers = item._layers || function() { + return [ + { + z: 0, + draw(chartArea) { + item.draw(chartArea); + } + } + ]; + }; + chart2.boxes.push(item); + }, + removeBox(chart2, layoutItem) { + const index2 = chart2.boxes ? chart2.boxes.indexOf(layoutItem) : -1; + if (index2 !== -1) { + chart2.boxes.splice(index2, 1); + } + }, + configure(chart2, item, options) { + item.fullSize = options.fullSize; + item.position = options.position; + item.weight = options.weight; + }, + update(chart2, width, height, minPadding) { + if (!chart2) { + return; + } + const padding = toPadding(chart2.options.layout.padding); + const availableWidth = Math.max(width - padding.width, 0); + const availableHeight = Math.max(height - padding.height, 0); + const boxes = buildLayoutBoxes(chart2.boxes); + const verticalBoxes = boxes.vertical; + const horizontalBoxes = boxes.horizontal; + each(chart2.boxes, (box) => { + if (typeof box.beforeLayout === "function") { + box.beforeLayout(); + } + }); + const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) => wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1; + const params = Object.freeze({ + outerWidth: width, + outerHeight: height, + padding, + availableWidth, + availableHeight, + vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount, + hBoxMaxHeight: availableHeight / 2 + }); + const maxPadding = Object.assign({}, padding); + updateMaxPadding(maxPadding, toPadding(minPadding)); + const chartArea = Object.assign({ + maxPadding, + w: availableWidth, + h: availableHeight, + x: padding.left, + y: padding.top + }, padding); + const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params); + fitBoxes(boxes.fullSize, chartArea, params, stacks); + fitBoxes(verticalBoxes, chartArea, params, stacks); + if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) { + fitBoxes(verticalBoxes, chartArea, params, stacks); + } + handleMaxPadding(chartArea); + placeBoxes(boxes.leftAndTop, chartArea, params, stacks); + chartArea.x += chartArea.w; + chartArea.y += chartArea.h; + placeBoxes(boxes.rightAndBottom, chartArea, params, stacks); + chart2.chartArea = { + left: chartArea.left, + top: chartArea.top, + right: chartArea.left + chartArea.w, + bottom: chartArea.top + chartArea.h, + height: chartArea.h, + width: chartArea.w + }; + each(boxes.chartArea, (layout) => { + const box = layout.box; + Object.assign(box, chart2.chartArea); + box.update(chartArea.w, chartArea.h, { + left: 0, + top: 0, + right: 0, + bottom: 0 + }); + }); + } + }; + BasePlatform = class { + acquireContext(canvas, aspectRatio) { + } + releaseContext(context) { + return false; + } + addEventListener(chart2, type, listener) { + } + removeEventListener(chart2, type, listener) { + } + getDevicePixelRatio() { + return 1; + } + getMaximumSize(element, width, height, aspectRatio) { + width = Math.max(0, width || element.width); + height = height || element.height; + return { + width, + height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height) + }; + } + isAttached(canvas) { + return true; + } + updateConfig(config) { + } + }; + BasicPlatform = class extends BasePlatform { + acquireContext(item) { + return item && item.getContext && item.getContext("2d") || null; + } + updateConfig(config) { + config.options.animation = false; + } + }; + EXPANDO_KEY = "$chartjs"; + EVENT_TYPES = { + touchstart: "mousedown", + touchmove: "mousemove", + touchend: "mouseup", + pointerenter: "mouseenter", + pointerdown: "mousedown", + pointermove: "mousemove", + pointerup: "mouseup", + pointerleave: "mouseout", + pointerout: "mouseout" + }; + isNullOrEmpty = (value) => value === null || value === ""; + eventListenerOptions = supportsEventListenerOptions ? { + passive: true + } : false; + drpListeningCharts = /* @__PURE__ */ new Map(); + oldDevicePixelRatio = 0; + DomPlatform = class extends BasePlatform { + acquireContext(canvas, aspectRatio) { + const context = canvas && canvas.getContext && canvas.getContext("2d"); + if (context && context.canvas === canvas) { + initCanvas(canvas, aspectRatio); + return context; + } + return null; + } + releaseContext(context) { + const canvas = context.canvas; + if (!canvas[EXPANDO_KEY]) { + return false; + } + const initial = canvas[EXPANDO_KEY].initial; + [ + "height", + "width" + ].forEach((prop) => { + const value = initial[prop]; + if (isNullOrUndef(value)) { + canvas.removeAttribute(prop); + } else { + canvas.setAttribute(prop, value); + } + }); + const style = initial.style || {}; + Object.keys(style).forEach((key) => { + canvas.style[key] = style[key]; + }); + canvas.width = canvas.width; + delete canvas[EXPANDO_KEY]; + return true; + } + addEventListener(chart2, type, listener) { + this.removeEventListener(chart2, type); + const proxies = chart2.$proxies || (chart2.$proxies = {}); + const handlers = { + attach: createAttachObserver, + detach: createDetachObserver, + resize: createResizeObserver + }; + const handler = handlers[type] || createProxyAndListen; + proxies[type] = handler(chart2, type, listener); + } + removeEventListener(chart2, type) { + const proxies = chart2.$proxies || (chart2.$proxies = {}); + const proxy = proxies[type]; + if (!proxy) { + return; + } + const handlers = { + attach: releaseObserver, + detach: releaseObserver, + resize: releaseObserver + }; + const handler = handlers[type] || removeListener; + handler(chart2, type, proxy); + proxies[type] = void 0; + } + getDevicePixelRatio() { + return window.devicePixelRatio; + } + getMaximumSize(canvas, width, height, aspectRatio) { + return getMaximumSize(canvas, width, height, aspectRatio); + } + isAttached(canvas) { + const container = canvas && _getParentNode(canvas); + return !!(container && container.isConnected); + } + }; + Element2 = class { + constructor() { + __publicField(this, "x"); + __publicField(this, "y"); + __publicField(this, "active", false); + __publicField(this, "options"); + __publicField(this, "$animations"); + } + tooltipPosition(useFinalPosition) { + const { x, y } = this.getProps([ + "x", + "y" + ], useFinalPosition); + return { + x, + y + }; + } + hasValue() { + return isNumber(this.x) && isNumber(this.y); + } + getProps(props, final) { + const anims = this.$animations; + if (!final || !anims) { + return this; + } + const ret = {}; + props.forEach((prop) => { + ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop]; + }); + return ret; + } + }; + __publicField(Element2, "defaults", {}); + __publicField(Element2, "defaultRoutes"); + reverseAlign = (align) => align === "left" ? "right" : align === "right" ? "left" : align; + offsetFromEdge = (scale, edge, offset) => edge === "top" || edge === "left" ? scale[edge] + offset : scale[edge] - offset; + getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength); + Scale = class _Scale extends Element2 { + constructor(cfg) { + super(); + this.id = cfg.id; + this.type = cfg.type; + this.options = void 0; + this.ctx = cfg.ctx; + this.chart = cfg.chart; + this.top = void 0; + this.bottom = void 0; + this.left = void 0; + this.right = void 0; + this.width = void 0; + this.height = void 0; + this._margins = { + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + this.maxWidth = void 0; + this.maxHeight = void 0; + this.paddingTop = void 0; + this.paddingBottom = void 0; + this.paddingLeft = void 0; + this.paddingRight = void 0; + this.axis = void 0; + this.labelRotation = void 0; + this.min = void 0; + this.max = void 0; + this._range = void 0; + this.ticks = []; + this._gridLineItems = null; + this._labelItems = null; + this._labelSizes = null; + this._length = 0; + this._maxLength = 0; + this._longestTextCache = {}; + this._startPixel = void 0; + this._endPixel = void 0; + this._reversePixels = false; + this._userMax = void 0; + this._userMin = void 0; + this._suggestedMax = void 0; + this._suggestedMin = void 0; + this._ticksLength = 0; + this._borderValue = 0; + this._cache = {}; + this._dataLimitsCached = false; + this.$context = void 0; + } + init(options) { + this.options = options.setContext(this.getContext()); + this.axis = options.axis; + this._userMin = this.parse(options.min); + this._userMax = this.parse(options.max); + this._suggestedMin = this.parse(options.suggestedMin); + this._suggestedMax = this.parse(options.suggestedMax); + } + parse(raw, index2) { + return raw; + } + getUserBounds() { + let { _userMin, _userMax, _suggestedMin, _suggestedMax } = this; + _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY); + _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY); + _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY); + _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY); + return { + min: finiteOrDefault(_userMin, _suggestedMin), + max: finiteOrDefault(_userMax, _suggestedMax), + minDefined: isNumberFinite(_userMin), + maxDefined: isNumberFinite(_userMax) + }; + } + getMinMax(canStack) { + let { min, max, minDefined, maxDefined } = this.getUserBounds(); + let range2; + if (minDefined && maxDefined) { + return { + min, + max + }; + } + const metas = this.getMatchingVisibleMetas(); + for (let i = 0, ilen = metas.length; i < ilen; ++i) { + range2 = metas[i].controller.getMinMax(this, canStack); + if (!minDefined) { + min = Math.min(min, range2.min); + } + if (!maxDefined) { + max = Math.max(max, range2.max); + } + } + min = maxDefined && min > max ? max : min; + max = minDefined && min > max ? min : max; + return { + min: finiteOrDefault(min, finiteOrDefault(max, min)), + max: finiteOrDefault(max, finiteOrDefault(min, max)) + }; + } + getPadding() { + return { + left: this.paddingLeft || 0, + top: this.paddingTop || 0, + right: this.paddingRight || 0, + bottom: this.paddingBottom || 0 + }; + } + getTicks() { + return this.ticks; + } + getLabels() { + const data = this.chart.data; + return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || []; + } + getLabelItems(chartArea = this.chart.chartArea) { + const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea)); + return items; + } + beforeLayout() { + this._cache = {}; + this._dataLimitsCached = false; + } + beforeUpdate() { + callback(this.options.beforeUpdate, [ + this + ]); + } + update(maxWidth, maxHeight, margins) { + const { beginAtZero, grace, ticks: tickOpts } = this.options; + const sampleSize = tickOpts.sampleSize; + this.beforeUpdate(); + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this._margins = margins = Object.assign({ + left: 0, + right: 0, + top: 0, + bottom: 0 + }, margins); + this.ticks = null; + this._labelSizes = null; + this._gridLineItems = null; + this._labelItems = null; + this.beforeSetDimensions(); + this.setDimensions(); + this.afterSetDimensions(); + this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom; + if (!this._dataLimitsCached) { + this.beforeDataLimits(); + this.determineDataLimits(); + this.afterDataLimits(); + this._range = _addGrace(this, grace, beginAtZero); + this._dataLimitsCached = true; + } + this.beforeBuildTicks(); + this.ticks = this.buildTicks() || []; + this.afterBuildTicks(); + const samplingEnabled = sampleSize < this.ticks.length; + this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks); + this.configure(); + this.beforeCalculateLabelRotation(); + this.calculateLabelRotation(); + this.afterCalculateLabelRotation(); + if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === "auto")) { + this.ticks = autoSkip(this, this.ticks); + this._labelSizes = null; + this.afterAutoSkip(); + } + if (samplingEnabled) { + this._convertTicksToLabels(this.ticks); + } + this.beforeFit(); + this.fit(); + this.afterFit(); + this.afterUpdate(); + } + configure() { + let reversePixels = this.options.reverse; + let startPixel, endPixel; + if (this.isHorizontal()) { + startPixel = this.left; + endPixel = this.right; + } else { + startPixel = this.top; + endPixel = this.bottom; + reversePixels = !reversePixels; + } + this._startPixel = startPixel; + this._endPixel = endPixel; + this._reversePixels = reversePixels; + this._length = endPixel - startPixel; + this._alignToPixels = this.options.alignToPixels; + } + afterUpdate() { + callback(this.options.afterUpdate, [ + this + ]); + } + beforeSetDimensions() { + callback(this.options.beforeSetDimensions, [ + this + ]); + } + setDimensions() { + if (this.isHorizontal()) { + this.width = this.maxWidth; + this.left = 0; + this.right = this.width; + } else { + this.height = this.maxHeight; + this.top = 0; + this.bottom = this.height; + } + this.paddingLeft = 0; + this.paddingTop = 0; + this.paddingRight = 0; + this.paddingBottom = 0; + } + afterSetDimensions() { + callback(this.options.afterSetDimensions, [ + this + ]); + } + _callHooks(name) { + this.chart.notifyPlugins(name, this.getContext()); + callback(this.options[name], [ + this + ]); + } + beforeDataLimits() { + this._callHooks("beforeDataLimits"); + } + determineDataLimits() { + } + afterDataLimits() { + this._callHooks("afterDataLimits"); + } + beforeBuildTicks() { + this._callHooks("beforeBuildTicks"); + } + buildTicks() { + return []; + } + afterBuildTicks() { + this._callHooks("afterBuildTicks"); + } + beforeTickToLabelConversion() { + callback(this.options.beforeTickToLabelConversion, [ + this + ]); + } + generateTickLabels(ticks) { + const tickOpts = this.options.ticks; + let i, ilen, tick; + for (i = 0, ilen = ticks.length; i < ilen; i++) { + tick = ticks[i]; + tick.label = callback(tickOpts.callback, [ + tick.value, + i, + ticks + ], this); + } + } + afterTickToLabelConversion() { + callback(this.options.afterTickToLabelConversion, [ + this + ]); + } + beforeCalculateLabelRotation() { + callback(this.options.beforeCalculateLabelRotation, [ + this + ]); + } + calculateLabelRotation() { + const options = this.options; + const tickOpts = options.ticks; + const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit); + const minRotation = tickOpts.minRotation || 0; + const maxRotation = tickOpts.maxRotation; + let labelRotation = minRotation; + let tickWidth, maxHeight, maxLabelDiagonal; + if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) { + this.labelRotation = minRotation; + return; + } + const labelSizes = this._getLabelSizes(); + const maxLabelWidth = labelSizes.widest.width; + const maxLabelHeight = labelSizes.highest.height; + const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth); + tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1); + if (maxLabelWidth + 6 > tickWidth) { + tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1)); + maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font); + maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight); + labelRotation = toDegrees(Math.min(Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)), Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1)))); + labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation)); + } + this.labelRotation = labelRotation; + } + afterCalculateLabelRotation() { + callback(this.options.afterCalculateLabelRotation, [ + this + ]); + } + afterAutoSkip() { + } + beforeFit() { + callback(this.options.beforeFit, [ + this + ]); + } + fit() { + const minSize = { + width: 0, + height: 0 + }; + const { chart: chart2, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this; + const display2 = this._isVisible(); + const isHorizontal = this.isHorizontal(); + if (display2) { + const titleHeight = getTitleHeight(titleOpts, chart2.options.font); + if (isHorizontal) { + minSize.width = this.maxWidth; + minSize.height = getTickMarkLength(gridOpts) + titleHeight; + } else { + minSize.height = this.maxHeight; + minSize.width = getTickMarkLength(gridOpts) + titleHeight; + } + if (tickOpts.display && this.ticks.length) { + const { first, last, widest, highest } = this._getLabelSizes(); + const tickPadding = tickOpts.padding * 2; + const angleRadians = toRadians(this.labelRotation); + const cos = Math.cos(angleRadians); + const sin = Math.sin(angleRadians); + if (isHorizontal) { + const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height; + minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding); + } else { + const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height; + minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding); + } + this._calculatePadding(first, last, sin, cos); + } + } + this._handleMargins(); + if (isHorizontal) { + this.width = this._length = chart2.width - this._margins.left - this._margins.right; + this.height = minSize.height; + } else { + this.width = minSize.width; + this.height = this._length = chart2.height - this._margins.top - this._margins.bottom; + } + } + _calculatePadding(first, last, sin, cos) { + const { ticks: { align, padding }, position } = this.options; + const isRotated = this.labelRotation !== 0; + const labelsBelowTicks = position !== "top" && this.axis === "x"; + if (this.isHorizontal()) { + const offsetLeft = this.getPixelForTick(0) - this.left; + const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1); + let paddingLeft = 0; + let paddingRight = 0; + if (isRotated) { + if (labelsBelowTicks) { + paddingLeft = cos * first.width; + paddingRight = sin * last.height; + } else { + paddingLeft = sin * first.height; + paddingRight = cos * last.width; + } + } else if (align === "start") { + paddingRight = last.width; + } else if (align === "end") { + paddingLeft = first.width; + } else if (align !== "inner") { + paddingLeft = first.width / 2; + paddingRight = last.width / 2; + } + this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0); + this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0); + } else { + let paddingTop = last.height / 2; + let paddingBottom = first.height / 2; + if (align === "start") { + paddingTop = 0; + paddingBottom = first.height; + } else if (align === "end") { + paddingTop = last.height; + paddingBottom = 0; + } + this.paddingTop = paddingTop + padding; + this.paddingBottom = paddingBottom + padding; + } + } + _handleMargins() { + if (this._margins) { + this._margins.left = Math.max(this.paddingLeft, this._margins.left); + this._margins.top = Math.max(this.paddingTop, this._margins.top); + this._margins.right = Math.max(this.paddingRight, this._margins.right); + this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom); + } + } + afterFit() { + callback(this.options.afterFit, [ + this + ]); + } + isHorizontal() { + const { axis, position } = this.options; + return position === "top" || position === "bottom" || axis === "x"; + } + isFullSize() { + return this.options.fullSize; + } + _convertTicksToLabels(ticks) { + this.beforeTickToLabelConversion(); + this.generateTickLabels(ticks); + let i, ilen; + for (i = 0, ilen = ticks.length; i < ilen; i++) { + if (isNullOrUndef(ticks[i].label)) { + ticks.splice(i, 1); + ilen--; + i--; + } + } + this.afterTickToLabelConversion(); + } + _getLabelSizes() { + let labelSizes = this._labelSizes; + if (!labelSizes) { + const sampleSize = this.options.ticks.sampleSize; + let ticks = this.ticks; + if (sampleSize < ticks.length) { + ticks = sample(ticks, sampleSize); + } + this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit); + } + return labelSizes; + } + _computeLabelSizes(ticks, length, maxTicksLimit) { + const { ctx, _longestTextCache: caches } = this; + const widths = []; + const heights = []; + const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit)); + let widestLabelSize = 0; + let highestLabelSize = 0; + let i, j, jlen, label, tickFont, fontString, cache2, lineHeight, width, height, nestedLabel; + for (i = 0; i < length; i += increment) { + label = ticks[i].label; + tickFont = this._resolveTickFontOptions(i); + ctx.font = fontString = tickFont.string; + cache2 = caches[fontString] = caches[fontString] || { + data: {}, + gc: [] + }; + lineHeight = tickFont.lineHeight; + width = height = 0; + if (!isNullOrUndef(label) && !isArray(label)) { + width = _measureText(ctx, cache2.data, cache2.gc, width, label); + height = lineHeight; + } else if (isArray(label)) { + for (j = 0, jlen = label.length; j < jlen; ++j) { + nestedLabel = label[j]; + if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) { + width = _measureText(ctx, cache2.data, cache2.gc, width, nestedLabel); + height += lineHeight; + } + } + } + widths.push(width); + heights.push(height); + widestLabelSize = Math.max(width, widestLabelSize); + highestLabelSize = Math.max(height, highestLabelSize); + } + garbageCollect(caches, length); + const widest = widths.indexOf(widestLabelSize); + const highest = heights.indexOf(highestLabelSize); + const valueAt = (idx) => ({ + width: widths[idx] || 0, + height: heights[idx] || 0 + }); + return { + first: valueAt(0), + last: valueAt(length - 1), + widest: valueAt(widest), + highest: valueAt(highest), + widths, + heights + }; + } + getLabelForValue(value) { + return value; + } + getPixelForValue(value, index2) { + return NaN; + } + getValueForPixel(pixel) { + } + getPixelForTick(index2) { + const ticks = this.ticks; + if (index2 < 0 || index2 > ticks.length - 1) { + return null; + } + return this.getPixelForValue(ticks[index2].value); + } + getPixelForDecimal(decimal) { + if (this._reversePixels) { + decimal = 1 - decimal; + } + const pixel = this._startPixel + decimal * this._length; + return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel); + } + getDecimalForPixel(pixel) { + const decimal = (pixel - this._startPixel) / this._length; + return this._reversePixels ? 1 - decimal : decimal; + } + getBasePixel() { + return this.getPixelForValue(this.getBaseValue()); + } + getBaseValue() { + const { min, max } = this; + return min < 0 && max < 0 ? max : min > 0 && max > 0 ? min : 0; + } + getContext(index2) { + const ticks = this.ticks || []; + if (index2 >= 0 && index2 < ticks.length) { + const tick = ticks[index2]; + return tick.$context || (tick.$context = createTickContext(this.getContext(), index2, tick)); + } + return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this)); + } + _tickSize() { + const optionTicks = this.options.ticks; + const rot = toRadians(this.labelRotation); + const cos = Math.abs(Math.cos(rot)); + const sin = Math.abs(Math.sin(rot)); + const labelSizes = this._getLabelSizes(); + const padding = optionTicks.autoSkipPadding || 0; + const w = labelSizes ? labelSizes.widest.width + padding : 0; + const h = labelSizes ? labelSizes.highest.height + padding : 0; + return this.isHorizontal() ? h * cos > w * sin ? w / cos : h / sin : h * sin < w * cos ? h / cos : w / sin; + } + _isVisible() { + const display2 = this.options.display; + if (display2 !== "auto") { + return !!display2; + } + return this.getMatchingVisibleMetas().length > 0; + } + _computeGridLineItems(chartArea) { + const axis = this.axis; + const chart2 = this.chart; + const options = this.options; + const { grid, position, border } = options; + const offset = grid.offset; + const isHorizontal = this.isHorizontal(); + const ticks = this.ticks; + const ticksLength = ticks.length + (offset ? 1 : 0); + const tl = getTickMarkLength(grid); + const items = []; + const borderOpts = border.setContext(this.getContext()); + const axisWidth = borderOpts.display ? borderOpts.width : 0; + const axisHalfWidth = axisWidth / 2; + const alignBorderValue = function(pixel) { + return _alignPixel(chart2, pixel, axisWidth); + }; + let borderValue, i, lineValue, alignedLineValue; + let tx1, ty1, tx2, ty2, x1, y1, x2, y2; + if (position === "top") { + borderValue = alignBorderValue(this.bottom); + ty1 = this.bottom - tl; + ty2 = borderValue - axisHalfWidth; + y1 = alignBorderValue(chartArea.top) + axisHalfWidth; + y2 = chartArea.bottom; + } else if (position === "bottom") { + borderValue = alignBorderValue(this.top); + y1 = chartArea.top; + y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth; + ty1 = borderValue + axisHalfWidth; + ty2 = this.top + tl; + } else if (position === "left") { + borderValue = alignBorderValue(this.right); + tx1 = this.right - tl; + tx2 = borderValue - axisHalfWidth; + x1 = alignBorderValue(chartArea.left) + axisHalfWidth; + x2 = chartArea.right; + } else if (position === "right") { + borderValue = alignBorderValue(this.left); + x1 = chartArea.left; + x2 = alignBorderValue(chartArea.right) - axisHalfWidth; + tx1 = borderValue + axisHalfWidth; + tx2 = this.left + tl; + } else if (axis === "x") { + if (position === "center") { + borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5); + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value)); + } + y1 = chartArea.top; + y2 = chartArea.bottom; + ty1 = borderValue + axisHalfWidth; + ty2 = ty1 + tl; + } else if (axis === "y") { + if (position === "center") { + borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2); + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value)); + } + tx1 = borderValue - axisHalfWidth; + tx2 = tx1 - tl; + x1 = chartArea.left; + x2 = chartArea.right; + } + const limit2 = valueOrDefault(options.ticks.maxTicksLimit, ticksLength); + const step = Math.max(1, Math.ceil(ticksLength / limit2)); + for (i = 0; i < ticksLength; i += step) { + const context = this.getContext(i); + const optsAtIndex = grid.setContext(context); + const optsAtIndexBorder = border.setContext(context); + const lineWidth = optsAtIndex.lineWidth; + const lineColor = optsAtIndex.color; + const borderDash = optsAtIndexBorder.dash || []; + const borderDashOffset = optsAtIndexBorder.dashOffset; + const tickWidth = optsAtIndex.tickWidth; + const tickColor = optsAtIndex.tickColor; + const tickBorderDash = optsAtIndex.tickBorderDash || []; + const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset; + lineValue = getPixelForGridLine(this, i, offset); + if (lineValue === void 0) { + continue; + } + alignedLineValue = _alignPixel(chart2, lineValue, lineWidth); + if (isHorizontal) { + tx1 = tx2 = x1 = x2 = alignedLineValue; + } else { + ty1 = ty2 = y1 = y2 = alignedLineValue; + } + items.push({ + tx1, + ty1, + tx2, + ty2, + x1, + y1, + x2, + y2, + width: lineWidth, + color: lineColor, + borderDash, + borderDashOffset, + tickWidth, + tickColor, + tickBorderDash, + tickBorderDashOffset + }); + } + this._ticksLength = ticksLength; + this._borderValue = borderValue; + return items; + } + _computeLabelItems(chartArea) { + const axis = this.axis; + const options = this.options; + const { position, ticks: optionTicks } = options; + const isHorizontal = this.isHorizontal(); + const ticks = this.ticks; + const { align, crossAlign, padding, mirror } = optionTicks; + const tl = getTickMarkLength(options.grid); + const tickAndPadding = tl + padding; + const hTickAndPadding = mirror ? -padding : tickAndPadding; + const rotation = -toRadians(this.labelRotation); + const items = []; + let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset; + let textBaseline = "middle"; + if (position === "top") { + y = this.bottom - hTickAndPadding; + textAlign = this._getXAxisLabelAlignment(); + } else if (position === "bottom") { + y = this.top + hTickAndPadding; + textAlign = this._getXAxisLabelAlignment(); + } else if (position === "left") { + const ret = this._getYAxisLabelAlignment(tl); + textAlign = ret.textAlign; + x = ret.x; + } else if (position === "right") { + const ret = this._getYAxisLabelAlignment(tl); + textAlign = ret.textAlign; + x = ret.x; + } else if (axis === "x") { + if (position === "center") { + y = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding; + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding; + } + textAlign = this._getXAxisLabelAlignment(); + } else if (axis === "y") { + if (position === "center") { + x = (chartArea.left + chartArea.right) / 2 - tickAndPadding; + } else if (isObject(position)) { + const positionAxisID = Object.keys(position)[0]; + const value = position[positionAxisID]; + x = this.chart.scales[positionAxisID].getPixelForValue(value); + } + textAlign = this._getYAxisLabelAlignment(tl).textAlign; + } + if (axis === "y") { + if (align === "start") { + textBaseline = "top"; + } else if (align === "end") { + textBaseline = "bottom"; + } + } + const labelSizes = this._getLabelSizes(); + for (i = 0, ilen = ticks.length; i < ilen; ++i) { + tick = ticks[i]; + label = tick.label; + const optsAtIndex = optionTicks.setContext(this.getContext(i)); + pixel = this.getPixelForTick(i) + optionTicks.labelOffset; + font = this._resolveTickFontOptions(i); + lineHeight = font.lineHeight; + lineCount = isArray(label) ? label.length : 1; + const halfCount = lineCount / 2; + const color2 = optsAtIndex.color; + const strokeColor = optsAtIndex.textStrokeColor; + const strokeWidth = optsAtIndex.textStrokeWidth; + let tickTextAlign = textAlign; + if (isHorizontal) { + x = pixel; + if (textAlign === "inner") { + if (i === ilen - 1) { + tickTextAlign = !this.options.reverse ? "right" : "left"; + } else if (i === 0) { + tickTextAlign = !this.options.reverse ? "left" : "right"; + } else { + tickTextAlign = "center"; + } + } + if (position === "top") { + if (crossAlign === "near" || rotation !== 0) { + textOffset = -lineCount * lineHeight + lineHeight / 2; + } else if (crossAlign === "center") { + textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight; + } else { + textOffset = -labelSizes.highest.height + lineHeight / 2; + } + } else { + if (crossAlign === "near" || rotation !== 0) { + textOffset = lineHeight / 2; + } else if (crossAlign === "center") { + textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight; + } else { + textOffset = labelSizes.highest.height - lineCount * lineHeight; + } + } + if (mirror) { + textOffset *= -1; + } + if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) { + x += lineHeight / 2 * Math.sin(rotation); + } + } else { + y = pixel; + textOffset = (1 - lineCount) * lineHeight / 2; + } + let backdrop; + if (optsAtIndex.showLabelBackdrop) { + const labelPadding = toPadding(optsAtIndex.backdropPadding); + const height = labelSizes.heights[i]; + const width = labelSizes.widths[i]; + let top = textOffset - labelPadding.top; + let left = 0 - labelPadding.left; + switch (textBaseline) { + case "middle": + top -= height / 2; + break; + case "bottom": + top -= height; + break; + } + switch (textAlign) { + case "center": + left -= width / 2; + break; + case "right": + left -= width; + break; + case "inner": + if (i === ilen - 1) { + left -= width; + } else if (i > 0) { + left -= width / 2; + } + break; + } + backdrop = { + left, + top, + width: width + labelPadding.width, + height: height + labelPadding.height, + color: optsAtIndex.backdropColor + }; + } + items.push({ + label, + font, + textOffset, + options: { + rotation, + color: color2, + strokeColor, + strokeWidth, + textAlign: tickTextAlign, + textBaseline, + translation: [ + x, + y + ], + backdrop + } + }); + } + return items; + } + _getXAxisLabelAlignment() { + const { position, ticks } = this.options; + const rotation = -toRadians(this.labelRotation); + if (rotation) { + return position === "top" ? "left" : "right"; + } + let align = "center"; + if (ticks.align === "start") { + align = "left"; + } else if (ticks.align === "end") { + align = "right"; + } else if (ticks.align === "inner") { + align = "inner"; + } + return align; + } + _getYAxisLabelAlignment(tl) { + const { position, ticks: { crossAlign, mirror, padding } } = this.options; + const labelSizes = this._getLabelSizes(); + const tickAndPadding = tl + padding; + const widest = labelSizes.widest.width; + let textAlign; + let x; + if (position === "left") { + if (mirror) { + x = this.right + padding; + if (crossAlign === "near") { + textAlign = "left"; + } else if (crossAlign === "center") { + textAlign = "center"; + x += widest / 2; + } else { + textAlign = "right"; + x += widest; + } + } else { + x = this.right - tickAndPadding; + if (crossAlign === "near") { + textAlign = "right"; + } else if (crossAlign === "center") { + textAlign = "center"; + x -= widest / 2; + } else { + textAlign = "left"; + x = this.left; + } + } + } else if (position === "right") { + if (mirror) { + x = this.left + padding; + if (crossAlign === "near") { + textAlign = "right"; + } else if (crossAlign === "center") { + textAlign = "center"; + x -= widest / 2; + } else { + textAlign = "left"; + x -= widest; + } + } else { + x = this.left + tickAndPadding; + if (crossAlign === "near") { + textAlign = "left"; + } else if (crossAlign === "center") { + textAlign = "center"; + x += widest / 2; + } else { + textAlign = "right"; + x = this.right; + } + } + } else { + textAlign = "right"; + } + return { + textAlign, + x + }; + } + _computeLabelArea() { + if (this.options.ticks.mirror) { + return; + } + const chart2 = this.chart; + const position = this.options.position; + if (position === "left" || position === "right") { + return { + top: 0, + left: this.left, + bottom: chart2.height, + right: this.right + }; + } + if (position === "top" || position === "bottom") { + return { + top: this.top, + left: 0, + bottom: this.bottom, + right: chart2.width + }; + } + } + drawBackground() { + const { ctx, options: { backgroundColor }, left, top, width, height } = this; + if (backgroundColor) { + ctx.save(); + ctx.fillStyle = backgroundColor; + ctx.fillRect(left, top, width, height); + ctx.restore(); + } + } + getLineWidthForValue(value) { + const grid = this.options.grid; + if (!this._isVisible() || !grid.display) { + return 0; + } + const ticks = this.ticks; + const index2 = ticks.findIndex((t) => t.value === value); + if (index2 >= 0) { + const opts = grid.setContext(this.getContext(index2)); + return opts.lineWidth; + } + return 0; + } + drawGrid(chartArea) { + const grid = this.options.grid; + const ctx = this.ctx; + const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea)); + let i, ilen; + const drawLine = (p1, p2, style) => { + if (!style.width || !style.color) { + return; + } + ctx.save(); + ctx.lineWidth = style.width; + ctx.strokeStyle = style.color; + ctx.setLineDash(style.borderDash || []); + ctx.lineDashOffset = style.borderDashOffset; + ctx.beginPath(); + ctx.moveTo(p1.x, p1.y); + ctx.lineTo(p2.x, p2.y); + ctx.stroke(); + ctx.restore(); + }; + if (grid.display) { + for (i = 0, ilen = items.length; i < ilen; ++i) { + const item = items[i]; + if (grid.drawOnChartArea) { + drawLine({ + x: item.x1, + y: item.y1 + }, { + x: item.x2, + y: item.y2 + }, item); + } + if (grid.drawTicks) { + drawLine({ + x: item.tx1, + y: item.ty1 + }, { + x: item.tx2, + y: item.ty2 + }, { + color: item.tickColor, + width: item.tickWidth, + borderDash: item.tickBorderDash, + borderDashOffset: item.tickBorderDashOffset + }); + } + } + } + } + drawBorder() { + const { chart: chart2, ctx, options: { border, grid } } = this; + const borderOpts = border.setContext(this.getContext()); + const axisWidth = border.display ? borderOpts.width : 0; + if (!axisWidth) { + return; + } + const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth; + const borderValue = this._borderValue; + let x1, x2, y1, y2; + if (this.isHorizontal()) { + x1 = _alignPixel(chart2, this.left, axisWidth) - axisWidth / 2; + x2 = _alignPixel(chart2, this.right, lastLineWidth) + lastLineWidth / 2; + y1 = y2 = borderValue; + } else { + y1 = _alignPixel(chart2, this.top, axisWidth) - axisWidth / 2; + y2 = _alignPixel(chart2, this.bottom, lastLineWidth) + lastLineWidth / 2; + x1 = x2 = borderValue; + } + ctx.save(); + ctx.lineWidth = borderOpts.width; + ctx.strokeStyle = borderOpts.color; + ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + ctx.restore(); + } + drawLabels(chartArea) { + const optionTicks = this.options.ticks; + if (!optionTicks.display) { + return; + } + const ctx = this.ctx; + const area = this._computeLabelArea(); + if (area) { + clipArea(ctx, area); + } + const items = this.getLabelItems(chartArea); + for (const item of items) { + const renderTextOptions = item.options; + const tickFont = item.font; + const label = item.label; + const y = item.textOffset; + renderText(ctx, label, 0, y, tickFont, renderTextOptions); + } + if (area) { + unclipArea(ctx); + } + } + drawTitle() { + const { ctx, options: { position, title, reverse } } = this; + if (!title.display) { + return; + } + const font = toFont(title.font); + const padding = toPadding(title.padding); + const align = title.align; + let offset = font.lineHeight / 2; + if (position === "bottom" || position === "center" || isObject(position)) { + offset += padding.bottom; + if (isArray(title.text)) { + offset += font.lineHeight * (title.text.length - 1); + } + } else { + offset += padding.top; + } + const { titleX, titleY, maxWidth, rotation } = titleArgs(this, offset, position, align); + renderText(ctx, title.text, 0, 0, font, { + color: title.color, + maxWidth, + rotation, + textAlign: titleAlign(align, position, reverse), + textBaseline: "middle", + translation: [ + titleX, + titleY + ] + }); + } + draw(chartArea) { + if (!this._isVisible()) { + return; + } + this.drawBackground(); + this.drawGrid(chartArea); + this.drawBorder(); + this.drawTitle(); + this.drawLabels(chartArea); + } + _layers() { + const opts = this.options; + const tz = opts.ticks && opts.ticks.z || 0; + const gz = valueOrDefault(opts.grid && opts.grid.z, -1); + const bz = valueOrDefault(opts.border && opts.border.z, 0); + if (!this._isVisible() || this.draw !== _Scale.prototype.draw) { + return [ + { + z: tz, + draw: (chartArea) => { + this.draw(chartArea); + } + } + ]; + } + return [ + { + z: gz, + draw: (chartArea) => { + this.drawBackground(); + this.drawGrid(chartArea); + this.drawTitle(); + } + }, + { + z: bz, + draw: () => { + this.drawBorder(); + } + }, + { + z: tz, + draw: (chartArea) => { + this.drawLabels(chartArea); + } + } + ]; + } + getMatchingVisibleMetas(type) { + const metas = this.chart.getSortedVisibleDatasetMetas(); + const axisID = this.axis + "AxisID"; + const result = []; + let i, ilen; + for (i = 0, ilen = metas.length; i < ilen; ++i) { + const meta = metas[i]; + if (meta[axisID] === this.id && (!type || meta.type === type)) { + result.push(meta); + } + } + return result; + } + _resolveTickFontOptions(index2) { + const opts = this.options.ticks.setContext(this.getContext(index2)); + return toFont(opts.font); + } + _maxDigits() { + const fontSize = this._resolveTickFontOptions(0).lineHeight; + return (this.isHorizontal() ? this.width : this.height) / fontSize; + } + }; + TypedRegistry = class { + constructor(type, scope, override) { + this.type = type; + this.scope = scope; + this.override = override; + this.items = /* @__PURE__ */ Object.create(null); + } + isForType(type) { + return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype); + } + register(item) { + const proto = Object.getPrototypeOf(item); + let parentScope; + if (isIChartComponent(proto)) { + parentScope = this.register(proto); + } + const items = this.items; + const id = item.id; + const scope = this.scope + "." + id; + if (!id) { + throw new Error("class does not have id: " + item); + } + if (id in items) { + return scope; + } + items[id] = item; + registerDefaults(item, scope, parentScope); + if (this.override) { + defaults.override(item.id, item.overrides); + } + return scope; + } + get(id) { + return this.items[id]; + } + unregister(item) { + const items = this.items; + const id = item.id; + const scope = this.scope; + if (id in items) { + delete items[id]; + } + if (scope && id in defaults[scope]) { + delete defaults[scope][id]; + if (this.override) { + delete overrides[id]; + } + } + } + }; + Registry = class { + constructor() { + this.controllers = new TypedRegistry(DatasetController, "datasets", true); + this.elements = new TypedRegistry(Element2, "elements"); + this.plugins = new TypedRegistry(Object, "plugins"); + this.scales = new TypedRegistry(Scale, "scales"); + this._typedRegistries = [ + this.controllers, + this.scales, + this.elements + ]; + } + add(...args) { + this._each("register", args); + } + remove(...args) { + this._each("unregister", args); + } + addControllers(...args) { + this._each("register", args, this.controllers); + } + addElements(...args) { + this._each("register", args, this.elements); + } + addPlugins(...args) { + this._each("register", args, this.plugins); + } + addScales(...args) { + this._each("register", args, this.scales); + } + getController(id) { + return this._get(id, this.controllers, "controller"); + } + getElement(id) { + return this._get(id, this.elements, "element"); + } + getPlugin(id) { + return this._get(id, this.plugins, "plugin"); + } + getScale(id) { + return this._get(id, this.scales, "scale"); + } + removeControllers(...args) { + this._each("unregister", args, this.controllers); + } + removeElements(...args) { + this._each("unregister", args, this.elements); + } + removePlugins(...args) { + this._each("unregister", args, this.plugins); + } + removeScales(...args) { + this._each("unregister", args, this.scales); + } + _each(method, args, typedRegistry) { + [ + ...args + ].forEach((arg) => { + const reg = typedRegistry || this._getRegistryForType(arg); + if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) { + this._exec(method, reg, arg); + } else { + each(arg, (item) => { + const itemReg = typedRegistry || this._getRegistryForType(item); + this._exec(method, itemReg, item); + }); + } + }); + } + _exec(method, registry2, component) { + const camelMethod = _capitalize(method); + callback(component["before" + camelMethod], [], component); + registry2[method](component); + callback(component["after" + camelMethod], [], component); + } + _getRegistryForType(type) { + for (let i = 0; i < this._typedRegistries.length; i++) { + const reg = this._typedRegistries[i]; + if (reg.isForType(type)) { + return reg; + } + } + return this.plugins; + } + _get(id, typedRegistry, type) { + const item = typedRegistry.get(id); + if (item === void 0) { + throw new Error('"' + id + '" is not a registered ' + type + "."); + } + return item; + } + }; + registry = /* @__PURE__ */ new Registry(); + PluginService = class { + constructor() { + this._init = void 0; + } + notify(chart2, hook, args, filter) { + if (hook === "beforeInit") { + this._init = this._createDescriptors(chart2, true); + this._notify(this._init, chart2, "install"); + } + if (this._init === void 0) { + return; + } + const descriptors2 = filter ? this._descriptors(chart2).filter(filter) : this._descriptors(chart2); + const result = this._notify(descriptors2, chart2, hook, args); + if (hook === "afterDestroy") { + this._notify(descriptors2, chart2, "stop"); + this._notify(this._init, chart2, "uninstall"); + this._init = void 0; + } + return result; + } + _notify(descriptors2, chart2, hook, args) { + args = args || {}; + for (const descriptor of descriptors2) { + const plugin = descriptor.plugin; + const method = plugin[hook]; + const params = [ + chart2, + args, + descriptor.options + ]; + if (callback(method, params, plugin) === false && args.cancelable) { + return false; + } + } + return true; + } + invalidate() { + if (!isNullOrUndef(this._cache)) { + this._oldCache = this._cache; + this._cache = void 0; + } + } + _descriptors(chart2) { + if (this._cache) { + return this._cache; + } + const descriptors2 = this._cache = this._createDescriptors(chart2); + this._notifyStateChanges(chart2); + return descriptors2; + } + _createDescriptors(chart2, all2) { + const config = chart2 && chart2.config; + const options = valueOrDefault(config.options && config.options.plugins, {}); + const plugins2 = allPlugins(config); + return options === false && !all2 ? [] : createDescriptors(chart2, plugins2, options, all2); + } + _notifyStateChanges(chart2) { + const previousDescriptors = this._oldCache || []; + const descriptors2 = this._cache; + const diff = (a, b) => a.filter((x) => !b.some((y) => x.plugin.id === y.plugin.id)); + this._notify(diff(previousDescriptors, descriptors2), chart2, "stop"); + this._notify(diff(descriptors2, previousDescriptors), chart2, "start"); + } + }; + keyCache = /* @__PURE__ */ new Map(); + keysCached = /* @__PURE__ */ new Set(); + addIfFound = (set2, obj, key) => { + const opts = resolveObjectKey(obj, key); + if (opts !== void 0) { + set2.add(opts); + } + }; + Config = class { + constructor(config) { + this._config = initConfig(config); + this._scopeCache = /* @__PURE__ */ new Map(); + this._resolverCache = /* @__PURE__ */ new Map(); + } + get platform() { + return this._config.platform; + } + get type() { + return this._config.type; + } + set type(type) { + this._config.type = type; + } + get data() { + return this._config.data; + } + set data(data) { + this._config.data = initData(data); + } + get options() { + return this._config.options; + } + set options(options) { + this._config.options = options; + } + get plugins() { + return this._config.plugins; + } + update() { + const config = this._config; + this.clearCache(); + initOptions(config); + } + clearCache() { + this._scopeCache.clear(); + this._resolverCache.clear(); + } + datasetScopeKeys(datasetType) { + return cachedKeys(datasetType, () => [ + [ + `datasets.${datasetType}`, + "" + ] + ]); + } + datasetAnimationScopeKeys(datasetType, transition) { + return cachedKeys(`${datasetType}.transition.${transition}`, () => [ + [ + `datasets.${datasetType}.transitions.${transition}`, + `transitions.${transition}` + ], + [ + `datasets.${datasetType}`, + "" + ] + ]); + } + datasetElementScopeKeys(datasetType, elementType) { + return cachedKeys(`${datasetType}-${elementType}`, () => [ + [ + `datasets.${datasetType}.elements.${elementType}`, + `datasets.${datasetType}`, + `elements.${elementType}`, + "" + ] + ]); + } + pluginScopeKeys(plugin) { + const id = plugin.id; + const type = this.type; + return cachedKeys(`${type}-plugin-${id}`, () => [ + [ + `plugins.${id}`, + ...plugin.additionalOptionScopes || [] + ] + ]); + } + _cachedScopes(mainScope, resetCache) { + const _scopeCache = this._scopeCache; + let cache2 = _scopeCache.get(mainScope); + if (!cache2 || resetCache) { + cache2 = /* @__PURE__ */ new Map(); + _scopeCache.set(mainScope, cache2); + } + return cache2; + } + getOptionScopes(mainScope, keyLists, resetCache) { + const { options, type } = this; + const cache2 = this._cachedScopes(mainScope, resetCache); + const cached = cache2.get(keyLists); + if (cached) { + return cached; + } + const scopes = /* @__PURE__ */ new Set(); + keyLists.forEach((keys) => { + if (mainScope) { + scopes.add(mainScope); + keys.forEach((key) => addIfFound(scopes, mainScope, key)); + } + keys.forEach((key) => addIfFound(scopes, options, key)); + keys.forEach((key) => addIfFound(scopes, overrides[type] || {}, key)); + keys.forEach((key) => addIfFound(scopes, defaults, key)); + keys.forEach((key) => addIfFound(scopes, descriptors, key)); + }); + const array = Array.from(scopes); + if (array.length === 0) { + array.push(/* @__PURE__ */ Object.create(null)); + } + if (keysCached.has(keyLists)) { + cache2.set(keyLists, array); + } + return array; + } + chartOptionScopes() { + const { options, type } = this; + return [ + options, + overrides[type] || {}, + defaults.datasets[type] || {}, + { + type + }, + defaults, + descriptors + ]; + } + resolveNamedOptions(scopes, names2, context, prefixes = [ + "" + ]) { + const result = { + $shared: true + }; + const { resolver, subPrefixes } = getResolver(this._resolverCache, scopes, prefixes); + let options = resolver; + if (needContext(resolver, names2)) { + result.$shared = false; + context = isFunction(context) ? context() : context; + const subResolver = this.createResolver(scopes, context, subPrefixes); + options = _attachContext(resolver, context, subResolver); + } + for (const prop of names2) { + result[prop] = options[prop]; + } + return result; + } + createResolver(scopes, context, prefixes = [ + "" + ], descriptorDefaults) { + const { resolver } = getResolver(this._resolverCache, scopes, prefixes); + return isObject(context) ? _attachContext(resolver, context, void 0, descriptorDefaults) : resolver; + } + }; + hasFunction = (value) => isObject(value) && Object.getOwnPropertyNames(value).some((key) => isFunction(value[key])); + version = "4.5.1"; + KNOWN_POSITIONS = [ + "top", + "bottom", + "left", + "right", + "chartArea" + ]; + instances = {}; + getChart = (key) => { + const canvas = getCanvas(key); + return Object.values(instances).filter((c) => c.canvas === canvas).pop(); + }; + Chart = class { + static register(...items) { + registry.add(...items); + invalidatePlugins(); + } + static unregister(...items) { + registry.remove(...items); + invalidatePlugins(); + } + constructor(item, userConfig) { + const config = this.config = new Config(userConfig); + const initialCanvas = getCanvas(item); + const existingChart = getChart(initialCanvas); + if (existingChart) { + throw new Error("Canvas is already in use. Chart with ID '" + existingChart.id + "' must be destroyed before the canvas with ID '" + existingChart.canvas.id + "' can be reused."); + } + const options = config.createResolver(config.chartOptionScopes(), this.getContext()); + this.platform = new (config.platform || _detectPlatform(initialCanvas))(); + this.platform.updateConfig(config); + const context = this.platform.acquireContext(initialCanvas, options.aspectRatio); + const canvas = context && context.canvas; + const height = canvas && canvas.height; + const width = canvas && canvas.width; + this.id = uid(); + this.ctx = context; + this.canvas = canvas; + this.width = width; + this.height = height; + this._options = options; + this._aspectRatio = this.aspectRatio; + this._layers = []; + this._metasets = []; + this._stacks = void 0; + this.boxes = []; + this.currentDevicePixelRatio = void 0; + this.chartArea = void 0; + this._active = []; + this._lastEvent = void 0; + this._listeners = {}; + this._responsiveListeners = void 0; + this._sortedMetasets = []; + this.scales = {}; + this._plugins = new PluginService(); + this.$proxies = {}; + this._hiddenIndices = {}; + this.attached = false; + this._animationsDisabled = void 0; + this.$context = void 0; + this._doResize = debounce((mode) => this.update(mode), options.resizeDelay || 0); + this._dataChanges = []; + instances[this.id] = this; + if (!context || !canvas) { + console.error("Failed to create chart: can't acquire context from the given item"); + return; + } + animator.listen(this, "complete", onAnimationsComplete); + animator.listen(this, "progress", onAnimationProgress); + this._initialize(); + if (this.attached) { + this.update(); + } + } + get aspectRatio() { + const { options: { aspectRatio, maintainAspectRatio }, width, height, _aspectRatio } = this; + if (!isNullOrUndef(aspectRatio)) { + return aspectRatio; + } + if (maintainAspectRatio && _aspectRatio) { + return _aspectRatio; + } + return height ? width / height : null; + } + get data() { + return this.config.data; + } + set data(data) { + this.config.data = data; + } + get options() { + return this._options; + } + set options(options) { + this.config.options = options; + } + get registry() { + return registry; + } + _initialize() { + this.notifyPlugins("beforeInit"); + if (this.options.responsive) { + this.resize(); + } else { + retinaScale(this, this.options.devicePixelRatio); + } + this.bindEvents(); + this.notifyPlugins("afterInit"); + return this; + } + clear() { + clearCanvas(this.canvas, this.ctx); + return this; + } + stop() { + animator.stop(this); + return this; + } + resize(width, height) { + if (!animator.running(this)) { + this._resize(width, height); + } else { + this._resizeBeforeDraw = { + width, + height + }; + } + } + _resize(width, height) { + const options = this.options; + const canvas = this.canvas; + const aspectRatio = options.maintainAspectRatio && this.aspectRatio; + const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio); + const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio(); + const mode = this.width ? "resize" : "attach"; + this.width = newSize.width; + this.height = newSize.height; + this._aspectRatio = this.aspectRatio; + if (!retinaScale(this, newRatio, true)) { + return; + } + this.notifyPlugins("resize", { + size: newSize + }); + callback(options.onResize, [ + this, + newSize + ], this); + if (this.attached) { + if (this._doResize(mode)) { + this.render(); + } + } + } + ensureScalesHaveIDs() { + const options = this.options; + const scalesOptions = options.scales || {}; + each(scalesOptions, (axisOptions, axisID) => { + axisOptions.id = axisID; + }); + } + buildOrUpdateScales() { + const options = this.options; + const scaleOpts = options.scales; + const scales2 = this.scales; + const updated = Object.keys(scales2).reduce((obj, id) => { + obj[id] = false; + return obj; + }, {}); + let items = []; + if (scaleOpts) { + items = items.concat(Object.keys(scaleOpts).map((id) => { + const scaleOptions = scaleOpts[id]; + const axis = determineAxis(id, scaleOptions); + const isRadial = axis === "r"; + const isHorizontal = axis === "x"; + return { + options: scaleOptions, + dposition: isRadial ? "chartArea" : isHorizontal ? "bottom" : "left", + dtype: isRadial ? "radialLinear" : isHorizontal ? "category" : "linear" + }; + })); + } + each(items, (item) => { + const scaleOptions = item.options; + const id = scaleOptions.id; + const axis = determineAxis(id, scaleOptions); + const scaleType = valueOrDefault(scaleOptions.type, item.dtype); + if (scaleOptions.position === void 0 || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) { + scaleOptions.position = item.dposition; + } + updated[id] = true; + let scale = null; + if (id in scales2 && scales2[id].type === scaleType) { + scale = scales2[id]; + } else { + const scaleClass = registry.getScale(scaleType); + scale = new scaleClass({ + id, + type: scaleType, + ctx: this.ctx, + chart: this + }); + scales2[scale.id] = scale; + } + scale.init(scaleOptions, options); + }); + each(updated, (hasUpdated, id) => { + if (!hasUpdated) { + delete scales2[id]; + } + }); + each(scales2, (scale) => { + layouts.configure(this, scale, scale.options); + layouts.addBox(this, scale); + }); + } + _updateMetasets() { + const metasets = this._metasets; + const numData = this.data.datasets.length; + const numMeta = metasets.length; + metasets.sort((a, b) => a.index - b.index); + if (numMeta > numData) { + for (let i = numData; i < numMeta; ++i) { + this._destroyDatasetMeta(i); + } + metasets.splice(numData, numMeta - numData); + } + this._sortedMetasets = metasets.slice(0).sort(compare2Level("order", "index")); + } + _removeUnreferencedMetasets() { + const { _metasets: metasets, data: { datasets } } = this; + if (metasets.length > datasets.length) { + delete this._stacks; + } + metasets.forEach((meta, index2) => { + if (datasets.filter((x) => x === meta._dataset).length === 0) { + this._destroyDatasetMeta(index2); + } + }); + } + buildOrUpdateControllers() { + const newControllers = []; + const datasets = this.data.datasets; + let i, ilen; + this._removeUnreferencedMetasets(); + for (i = 0, ilen = datasets.length; i < ilen; i++) { + const dataset = datasets[i]; + let meta = this.getDatasetMeta(i); + const type = dataset.type || this.config.type; + if (meta.type && meta.type !== type) { + this._destroyDatasetMeta(i); + meta = this.getDatasetMeta(i); + } + meta.type = type; + meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options); + meta.order = dataset.order || 0; + meta.index = i; + meta.label = "" + dataset.label; + meta.visible = this.isDatasetVisible(i); + if (meta.controller) { + meta.controller.updateIndex(i); + meta.controller.linkScales(); + } else { + const ControllerClass = registry.getController(type); + const { datasetElementType, dataElementType } = defaults.datasets[type]; + Object.assign(ControllerClass, { + dataElementType: registry.getElement(dataElementType), + datasetElementType: datasetElementType && registry.getElement(datasetElementType) + }); + meta.controller = new ControllerClass(this, i); + newControllers.push(meta.controller); + } + } + this._updateMetasets(); + return newControllers; + } + _resetElements() { + each(this.data.datasets, (dataset, datasetIndex) => { + this.getDatasetMeta(datasetIndex).controller.reset(); + }, this); + } + reset() { + this._resetElements(); + this.notifyPlugins("reset"); + } + update(mode) { + const config = this.config; + config.update(); + const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext()); + const animsDisabled = this._animationsDisabled = !options.animation; + this._updateScales(); + this._checkEventBindings(); + this._updateHiddenIndices(); + this._plugins.invalidate(); + if (this.notifyPlugins("beforeUpdate", { + mode, + cancelable: true + }) === false) { + return; + } + const newControllers = this.buildOrUpdateControllers(); + this.notifyPlugins("beforeElementsUpdate"); + let minPadding = 0; + for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) { + const { controller } = this.getDatasetMeta(i); + const reset = !animsDisabled && newControllers.indexOf(controller) === -1; + controller.buildOrUpdateElements(reset); + minPadding = Math.max(+controller.getMaxOverflow(), minPadding); + } + minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0; + this._updateLayout(minPadding); + if (!animsDisabled) { + each(newControllers, (controller) => { + controller.reset(); + }); + } + this._updateDatasets(mode); + this.notifyPlugins("afterUpdate", { + mode + }); + this._layers.sort(compare2Level("z", "_idx")); + const { _active, _lastEvent } = this; + if (_lastEvent) { + this._eventHandler(_lastEvent, true); + } else if (_active.length) { + this._updateHoverStyles(_active, _active, true); + } + this.render(); + } + _updateScales() { + each(this.scales, (scale) => { + layouts.removeBox(this, scale); + }); + this.ensureScalesHaveIDs(); + this.buildOrUpdateScales(); + } + _checkEventBindings() { + const options = this.options; + const existingEvents = new Set(Object.keys(this._listeners)); + const newEvents = new Set(options.events); + if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) { + this.unbindEvents(); + this.bindEvents(); + } + } + _updateHiddenIndices() { + const { _hiddenIndices } = this; + const changes = this._getUniformDataChanges() || []; + for (const { method, start, count } of changes) { + const move = method === "_removeElements" ? -count : count; + moveNumericKeys(_hiddenIndices, start, move); + } + } + _getUniformDataChanges() { + const _dataChanges = this._dataChanges; + if (!_dataChanges || !_dataChanges.length) { + return; + } + this._dataChanges = []; + const datasetCount = this.data.datasets.length; + const makeSet = (idx) => new Set(_dataChanges.filter((c) => c[0] === idx).map((c, i) => i + "," + c.splice(1).join(","))); + const changeSet = makeSet(0); + for (let i = 1; i < datasetCount; i++) { + if (!setsEqual(changeSet, makeSet(i))) { + return; + } + } + return Array.from(changeSet).map((c) => c.split(",")).map((a) => ({ + method: a[1], + start: +a[2], + count: +a[3] + })); + } + _updateLayout(minPadding) { + if (this.notifyPlugins("beforeLayout", { + cancelable: true + }) === false) { + return; + } + layouts.update(this, this.width, this.height, minPadding); + const area = this.chartArea; + const noArea = area.width <= 0 || area.height <= 0; + this._layers = []; + each(this.boxes, (box) => { + if (noArea && box.position === "chartArea") { + return; + } + if (box.configure) { + box.configure(); + } + this._layers.push(...box._layers()); + }, this); + this._layers.forEach((item, index2) => { + item._idx = index2; + }); + this.notifyPlugins("afterLayout"); + } + _updateDatasets(mode) { + if (this.notifyPlugins("beforeDatasetsUpdate", { + mode, + cancelable: true + }) === false) { + return; + } + for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) { + this.getDatasetMeta(i).controller.configure(); + } + for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) { + this._updateDataset(i, isFunction(mode) ? mode({ + datasetIndex: i + }) : mode); + } + this.notifyPlugins("afterDatasetsUpdate", { + mode + }); + } + _updateDataset(index2, mode) { + const meta = this.getDatasetMeta(index2); + const args = { + meta, + index: index2, + mode, + cancelable: true + }; + if (this.notifyPlugins("beforeDatasetUpdate", args) === false) { + return; + } + meta.controller._update(mode); + args.cancelable = false; + this.notifyPlugins("afterDatasetUpdate", args); + } + render() { + if (this.notifyPlugins("beforeRender", { + cancelable: true + }) === false) { + return; + } + if (animator.has(this)) { + if (this.attached && !animator.running(this)) { + animator.start(this); + } + } else { + this.draw(); + onAnimationsComplete({ + chart: this + }); + } + } + draw() { + let i; + if (this._resizeBeforeDraw) { + const { width, height } = this._resizeBeforeDraw; + this._resizeBeforeDraw = null; + this._resize(width, height); + } + this.clear(); + if (this.width <= 0 || this.height <= 0) { + return; + } + if (this.notifyPlugins("beforeDraw", { + cancelable: true + }) === false) { + return; + } + const layers = this._layers; + for (i = 0; i < layers.length && layers[i].z <= 0; ++i) { + layers[i].draw(this.chartArea); + } + this._drawDatasets(); + for (; i < layers.length; ++i) { + layers[i].draw(this.chartArea); + } + this.notifyPlugins("afterDraw"); + } + _getSortedDatasetMetas(filterVisible) { + const metasets = this._sortedMetasets; + const result = []; + let i, ilen; + for (i = 0, ilen = metasets.length; i < ilen; ++i) { + const meta = metasets[i]; + if (!filterVisible || meta.visible) { + result.push(meta); + } + } + return result; + } + getSortedVisibleDatasetMetas() { + return this._getSortedDatasetMetas(true); + } + _drawDatasets() { + if (this.notifyPlugins("beforeDatasetsDraw", { + cancelable: true + }) === false) { + return; + } + const metasets = this.getSortedVisibleDatasetMetas(); + for (let i = metasets.length - 1; i >= 0; --i) { + this._drawDataset(metasets[i]); + } + this.notifyPlugins("afterDatasetsDraw"); + } + _drawDataset(meta) { + const ctx = this.ctx; + const args = { + meta, + index: meta.index, + cancelable: true + }; + const clip = getDatasetClipArea(this, meta); + if (this.notifyPlugins("beforeDatasetDraw", args) === false) { + return; + } + if (clip) { + clipArea(ctx, clip); + } + meta.controller.draw(); + if (clip) { + unclipArea(ctx); + } + args.cancelable = false; + this.notifyPlugins("afterDatasetDraw", args); + } + isPointInArea(point) { + return _isPointInArea(point, this.chartArea, this._minPadding); + } + getElementsAtEventForMode(e, mode, options, useFinalPosition) { + const method = Interaction.modes[mode]; + if (typeof method === "function") { + return method(this, e, options, useFinalPosition); + } + return []; + } + getDatasetMeta(datasetIndex) { + const dataset = this.data.datasets[datasetIndex]; + const metasets = this._metasets; + let meta = metasets.filter((x) => x && x._dataset === dataset).pop(); + if (!meta) { + meta = { + type: null, + data: [], + dataset: null, + controller: null, + hidden: null, + xAxisID: null, + yAxisID: null, + order: dataset && dataset.order || 0, + index: datasetIndex, + _dataset: dataset, + _parsed: [], + _sorted: false + }; + metasets.push(meta); + } + return meta; + } + getContext() { + return this.$context || (this.$context = createContext(null, { + chart: this, + type: "chart" + })); + } + getVisibleDatasetCount() { + return this.getSortedVisibleDatasetMetas().length; + } + isDatasetVisible(datasetIndex) { + const dataset = this.data.datasets[datasetIndex]; + if (!dataset) { + return false; + } + const meta = this.getDatasetMeta(datasetIndex); + return typeof meta.hidden === "boolean" ? !meta.hidden : !dataset.hidden; + } + setDatasetVisibility(datasetIndex, visible) { + const meta = this.getDatasetMeta(datasetIndex); + meta.hidden = !visible; + } + toggleDataVisibility(index2) { + this._hiddenIndices[index2] = !this._hiddenIndices[index2]; + } + getDataVisibility(index2) { + return !this._hiddenIndices[index2]; + } + _updateVisibility(datasetIndex, dataIndex, visible) { + const mode = visible ? "show" : "hide"; + const meta = this.getDatasetMeta(datasetIndex); + const anims = meta.controller._resolveAnimations(void 0, mode); + if (defined(dataIndex)) { + meta.data[dataIndex].hidden = !visible; + this.update(); + } else { + this.setDatasetVisibility(datasetIndex, visible); + anims.update(meta, { + visible + }); + this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : void 0); + } + } + hide(datasetIndex, dataIndex) { + this._updateVisibility(datasetIndex, dataIndex, false); + } + show(datasetIndex, dataIndex) { + this._updateVisibility(datasetIndex, dataIndex, true); + } + _destroyDatasetMeta(datasetIndex) { + const meta = this._metasets[datasetIndex]; + if (meta && meta.controller) { + meta.controller._destroy(); + } + delete this._metasets[datasetIndex]; + } + _stop() { + let i, ilen; + this.stop(); + animator.remove(this); + for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) { + this._destroyDatasetMeta(i); + } + } + destroy() { + this.notifyPlugins("beforeDestroy"); + const { canvas, ctx } = this; + this._stop(); + this.config.clearCache(); + if (canvas) { + this.unbindEvents(); + clearCanvas(canvas, ctx); + this.platform.releaseContext(ctx); + this.canvas = null; + this.ctx = null; + } + delete instances[this.id]; + this.notifyPlugins("afterDestroy"); + } + toBase64Image(...args) { + return this.canvas.toDataURL(...args); + } + bindEvents() { + this.bindUserEvents(); + if (this.options.responsive) { + this.bindResponsiveEvents(); + } else { + this.attached = true; + } + } + bindUserEvents() { + const listeners = this._listeners; + const platform = this.platform; + const _add = (type, listener2) => { + platform.addEventListener(this, type, listener2); + listeners[type] = listener2; + }; + const listener = (e, x, y) => { + e.offsetX = x; + e.offsetY = y; + this._eventHandler(e); + }; + each(this.options.events, (type) => _add(type, listener)); + } + bindResponsiveEvents() { + if (!this._responsiveListeners) { + this._responsiveListeners = {}; + } + const listeners = this._responsiveListeners; + const platform = this.platform; + const _add = (type, listener2) => { + platform.addEventListener(this, type, listener2); + listeners[type] = listener2; + }; + const _remove = (type, listener2) => { + if (listeners[type]) { + platform.removeEventListener(this, type, listener2); + delete listeners[type]; + } + }; + const listener = (width, height) => { + if (this.canvas) { + this.resize(width, height); + } + }; + let detached; + const attached = () => { + _remove("attach", attached); + this.attached = true; + this.resize(); + _add("resize", listener); + _add("detach", detached); + }; + detached = () => { + this.attached = false; + _remove("resize", listener); + this._stop(); + this._resize(0, 0); + _add("attach", attached); + }; + if (platform.isAttached(this.canvas)) { + attached(); + } else { + detached(); + } + } + unbindEvents() { + each(this._listeners, (listener, type) => { + this.platform.removeEventListener(this, type, listener); + }); + this._listeners = {}; + each(this._responsiveListeners, (listener, type) => { + this.platform.removeEventListener(this, type, listener); + }); + this._responsiveListeners = void 0; + } + updateHoverStyle(items, mode, enabled) { + const prefix = enabled ? "set" : "remove"; + let meta, item, i, ilen; + if (mode === "dataset") { + meta = this.getDatasetMeta(items[0].datasetIndex); + meta.controller["_" + prefix + "DatasetHoverStyle"](); + } + for (i = 0, ilen = items.length; i < ilen; ++i) { + item = items[i]; + const controller = item && this.getDatasetMeta(item.datasetIndex).controller; + if (controller) { + controller[prefix + "HoverStyle"](item.element, item.datasetIndex, item.index); + } + } + } + getActiveElements() { + return this._active || []; + } + setActiveElements(activeElements) { + const lastActive = this._active || []; + const active = activeElements.map(({ datasetIndex, index: index2 }) => { + const meta = this.getDatasetMeta(datasetIndex); + if (!meta) { + throw new Error("No dataset found at index " + datasetIndex); + } + return { + datasetIndex, + element: meta.data[index2], + index: index2 + }; + }); + const changed = !_elementsEqual(active, lastActive); + if (changed) { + this._active = active; + this._lastEvent = null; + this._updateHoverStyles(active, lastActive); + } + } + notifyPlugins(hook, args, filter) { + return this._plugins.notify(this, hook, args, filter); + } + isPluginEnabled(pluginId) { + return this._plugins._cache.filter((p) => p.plugin.id === pluginId).length === 1; + } + _updateHoverStyles(active, lastActive, replay) { + const hoverOptions = this.options.hover; + const diff = (a, b) => a.filter((x) => !b.some((y) => x.datasetIndex === y.datasetIndex && x.index === y.index)); + const deactivated = diff(lastActive, active); + const activated = replay ? active : diff(active, lastActive); + if (deactivated.length) { + this.updateHoverStyle(deactivated, hoverOptions.mode, false); + } + if (activated.length && hoverOptions.mode) { + this.updateHoverStyle(activated, hoverOptions.mode, true); + } + } + _eventHandler(e, replay) { + const args = { + event: e, + replay, + cancelable: true, + inChartArea: this.isPointInArea(e) + }; + const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type); + if (this.notifyPlugins("beforeEvent", args, eventFilter) === false) { + return; + } + const changed = this._handleEvent(e, replay, args.inChartArea); + args.cancelable = false; + this.notifyPlugins("afterEvent", args, eventFilter); + if (changed || args.changed) { + this.render(); + } + return this; + } + _handleEvent(e, replay, inChartArea) { + const { _active: lastActive = [], options } = this; + const useFinalPosition = replay; + const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition); + const isClick = _isClickEvent(e); + const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick); + if (inChartArea) { + this._lastEvent = null; + callback(options.onHover, [ + e, + active, + this + ], this); + if (isClick) { + callback(options.onClick, [ + e, + active, + this + ], this); + } + } + const changed = !_elementsEqual(active, lastActive); + if (changed || replay) { + this._active = active; + this._updateHoverStyles(active, lastActive, replay); + } + this._lastEvent = lastEvent; + return changed; + } + _getActiveElements(e, lastActive, inChartArea, useFinalPosition) { + if (e.type === "mouseout") { + return []; + } + if (!inChartArea) { + return lastActive; + } + const hoverOptions = this.options.hover; + return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition); + } + }; + __publicField(Chart, "defaults", defaults); + __publicField(Chart, "instances", instances); + __publicField(Chart, "overrides", overrides); + __publicField(Chart, "registry", registry); + __publicField(Chart, "version", version); + __publicField(Chart, "getChart", getChart); + ArcElement = class extends Element2 { + constructor(cfg) { + super(); + __publicField(this, "circumference"); + __publicField(this, "endAngle"); + __publicField(this, "fullCircles"); + __publicField(this, "innerRadius"); + __publicField(this, "outerRadius"); + __publicField(this, "pixelMargin"); + __publicField(this, "startAngle"); + this.options = void 0; + this.circumference = void 0; + this.startAngle = void 0; + this.endAngle = void 0; + this.innerRadius = void 0; + this.outerRadius = void 0; + this.pixelMargin = 0; + this.fullCircles = 0; + if (cfg) { + Object.assign(this, cfg); + } + } + inRange(chartX, chartY, useFinalPosition) { + const point = this.getProps([ + "x", + "y" + ], useFinalPosition); + const { angle, distance } = getAngleFromPoint(point, { + x: chartX, + y: chartY + }); + const { startAngle, endAngle, innerRadius, outerRadius, circumference } = this.getProps([ + "startAngle", + "endAngle", + "innerRadius", + "outerRadius", + "circumference" + ], useFinalPosition); + const rAdjust = (this.options.spacing + this.options.borderWidth) / 2; + const _circumference = valueOrDefault(circumference, endAngle - startAngle); + const nonZeroBetween = _angleBetween(angle, startAngle, endAngle) && startAngle !== endAngle; + const betweenAngles = _circumference >= TAU || nonZeroBetween; + const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust); + return betweenAngles && withinRadius; + } + getCenterPoint(useFinalPosition) { + const { x, y, startAngle, endAngle, innerRadius, outerRadius } = this.getProps([ + "x", + "y", + "startAngle", + "endAngle", + "innerRadius", + "outerRadius" + ], useFinalPosition); + const { offset, spacing } = this.options; + const halfAngle = (startAngle + endAngle) / 2; + const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2; + return { + x: x + Math.cos(halfAngle) * halfRadius, + y: y + Math.sin(halfAngle) * halfRadius + }; + } + tooltipPosition(useFinalPosition) { + return this.getCenterPoint(useFinalPosition); + } + draw(ctx) { + const { options, circumference } = this; + const offset = (options.offset || 0) / 4; + const spacing = (options.spacing || 0) / 2; + const circular = options.circular; + this.pixelMargin = options.borderAlign === "inner" ? 0.33 : 0; + this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0; + if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) { + return; + } + ctx.save(); + const halfAngle = (this.startAngle + this.endAngle) / 2; + ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset); + const fix = 1 - Math.sin(Math.min(PI, circumference || 0)); + const radiusOffset = offset * fix; + ctx.fillStyle = options.backgroundColor; + ctx.strokeStyle = options.borderColor; + drawArc(ctx, this, radiusOffset, spacing, circular); + drawBorder(ctx, this, radiusOffset, spacing, circular); + ctx.restore(); + } + }; + __publicField(ArcElement, "id", "arc"); + __publicField(ArcElement, "defaults", { + borderAlign: "center", + borderColor: "#fff", + borderDash: [], + borderDashOffset: 0, + borderJoinStyle: void 0, + borderRadius: 0, + borderWidth: 2, + offset: 0, + spacing: 0, + angle: void 0, + circular: true, + selfJoin: false + }); + __publicField(ArcElement, "defaultRoutes", { + backgroundColor: "backgroundColor" + }); + __publicField(ArcElement, "descriptors", { + _scriptable: true, + _indexable: (name) => name !== "borderDash" + }); + usePath2D = typeof Path2D === "function"; + LineElement = class extends Element2 { + constructor(cfg) { + super(); + this.animated = true; + this.options = void 0; + this._chart = void 0; + this._loop = void 0; + this._fullLoop = void 0; + this._path = void 0; + this._points = void 0; + this._segments = void 0; + this._decimated = false; + this._pointsUpdated = false; + this._datasetIndex = void 0; + if (cfg) { + Object.assign(this, cfg); + } + } + updateControlPoints(chartArea, indexAxis) { + const options = this.options; + if ((options.tension || options.cubicInterpolationMode === "monotone") && !options.stepped && !this._pointsUpdated) { + const loop = options.spanGaps ? this._loop : this._fullLoop; + _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis); + this._pointsUpdated = true; + } + } + set points(points) { + this._points = points; + delete this._segments; + delete this._path; + this._pointsUpdated = false; + } + get points() { + return this._points; + } + get segments() { + return this._segments || (this._segments = _computeSegments(this, this.options.segment)); + } + first() { + const segments = this.segments; + const points = this.points; + return segments.length && points[segments[0].start]; + } + last() { + const segments = this.segments; + const points = this.points; + const count = segments.length; + return count && points[segments[count - 1].end]; + } + interpolate(point, property) { + const options = this.options; + const value = point[property]; + const points = this.points; + const segments = _boundSegments(this, { + property, + start: value, + end: value + }); + if (!segments.length) { + return; + } + const result = []; + const _interpolate = _getInterpolationMethod(options); + let i, ilen; + for (i = 0, ilen = segments.length; i < ilen; ++i) { + const { start, end } = segments[i]; + const p1 = points[start]; + const p2 = points[end]; + if (p1 === p2) { + result.push(p1); + continue; + } + const t = Math.abs((value - p1[property]) / (p2[property] - p1[property])); + const interpolated = _interpolate(p1, p2, t, options.stepped); + interpolated[property] = point[property]; + result.push(interpolated); + } + return result.length === 1 ? result[0] : result; + } + pathSegment(ctx, segment, params) { + const segmentMethod = _getSegmentMethod(this); + return segmentMethod(ctx, this, segment, params); + } + path(ctx, start, count) { + const segments = this.segments; + const segmentMethod = _getSegmentMethod(this); + let loop = this._loop; + start = start || 0; + count = count || this.points.length - start; + for (const segment of segments) { + loop &= segmentMethod(ctx, this, segment, { + start, + end: start + count - 1 + }); + } + return !!loop; + } + draw(ctx, chartArea, start, count) { + const options = this.options || {}; + const points = this.points || []; + if (points.length && options.borderWidth) { + ctx.save(); + draw(ctx, this, start, count); + ctx.restore(); + } + if (this.animated) { + this._pointsUpdated = false; + this._path = void 0; + } + } + }; + __publicField(LineElement, "id", "line"); + __publicField(LineElement, "defaults", { + borderCapStyle: "butt", + borderDash: [], + borderDashOffset: 0, + borderJoinStyle: "miter", + borderWidth: 3, + capBezierPoints: true, + cubicInterpolationMode: "default", + fill: false, + spanGaps: false, + stepped: false, + tension: 0 + }); + __publicField(LineElement, "defaultRoutes", { + backgroundColor: "backgroundColor", + borderColor: "borderColor" + }); + __publicField(LineElement, "descriptors", { + _scriptable: true, + _indexable: (name) => name !== "borderDash" && name !== "fill" + }); + PointElement = class extends Element2 { + constructor(cfg) { + super(); + __publicField(this, "parsed"); + __publicField(this, "skip"); + __publicField(this, "stop"); + this.options = void 0; + this.parsed = void 0; + this.skip = void 0; + this.stop = void 0; + if (cfg) { + Object.assign(this, cfg); + } + } + inRange(mouseX, mouseY, useFinalPosition) { + const options = this.options; + const { x, y } = this.getProps([ + "x", + "y" + ], useFinalPosition); + return Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2) < Math.pow(options.hitRadius + options.radius, 2); + } + inXRange(mouseX, useFinalPosition) { + return inRange$1(this, mouseX, "x", useFinalPosition); + } + inYRange(mouseY, useFinalPosition) { + return inRange$1(this, mouseY, "y", useFinalPosition); + } + getCenterPoint(useFinalPosition) { + const { x, y } = this.getProps([ + "x", + "y" + ], useFinalPosition); + return { + x, + y + }; + } + size(options) { + options = options || this.options || {}; + let radius = options.radius || 0; + radius = Math.max(radius, radius && options.hoverRadius || 0); + const borderWidth2 = radius && options.borderWidth || 0; + return (radius + borderWidth2) * 2; + } + draw(ctx, area) { + const options = this.options; + if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) { + return; + } + ctx.strokeStyle = options.borderColor; + ctx.lineWidth = options.borderWidth; + ctx.fillStyle = options.backgroundColor; + drawPoint(ctx, options, this.x, this.y); + } + getRange() { + const options = this.options || {}; + return options.radius + options.hitRadius; + } + }; + __publicField(PointElement, "id", "point"); + /** + * @type {any} + */ + __publicField(PointElement, "defaults", { + borderWidth: 1, + hitRadius: 1, + hoverBorderWidth: 1, + hoverRadius: 4, + pointStyle: "circle", + radius: 3, + rotation: 0 + }); + /** + * @type {any} + */ + __publicField(PointElement, "defaultRoutes", { + backgroundColor: "backgroundColor", + borderColor: "borderColor" + }); + BarElement = class extends Element2 { + constructor(cfg) { + super(); + this.options = void 0; + this.horizontal = void 0; + this.base = void 0; + this.width = void 0; + this.height = void 0; + this.inflateAmount = void 0; + if (cfg) { + Object.assign(this, cfg); + } + } + draw(ctx) { + const { inflateAmount, options: { borderColor, backgroundColor } } = this; + const { inner, outer } = boundingRects(this); + const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath; + ctx.save(); + if (outer.w !== inner.w || outer.h !== inner.h) { + ctx.beginPath(); + addRectPath(ctx, inflateRect(outer, inflateAmount, inner)); + ctx.clip(); + addRectPath(ctx, inflateRect(inner, -inflateAmount, outer)); + ctx.fillStyle = borderColor; + ctx.fill("evenodd"); + } + ctx.beginPath(); + addRectPath(ctx, inflateRect(inner, inflateAmount)); + ctx.fillStyle = backgroundColor; + ctx.fill(); + ctx.restore(); + } + inRange(mouseX, mouseY, useFinalPosition) { + return inRange(this, mouseX, mouseY, useFinalPosition); + } + inXRange(mouseX, useFinalPosition) { + return inRange(this, mouseX, null, useFinalPosition); + } + inYRange(mouseY, useFinalPosition) { + return inRange(this, null, mouseY, useFinalPosition); + } + getCenterPoint(useFinalPosition) { + const { x, y, base, horizontal } = this.getProps([ + "x", + "y", + "base", + "horizontal" + ], useFinalPosition); + return { + x: horizontal ? (x + base) / 2 : x, + y: horizontal ? y : (y + base) / 2 + }; + } + getRange(axis) { + return axis === "x" ? this.width / 2 : this.height / 2; + } + }; + __publicField(BarElement, "id", "bar"); + __publicField(BarElement, "defaults", { + borderSkipped: "start", + borderWidth: 0, + borderRadius: 0, + inflateAmount: "auto", + pointStyle: void 0 + }); + __publicField(BarElement, "defaultRoutes", { + backgroundColor: "backgroundColor", + borderColor: "borderColor" + }); + elements = /* @__PURE__ */ Object.freeze({ + __proto__: null, + ArcElement, + BarElement, + LineElement, + PointElement + }); + BORDER_COLORS = [ + "rgb(54, 162, 235)", + "rgb(255, 99, 132)", + "rgb(255, 159, 64)", + "rgb(255, 205, 86)", + "rgb(75, 192, 192)", + "rgb(153, 102, 255)", + "rgb(201, 203, 207)" + // grey + ]; + BACKGROUND_COLORS = /* @__PURE__ */ BORDER_COLORS.map((color2) => color2.replace("rgb(", "rgba(").replace(")", ", 0.5)")); + plugin_colors = { + id: "colors", + defaults: { + enabled: true, + forceOverride: false + }, + beforeLayout(chart2, _args, options) { + if (!options.enabled) { + return; + } + const { data: { datasets }, options: chartOptions } = chart2.config; + const { elements: elements3 } = chartOptions; + const containsColorDefenition = containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || elements3 && containsColorsDefinitions(elements3) || containsDefaultColorsDefenitions(); + if (!options.forceOverride && containsColorDefenition) { + return; + } + const colorizer = getColorizer(chart2); + datasets.forEach(colorizer); + } + }; + plugin_decimation = { + id: "decimation", + defaults: { + algorithm: "min-max", + enabled: false + }, + beforeElementsUpdate: (chart2, args, options) => { + if (!options.enabled) { + cleanDecimatedData(chart2); + return; + } + const availableWidth = chart2.width; + chart2.data.datasets.forEach((dataset, datasetIndex) => { + const { _data, indexAxis } = dataset; + const meta = chart2.getDatasetMeta(datasetIndex); + const data = _data || dataset.data; + if (resolve([ + indexAxis, + chart2.options.indexAxis + ]) === "y") { + return; + } + if (!meta.controller.supportsDecimation) { + return; + } + const xAxis = chart2.scales[meta.xAxisID]; + if (xAxis.type !== "linear" && xAxis.type !== "time") { + return; + } + if (chart2.options.parsing) { + return; + } + let { start, count } = getStartAndCountOfVisiblePointsSimplified(meta, data); + const threshold = options.threshold || 4 * availableWidth; + if (count <= threshold) { + cleanDecimatedDataset(dataset); + return; + } + if (isNullOrUndef(_data)) { + dataset._data = data; + delete dataset.data; + Object.defineProperty(dataset, "data", { + configurable: true, + enumerable: true, + get: function() { + return this._decimated; + }, + set: function(d) { + this._data = d; + } + }); + } + let decimated; + switch (options.algorithm) { + case "lttb": + decimated = lttbDecimation(data, start, count, availableWidth, options); + break; + case "min-max": + decimated = minMaxDecimation(data, start, count, availableWidth); + break; + default: + throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`); + } + dataset._decimated = decimated; + }); + }, + destroy(chart2) { + cleanDecimatedData(chart2); + } + }; + simpleArc = class { + constructor(opts) { + this.x = opts.x; + this.y = opts.y; + this.radius = opts.radius; + } + pathSegment(ctx, bounds, opts) { + const { x, y, radius } = this; + bounds = bounds || { + start: 0, + end: TAU + }; + ctx.arc(x, y, radius, bounds.end, bounds.start, true); + return !opts.bounds; + } + interpolate(point) { + const { x, y, radius } = this; + const angle = point.angle; + return { + x: x + Math.cos(angle) * radius, + y: y + Math.sin(angle) * radius, + angle + }; + } + }; + index = { + id: "filler", + afterDatasetsUpdate(chart2, _args, options) { + const count = (chart2.data.datasets || []).length; + const sources = []; + let meta, i, line, source; + for (i = 0; i < count; ++i) { + meta = chart2.getDatasetMeta(i); + line = meta.dataset; + source = null; + if (line && line.options && line instanceof LineElement) { + source = { + visible: chart2.isDatasetVisible(i), + index: i, + fill: _decodeFill(line, i, count), + chart: chart2, + axis: meta.controller.options.indexAxis, + scale: meta.vScale, + line + }; + } + meta.$filler = source; + sources.push(source); + } + for (i = 0; i < count; ++i) { + source = sources[i]; + if (!source || source.fill === false) { + continue; + } + source.fill = _resolveTarget(sources, i, options.propagate); + } + }, + beforeDraw(chart2, _args, options) { + const draw2 = options.drawTime === "beforeDraw"; + const metasets = chart2.getSortedVisibleDatasetMetas(); + const area = chart2.chartArea; + for (let i = metasets.length - 1; i >= 0; --i) { + const source = metasets[i].$filler; + if (!source) { + continue; + } + source.line.updateControlPoints(area, source.axis); + if (draw2 && source.fill) { + _drawfill(chart2.ctx, source, area); + } + } + }, + beforeDatasetsDraw(chart2, _args, options) { + if (options.drawTime !== "beforeDatasetsDraw") { + return; + } + const metasets = chart2.getSortedVisibleDatasetMetas(); + for (let i = metasets.length - 1; i >= 0; --i) { + const source = metasets[i].$filler; + if (_shouldApplyFill(source)) { + _drawfill(chart2.ctx, source, chart2.chartArea); + } + } + }, + beforeDatasetDraw(chart2, args, options) { + const source = args.meta.$filler; + if (!_shouldApplyFill(source) || options.drawTime !== "beforeDatasetDraw") { + return; + } + _drawfill(chart2.ctx, source, chart2.chartArea); + }, + defaults: { + propagate: true, + drawTime: "beforeDatasetDraw" + } + }; + getBoxSize = (labelOpts, fontSize) => { + let { boxHeight = fontSize, boxWidth = fontSize } = labelOpts; + if (labelOpts.usePointStyle) { + boxHeight = Math.min(boxHeight, fontSize); + boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize); + } + return { + boxWidth, + boxHeight, + itemHeight: Math.max(fontSize, boxHeight) + }; + }; + itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index; + Legend = class extends Element2 { + constructor(config) { + super(); + this._added = false; + this.legendHitBoxes = []; + this._hoveredItem = null; + this.doughnutMode = false; + this.chart = config.chart; + this.options = config.options; + this.ctx = config.ctx; + this.legendItems = void 0; + this.columnSizes = void 0; + this.lineWidths = void 0; + this.maxHeight = void 0; + this.maxWidth = void 0; + this.top = void 0; + this.bottom = void 0; + this.left = void 0; + this.right = void 0; + this.height = void 0; + this.width = void 0; + this._margins = void 0; + this.position = void 0; + this.weight = void 0; + this.fullSize = void 0; + } + update(maxWidth, maxHeight, margins) { + this.maxWidth = maxWidth; + this.maxHeight = maxHeight; + this._margins = margins; + this.setDimensions(); + this.buildLabels(); + this.fit(); + } + setDimensions() { + if (this.isHorizontal()) { + this.width = this.maxWidth; + this.left = this._margins.left; + this.right = this.width; + } else { + this.height = this.maxHeight; + this.top = this._margins.top; + this.bottom = this.height; + } + } + buildLabels() { + const labelOpts = this.options.labels || {}; + let legendItems = callback(labelOpts.generateLabels, [ + this.chart + ], this) || []; + if (labelOpts.filter) { + legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data)); + } + if (labelOpts.sort) { + legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data)); + } + if (this.options.reverse) { + legendItems.reverse(); + } + this.legendItems = legendItems; + } + fit() { + const { options, ctx } = this; + if (!options.display) { + this.width = this.height = 0; + return; + } + const labelOpts = options.labels; + const labelFont = toFont(labelOpts.font); + const fontSize = labelFont.size; + const titleHeight = this._computeTitleHeight(); + const { boxWidth, itemHeight } = getBoxSize(labelOpts, fontSize); + let width, height; + ctx.font = labelFont.string; + if (this.isHorizontal()) { + width = this.maxWidth; + height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10; + } else { + height = this.maxHeight; + width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10; + } + this.width = Math.min(width, options.maxWidth || this.maxWidth); + this.height = Math.min(height, options.maxHeight || this.maxHeight); + } + _fitRows(titleHeight, fontSize, boxWidth, itemHeight) { + const { ctx, maxWidth, options: { labels: { padding } } } = this; + const hitboxes = this.legendHitBoxes = []; + const lineWidths = this.lineWidths = [ + 0 + ]; + const lineHeight = itemHeight + padding; + let totalHeight = titleHeight; + ctx.textAlign = "left"; + ctx.textBaseline = "middle"; + let row = -1; + let top = -lineHeight; + this.legendItems.forEach((legendItem, i) => { + const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width; + if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) { + totalHeight += lineHeight; + lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0; + top += lineHeight; + row++; + } + hitboxes[i] = { + left: 0, + top, + row, + width: itemWidth, + height: itemHeight + }; + lineWidths[lineWidths.length - 1] += itemWidth + padding; + }); + return totalHeight; + } + _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) { + const { ctx, maxHeight, options: { labels: { padding } } } = this; + const hitboxes = this.legendHitBoxes = []; + const columnSizes = this.columnSizes = []; + const heightLimit = maxHeight - titleHeight; + let totalWidth = padding; + let currentColWidth = 0; + let currentColHeight = 0; + let left = 0; + let col = 0; + this.legendItems.forEach((legendItem, i) => { + const { itemWidth, itemHeight } = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight); + if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) { + totalWidth += currentColWidth + padding; + columnSizes.push({ + width: currentColWidth, + height: currentColHeight + }); + left += currentColWidth + padding; + col++; + currentColWidth = currentColHeight = 0; + } + hitboxes[i] = { + left, + top: currentColHeight, + col, + width: itemWidth, + height: itemHeight + }; + currentColWidth = Math.max(currentColWidth, itemWidth); + currentColHeight += itemHeight + padding; + }); + totalWidth += currentColWidth; + columnSizes.push({ + width: currentColWidth, + height: currentColHeight + }); + return totalWidth; + } + adjustHitBoxes() { + if (!this.options.display) { + return; + } + const titleHeight = this._computeTitleHeight(); + const { legendHitBoxes: hitboxes, options: { align, labels: { padding }, rtl } } = this; + const rtlHelper = getRtlAdapter(rtl, this.left, this.width); + if (this.isHorizontal()) { + let row = 0; + let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]); + for (const hitbox of hitboxes) { + if (row !== hitbox.row) { + row = hitbox.row; + left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]); + } + hitbox.top += this.top + titleHeight + padding; + hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width); + left += hitbox.width + padding; + } + } else { + let col = 0; + let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height); + for (const hitbox of hitboxes) { + if (hitbox.col !== col) { + col = hitbox.col; + top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height); + } + hitbox.top = top; + hitbox.left += this.left + padding; + hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width); + top += hitbox.height + padding; + } + } + } + isHorizontal() { + return this.options.position === "top" || this.options.position === "bottom"; + } + draw() { + if (this.options.display) { + const ctx = this.ctx; + clipArea(ctx, this); + this._draw(); + unclipArea(ctx); + } + } + _draw() { + const { options: opts, columnSizes, lineWidths, ctx } = this; + const { align, labels: labelOpts } = opts; + const defaultColor = defaults.color; + const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width); + const labelFont = toFont(labelOpts.font); + const { padding } = labelOpts; + const fontSize = labelFont.size; + const halfFontSize = fontSize / 2; + let cursor; + this.drawTitle(); + ctx.textAlign = rtlHelper.textAlign("left"); + ctx.textBaseline = "middle"; + ctx.lineWidth = 0.5; + ctx.font = labelFont.string; + const { boxWidth, boxHeight, itemHeight } = getBoxSize(labelOpts, fontSize); + const drawLegendBox = function(x, y, legendItem) { + if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) { + return; + } + ctx.save(); + const lineWidth = valueOrDefault(legendItem.lineWidth, 1); + ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor); + ctx.lineCap = valueOrDefault(legendItem.lineCap, "butt"); + ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0); + ctx.lineJoin = valueOrDefault(legendItem.lineJoin, "miter"); + ctx.lineWidth = lineWidth; + ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor); + ctx.setLineDash(valueOrDefault(legendItem.lineDash, [])); + if (labelOpts.usePointStyle) { + const drawOptions = { + radius: boxHeight * Math.SQRT2 / 2, + pointStyle: legendItem.pointStyle, + rotation: legendItem.rotation, + borderWidth: lineWidth + }; + const centerX = rtlHelper.xPlus(x, boxWidth / 2); + const centerY = y + halfFontSize; + drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth); + } else { + const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0); + const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth); + const borderRadius = toTRBLCorners(legendItem.borderRadius); + ctx.beginPath(); + if (Object.values(borderRadius).some((v) => v !== 0)) { + addRoundedRectPath(ctx, { + x: xBoxLeft, + y: yBoxTop, + w: boxWidth, + h: boxHeight, + radius: borderRadius + }); + } else { + ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight); + } + ctx.fill(); + if (lineWidth !== 0) { + ctx.stroke(); + } + } + ctx.restore(); + }; + const fillText = function(x, y, legendItem) { + renderText(ctx, legendItem.text, x, y + itemHeight / 2, labelFont, { + strikethrough: legendItem.hidden, + textAlign: rtlHelper.textAlign(legendItem.textAlign) + }); + }; + const isHorizontal = this.isHorizontal(); + const titleHeight = this._computeTitleHeight(); + if (isHorizontal) { + cursor = { + x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]), + y: this.top + padding + titleHeight, + line: 0 + }; + } else { + cursor = { + x: this.left + padding, + y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height), + line: 0 + }; + } + overrideTextDirection(this.ctx, opts.textDirection); + const lineHeight = itemHeight + padding; + this.legendItems.forEach((legendItem, i) => { + ctx.strokeStyle = legendItem.fontColor; + ctx.fillStyle = legendItem.fontColor; + const textWidth = ctx.measureText(legendItem.text).width; + const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign)); + const width = boxWidth + halfFontSize + textWidth; + let x = cursor.x; + let y = cursor.y; + rtlHelper.setWidth(this.width); + if (isHorizontal) { + if (i > 0 && x + width + padding > this.right) { + y = cursor.y += lineHeight; + cursor.line++; + x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]); + } + } else if (i > 0 && y + lineHeight > this.bottom) { + x = cursor.x = x + columnSizes[cursor.line].width + padding; + cursor.line++; + y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height); + } + const realX = rtlHelper.x(x); + drawLegendBox(realX, y, legendItem); + x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl); + fillText(rtlHelper.x(x), y, legendItem); + if (isHorizontal) { + cursor.x += width + padding; + } else if (typeof legendItem.text !== "string") { + const fontLineHeight = labelFont.lineHeight; + cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding; + } else { + cursor.y += lineHeight; + } + }); + restoreTextDirection(this.ctx, opts.textDirection); + } + drawTitle() { + const opts = this.options; + const titleOpts = opts.title; + const titleFont = toFont(titleOpts.font); + const titlePadding = toPadding(titleOpts.padding); + if (!titleOpts.display) { + return; + } + const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width); + const ctx = this.ctx; + const position = titleOpts.position; + const halfFontSize = titleFont.size / 2; + const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize; + let y; + let left = this.left; + let maxWidth = this.width; + if (this.isHorizontal()) { + maxWidth = Math.max(...this.lineWidths); + y = this.top + topPaddingPlusHalfFontSize; + left = _alignStartEnd(opts.align, left, this.right - maxWidth); + } else { + const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0); + y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight()); + } + const x = _alignStartEnd(position, left, left + maxWidth); + ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position)); + ctx.textBaseline = "middle"; + ctx.strokeStyle = titleOpts.color; + ctx.fillStyle = titleOpts.color; + ctx.font = titleFont.string; + renderText(ctx, titleOpts.text, x, y, titleFont); + } + _computeTitleHeight() { + const titleOpts = this.options.title; + const titleFont = toFont(titleOpts.font); + const titlePadding = toPadding(titleOpts.padding); + return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0; + } + _getLegendItemAt(x, y) { + let i, hitBox, lh; + if (_isBetween(x, this.left, this.right) && _isBetween(y, this.top, this.bottom)) { + lh = this.legendHitBoxes; + for (i = 0; i < lh.length; ++i) { + hitBox = lh[i]; + if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) { + return this.legendItems[i]; + } + } + } + return null; + } + handleEvent(e) { + const opts = this.options; + if (!isListened(e.type, opts)) { + return; + } + const hoveredItem = this._getLegendItemAt(e.x, e.y); + if (e.type === "mousemove" || e.type === "mouseout") { + const previous = this._hoveredItem; + const sameItem = itemsEqual(previous, hoveredItem); + if (previous && !sameItem) { + callback(opts.onLeave, [ + e, + previous, + this + ], this); + } + this._hoveredItem = hoveredItem; + if (hoveredItem && !sameItem) { + callback(opts.onHover, [ + e, + hoveredItem, + this + ], this); + } + } else if (hoveredItem) { + callback(opts.onClick, [ + e, + hoveredItem, + this + ], this); + } + } + }; + plugin_legend = { + id: "legend", + _element: Legend, + start(chart2, _args, options) { + const legend = chart2.legend = new Legend({ + ctx: chart2.ctx, + options, + chart: chart2 + }); + layouts.configure(chart2, legend, options); + layouts.addBox(chart2, legend); + }, + stop(chart2) { + layouts.removeBox(chart2, chart2.legend); + delete chart2.legend; + }, + beforeUpdate(chart2, _args, options) { + const legend = chart2.legend; + layouts.configure(chart2, legend, options); + legend.options = options; + }, + afterUpdate(chart2) { + const legend = chart2.legend; + legend.buildLabels(); + legend.adjustHitBoxes(); + }, + afterEvent(chart2, args) { + if (!args.replay) { + chart2.legend.handleEvent(args.event); + } + }, + defaults: { + display: true, + position: "top", + align: "center", + fullSize: true, + reverse: false, + weight: 1e3, + onClick(e, legendItem, legend) { + const index2 = legendItem.datasetIndex; + const ci = legend.chart; + if (ci.isDatasetVisible(index2)) { + ci.hide(index2); + legendItem.hidden = true; + } else { + ci.show(index2); + legendItem.hidden = false; + } + }, + onHover: null, + onLeave: null, + labels: { + color: (ctx) => ctx.chart.options.color, + boxWidth: 40, + padding: 10, + generateLabels(chart2) { + const datasets = chart2.data.datasets; + const { labels: { usePointStyle, pointStyle, textAlign, color: color2, useBorderRadius, borderRadius } } = chart2.legend.options; + return chart2._getSortedDatasetMetas().map((meta) => { + const style = meta.controller.getStyle(usePointStyle ? 0 : void 0); + const borderWidth2 = toPadding(style.borderWidth); + return { + text: datasets[meta.index].label, + fillStyle: style.backgroundColor, + fontColor: color2, + hidden: !meta.visible, + lineCap: style.borderCapStyle, + lineDash: style.borderDash, + lineDashOffset: style.borderDashOffset, + lineJoin: style.borderJoinStyle, + lineWidth: (borderWidth2.width + borderWidth2.height) / 4, + strokeStyle: style.borderColor, + pointStyle: pointStyle || style.pointStyle, + rotation: style.rotation, + textAlign: textAlign || style.textAlign, + borderRadius: useBorderRadius && (borderRadius || style.borderRadius), + datasetIndex: meta.index + }; + }, this); + } + }, + title: { + color: (ctx) => ctx.chart.options.color, + display: false, + position: "center", + text: "" + } + }, + descriptors: { + _scriptable: (name) => !name.startsWith("on"), + labels: { + _scriptable: (name) => ![ + "generateLabels", + "filter", + "sort" + ].includes(name) + } + } + }; + Title = class extends Element2 { + constructor(config) { + super(); + this.chart = config.chart; + this.options = config.options; + this.ctx = config.ctx; + this._padding = void 0; + this.top = void 0; + this.bottom = void 0; + this.left = void 0; + this.right = void 0; + this.width = void 0; + this.height = void 0; + this.position = void 0; + this.weight = void 0; + this.fullSize = void 0; + } + update(maxWidth, maxHeight) { + const opts = this.options; + this.left = 0; + this.top = 0; + if (!opts.display) { + this.width = this.height = this.right = this.bottom = 0; + return; + } + this.width = this.right = maxWidth; + this.height = this.bottom = maxHeight; + const lineCount = isArray(opts.text) ? opts.text.length : 1; + this._padding = toPadding(opts.padding); + const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height; + if (this.isHorizontal()) { + this.height = textSize; + } else { + this.width = textSize; + } + } + isHorizontal() { + const pos = this.options.position; + return pos === "top" || pos === "bottom"; + } + _drawArgs(offset) { + const { top, left, bottom, right, options } = this; + const align = options.align; + let rotation = 0; + let maxWidth, titleX, titleY; + if (this.isHorizontal()) { + titleX = _alignStartEnd(align, left, right); + titleY = top + offset; + maxWidth = right - left; + } else { + if (options.position === "left") { + titleX = left + offset; + titleY = _alignStartEnd(align, bottom, top); + rotation = PI * -0.5; + } else { + titleX = right - offset; + titleY = _alignStartEnd(align, top, bottom); + rotation = PI * 0.5; + } + maxWidth = bottom - top; + } + return { + titleX, + titleY, + maxWidth, + rotation + }; + } + draw() { + const ctx = this.ctx; + const opts = this.options; + if (!opts.display) { + return; + } + const fontOpts = toFont(opts.font); + const lineHeight = fontOpts.lineHeight; + const offset = lineHeight / 2 + this._padding.top; + const { titleX, titleY, maxWidth, rotation } = this._drawArgs(offset); + renderText(ctx, opts.text, 0, 0, fontOpts, { + color: opts.color, + maxWidth, + rotation, + textAlign: _toLeftRightCenter(opts.align), + textBaseline: "middle", + translation: [ + titleX, + titleY + ] + }); + } + }; + plugin_title = { + id: "title", + _element: Title, + start(chart2, _args, options) { + createTitle(chart2, options); + }, + stop(chart2) { + const titleBlock = chart2.titleBlock; + layouts.removeBox(chart2, titleBlock); + delete chart2.titleBlock; + }, + beforeUpdate(chart2, _args, options) { + const title = chart2.titleBlock; + layouts.configure(chart2, title, options); + title.options = options; + }, + defaults: { + align: "center", + display: false, + font: { + weight: "bold" + }, + fullSize: true, + padding: 10, + position: "top", + text: "", + weight: 2e3 + }, + defaultRoutes: { + color: "color" + }, + descriptors: { + _scriptable: true, + _indexable: false + } + }; + map2 = /* @__PURE__ */ new WeakMap(); + plugin_subtitle = { + id: "subtitle", + start(chart2, _args, options) { + const title = new Title({ + ctx: chart2.ctx, + options, + chart: chart2 + }); + layouts.configure(chart2, title, options); + layouts.addBox(chart2, title); + map2.set(chart2, title); + }, + stop(chart2) { + layouts.removeBox(chart2, map2.get(chart2)); + map2.delete(chart2); + }, + beforeUpdate(chart2, _args, options) { + const title = map2.get(chart2); + layouts.configure(chart2, title, options); + title.options = options; + }, + defaults: { + align: "center", + display: false, + font: { + weight: "normal" + }, + fullSize: true, + padding: 0, + position: "top", + text: "", + weight: 1500 + }, + defaultRoutes: { + color: "color" + }, + descriptors: { + _scriptable: true, + _indexable: false + } + }; + positioners = { + average(items) { + if (!items.length) { + return false; + } + let i, len; + let xSet = /* @__PURE__ */ new Set(); + let y = 0; + let count = 0; + for (i = 0, len = items.length; i < len; ++i) { + const el2 = items[i].element; + if (el2 && el2.hasValue()) { + const pos = el2.tooltipPosition(); + xSet.add(pos.x); + y += pos.y; + ++count; + } + } + if (count === 0 || xSet.size === 0) { + return false; + } + const xAverage = [ + ...xSet + ].reduce((a, b) => a + b) / xSet.size; + return { + x: xAverage, + y: y / count + }; + }, + nearest(items, eventPosition) { + if (!items.length) { + return false; + } + let x = eventPosition.x; + let y = eventPosition.y; + let minDistance = Number.POSITIVE_INFINITY; + let i, len, nearestElement; + for (i = 0, len = items.length; i < len; ++i) { + const el2 = items[i].element; + if (el2 && el2.hasValue()) { + const center = el2.getCenterPoint(); + const d = distanceBetweenPoints(eventPosition, center); + if (d < minDistance) { + minDistance = d; + nearestElement = el2; + } + } + } + if (nearestElement) { + const tp = nearestElement.tooltipPosition(); + x = tp.x; + y = tp.y; + } + return { + x, + y + }; + } + }; + defaultCallbacks = { + beforeTitle: noop, + title(tooltipItems) { + if (tooltipItems.length > 0) { + const item = tooltipItems[0]; + const labels = item.chart.data.labels; + const labelCount = labels ? labels.length : 0; + if (this && this.options && this.options.mode === "dataset") { + return item.dataset.label || ""; + } else if (item.label) { + return item.label; + } else if (labelCount > 0 && item.dataIndex < labelCount) { + return labels[item.dataIndex]; + } + } + return ""; + }, + afterTitle: noop, + beforeBody: noop, + beforeLabel: noop, + label(tooltipItem) { + if (this && this.options && this.options.mode === "dataset") { + return tooltipItem.label + ": " + tooltipItem.formattedValue || tooltipItem.formattedValue; + } + let label = tooltipItem.dataset.label || ""; + if (label) { + label += ": "; + } + const value = tooltipItem.formattedValue; + if (!isNullOrUndef(value)) { + label += value; + } + return label; + }, + labelColor(tooltipItem) { + const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); + const options = meta.controller.getStyle(tooltipItem.dataIndex); + return { + borderColor: options.borderColor, + backgroundColor: options.backgroundColor, + borderWidth: options.borderWidth, + borderDash: options.borderDash, + borderDashOffset: options.borderDashOffset, + borderRadius: 0 + }; + }, + labelTextColor() { + return this.options.bodyColor; + }, + labelPointStyle(tooltipItem) { + const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex); + const options = meta.controller.getStyle(tooltipItem.dataIndex); + return { + pointStyle: options.pointStyle, + rotation: options.rotation + }; + }, + afterLabel: noop, + afterBody: noop, + beforeFooter: noop, + footer: noop, + afterFooter: noop + }; + Tooltip = class extends Element2 { + constructor(config) { + super(); + this.opacity = 0; + this._active = []; + this._eventPosition = void 0; + this._size = void 0; + this._cachedAnimations = void 0; + this._tooltipItems = []; + this.$animations = void 0; + this.$context = void 0; + this.chart = config.chart; + this.options = config.options; + this.dataPoints = void 0; + this.title = void 0; + this.beforeBody = void 0; + this.body = void 0; + this.afterBody = void 0; + this.footer = void 0; + this.xAlign = void 0; + this.yAlign = void 0; + this.x = void 0; + this.y = void 0; + this.height = void 0; + this.width = void 0; + this.caretX = void 0; + this.caretY = void 0; + this.labelColors = void 0; + this.labelPointStyles = void 0; + this.labelTextColors = void 0; + } + initialize(options) { + this.options = options; + this._cachedAnimations = void 0; + this.$context = void 0; + } + _resolveAnimations() { + const cached = this._cachedAnimations; + if (cached) { + return cached; + } + const chart2 = this.chart; + const options = this.options.setContext(this.getContext()); + const opts = options.enabled && chart2.options.animation && options.animations; + const animations = new Animations(this.chart, opts); + if (opts._cacheable) { + this._cachedAnimations = Object.freeze(animations); + } + return animations; + } + getContext() { + return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems)); + } + getTitle(context, options) { + const { callbacks } = options; + const beforeTitle = invokeCallbackWithFallback(callbacks, "beforeTitle", this, context); + const title = invokeCallbackWithFallback(callbacks, "title", this, context); + const afterTitle = invokeCallbackWithFallback(callbacks, "afterTitle", this, context); + let lines = []; + lines = pushOrConcat(lines, splitNewlines(beforeTitle)); + lines = pushOrConcat(lines, splitNewlines(title)); + lines = pushOrConcat(lines, splitNewlines(afterTitle)); + return lines; + } + getBeforeBody(tooltipItems, options) { + return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, "beforeBody", this, tooltipItems)); + } + getBody(tooltipItems, options) { + const { callbacks } = options; + const bodyItems = []; + each(tooltipItems, (context) => { + const bodyItem = { + before: [], + lines: [], + after: [] + }; + const scoped = overrideCallbacks(callbacks, context); + pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, "beforeLabel", this, context))); + pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, "label", this, context)); + pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, "afterLabel", this, context))); + bodyItems.push(bodyItem); + }); + return bodyItems; + } + getAfterBody(tooltipItems, options) { + return getBeforeAfterBodyLines(invokeCallbackWithFallback(options.callbacks, "afterBody", this, tooltipItems)); + } + getFooter(tooltipItems, options) { + const { callbacks } = options; + const beforeFooter = invokeCallbackWithFallback(callbacks, "beforeFooter", this, tooltipItems); + const footer = invokeCallbackWithFallback(callbacks, "footer", this, tooltipItems); + const afterFooter = invokeCallbackWithFallback(callbacks, "afterFooter", this, tooltipItems); + let lines = []; + lines = pushOrConcat(lines, splitNewlines(beforeFooter)); + lines = pushOrConcat(lines, splitNewlines(footer)); + lines = pushOrConcat(lines, splitNewlines(afterFooter)); + return lines; + } + _createItems(options) { + const active = this._active; + const data = this.chart.data; + const labelColors = []; + const labelPointStyles = []; + const labelTextColors = []; + let tooltipItems = []; + let i, len; + for (i = 0, len = active.length; i < len; ++i) { + tooltipItems.push(createTooltipItem(this.chart, active[i])); + } + if (options.filter) { + tooltipItems = tooltipItems.filter((element, index2, array) => options.filter(element, index2, array, data)); + } + if (options.itemSort) { + tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data)); + } + each(tooltipItems, (context) => { + const scoped = overrideCallbacks(options.callbacks, context); + labelColors.push(invokeCallbackWithFallback(scoped, "labelColor", this, context)); + labelPointStyles.push(invokeCallbackWithFallback(scoped, "labelPointStyle", this, context)); + labelTextColors.push(invokeCallbackWithFallback(scoped, "labelTextColor", this, context)); + }); + this.labelColors = labelColors; + this.labelPointStyles = labelPointStyles; + this.labelTextColors = labelTextColors; + this.dataPoints = tooltipItems; + return tooltipItems; + } + update(changed, replay) { + const options = this.options.setContext(this.getContext()); + const active = this._active; + let properties; + let tooltipItems = []; + if (!active.length) { + if (this.opacity !== 0) { + properties = { + opacity: 0 + }; + } + } else { + const position = positioners[options.position].call(this, active, this._eventPosition); + tooltipItems = this._createItems(options); + this.title = this.getTitle(tooltipItems, options); + this.beforeBody = this.getBeforeBody(tooltipItems, options); + this.body = this.getBody(tooltipItems, options); + this.afterBody = this.getAfterBody(tooltipItems, options); + this.footer = this.getFooter(tooltipItems, options); + const size = this._size = getTooltipSize(this, options); + const positionAndSize = Object.assign({}, position, size); + const alignment = determineAlignment(this.chart, options, positionAndSize); + const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart); + this.xAlign = alignment.xAlign; + this.yAlign = alignment.yAlign; + properties = { + opacity: 1, + x: backgroundPoint.x, + y: backgroundPoint.y, + width: size.width, + height: size.height, + caretX: position.x, + caretY: position.y + }; + } + this._tooltipItems = tooltipItems; + this.$context = void 0; + if (properties) { + this._resolveAnimations().update(this, properties); + } + if (changed && options.external) { + options.external.call(this, { + chart: this.chart, + tooltip: this, + replay + }); + } + } + drawCaret(tooltipPoint, ctx, size, options) { + const caretPosition = this.getCaretPosition(tooltipPoint, size, options); + ctx.lineTo(caretPosition.x1, caretPosition.y1); + ctx.lineTo(caretPosition.x2, caretPosition.y2); + ctx.lineTo(caretPosition.x3, caretPosition.y3); + } + getCaretPosition(tooltipPoint, size, options) { + const { xAlign, yAlign } = this; + const { caretSize, cornerRadius: cornerRadius2 } = options; + const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius2); + const { x: ptX, y: ptY } = tooltipPoint; + const { width, height } = size; + let x1, x2, x3, y1, y2, y3; + if (yAlign === "center") { + y2 = ptY + height / 2; + if (xAlign === "left") { + x1 = ptX; + x2 = x1 - caretSize; + y1 = y2 + caretSize; + y3 = y2 - caretSize; + } else { + x1 = ptX + width; + x2 = x1 + caretSize; + y1 = y2 - caretSize; + y3 = y2 + caretSize; + } + x3 = x1; + } else { + if (xAlign === "left") { + x2 = ptX + Math.max(topLeft, bottomLeft) + caretSize; + } else if (xAlign === "right") { + x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize; + } else { + x2 = this.caretX; + } + if (yAlign === "top") { + y1 = ptY; + y2 = y1 - caretSize; + x1 = x2 - caretSize; + x3 = x2 + caretSize; + } else { + y1 = ptY + height; + y2 = y1 + caretSize; + x1 = x2 + caretSize; + x3 = x2 - caretSize; + } + y3 = y1; + } + return { + x1, + x2, + x3, + y1, + y2, + y3 + }; + } + drawTitle(pt, ctx, options) { + const title = this.title; + const length = title.length; + let titleFont, titleSpacing, i; + if (length) { + const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width); + pt.x = getAlignedX(this, options.titleAlign, options); + ctx.textAlign = rtlHelper.textAlign(options.titleAlign); + ctx.textBaseline = "middle"; + titleFont = toFont(options.titleFont); + titleSpacing = options.titleSpacing; + ctx.fillStyle = options.titleColor; + ctx.font = titleFont.string; + for (i = 0; i < length; ++i) { + ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2); + pt.y += titleFont.lineHeight + titleSpacing; + if (i + 1 === length) { + pt.y += options.titleMarginBottom - titleSpacing; + } + } + } + } + _drawColorBox(ctx, pt, i, rtlHelper, options) { + const labelColor = this.labelColors[i]; + const labelPointStyle = this.labelPointStyles[i]; + const { boxHeight, boxWidth } = options; + const bodyFont = toFont(options.bodyFont); + const colorX = getAlignedX(this, "left", options); + const rtlColorX = rtlHelper.x(colorX); + const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0; + const colorY = pt.y + yOffSet; + if (options.usePointStyle) { + const drawOptions = { + radius: Math.min(boxWidth, boxHeight) / 2, + pointStyle: labelPointStyle.pointStyle, + rotation: labelPointStyle.rotation, + borderWidth: 1 + }; + const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2; + const centerY = colorY + boxHeight / 2; + ctx.strokeStyle = options.multiKeyBackground; + ctx.fillStyle = options.multiKeyBackground; + drawPoint(ctx, drawOptions, centerX, centerY); + ctx.strokeStyle = labelColor.borderColor; + ctx.fillStyle = labelColor.backgroundColor; + drawPoint(ctx, drawOptions, centerX, centerY); + } else { + ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : labelColor.borderWidth || 1; + ctx.strokeStyle = labelColor.borderColor; + ctx.setLineDash(labelColor.borderDash || []); + ctx.lineDashOffset = labelColor.borderDashOffset || 0; + const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth); + const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2); + const borderRadius = toTRBLCorners(labelColor.borderRadius); + if (Object.values(borderRadius).some((v) => v !== 0)) { + ctx.beginPath(); + ctx.fillStyle = options.multiKeyBackground; + addRoundedRectPath(ctx, { + x: outerX, + y: colorY, + w: boxWidth, + h: boxHeight, + radius: borderRadius + }); + ctx.fill(); + ctx.stroke(); + ctx.fillStyle = labelColor.backgroundColor; + ctx.beginPath(); + addRoundedRectPath(ctx, { + x: innerX, + y: colorY + 1, + w: boxWidth - 2, + h: boxHeight - 2, + radius: borderRadius + }); + ctx.fill(); + } else { + ctx.fillStyle = options.multiKeyBackground; + ctx.fillRect(outerX, colorY, boxWidth, boxHeight); + ctx.strokeRect(outerX, colorY, boxWidth, boxHeight); + ctx.fillStyle = labelColor.backgroundColor; + ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2); + } + } + ctx.fillStyle = this.labelTextColors[i]; + } + drawBody(pt, ctx, options) { + const { body } = this; + const { bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding } = options; + const bodyFont = toFont(options.bodyFont); + let bodyLineHeight = bodyFont.lineHeight; + let xLinePadding = 0; + const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width); + const fillLineOfText = function(line) { + ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2); + pt.y += bodyLineHeight + bodySpacing; + }; + const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign); + let bodyItem, textColor, lines, i, j, ilen, jlen; + ctx.textAlign = bodyAlign; + ctx.textBaseline = "middle"; + ctx.font = bodyFont.string; + pt.x = getAlignedX(this, bodyAlignForCalculation, options); + ctx.fillStyle = options.bodyColor; + each(this.beforeBody, fillLineOfText); + xLinePadding = displayColors && bodyAlignForCalculation !== "right" ? bodyAlign === "center" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0; + for (i = 0, ilen = body.length; i < ilen; ++i) { + bodyItem = body[i]; + textColor = this.labelTextColors[i]; + ctx.fillStyle = textColor; + each(bodyItem.before, fillLineOfText); + lines = bodyItem.lines; + if (displayColors && lines.length) { + this._drawColorBox(ctx, pt, i, rtlHelper, options); + bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight); + } + for (j = 0, jlen = lines.length; j < jlen; ++j) { + fillLineOfText(lines[j]); + bodyLineHeight = bodyFont.lineHeight; + } + each(bodyItem.after, fillLineOfText); + } + xLinePadding = 0; + bodyLineHeight = bodyFont.lineHeight; + each(this.afterBody, fillLineOfText); + pt.y -= bodySpacing; + } + drawFooter(pt, ctx, options) { + const footer = this.footer; + const length = footer.length; + let footerFont, i; + if (length) { + const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width); + pt.x = getAlignedX(this, options.footerAlign, options); + pt.y += options.footerMarginTop; + ctx.textAlign = rtlHelper.textAlign(options.footerAlign); + ctx.textBaseline = "middle"; + footerFont = toFont(options.footerFont); + ctx.fillStyle = options.footerColor; + ctx.font = footerFont.string; + for (i = 0; i < length; ++i) { + ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2); + pt.y += footerFont.lineHeight + options.footerSpacing; + } + } + } + drawBackground(pt, ctx, tooltipSize, options) { + const { xAlign, yAlign } = this; + const { x, y } = pt; + const { width, height } = tooltipSize; + const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(options.cornerRadius); + ctx.fillStyle = options.backgroundColor; + ctx.strokeStyle = options.borderColor; + ctx.lineWidth = options.borderWidth; + ctx.beginPath(); + ctx.moveTo(x + topLeft, y); + if (yAlign === "top") { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + width - topRight, y); + ctx.quadraticCurveTo(x + width, y, x + width, y + topRight); + if (yAlign === "center" && xAlign === "right") { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + width, y + height - bottomRight); + ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height); + if (yAlign === "bottom") { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x + bottomLeft, y + height); + ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft); + if (yAlign === "center" && xAlign === "left") { + this.drawCaret(pt, ctx, tooltipSize, options); + } + ctx.lineTo(x, y + topLeft); + ctx.quadraticCurveTo(x, y, x + topLeft, y); + ctx.closePath(); + ctx.fill(); + if (options.borderWidth > 0) { + ctx.stroke(); + } + } + _updateAnimationTarget(options) { + const chart2 = this.chart; + const anims = this.$animations; + const animX = anims && anims.x; + const animY = anims && anims.y; + if (animX || animY) { + const position = positioners[options.position].call(this, this._active, this._eventPosition); + if (!position) { + return; + } + const size = this._size = getTooltipSize(this, options); + const positionAndSize = Object.assign({}, position, this._size); + const alignment = determineAlignment(chart2, options, positionAndSize); + const point = getBackgroundPoint(options, positionAndSize, alignment, chart2); + if (animX._to !== point.x || animY._to !== point.y) { + this.xAlign = alignment.xAlign; + this.yAlign = alignment.yAlign; + this.width = size.width; + this.height = size.height; + this.caretX = position.x; + this.caretY = position.y; + this._resolveAnimations().update(this, point); + } + } + } + _willRender() { + return !!this.opacity; + } + draw(ctx) { + const options = this.options.setContext(this.getContext()); + let opacity = this.opacity; + if (!opacity) { + return; + } + this._updateAnimationTarget(options); + const tooltipSize = { + width: this.width, + height: this.height + }; + const pt = { + x: this.x, + y: this.y + }; + opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity; + const padding = toPadding(options.padding); + const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length; + if (options.enabled && hasTooltipContent) { + ctx.save(); + ctx.globalAlpha = opacity; + this.drawBackground(pt, ctx, tooltipSize, options); + overrideTextDirection(ctx, options.textDirection); + pt.y += padding.top; + this.drawTitle(pt, ctx, options); + this.drawBody(pt, ctx, options); + this.drawFooter(pt, ctx, options); + restoreTextDirection(ctx, options.textDirection); + ctx.restore(); + } + } + getActiveElements() { + return this._active || []; + } + setActiveElements(activeElements, eventPosition) { + const lastActive = this._active; + const active = activeElements.map(({ datasetIndex, index: index2 }) => { + const meta = this.chart.getDatasetMeta(datasetIndex); + if (!meta) { + throw new Error("Cannot find a dataset at index " + datasetIndex); + } + return { + datasetIndex, + element: meta.data[index2], + index: index2 + }; + }); + const changed = !_elementsEqual(lastActive, active); + const positionChanged = this._positionChanged(active, eventPosition); + if (changed || positionChanged) { + this._active = active; + this._eventPosition = eventPosition; + this._ignoreReplayEvents = true; + this.update(true); + } + } + handleEvent(e, replay, inChartArea = true) { + if (replay && this._ignoreReplayEvents) { + return false; + } + this._ignoreReplayEvents = false; + const options = this.options; + const lastActive = this._active || []; + const active = this._getActiveElements(e, lastActive, replay, inChartArea); + const positionChanged = this._positionChanged(active, e); + const changed = replay || !_elementsEqual(active, lastActive) || positionChanged; + if (changed) { + this._active = active; + if (options.enabled || options.external) { + this._eventPosition = { + x: e.x, + y: e.y + }; + this.update(true, replay); + } + } + return changed; + } + _getActiveElements(e, lastActive, replay, inChartArea) { + const options = this.options; + if (e.type === "mouseout") { + return []; + } + if (!inChartArea) { + return lastActive.filter((i) => this.chart.data.datasets[i.datasetIndex] && this.chart.getDatasetMeta(i.datasetIndex).controller.getParsed(i.index) !== void 0); + } + const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay); + if (options.reverse) { + active.reverse(); + } + return active; + } + _positionChanged(active, e) { + const { caretX, caretY, options } = this; + const position = positioners[options.position].call(this, active, e); + return position !== false && (caretX !== position.x || caretY !== position.y); + } + }; + __publicField(Tooltip, "positioners", positioners); + plugin_tooltip = { + id: "tooltip", + _element: Tooltip, + positioners, + afterInit(chart2, _args, options) { + if (options) { + chart2.tooltip = new Tooltip({ + chart: chart2, + options + }); + } + }, + beforeUpdate(chart2, _args, options) { + if (chart2.tooltip) { + chart2.tooltip.initialize(options); + } + }, + reset(chart2, _args, options) { + if (chart2.tooltip) { + chart2.tooltip.initialize(options); + } + }, + afterDraw(chart2) { + const tooltip = chart2.tooltip; + if (tooltip && tooltip._willRender()) { + const args = { + tooltip + }; + if (chart2.notifyPlugins("beforeTooltipDraw", { + ...args, + cancelable: true + }) === false) { + return; + } + tooltip.draw(chart2.ctx); + chart2.notifyPlugins("afterTooltipDraw", args); + } + }, + afterEvent(chart2, args) { + if (chart2.tooltip) { + const useFinalPosition = args.replay; + if (chart2.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) { + args.changed = true; + } + } + }, + defaults: { + enabled: true, + external: null, + position: "average", + backgroundColor: "rgba(0,0,0,0.8)", + titleColor: "#fff", + titleFont: { + weight: "bold" + }, + titleSpacing: 2, + titleMarginBottom: 6, + titleAlign: "left", + bodyColor: "#fff", + bodySpacing: 2, + bodyFont: {}, + bodyAlign: "left", + footerColor: "#fff", + footerSpacing: 2, + footerMarginTop: 6, + footerFont: { + weight: "bold" + }, + footerAlign: "left", + padding: 6, + caretPadding: 2, + caretSize: 5, + cornerRadius: 6, + boxHeight: (ctx, opts) => opts.bodyFont.size, + boxWidth: (ctx, opts) => opts.bodyFont.size, + multiKeyBackground: "#fff", + displayColors: true, + boxPadding: 0, + borderColor: "rgba(0,0,0,0)", + borderWidth: 0, + animation: { + duration: 400, + easing: "easeOutQuart" + }, + animations: { + numbers: { + type: "number", + properties: [ + "x", + "y", + "width", + "height", + "caretX", + "caretY" + ] + }, + opacity: { + easing: "linear", + duration: 200 + } + }, + callbacks: defaultCallbacks + }, + defaultRoutes: { + bodyFont: "font", + footerFont: "font", + titleFont: "font" + }, + descriptors: { + _scriptable: (name) => name !== "filter" && name !== "itemSort" && name !== "external", + _indexable: false, + callbacks: { + _scriptable: false, + _indexable: false + }, + animation: { + _fallback: false + }, + animations: { + _fallback: "animation" + } + }, + additionalOptionScopes: [ + "interaction" + ] + }; + plugins = /* @__PURE__ */ Object.freeze({ + __proto__: null, + Colors: plugin_colors, + Decimation: plugin_decimation, + Filler: index, + Legend: plugin_legend, + SubTitle: plugin_subtitle, + Title: plugin_title, + Tooltip: plugin_tooltip + }); + addIfString = (labels, raw, index2, addedLabels) => { + if (typeof raw === "string") { + index2 = labels.push(raw) - 1; + addedLabels.unshift({ + index: index2, + label: raw + }); + } else if (isNaN(raw)) { + index2 = null; + } + return index2; + }; + validIndex = (index2, max) => index2 === null ? null : _limitValue(Math.round(index2), 0, max); + CategoryScale = class extends Scale { + constructor(cfg) { + super(cfg); + this._startValue = void 0; + this._valueRange = 0; + this._addedLabels = []; + } + init(scaleOptions) { + const added = this._addedLabels; + if (added.length) { + const labels = this.getLabels(); + for (const { index: index2, label } of added) { + if (labels[index2] === label) { + labels.splice(index2, 1); + } + } + this._addedLabels = []; + } + super.init(scaleOptions); + } + parse(raw, index2) { + if (isNullOrUndef(raw)) { + return null; + } + const labels = this.getLabels(); + index2 = isFinite(index2) && labels[index2] === raw ? index2 : findOrAddLabel(labels, raw, valueOrDefault(index2, raw), this._addedLabels); + return validIndex(index2, labels.length - 1); + } + determineDataLimits() { + const { minDefined, maxDefined } = this.getUserBounds(); + let { min, max } = this.getMinMax(true); + if (this.options.bounds === "ticks") { + if (!minDefined) { + min = 0; + } + if (!maxDefined) { + max = this.getLabels().length - 1; + } + } + this.min = min; + this.max = max; + } + buildTicks() { + const min = this.min; + const max = this.max; + const offset = this.options.offset; + const ticks = []; + let labels = this.getLabels(); + labels = min === 0 && max === labels.length - 1 ? labels : labels.slice(min, max + 1); + this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1); + this._startValue = this.min - (offset ? 0.5 : 0); + for (let value = min; value <= max; value++) { + ticks.push({ + value + }); + } + return ticks; + } + getLabelForValue(value) { + return _getLabelForValue.call(this, value); + } + configure() { + super.configure(); + if (!this.isHorizontal()) { + this._reversePixels = !this._reversePixels; + } + } + getPixelForValue(value) { + if (typeof value !== "number") { + value = this.parse(value); + } + return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange); + } + getPixelForTick(index2) { + const ticks = this.ticks; + if (index2 < 0 || index2 > ticks.length - 1) { + return null; + } + return this.getPixelForValue(ticks[index2].value); + } + getValueForPixel(pixel) { + return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange); + } + getBasePixel() { + return this.bottom; + } + }; + __publicField(CategoryScale, "id", "category"); + __publicField(CategoryScale, "defaults", { + ticks: { + callback: _getLabelForValue + } + }); + LinearScaleBase = class extends Scale { + constructor(cfg) { + super(cfg); + this.start = void 0; + this.end = void 0; + this._startValue = void 0; + this._endValue = void 0; + this._valueRange = 0; + } + parse(raw, index2) { + if (isNullOrUndef(raw)) { + return null; + } + if ((typeof raw === "number" || raw instanceof Number) && !isFinite(+raw)) { + return null; + } + return +raw; + } + handleTickRangeOptions() { + const { beginAtZero } = this.options; + const { minDefined, maxDefined } = this.getUserBounds(); + let { min, max } = this; + const setMin = (v) => min = minDefined ? min : v; + const setMax = (v) => max = maxDefined ? max : v; + if (beginAtZero) { + const minSign = sign(min); + const maxSign = sign(max); + if (minSign < 0 && maxSign < 0) { + setMax(0); + } else if (minSign > 0 && maxSign > 0) { + setMin(0); + } + } + if (min === max) { + let offset = max === 0 ? 1 : Math.abs(max * 0.05); + setMax(max + offset); + if (!beginAtZero) { + setMin(min - offset); + } + } + this.min = min; + this.max = max; + } + getTickLimit() { + const tickOpts = this.options.ticks; + let { maxTicksLimit, stepSize } = tickOpts; + let maxTicks; + if (stepSize) { + maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1; + if (maxTicks > 1e3) { + console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`); + maxTicks = 1e3; + } + } else { + maxTicks = this.computeTickLimit(); + maxTicksLimit = maxTicksLimit || 11; + } + if (maxTicksLimit) { + maxTicks = Math.min(maxTicksLimit, maxTicks); + } + return maxTicks; + } + computeTickLimit() { + return Number.POSITIVE_INFINITY; + } + buildTicks() { + const opts = this.options; + const tickOpts = opts.ticks; + let maxTicks = this.getTickLimit(); + maxTicks = Math.max(2, maxTicks); + const numericGeneratorOptions = { + maxTicks, + bounds: opts.bounds, + min: opts.min, + max: opts.max, + precision: tickOpts.precision, + step: tickOpts.stepSize, + count: tickOpts.count, + maxDigits: this._maxDigits(), + horizontal: this.isHorizontal(), + minRotation: tickOpts.minRotation || 0, + includeBounds: tickOpts.includeBounds !== false + }; + const dataRange = this._range || this; + const ticks = generateTicks$1(numericGeneratorOptions, dataRange); + if (opts.bounds === "ticks") { + _setMinAndMaxByKey(ticks, this, "value"); + } + if (opts.reverse) { + ticks.reverse(); + this.start = this.max; + this.end = this.min; + } else { + this.start = this.min; + this.end = this.max; + } + return ticks; + } + configure() { + const ticks = this.ticks; + let start = this.min; + let end = this.max; + super.configure(); + if (this.options.offset && ticks.length) { + const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2; + start -= offset; + end += offset; + } + this._startValue = start; + this._endValue = end; + this._valueRange = end - start; + } + getLabelForValue(value) { + return formatNumber(value, this.chart.options.locale, this.options.ticks.format); + } + }; + LinearScale = class extends LinearScaleBase { + determineDataLimits() { + const { min, max } = this.getMinMax(true); + this.min = isNumberFinite(min) ? min : 0; + this.max = isNumberFinite(max) ? max : 1; + this.handleTickRangeOptions(); + } + computeTickLimit() { + const horizontal = this.isHorizontal(); + const length = horizontal ? this.width : this.height; + const minRotation = toRadians(this.options.ticks.minRotation); + const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 1e-3; + const tickFont = this._resolveTickFontOptions(0); + return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio)); + } + getPixelForValue(value) { + return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange); + } + getValueForPixel(pixel) { + return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange; + } + }; + __publicField(LinearScale, "id", "linear"); + __publicField(LinearScale, "defaults", { + ticks: { + callback: Ticks.formatters.numeric + } + }); + log10Floor = (v) => Math.floor(log10(v)); + changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m); + LogarithmicScale = class extends Scale { + constructor(cfg) { + super(cfg); + this.start = void 0; + this.end = void 0; + this._startValue = void 0; + this._valueRange = 0; + } + parse(raw, index2) { + const value = LinearScaleBase.prototype.parse.apply(this, [ + raw, + index2 + ]); + if (value === 0) { + this._zero = true; + return void 0; + } + return isNumberFinite(value) && value > 0 ? value : null; + } + determineDataLimits() { + const { min, max } = this.getMinMax(true); + this.min = isNumberFinite(min) ? Math.max(0, min) : null; + this.max = isNumberFinite(max) ? Math.max(0, max) : null; + if (this.options.beginAtZero) { + this._zero = true; + } + if (this._zero && this.min !== this._suggestedMin && !isNumberFinite(this._userMin)) { + this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0); + } + this.handleTickRangeOptions(); + } + handleTickRangeOptions() { + const { minDefined, maxDefined } = this.getUserBounds(); + let min = this.min; + let max = this.max; + const setMin = (v) => min = minDefined ? min : v; + const setMax = (v) => max = maxDefined ? max : v; + if (min === max) { + if (min <= 0) { + setMin(1); + setMax(10); + } else { + setMin(changeExponent(min, -1)); + setMax(changeExponent(max, 1)); + } + } + if (min <= 0) { + setMin(changeExponent(max, -1)); + } + if (max <= 0) { + setMax(changeExponent(min, 1)); + } + this.min = min; + this.max = max; + } + buildTicks() { + const opts = this.options; + const generationOptions = { + min: this._userMin, + max: this._userMax + }; + const ticks = generateTicks(generationOptions, this); + if (opts.bounds === "ticks") { + _setMinAndMaxByKey(ticks, this, "value"); + } + if (opts.reverse) { + ticks.reverse(); + this.start = this.max; + this.end = this.min; + } else { + this.start = this.min; + this.end = this.max; + } + return ticks; + } + getLabelForValue(value) { + return value === void 0 ? "0" : formatNumber(value, this.chart.options.locale, this.options.ticks.format); + } + configure() { + const start = this.min; + super.configure(); + this._startValue = log10(start); + this._valueRange = log10(this.max) - log10(start); + } + getPixelForValue(value) { + if (value === void 0 || value === 0) { + value = this.min; + } + if (value === null || isNaN(value)) { + return NaN; + } + return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange); + } + getValueForPixel(pixel) { + const decimal = this.getDecimalForPixel(pixel); + return Math.pow(10, this._startValue + decimal * this._valueRange); + } + }; + __publicField(LogarithmicScale, "id", "logarithmic"); + __publicField(LogarithmicScale, "defaults", { + ticks: { + callback: Ticks.formatters.logarithmic, + major: { + enabled: true + } + } + }); + RadialLinearScale = class extends LinearScaleBase { + constructor(cfg) { + super(cfg); + this.xCenter = void 0; + this.yCenter = void 0; + this.drawingArea = void 0; + this._pointLabels = []; + this._pointLabelItems = []; + } + setDimensions() { + const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2); + const w = this.width = this.maxWidth - padding.width; + const h = this.height = this.maxHeight - padding.height; + this.xCenter = Math.floor(this.left + w / 2 + padding.left); + this.yCenter = Math.floor(this.top + h / 2 + padding.top); + this.drawingArea = Math.floor(Math.min(w, h) / 2); + } + determineDataLimits() { + const { min, max } = this.getMinMax(false); + this.min = isNumberFinite(min) && !isNaN(min) ? min : 0; + this.max = isNumberFinite(max) && !isNaN(max) ? max : 0; + this.handleTickRangeOptions(); + } + computeTickLimit() { + return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options)); + } + generateTickLabels(ticks) { + LinearScaleBase.prototype.generateTickLabels.call(this, ticks); + this._pointLabels = this.getLabels().map((value, index2) => { + const label = callback(this.options.pointLabels.callback, [ + value, + index2 + ], this); + return label || label === 0 ? label : ""; + }).filter((v, i) => this.chart.getDataVisibility(i)); + } + fit() { + const opts = this.options; + if (opts.display && opts.pointLabels.display) { + fitWithPointLabels(this); + } else { + this.setCenterPoint(0, 0, 0, 0); + } + } + setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) { + this.xCenter += Math.floor((leftMovement - rightMovement) / 2); + this.yCenter += Math.floor((topMovement - bottomMovement) / 2); + this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement)); + } + getIndexAngle(index2) { + const angleMultiplier = TAU / (this._pointLabels.length || 1); + const startAngle = this.options.startAngle || 0; + return _normalizeAngle(index2 * angleMultiplier + toRadians(startAngle)); + } + getDistanceFromCenterForValue(value) { + if (isNullOrUndef(value)) { + return NaN; + } + const scalingFactor = this.drawingArea / (this.max - this.min); + if (this.options.reverse) { + return (this.max - value) * scalingFactor; + } + return (value - this.min) * scalingFactor; + } + getValueForDistanceFromCenter(distance) { + if (isNullOrUndef(distance)) { + return NaN; + } + const scaledDistance = distance / (this.drawingArea / (this.max - this.min)); + return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance; + } + getPointLabelContext(index2) { + const pointLabels = this._pointLabels || []; + if (index2 >= 0 && index2 < pointLabels.length) { + const pointLabel = pointLabels[index2]; + return createPointLabelContext(this.getContext(), index2, pointLabel); + } + } + getPointPosition(index2, distanceFromCenter, additionalAngle = 0) { + const angle = this.getIndexAngle(index2) - HALF_PI + additionalAngle; + return { + x: Math.cos(angle) * distanceFromCenter + this.xCenter, + y: Math.sin(angle) * distanceFromCenter + this.yCenter, + angle + }; + } + getPointPositionForValue(index2, value) { + return this.getPointPosition(index2, this.getDistanceFromCenterForValue(value)); + } + getBasePosition(index2) { + return this.getPointPositionForValue(index2 || 0, this.getBaseValue()); + } + getPointLabelPosition(index2) { + const { left, top, right, bottom } = this._pointLabelItems[index2]; + return { + left, + top, + right, + bottom + }; + } + drawBackground() { + const { backgroundColor, grid: { circular } } = this.options; + if (backgroundColor) { + const ctx = this.ctx; + ctx.save(); + ctx.beginPath(); + pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length); + ctx.closePath(); + ctx.fillStyle = backgroundColor; + ctx.fill(); + ctx.restore(); + } + } + drawGrid() { + const ctx = this.ctx; + const opts = this.options; + const { angleLines, grid, border } = opts; + const labelCount = this._pointLabels.length; + let i, offset, position; + if (opts.pointLabels.display) { + drawPointLabels(this, labelCount); + } + if (grid.display) { + this.ticks.forEach((tick, index2) => { + if (index2 !== 0 || index2 === 0 && this.min < 0) { + offset = this.getDistanceFromCenterForValue(tick.value); + const context = this.getContext(index2); + const optsAtIndex = grid.setContext(context); + const optsAtIndexBorder = border.setContext(context); + drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder); + } + }); + } + if (angleLines.display) { + ctx.save(); + for (i = labelCount - 1; i >= 0; i--) { + const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i)); + const { color: color2, lineWidth } = optsAtIndex; + if (!lineWidth || !color2) { + continue; + } + ctx.lineWidth = lineWidth; + ctx.strokeStyle = color2; + ctx.setLineDash(optsAtIndex.borderDash); + ctx.lineDashOffset = optsAtIndex.borderDashOffset; + offset = this.getDistanceFromCenterForValue(opts.reverse ? this.min : this.max); + position = this.getPointPosition(i, offset); + ctx.beginPath(); + ctx.moveTo(this.xCenter, this.yCenter); + ctx.lineTo(position.x, position.y); + ctx.stroke(); + } + ctx.restore(); + } + } + drawBorder() { + } + drawLabels() { + const ctx = this.ctx; + const opts = this.options; + const tickOpts = opts.ticks; + if (!tickOpts.display) { + return; + } + const startAngle = this.getIndexAngle(0); + let offset, width; + ctx.save(); + ctx.translate(this.xCenter, this.yCenter); + ctx.rotate(startAngle); + ctx.textAlign = "center"; + ctx.textBaseline = "middle"; + this.ticks.forEach((tick, index2) => { + if (index2 === 0 && this.min >= 0 && !opts.reverse) { + return; + } + const optsAtIndex = tickOpts.setContext(this.getContext(index2)); + const tickFont = toFont(optsAtIndex.font); + offset = this.getDistanceFromCenterForValue(this.ticks[index2].value); + if (optsAtIndex.showLabelBackdrop) { + ctx.font = tickFont.string; + width = ctx.measureText(tick.label).width; + ctx.fillStyle = optsAtIndex.backdropColor; + const padding = toPadding(optsAtIndex.backdropPadding); + ctx.fillRect(-width / 2 - padding.left, -offset - tickFont.size / 2 - padding.top, width + padding.width, tickFont.size + padding.height); + } + renderText(ctx, tick.label, 0, -offset, tickFont, { + color: optsAtIndex.color, + strokeColor: optsAtIndex.textStrokeColor, + strokeWidth: optsAtIndex.textStrokeWidth + }); + }); + ctx.restore(); + } + drawTitle() { + } + }; + __publicField(RadialLinearScale, "id", "radialLinear"); + __publicField(RadialLinearScale, "defaults", { + display: true, + animate: true, + position: "chartArea", + angleLines: { + display: true, + lineWidth: 1, + borderDash: [], + borderDashOffset: 0 + }, + grid: { + circular: false + }, + startAngle: 0, + ticks: { + showLabelBackdrop: true, + callback: Ticks.formatters.numeric + }, + pointLabels: { + backdropColor: void 0, + backdropPadding: 2, + display: true, + font: { + size: 10 + }, + callback(label) { + return label; + }, + padding: 5, + centerPointLabels: false + } + }); + __publicField(RadialLinearScale, "defaultRoutes", { + "angleLines.color": "borderColor", + "pointLabels.color": "color", + "ticks.color": "color" + }); + __publicField(RadialLinearScale, "descriptors", { + angleLines: { + _fallback: "grid" + } + }); + INTERVALS = { + millisecond: { + common: true, + size: 1, + steps: 1e3 + }, + second: { + common: true, + size: 1e3, + steps: 60 + }, + minute: { + common: true, + size: 6e4, + steps: 60 + }, + hour: { + common: true, + size: 36e5, + steps: 24 + }, + day: { + common: true, + size: 864e5, + steps: 30 + }, + week: { + common: false, + size: 6048e5, + steps: 4 + }, + month: { + common: true, + size: 2628e6, + steps: 12 + }, + quarter: { + common: false, + size: 7884e6, + steps: 4 + }, + year: { + common: true, + size: 3154e7 + } + }; + UNITS = /* @__PURE__ */ Object.keys(INTERVALS); + TimeScale = class extends Scale { + constructor(props) { + super(props); + this._cache = { + data: [], + labels: [], + all: [] + }; + this._unit = "day"; + this._majorUnit = void 0; + this._offsets = {}; + this._normalized = false; + this._parseOpts = void 0; + } + init(scaleOpts, opts = {}) { + const time = scaleOpts.time || (scaleOpts.time = {}); + const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date); + adapter.init(opts); + mergeIf(time.displayFormats, adapter.formats()); + this._parseOpts = { + parser: time.parser, + round: time.round, + isoWeekday: time.isoWeekday + }; + super.init(scaleOpts); + this._normalized = opts.normalized; + } + parse(raw, index2) { + if (raw === void 0) { + return null; + } + return parse(this, raw); + } + beforeLayout() { + super.beforeLayout(); + this._cache = { + data: [], + labels: [], + all: [] + }; + } + determineDataLimits() { + const options = this.options; + const adapter = this._adapter; + const unit = options.time.unit || "day"; + let { min, max, minDefined, maxDefined } = this.getUserBounds(); + function _applyBounds(bounds) { + if (!minDefined && !isNaN(bounds.min)) { + min = Math.min(min, bounds.min); + } + if (!maxDefined && !isNaN(bounds.max)) { + max = Math.max(max, bounds.max); + } + } + if (!minDefined || !maxDefined) { + _applyBounds(this._getLabelBounds()); + if (options.bounds !== "ticks" || options.ticks.source !== "labels") { + _applyBounds(this.getMinMax(false)); + } + } + min = isNumberFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit); + max = isNumberFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1; + this.min = Math.min(min, max - 1); + this.max = Math.max(min + 1, max); + } + _getLabelBounds() { + const arr = this.getLabelTimestamps(); + let min = Number.POSITIVE_INFINITY; + let max = Number.NEGATIVE_INFINITY; + if (arr.length) { + min = arr[0]; + max = arr[arr.length - 1]; + } + return { + min, + max + }; + } + buildTicks() { + const options = this.options; + const timeOpts = options.time; + const tickOpts = options.ticks; + const timestamps = tickOpts.source === "labels" ? this.getLabelTimestamps() : this._generate(); + if (options.bounds === "ticks" && timestamps.length) { + this.min = this._userMin || timestamps[0]; + this.max = this._userMax || timestamps[timestamps.length - 1]; + } + const min = this.min; + const max = this.max; + const ticks = _filterBetween(timestamps, min, max); + this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max)); + this._majorUnit = !tickOpts.major.enabled || this._unit === "year" ? void 0 : determineMajorUnit(this._unit); + this.initOffsets(timestamps); + if (options.reverse) { + ticks.reverse(); + } + return ticksFromTimestamps(this, ticks, this._majorUnit); + } + afterAutoSkip() { + if (this.options.offsetAfterAutoskip) { + this.initOffsets(this.ticks.map((tick) => +tick.value)); + } + } + initOffsets(timestamps = []) { + let start = 0; + let end = 0; + let first, last; + if (this.options.offset && timestamps.length) { + first = this.getDecimalForValue(timestamps[0]); + if (timestamps.length === 1) { + start = 1 - first; + } else { + start = (this.getDecimalForValue(timestamps[1]) - first) / 2; + } + last = this.getDecimalForValue(timestamps[timestamps.length - 1]); + if (timestamps.length === 1) { + end = last; + } else { + end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2; + } + } + const limit2 = timestamps.length < 3 ? 0.5 : 0.25; + start = _limitValue(start, 0, limit2); + end = _limitValue(end, 0, limit2); + this._offsets = { + start, + end, + factor: 1 / (start + 1 + end) + }; + } + _generate() { + const adapter = this._adapter; + const min = this.min; + const max = this.max; + const options = this.options; + const timeOpts = options.time; + const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min)); + const stepSize = valueOrDefault(options.ticks.stepSize, 1); + const weekday = minor === "week" ? timeOpts.isoWeekday : false; + const hasWeekday = isNumber(weekday) || weekday === true; + const ticks = {}; + let first = min; + let time, count; + if (hasWeekday) { + first = +adapter.startOf(first, "isoWeek", weekday); + } + first = +adapter.startOf(first, hasWeekday ? "day" : minor); + if (adapter.diff(max, min, minor) > 1e5 * stepSize) { + throw new Error(min + " and " + max + " are too far apart with stepSize of " + stepSize + " " + minor); + } + const timestamps = options.ticks.source === "data" && this.getDataTimestamps(); + for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) { + addTick(ticks, time, timestamps); + } + if (time === max || options.bounds === "ticks" || count === 1) { + addTick(ticks, time, timestamps); + } + return Object.keys(ticks).sort(sorter).map((x) => +x); + } + getLabelForValue(value) { + const adapter = this._adapter; + const timeOpts = this.options.time; + if (timeOpts.tooltipFormat) { + return adapter.format(value, timeOpts.tooltipFormat); + } + return adapter.format(value, timeOpts.displayFormats.datetime); + } + format(value, format) { + const options = this.options; + const formats = options.time.displayFormats; + const unit = this._unit; + const fmt = format || formats[unit]; + return this._adapter.format(value, fmt); + } + _tickFormatFunction(time, index2, ticks, format) { + const options = this.options; + const formatter = options.ticks.callback; + if (formatter) { + return callback(formatter, [ + time, + index2, + ticks + ], this); + } + const formats = options.time.displayFormats; + const unit = this._unit; + const majorUnit = this._majorUnit; + const minorFormat = unit && formats[unit]; + const majorFormat = majorUnit && formats[majorUnit]; + const tick = ticks[index2]; + const major = majorUnit && majorFormat && tick && tick.major; + return this._adapter.format(time, format || (major ? majorFormat : minorFormat)); + } + generateTickLabels(ticks) { + let i, ilen, tick; + for (i = 0, ilen = ticks.length; i < ilen; ++i) { + tick = ticks[i]; + tick.label = this._tickFormatFunction(tick.value, i, ticks); + } + } + getDecimalForValue(value) { + return value === null ? NaN : (value - this.min) / (this.max - this.min); + } + getPixelForValue(value) { + const offsets = this._offsets; + const pos = this.getDecimalForValue(value); + return this.getPixelForDecimal((offsets.start + pos) * offsets.factor); + } + getValueForPixel(pixel) { + const offsets = this._offsets; + const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end; + return this.min + pos * (this.max - this.min); + } + _getLabelSize(label) { + const ticksOpts = this.options.ticks; + const tickLabelWidth = this.ctx.measureText(label).width; + const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation); + const cosRotation = Math.cos(angle); + const sinRotation = Math.sin(angle); + const tickFontSize = this._resolveTickFontOptions(0).size; + return { + w: tickLabelWidth * cosRotation + tickFontSize * sinRotation, + h: tickLabelWidth * sinRotation + tickFontSize * cosRotation + }; + } + _getLabelCapacity(exampleTime) { + const timeOpts = this.options.time; + const displayFormats = timeOpts.displayFormats; + const format = displayFormats[timeOpts.unit] || displayFormats.millisecond; + const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [ + exampleTime + ], this._majorUnit), format); + const size = this._getLabelSize(exampleLabel); + const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1; + return capacity > 0 ? capacity : 1; + } + getDataTimestamps() { + let timestamps = this._cache.data || []; + let i, ilen; + if (timestamps.length) { + return timestamps; + } + const metas = this.getMatchingVisibleMetas(); + if (this._normalized && metas.length) { + return this._cache.data = metas[0].controller.getAllParsedValues(this); + } + for (i = 0, ilen = metas.length; i < ilen; ++i) { + timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this)); + } + return this._cache.data = this.normalize(timestamps); + } + getLabelTimestamps() { + const timestamps = this._cache.labels || []; + let i, ilen; + if (timestamps.length) { + return timestamps; + } + const labels = this.getLabels(); + for (i = 0, ilen = labels.length; i < ilen; ++i) { + timestamps.push(parse(this, labels[i])); + } + return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps); + } + normalize(values) { + return _arrayUnique(values.sort(sorter)); + } + }; + __publicField(TimeScale, "id", "time"); + __publicField(TimeScale, "defaults", { + bounds: "data", + adapters: {}, + time: { + parser: false, + unit: false, + round: false, + isoWeekday: false, + minUnit: "millisecond", + displayFormats: {} + }, + ticks: { + source: "auto", + callback: false, + major: { + enabled: false + } + } + }); + TimeSeriesScale = class extends TimeScale { + constructor(props) { + super(props); + this._table = []; + this._minPos = void 0; + this._tableRange = void 0; + } + initOffsets() { + const timestamps = this._getTimestampsForTable(); + const table = this._table = this.buildLookupTable(timestamps); + this._minPos = interpolate2(table, this.min); + this._tableRange = interpolate2(table, this.max) - this._minPos; + super.initOffsets(timestamps); + } + buildLookupTable(timestamps) { + const { min, max } = this; + const items = []; + const table = []; + let i, ilen, prev, curr, next; + for (i = 0, ilen = timestamps.length; i < ilen; ++i) { + curr = timestamps[i]; + if (curr >= min && curr <= max) { + items.push(curr); + } + } + if (items.length < 2) { + return [ + { + time: min, + pos: 0 + }, + { + time: max, + pos: 1 + } + ]; + } + for (i = 0, ilen = items.length; i < ilen; ++i) { + next = items[i + 1]; + prev = items[i - 1]; + curr = items[i]; + if (Math.round((next + prev) / 2) !== curr) { + table.push({ + time: curr, + pos: i / (ilen - 1) + }); + } + } + return table; + } + _generate() { + const min = this.min; + const max = this.max; + let timestamps = super.getDataTimestamps(); + if (!timestamps.includes(min) || !timestamps.length) { + timestamps.splice(0, 0, min); + } + if (!timestamps.includes(max) || timestamps.length === 1) { + timestamps.push(max); + } + return timestamps.sort((a, b) => a - b); + } + _getTimestampsForTable() { + let timestamps = this._cache.all || []; + if (timestamps.length) { + return timestamps; + } + const data = this.getDataTimestamps(); + const label = this.getLabelTimestamps(); + if (data.length && label.length) { + timestamps = this.normalize(data.concat(label)); + } else { + timestamps = data.length ? data : label; + } + timestamps = this._cache.all = timestamps; + return timestamps; + } + getDecimalForValue(value) { + return (interpolate2(this._table, value) - this._minPos) / this._tableRange; + } + getValueForPixel(pixel) { + const offsets = this._offsets; + const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end; + return interpolate2(this._table, decimal * this._tableRange + this._minPos, true); + } + }; + __publicField(TimeSeriesScale, "id", "timeseries"); + __publicField(TimeSeriesScale, "defaults", TimeScale.defaults); + scales = /* @__PURE__ */ Object.freeze({ + __proto__: null, + CategoryScale, + LinearScale, + LogarithmicScale, + RadialLinearScale, + TimeScale, + TimeSeriesScale + }); + registerables = [ + controllers, + elements, + plugins, + scales + ]; + } + }); + + // node_modules/chart.js/auto/auto.js + var auto_exports = {}; + __export(auto_exports, { + Animation: () => Animation, + Animations: () => Animations, + ArcElement: () => ArcElement, + BarController: () => BarController, + BarElement: () => BarElement, + BasePlatform: () => BasePlatform, + BasicPlatform: () => BasicPlatform, + BubbleController: () => BubbleController, + CategoryScale: () => CategoryScale, + Chart: () => Chart, + Colors: () => plugin_colors, + DatasetController: () => DatasetController, + Decimation: () => plugin_decimation, + DomPlatform: () => DomPlatform, + DoughnutController: () => DoughnutController, + Element: () => Element2, + Filler: () => index, + Interaction: () => Interaction, + Legend: () => plugin_legend, + LineController: () => LineController, + LineElement: () => LineElement, + LinearScale: () => LinearScale, + LogarithmicScale: () => LogarithmicScale, + PieController: () => PieController, + PointElement: () => PointElement, + PolarAreaController: () => PolarAreaController, + RadarController: () => RadarController, + RadialLinearScale: () => RadialLinearScale, + Scale: () => Scale, + ScatterController: () => ScatterController, + SubTitle: () => plugin_subtitle, + Ticks: () => Ticks, + TimeScale: () => TimeScale, + TimeSeriesScale: () => TimeSeriesScale, + Title: () => plugin_title, + Tooltip: () => plugin_tooltip, + _adapters: () => adapters, + _detectPlatform: () => _detectPlatform, + animator: () => animator, + controllers: () => controllers, + default: () => auto_default, + defaults: () => defaults, + elements: () => elements, + layouts: () => layouts, + plugins: () => plugins, + registerables: () => registerables, + registry: () => registry, + scales: () => scales + }); + var auto_default; + var init_auto = __esm({ + "node_modules/chart.js/auto/auto.js"() { + init_chart(); + init_chart(); + Chart.register(...registerables); + auto_default = Chart; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/platform.js + function createMetadataLocator() { + const metadataLookup = /* @__PURE__ */ new WeakMap(); + return function(target) { + let metadata = metadataLookup.get(target); + if (metadata === void 0) { + let currentTarget = Reflect.getPrototypeOf(target); + while (metadata === void 0 && currentTarget !== null) { + metadata = metadataLookup.get(currentTarget); + currentTarget = Reflect.getPrototypeOf(currentTarget); + } + metadata = metadata === void 0 ? [] : metadata.slice(0); + metadataLookup.set(target, metadata); + } + return metadata; + }; + } + var $global, propConfig, FAST, emptyArray; + var init_platform = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/platform.js"() { + $global = (function() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + try { + return new Function("return this")(); + } catch (_a) { + return {}; + } + })(); + if ($global.trustedTypes === void 0) { + $global.trustedTypes = { createPolicy: (n, r) => r }; + } + propConfig = { + configurable: false, + enumerable: false, + writable: false + }; + if ($global.FAST === void 0) { + Reflect.defineProperty($global, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, propConfig)); + } + FAST = $global.FAST; + if (FAST.getById === void 0) { + const storage = /* @__PURE__ */ Object.create(null); + Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) { + let found = storage[id]; + if (found === void 0) { + found = initialize ? storage[id] = initialize() : null; + } + return found; + } }, propConfig)); + } + emptyArray = Object.freeze([]); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/dom.js + var updateQueue, fastHTMLPolicy, htmlPolicy, marker, _interpolationStart, _interpolationEnd, DOM; + var init_dom = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/dom.js"() { + init_platform(); + updateQueue = $global.FAST.getById(1, () => { + const tasks = []; + const pendingErrors = []; + function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } + } + function tryRunTask(task) { + try { + task.call(); + } catch (error) { + pendingErrors.push(error); + setTimeout(throwFirstError, 0); + } + } + function process() { + const capacity = 1024; + let index2 = 0; + while (index2 < tasks.length) { + tryRunTask(tasks[index2]); + index2++; + if (index2 > capacity) { + for (let scan = 0, newLength = tasks.length - index2; scan < newLength; scan++) { + tasks[scan] = tasks[scan + index2]; + } + tasks.length -= index2; + index2 = 0; + } + } + tasks.length = 0; + } + function enqueue(callable) { + if (tasks.length < 1) { + $global.requestAnimationFrame(process); + } + tasks.push(callable); + } + return Object.freeze({ + enqueue, + process + }); + }); + fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { + createHTML: (html2) => html2 + }); + htmlPolicy = fastHTMLPolicy; + marker = `fast-${Math.random().toString(36).substring(2, 8)}`; + _interpolationStart = `${marker}{`; + _interpolationEnd = `}${marker}`; + DOM = Object.freeze({ + /** + * Indicates whether the DOM supports the adoptedStyleSheets feature. + */ + supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, + /** + * Sets the HTML trusted types policy used by the templating engine. + * @param policy - The policy to set for HTML. + * @remarks + * This API can only be called once, for security reasons. It should be + * called by the application developer at the start of their program. + */ + setHTMLPolicy(policy) { + if (htmlPolicy !== fastHTMLPolicy) { + throw new Error("The HTML policy can only be set once."); + } + htmlPolicy = policy; + }, + /** + * Turns a string into trusted HTML using the configured trusted types policy. + * @param html - The string to turn into trusted HTML. + * @remarks + * Used internally by the template engine when creating templates + * and setting innerHTML. + */ + createHTML(html2) { + return htmlPolicy.createHTML(html2); + }, + /** + * Determines if the provided node is a template marker used by the runtime. + * @param node - The node to test. + */ + isMarker(node) { + return node && node.nodeType === 8 && node.data.startsWith(marker); + }, + /** + * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. + * @param node - The marker node to extract the index from. + */ + extractDirectiveIndexFromMarker(node) { + return parseInt(node.data.replace(`${marker}:`, "")); + }, + /** + * Creates a placeholder string suitable for marking out a location *within* + * an attribute value or HTML content. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by binding directives. + */ + createInterpolationPlaceholder(index2) { + return `${_interpolationStart}${index2}${_interpolationEnd}`; + }, + /** + * Creates a placeholder that manifests itself as an attribute on an + * element. + * @param attributeName - The name of the custom attribute. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by attribute directives such as `ref`, `slotted`, and `children`. + */ + createCustomAttributePlaceholder(attributeName, index2) { + return `${attributeName}="${this.createInterpolationPlaceholder(index2)}"`; + }, + /** + * Creates a placeholder that manifests itself as a marker within the DOM structure. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by structural directives such as `repeat`. + */ + createBlockPlaceholder(index2) { + return ``; + }, + /** + * Schedules DOM update work in the next async batch. + * @param callable - The callable function or object to queue. + */ + queueUpdate: updateQueue.enqueue, + /** + * Immediately processes all work previously scheduled + * through queueUpdate. + * @remarks + * This also forces nextUpdate promises + * to resolve. + */ + processUpdates: updateQueue.process, + /** + * Resolves with the next DOM update. + */ + nextUpdate() { + return new Promise(updateQueue.enqueue); + }, + /** + * Sets an attribute value on an element. + * @param element - The element to set the attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is `null` or `undefined`, the attribute is removed, otherwise + * it is set to the provided value using the standard `setAttribute` API. + */ + setAttribute(element, attributeName, value) { + if (value === null || value === void 0) { + element.removeAttribute(attributeName); + } else { + element.setAttribute(attributeName, value); + } + }, + /** + * Sets a boolean attribute value. + * @param element - The element to set the boolean attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is true, the attribute is added; otherwise it is removed. + */ + setBooleanAttribute(element, attributeName, value) { + value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); + }, + /** + * Removes all the child nodes of the provided parent node. + * @param parent - The node to remove the children from. + */ + removeChildNodes(parent) { + for (let child = parent.firstChild; child !== null; child = parent.firstChild) { + parent.removeChild(child); + } + }, + /** + * Creates a TreeWalker configured to walk a template fragment. + * @param fragment - The fragment to walk. + */ + createTemplateWalker(fragment) { + return document.createTreeWalker( + fragment, + 133, + // element, text, comment + null, + false + ); + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js + var SubscriberSet, PropertyChangeNotifier; + var init_notifier = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js"() { + SubscriberSet = class { + /** + * Creates an instance of SubscriberSet for the specified source. + * @param source - The object source that subscribers will receive notifications from. + * @param initialSubscriber - An initial subscriber to changes. + */ + constructor(source, initialSubscriber) { + this.sub1 = void 0; + this.sub2 = void 0; + this.spillover = void 0; + this.source = source; + this.sub1 = initialSubscriber; + } + /** + * Checks whether the provided subscriber has been added to this set. + * @param subscriber - The subscriber to test for inclusion in this set. + */ + has(subscriber) { + return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + */ + subscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.has(subscriber)) { + return; + } + if (this.sub1 === void 0) { + this.sub1 = subscriber; + return; + } + if (this.sub2 === void 0) { + this.sub2 = subscriber; + return; + } + this.spillover = [this.sub1, this.sub2, subscriber]; + this.sub1 = void 0; + this.sub2 = void 0; + } else { + const index2 = spillover.indexOf(subscriber); + if (index2 === -1) { + spillover.push(subscriber); + } + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + */ + unsubscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.sub1 === subscriber) { + this.sub1 = void 0; + } else if (this.sub2 === subscriber) { + this.sub2 = void 0; + } + } else { + const index2 = spillover.indexOf(subscriber); + if (index2 !== -1) { + spillover.splice(index2, 1); + } + } + } + /** + * Notifies all subscribers. + * @param args - Data passed along to subscribers during notification. + */ + notify(args) { + const spillover = this.spillover; + const source = this.source; + if (spillover === void 0) { + const sub1 = this.sub1; + const sub2 = this.sub2; + if (sub1 !== void 0) { + sub1.handleChange(source, args); + } + if (sub2 !== void 0) { + sub2.handleChange(source, args); + } + } else { + for (let i = 0, ii = spillover.length; i < ii; ++i) { + spillover[i].handleChange(source, args); + } + } + } + }; + PropertyChangeNotifier = class { + /** + * Creates an instance of PropertyChangeNotifier for the specified source. + * @param source - The object source that subscribers will receive notifications from. + */ + constructor(source) { + this.subscribers = {}; + this.sourceSubscribers = null; + this.source = source; + } + /** + * Notifies all subscribers, based on the specified property. + * @param propertyName - The property name, passed along to subscribers during notification. + */ + notify(propertyName) { + var _a; + const subscribers = this.subscribers[propertyName]; + if (subscribers !== void 0) { + subscribers.notify(propertyName); + } + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. + */ + subscribe(subscriber, propertyToWatch) { + var _a; + if (propertyToWatch) { + let subscribers = this.subscribers[propertyToWatch]; + if (subscribers === void 0) { + this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); + } + subscribers.subscribe(subscriber); + } else { + this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); + this.sourceSubscribers.subscribe(subscriber); + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. + */ + unsubscribe(subscriber, propertyToUnwatch) { + var _a; + if (propertyToUnwatch) { + const subscribers = this.subscribers[propertyToUnwatch]; + if (subscribers !== void 0) { + subscribers.unsubscribe(subscriber); + } + } else { + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/observable.js + function observable(target, nameOrAccessor) { + Observable.defineProperty(target, nameOrAccessor); + } + function volatile(target, name, descriptor) { + return Object.assign({}, descriptor, { + get: function() { + Observable.trackVolatile(); + return descriptor.get.apply(this); + } + }); + } + var Observable, contextEvent, ExecutionContext, defaultExecutionContext; + var init_observable = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/observable.js"() { + init_dom(); + init_platform(); + init_notifier(); + Observable = FAST.getById(2, () => { + const volatileRegex = /(:|&&|\|\||if)/; + const notifierLookup = /* @__PURE__ */ new WeakMap(); + const queueUpdate = DOM.queueUpdate; + let watcher = void 0; + let createArrayObserver = (array) => { + throw new Error("Must call enableArrayObservation before observing arrays."); + }; + function getNotifier(source) { + let found = source.$fastController || notifierLookup.get(source); + if (found === void 0) { + if (Array.isArray(source)) { + found = createArrayObserver(source); + } else { + notifierLookup.set(source, found = new PropertyChangeNotifier(source)); + } + } + return found; + } + const getAccessors = createMetadataLocator(); + class DefaultObservableAccessor { + constructor(name) { + this.name = name; + this.field = `_${name}`; + this.callback = `${name}Changed`; + } + getValue(source) { + if (watcher !== void 0) { + watcher.watch(source, this.name); + } + return source[this.field]; + } + setValue(source, newValue) { + const field = this.field; + const oldValue = source[field]; + if (oldValue !== newValue) { + source[field] = newValue; + const callback2 = source[this.callback]; + if (typeof callback2 === "function") { + callback2.call(source, oldValue, newValue); + } + getNotifier(source).notify(this.name); + } + } + } + class BindingObserverImplementation extends SubscriberSet { + constructor(binding, initialSubscriber, isVolatileBinding = false) { + super(binding, initialSubscriber); + this.binding = binding; + this.isVolatileBinding = isVolatileBinding; + this.needsRefresh = true; + this.needsQueue = true; + this.first = this; + this.last = null; + this.propertySource = void 0; + this.propertyName = void 0; + this.notifier = void 0; + this.next = void 0; + } + observe(source, context) { + if (this.needsRefresh && this.last !== null) { + this.disconnect(); + } + const previousWatcher = watcher; + watcher = this.needsRefresh ? this : void 0; + this.needsRefresh = this.isVolatileBinding; + const result = this.binding(source, context); + watcher = previousWatcher; + return result; + } + disconnect() { + if (this.last !== null) { + let current = this.first; + while (current !== void 0) { + current.notifier.unsubscribe(this, current.propertyName); + current = current.next; + } + this.last = null; + this.needsRefresh = this.needsQueue = true; + } + } + watch(propertySource, propertyName) { + const prev = this.last; + const notifier = getNotifier(propertySource); + const current = prev === null ? this.first : {}; + current.propertySource = propertySource; + current.propertyName = propertyName; + current.notifier = notifier; + notifier.subscribe(this, propertyName); + if (prev !== null) { + if (!this.needsRefresh) { + let prevValue; + watcher = void 0; + prevValue = prev.propertySource[prev.propertyName]; + watcher = this; + if (propertySource === prevValue) { + this.needsRefresh = true; + } + } + prev.next = current; + } + this.last = current; + } + handleChange() { + if (this.needsQueue) { + this.needsQueue = false; + queueUpdate(this); + } + } + call() { + if (this.last !== null) { + this.needsQueue = true; + this.notify(this); + } + } + records() { + let next = this.first; + return { + next: () => { + const current = next; + if (current === void 0) { + return { value: void 0, done: true }; + } else { + next = next.next; + return { + value: current, + done: false + }; + } + }, + [Symbol.iterator]: function() { + return this; + } + }; + } + } + return Object.freeze({ + /** + * @internal + * @param factory - The factory used to create array observers. + */ + setArrayObserverFactory(factory) { + createArrayObserver = factory; + }, + /** + * Gets a notifier for an object or Array. + * @param source - The object or Array to get the notifier for. + */ + getNotifier, + /** + * Records a property change for a source object. + * @param source - The object to record the change against. + * @param propertyName - The property to track as changed. + */ + track(source, propertyName) { + if (watcher !== void 0) { + watcher.watch(source, propertyName); + } + }, + /** + * Notifies watchers that the currently executing property getter or function is volatile + * with respect to its observable dependencies. + */ + trackVolatile() { + if (watcher !== void 0) { + watcher.needsRefresh = true; + } + }, + /** + * Notifies subscribers of a source object of changes. + * @param source - the object to notify of changes. + * @param args - The change args to pass to subscribers. + */ + notify(source, args) { + getNotifier(source).notify(args); + }, + /** + * Defines an observable property on an object or prototype. + * @param target - The target object to define the observable on. + * @param nameOrAccessor - The name of the property to define as observable; + * or a custom accessor that specifies the property name and accessor implementation. + */ + defineProperty(target, nameOrAccessor) { + if (typeof nameOrAccessor === "string") { + nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); + } + getAccessors(target).push(nameOrAccessor); + Reflect.defineProperty(target, nameOrAccessor.name, { + enumerable: true, + get: function() { + return nameOrAccessor.getValue(this); + }, + set: function(newValue) { + nameOrAccessor.setValue(this, newValue); + } + }); + }, + /** + * Finds all the observable accessors defined on the target, + * including its prototype chain. + * @param target - The target object to search for accessor on. + */ + getAccessors, + /** + * Creates a {@link BindingObserver} that can watch the + * provided {@link Binding} for changes. + * @param binding - The binding to observe. + * @param initialSubscriber - An initial subscriber to changes in the binding value. + * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. + */ + binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) { + return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding); + }, + /** + * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated + * on every evaluation of the value. + * @param binding - The binding to inspect. + */ + isVolatileBinding(binding) { + return volatileRegex.test(binding.toString()); + } + }); + }); + contextEvent = FAST.getById(3, () => { + let current = null; + return { + get() { + return current; + }, + set(event) { + current = event; + } + }; + }); + ExecutionContext = class { + constructor() { + this.index = 0; + this.length = 0; + this.parent = null; + this.parentContext = null; + } + /** + * The current event within an event handler. + */ + get event() { + return contextEvent.get(); + } + /** + * Indicates whether the current item within a repeat context + * has an even index. + */ + get isEven() { + return this.index % 2 === 0; + } + /** + * Indicates whether the current item within a repeat context + * has an odd index. + */ + get isOdd() { + return this.index % 2 !== 0; + } + /** + * Indicates whether the current item within a repeat context + * is the first item in the collection. + */ + get isFirst() { + return this.index === 0; + } + /** + * Indicates whether the current item within a repeat context + * is somewhere in the middle of the collection. + */ + get isInMiddle() { + return !this.isFirst && !this.isLast; + } + /** + * Indicates whether the current item within a repeat context + * is the last item in the collection. + */ + get isLast() { + return this.index === this.length - 1; + } + /** + * Sets the event for the current execution context. + * @param event - The event to set. + * @internal + */ + static setEvent(event) { + contextEvent.set(event); + } + }; + Observable.defineProperty(ExecutionContext.prototype, "index"); + Observable.defineProperty(ExecutionContext.prototype, "length"); + defaultExecutionContext = Object.seal(new ExecutionContext()); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js + var HTMLDirective, TargetedHTMLDirective, AttachedBehaviorHTMLDirective; + var init_html_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js"() { + init_dom(); + HTMLDirective = class { + constructor() { + this.targetIndex = 0; + } + }; + TargetedHTMLDirective = class extends HTMLDirective { + constructor() { + super(...arguments); + this.createPlaceholder = DOM.createInterpolationPlaceholder; + } + }; + AttachedBehaviorHTMLDirective = class extends HTMLDirective { + /** + * + * @param name - The name of the behavior; used as a custom attribute on the element. + * @param behavior - The behavior to instantiate and attach to the element. + * @param options - Options to pass to the behavior during creation. + */ + constructor(name, behavior, options) { + super(); + this.name = name; + this.behavior = behavior; + this.options = options; + } + /** + * Creates a placeholder string based on the directive's index within the template. + * @param index - The index of the directive within the template. + * @remarks + * Creates a custom attribute placeholder. + */ + createPlaceholder(index2) { + return DOM.createCustomAttributePlaceholder(this.name, index2); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + * @remarks + * Creates an instance of the `behavior` type this directive was constructed with + * and passes the target and options to that `behavior`'s constructor. + */ + createBehavior(target) { + return new this.behavior(target, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/binding.js + function normalBind(source, context) { + this.source = source; + this.context = context; + if (this.bindingObserver === null) { + this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); + } + this.updateTarget(this.bindingObserver.observe(source, context)); + } + function triggerBind(source, context) { + this.source = source; + this.context = context; + this.target.addEventListener(this.targetName, this); + } + function normalUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + } + function contentUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.unbind(); + view.needsBindOnly = true; + } + } + function triggerUnbind() { + this.target.removeEventListener(this.targetName, this); + this.source = null; + this.context = null; + } + function updateAttributeTarget(value) { + DOM.setAttribute(this.target, this.targetName, value); + } + function updateBooleanAttributeTarget(value) { + DOM.setBooleanAttribute(this.target, this.targetName, value); + } + function updateContentTarget(value) { + if (value === null || value === void 0) { + value = ""; + } + if (value.create) { + this.target.textContent = ""; + let view = this.target.$fastView; + if (view === void 0) { + view = value.create(); + } else { + if (this.target.$fastTemplate !== value) { + if (view.isComposed) { + view.remove(); + view.unbind(); + } + view = value.create(); + } + } + if (!view.isComposed) { + view.isComposed = true; + view.bind(this.source, this.context); + view.insertBefore(this.target); + this.target.$fastView = view; + this.target.$fastTemplate = value; + } else if (view.needsBindOnly) { + view.needsBindOnly = false; + view.bind(this.source, this.context); + } + } else { + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.isComposed = false; + view.remove(); + if (view.needsBindOnly) { + view.needsBindOnly = false; + } else { + view.unbind(); + } + } + this.target.textContent = value; + } + } + function updatePropertyTarget(value) { + this.target[this.targetName] = value; + } + function updateClassTarget(value) { + const classVersions = this.classVersions || /* @__PURE__ */ Object.create(null); + const target = this.target; + let version2 = this.version || 0; + if (value !== null && value !== void 0 && value.length) { + const names2 = value.split(/\s+/); + for (let i = 0, ii = names2.length; i < ii; ++i) { + const currentName = names2[i]; + if (currentName === "") { + continue; + } + classVersions[currentName] = version2; + target.classList.add(currentName); + } + } + this.classVersions = classVersions; + this.version = version2 + 1; + if (version2 === 0) { + return; + } + version2 -= 1; + for (const name in classVersions) { + if (classVersions[name] === version2) { + target.classList.remove(name); + } + } + } + var HTMLBindingDirective, BindingBehavior; + var init_binding = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/binding.js"() { + init_dom(); + init_observable(); + init_html_directive(); + HTMLBindingDirective = class extends TargetedHTMLDirective { + /** + * Creates an instance of BindingDirective. + * @param binding - A binding that returns the data used to update the DOM. + */ + constructor(binding) { + super(); + this.binding = binding; + this.bind = normalBind; + this.unbind = normalUnbind; + this.updateTarget = updateAttributeTarget; + this.isBindingVolatile = Observable.isVolatileBinding(this.binding); + } + /** + * Gets/sets the name of the attribute or property that this + * binding is targeting. + */ + get targetName() { + return this.originalTargetName; + } + set targetName(value) { + this.originalTargetName = value; + if (value === void 0) { + return; + } + switch (value[0]) { + case ":": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updatePropertyTarget; + if (this.cleanedTargetName === "innerHTML") { + const binding = this.binding; + this.binding = (s, c) => DOM.createHTML(binding(s, c)); + } + break; + case "?": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updateBooleanAttributeTarget; + break; + case "@": + this.cleanedTargetName = value.substr(1); + this.bind = triggerBind; + this.unbind = triggerUnbind; + break; + default: + this.cleanedTargetName = value; + if (value === "class") { + this.updateTarget = updateClassTarget; + } + break; + } + } + /** + * Makes this binding target the content of an element rather than + * a particular attribute or property. + */ + targetAtContent() { + this.updateTarget = updateContentTarget; + this.unbind = contentUnbind; + } + /** + * Creates the runtime BindingBehavior instance based on the configuration + * information stored in the BindingDirective. + * @param target - The target node that the binding behavior should attach to. + */ + createBehavior(target) { + return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); + } + }; + BindingBehavior = class { + /** + * Creates an instance of BindingBehavior. + * @param target - The target of the data updates. + * @param binding - The binding that returns the latest value for an update. + * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. + * @param bind - The operation to perform during binding. + * @param unbind - The operation to perform during unbinding. + * @param updateTarget - The operation to perform when updating. + * @param targetName - The name of the target attribute or property to update. + */ + constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { + this.source = null; + this.context = null; + this.bindingObserver = null; + this.target = target; + this.binding = binding; + this.isBindingVolatile = isBindingVolatile; + this.bind = bind; + this.unbind = unbind; + this.updateTarget = updateTarget; + this.targetName = targetName; + } + /** @internal */ + handleChange() { + this.updateTarget(this.bindingObserver.observe(this.source, this.context)); + } + /** @internal */ + handleEvent(event) { + ExecutionContext.setEvent(event); + const result = this.binding(this.source, this.context); + ExecutionContext.setEvent(null); + if (result !== true) { + event.preventDefault(); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js + function createAggregateBinding(parts) { + if (parts.length === 1) { + return parts[0]; + } + let targetName; + const partCount = parts.length; + const finalParts = parts.map((x) => { + if (typeof x === "string") { + return () => x; + } + targetName = x.targetName || targetName; + return x.binding; + }); + const binding = (scope, context) => { + let output = ""; + for (let i = 0; i < partCount; ++i) { + output += finalParts[i](scope, context); + } + return output; + }; + const directive = new HTMLBindingDirective(binding); + directive.targetName = targetName; + return directive; + } + function parseContent(context, value) { + const valueParts = value.split(_interpolationStart); + if (valueParts.length === 1) { + return null; + } + const bindingParts = []; + for (let i = 0, ii = valueParts.length; i < ii; ++i) { + const current = valueParts[i]; + const index2 = current.indexOf(_interpolationEnd); + let literal; + if (index2 === -1) { + literal = current; + } else { + const directiveIndex = parseInt(current.substring(0, index2)); + bindingParts.push(context.directives[directiveIndex]); + literal = current.substring(index2 + interpolationEndLength); + } + if (literal !== "") { + bindingParts.push(literal); + } + } + return bindingParts; + } + function compileAttributes(context, node, includeBasicValues = false) { + const attributes = node.attributes; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const attr2 = attributes[i]; + const attrValue = attr2.value; + const parseResult = parseContent(context, attrValue); + let result = null; + if (parseResult === null) { + if (includeBasicValues) { + result = new HTMLBindingDirective(() => attrValue); + result.targetName = attr2.name; + } + } else { + result = createAggregateBinding(parseResult); + } + if (result !== null) { + node.removeAttributeNode(attr2); + i--; + ii--; + context.addFactory(result); + } + } + } + function compileContent(context, node, walker) { + const parseResult = parseContent(context, node.textContent); + if (parseResult !== null) { + let lastNode = node; + for (let i = 0, ii = parseResult.length; i < ii; ++i) { + const currentPart = parseResult[i]; + const currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); + if (typeof currentPart === "string") { + currentNode.textContent = currentPart; + } else { + currentNode.textContent = " "; + context.captureContentBinding(currentPart); + } + lastNode = currentNode; + context.targetIndex++; + if (currentNode !== node) { + walker.nextNode(); + } + } + context.targetIndex--; + } + } + function compileTemplate(template, directives) { + const fragment = template.content; + document.adoptNode(fragment); + const context = CompilationContext.borrow(directives); + compileAttributes(context, template, true); + const hostBehaviorFactories = context.behaviorFactories; + context.reset(); + const walker = DOM.createTemplateWalker(fragment); + let node; + while (node = walker.nextNode()) { + context.targetIndex++; + switch (node.nodeType) { + case 1: + compileAttributes(context, node); + break; + case 3: + compileContent(context, node, walker); + break; + case 8: + if (DOM.isMarker(node)) { + context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); + } + } + } + let targetOffset = 0; + if ( + // If the first node in a fragment is a marker, that means it's an unstable first node, + // because something like a when, repeat, etc. could add nodes before the marker. + // To mitigate this, we insert a stable first node. However, if we insert a node, + // that will alter the result of the TreeWalker. So, we also need to offset the target index. + DOM.isMarker(fragment.firstChild) || // Or if there is only one node and a directive, it means the template's content + // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by + // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. + fragment.childNodes.length === 1 && directives.length + ) { + fragment.insertBefore(document.createComment(""), fragment.firstChild); + targetOffset = -1; + } + const viewBehaviorFactories = context.behaviorFactories; + context.release(); + return { + fragment, + viewBehaviorFactories, + hostBehaviorFactories, + targetOffset + }; + } + var sharedContext, CompilationContext, interpolationEndLength; + var init_compiler = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js"() { + init_dom(); + init_binding(); + sharedContext = null; + CompilationContext = class _CompilationContext { + addFactory(factory) { + factory.targetIndex = this.targetIndex; + this.behaviorFactories.push(factory); + } + captureContentBinding(directive) { + directive.targetAtContent(); + this.addFactory(directive); + } + reset() { + this.behaviorFactories = []; + this.targetIndex = -1; + } + release() { + sharedContext = this; + } + static borrow(directives) { + const shareable = sharedContext || new _CompilationContext(); + shareable.directives = directives; + shareable.reset(); + sharedContext = null; + return shareable; + } + }; + interpolationEndLength = _interpolationEnd.length; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/view.js + var range, HTMLView; + var init_view = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/view.js"() { + range = document.createRange(); + HTMLView = class { + /** + * Constructs an instance of HTMLView. + * @param fragment - The html fragment that contains the nodes for this view. + * @param behaviors - The behaviors to be applied to this view. + */ + constructor(fragment, behaviors) { + this.fragment = fragment; + this.behaviors = behaviors; + this.source = null; + this.context = null; + this.firstChild = fragment.firstChild; + this.lastChild = fragment.lastChild; + } + /** + * Appends the view's DOM nodes to the referenced node. + * @param node - The parent node to append the view's DOM nodes to. + */ + appendTo(node) { + node.appendChild(this.fragment); + } + /** + * Inserts the view's DOM nodes before the referenced node. + * @param node - The node to insert the view's DOM before. + */ + insertBefore(node) { + if (this.fragment.hasChildNodes()) { + node.parentNode.insertBefore(this.fragment, node); + } else { + const end = this.lastChild; + if (node.previousSibling === end) + return; + const parentNode = node.parentNode; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parentNode.insertBefore(current, node); + current = next; + } + parentNode.insertBefore(end, node); + } + } + /** + * Removes the view's DOM nodes. + * The nodes are not disposed and the view can later be re-inserted. + */ + remove() { + const fragment = this.fragment; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + fragment.appendChild(current); + current = next; + } + fragment.appendChild(end); + } + /** + * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. + * Once a view has been disposed, it cannot be inserted or bound again. + */ + dispose() { + const parent = this.firstChild.parentNode; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parent.removeChild(current); + current = next; + } + parent.removeChild(end); + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + } + /** + * Binds a view's behaviors to its binding source. + * @param source - The binding source for the view's binding behaviors. + * @param context - The execution context to run the behaviors within. + */ + bind(source, context) { + const behaviors = this.behaviors; + if (this.source === source) { + return; + } else if (this.source !== null) { + const oldSource = this.source; + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + const current = behaviors[i]; + current.unbind(oldSource); + current.bind(source, context); + } + } else { + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].bind(source, context); + } + } + } + /** + * Unbinds a view's behaviors from its binding source. + */ + unbind() { + if (this.source === null) { + return; + } + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + this.source = null; + } + /** + * Efficiently disposes of a contiguous range of synthetic view instances. + * @param views - A contiguous range of views to be disposed. + */ + static disposeContiguousBatch(views) { + if (views.length === 0) { + return; + } + range.setStartBefore(views[0].firstChild); + range.setEndAfter(views[views.length - 1].lastChild); + range.deleteContents(); + for (let i = 0, ii = views.length; i < ii; ++i) { + const view = views[i]; + const behaviors = view.behaviors; + const oldSource = view.source; + for (let j = 0, jj = behaviors.length; j < jj; ++j) { + behaviors[j].unbind(oldSource); + } + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/template.js + function html(strings, ...values) { + const directives = []; + let html2 = ""; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + const currentString = strings[i]; + let value = values[i]; + html2 += currentString; + if (value instanceof ViewTemplate) { + const template = value; + value = () => template; + } + if (typeof value === "function") { + value = new HTMLBindingDirective(value); + } + if (value instanceof TargetedHTMLDirective) { + const match = lastAttributeNameRegex.exec(currentString); + if (match !== null) { + value.targetName = match[2]; + } + } + if (value instanceof HTMLDirective) { + html2 += value.createPlaceholder(directives.length); + directives.push(value); + } else { + html2 += value; + } + } + html2 += strings[strings.length - 1]; + return new ViewTemplate(html2, directives); + } + var ViewTemplate, lastAttributeNameRegex; + var init_template = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/template.js"() { + init_dom(); + init_observable(); + init_compiler(); + init_view(); + init_html_directive(); + init_binding(); + ViewTemplate = class { + /** + * Creates an instance of ViewTemplate. + * @param html - The html representing what this template will instantiate, including placeholders for directives. + * @param directives - The directives that will be connected to placeholders in the html. + */ + constructor(html2, directives) { + this.behaviorCount = 0; + this.hasHostBehaviors = false; + this.fragment = null; + this.targetOffset = 0; + this.viewBehaviorFactories = null; + this.hostBehaviorFactories = null; + this.html = html2; + this.directives = directives; + } + /** + * Creates an HTMLView instance based on this template definition. + * @param hostBindingTarget - The element that host behaviors will be bound to. + */ + create(hostBindingTarget) { + if (this.fragment === null) { + let template; + const html2 = this.html; + if (typeof html2 === "string") { + template = document.createElement("template"); + template.innerHTML = DOM.createHTML(html2); + const fec = template.content.firstElementChild; + if (fec !== null && fec.tagName === "TEMPLATE") { + template = fec; + } + } else { + template = html2; + } + const result = compileTemplate(template, this.directives); + this.fragment = result.fragment; + this.viewBehaviorFactories = result.viewBehaviorFactories; + this.hostBehaviorFactories = result.hostBehaviorFactories; + this.targetOffset = result.targetOffset; + this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; + this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; + } + const fragment = this.fragment.cloneNode(true); + const viewFactories = this.viewBehaviorFactories; + const behaviors = new Array(this.behaviorCount); + const walker = DOM.createTemplateWalker(fragment); + let behaviorIndex = 0; + let targetIndex = this.targetOffset; + let node = walker.nextNode(); + for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { + const factory = viewFactories[behaviorIndex]; + const factoryIndex = factory.targetIndex; + while (node !== null) { + if (targetIndex === factoryIndex) { + behaviors[behaviorIndex] = factory.createBehavior(node); + break; + } else { + node = walker.nextNode(); + targetIndex++; + } + } + } + if (this.hasHostBehaviors) { + const hostFactories = this.hostBehaviorFactories; + for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) { + behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); + } + } + return new HTMLView(fragment, behaviors); + } + /** + * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. + * @param source - The data source to bind the template to. + * @param host - The Element where the template will be rendered. + * @param hostBindingTarget - An HTML element to target the host bindings at if different from the + * host that the template is being attached to. + */ + render(source, host, hostBindingTarget) { + if (typeof host === "string") { + host = document.getElementById(host); + } + if (hostBindingTarget === void 0) { + hostBindingTarget = host; + } + const view = this.create(hostBindingTarget); + view.bind(source, defaultExecutionContext); + view.appendTo(host); + return view; + } + }; + lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ + /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js + function reduceStyles(styles) { + return styles.map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x]).reduce((prev, curr) => prev.concat(curr), []); + } + function reduceBehaviors(styles) { + return styles.map((x) => x instanceof ElementStyles ? x.behaviors : null).reduce((prev, curr) => { + if (curr === null) { + return prev; + } + if (prev === null) { + prev = []; + } + return prev.concat(curr); + }, null); + } + function separateSheetsToPrepend(sheets) { + const prepend = []; + const append = []; + sheets.forEach((x) => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x)); + return { prepend, append }; + } + function getNextStyleClass() { + return `fast-style-class-${++styleClassId}`; + } + var ElementStyles, prependToAdoptedStyleSheetsSymbol, addAdoptedStyleSheets, removeAdoptedStyleSheets, AdoptedStyleSheetsStyles, styleClassId, StyleElementStyles; + var init_element_styles = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js"() { + init_dom(); + ElementStyles = class { + constructor() { + this.targets = /* @__PURE__ */ new WeakSet(); + } + /** @internal */ + addStylesTo(target) { + this.targets.add(target); + } + /** @internal */ + removeStylesFrom(target) { + this.targets.delete(target); + } + /** @internal */ + isAttachedTo(target) { + return this.targets.has(target); + } + /** + * Associates behaviors with this set of styles. + * @param behaviors - The behaviors to associate. + */ + withBehaviors(...behaviors) { + this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); + return this; + } + }; + ElementStyles.create = (() => { + if (DOM.supportsAdoptedStyleSheets) { + const styleSheetCache = /* @__PURE__ */ new Map(); + return (styles) => ( + // eslint-disable-next-line @typescript-eslint/no-use-before-define + new AdoptedStyleSheetsStyles(styles, styleSheetCache) + ); + } + return (styles) => new StyleElementStyles(styles); + })(); + prependToAdoptedStyleSheetsSymbol = /* @__PURE__ */ Symbol("prependToAdoptedStyleSheets"); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append]; + }; + removeAdoptedStyleSheets = (target, sheets) => { + target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1); + }; + if (DOM.supportsAdoptedStyleSheets) { + try { + document.adoptedStyleSheets.push(); + document.adoptedStyleSheets.splice(); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets.splice(0, 0, ...prepend); + target.adoptedStyleSheets.push(...append); + }; + removeAdoptedStyleSheets = (target, sheets) => { + for (const sheet of sheets) { + const index2 = target.adoptedStyleSheets.indexOf(sheet); + if (index2 !== -1) { + target.adoptedStyleSheets.splice(index2, 1); + } + } + }; + } catch (e) { + } + } + AdoptedStyleSheetsStyles = class extends ElementStyles { + constructor(styles, styleSheetCache) { + super(); + this.styles = styles; + this.styleSheetCache = styleSheetCache; + this._styleSheets = void 0; + this.behaviors = reduceBehaviors(styles); + } + get styleSheets() { + if (this._styleSheets === void 0) { + const styles = this.styles; + const styleSheetCache = this.styleSheetCache; + this._styleSheets = reduceStyles(styles).map((x) => { + if (x instanceof CSSStyleSheet) { + return x; + } + let sheet = styleSheetCache.get(x); + if (sheet === void 0) { + sheet = new CSSStyleSheet(); + sheet.replaceSync(x); + styleSheetCache.set(x, sheet); + } + return sheet; + }); + } + return this._styleSheets; + } + addStylesTo(target) { + addAdoptedStyleSheets(target, this.styleSheets); + super.addStylesTo(target); + } + removeStylesFrom(target) { + removeAdoptedStyleSheets(target, this.styleSheets); + super.removeStylesFrom(target); + } + }; + styleClassId = 0; + StyleElementStyles = class extends ElementStyles { + constructor(styles) { + super(); + this.styles = styles; + this.behaviors = null; + this.behaviors = reduceBehaviors(styles); + this.styleSheets = reduceStyles(styles); + this.styleClass = getNextStyleClass(); + } + addStylesTo(target) { + const styleSheets = this.styleSheets; + const styleClass = this.styleClass; + target = this.normalizeTarget(target); + for (let i = 0; i < styleSheets.length; i++) { + const element = document.createElement("style"); + element.innerHTML = styleSheets[i]; + element.className = styleClass; + target.append(element); + } + super.addStylesTo(target); + } + removeStylesFrom(target) { + target = this.normalizeTarget(target); + const styles = target.querySelectorAll(`.${this.styleClass}`); + for (let i = 0, ii = styles.length; i < ii; ++i) { + target.removeChild(styles[i]); + } + super.removeStylesFrom(target); + } + isAttachedTo(target) { + return super.isAttachedTo(this.normalizeTarget(target)); + } + normalizeTarget(target) { + return target === document ? document.body : target; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/attributes.js + function attr(configOrTarget, prop) { + let config; + function decorator($target, $prop) { + if (arguments.length > 1) { + config.property = $prop; + } + AttributeConfiguration.locate($target.constructor).push(config); + } + if (arguments.length > 1) { + config = {}; + decorator(configOrTarget, prop); + return; + } + config = configOrTarget === void 0 ? {} : configOrTarget; + return decorator; + } + var AttributeConfiguration, booleanConverter, nullableNumberConverter, AttributeDefinition; + var init_attributes = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/attributes.js"() { + init_observable(); + init_dom(); + init_platform(); + AttributeConfiguration = Object.freeze({ + /** + * Locates all attribute configurations associated with a type. + */ + locate: createMetadataLocator() + }); + booleanConverter = { + toView(value) { + return value ? "true" : "false"; + }, + fromView(value) { + if (value === null || value === void 0 || value === "false" || value === false || value === 0) { + return false; + } + return true; + } + }; + nullableNumberConverter = { + toView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number.toString(); + }, + fromView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number; + } + }; + AttributeDefinition = class _AttributeDefinition { + /** + * Creates an instance of AttributeDefinition. + * @param Owner - The class constructor that owns this attribute. + * @param name - The name of the property associated with the attribute. + * @param attribute - The name of the attribute in HTML. + * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. + * @param converter - A {@link ValueConverter} that integrates with the property getter/setter + * to convert values to and from a DOM string. + */ + constructor(Owner, name, attribute = name.toLowerCase(), mode = "reflect", converter) { + this.guards = /* @__PURE__ */ new Set(); + this.Owner = Owner; + this.name = name; + this.attribute = attribute; + this.mode = mode; + this.converter = converter; + this.fieldName = `_${name}`; + this.callbackName = `${name}Changed`; + this.hasCallback = this.callbackName in Owner.prototype; + if (mode === "boolean" && converter === void 0) { + this.converter = booleanConverter; + } + } + /** + * Sets the value of the attribute/property on the source element. + * @param source - The source element to access. + * @param value - The value to set the attribute/property to. + */ + setValue(source, newValue) { + const oldValue = source[this.fieldName]; + const converter = this.converter; + if (converter !== void 0) { + newValue = converter.fromView(newValue); + } + if (oldValue !== newValue) { + source[this.fieldName] = newValue; + this.tryReflectToAttribute(source); + if (this.hasCallback) { + source[this.callbackName](oldValue, newValue); + } + source.$fastController.notify(this.name); + } + } + /** + * Gets the value of the attribute/property on the source element. + * @param source - The source element to access. + */ + getValue(source) { + Observable.track(source, this.name); + return source[this.fieldName]; + } + /** @internal */ + onAttributeChangedCallback(element, value) { + if (this.guards.has(element)) { + return; + } + this.guards.add(element); + this.setValue(element, value); + this.guards.delete(element); + } + tryReflectToAttribute(element) { + const mode = this.mode; + const guards = this.guards; + if (guards.has(element) || mode === "fromView") { + return; + } + DOM.queueUpdate(() => { + guards.add(element); + const latestValue = element[this.fieldName]; + switch (mode) { + case "reflect": + const converter = this.converter; + DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); + break; + case "boolean": + DOM.setBooleanAttribute(element, this.attribute, latestValue); + break; + } + guards.delete(element); + }); + } + /** + * Collects all attribute definitions associated with the owner. + * @param Owner - The class constructor to collect attribute for. + * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. + * @internal + */ + static collect(Owner, ...attributeLists) { + const attributes = []; + attributeLists.push(AttributeConfiguration.locate(Owner)); + for (let i = 0, ii = attributeLists.length; i < ii; ++i) { + const list = attributeLists[i]; + if (list === void 0) { + continue; + } + for (let j = 0, jj = list.length; j < jj; ++j) { + const config = list[j]; + if (typeof config === "string") { + attributes.push(new _AttributeDefinition(Owner, config)); + } else { + attributes.push(new _AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); + } + } + } + return attributes; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js + var defaultShadowOptions, defaultElementOptions, fastRegistry, FASTElementDefinition; + var init_fast_definitions = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js"() { + init_platform(); + init_observable(); + init_element_styles(); + init_attributes(); + defaultShadowOptions = { mode: "open" }; + defaultElementOptions = {}; + fastRegistry = FAST.getById(4, () => { + const typeToDefinition = /* @__PURE__ */ new Map(); + return Object.freeze({ + register(definition) { + if (typeToDefinition.has(definition.type)) { + return false; + } + typeToDefinition.set(definition.type, definition); + return true; + }, + getByType(key) { + return typeToDefinition.get(key); + } + }); + }); + FASTElementDefinition = class { + /** + * Creates an instance of FASTElementDefinition. + * @param type - The type this definition is being created for. + * @param nameOrConfig - The name of the element to define or a config object + * that describes the element to define. + */ + constructor(type, nameOrConfig = type.definition) { + if (typeof nameOrConfig === "string") { + nameOrConfig = { name: nameOrConfig }; + } + this.type = type; + this.name = nameOrConfig.name; + this.template = nameOrConfig.template; + const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); + const observedAttributes = new Array(attributes.length); + const propertyLookup = {}; + const attributeLookup = {}; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const current = attributes[i]; + observedAttributes[i] = current.attribute; + propertyLookup[current.name] = current; + attributeLookup[current.attribute] = current; + } + this.attributes = attributes; + this.observedAttributes = observedAttributes; + this.propertyLookup = propertyLookup; + this.attributeLookup = attributeLookup; + this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); + this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); + this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof ElementStyles ? nameOrConfig.styles : ElementStyles.create([nameOrConfig.styles]); + } + /** + * Indicates if this element has been defined in at least one registry. + */ + get isDefined() { + return !!fastRegistry.getByType(this.type); + } + /** + * Defines a custom element based on this definition. + * @param registry - The element registry to define the element in. + */ + define(registry2 = customElements) { + const type = this.type; + if (fastRegistry.register(this)) { + const attributes = this.attributes; + const proto = type.prototype; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + Observable.defineProperty(proto, attributes[i]); + } + Reflect.defineProperty(type, "observedAttributes", { + value: this.observedAttributes, + enumerable: true + }); + } + if (!registry2.get(this.name)) { + registry2.define(this.name, type, this.elementOptions); + } + return this; + } + }; + FASTElementDefinition.forType = fastRegistry.getByType; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/controller.js + function getShadowRoot(element) { + return element.shadowRoot || shadowRoots.get(element) || null; + } + var shadowRoots, defaultEventOptions, Controller; + var init_controller = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/controller.js"() { + init_dom(); + init_notifier(); + init_observable(); + init_fast_definitions(); + shadowRoots = /* @__PURE__ */ new WeakMap(); + defaultEventOptions = { + bubbles: true, + composed: true, + cancelable: true + }; + Controller = class _Controller extends PropertyChangeNotifier { + /** + * Creates a Controller to control the specified element. + * @param element - The element to be controlled by this controller. + * @param definition - The element definition metadata that instructs this + * controller in how to handle rendering and other platform integrations. + * @internal + */ + constructor(element, definition) { + super(element); + this.boundObservables = null; + this.behaviors = null; + this.needsInitialization = true; + this._template = null; + this._styles = null; + this._isConnected = false; + this.$fastController = this; + this.view = null; + this.element = element; + this.definition = definition; + const shadowOptions = definition.shadowOptions; + if (shadowOptions !== void 0) { + const shadowRoot = element.attachShadow(shadowOptions); + if (shadowOptions.mode === "closed") { + shadowRoots.set(element, shadowRoot); + } + } + const accessors = Observable.getAccessors(element); + if (accessors.length > 0) { + const boundObservables = this.boundObservables = /* @__PURE__ */ Object.create(null); + for (let i = 0, ii = accessors.length; i < ii; ++i) { + const propertyName = accessors[i].name; + const value = element[propertyName]; + if (value !== void 0) { + delete element[propertyName]; + boundObservables[propertyName] = value; + } + } + } + } + /** + * Indicates whether or not the custom element has been + * connected to the document. + */ + get isConnected() { + Observable.track(this, "isConnected"); + return this._isConnected; + } + setIsConnected(value) { + this._isConnected = value; + Observable.notify(this, "isConnected"); + } + /** + * Gets/sets the template used to render the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get template() { + return this._template; + } + set template(value) { + if (this._template === value) { + return; + } + this._template = value; + if (!this.needsInitialization) { + this.renderTemplate(value); + } + } + /** + * Gets/sets the primary styles used for the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get styles() { + return this._styles; + } + set styles(value) { + if (this._styles === value) { + return; + } + if (this._styles !== null) { + this.removeStyles(this._styles); + } + this._styles = value; + if (!this.needsInitialization && value !== null) { + this.addStyles(value); + } + } + /** + * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. + * @param styles - The styles to add. + */ + addStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.append(styles); + } else if (!styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.addStylesTo(target); + if (sourceBehaviors !== null) { + this.addBehaviors(sourceBehaviors); + } + } + } + /** + * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. + * @param styles - the styles to remove. + */ + removeStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.removeChild(styles); + } else if (styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.removeStylesFrom(target); + if (sourceBehaviors !== null) { + this.removeBehaviors(sourceBehaviors); + } + } + } + /** + * Adds behaviors to this element. + * @param behaviors - The behaviors to add. + */ + addBehaviors(behaviors) { + const targetBehaviors = this.behaviors || (this.behaviors = /* @__PURE__ */ new Map()); + const length = behaviors.length; + const behaviorsToBind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); + } else { + targetBehaviors.set(behavior, 1); + behaviorsToBind.push(behavior); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToBind.length; ++i) { + behaviorsToBind[i].bind(element, defaultExecutionContext); + } + } + } + /** + * Removes behaviors from this element. + * @param behaviors - The behaviors to remove. + * @param force - Forces unbinding of behaviors. + */ + removeBehaviors(behaviors, force = false) { + const targetBehaviors = this.behaviors; + if (targetBehaviors === null) { + return; + } + const length = behaviors.length; + const behaviorsToUnbind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + const count = targetBehaviors.get(behavior) - 1; + count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToUnbind.length; ++i) { + behaviorsToUnbind[i].unbind(element); + } + } + } + /** + * Runs connected lifecycle behavior on the associated element. + */ + onConnectedCallback() { + if (this._isConnected) { + return; + } + const element = this.element; + if (this.needsInitialization) { + this.finishInitialization(); + } else if (this.view !== null) { + this.view.bind(element, defaultExecutionContext); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + for (const [behavior] of behaviors) { + behavior.bind(element, defaultExecutionContext); + } + } + this.setIsConnected(true); + } + /** + * Runs disconnected lifecycle behavior on the associated element. + */ + onDisconnectedCallback() { + if (!this._isConnected) { + return; + } + this.setIsConnected(false); + const view = this.view; + if (view !== null) { + view.unbind(); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + const element = this.element; + for (const [behavior] of behaviors) { + behavior.unbind(element); + } + } + } + /** + * Runs the attribute changed callback for the associated element. + * @param name - The name of the attribute that changed. + * @param oldValue - The previous value of the attribute. + * @param newValue - The new value of the attribute. + */ + onAttributeChangedCallback(name, oldValue, newValue) { + const attrDef = this.definition.attributeLookup[name]; + if (attrDef !== void 0) { + attrDef.onAttributeChangedCallback(this.element, newValue); + } + } + /** + * Emits a custom HTML event. + * @param type - The type name of the event. + * @param detail - The event detail object to send with the event. + * @param options - The event options. By default bubbles and composed. + * @remarks + * Only emits events if connected. + */ + emit(type, detail, options) { + if (this._isConnected) { + return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options))); + } + return false; + } + finishInitialization() { + const element = this.element; + const boundObservables = this.boundObservables; + if (boundObservables !== null) { + const propertyNames = Object.keys(boundObservables); + for (let i = 0, ii = propertyNames.length; i < ii; ++i) { + const propertyName = propertyNames[i]; + element[propertyName] = boundObservables[propertyName]; + } + this.boundObservables = null; + } + const definition = this.definition; + if (this._template === null) { + if (this.element.resolveTemplate) { + this._template = this.element.resolveTemplate(); + } else if (definition.template) { + this._template = definition.template || null; + } + } + if (this._template !== null) { + this.renderTemplate(this._template); + } + if (this._styles === null) { + if (this.element.resolveStyles) { + this._styles = this.element.resolveStyles(); + } else if (definition.styles) { + this._styles = definition.styles || null; + } + } + if (this._styles !== null) { + this.addStyles(this._styles); + } + this.needsInitialization = false; + } + renderTemplate(template) { + const element = this.element; + const host = getShadowRoot(element) || element; + if (this.view !== null) { + this.view.dispose(); + this.view = null; + } else if (!this.needsInitialization) { + DOM.removeChildNodes(host); + } + if (template) { + this.view = template.render(element, host, element); + } + } + /** + * Locates or creates a controller for the specified element. + * @param element - The element to return the controller for. + * @remarks + * The specified element must have a {@link FASTElementDefinition} + * registered either through the use of the {@link customElement} + * decorator or a call to `FASTElement.define`. + */ + static forCustomElement(element) { + const controller = element.$fastController; + if (controller !== void 0) { + return controller; + } + const definition = FASTElementDefinition.forType(element.constructor); + if (definition === void 0) { + throw new Error("Missing FASTElement definition."); + } + return element.$fastController = new _Controller(element, definition); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js + function createFASTElement(BaseType) { + return class extends BaseType { + constructor() { + super(); + Controller.forCustomElement(this); + } + $emit(type, detail, options) { + return this.$fastController.emit(type, detail, options); + } + connectedCallback() { + this.$fastController.onConnectedCallback(); + } + disconnectedCallback() { + this.$fastController.onDisconnectedCallback(); + } + attributeChangedCallback(name, oldValue, newValue) { + this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); + } + }; + } + var FASTElement; + var init_fast_element = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js"() { + init_controller(); + init_fast_definitions(); + FASTElement = Object.assign(createFASTElement(HTMLElement), { + /** + * Creates a new FASTElement base class inherited from the + * provided base type. + * @param BaseType - The base element type to inherit from. + */ + from(BaseType) { + return createFASTElement(BaseType); + }, + /** + * Defines a platform custom element based on the provided type and definition. + * @param type - The custom element type to define. + * @param nameOrDef - The name of the element to define or a definition object + * that describes the element to define. + */ + define(type, nameOrDef) { + return new FASTElementDefinition(type, nameOrDef).define().type; + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js + var CSSDirective; + var init_css_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js"() { + CSSDirective = class { + /** + * Creates a CSS fragment to interpolate into the CSS document. + * @returns - the string to interpolate into CSS + */ + createCSS() { + return ""; + } + /** + * Creates a behavior to bind to the host element. + * @returns - the behavior to bind to the host element, or undefined. + */ + createBehavior() { + return void 0; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css.js + function collectStyles(strings, values) { + const styles = []; + let cssString = ""; + const behaviors = []; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + cssString += strings[i]; + let value = values[i]; + if (value instanceof CSSDirective) { + const behavior = value.createBehavior(); + value = value.createCSS(); + if (behavior) { + behaviors.push(behavior); + } + } + if (value instanceof ElementStyles || value instanceof CSSStyleSheet) { + if (cssString.trim() !== "") { + styles.push(cssString); + cssString = ""; + } + styles.push(value); + } else { + cssString += value; + } + } + cssString += strings[strings.length - 1]; + if (cssString.trim() !== "") { + styles.push(cssString); + } + return { + styles, + behaviors + }; + } + function css(strings, ...values) { + const { styles, behaviors } = collectStyles(strings, values); + const elementStyles = ElementStyles.create(styles); + if (behaviors.length) { + elementStyles.withBehaviors(...behaviors); + } + return elementStyles; + } + var init_css = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css.js"() { + init_css_directive(); + init_element_styles(); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js + function newSplice(index2, removed, addedCount) { + return { + index: index2, + removed, + addedCount + }; + } + function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { + const rowCount = oldEnd - oldStart + 1; + const columnCount = currentEnd - currentStart + 1; + const distances = new Array(rowCount); + let north; + let west; + for (let i = 0; i < rowCount; ++i) { + distances[i] = new Array(columnCount); + distances[i][0] = i; + } + for (let j = 0; j < columnCount; ++j) { + distances[0][j] = j; + } + for (let i = 1; i < rowCount; ++i) { + for (let j = 1; j < columnCount; ++j) { + if (current[currentStart + j - 1] === old[oldStart + i - 1]) { + distances[i][j] = distances[i - 1][j - 1]; + } else { + north = distances[i - 1][j] + 1; + west = distances[i][j - 1] + 1; + distances[i][j] = north < west ? north : west; + } + } + } + return distances; + } + function spliceOperationsFromEditDistances(distances) { + let i = distances.length - 1; + let j = distances[0].length - 1; + let current = distances[i][j]; + const edits = []; + while (i > 0 || j > 0) { + if (i === 0) { + edits.push(EDIT_ADD); + j--; + continue; + } + if (j === 0) { + edits.push(EDIT_DELETE); + i--; + continue; + } + const northWest = distances[i - 1][j - 1]; + const west = distances[i - 1][j]; + const north = distances[i][j - 1]; + let min; + if (west < north) { + min = west < northWest ? west : northWest; + } else { + min = north < northWest ? north : northWest; + } + if (min === northWest) { + if (northWest === current) { + edits.push(EDIT_LEAVE); + } else { + edits.push(EDIT_UPDATE); + current = northWest; + } + i--; + j--; + } else if (min === west) { + edits.push(EDIT_DELETE); + i--; + current = west; + } else { + edits.push(EDIT_ADD); + j--; + current = north; + } + } + edits.reverse(); + return edits; + } + function sharedPrefix(current, old, searchLength) { + for (let i = 0; i < searchLength; ++i) { + if (current[i] !== old[i]) { + return i; + } + } + return searchLength; + } + function sharedSuffix(current, old, searchLength) { + let index1 = current.length; + let index2 = old.length; + let count = 0; + while (count < searchLength && current[--index1] === old[--index2]) { + count++; + } + return count; + } + function intersect(start1, end1, start2, end2) { + if (end1 < start2 || end2 < start1) { + return -1; + } + if (end1 === start2 || end2 === start1) { + return 0; + } + if (start1 < start2) { + if (end1 < end2) { + return end1 - start2; + } + return end2 - start2; + } + if (end2 < end1) { + return end2 - start1; + } + return end1 - start1; + } + function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { + let prefixCount = 0; + let suffixCount = 0; + const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); + if (currentStart === 0 && oldStart === 0) { + prefixCount = sharedPrefix(current, old, minLength); + } + if (currentEnd === current.length && oldEnd === old.length) { + suffixCount = sharedSuffix(current, old, minLength - prefixCount); + } + currentStart += prefixCount; + oldStart += prefixCount; + currentEnd -= suffixCount; + oldEnd -= suffixCount; + if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) { + return emptyArray; + } + if (currentStart === currentEnd) { + const splice2 = newSplice(currentStart, [], 0); + while (oldStart < oldEnd) { + splice2.removed.push(old[oldStart++]); + } + return [splice2]; + } else if (oldStart === oldEnd) { + return [newSplice(currentStart, [], currentEnd - currentStart)]; + } + const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); + const splices = []; + let splice = void 0; + let index2 = currentStart; + let oldIndex = oldStart; + for (let i = 0; i < ops.length; ++i) { + switch (ops[i]) { + case EDIT_LEAVE: + if (splice !== void 0) { + splices.push(splice); + splice = void 0; + } + index2++; + oldIndex++; + break; + case EDIT_UPDATE: + if (splice === void 0) { + splice = newSplice(index2, [], 0); + } + splice.addedCount++; + index2++; + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + case EDIT_ADD: + if (splice === void 0) { + splice = newSplice(index2, [], 0); + } + splice.addedCount++; + index2++; + break; + case EDIT_DELETE: + if (splice === void 0) { + splice = newSplice(index2, [], 0); + } + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + } + } + if (splice !== void 0) { + splices.push(splice); + } + return splices; + } + function mergeSplice(splices, index2, removed, addedCount) { + const splice = newSplice(index2, removed, addedCount); + let inserted = false; + let insertionOffset = 0; + for (let i = 0; i < splices.length; i++) { + const current = splices[i]; + current.index += insertionOffset; + if (inserted) { + continue; + } + const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount); + if (intersectCount >= 0) { + splices.splice(i, 1); + i--; + insertionOffset -= current.addedCount - current.removed.length; + splice.addedCount += current.addedCount - intersectCount; + const deleteCount = splice.removed.length + current.removed.length - intersectCount; + if (!splice.addedCount && !deleteCount) { + inserted = true; + } else { + let currentRemoved = current.removed; + if (splice.index < current.index) { + const prepend = splice.removed.slice(0, current.index - splice.index); + $push.apply(prepend, currentRemoved); + currentRemoved = prepend; + } + if (splice.index + splice.removed.length > current.index + current.addedCount) { + const append = splice.removed.slice(current.index + current.addedCount - splice.index); + $push.apply(currentRemoved, append); + } + splice.removed = currentRemoved; + if (current.index < splice.index) { + splice.index = current.index; + } + } + } else if (splice.index < current.index) { + inserted = true; + splices.splice(i, 0, splice); + i++; + const offset = splice.addedCount - splice.removed.length; + current.index += offset; + insertionOffset += offset; + } + } + if (!inserted) { + splices.push(splice); + } + } + function createInitialSplices(changeRecords) { + const splices = []; + for (let i = 0, ii = changeRecords.length; i < ii; i++) { + const record = changeRecords[i]; + mergeSplice(splices, record.index, record.removed, record.addedCount); + } + return splices; + } + function projectArraySplices(array, changeRecords) { + let splices = []; + const initialSplices = createInitialSplices(changeRecords); + for (let i = 0, ii = initialSplices.length; i < ii; ++i) { + const splice = initialSplices[i]; + if (splice.addedCount === 1 && splice.removed.length === 1) { + if (splice.removed[0] !== array[splice.index]) { + splices.push(splice); + } + continue; + } + splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length)); + } + return splices; + } + var EDIT_LEAVE, EDIT_UPDATE, EDIT_ADD, EDIT_DELETE, $push; + var init_array_change_records = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js"() { + init_platform(); + EDIT_LEAVE = 0; + EDIT_UPDATE = 1; + EDIT_ADD = 2; + EDIT_DELETE = 3; + $push = Array.prototype.push; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js + function adjustIndex(changeRecord, array) { + let index2 = changeRecord.index; + const arrayLength = array.length; + if (index2 > arrayLength) { + index2 = arrayLength - changeRecord.addedCount; + } else if (index2 < 0) { + index2 = arrayLength + changeRecord.removed.length + index2 - changeRecord.addedCount; + } + if (index2 < 0) { + index2 = 0; + } + changeRecord.index = index2; + return changeRecord; + } + function enableArrayObservation() { + if (arrayObservationEnabled) { + return; + } + arrayObservationEnabled = true; + Observable.setArrayObserverFactory((collection) => { + return new ArrayObserver(collection); + }); + const proto = Array.prototype; + if (proto.$fastPatch) { + return; + } + Reflect.defineProperty(proto, "$fastPatch", { + value: 1, + enumerable: false + }); + const pop = proto.pop; + const push = proto.push; + const reverse = proto.reverse; + const shift = proto.shift; + const sort = proto.sort; + const splice = proto.splice; + const unshift = proto.unshift; + proto.pop = function() { + const notEmpty = this.length > 0; + const methodCallResult = pop.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(this.length, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.push = function() { + const methodCallResult = push.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this)); + } + return methodCallResult; + }; + proto.reverse = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = reverse.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.shift = function() { + const notEmpty = this.length > 0; + const methodCallResult = shift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(0, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.sort = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = sort.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.splice = function() { + const methodCallResult = splice.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this)); + } + return methodCallResult; + }; + proto.unshift = function() { + const methodCallResult = unshift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this)); + } + return methodCallResult; + }; + } + var arrayObservationEnabled, ArrayObserver; + var init_array_observer = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js"() { + init_dom(); + init_array_change_records(); + init_notifier(); + init_observable(); + arrayObservationEnabled = false; + ArrayObserver = class extends SubscriberSet { + constructor(source) { + super(source); + this.oldCollection = void 0; + this.splices = void 0; + this.needsQueue = true; + this.call = this.flush; + Reflect.defineProperty(source, "$fastController", { + value: this, + enumerable: false + }); + } + subscribe(subscriber) { + this.flush(); + super.subscribe(subscriber); + } + addSplice(splice) { + if (this.splices === void 0) { + this.splices = [splice]; + } else { + this.splices.push(splice); + } + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + reset(oldCollection) { + this.oldCollection = oldCollection; + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + flush() { + const splices = this.splices; + const oldCollection = this.oldCollection; + if (splices === void 0 && oldCollection === void 0) { + return; + } + this.needsQueue = true; + this.splices = void 0; + this.oldCollection = void 0; + const finalSplices = oldCollection === void 0 ? projectArraySplices(this.source, splices) : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length); + this.notify(finalSplices); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/ref.js + function ref(propertyName) { + return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); + } + var RefBehavior; + var init_ref = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/ref.js"() { + init_html_directive(); + RefBehavior = class { + /** + * Creates an instance of RefBehavior. + * @param target - The element to reference. + * @param propertyName - The name of the property to assign the reference to. + */ + constructor(target, propertyName) { + this.target = target; + this.propertyName = propertyName; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + source[this.propertyName] = this.target; + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ + unbind() { + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/interfaces.js + var isFunction2; + var init_interfaces = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/interfaces.js"() { + isFunction2 = (object) => typeof object === "function"; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/when.js + function normalizeBinding(value) { + return value === void 0 ? noTemplate : isFunction2(value) ? value : () => value; + } + function when(binding, templateOrTemplateBinding, elseTemplateOrTemplateBinding) { + const dataBinding = isFunction2(binding) ? binding : () => binding; + const templateBinding = normalizeBinding(templateOrTemplateBinding); + const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding); + return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context); + } + var noTemplate; + var init_when = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/when.js"() { + init_interfaces(); + noTemplate = () => null; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js + function bindWithoutPositioning(view, items, index2, context) { + view.bind(items[index2], context); + } + function bindWithPositioning(view, items, index2, context) { + const childContext = Object.create(context); + childContext.index = index2; + childContext.length = items.length; + view.bind(items[index2], childContext); + } + var defaultRepeatOptions, RepeatBehavior, RepeatDirective; + var init_repeat = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js"() { + init_dom(); + init_observable(); + init_array_observer(); + init_platform(); + init_html_directive(); + init_view(); + defaultRepeatOptions = Object.freeze({ + positioning: false, + recycle: true + }); + RepeatBehavior = class { + /** + * Creates an instance of RepeatBehavior. + * @param location - The location in the DOM to render the repeat. + * @param itemsBinding - The array to render. + * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies. + * @param templateBinding - The template to render for each item. + * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies. + * @param options - Options used to turn on special repeat features. + */ + constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) { + this.location = location; + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.source = null; + this.views = []; + this.items = null; + this.itemsObserver = null; + this.originalContext = void 0; + this.childContext = void 0; + this.bindView = bindWithoutPositioning; + this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile); + this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile); + if (options.positioning) { + this.bindView = bindWithPositioning; + } + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source, context) { + this.source = source; + this.originalContext = context; + this.childContext = Object.create(context); + this.childContext.parent = source; + this.childContext.parentContext = this.originalContext; + this.items = this.itemsBindingObserver.observe(source, this.originalContext); + this.template = this.templateBindingObserver.observe(source, this.originalContext); + this.observeItems(true); + this.refreshAllViews(); + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.source = null; + this.items = null; + if (this.itemsObserver !== null) { + this.itemsObserver.unsubscribe(this); + } + this.unbindAllViews(); + this.itemsBindingObserver.disconnect(); + this.templateBindingObserver.disconnect(); + } + /** @internal */ + handleChange(source, args) { + if (source === this.itemsBinding) { + this.items = this.itemsBindingObserver.observe(this.source, this.originalContext); + this.observeItems(); + this.refreshAllViews(); + } else if (source === this.templateBinding) { + this.template = this.templateBindingObserver.observe(this.source, this.originalContext); + this.refreshAllViews(true); + } else { + this.updateViews(args); + } + } + observeItems(force = false) { + if (!this.items) { + this.items = emptyArray; + return; + } + const oldObserver = this.itemsObserver; + const newObserver = this.itemsObserver = Observable.getNotifier(this.items); + const hasNewObserver = oldObserver !== newObserver; + if (hasNewObserver && oldObserver !== null) { + oldObserver.unsubscribe(this); + } + if (hasNewObserver || force) { + newObserver.subscribe(this); + } + } + updateViews(splices) { + const childContext = this.childContext; + const views = this.views; + const bindView = this.bindView; + const items = this.items; + const template = this.template; + const recycle = this.options.recycle; + const leftoverViews = []; + let leftoverIndex = 0; + let availableViews = 0; + for (let i = 0, ii = splices.length; i < ii; ++i) { + const splice = splices[i]; + const removed = splice.removed; + let removeIndex = 0; + let addIndex = splice.index; + const end = addIndex + splice.addedCount; + const removedViews = views.splice(splice.index, removed.length); + const totalAvailableViews = availableViews = leftoverViews.length + removedViews.length; + for (; addIndex < end; ++addIndex) { + const neighbor = views[addIndex]; + const location = neighbor ? neighbor.firstChild : this.location; + let view; + if (recycle && availableViews > 0) { + if (removeIndex <= totalAvailableViews && removedViews.length > 0) { + view = removedViews[removeIndex]; + removeIndex++; + } else { + view = leftoverViews[leftoverIndex]; + leftoverIndex++; + } + availableViews--; + } else { + view = template.create(); + } + views.splice(addIndex, 0, view); + bindView(view, items, addIndex, childContext); + view.insertBefore(location); + } + if (removedViews[removeIndex]) { + leftoverViews.push(...removedViews.slice(removeIndex)); + } + } + for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) { + leftoverViews[i].dispose(); + } + if (this.options.positioning) { + for (let i = 0, ii = views.length; i < ii; ++i) { + const currentContext = views[i].context; + currentContext.length = ii; + currentContext.index = i; + } + } + } + refreshAllViews(templateChanged = false) { + const items = this.items; + const childContext = this.childContext; + const template = this.template; + const location = this.location; + const bindView = this.bindView; + let itemsLength = items.length; + let views = this.views; + let viewsLength = views.length; + if (itemsLength === 0 || templateChanged || !this.options.recycle) { + HTMLView.disposeContiguousBatch(views); + viewsLength = 0; + } + if (viewsLength === 0) { + this.views = views = new Array(itemsLength); + for (let i = 0; i < itemsLength; ++i) { + const view = template.create(); + bindView(view, items, i, childContext); + views[i] = view; + view.insertBefore(location); + } + } else { + let i = 0; + for (; i < itemsLength; ++i) { + if (i < viewsLength) { + const view = views[i]; + bindView(view, items, i, childContext); + } else { + const view = template.create(); + bindView(view, items, i, childContext); + views.push(view); + view.insertBefore(location); + } + } + const removed = views.splice(i, viewsLength - i); + for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) { + removed[i].dispose(); + } + } + } + unbindAllViews() { + const views = this.views; + for (let i = 0, ii = views.length; i < ii; ++i) { + views[i].unbind(); + } + } + }; + RepeatDirective = class extends HTMLDirective { + /** + * Creates an instance of RepeatDirective. + * @param itemsBinding - The binding that provides the array to render. + * @param templateBinding - The template binding used to obtain a template to render for each item in the array. + * @param options - Options used to turn on special repeat features. + */ + constructor(itemsBinding, templateBinding, options) { + super(); + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.createPlaceholder = DOM.createBlockPlaceholder; + enableArrayObservation(); + this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding); + this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + */ + createBehavior(target) { + return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js + function elements2(selector) { + if (selector) { + return function(value, index2, array) { + return value.nodeType === 1 && value.matches(selector); + }; + } + return function(value, index2, array) { + return value.nodeType === 1; + }; + } + var NodeObservationBehavior; + var init_node_observation = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js"() { + init_observable(); + init_platform(); + NodeObservationBehavior = class { + /** + * Creates an instance of NodeObservationBehavior. + * @param target - The target to assign the nodes property on. + * @param options - The options to use in configuring node observation. + */ + constructor(target, options) { + this.target = target; + this.options = options; + this.source = null; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + const name = this.options.property; + this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name); + this.source = source; + this.updateTarget(this.computeNodes()); + if (this.shouldUpdate) { + this.observe(); + } + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.updateTarget(emptyArray); + this.source = null; + if (this.shouldUpdate) { + this.disconnect(); + } + } + /** @internal */ + handleEvent() { + this.updateTarget(this.computeNodes()); + } + computeNodes() { + let nodes = this.getNodes(); + if (this.options.filter !== void 0) { + nodes = nodes.filter(this.options.filter); + } + return nodes; + } + updateTarget(value) { + this.source[this.options.property] = value; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js + function slotted(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { property: propertyOrOptions }; + } + return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions); + } + var SlottedBehavior; + var init_slotted = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js"() { + init_html_directive(); + init_node_observation(); + SlottedBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of SlottedBehavior. + * @param target - The slot element target to observe. + * @param options - The options to use when observing the slot. + */ + constructor(target, options) { + super(target, options); + } + /** + * Begins observation of the nodes. + */ + observe() { + this.target.addEventListener("slotchange", this); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.target.removeEventListener("slotchange", this); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + return this.target.assignedNodes(this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/children.js + function children(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { + property: propertyOrOptions + }; + } + return new AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions); + } + var ChildrenBehavior; + var init_children = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/children.js"() { + init_html_directive(); + init_node_observation(); + ChildrenBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of ChildrenBehavior. + * @param target - The element target to observe children on. + * @param options - The options to use when observing the element children. + */ + constructor(target, options) { + super(target, options); + this.observer = null; + options.childList = true; + } + /** + * Begins observation of the nodes. + */ + observe() { + if (this.observer === null) { + this.observer = new MutationObserver(this.handleEvent.bind(this)); + } + this.observer.observe(this.target, this.options); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.observer.disconnect(); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + if ("subtree" in this.options) { + return Array.from(this.target.querySelectorAll(this.options.selector)); + } + return Array.from(this.target.childNodes); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/index.js + var init_esm = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/index.js"() { + init_platform(); + init_template(); + init_fast_element(); + init_fast_definitions(); + init_attributes(); + init_controller(); + init_compiler(); + init_element_styles(); + init_css(); + init_css_directive(); + init_view(); + init_observable(); + init_notifier(); + init_dom(); + init_binding(); + init_html_directive(); + init_ref(); + init_when(); + init_repeat(); + init_slotted(); + init_children(); + init_node_observation(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js + var StartEnd, endSlotTemplate, startSlotTemplate, endTemplate, startTemplate; + var init_start_end = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js"() { + init_esm(); + StartEnd = class { + handleStartContentChange() { + this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); + } + handleEndContentChange() { + this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); + } + }; + endSlotTemplate = (context, definition) => html` + definition.end ? "end" : void 0} + > + + ${definition.end || ""} + + +`; + startSlotTemplate = (context, definition) => html` + + + ${definition.start || ""} + + +`; + endTemplate = html` + + + +`; + startTemplate = html` + + + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js + var init_accordion_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es6 = __esm({ + "node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/di.js + function cloneArrayWithPossibleProps(source) { + const clone3 = source.slice(); + const keys = Object.keys(source); + const len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + clone3[key] = source[key]; + } + } + return clone3; + } + function getParamTypes(key) { + return (Type) => { + return Reflect.getOwnMetadata(key, Type); + }; + } + function createResolver(getter) { + return function(key) { + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor); + }; + return resolver; + }; + } + function createAllResolver(getter) { + return function(key, searchAncestors) { + searchAncestors = !!searchAncestors; + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor, searchAncestors); + }; + return resolver; + }; + } + function ignore(target, property, descriptor) { + DI.inject(ignore)(target, property, descriptor); + } + function createNewInstance(key, handler) { + return handler.getFactory(key).construct(handler); + } + function containerGetKey(d) { + return this.get(d); + } + function transformInstance(inst, transform) { + return transform(inst); + } + function isRegistry(obj) { + return typeof obj.register === "function"; + } + function isSelfRegistry(obj) { + return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; + } + function isRegisterInRequester(obj) { + return isSelfRegistry(obj) && obj.registerInRequestor; + } + function isClass(obj) { + return obj.prototype !== void 0; + } + function cacheCallbackResult(fun) { + return function(handler, requestor, resolver) { + if (cache.has(resolver)) { + return cache.get(resolver); + } + const t = fun(handler, requestor, resolver); + cache.set(resolver, t); + return t; + }; + } + function validateKey(key) { + if (key === null || key === void 0) { + throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); + } + } + function buildAllResponse(resolver, handler, requestor) { + if (resolver instanceof ResolverImpl && resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].resolve(handler, requestor); + } + return results; + } + return [resolver.resolve(handler, requestor)]; + } + function isObject2(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + function isArrayIndex(value) { + switch (typeof value) { + case "number": + return value >= 0 && (value | 0) === value; + case "string": { + const result = isNumericLookup[value]; + if (result !== void 0) { + return result; + } + const length = value.length; + if (length === 0) { + return isNumericLookup[value] = false; + } + let ch = 0; + for (let i = 0; i < length; ++i) { + ch = value.charCodeAt(i); + if (i === 0 && ch === 48 && length > 1 || ch < 48 || ch > 57) { + return isNumericLookup[value] = false; + } + } + return isNumericLookup[value] = true; + } + default: + return false; + } + } + var metadataByTarget, ResolverBuilder, DefaultResolver, ContainerConfiguration, dependencyLookup, rootDOMContainer, DI, Container, inject, defaultSingletonOptions, all, lazy, optional, newInstanceForScope, newInstanceOf, ResolverImpl, FactoryImpl, containerResolver, InstrinsicTypeNames, DILocateParentEventType, factories, ContainerImpl, cache, Registration, defaultFriendlyName, isNativeFunction, isNumericLookup; + var init_di = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"() { + init_esm(); + metadataByTarget = /* @__PURE__ */ new Map(); + if (!("metadata" in Reflect)) { + Reflect.metadata = function(key, value) { + return function(target) { + Reflect.defineMetadata(key, value, target); + }; + }; + Reflect.defineMetadata = function(key, value, target) { + let metadata = metadataByTarget.get(target); + if (metadata === void 0) { + metadataByTarget.set(target, metadata = /* @__PURE__ */ new Map()); + } + metadata.set(key, value); + }; + Reflect.getOwnMetadata = function(key, target) { + const metadata = metadataByTarget.get(target); + if (metadata !== void 0) { + return metadata.get(key); + } + return void 0; + }; + } + ResolverBuilder = class { + /** + * + * @param container - The container to create resolvers for. + * @param key - The key to register resolvers under. + */ + constructor(container, key) { + this.container = container; + this.key = key; + } + /** + * Creates a resolver for an existing object instance. + * @param value - The instance to resolve. + * @returns The resolver. + */ + instance(value) { + return this.registerResolver(0, value); + } + /** + * Creates a resolver that enforces a singleton lifetime. + * @param value - The type to create and cache the singleton for. + * @returns The resolver. + */ + singleton(value) { + return this.registerResolver(1, value); + } + /** + * Creates a resolver that creates a new instance for every dependency request. + * @param value - The type to create instances of. + * @returns - The resolver. + */ + transient(value) { + return this.registerResolver(2, value); + } + /** + * Creates a resolver that invokes a callback function for every dependency resolution + * request, allowing custom logic to return the dependency. + * @param value - The callback to call during resolution. + * @returns The resolver. + */ + callback(value) { + return this.registerResolver(3, value); + } + /** + * Creates a resolver that invokes a callback function the first time that a dependency + * resolution is requested. The returned value is then cached and provided for all + * subsequent requests. + * @param value - The callback to call during the first resolution. + * @returns The resolver. + */ + cachedCallback(value) { + return this.registerResolver(3, cacheCallbackResult(value)); + } + /** + * Aliases the current key to a different key. + * @param destinationKey - The key to point the alias to. + * @returns The resolver. + */ + aliasTo(destinationKey) { + return this.registerResolver(5, destinationKey); + } + registerResolver(strategy, state) { + const { container, key } = this; + this.container = this.key = void 0; + return container.registerResolver(key, new ResolverImpl(key, strategy, state)); + } + }; + DefaultResolver = Object.freeze({ + /** + * Disables auto-registration and throws for all un-registered dependencies. + * @param key - The key to create the resolver for. + */ + none(key) { + throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`); + }, + /** + * Provides default singleton resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + singleton(key) { + return new ResolverImpl(key, 1, key); + }, + /** + * Provides default transient resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + transient(key) { + return new ResolverImpl(key, 2, key); + } + }); + ContainerConfiguration = Object.freeze({ + /** + * The default configuration used when creating a DOM-disconnected container. + * @remarks + * The default creates a root container, with no parent container. It does not handle + * owner requests and it uses singleton resolution behavior for auto-registration. + */ + default: Object.freeze({ + parentLocator: () => null, + responsibleForOwnerRequests: false, + defaultResolver: DefaultResolver.singleton + }) + }); + dependencyLookup = /* @__PURE__ */ new Map(); + rootDOMContainer = null; + DI = Object.freeze({ + /** + * Creates a new dependency injection container. + * @param config - The configuration for the container. + * @returns A newly created dependency injection container. + */ + createContainer(config) { + return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); + }, + /** + * Finds the dependency injection container responsible for providing dependencies + * to the specified node. + * @param node - The node to find the responsible container for. + * @returns The container responsible for providing dependencies to the node. + * @remarks + * This will be the same as the parent container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findResponsibleContainer(node) { + const owned = node.$$container$$; + if (owned && owned.responsibleForOwnerRequests) { + return owned; + } + return DI.findParentContainer(node); + }, + /** + * Find the dependency injection container up the DOM tree from this node. + * @param node - The node to find the parent container for. + * @returns The parent container of this node. + * @remarks + * This will be the same as the responsible container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findParentContainer(node) { + const event = new CustomEvent(DILocateParentEventType, { + bubbles: true, + composed: true, + cancelable: true, + detail: { container: void 0 } + }); + node.dispatchEvent(event); + return event.detail.container || DI.getOrCreateDOMContainer(); + }, + /** + * Returns a dependency injection container if one is explicitly owned by the specified + * node. If one is not owned, then a new container is created and assigned to the node. + * @param node - The node to find or create the container for. + * @param config - The configuration for the container if one needs to be created. + * @returns The located or created container. + * @remarks + * This API does not search for a responsible or parent container. It looks only for a container + * directly defined on the specified node and creates one at that location if one does not + * already exist. + */ + getOrCreateDOMContainer(node, config) { + if (!node) { + return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: () => null + }))); + } + return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: DI.findParentContainer + })); + }, + /** + * Gets the "design:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getDesignParamtypes: getParamTypes("design:paramtypes"), + /** + * Gets the "di:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getAnnotationParamtypes: getParamTypes("di:paramtypes"), + /** + * + * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, + * an empty metadata array is created and added. + * @returns The metadata array. + */ + getOrCreateAnnotationParamTypes(Type) { + let annotationParamtypes = this.getAnnotationParamtypes(Type); + if (annotationParamtypes === void 0) { + Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); + } + return annotationParamtypes; + }, + /** + * Gets the dependency keys representing what is needed to instantiate the specified type. + * @param Type - The type to get the dependencies for. + * @returns An array of dependency keys. + */ + getDependencies(Type) { + let dependencies = dependencyLookup.get(Type); + if (dependencies === void 0) { + const inject2 = Type.inject; + if (inject2 === void 0) { + const designParamtypes = DI.getDesignParamtypes(Type); + const annotationParamtypes = DI.getAnnotationParamtypes(Type); + if (designParamtypes === void 0) { + if (annotationParamtypes === void 0) { + const Proto = Object.getPrototypeOf(Type); + if (typeof Proto === "function" && Proto !== Function.prototype) { + dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); + } else { + dependencies = []; + } + } else { + dependencies = cloneArrayWithPossibleProps(annotationParamtypes); + } + } else if (annotationParamtypes === void 0) { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + } else { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + let len = annotationParamtypes.length; + let auAnnotationParamtype; + for (let i = 0; i < len; ++i) { + auAnnotationParamtype = annotationParamtypes[i]; + if (auAnnotationParamtype !== void 0) { + dependencies[i] = auAnnotationParamtype; + } + } + const keys = Object.keys(annotationParamtypes); + len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + dependencies[key] = annotationParamtypes[key]; + } + } + } + } else { + dependencies = cloneArrayWithPossibleProps(inject2); + } + dependencyLookup.set(Type, dependencies); + } + return dependencies; + }, + /** + * Defines a property on a web component class. The value of this property will + * be resolved from the dependency injection container responsible for the element + * instance, based on where it is connected in the DOM. + * @param target - The target to define the property on. + * @param propertyName - The name of the property to define. + * @param key - The dependency injection key. + * @param respectConnection - Indicates whether or not to update the property value if the + * hosting component is disconnected and then re-connected at a different location in the DOM. + * @remarks + * The respectConnection option is only applicable to elements that descend from FASTElement. + */ + defineProperty(target, propertyName, key, respectConnection = false) { + const diPropertyKey = `$di_${propertyName}`; + Reflect.defineProperty(target, propertyName, { + get: function() { + let value = this[diPropertyKey]; + if (value === void 0) { + const container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); + value = container.get(key); + this[diPropertyKey] = value; + if (respectConnection && this instanceof FASTElement) { + const notifier = this.$fastController; + const handleChange = () => { + const newContainer = DI.findResponsibleContainer(this); + const newValue = newContainer.get(key); + const oldValue = this[diPropertyKey]; + if (newValue !== oldValue) { + this[diPropertyKey] = value; + notifier.notify(propertyName); + } + }; + notifier.subscribe({ handleChange }, "isConnected"); + } + } + return value; + } + }); + }, + /** + * Creates a dependency injection key. + * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a + * default resolution for the dependency. + * @param configuror - If a friendly name was provided for the first parameter, then an optional + * lambda that configures a default resolution for the dependency can be provided second. + * @returns The created key. + * @remarks + * The created key can be used as a property decorator or constructor parameter decorator, + * in addition to its standard use in an inject array or through direct container APIs. + */ + createInterface(nameConfigOrCallback, configuror) { + const configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; + const friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; + const respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; + const Interface = function(target, property, index2) { + if (target == null || new.target !== void 0) { + throw new Error(`No registration for interface: '${Interface.friendlyName}'`); + } + if (property) { + DI.defineProperty(target, property, Interface, respectConnection); + } else { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + annotationParamtypes[index2] = Interface; + } + }; + Interface.$isInterface = true; + Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; + if (configure != null) { + Interface.register = function(container, key) { + return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); + }; + } + Interface.toString = function toString() { + return `InterfaceSymbol<${Interface.friendlyName}>`; + }; + return Interface; + }, + /** + * A decorator that specifies what to inject into its target. + * @param dependencies - The dependencies to inject. + * @returns The decorator to be applied to the target class. + * @remarks + * The decorator can be used to decorate a class, listing all of the classes dependencies. + * Or it can be used to decorate a constructor paramter, indicating what to inject for that + * parameter. + * Or it can be used for a web component property, indicating what that property should resolve to. + */ + inject(...dependencies) { + return function(target, key, descriptor) { + if (typeof descriptor === "number") { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + const dep = dependencies[0]; + if (dep !== void 0) { + annotationParamtypes[descriptor] = dep; + } + } else if (key) { + DI.defineProperty(target, key, dependencies[0]); + } else { + const annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); + let dep; + for (let i = 0; i < dependencies.length; ++i) { + dep = dependencies[i]; + if (dep !== void 0) { + annotationParamtypes[i] = dep; + } + } + } + }; + }, + /** + * Registers the `target` class as a transient dependency; each time the dependency is resolved + * a new instance will be created. + * + * @param target - The class / constructor function to register as transient. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.transient(Foo); + * ``` + * + * @example + * Inline declaration + * + * ```ts + * const Foo = DI.transient(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + transient(target) { + target.register = function register(container) { + const registration = Registration.transient(target, target); + return registration.register(container); + }; + target.registerInRequestor = false; + return target; + }, + /** + * Registers the `target` class as a singleton dependency; the class will only be created once. Each + * consecutive time the dependency is resolved, the same instance will be returned. + * + * @param target - The class / constructor function to register as a singleton. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.singleton(Foo); + * ``` + * + * @example + * Inline declaration + * ```ts + * const Foo = DI.singleton(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + singleton(target, options = defaultSingletonOptions) { + target.register = function register(container) { + const registration = Registration.singleton(target, target); + return registration.register(container); + }; + target.registerInRequestor = options.scoped; + return target; + } + }); + Container = DI.createInterface("Container"); + inject = DI.inject; + defaultSingletonOptions = { scoped: false }; + all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors)); + lazy = createResolver((key, handler, requestor) => { + return () => requestor.get(key); + }); + optional = createResolver((key, handler, requestor) => { + if (requestor.has(key, true)) { + return requestor.get(key); + } else { + return void 0; + } + }); + ignore.$isResolver = true; + ignore.resolve = () => void 0; + newInstanceForScope = createResolver((key, handler, requestor) => { + const instance = createNewInstance(key, handler); + const resolver = new ResolverImpl(key, 0, instance); + requestor.registerResolver(key, resolver); + return instance; + }); + newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler)); + ResolverImpl = class { + constructor(key, strategy, state) { + this.key = key; + this.strategy = strategy; + this.state = state; + this.resolving = false; + } + get $isResolver() { + return true; + } + register(container) { + return container.registerResolver(this.key, this); + } + resolve(handler, requestor) { + switch (this.strategy) { + case 0: + return this.state; + case 1: { + if (this.resolving) { + throw new Error(`Cyclic dependency found: ${this.state.name}`); + } + this.resolving = true; + this.state = handler.getFactory(this.state).construct(requestor); + this.strategy = 0; + this.resolving = false; + return this.state; + } + case 2: { + const factory = handler.getFactory(this.state); + if (factory === null) { + throw new Error(`Resolver for ${String(this.key)} returned a null factory`); + } + return factory.construct(requestor); + } + case 3: + return this.state(handler, requestor, this); + case 4: + return this.state[0].resolve(handler, requestor); + case 5: + return requestor.get(this.state); + default: + throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`); + } + } + getFactory(container) { + var _a, _b, _c; + switch (this.strategy) { + case 1: + case 2: + return container.getFactory(this.state); + case 5: + return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; + default: + return null; + } + } + }; + FactoryImpl = class { + constructor(Type, dependencies) { + this.Type = Type; + this.dependencies = dependencies; + this.transformers = null; + } + construct(container, dynamicDependencies) { + let instance; + if (dynamicDependencies === void 0) { + instance = new this.Type(...this.dependencies.map(containerGetKey, container)); + } else { + instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies); + } + if (this.transformers == null) { + return instance; + } + return this.transformers.reduce(transformInstance, instance); + } + registerTransformer(transformer) { + (this.transformers || (this.transformers = [])).push(transformer); + } + }; + containerResolver = { + $isResolver: true, + resolve(handler, requestor) { + return requestor; + } + }; + InstrinsicTypeNames = /* @__PURE__ */ new Set([ + "Array", + "ArrayBuffer", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Number", + "Object", + "Promise", + "RangeError", + "ReferenceError", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "URIError", + "WeakMap", + "WeakSet" + ]); + DILocateParentEventType = "__DI_LOCATE_PARENT__"; + factories = /* @__PURE__ */ new Map(); + ContainerImpl = class _ContainerImpl { + constructor(owner, config) { + this.owner = owner; + this.config = config; + this._parent = void 0; + this.registerDepth = 0; + this.context = null; + if (owner !== null) { + owner.$$container$$ = this; + } + this.resolvers = /* @__PURE__ */ new Map(); + this.resolvers.set(Container, containerResolver); + if (owner instanceof Node) { + owner.addEventListener(DILocateParentEventType, (e) => { + if (e.composedPath()[0] !== this.owner) { + e.detail.container = this; + e.stopImmediatePropagation(); + } + }); + } + } + get parent() { + if (this._parent === void 0) { + this._parent = this.config.parentLocator(this.owner); + } + return this._parent; + } + get depth() { + return this.parent === null ? 0 : this.parent.depth + 1; + } + get responsibleForOwnerRequests() { + return this.config.responsibleForOwnerRequests; + } + registerWithContext(context, ...params) { + this.context = context; + this.register(...params); + this.context = null; + return this; + } + register(...params) { + if (++this.registerDepth === 100) { + throw new Error("Unable to autoregister dependency"); + } + let current; + let keys; + let value; + let j; + let jj; + const context = this.context; + for (let i = 0, ii = params.length; i < ii; ++i) { + current = params[i]; + if (!isObject2(current)) { + continue; + } + if (isRegistry(current)) { + current.register(this, context); + } else if (isClass(current)) { + Registration.singleton(current, current).register(this); + } else { + keys = Object.keys(current); + j = 0; + jj = keys.length; + for (; j < jj; ++j) { + value = current[keys[j]]; + if (!isObject2(value)) { + continue; + } + if (isRegistry(value)) { + value.register(this, context); + } else { + this.register(value); + } + } + } + } + --this.registerDepth; + return this; + } + registerResolver(key, resolver) { + validateKey(key); + const resolvers = this.resolvers; + const result = resolvers.get(key); + if (result == null) { + resolvers.set(key, resolver); + } else if (result instanceof ResolverImpl && result.strategy === 4) { + result.state.push(resolver); + } else { + resolvers.set(key, new ResolverImpl(key, 4, [result, resolver])); + } + return resolver; + } + registerTransformer(key, transformer) { + const resolver = this.getResolver(key); + if (resolver == null) { + return false; + } + if (resolver.getFactory) { + const factory = resolver.getFactory(this); + if (factory == null) { + return false; + } + factory.registerTransformer(transformer); + return true; + } + return false; + } + getResolver(key, autoRegister = true) { + validateKey(key); + if (key.resolve !== void 0) { + return key; + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + return autoRegister ? this.jitRegister(key, handler) : null; + } + current = current.parent; + } else { + return resolver; + } + } + return null; + } + has(key, searchAncestors = false) { + return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; + } + get(key) { + validateKey(key); + if (key.$isResolver) { + return key.resolve(this, this); + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + resolver = this.jitRegister(key, handler); + return resolver.resolve(current, this); + } + current = current.parent; + } else { + return resolver.resolve(current, this); + } + } + throw new Error(`Unable to resolve key: ${String(key)}`); + } + getAll(key, searchAncestors = false) { + validateKey(key); + const requestor = this; + let current = requestor; + let resolver; + if (searchAncestors) { + let resolutions = emptyArray; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver != null) { + resolutions = resolutions.concat( + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + buildAllResponse(resolver, current, requestor) + ); + } + current = current.parent; + } + return resolutions; + } else { + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + current = current.parent; + if (current == null) { + return emptyArray; + } + } else { + return buildAllResponse(resolver, current, requestor); + } + } + } + return emptyArray; + } + getFactory(Type) { + let factory = factories.get(Type); + if (factory === void 0) { + if (isNativeFunction(Type)) { + throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`); + } + factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); + } + return factory; + } + registerFactory(key, factory) { + factories.set(key, factory); + } + createChild(config) { + return new _ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this })); + } + jitRegister(keyAsValue, handler) { + if (typeof keyAsValue !== "function") { + throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`); + } + if (InstrinsicTypeNames.has(keyAsValue.name)) { + throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`); + } + if (isRegistry(keyAsValue)) { + const registrationResolver = keyAsValue.register(handler); + if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { + const newResolver = handler.resolvers.get(keyAsValue); + if (newResolver != void 0) { + return newResolver; + } + throw new Error("A valid resolver was not returned from the static register method"); + } + return registrationResolver; + } else if (keyAsValue.$isInterface) { + throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`); + } else { + const resolver = this.config.defaultResolver(keyAsValue, handler); + handler.resolvers.set(keyAsValue, resolver); + return resolver; + } + } + }; + cache = /* @__PURE__ */ new WeakMap(); + Registration = Object.freeze({ + /** + * Allows you to pass an instance. + * Every time you request this {@link Key} you will get this instance back. + * + * @example + * ``` + * Registration.instance(Foo, new Foo())); + * ``` + * + * @param key - The key to register the instance under. + * @param value - The instance to return when the key is requested. + */ + instance(key, value) { + return new ResolverImpl(key, 0, value); + }, + /** + * Creates an instance from the class. + * Every time you request this {@link Key} you will get the same one back. + * + * @example + * ``` + * Registration.singleton(Foo, Foo); + * ``` + * + * @param key - The key to register the singleton under. + * @param value - The class to instantiate as a singleton when first requested. + */ + singleton(key, value) { + return new ResolverImpl(key, 1, value); + }, + /** + * Creates an instance from a class. + * Every time you request this {@link Key} you will get a new instance. + * + * @example + * ``` + * Registration.instance(Foo, Foo); + * ``` + * + * @param key - The key to register the instance type under. + * @param value - The class to instantiate each time the key is requested. + */ + transient(key, value) { + return new ResolverImpl(key, 2, value); + }, + /** + * Delegates to a callback function to provide the dependency. + * Every time you request this {@link Key} the callback will be invoked to provide + * the dependency. + * + * @example + * ``` + * Registration.callback(Foo, () => new Foo()); + * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + */ + callback(key, callback2) { + return new ResolverImpl(key, 3, callback2); + }, + /** + * Delegates to a callback function to provide the dependency and then caches the + * dependency for future requests. + * + * @example + * ``` + * Registration.cachedCallback(Foo, () => new Foo()); + * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + * @remarks + * If you pass the same Registration to another container, the same cached value will be used. + * Should all references to the resolver returned be removed, the cache will expire. + */ + cachedCallback(key, callback2) { + return new ResolverImpl(key, 3, cacheCallbackResult(callback2)); + }, + /** + * Creates an alternate {@link Key} to retrieve an instance by. + * + * @example + * ``` + * Register.singleton(Foo, Foo) + * Register.aliasTo(Foo, MyFoos); + * + * container.getAll(MyFoos) // contains an instance of Foo + * ``` + * + * @param originalKey - The original key that has been registered. + * @param aliasKey - The alias to the original key. + */ + aliasTo(originalKey, aliasKey) { + return new ResolverImpl(aliasKey, 5, originalKey); + } + }); + defaultFriendlyName = "(anonymous)"; + isNativeFunction = /* @__PURE__ */ (function() { + const lookup = /* @__PURE__ */ new WeakMap(); + let isNative = false; + let sourceText = ""; + let i = 0; + return function(fn) { + isNative = lookup.get(fn); + if (isNative === void 0) { + sourceText = fn.toString(); + i = sourceText.length; + isNative = // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string + i >= 29 && // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. + i <= 100 && // This whole heuristic *could* be tricked by a comment. Do we need to care about that? + sourceText.charCodeAt(i - 1) === 125 && // } + // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. + sourceText.charCodeAt(i - 2) <= 32 && // whitespace + sourceText.charCodeAt(i - 3) === 93 && // ] + sourceText.charCodeAt(i - 4) === 101 && // e + sourceText.charCodeAt(i - 5) === 100 && // d + sourceText.charCodeAt(i - 6) === 111 && // o + sourceText.charCodeAt(i - 7) === 99 && // c + sourceText.charCodeAt(i - 8) === 32 && // + sourceText.charCodeAt(i - 9) === 101 && // e + sourceText.charCodeAt(i - 10) === 118 && // v + sourceText.charCodeAt(i - 11) === 105 && // i + sourceText.charCodeAt(i - 12) === 116 && // t + sourceText.charCodeAt(i - 13) === 97 && // a + sourceText.charCodeAt(i - 14) === 110 && // n + sourceText.charCodeAt(i - 15) === 88; + lookup.set(fn, isNative); + } + return isNative; + }; + })(); + isNumericLookup = {}; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js + function presentationKeyFromTag(tagName) { + return `${tagName.toLowerCase()}:presentation`; + } + var presentationRegistry, ComponentPresentation, DefaultComponentPresentation; + var init_component_presentation = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js"() { + init_esm(); + init_di(); + presentationRegistry = /* @__PURE__ */ new Map(); + ComponentPresentation = Object.freeze({ + /** + * Defines a component presentation for an element. + * @param tagName - The element name to define the presentation for. + * @param presentation - The presentation that will be applied to matching elements. + * @param container - The dependency injection container to register the configuration in. + * @public + */ + define(tagName, presentation, container) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === void 0) { + presentationRegistry.set(key, presentation); + } else { + presentationRegistry.set(key, false); + } + container.register(Registration.instance(key, presentation)); + }, + /** + * Finds a component presentation for the specified element name, + * searching the DOM hierarchy starting from the provided element. + * @param tagName - The name of the element to locate the presentation for. + * @param element - The element to begin the search from. + * @returns The component presentation or null if none is found. + * @public + */ + forTag(tagName, element) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === false) { + const container = DI.findResponsibleContainer(element); + return container.get(key); + } + return existing || null; + } + }); + DefaultComponentPresentation = class { + /** + * Creates an instance of DefaultComponentPresentation. + * @param template - The template to apply to the element. + * @param styles - The styles to apply to the element. + * @public + */ + constructor(template, styles) { + this.template = template || null; + this.styles = styles === void 0 ? null : Array.isArray(styles) ? ElementStyles.create(styles) : styles instanceof ElementStyles ? styles : ElementStyles.create([styles]); + } + /** + * Applies the presentation details to the specified element. + * @param element - The element to apply the presentation details to. + * @public + */ + applyTo(element) { + const controller = element.$fastController; + if (controller.template === null) { + controller.template = this.template; + } + if (controller.styles === null) { + controller.styles = this.styles; + } + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js + function resolveOption(option, context, definition) { + if (typeof option === "function") { + return option(context, definition); + } + return option; + } + var FoundationElement, FoundationElementRegistry; + var init_foundation_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js"() { + init_tslib_es6(); + init_esm(); + init_component_presentation(); + FoundationElement = class _FoundationElement extends FASTElement { + constructor() { + super(...arguments); + this._presentation = void 0; + } + /** + * A property which resolves the ComponentPresentation instance + * for the current component. + * @public + */ + get $presentation() { + if (this._presentation === void 0) { + this._presentation = ComponentPresentation.forTag(this.tagName, this); + } + return this._presentation; + } + templateChanged() { + if (this.template !== void 0) { + this.$fastController.template = this.template; + } + } + stylesChanged() { + if (this.styles !== void 0) { + this.$fastController.styles = this.styles; + } + } + /** + * The connected callback for this FASTElement. + * @remarks + * This method is invoked by the platform whenever this FoundationElement + * becomes connected to the document. + * @public + */ + connectedCallback() { + if (this.$presentation !== null) { + this.$presentation.applyTo(this); + } + super.connectedCallback(); + } + /** + * Defines an element registry function with a set of element definition defaults. + * @param elementDefinition - The definition of the element to create the registry + * function for. + * @public + */ + static compose(elementDefinition) { + return (overrideDefinition = {}) => new FoundationElementRegistry(this === _FoundationElement ? class extends _FoundationElement { + } : this, elementDefinition, overrideDefinition); + } + }; + __decorate([ + observable + ], FoundationElement.prototype, "template", void 0); + __decorate([ + observable + ], FoundationElement.prototype, "styles", void 0); + FoundationElementRegistry = class { + constructor(type, elementDefinition, overrideDefinition) { + this.type = type; + this.elementDefinition = elementDefinition; + this.overrideDefinition = overrideDefinition; + this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); + } + register(container, context) { + const definition = this.definition; + const overrideDefinition = this.overrideDefinition; + const prefix = definition.prefix || context.elementPrefix; + const name = `${prefix}-${definition.baseName}`; + context.tryDefineElement({ + name, + type: this.type, + baseClass: this.elementDefinition.baseClass, + callback: (x) => { + const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); + x.definePresentation(presentation); + let shadowOptions = resolveOption(definition.shadowOptions, x, definition); + if (x.shadowRootMode) { + if (shadowOptions) { + if (!overrideDefinition.shadowOptions) { + shadowOptions.mode = x.shadowRootMode; + } + } else if (shadowOptions !== null) { + shadowOptions = { mode: x.shadowRootMode }; + } + } + x.defineElement({ + elementOptions: resolveOption(definition.elementOptions, x, definition), + shadowOptions, + attributes: resolveOption(definition.attributes, x, definition) + }); + } + }); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js + function applyMixins(derivedCtor, ...baseCtors) { + const derivedAttributes = AttributeConfiguration.locate(derivedCtor); + baseCtors.forEach((baseCtor) => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { + if (name !== "constructor") { + Object.defineProperty( + derivedCtor.prototype, + name, + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + Object.getOwnPropertyDescriptor(baseCtor.prototype, name) + ); + } + }); + const baseAttributes = AttributeConfiguration.locate(baseCtor); + baseAttributes.forEach((x) => derivedAttributes.push(x)); + }); + } + var init_apply_mixins = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js"() { + init_esm(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js + var AccordionItem; + var init_accordion_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_start_end(); + init_apply_mixins(); + AccordionItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.headinglevel = 2; + this.expanded = false; + this.clickHandler = (e) => { + this.expanded = !this.expanded; + this.change(); + }; + this.change = () => { + this.$emit("change"); + }; + } + }; + __decorate([ + attr({ + attribute: "heading-level", + mode: "fromView", + converter: nullableNumberConverter + }) + ], AccordionItem.prototype, "headinglevel", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], AccordionItem.prototype, "expanded", void 0); + __decorate([ + attr + ], AccordionItem.prototype, "id", void 0); + applyMixins(AccordionItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js + var init_accordion_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js"() { + init_accordion_item_template(); + init_accordion_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js + var init_accordion_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/aria.js + var Orientation; + var init_aria = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/aria.js"() { + Orientation = { + horizontal: "horizontal", + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/array.js + function findLastIndex(array, predicate) { + let k = array.length; + while (k--) { + if (predicate(array[k], k, array)) { + return k; + } + } + return -1; + } + var init_array = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/array.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/class-names.js + var init_class_names = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/class-names.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-dom.js + function canUseDOM() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + var init_can_use_dom = __esm({ + "node_modules/exenv-es6/dist/can-use-dom.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-event-listeners.js + var init_can_use_event_listeners = __esm({ + "node_modules/exenv-es6/dist/can-use-event-listeners.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-viewport.js + var init_can_use_viewport = __esm({ + "node_modules/exenv-es6/dist/can-use-viewport.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-workers.js + var init_can_use_workers = __esm({ + "node_modules/exenv-es6/dist/can-use-workers.js"() { + } + }); + + // node_modules/exenv-es6/dist/index.js + var init_dist = __esm({ + "node_modules/exenv-es6/dist/index.js"() { + init_can_use_dom(); + init_can_use_event_listeners(); + init_can_use_viewport(); + init_can_use_workers(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/dom.js + function isHTMLElement(...args) { + return args.every((arg) => arg instanceof HTMLElement); + } + function getDisplayedNodes(rootNode, selector) { + if (!rootNode || !selector || !isHTMLElement(rootNode)) { + return; + } + const nodes = Array.from(rootNode.querySelectorAll(selector)); + return nodes.filter((node) => node.offsetParent !== null); + } + function getNonce() { + const node = document.querySelector('meta[property="csp-nonce"]'); + if (node) { + return node.getAttribute("content"); + } else { + return null; + } + } + function canUseFocusVisible() { + if (typeof _canUseFocusVisible === "boolean") { + return _canUseFocusVisible; + } + if (!canUseDOM()) { + _canUseFocusVisible = false; + return _canUseFocusVisible; + } + const styleElement = document.createElement("style"); + const styleNonce = getNonce(); + if (styleNonce !== null) { + styleElement.setAttribute("nonce", styleNonce); + } + document.head.appendChild(styleElement); + try { + styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); + _canUseFocusVisible = true; + } catch (e) { + _canUseFocusVisible = false; + } finally { + document.head.removeChild(styleElement); + } + return _canUseFocusVisible; + } + var _canUseFocusVisible; + var init_dom2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/dom.js"() { + init_dist(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/events.js + var eventFocus, eventFocusIn, eventFocusOut, eventKeyDown, eventResize, eventScroll; + var init_events = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/events.js"() { + eventFocus = "focus"; + eventFocusIn = "focusin"; + eventFocusOut = "focusout"; + eventKeyDown = "keydown"; + eventResize = "resize"; + eventScroll = "scroll"; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/html.js + var init_html = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/html.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/key-codes.js + var KeyCodes, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, keyEscape, keyHome, keyEnd, keyFunction2, keyPageDown, keyPageUp, keySpace, keyTab, keyBackspace, keyDelete, ArrowKeys; + var init_key_codes = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/key-codes.js"() { + (function(KeyCodes2) { + KeyCodes2[KeyCodes2["alt"] = 18] = "alt"; + KeyCodes2[KeyCodes2["arrowDown"] = 40] = "arrowDown"; + KeyCodes2[KeyCodes2["arrowLeft"] = 37] = "arrowLeft"; + KeyCodes2[KeyCodes2["arrowRight"] = 39] = "arrowRight"; + KeyCodes2[KeyCodes2["arrowUp"] = 38] = "arrowUp"; + KeyCodes2[KeyCodes2["back"] = 8] = "back"; + KeyCodes2[KeyCodes2["backSlash"] = 220] = "backSlash"; + KeyCodes2[KeyCodes2["break"] = 19] = "break"; + KeyCodes2[KeyCodes2["capsLock"] = 20] = "capsLock"; + KeyCodes2[KeyCodes2["closeBracket"] = 221] = "closeBracket"; + KeyCodes2[KeyCodes2["colon"] = 186] = "colon"; + KeyCodes2[KeyCodes2["colon2"] = 59] = "colon2"; + KeyCodes2[KeyCodes2["comma"] = 188] = "comma"; + KeyCodes2[KeyCodes2["ctrl"] = 17] = "ctrl"; + KeyCodes2[KeyCodes2["delete"] = 46] = "delete"; + KeyCodes2[KeyCodes2["end"] = 35] = "end"; + KeyCodes2[KeyCodes2["enter"] = 13] = "enter"; + KeyCodes2[KeyCodes2["equals"] = 187] = "equals"; + KeyCodes2[KeyCodes2["equals2"] = 61] = "equals2"; + KeyCodes2[KeyCodes2["equals3"] = 107] = "equals3"; + KeyCodes2[KeyCodes2["escape"] = 27] = "escape"; + KeyCodes2[KeyCodes2["forwardSlash"] = 191] = "forwardSlash"; + KeyCodes2[KeyCodes2["function1"] = 112] = "function1"; + KeyCodes2[KeyCodes2["function10"] = 121] = "function10"; + KeyCodes2[KeyCodes2["function11"] = 122] = "function11"; + KeyCodes2[KeyCodes2["function12"] = 123] = "function12"; + KeyCodes2[KeyCodes2["function2"] = 113] = "function2"; + KeyCodes2[KeyCodes2["function3"] = 114] = "function3"; + KeyCodes2[KeyCodes2["function4"] = 115] = "function4"; + KeyCodes2[KeyCodes2["function5"] = 116] = "function5"; + KeyCodes2[KeyCodes2["function6"] = 117] = "function6"; + KeyCodes2[KeyCodes2["function7"] = 118] = "function7"; + KeyCodes2[KeyCodes2["function8"] = 119] = "function8"; + KeyCodes2[KeyCodes2["function9"] = 120] = "function9"; + KeyCodes2[KeyCodes2["home"] = 36] = "home"; + KeyCodes2[KeyCodes2["insert"] = 45] = "insert"; + KeyCodes2[KeyCodes2["menu"] = 93] = "menu"; + KeyCodes2[KeyCodes2["minus"] = 189] = "minus"; + KeyCodes2[KeyCodes2["minus2"] = 109] = "minus2"; + KeyCodes2[KeyCodes2["numLock"] = 144] = "numLock"; + KeyCodes2[KeyCodes2["numPad0"] = 96] = "numPad0"; + KeyCodes2[KeyCodes2["numPad1"] = 97] = "numPad1"; + KeyCodes2[KeyCodes2["numPad2"] = 98] = "numPad2"; + KeyCodes2[KeyCodes2["numPad3"] = 99] = "numPad3"; + KeyCodes2[KeyCodes2["numPad4"] = 100] = "numPad4"; + KeyCodes2[KeyCodes2["numPad5"] = 101] = "numPad5"; + KeyCodes2[KeyCodes2["numPad6"] = 102] = "numPad6"; + KeyCodes2[KeyCodes2["numPad7"] = 103] = "numPad7"; + KeyCodes2[KeyCodes2["numPad8"] = 104] = "numPad8"; + KeyCodes2[KeyCodes2["numPad9"] = 105] = "numPad9"; + KeyCodes2[KeyCodes2["numPadDivide"] = 111] = "numPadDivide"; + KeyCodes2[KeyCodes2["numPadDot"] = 110] = "numPadDot"; + KeyCodes2[KeyCodes2["numPadMinus"] = 109] = "numPadMinus"; + KeyCodes2[KeyCodes2["numPadMultiply"] = 106] = "numPadMultiply"; + KeyCodes2[KeyCodes2["numPadPlus"] = 107] = "numPadPlus"; + KeyCodes2[KeyCodes2["openBracket"] = 219] = "openBracket"; + KeyCodes2[KeyCodes2["pageDown"] = 34] = "pageDown"; + KeyCodes2[KeyCodes2["pageUp"] = 33] = "pageUp"; + KeyCodes2[KeyCodes2["period"] = 190] = "period"; + KeyCodes2[KeyCodes2["print"] = 44] = "print"; + KeyCodes2[KeyCodes2["quote"] = 222] = "quote"; + KeyCodes2[KeyCodes2["scrollLock"] = 145] = "scrollLock"; + KeyCodes2[KeyCodes2["shift"] = 16] = "shift"; + KeyCodes2[KeyCodes2["space"] = 32] = "space"; + KeyCodes2[KeyCodes2["tab"] = 9] = "tab"; + KeyCodes2[KeyCodes2["tilde"] = 192] = "tilde"; + KeyCodes2[KeyCodes2["windowsLeft"] = 91] = "windowsLeft"; + KeyCodes2[KeyCodes2["windowsOpera"] = 219] = "windowsOpera"; + KeyCodes2[KeyCodes2["windowsRight"] = 92] = "windowsRight"; + })(KeyCodes || (KeyCodes = {})); + keyArrowDown = "ArrowDown"; + keyArrowLeft = "ArrowLeft"; + keyArrowRight = "ArrowRight"; + keyArrowUp = "ArrowUp"; + keyEnter = "Enter"; + keyEscape = "Escape"; + keyHome = "Home"; + keyEnd = "End"; + keyFunction2 = "F2"; + keyPageDown = "PageDown"; + keyPageUp = "PageUp"; + keySpace = " "; + keyTab = "Tab"; + keyBackspace = "Backspace"; + keyDelete = "Delete"; + ArrowKeys = { + ArrowDown: keyArrowDown, + ArrowLeft: keyArrowLeft, + ArrowRight: keyArrowRight, + ArrowUp: keyArrowUp + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/localization.js + var Direction; + var init_localization = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/localization.js"() { + (function(Direction2) { + Direction2["ltr"] = "ltr"; + Direction2["rtl"] = "rtl"; + })(Direction || (Direction = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/numbers.js + function wrapInBounds(min, max, value) { + if (value < min) { + return max; + } else if (value > max) { + return min; + } + return value; + } + function limit(min, max, value) { + return Math.min(Math.max(value, min), max); + } + function inRange2(value, min, max = 0) { + [min, max] = [min, max].sort((a, b) => a - b); + return min <= value && value < max; + } + var init_numbers = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/numbers.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/strings.js + function uniqueId(prefix = "") { + return `${prefix}${uniqueIdCounter++}`; + } + var uniqueIdCounter; + var init_strings = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/strings.js"() { + uniqueIdCounter = 0; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/query.js + var init_query = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/query.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js + var RtlScrollConverter; + var init_rtl_scroll_converter = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js"() { + init_dist(); + init_localization(); + RtlScrollConverter = class _RtlScrollConverter { + /** + * Gets the scrollLeft value of the provided element + */ + static getScrollLeft(scrolledElement, direction) { + if (direction === Direction.rtl) { + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + return scrolledElement.scrollLeft; + } + /** + * Sets the scrollLeft value of the provided element + */ + static setScrollLeft(scrolledElement, scrollValue, direction) { + if (direction === Direction.rtl) { + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, scrollValue); + return; + } + scrolledElement.scrollLeft = scrollValue; + } + /** + * The initial rtl scroll converter getter function, it calls the browser test to set the correct converter + * functions and then invokes the getter + */ + static initialGetRtlScrollConverter(scrolledElement) { + _RtlScrollConverter.initializeRtlScrollConverters(); + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + /** + * The "direct" rtl get scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft; + } + /** + * The "inverted" get scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedGetRtlScrollConverter(scrolledElement) { + return -Math.abs(scrolledElement.scrollLeft); + } + /** + * The "reverse" get scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft - (scrolledElement.scrollWidth - scrolledElement.clientWidth); + } + /** + * The initial rtl scroll converter setter function, it calls the browser test to set the correct converter + * functions and then invokes the setter + */ + static initialSetRtlScrollConverter(scrolledElement, newScrollValue) { + _RtlScrollConverter.initializeRtlScrollConverters(); + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, newScrollValue); + } + /** + * The "direct" rtl set scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = newScrollValue; + } + /** + * The "inverted" set scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = Math.abs(newScrollValue); + } + /** + * The "reverse" set scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseSetRtlScrollConverter(scrolledElement, newScrollValue) { + const maxScroll = scrolledElement.scrollWidth - scrolledElement.clientWidth; + scrolledElement.scrollLeft = maxScroll + newScrollValue; + } + /** + * detects the appropriate rtl scroll converter functions and assigns them + * should only run once + */ + static initializeRtlScrollConverters() { + if (!canUseDOM()) { + _RtlScrollConverter.applyDirectScrollConverters(); + return; + } + const testElement = _RtlScrollConverter.getTestElement(); + document.body.appendChild(testElement); + _RtlScrollConverter.checkForScrollType(testElement); + document.body.removeChild(testElement); + } + /** + * checks the provided test element to determine scroll type + * and apply appropriate converters + */ + static checkForScrollType(testElement) { + if (_RtlScrollConverter.isReverse(testElement)) { + _RtlScrollConverter.applyReverseScrollConverters(); + } else { + if (_RtlScrollConverter.isDirect(testElement)) { + _RtlScrollConverter.applyDirectScrollConverters(); + } else { + _RtlScrollConverter.applyInvertedScrollConverters(); + } + } + } + /** + * checks test element initial state for rtl "reverse" mode + */ + static isReverse(testElement) { + return testElement.scrollLeft > 0; + } + /** + * checks test element for rtl "direct" mode + */ + static isDirect(testElement) { + testElement.scrollLeft = -1; + return testElement.scrollLeft < 0; + } + /** + * apply direct scroll conververters + */ + static applyDirectScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.directSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.directGetRtlScrollConverter; + } + /** + * apply inverted scroll conververters + */ + static applyInvertedScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.invertedSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.invertedGetRtlScrollConverter; + } + /** + * apply reverse scroll conververters + */ + static applyReverseScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.reverseSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.reverseGetRtlScrollConverter; + } + /** + * generate a test element for rtl testing + */ + static getTestElement() { + const testElement = document.createElement("div"); + testElement.appendChild(document.createTextNode("ABCD")); + testElement.dir = "rtl"; + testElement.style.fontSize = "14px"; + testElement.style.width = "4px"; + testElement.style.height = "1px"; + testElement.style.position = "absolute"; + testElement.style.top = "-1000px"; + testElement.style.overflow = "scroll"; + return testElement; + } + }; + RtlScrollConverter.getRtlScrollLeftConverter = RtlScrollConverter.initialGetRtlScrollConverter; + RtlScrollConverter.setRtlScrollLeftConverter = RtlScrollConverter.initialSetRtlScrollConverter; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/system-colors.js + var SystemColors; + var init_system_colors = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/system-colors.js"() { + (function(SystemColors2) { + SystemColors2["Canvas"] = "Canvas"; + SystemColors2["CanvasText"] = "CanvasText"; + SystemColors2["LinkText"] = "LinkText"; + SystemColors2["VisitedText"] = "VisitedText"; + SystemColors2["ActiveText"] = "ActiveText"; + SystemColors2["ButtonFace"] = "ButtonFace"; + SystemColors2["ButtonText"] = "ButtonText"; + SystemColors2["Field"] = "Field"; + SystemColors2["FieldText"] = "FieldText"; + SystemColors2["Highlight"] = "Highlight"; + SystemColors2["HighlightText"] = "HighlightText"; + SystemColors2["GrayText"] = "GrayText"; + })(SystemColors || (SystemColors = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/index.js + var init_dist2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/index.js"() { + init_aria(); + init_array(); + init_class_names(); + init_dom2(); + init_events(); + init_html(); + init_key_codes(); + init_localization(); + init_numbers(); + init_strings(); + init_query(); + init_rtl_scroll_converter(); + init_system_colors(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js + var AccordionExpandMode, Accordion; + var init_accordion = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_accordion_item(); + AccordionExpandMode = { + /** + * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. + */ + single: "single", + /** + * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously. + */ + multi: "multi" + }; + Accordion = class extends FoundationElement { + constructor() { + super(...arguments); + this.expandmode = AccordionExpandMode.multi; + this.activeItemIndex = 0; + this.change = () => { + this.$emit("change", this.activeid); + }; + this.setItems = () => { + var _a; + if (this.accordionItems.length === 0) { + return; + } + this.accordionIds = this.getItemIds(); + this.accordionItems.forEach((item, index2) => { + if (item instanceof AccordionItem) { + item.addEventListener("change", this.activeItemChange); + if (this.isSingleExpandMode()) { + this.activeItemIndex !== index2 ? item.expanded = false : item.expanded = true; + } + } + const itemId = this.accordionIds[index2]; + item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index2 + 1}` : itemId); + this.activeid = this.accordionIds[this.activeItemIndex]; + item.addEventListener("keydown", this.handleItemKeyDown); + item.addEventListener("focus", this.handleItemFocus); + }); + if (this.isSingleExpandMode()) { + const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0]; + expandedItem.setAttribute("aria-disabled", "true"); + } + }; + this.removeItemListeners = (oldValue) => { + oldValue.forEach((item, index2) => { + item.removeEventListener("change", this.activeItemChange); + item.removeEventListener("keydown", this.handleItemKeyDown); + item.removeEventListener("focus", this.handleItemFocus); + }); + }; + this.activeItemChange = (event) => { + if (event.defaultPrevented || event.target !== event.currentTarget) { + return; + } + event.preventDefault(); + const selectedItem = event.target; + this.activeid = selectedItem.getAttribute("id"); + if (this.isSingleExpandMode()) { + this.resetItems(); + selectedItem.expanded = true; + selectedItem.setAttribute("aria-disabled", "true"); + this.accordionItems.forEach((item) => { + if (!item.hasAttribute("disabled") && item.id !== this.activeid) { + item.removeAttribute("aria-disabled"); + } + }); + } + this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem); + this.change(); + }; + this.handleItemKeyDown = (event) => { + if (event.target !== event.currentTarget) { + return; + } + this.accordionIds = this.getItemIds(); + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjust(-1); + break; + case keyArrowDown: + event.preventDefault(); + this.adjust(1); + break; + case keyHome: + this.activeItemIndex = 0; + this.focusItem(); + break; + case keyEnd: + this.activeItemIndex = this.accordionItems.length - 1; + this.focusItem(); + break; + } + }; + this.handleItemFocus = (event) => { + if (event.target === event.currentTarget) { + const focusedItem = event.target; + const focusedIndex = this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem); + if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { + this.activeItemIndex = focusedIndex; + this.activeid = this.accordionIds[this.activeItemIndex]; + } + } + }; + } + /** + * @internal + */ + accordionItemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.removeItemListeners(oldValue); + this.setItems(); + } + } + findExpandedItem() { + for (let item = 0; item < this.accordionItems.length; item++) { + if (this.accordionItems[item].getAttribute("expanded") === "true") { + return this.accordionItems[item]; + } + } + return null; + } + resetItems() { + this.accordionItems.forEach((item, index2) => { + item.expanded = false; + }); + } + getItemIds() { + return this.accordionItems.map((accordionItem) => { + return accordionItem.getAttribute("id"); + }); + } + isSingleExpandMode() { + return this.expandmode === AccordionExpandMode.single; + } + adjust(adjustment) { + this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment); + this.focusItem(); + } + focusItem() { + const element = this.accordionItems[this.activeItemIndex]; + if (element instanceof AccordionItem) { + element.expandbutton.focus(); + } + } + }; + __decorate([ + attr({ attribute: "expand-mode" }) + ], Accordion.prototype, "expandmode", void 0); + __decorate([ + observable + ], Accordion.prototype, "accordionItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js + var init_accordion2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js"() { + init_accordion_template(); + init_accordion(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js + var anchorTemplate; + var init_anchor_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js"() { + init_esm(); + init_start_end(); + anchorTemplate = (context, definition) => html` + + ${startSlotTemplate(context, definition)} + + + + ${endSlotTemplate(context, definition)} + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js + var ARIAGlobalStatesAndProperties; + var init_aria_global = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js"() { + init_tslib_es6(); + init_esm(); + ARIAGlobalStatesAndProperties = class { + }; + __decorate([ + attr({ attribute: "aria-atomic" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); + __decorate([ + attr({ attribute: "aria-busy" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); + __decorate([ + attr({ attribute: "aria-controls" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); + __decorate([ + attr({ attribute: "aria-current" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-details" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); + __decorate([ + attr({ attribute: "aria-disabled" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); + __decorate([ + attr({ attribute: "aria-errormessage" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); + __decorate([ + attr({ attribute: "aria-flowto" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); + __decorate([ + attr({ attribute: "aria-haspopup" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); + __decorate([ + attr({ attribute: "aria-hidden" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); + __decorate([ + attr({ attribute: "aria-invalid" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); + __decorate([ + attr({ attribute: "aria-keyshortcuts" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-live" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); + __decorate([ + attr({ attribute: "aria-owns" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); + __decorate([ + attr({ attribute: "aria-relevant" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); + __decorate([ + attr({ attribute: "aria-roledescription" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js + var init_patterns = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js"() { + init_aria_global(); + init_start_end(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js + var Anchor, DelegatesARIALink; + var init_anchor = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_patterns(); + init_apply_mixins(); + Anchor = class extends FoundationElement { + constructor() { + super(...arguments); + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + var _a2; + (_a2 = this.control) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + } + }; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.handleUnsupportedDelegatesFocus(); + } + }; + __decorate([ + attr + ], Anchor.prototype, "download", void 0); + __decorate([ + attr + ], Anchor.prototype, "href", void 0); + __decorate([ + attr + ], Anchor.prototype, "hreflang", void 0); + __decorate([ + attr + ], Anchor.prototype, "ping", void 0); + __decorate([ + attr + ], Anchor.prototype, "referrerpolicy", void 0); + __decorate([ + attr + ], Anchor.prototype, "rel", void 0); + __decorate([ + attr + ], Anchor.prototype, "target", void 0); + __decorate([ + attr + ], Anchor.prototype, "type", void 0); + __decorate([ + observable + ], Anchor.prototype, "defaultSlottedContent", void 0); + DelegatesARIALink = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIALink.prototype, "ariaExpanded", void 0); + applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties); + applyMixins(Anchor, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js + var init_anchor2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js"() { + init_anchor_template(); + init_anchor(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js + var init_anchored_region_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js + var getDirection; + var init_direction = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js"() { + init_dist2(); + getDirection = (rootNode) => { + const dirNode = rootNode.closest("[dir]"); + return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js + var IntersectionService; + var init_intersection_service = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js"() { + init_esm(); + IntersectionService = class { + constructor() { + this.intersectionDetector = null; + this.observedElements = /* @__PURE__ */ new Map(); + this.requestPosition = (target, callback2) => { + var _a; + if (this.intersectionDetector === null) { + return; + } + if (this.observedElements.has(target)) { + (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback2); + return; + } + this.observedElements.set(target, [callback2]); + this.intersectionDetector.observe(target); + }; + this.cancelRequestPosition = (target, callback2) => { + const callbacks = this.observedElements.get(target); + if (callbacks !== void 0) { + const callBackIndex = callbacks.indexOf(callback2); + if (callBackIndex !== -1) { + callbacks.splice(callBackIndex, 1); + } + } + }; + this.initializeIntersectionDetector = () => { + if (!$global.IntersectionObserver) { + return; + } + this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { + root: null, + rootMargin: "0px", + threshold: [0, 1] + }); + }; + this.handleIntersection = (entries) => { + if (this.intersectionDetector === null) { + return; + } + const pendingCallbacks = []; + const pendingCallbackParams = []; + entries.forEach((entry) => { + var _a; + (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); + const thisElementCallbacks = this.observedElements.get(entry.target); + if (thisElementCallbacks !== void 0) { + thisElementCallbacks.forEach((callback2) => { + let targetCallbackIndex = pendingCallbacks.indexOf(callback2); + if (targetCallbackIndex === -1) { + targetCallbackIndex = pendingCallbacks.length; + pendingCallbacks.push(callback2); + pendingCallbackParams.push([]); + } + pendingCallbackParams[targetCallbackIndex].push(entry); + }); + this.observedElements.delete(entry.target); + } + }); + pendingCallbacks.forEach((callback2, index2) => { + callback2(pendingCallbackParams[index2]); + }); + }; + this.initializeIntersectionDetector(); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js + var AnchoredRegion; + var init_anchored_region = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_direction(); + init_intersection_service(); + AnchoredRegion = class _AnchoredRegion extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.viewport = ""; + this.horizontalPositioningMode = "uncontrolled"; + this.horizontalDefaultPosition = "unset"; + this.horizontalViewportLock = false; + this.horizontalInset = false; + this.horizontalScaling = "content"; + this.verticalPositioningMode = "uncontrolled"; + this.verticalDefaultPosition = "unset"; + this.verticalViewportLock = false; + this.verticalInset = false; + this.verticalScaling = "content"; + this.fixedPlacement = false; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.initialLayoutComplete = false; + this.resizeDetector = null; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.pendingPositioningUpdate = false; + this.pendingReset = false; + this.currentDirection = Direction.ltr; + this.regionVisible = false; + this.forceUpdate = false; + this.updateThreshold = 0.5; + this.update = () => { + if (!this.pendingPositioningUpdate) { + this.requestPositionUpdates(); + } + }; + this.startObservers = () => { + this.stopObservers(); + if (this.anchorElement === null) { + return; + } + this.requestPositionUpdates(); + if (this.resizeDetector !== null) { + this.resizeDetector.observe(this.anchorElement); + this.resizeDetector.observe(this); + } + }; + this.requestPositionUpdates = () => { + if (this.anchorElement === null || this.pendingPositioningUpdate) { + return; + } + _AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection); + _AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection); + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection); + } + this.pendingPositioningUpdate = true; + }; + this.stopObservers = () => { + if (this.pendingPositioningUpdate) { + this.pendingPositioningUpdate = false; + _AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection); + if (this.anchorElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection); + } + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection); + } + } + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + } + }; + this.getViewport = () => { + if (typeof this.viewport !== "string" || this.viewport === "") { + return document.documentElement; + } + return document.getElementById(this.viewport); + }; + this.getAnchor = () => { + return document.getElementById(this.anchor); + }; + this.handleIntersection = (entries) => { + if (!this.pendingPositioningUpdate) { + return; + } + this.pendingPositioningUpdate = false; + if (!this.applyIntersectionEntries(entries)) { + return; + } + this.updateLayout(); + }; + this.applyIntersectionEntries = (entries) => { + const regionEntry = entries.find((x) => x.target === this); + const anchorEntry = entries.find((x) => x.target === this.anchorElement); + const viewportEntry = entries.find((x) => x.target === this.viewportElement); + if (regionEntry === void 0 || viewportEntry === void 0 || anchorEntry === void 0) { + return false; + } + if (!this.regionVisible || this.forceUpdate || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0 || this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) || this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) || this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) { + this.regionRect = regionEntry.boundingClientRect; + this.anchorRect = anchorEntry.boundingClientRect; + if (this.viewportElement === document.documentElement) { + this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x + document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y + document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height); + } else { + this.viewportRect = viewportEntry.boundingClientRect; + } + this.updateRegionOffset(); + this.forceUpdate = false; + return true; + } + return false; + }; + this.updateRegionOffset = () => { + if (this.anchorRect && this.regionRect) { + this.baseHorizontalOffset = this.baseHorizontalOffset + (this.anchorRect.left - this.regionRect.left) + (this.translateX - this.baseHorizontalOffset); + this.baseVerticalOffset = this.baseVerticalOffset + (this.anchorRect.top - this.regionRect.top) + (this.translateY - this.baseVerticalOffset); + } + }; + this.isRectDifferent = (rectA, rectB) => { + if (Math.abs(rectA.top - rectB.top) > this.updateThreshold || Math.abs(rectA.right - rectB.right) > this.updateThreshold || Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold || Math.abs(rectA.left - rectB.left) > this.updateThreshold) { + return true; + } + return false; + }; + this.handleResize = (entries) => { + this.update(); + }; + this.reset = () => { + if (!this.pendingReset) { + return; + } + this.pendingReset = false; + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + if (this.viewportElement === null) { + this.viewportElement = this.getViewport(); + } + this.currentDirection = getDirection(this); + this.startObservers(); + }; + this.updateLayout = () => { + let desiredVerticalPosition = void 0; + let desiredHorizontalPosition = void 0; + if (this.horizontalPositioningMode !== "uncontrolled") { + const horizontalOptions = this.getPositioningOptions(this.horizontalInset); + if (this.horizontalDefaultPosition === "center") { + desiredHorizontalPosition = "center"; + } else if (this.horizontalDefaultPosition !== "unset") { + let dirCorrectedHorizontalDefaultPosition = this.horizontalDefaultPosition; + if (dirCorrectedHorizontalDefaultPosition === "start" || dirCorrectedHorizontalDefaultPosition === "end") { + const newDirection = getDirection(this); + if (newDirection !== this.currentDirection) { + this.currentDirection = newDirection; + this.initialize(); + return; + } + if (this.currentDirection === Direction.ltr) { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right"; + } else { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left"; + } + } + switch (dirCorrectedHorizontalDefaultPosition) { + case "left": + desiredHorizontalPosition = this.horizontalInset ? "insetStart" : "start"; + break; + case "right": + desiredHorizontalPosition = this.horizontalInset ? "insetEnd" : "end"; + break; + } + } + const horizontalThreshold = this.horizontalThreshold !== void 0 ? this.horizontalThreshold : this.regionRect !== void 0 ? this.regionRect.width : 0; + const anchorLeft = this.anchorRect !== void 0 ? this.anchorRect.left : 0; + const anchorRight = this.anchorRect !== void 0 ? this.anchorRect.right : 0; + const anchorWidth = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + const viewportLeft = this.viewportRect !== void 0 ? this.viewportRect.left : 0; + const viewportRight = this.viewportRect !== void 0 ? this.viewportRect.right : 0; + if (desiredHorizontalPosition === void 0 || !(this.horizontalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold) { + desiredHorizontalPosition = this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) > this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) ? horizontalOptions[0] : horizontalOptions[1]; + } + } + if (this.verticalPositioningMode !== "uncontrolled") { + const verticalOptions = this.getPositioningOptions(this.verticalInset); + if (this.verticalDefaultPosition === "center") { + desiredVerticalPosition = "center"; + } else if (this.verticalDefaultPosition !== "unset") { + switch (this.verticalDefaultPosition) { + case "top": + desiredVerticalPosition = this.verticalInset ? "insetStart" : "start"; + break; + case "bottom": + desiredVerticalPosition = this.verticalInset ? "insetEnd" : "end"; + break; + } + } + const verticalThreshold = this.verticalThreshold !== void 0 ? this.verticalThreshold : this.regionRect !== void 0 ? this.regionRect.height : 0; + const anchorTop = this.anchorRect !== void 0 ? this.anchorRect.top : 0; + const anchorBottom = this.anchorRect !== void 0 ? this.anchorRect.bottom : 0; + const anchorHeight = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + const viewportTop = this.viewportRect !== void 0 ? this.viewportRect.top : 0; + const viewportBottom = this.viewportRect !== void 0 ? this.viewportRect.bottom : 0; + if (desiredVerticalPosition === void 0 || !(this.verticalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold) { + desiredVerticalPosition = this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) > this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) ? verticalOptions[0] : verticalOptions[1]; + } + } + const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition); + const positionChanged = this.horizontalPosition !== desiredHorizontalPosition || this.verticalPosition !== desiredVerticalPosition; + this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension); + this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension); + this.updateRegionStyle(); + if (!this.initialLayoutComplete) { + this.initialLayoutComplete = true; + this.requestPositionUpdates(); + return; + } + if (!this.regionVisible) { + this.regionVisible = true; + this.style.removeProperty("pointer-events"); + this.style.removeProperty("opacity"); + this.classList.toggle("loaded", true); + this.$emit("loaded", this, { bubbles: false }); + } + this.updatePositionClasses(); + if (positionChanged) { + this.$emit("positionchange", this, { bubbles: false }); + } + }; + this.updateRegionStyle = () => { + this.style.width = this.regionWidth; + this.style.height = this.regionHeight; + this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`; + }; + this.updatePositionClasses = () => { + this.classList.toggle("top", this.verticalPosition === "start"); + this.classList.toggle("bottom", this.verticalPosition === "end"); + this.classList.toggle("inset-top", this.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.verticalPosition === "insetEnd"); + this.classList.toggle("vertical-center", this.verticalPosition === "center"); + this.classList.toggle("left", this.horizontalPosition === "start"); + this.classList.toggle("right", this.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.horizontalPosition === "insetEnd"); + this.classList.toggle("horizontal-center", this.horizontalPosition === "center"); + }; + this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => { + if (desiredHorizontalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionWidth = 0; + switch (this.horizontalScaling) { + case "anchor": + case "fill": + nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width; + this.regionWidth = `${nextRegionWidth}px`; + break; + case "content": + nextRegionWidth = this.regionRect.width; + this.regionWidth = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredHorizontalPosition) { + case "start": + this.translateX = this.baseHorizontalOffset - nextRegionWidth; + if (this.horizontalViewportLock && this.anchorRect.left > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.right); + } + break; + case "insetStart": + this.translateX = this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.right); + } + break; + case "insetEnd": + this.translateX = this.baseHorizontalOffset; + if (this.horizontalViewportLock && this.anchorRect.left < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.left); + } + break; + case "end": + this.translateX = this.baseHorizontalOffset + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.left); + } + break; + case "center": + sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2; + this.translateX = this.baseHorizontalOffset + sizeDelta; + if (this.horizontalViewportLock) { + const regionLeft = this.anchorRect.left + sizeDelta; + const regionRight = this.anchorRect.right - sizeDelta; + if (regionLeft < this.viewportRect.left && !(regionRight > this.viewportRect.right)) { + this.translateX = this.translateX - (regionLeft - this.viewportRect.left); + } else if (regionRight > this.viewportRect.right && !(regionLeft < this.viewportRect.left)) { + this.translateX = this.translateX - (regionRight - this.viewportRect.right); + } + } + break; + } + this.horizontalPosition = desiredHorizontalPosition; + }; + this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => { + if (desiredVerticalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionHeight = 0; + switch (this.verticalScaling) { + case "anchor": + case "fill": + nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height; + this.regionHeight = `${nextRegionHeight}px`; + break; + case "content": + nextRegionHeight = this.regionRect.height; + this.regionHeight = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredVerticalPosition) { + case "start": + this.translateY = this.baseVerticalOffset - nextRegionHeight; + if (this.verticalViewportLock && this.anchorRect.top > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.bottom); + } + break; + case "insetStart": + this.translateY = this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.bottom); + } + break; + case "insetEnd": + this.translateY = this.baseVerticalOffset; + if (this.verticalViewportLock && this.anchorRect.top < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.top); + } + break; + case "end": + this.translateY = this.baseVerticalOffset + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.top); + } + break; + case "center": + sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2; + this.translateY = this.baseVerticalOffset + sizeDelta; + if (this.verticalViewportLock) { + const regionTop = this.anchorRect.top + sizeDelta; + const regionBottom = this.anchorRect.bottom - sizeDelta; + if (regionTop < this.viewportRect.top && !(regionBottom > this.viewportRect.bottom)) { + this.translateY = this.translateY - (regionTop - this.viewportRect.top); + } else if (regionBottom > this.viewportRect.bottom && !(regionTop < this.viewportRect.top)) { + this.translateY = this.translateY - (regionBottom - this.viewportRect.bottom); + } + } + } + this.verticalPosition = desiredVerticalPosition; + }; + this.getPositioningOptions = (inset) => { + if (inset) { + return ["insetStart", "insetEnd"]; + } + return ["start", "end"]; + }; + this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => { + const spaceStart = anchorStart - viewportStart; + const spaceEnd = viewportEnd - (anchorStart + anchorSpan); + switch (positionOption) { + case "start": + return spaceStart; + case "insetStart": + return spaceStart + anchorSpan; + case "insetEnd": + return spaceEnd + anchorSpan; + case "end": + return spaceEnd; + case "center": + return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan; + } + }; + this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => { + const newRegionDimension = { + height: this.regionRect !== void 0 ? this.regionRect.height : 0, + width: this.regionRect !== void 0 ? this.regionRect.width : 0 + }; + if (desiredHorizontalPosition !== void 0 && this.horizontalScaling === "fill") { + newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== void 0 ? this.anchorRect.left : 0, this.anchorRect !== void 0 ? this.anchorRect.right : 0, this.anchorRect !== void 0 ? this.anchorRect.width : 0, this.viewportRect !== void 0 ? this.viewportRect.left : 0, this.viewportRect !== void 0 ? this.viewportRect.right : 0); + } else if (this.horizontalScaling === "anchor") { + newRegionDimension.width = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + } + if (desiredVerticalPosition !== void 0 && this.verticalScaling === "fill") { + newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== void 0 ? this.anchorRect.top : 0, this.anchorRect !== void 0 ? this.anchorRect.bottom : 0, this.anchorRect !== void 0 ? this.anchorRect.height : 0, this.viewportRect !== void 0 ? this.viewportRect.top : 0, this.viewportRect !== void 0 ? this.viewportRect.bottom : 0); + } else if (this.verticalScaling === "anchor") { + newRegionDimension.height = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + } + return newRegionDimension; + }; + this.startAutoUpdateEventListeners = () => { + window.addEventListener(eventResize, this.update, { passive: true }); + window.addEventListener(eventScroll, this.update, { + passive: true, + capture: true + }); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.observe(this.viewportElement); + } + }; + this.stopAutoUpdateEventListeners = () => { + window.removeEventListener(eventResize, this.update); + window.removeEventListener(eventScroll, this.update); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.unobserve(this.viewportElement); + } + }; + } + anchorChanged() { + if (this.initialLayoutComplete) { + this.anchorElement = this.getAnchor(); + } + } + viewportChanged() { + if (this.initialLayoutComplete) { + this.viewportElement = this.getViewport(); + } + } + horizontalPositioningModeChanged() { + this.requestReset(); + } + horizontalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + horizontalViewportLockChanged() { + this.updateForAttributeChange(); + } + horizontalInsetChanged() { + this.updateForAttributeChange(); + } + horizontalThresholdChanged() { + this.updateForAttributeChange(); + } + horizontalScalingChanged() { + this.updateForAttributeChange(); + } + verticalPositioningModeChanged() { + this.requestReset(); + } + verticalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + verticalViewportLockChanged() { + this.updateForAttributeChange(); + } + verticalInsetChanged() { + this.updateForAttributeChange(); + } + verticalThresholdChanged() { + this.updateForAttributeChange(); + } + verticalScalingChanged() { + this.updateForAttributeChange(); + } + fixedPlacementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + autoUpdateModeChanged(prevMode, newMode) { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + if (prevMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + if (newMode === "auto") { + this.startAutoUpdateEventListeners(); + } + } + } + anchorElementChanged() { + this.requestReset(); + } + viewportElementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.autoUpdateMode === "auto") { + this.startAutoUpdateEventListeners(); + } + this.initialize(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.autoUpdateMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + this.stopObservers(); + this.disconnectResizeDetector(); + } + /** + * @internal + */ + adoptedCallback() { + this.initialize(); + } + /** + * destroys the instance's resize observer + */ + disconnectResizeDetector() { + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.handleResize); + } + /** + * react to attribute changes that don't require a reset + */ + updateForAttributeChange() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.forceUpdate = true; + this.update(); + } + } + /** + * fully initializes the component + */ + initialize() { + this.initializeResizeDetector(); + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + this.requestReset(); + } + /** + * Request a reset if there are currently no open requests + */ + requestReset() { + if (this.$fastController.isConnected && this.pendingReset === false) { + this.setInitialState(); + DOM.queueUpdate(() => this.reset()); + this.pendingReset = true; + } + } + /** + * sets the starting configuration for component internal values + */ + setInitialState() { + this.initialLayoutComplete = false; + this.regionVisible = false; + this.translateX = 0; + this.translateY = 0; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.viewportRect = void 0; + this.regionRect = void 0; + this.anchorRect = void 0; + this.verticalPosition = void 0; + this.horizontalPosition = void 0; + this.style.opacity = "0"; + this.style.pointerEvents = "none"; + this.forceUpdate = false; + this.style.position = this.fixedPlacement ? "fixed" : "absolute"; + this.updatePositionClasses(); + this.updateRegionStyle(); + } + }; + AnchoredRegion.intersectionService = new IntersectionService(); + __decorate([ + attr + ], AnchoredRegion.prototype, "anchor", void 0); + __decorate([ + attr + ], AnchoredRegion.prototype, "viewport", void 0); + __decorate([ + attr({ attribute: "horizontal-positioning-mode" }) + ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0); + __decorate([ + attr({ attribute: "horizontal-default-position" }) + ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "horizontal-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalInset", void 0); + __decorate([ + attr({ attribute: "horizontal-threshold" }) + ], AnchoredRegion.prototype, "horizontalThreshold", void 0); + __decorate([ + attr({ attribute: "horizontal-scaling" }) + ], AnchoredRegion.prototype, "horizontalScaling", void 0); + __decorate([ + attr({ attribute: "vertical-positioning-mode" }) + ], AnchoredRegion.prototype, "verticalPositioningMode", void 0); + __decorate([ + attr({ attribute: "vertical-default-position" }) + ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalInset", void 0); + __decorate([ + attr({ attribute: "vertical-threshold" }) + ], AnchoredRegion.prototype, "verticalThreshold", void 0); + __decorate([ + attr({ attribute: "vertical-scaling" }) + ], AnchoredRegion.prototype, "verticalScaling", void 0); + __decorate([ + attr({ attribute: "fixed-placement", mode: "boolean" }) + ], AnchoredRegion.prototype, "fixedPlacement", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], AnchoredRegion.prototype, "autoUpdateMode", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "anchorElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "viewportElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "initialLayoutComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js + var horizontalAnchorOverlay, FlyoutPosTop, FlyoutPosBottom, FlyoutPosTallest, FlyoutPosTopFill, FlyoutPosBottomFill, FlyoutPosTallestFill; + var init_anchored_region_config = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js"() { + horizontalAnchorOverlay = { + horizontalDefaultPosition: "center", + horizontalPositioningMode: "locktodefault", + horizontalInset: false, + horizontalScaling: "anchor" + }; + FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "top", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "bottom", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: "dynamic", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: "fill" }); + FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: "fill" }); + FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: "fill" }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js + var init_anchored_region2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js"() { + init_anchored_region_template(); + init_anchored_region(); + init_anchored_region_config(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js + var init_avatar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js + var Avatar; + var init_avatar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Avatar = class extends FoundationElement { + /** + * Internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.shape) { + this.shape = "circle"; + } + } + }; + __decorate([ + attr + ], Avatar.prototype, "fill", void 0); + __decorate([ + attr + ], Avatar.prototype, "color", void 0); + __decorate([ + attr + ], Avatar.prototype, "link", void 0); + __decorate([ + attr + ], Avatar.prototype, "shape", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js + var init_avatar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js"() { + init_avatar_template(); + init_avatar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js + var badgeTemplate; + var init_badge_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js"() { + init_esm(); + badgeTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js + var Badge; + var init_badge = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Badge = class extends FoundationElement { + constructor() { + super(...arguments); + this.generateBadgeStyle = () => { + if (!this.fill && !this.color) { + return; + } + const fill2 = `background-color: var(--badge-fill-${this.fill});`; + const color2 = `color: var(--badge-color-${this.color});`; + if (this.fill && !this.color) { + return fill2; + } else if (this.color && !this.fill) { + return color2; + } else { + return `${color2} ${fill2}`; + } + }; + } + }; + __decorate([ + attr({ attribute: "fill" }) + ], Badge.prototype, "fill", void 0); + __decorate([ + attr({ attribute: "color" }) + ], Badge.prototype, "color", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Badge.prototype, "circular", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js + var init_badge2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js"() { + init_badge_template(); + init_badge(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js + var init_breadcrumb_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js + var BreadcrumbItem; + var init_breadcrumb_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js"() { + init_tslib_es6(); + init_esm(); + init_anchor(); + init_patterns(); + init_apply_mixins(); + BreadcrumbItem = class extends Anchor { + constructor() { + super(...arguments); + this.separator = true; + } + }; + __decorate([ + observable + ], BreadcrumbItem.prototype, "separator", void 0); + applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js + var init_breadcrumb_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js"() { + init_breadcrumb_item_template(); + init_breadcrumb_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js + var init_breadcrumb_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js + var Breadcrumb; + var init_breadcrumb = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js"() { + init_tslib_es6(); + init_esm(); + init_breadcrumb_item(); + init_foundation_element(); + Breadcrumb = class extends FoundationElement { + slottedBreadcrumbItemsChanged() { + if (this.$fastController.isConnected) { + if (this.slottedBreadcrumbItems === void 0 || this.slottedBreadcrumbItems.length === 0) { + return; + } + const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1]; + this.slottedBreadcrumbItems.forEach((item) => { + const itemIsLastNode = item === lastNode; + this.setItemSeparator(item, itemIsLastNode); + this.setAriaCurrent(item, itemIsLastNode); + }); + } + } + setItemSeparator(item, isLastNode) { + if (item instanceof BreadcrumbItem) { + item.separator = !isLastNode; + } + } + /** + * Finds href on childnodes in the light DOM or shadow DOM. + * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href. + */ + findChildWithHref(node) { + var _a, _b; + if (node.childElementCount > 0) { + return node.querySelector("a[href]"); + } else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) { + return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]"); + } else + return null; + } + /** + * Sets ARIA Current for the current node + * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node, + * otherwise apply aria-current to the host element, with an href + */ + setAriaCurrent(item, isLastNode) { + const childNodeWithHref = this.findChildWithHref(item); + if (childNodeWithHref === null && item.hasAttribute("href") && item instanceof BreadcrumbItem) { + isLastNode ? item.setAttribute("aria-current", "page") : item.removeAttribute("aria-current"); + } else if (childNodeWithHref !== null) { + isLastNode ? childNodeWithHref.setAttribute("aria-current", "page") : childNodeWithHref.removeAttribute("aria-current"); + } + } + }; + __decorate([ + observable + ], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js + var init_breadcrumb2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js"() { + init_breadcrumb_template(); + init_breadcrumb(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js + var buttonTemplate; + var init_button_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js"() { + init_esm(); + init_start_end(); + buttonTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js + function FormAssociated(BaseCtor) { + const C = class extends BaseCtor { + constructor(...args) { + super(...args); + this.dirtyValue = false; + this.disabled = false; + this.proxyEventsToBlock = ["change", "click"]; + this.proxyInitialized = false; + this.required = false; + this.initialValue = this.initialValue || ""; + if (!this.elementInternals) { + this.formResetCallback = this.formResetCallback.bind(this); + } + } + /** + * Must evaluate to true to enable elementInternals. + * Feature detects API support and resolve respectively + * + * @internal + */ + static get formAssociated() { + return supportsElementInternals; + } + /** + * Returns the validity state of the element + * + * @alpha + */ + get validity() { + return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; + } + /** + * Retrieve a reference to the associated form. + * Returns null if not associated to any form. + * + * @alpha + */ + get form() { + return this.elementInternals ? this.elementInternals.form : this.proxy.form; + } + /** + * Retrieve the localized validation message, + * or custom validation message if set. + * + * @alpha + */ + get validationMessage() { + return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; + } + /** + * Whether the element will be validated when the + * form is submitted + */ + get willValidate() { + return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; + } + /** + * A reference to all associated label elements + */ + get labels() { + if (this.elementInternals) { + return Object.freeze(Array.from(this.elementInternals.labels)); + } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { + const parentLabels = this.proxy.labels; + const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)); + const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; + return Object.freeze(labels); + } else { + return emptyArray; + } + } + /** + * Invoked when the `value` property changes + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `valueChanged` method + * They must be sure to invoke `super.valueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + valueChanged(previous, next) { + this.dirtyValue = true; + if (this.proxy instanceof HTMLElement) { + this.proxy.value = this.value; + } + this.currentValue = this.value; + this.setFormValue(this.value); + this.validate(); + } + currentValueChanged() { + this.value = this.currentValue; + } + /** + * Invoked when the `initialValue` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `initialValueChanged` method + * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + /** + * Invoked when the `disabled` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `disabledChanged` method + * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + disabledChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.disabled = this.disabled; + } + DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled)); + } + /** + * Invoked when the `name` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `nameChanged` method + * They must be sure to invoke `super.nameChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + nameChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.name = this.name; + } + } + /** + * Invoked when the `required` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `requiredChanged` method + * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + requiredChanged(prev, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.required = this.required; + } + DOM.queueUpdate(() => this.classList.toggle("required", this.required)); + this.validate(); + } + /** + * The element internals object. Will only exist + * in browsers supporting the attachInternals API + */ + get elementInternals() { + if (!supportsElementInternals) { + return null; + } + let internals = InternalsMap.get(this); + if (!internals) { + internals = this.attachInternals(); + InternalsMap.set(this, internals); + } + return internals; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("keypress", this._keypressHandler); + if (!this.value) { + this.value = this.initialValue; + this.dirtyValue = false; + } + if (!this.elementInternals) { + this.attachProxy(); + if (this.form) { + this.form.addEventListener("reset", this.formResetCallback); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.proxyEventsToBlock.forEach((name) => this.proxy.removeEventListener(name, this.stopPropagation)); + if (!this.elementInternals && this.form) { + this.form.removeEventListener("reset", this.formResetCallback); + } + } + /** + * Return the current validity of the element. + */ + checkValidity() { + return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); + } + /** + * Return the current validity of the element. + * If false, fires an invalid event at the element. + */ + reportValidity() { + return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); + } + /** + * Set the validity of the control. In cases when the elementInternals object is not + * available (and the proxy element is used to report validity), this function will + * do nothing unless a message is provided, at which point the setCustomValidity method + * of the proxy element will be invoked with the provided message. + * @param flags - Validity flags + * @param message - Optional message to supply + * @param anchor - Optional element used by UA to display an interactive validation UI + */ + setValidity(flags, message, anchor) { + if (this.elementInternals) { + this.elementInternals.setValidity(flags, message, anchor); + } else if (typeof message === "string") { + this.proxy.setCustomValidity(message); + } + } + /** + * Invoked when a connected component's form or fieldset has its disabled + * state changed. + * @param disabled - the disabled value of the form / fieldset + */ + formDisabledCallback(disabled) { + this.disabled = disabled; + } + formResetCallback() { + this.value = this.initialValue; + this.dirtyValue = false; + } + /** + * Attach the proxy element to the DOM + */ + attachProxy() { + var _a; + if (!this.proxyInitialized) { + this.proxyInitialized = true; + this.proxy.style.display = "none"; + this.proxyEventsToBlock.forEach((name) => this.proxy.addEventListener(name, this.stopPropagation)); + this.proxy.disabled = this.disabled; + this.proxy.required = this.required; + if (typeof this.name === "string") { + this.proxy.name = this.name; + } + if (typeof this.value === "string") { + this.proxy.value = this.value; + } + this.proxy.setAttribute("slot", proxySlotName); + this.proxySlot = document.createElement("slot"); + this.proxySlot.setAttribute("name", proxySlotName); + } + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); + this.appendChild(this.proxy); + } + /** + * Detach the proxy element from the DOM + */ + detachProxy() { + var _a; + this.removeChild(this.proxy); + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate(anchor) { + if (this.proxy instanceof HTMLElement) { + this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); + } + } + /** + * Associates the provided value (and optional state) with the parent form. + * @param value - The value to set + * @param state - The state object provided to during session restores and when autofilling. + */ + setFormValue(value, state) { + if (this.elementInternals) { + this.elementInternals.setFormValue(value, state || value); + } + } + _keypressHandler(e) { + switch (e.key) { + case keyEnter: + if (this.form instanceof HTMLFormElement) { + const defaultButton = this.form.querySelector("[type=submit]"); + defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); + } + break; + } + } + /** + * Used to stop propagation of proxy element events + * @param e - Event object + */ + stopPropagation(e) { + e.stopPropagation(); + } + }; + attr({ mode: "boolean" })(C.prototype, "disabled"); + attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue"); + attr({ attribute: "current-value" })(C.prototype, "currentValue"); + attr(C.prototype, "name"); + attr({ mode: "boolean" })(C.prototype, "required"); + observable(C.prototype, "value"); + return C; + } + function CheckableFormAssociated(BaseCtor) { + class C extends FormAssociated(BaseCtor) { + } + class D extends C { + constructor(...args) { + super(args); + this.dirtyChecked = false; + this.checkedAttribute = false; + this.checked = false; + this.dirtyChecked = false; + } + checkedAttributeChanged() { + this.defaultChecked = this.checkedAttribute; + } + /** + * @internal + */ + defaultCheckedChanged() { + if (!this.dirtyChecked) { + this.checked = this.defaultChecked; + this.dirtyChecked = false; + } + } + checkedChanged(prev, next) { + if (!this.dirtyChecked) { + this.dirtyChecked = true; + } + this.currentChecked = this.checked; + this.updateForm(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.checked = this.checked; + } + if (prev !== void 0) { + this.$emit("change"); + } + this.validate(); + } + currentCheckedChanged(prev, next) { + this.checked = this.currentChecked; + } + updateForm() { + const value = this.checked ? this.value : null; + this.setFormValue(value, value); + } + connectedCallback() { + super.connectedCallback(); + this.updateForm(); + } + formResetCallback() { + super.formResetCallback(); + this.checked = !!this.checkedAttribute; + this.dirtyChecked = false; + } + } + attr({ attribute: "checked", mode: "boolean" })(D.prototype, "checkedAttribute"); + attr({ attribute: "current-checked", converter: booleanConverter })(D.prototype, "currentChecked"); + observable(D.prototype, "defaultChecked"); + observable(D.prototype, "checked"); + return D; + } + var proxySlotName, ElementInternalsKey, supportsElementInternals, InternalsMap; + var init_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js"() { + init_esm(); + init_dist2(); + proxySlotName = "form-associated-proxy"; + ElementInternalsKey = "ElementInternals"; + supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; + InternalsMap = /* @__PURE__ */ new WeakMap(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js + var _Button, FormAssociatedButton; + var init_button_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Button = class extends FoundationElement { + }; + FormAssociatedButton = class extends FormAssociated(_Button) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.js + var Button, DelegatesARIAButton; + var init_button = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_button_form_associated(); + Button = class extends FormAssociatedButton { + constructor() { + super(...arguments); + this.handleClick = (e) => { + var _a; + if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) { + e.stopPropagation(); + } + }; + this.handleSubmission = () => { + if (!this.form) { + return; + } + const attached = this.proxy.isConnected; + if (!attached) { + this.attachProxy(); + } + typeof this.form.requestSubmit === "function" ? this.form.requestSubmit(this.proxy) : this.proxy.click(); + if (!attached) { + this.detachProxy(); + } + }; + this.handleFormReset = () => { + var _a; + (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset(); + }; + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + this.control.focus(); + }; + } + }; + } + formactionChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formAction = this.formaction; + } + } + formenctypeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formEnctype = this.formenctype; + } + } + formmethodChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formMethod = this.formmethod; + } + } + formnovalidateChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formNoValidate = this.formnovalidate; + } + } + formtargetChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formTarget = this.formtarget; + } + } + typeChanged(previous, next) { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + } + next === "submit" && this.addEventListener("click", this.handleSubmission); + previous === "submit" && this.removeEventListener("click", this.handleSubmission); + next === "reset" && this.addEventListener("click", this.handleFormReset); + previous === "reset" && this.removeEventListener("click", this.handleFormReset); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.handleUnsupportedDelegatesFocus(); + const elements3 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements3) { + elements3.forEach((span) => { + span.addEventListener("click", this.handleClick); + }); + } + } + /** + * @internal + */ + disconnectedCallback() { + var _a; + super.disconnectedCallback(); + const elements3 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements3) { + elements3.forEach((span) => { + span.removeEventListener("click", this.handleClick); + }); + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], Button.prototype, "formId", void 0); + __decorate([ + attr + ], Button.prototype, "formaction", void 0); + __decorate([ + attr + ], Button.prototype, "formenctype", void 0); + __decorate([ + attr + ], Button.prototype, "formmethod", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "formnovalidate", void 0); + __decorate([ + attr + ], Button.prototype, "formtarget", void 0); + __decorate([ + attr + ], Button.prototype, "type", void 0); + __decorate([ + observable + ], Button.prototype, "defaultSlottedContent", void 0); + DelegatesARIAButton = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIAButton.prototype, "ariaExpanded", void 0); + __decorate([ + attr({ attribute: "aria-pressed" }) + ], DelegatesARIAButton.prototype, "ariaPressed", void 0); + applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties); + applyMixins(Button, StartEnd, DelegatesARIAButton); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/index.js + var init_button2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/index.js"() { + init_button_template(); + init_button(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js + var DateFormatter; + var init_date_formatter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js"() { + DateFormatter = class { + constructor(config) { + this.dayFormat = "numeric"; + this.weekdayFormat = "long"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.date = /* @__PURE__ */ new Date(); + if (config) { + for (const key in config) { + const value = config[key]; + if (key === "date") { + this.date = this.getDateObject(value); + } else { + this[key] = value; + } + } + } + } + /** + * Helper function to make sure that the DateFormatter is working with an instance of Date + * @param date - The date as an object, string or Date insance + * @returns - A Date instance + * @public + */ + getDateObject(date) { + if (typeof date === "string") { + const dates = date.split(/[/-]/); + if (dates.length < 3) { + return /* @__PURE__ */ new Date(); + } + return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10)); + } else if ("day" in date && "month" in date && "year" in date) { + const { day, month, year } = date; + return new Date(year, month - 1, day); + } + return date; + } + /** + * + * @param date - a valide date as either a Date, string, objec or a DateFormatter + * @param format - The formatting for the string + * @param locale - locale data used for formatting + * @returns A localized string of the date provided + * @public + */ + getDate(date = this.date, format = { + weekday: this.weekdayFormat, + month: this.monthFormat, + day: this.dayFormat, + year: this.yearFormat + }, locale = this.locale) { + const dateObj = this.getDateObject(date); + if (!dateObj.getTime()) { + return ""; + } + const optionsWithTimeZone = Object.assign({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }, format); + return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj); + } + /** + * + * @param day - Day to localize + * @param format - The formatting for the day + * @param locale - The locale data used for formatting + * @returns - A localized number for the day + * @public + */ + getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) { + return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale); + } + /** + * + * @param month - The month to localize + * @param format - The formatting for the month + * @param locale - The locale data used for formatting + * @returns - A localized name of the month + * @public + */ + getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) { + return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale); + } + /** + * + * @param year - The year to localize + * @param format - The formatting for the year + * @param locale - The locale data used for formatting + * @returns - A localized string for the year + * @public + */ + getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) { + return this.getDate({ month: 2, day: 2, year }, { year: format }, locale); + } + /** + * + * @param weekday - The number of the weekday, defaults to Sunday + * @param format - The formatting for the weekday label + * @param locale - The locale data used for formatting + * @returns - A formatted weekday label + * @public + */ + getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) { + const date = `1-${weekday + 1}-2017`; + return this.getDate(date, { weekday: format }, locale); + } + /** + * + * @param format - The formatting for the weekdays + * @param locale - The locale data used for formatting + * @returns - An array of the weekday labels + * @public + */ + getWeekdays(format = this.weekdayFormat, locale = this.locale) { + return Array(7).fill(null).map((_, day) => this.getWeekday(day, format, locale)); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js + var Calendar; + var init_calendar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_date_formatter(); + Calendar = class extends FoundationElement { + constructor() { + super(...arguments); + this.dateFormatter = new DateFormatter(); + this.readonly = false; + this.locale = "en-US"; + this.month = (/* @__PURE__ */ new Date()).getMonth() + 1; + this.year = (/* @__PURE__ */ new Date()).getFullYear(); + this.dayFormat = "numeric"; + this.weekdayFormat = "short"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.minWeeks = 0; + this.disabledDates = ""; + this.selectedDates = ""; + this.oneDayInMs = 864e5; + } + localeChanged() { + this.dateFormatter.locale = this.locale; + } + dayFormatChanged() { + this.dateFormatter.dayFormat = this.dayFormat; + } + weekdayFormatChanged() { + this.dateFormatter.weekdayFormat = this.weekdayFormat; + } + monthFormatChanged() { + this.dateFormatter.monthFormat = this.monthFormat; + } + yearFormatChanged() { + this.dateFormatter.yearFormat = this.yearFormat; + } + /** + * Gets data needed to render about a calendar month as well as the previous and next months + * @param year - year of the calendar + * @param month - month of the calendar + * @returns - an object with data about the current and 2 surrounding months + * @public + */ + getMonthInfo(month = this.month, year = this.year) { + const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay(); + const getLength = (date) => { + const nextMonth2 = new Date(date.getFullYear(), date.getMonth() + 1, 1); + return new Date(nextMonth2.getTime() - this.oneDayInMs).getDate(); + }; + const thisMonth = new Date(year, month - 1); + const nextMonth = new Date(year, month); + const previousMonth = new Date(year, month - 2); + return { + length: getLength(thisMonth), + month, + start: getFirstDay(thisMonth), + year, + previous: { + length: getLength(previousMonth), + month: previousMonth.getMonth() + 1, + start: getFirstDay(previousMonth), + year: previousMonth.getFullYear() + }, + next: { + length: getLength(nextMonth), + month: nextMonth.getMonth() + 1, + start: getFirstDay(nextMonth), + year: nextMonth.getFullYear() + } + }; + } + /** + * A list of calendar days + * @param info - an object containing the information needed to render a calendar month + * @param minWeeks - minimum number of weeks to show + * @returns a list of days in a calendar month + * @public + */ + getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) { + minWeeks = minWeeks > 10 ? 10 : minWeeks; + const { start, length, previous, next } = info; + const days = []; + let dayCount = 1 - start; + while (dayCount < length + 1 || days.length < minWeeks || days[days.length - 1].length % 7 !== 0) { + const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info; + const day = dayCount < 1 ? previous.length + dayCount : dayCount > length ? dayCount - length : dayCount; + const dateString = `${month}-${day}-${year}`; + const disabled = this.dateInString(dateString, this.disabledDates); + const selected = this.dateInString(dateString, this.selectedDates); + const date = { + day, + month, + year, + disabled, + selected + }; + const target = days[days.length - 1]; + if (days.length === 0 || target.length % 7 === 0) { + days.push([date]); + } else { + target.push(date); + } + dayCount++; + } + return days; + } + /** + * A helper function that checks if a date exists in a list of dates + * @param date - A date objec that includes the day, month and year + * @param datesString - a comma separated list of dates + * @returns - Returns true if it found the date in the list of dates + * @public + */ + dateInString(date, datesString) { + const dates = datesString.split(",").map((str) => str.trim()); + date = typeof date === "string" ? date : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; + return dates.some((d) => d === date); + } + /** + * Creates a class string for the day container + * @param date - date of the calendar cell + * @returns - string of class names + * @public + */ + getDayClassNames(date, todayString) { + const { day, month, year, disabled, selected } = date; + const today = todayString === `${month}-${day}-${year}`; + const inactive = this.month !== month; + return [ + "day", + today && "today", + inactive && "inactive", + disabled && "disabled", + selected && "selected" + ].filter(Boolean).join(" "); + } + /** + * Returns a list of weekday labels + * @returns An array of weekday text and full text if abbreviated + * @public + */ + getWeekdayText() { + const weekdayText = this.dateFormatter.getWeekdays().map((text) => ({ text })); + if (this.weekdayFormat !== "long") { + const longText = this.dateFormatter.getWeekdays("long"); + weekdayText.forEach((weekday, index2) => { + weekday.abbr = longText[index2]; + }); + } + return weekdayText; + } + /** + * Emits the "date-select" event with the day, month and year. + * @param date - Date cell + * @public + */ + handleDateSelect(event, day) { + event.preventDefault; + this.$emit("dateselected", day); + } + /** + * Handles keyboard events on a cell + * @param event - Keyboard event + * @param date - Date of the cell selected + */ + handleKeydown(event, date) { + if (event.key === keyEnter) { + this.handleDateSelect(event, date); + } + return true; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Calendar.prototype, "readonly", void 0); + __decorate([ + attr + ], Calendar.prototype, "locale", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "month", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "year", void 0); + __decorate([ + attr({ attribute: "day-format", mode: "fromView" }) + ], Calendar.prototype, "dayFormat", void 0); + __decorate([ + attr({ attribute: "weekday-format", mode: "fromView" }) + ], Calendar.prototype, "weekdayFormat", void 0); + __decorate([ + attr({ attribute: "month-format", mode: "fromView" }) + ], Calendar.prototype, "monthFormat", void 0); + __decorate([ + attr({ attribute: "year-format", mode: "fromView" }) + ], Calendar.prototype, "yearFormat", void 0); + __decorate([ + attr({ attribute: "min-weeks", converter: nullableNumberConverter }) + ], Calendar.prototype, "minWeeks", void 0); + __decorate([ + attr({ attribute: "disabled-dates" }) + ], Calendar.prototype, "disabledDates", void 0); + __decorate([ + attr({ attribute: "selected-dates" }) + ], Calendar.prototype, "selectedDates", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js + var GenerateHeaderOptions, DataGridCellTypes, DataGridRowTypes; + var init_data_grid_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js"() { + GenerateHeaderOptions = { + none: "none", + default: "default", + sticky: "sticky" + }; + DataGridCellTypes = { + default: "default", + columnHeader: "columnheader", + rowHeader: "rowheader" + }; + DataGridRowTypes = { + default: "default", + header: "header", + stickyHeader: "sticky-header" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js + var DataGridRow; + var init_data_grid_row = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGridRow = class extends FoundationElement { + constructor() { + super(...arguments); + this.rowType = DataGridRowTypes.default; + this.rowData = null; + this.columnDefinitions = null; + this.isActiveRow = false; + this.cellsRepeatBehavior = null; + this.cellsPlaceholder = null; + this.focusColumnIndex = 0; + this.refocusOnLoad = false; + this.updateRowStyle = () => { + this.style.gridTemplateColumns = this.gridTemplateColumns; + }; + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowStyle(); + } + } + rowTypeChanged() { + if (this.$fastController.isConnected) { + this.updateItemTemplate(); + } + } + rowDataChanged() { + if (this.rowData !== null && this.isActiveRow) { + this.refocusOnLoad = true; + return; + } + } + cellItemTemplateChanged() { + this.updateItemTemplate(); + } + headerCellItemTemplateChanged() { + this.updateItemTemplate(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.cellsRepeatBehavior === null) { + this.cellsPlaceholder = document.createComment(""); + this.appendChild(this.cellsPlaceholder); + this.updateItemTemplate(); + this.cellsRepeatBehavior = new RepeatDirective((x) => x.columnDefinitions, (x) => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder); + this.$fastController.addBehaviors([this.cellsRepeatBehavior]); + } + this.addEventListener("cell-focused", this.handleCellFocus); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.updateRowStyle(); + if (this.refocusOnLoad) { + this.refocusOnLoad = false; + if (this.cellElements.length > this.focusColumnIndex) { + this.cellElements[this.focusColumnIndex].focus(); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("cell-focused", this.handleCellFocus); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + } + handleFocusout(e) { + if (!this.contains(e.target)) { + this.isActiveRow = false; + this.focusColumnIndex = 0; + } + } + handleCellFocus(e) { + this.isActiveRow = true; + this.focusColumnIndex = this.cellElements.indexOf(e.target); + this.$emit("row-focused", this); + } + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusColumnIndex = 0; + switch (e.key) { + case keyArrowLeft: + newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyArrowRight: + newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyHome: + if (!e.ctrlKey) { + this.cellElements[0].focus(); + e.preventDefault(); + } + break; + case keyEnd: + if (!e.ctrlKey) { + this.cellElements[this.cellElements.length - 1].focus(); + e.preventDefault(); + } + break; + } + } + updateItemTemplate() { + this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate; + } + }; + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGridRow.prototype, "gridTemplateColumns", void 0); + __decorate([ + attr({ attribute: "row-type" }) + ], DataGridRow.prototype, "rowType", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowIndex", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "isActiveRow", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "activeCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js + function createRowItemTemplate(context) { + const rowTag = context.tagFor(DataGridRow); + return html` + <${rowTag} + :rowData="${(x) => x}" + :cellItemTemplate="${(x, c) => c.parent.cellItemTemplate}" + :headerCellItemTemplate="${(x, c) => c.parent.headerCellItemTemplate}" + > +`; + } + var dataGridTemplate; + var init_data_grid_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js"() { + init_esm(); + init_data_grid_row(); + dataGridTemplate = (context, definition) => { + const rowItemTemplate = createRowItemTemplate(context); + const rowTag = context.tagFor(DataGridRow); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js + var DataGrid; + var init_data_grid = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGrid = class _DataGrid extends FoundationElement { + constructor() { + super(); + this.noTabbing = false; + this.generateHeader = GenerateHeaderOptions.default; + this.rowsData = []; + this.columnDefinitions = null; + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + this.rowsPlaceholder = null; + this.generatedHeader = null; + this.isUpdatingFocus = false; + this.pendingFocusUpdate = false; + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = true; + this.generatedGridTemplateColumns = ""; + this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => { + if (this.rowElements.length === 0) { + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + return; + } + const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex)); + const focusRow = this.rowElements[focusRowIndex]; + const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'); + const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex)); + const focusTarget = cells[focusColumnIndex]; + if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) { + focusTarget.scrollIntoView({ block: "center", inline: "center" }); + } + focusTarget.focus(); + }; + this.onChildListChange = (mutations, observer) => { + if (mutations && mutations.length) { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((newNode) => { + if (newNode.nodeType === 1 && newNode.getAttribute("role") === "row") { + newNode.columnDefinitions = this.columnDefinitions; + } + }); + }); + this.queueRowIndexUpdate(); + } + }; + this.queueRowIndexUpdate = () => { + if (!this.rowindexUpdateQueued) { + this.rowindexUpdateQueued = true; + DOM.queueUpdate(this.updateRowIndexes); + } + }; + this.updateRowIndexes = () => { + let newGridTemplateColumns = this.gridTemplateColumns; + if (newGridTemplateColumns === void 0) { + if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) { + const firstRow = this.rowElements[0]; + this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" "); + } + newGridTemplateColumns = this.generatedGridTemplateColumns; + } + this.rowElements.forEach((element, index2) => { + const thisRow = element; + thisRow.rowIndex = index2; + thisRow.gridTemplateColumns = newGridTemplateColumns; + if (this.columnDefinitionsStale) { + thisRow.columnDefinitions = this.columnDefinitions; + } + }); + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = false; + }; + } + /** + * generates a gridTemplateColumns based on columndata array + */ + static generateTemplateColumns(columnDefinitions) { + let templateColumns = ""; + columnDefinitions.forEach((column) => { + templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`; + }); + return templateColumns; + } + noTabbingChanged() { + if (this.$fastController.isConnected) { + if (this.noTabbing) { + this.setAttribute("tabIndex", "-1"); + } else { + this.setAttribute("tabIndex", this.contains(document.activeElement) || this === document.activeElement ? "-1" : "0"); + } + } + } + generateHeaderChanged() { + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowIndexes(); + } + } + rowsDataChanged() { + if (this.columnDefinitions === null && this.rowsData.length > 0) { + this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]); + } + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + columnDefinitionsChanged() { + if (this.columnDefinitions === null) { + this.generatedGridTemplateColumns = ""; + return; + } + this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(this.columnDefinitions); + if (this.$fastController.isConnected) { + this.columnDefinitionsStale = true; + this.queueRowIndexUpdate(); + } + } + headerCellItemTemplateChanged() { + if (this.$fastController.isConnected) { + if (this.generatedHeader !== null) { + this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate; + } + } + } + focusRowIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + focusColumnIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.rowItemTemplate === void 0) { + this.rowItemTemplate = this.defaultRowItemTemplate; + } + this.rowsPlaceholder = document.createComment(""); + this.appendChild(this.rowsPlaceholder); + this.toggleGeneratedHeader(); + this.rowsRepeatBehavior = new RepeatDirective((x) => x.rowsData, (x) => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder); + this.$fastController.addBehaviors([this.rowsRepeatBehavior]); + this.addEventListener("row-focused", this.handleRowFocus); + this.addEventListener(eventFocus, this.handleFocus); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.addEventListener(eventFocusOut, this.handleFocusOut); + this.observer = new MutationObserver(this.onChildListChange); + this.observer.observe(this, { childList: true }); + if (this.noTabbing) { + this.setAttribute("tabindex", "-1"); + } + DOM.queueUpdate(this.queueRowIndexUpdate); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("row-focused", this.handleRowFocus); + this.removeEventListener(eventFocus, this.handleFocus); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.removeEventListener(eventFocusOut, this.handleFocusOut); + this.observer.disconnect(); + this.rowsPlaceholder = null; + this.generatedHeader = null; + } + /** + * @internal + */ + handleRowFocus(e) { + this.isUpdatingFocus = true; + const focusRow = e.target; + this.focusRowIndex = this.rowElements.indexOf(focusRow); + this.focusColumnIndex = focusRow.focusColumnIndex; + this.setAttribute("tabIndex", "-1"); + this.isUpdatingFocus = false; + } + /** + * @internal + */ + handleFocus(e) { + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + /** + * @internal + */ + handleFocusOut(e) { + if (e.relatedTarget === null || !this.contains(e.relatedTarget)) { + this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0"); + } + } + /** + * @internal + */ + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusRowIndex; + const maxIndex = this.rowElements.length - 1; + const currentGridBottom = this.offsetHeight + this.scrollTop; + const lastRow = this.rowElements[maxIndex]; + switch (e.key) { + case keyArrowUp: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true); + break; + case keyArrowDown: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true); + break; + case keyPageUp: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex === 0) { + this.focusOnCell(0, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex - 1; + for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop < this.scrollTop) { + this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyPageDown: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) { + this.focusOnCell(maxIndex, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex + 1; + for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) { + let stickyHeaderOffset = 0; + if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) { + stickyHeaderOffset = this.generatedHeader.clientHeight; + } + this.scrollTop = thisRow.offsetTop - stickyHeaderOffset; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyHome: + if (e.ctrlKey) { + e.preventDefault(); + this.focusOnCell(0, 0, true); + } + break; + case keyEnd: + if (e.ctrlKey && this.columnDefinitions !== null) { + e.preventDefault(); + this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true); + } + break; + } + } + queueFocusUpdate() { + if (this.isUpdatingFocus && (this.contains(document.activeElement) || this === document.activeElement)) { + return; + } + if (this.pendingFocusUpdate === false) { + this.pendingFocusUpdate = true; + DOM.queueUpdate(() => this.updateFocus()); + } + } + updateFocus() { + this.pendingFocusUpdate = false; + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + toggleGeneratedHeader() { + if (this.generatedHeader !== null) { + this.removeChild(this.generatedHeader); + this.generatedHeader = null; + } + if (this.generateHeader !== GenerateHeaderOptions.none && this.rowsData.length > 0) { + const generatedHeaderElement = document.createElement(this.rowElementTag); + this.generatedHeader = generatedHeaderElement; + this.generatedHeader.columnDefinitions = this.columnDefinitions; + this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns; + this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header; + if (this.firstChild !== null || this.rowsPlaceholder !== null) { + this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder); + } + return; + } + } + }; + DataGrid.generateColumns = (row) => { + return Object.getOwnPropertyNames(row).map((property, index2) => { + return { + columnDataKey: property, + gridColumn: `${index2}` + }; + }); + }; + __decorate([ + attr({ attribute: "no-tabbing", mode: "boolean" }) + ], DataGrid.prototype, "noTabbing", void 0); + __decorate([ + attr({ attribute: "generate-header" }) + ], DataGrid.prototype, "generateHeader", void 0); + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGrid.prototype, "gridTemplateColumns", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowsData", void 0); + __decorate([ + observable + ], DataGrid.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusRowIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusColumnIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "defaultRowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElementTag", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js + var defaultCellContentsTemplate, defaultHeaderCellContentsTemplate, DataGridCell; + var init_data_grid_cell = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + defaultCellContentsTemplate = html` + +`; + defaultHeaderCellContentsTemplate = html` + +`; + DataGridCell = class extends FoundationElement { + constructor() { + super(...arguments); + this.cellType = DataGridCellTypes.default; + this.rowData = null; + this.columnDefinition = null; + this.isActiveCell = false; + this.customCellView = null; + this.updateCellStyle = () => { + this.style.gridColumn = this.gridColumn; + }; + } + cellTypeChanged() { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + gridColumnChanged() { + if (this.$fastController.isConnected) { + this.updateCellStyle(); + } + } + columnDefinitionChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.addEventListener(eventFocusIn, this.handleFocusin); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === void 0 ? 0 : this.columnDefinition.gridColumn}`; + this.updateCellView(); + this.updateCellStyle(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener(eventFocusIn, this.handleFocusin); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.disconnectCellView(); + } + handleFocusin(e) { + if (this.isActiveCell) { + return; + } + this.isActiveCell = true; + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + default: + if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + } + this.$emit("cell-focused", this); + } + handleFocusout(e) { + if (this !== document.activeElement && !this.contains(document.activeElement)) { + this.isActiveCell = false; + } + } + handleKeydown(e) { + if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) { + return; + } + switch (e.key) { + case keyEnter: + case keyFunction2: + if (this.contains(document.activeElement) && document.activeElement !== this) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + default: + if (this.columnDefinition.cellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + } + break; + case keyEscape: + if (this.contains(document.activeElement) && document.activeElement !== this) { + this.focus(); + e.preventDefault(); + } + break; + } + } + updateCellView() { + this.disconnectCellView(); + if (this.columnDefinition === null) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellTemplate !== void 0) { + this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this); + } else { + this.customCellView = defaultHeaderCellContentsTemplate.render(this, this); + } + break; + case void 0: + case DataGridCellTypes.rowHeader: + case DataGridCellTypes.default: + if (this.columnDefinition.cellTemplate !== void 0) { + this.customCellView = this.columnDefinition.cellTemplate.render(this, this); + } else { + this.customCellView = defaultCellContentsTemplate.render(this, this); + } + break; + } + } + disconnectCellView() { + if (this.customCellView !== null) { + this.customCellView.dispose(); + this.customCellView = null; + } + } + }; + __decorate([ + attr({ attribute: "cell-type" }) + ], DataGridCell.prototype, "cellType", void 0); + __decorate([ + attr({ attribute: "grid-column" }) + ], DataGridCell.prototype, "gridColumn", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "columnDefinition", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js + function createCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}" + grid-column="${(x, c) => c.index + 1}" + :rowData="${(x, c) => c.parent.rowData}" + :columnDefinition="${(x) => x}" + > +`; + } + function createHeaderCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="columnheader" + grid-column="${(x, c) => c.index + 1}" + :columnDefinition="${(x) => x}" + > +`; + } + var dataGridRowTemplate; + var init_data_grid_row_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js"() { + init_esm(); + init_data_grid_cell(); + dataGridRowTemplate = (context, definition) => { + const cellItemTemplate = createCellItemTemplate(context); + const headerCellItemTemplate = createHeaderCellItemTemplate(context); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js + var dataGridCellTemplate; + var init_data_grid_cell_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js"() { + init_esm(); + dataGridCellTemplate = (context, definition) => { + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js + var init_data_grid2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js"() { + init_data_grid_template(); + init_data_grid(); + init_data_grid_row_template(); + init_data_grid_row(); + init_data_grid_cell_template(); + init_data_grid_cell(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js + var CalendarTitleTemplate; + var init_calendar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js"() { + init_esm(); + CalendarTitleTemplate = html` +
+ + ${(x) => x.dateFormatter.getMonth(x.month)} + + ${(x) => x.dateFormatter.getYear(x.year)} +
+`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js + var init_calendar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js"() { + init_calendar(); + init_calendar_template(); + init_date_formatter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js + var init_card_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.js + var init_card = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/index.js + var init_card2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/index.js"() { + init_card_template(); + init_card(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js + var checkboxTemplate; + var init_checkbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js"() { + init_esm(); + checkboxTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js + var _Checkbox, FormAssociatedCheckbox; + var init_checkbox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Checkbox = class extends FoundationElement { + }; + FormAssociatedCheckbox = class extends CheckableFormAssociated(_Checkbox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js + var Checkbox; + var init_checkbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_checkbox_form_associated(); + Checkbox = class extends FormAssociatedCheckbox { + constructor() { + super(); + this.initialValue = "on"; + this.indeterminate = false; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keySpace: + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Checkbox.prototype, "readOnly", void 0); + __decorate([ + observable + ], Checkbox.prototype, "defaultSlottedNodes", void 0); + __decorate([ + observable + ], Checkbox.prototype, "indeterminate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js + var init_checkbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js"() { + init_checkbox_template(); + init_checkbox(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js + function isListboxOption(el2) { + return isHTMLElement(el2) && (el2.getAttribute("role") === "option" || el2 instanceof HTMLOptionElement); + } + var ListboxOption, DelegatesARIAListboxOption; + var init_listbox_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + ListboxOption = class extends FoundationElement { + constructor(text, value, defaultSelected, selected) { + super(); + this.defaultSelected = false; + this.dirtySelected = false; + this.selected = this.defaultSelected; + this.dirtyValue = false; + if (text) { + this.textContent = text; + } + if (value) { + this.initialValue = value; + } + if (defaultSelected) { + this.defaultSelected = defaultSelected; + } + if (selected) { + this.selected = selected; + } + this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected); + this.proxy.disabled = this.disabled; + } + /** + * Updates the ariaChecked property when the checked property changes. + * + * @param prev - the previous checked value + * @param next - the current checked value + * + * @public + */ + checkedChanged(prev, next) { + if (typeof next === "boolean") { + this.ariaChecked = next ? "true" : "false"; + return; + } + this.ariaChecked = null; + } + /** + * Updates the proxy's text content when the default slot changes. + * @param prev - the previous content value + * @param next - the current content value + * + * @internal + */ + contentChanged(prev, next) { + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.textContent = this.textContent; + } + this.$emit("contentchange", null, { bubbles: true }); + } + defaultSelectedChanged() { + if (!this.dirtySelected) { + this.selected = this.defaultSelected; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.defaultSelected; + } + } + } + disabledChanged(prev, next) { + this.ariaDisabled = this.disabled ? "true" : "false"; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.disabled = this.disabled; + } + } + selectedAttributeChanged() { + this.defaultSelected = this.selectedAttribute; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.defaultSelected = this.defaultSelected; + } + } + selectedChanged() { + this.ariaSelected = this.selected ? "true" : "false"; + if (!this.dirtySelected) { + this.dirtySelected = true; + } + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.selected; + } + } + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + get label() { + var _a; + return (_a = this.value) !== null && _a !== void 0 ? _a : this.text; + } + get text() { + var _a, _b; + return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : ""; + } + set value(next) { + const newValue = `${next !== null && next !== void 0 ? next : ""}`; + this._value = newValue; + this.dirtyValue = true; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.value = newValue; + } + Observable.notify(this, "value"); + } + get value() { + var _a; + Observable.track(this, "value"); + return (_a = this._value) !== null && _a !== void 0 ? _a : this.text; + } + get form() { + return this.proxy ? this.proxy.form : null; + } + }; + __decorate([ + observable + ], ListboxOption.prototype, "checked", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "content", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "defaultSelected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxOption.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "selected", mode: "boolean" }) + ], ListboxOption.prototype, "selectedAttribute", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "selected", void 0); + __decorate([ + attr({ attribute: "value", mode: "fromView" }) + ], ListboxOption.prototype, "initialValue", void 0); + DelegatesARIAListboxOption = class { + }; + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0); + applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties); + applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js + var Listbox, DelegatesARIAListbox; + var init_listbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_listbox_option(); + init_aria_global(); + init_apply_mixins(); + Listbox = class _Listbox extends FoundationElement { + constructor() { + super(...arguments); + this._options = []; + this.selectedIndex = -1; + this.selectedOptions = []; + this.shouldSkipFocus = false; + this.typeaheadBuffer = ""; + this.typeaheadExpired = true; + this.typeaheadTimeout = -1; + } + /** + * The first selected option. + * + * @internal + */ + get firstSelectedOption() { + var _a; + return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null; + } + /** + * Returns true if there is one or more selectable option. + * + * @internal + */ + get hasSelectableOptions() { + return this.options.length > 0 && !this.options.every((o) => o.disabled); + } + /** + * The number of options. + * + * @public + */ + get length() { + var _a, _b; + return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + } + /** + * The list of options. + * + * @public + */ + get options() { + Observable.track(this, "options"); + return this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Flag for the typeahead timeout expiration. + * + * @deprecated use `Listbox.typeaheadExpired` + * @internal + */ + get typeAheadExpired() { + return this.typeaheadExpired; + } + set typeAheadExpired(value) { + this.typeaheadExpired = value; + } + /** + * Handle click events for listbox options. + * + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && !captured.disabled) { + this.selectedIndex = this.options.indexOf(captured); + return true; + } + } + /** + * Ensures that the provided option is focused and scrolled into view. + * + * @param optionToFocus - The option to focus + * @internal + */ + focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) { + if (this.contains(document.activeElement) && optionToFocus !== null) { + optionToFocus.focus(); + requestAnimationFrame(() => { + optionToFocus.scrollIntoView({ block: "nearest" }); + }); + } + } + /** + * Handles `focusin` actions for the component. When the component receives focus, + * the list of selected options is refreshed and the first selected option is scrolled + * into view. + * + * @internal + */ + focusinHandler(e) { + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Returns the options which match the current typeahead buffer. + * + * @internal + */ + getTypeaheadMatches() { + const pattern = this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp(`^${pattern}`, "gi"); + return this.options.filter((o) => o.text.trim().match(re)); + } + /** + * Determines the index of the next option which is selectable, if any. + * + * @param prev - the previous selected index + * @param next - the next index to select + * + * @internal + */ + getSelectableIndex(prev = this.selectedIndex, next) { + const direction = prev > next ? -1 : prev < next ? 1 : 0; + const potentialDirection = prev + direction; + let nextSelectableOption = null; + switch (direction) { + case -1: { + nextSelectableOption = this.options.reduceRight((nextSelectableOption2, thisOption, index2) => !nextSelectableOption2 && !thisOption.disabled && index2 < potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + case 1: { + nextSelectableOption = this.options.reduce((nextSelectableOption2, thisOption, index2) => !nextSelectableOption2 && !thisOption.disabled && index2 > potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + } + return this.options.indexOf(nextSelectableOption); + } + /** + * Handles external changes to child options. + * + * @param source - the source object + * @param propertyName - the property + * + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "selected": { + if (_Listbox.slottedOptionFilter(source)) { + this.selectedIndex = this.options.indexOf(source); + } + this.setSelectedOptions(); + break; + } + } + } + /** + * Moves focus to an option whose label matches characters typed by the user. + * Consecutive keystrokes are batched into a buffer of search text used + * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes + * between consecutive keystrokes, the search restarts. + * + * @param key - the key to be evaluated + * + * @internal + */ + handleTypeAhead(key) { + if (this.typeaheadTimeout) { + window.clearTimeout(this.typeaheadTimeout); + } + this.typeaheadTimeout = window.setTimeout(() => this.typeaheadExpired = true, _Listbox.TYPE_AHEAD_TIMEOUT_MS); + if (key.length > 1) { + return; + } + this.typeaheadBuffer = `${this.typeaheadExpired ? "" : this.typeaheadBuffer}${key}`; + } + /** + * Handles `keydown` actions for listbox navigation and typeahead. + * + * @internal + */ + keydownHandler(e) { + if (this.disabled) { + return true; + } + this.shouldSkipFocus = false; + const key = e.key; + switch (key) { + // Select the first available option + case keyHome: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectFirstOption(); + } + break; + } + // Select the next selectable option + case keyArrowDown: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectNextOption(); + } + break; + } + // Select the previous selectable option + case keyArrowUp: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectPreviousOption(); + } + break; + } + // Select the last available option + case keyEnd: { + e.preventDefault(); + this.selectLastOption(); + break; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEnter: + case keyEscape: { + return true; + } + case keySpace: { + if (this.typeaheadExpired) { + return true; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @internal + */ + mousedownHandler(e) { + this.shouldSkipFocus = !this.contains(document.activeElement); + return true; + } + /** + * Switches between single-selection and multi-selection mode. + * + * @param prev - the previous value of the `multiple` attribute + * @param next - the next value of the `multiple` attribute + * + * @internal + */ + multipleChanged(prev, next) { + this.ariaMultiSelectable = next ? "true" : null; + } + /** + * Updates the list of selected options when the `selectedIndex` changes. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + var _a; + if (!this.hasSelectableOptions) { + this.selectedIndex = -1; + return; + } + if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") { + const selectableIndex = this.getSelectableIndex(prev, next); + const newNext = selectableIndex > -1 ? selectableIndex : prev; + this.selectedIndex = newNext; + if (next === newNext) { + this.selectedIndexChanged(next, newNext); + } + return; + } + this.setSelectedOptions(); + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + const filteredNext = next.filter(_Listbox.slottedOptionFilter); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "selected"); + o.selected = filteredNext.includes(o); + notifier.subscribe(this, "selected"); + }); + } + /** + * Moves focus to the first selectable option. + * + * @public + */ + selectFirstOption() { + var _a, _b; + if (!this.disabled) { + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((o) => !o.disabled)) !== null && _b !== void 0 ? _b : -1; + } + } + /** + * Moves focus to the last selectable option. + * + * @internal + */ + selectLastOption() { + if (!this.disabled) { + this.selectedIndex = findLastIndex(this.options, (o) => !o.disabled); + } + } + /** + * Moves focus to the next selectable option. + * + * @internal + */ + selectNextOption() { + if (!this.disabled && this.selectedIndex < this.options.length - 1) { + this.selectedIndex += 1; + } + } + /** + * Moves focus to the previous selectable option. + * + * @internal + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex > 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Updates the selected index to match the first selected option. + * + * @internal + */ + setDefaultSelectedOption() { + var _a, _b; + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((el2) => el2.defaultSelected)) !== null && _b !== void 0 ? _b : -1; + } + /** + * Sets an option as selected and gives it focus. + * + * @public + */ + setSelectedOptions() { + var _a, _b, _c; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) { + this.selectedOptions = [this.options[this.selectedIndex]]; + this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""; + this.focusAndScrollOptionIntoView(); + } + } + /** + * Updates the list of options and resets the selected option when the slotted option content changes. + * + * @param prev - the previous list of slotted options + * @param next - the current list of slotted options + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options = next.reduce((options, item) => { + if (isListboxOption(item)) { + options.push(item); + } + return options; + }, []); + const setSize = `${this.options.length}`; + this.options.forEach((option, index2) => { + if (!option.id) { + option.id = uniqueId("option-"); + } + option.ariaPosInSet = `${index2 + 1}`; + option.ariaSetSize = setSize; + }); + if (this.$fastController.isConnected) { + this.setSelectedOptions(); + this.setDefaultSelectedOption(); + } + } + /** + * Updates the filtered list of options when the typeahead buffer changes. + * + * @param prev - the previous typeahead buffer value + * @param next - the current typeahead buffer value + * + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + if (typeaheadMatches.length) { + const selectedIndex = this.options.indexOf(typeaheadMatches[0]); + if (selectedIndex > -1) { + this.selectedIndex = selectedIndex; + } + } + this.typeaheadExpired = false; + } + } + }; + Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; + Listbox.TYPE_AHEAD_TIMEOUT_MS = 1e3; + __decorate([ + attr({ mode: "boolean" }) + ], Listbox.prototype, "disabled", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedIndex", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "slottedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "typeaheadBuffer", void 0); + DelegatesARIAListbox = class { + }; + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaDisabled", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaExpanded", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0); + applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties); + applyMixins(Listbox, DelegatesARIAListbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js + var SelectPosition; + var init_select_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js"() { + SelectPosition = { + above: "above", + below: "below" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js + var _Combobox, FormAssociatedCombobox; + var init_combobox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js"() { + init_form_associated(); + init_listbox(); + _Combobox = class extends Listbox { + }; + FormAssociatedCombobox = class extends FormAssociated(_Combobox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js + var ComboboxAutocomplete; + var init_combobox_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js"() { + ComboboxAutocomplete = { + inline: "inline", + list: "list", + both: "both", + none: "none" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js + var Combobox, DelegatesARIACombobox; + var init_combobox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_select_options(); + init_apply_mixins(); + init_combobox_form_associated(); + init_combobox_options(); + Combobox = class extends FormAssociatedCombobox { + constructor() { + super(...arguments); + this._value = ""; + this.filteredOptions = []; + this.filter = ""; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + this.open = false; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + super.formResetCallback(); + this.setDefaultSelectedOption(); + this.updateValue(); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + get isAutocompleteInline() { + return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth; + } + get isAutocompleteList() { + return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth; + } + get isAutocompleteBoth() { + return this.autocomplete === ComboboxAutocomplete.both; + } + /** + * Sets focus and synchronize ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged() { + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The list of options. + * + * @public + * @remarks + * Overrides `Listbox.options`. + */ + get options() { + Observable.track(this, "options"); + return this.filteredOptions.length ? this.filteredOptions : this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Updates the placeholder on the proxy element. + * @internal + */ + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c; + const prev = `${this._value}`; + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.text.toLowerCase() === next.toLowerCase()); + const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text; + const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text; + this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex; + next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + } + } + /** + * Handle opening and closing the listbox when the combobox is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (this.disabled || (captured === null || captured === void 0 ? void 0 : captured.disabled)) { + return; + } + if (this.open) { + if (e.composedPath()[0] === this.control) { + return; + } + if (captured) { + this.selectedOptions = [captured]; + this.control.value = captured.text; + this.clearSelectionRange(); + this.updateValue(true); + } + } + this.open = !this.open; + if (this.open) { + this.control.focus(); + } + return true; + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + if (this.value) { + this.initialValue = this.value; + } + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Filter available options by text value. + * + * @public + */ + filterOptions() { + if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) { + this.filter = ""; + } + const filter = this.filter.toLowerCase(); + this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase())); + if (this.isAutocompleteList) { + if (!this.filteredOptions.length && !filter) { + this.filteredOptions = this._options; + } + this._options.forEach((o) => { + o.hidden = !this.filteredOptions.includes(o); + }); + } + } + /** + * Focus the control and scroll the first selected option into view. + * + * @internal + * @remarks + * Overrides: `Listbox.focusAndScrollOptionIntoView` + */ + focusAndScrollOptionIntoView() { + if (this.contains(document.activeElement)) { + this.control.focus(); + if (this.firstSelectedOption) { + requestAnimationFrame(() => { + var _a; + (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest" }); + }); + } + } + } + /** + * Handle focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + this.syncValue(); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!this.options || !this.options.includes(focusTarget)) { + this.open = false; + } + } + /** + * Handle content changes on the control input. + * + * @param e - the input event + * @internal + */ + inputHandler(e) { + this.filter = this.control.value; + this.filterOptions(); + if (!this.isAutocompleteInline) { + this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value); + } + if (e.inputType.includes("deleteContent") || !this.filter.length) { + return true; + } + if (this.isAutocompleteList && !this.open) { + this.open = true; + } + if (this.isAutocompleteInline) { + if (this.filteredOptions.length) { + this.selectedOptions = [this.filteredOptions[0]]; + this.selectedIndex = this.options.indexOf(this.firstSelectedOption); + this.setInlineSelection(); + } else { + this.selectedIndex = -1; + } + } + return; + } + /** + * Handle keydown actions for listbox navigation. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (e.ctrlKey || e.shiftKey) { + return true; + } + switch (key) { + case "Enter": { + this.syncValue(); + if (this.isAutocompleteInline) { + this.filter = this.value; + } + this.open = false; + this.clearSelectionRange(); + break; + } + case "Escape": { + if (!this.isAutocompleteInline) { + this.selectedIndex = -1; + } + if (this.open) { + this.open = false; + break; + } + this.value = ""; + this.control.value = ""; + this.filter = ""; + this.filterOptions(); + break; + } + case "Tab": { + this.setInputToSelection(); + if (!this.open) { + return true; + } + e.preventDefault(); + this.open = false; + break; + } + case "ArrowUp": + case "ArrowDown": { + this.filterOptions(); + if (!this.open) { + this.open = true; + break; + } + if (this.filteredOptions.length > 0) { + super.keydownHandler(e); + } + if (this.isAutocompleteInline) { + this.setInlineSelection(); + } + break; + } + default: { + return true; + } + } + } + /** + * Handle keyup actions for value input and text field manipulations. + * + * @param e - the keyboard event + * @internal + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + case "ArrowRight": + case "Backspace": + case "Delete": + case "Home": + case "End": { + this.filter = this.control.value; + this.selectedIndex = -1; + this.filterOptions(); + break; + } + } + } + /** + * Ensure that the selectedIndex is within the current allowable filtered range. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + if (this.$fastController.isConnected) { + next = limit(-1, this.options.length - 1, next); + if (next !== this.selectedIndex) { + this.selectedIndex = next; + return; + } + super.selectedIndexChanged(prev, next); + } + } + /** + * Move focus to the previous selectable option. + * + * @internal + * @remarks + * Overrides `Listbox.selectPreviousOption` + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex >= 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Set the default selected options at initialization or reset. + * + * @internal + * @remarks + * Overrides `Listbox.setDefaultSelectedOption` + */ + setDefaultSelectedOption() { + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.getAttribute("selected") !== null || el2.selected); + this.selectedIndex = selectedIndex; + if (!this.dirtyValue && this.firstSelectedOption) { + this.value = this.firstSelectedOption.text; + } + this.setSelectedOptions(); + } + } + /** + * Focus and set the content of the control based on the first selected option. + * + * @internal + */ + setInputToSelection() { + if (this.firstSelectedOption) { + this.control.value = this.firstSelectedOption.text; + this.control.focus(); + } + } + /** + * Focus, set and select the content of the control based on the first selected option. + * + * @internal + */ + setInlineSelection() { + if (this.firstSelectedOption) { + this.setInputToSelection(); + this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward"); + } + } + /** + * Determines if a value update should involve emitting a change event, then updates the value. + * + * @internal + */ + syncValue() { + var _a; + const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value; + this.updateValue(this.value !== newValue); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @param force - direction to force the listbox to display + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * Ensure that the entire list of options is used when setting the selected property. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + * @remarks + * Overrides: `Listbox.selectedOptionsChanged` + */ + selectedOptionsChanged(prev, next) { + if (this.$fastController.isConnected) { + this._options.forEach((o) => { + o.selected = next.includes(o); + }); + } + } + /** + * Synchronize the form-associated proxy and update the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + super.slottedOptionsChanged(prev, next); + this.updateValue(); + } + /** + * Sets the value and to match the first selected option. + * + * @param shouldEmit - if true, the change event will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a; + if (this.$fastController.isConnected) { + this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value; + this.control.value = this.value; + } + if (shouldEmit) { + this.$emit("change"); + } + } + /** + * @internal + */ + clearSelectionRange() { + const controlValueLength = this.control.value.length; + this.control.setSelectionRange(controlValueLength, controlValueLength); + } + }; + __decorate([ + attr({ attribute: "autocomplete", mode: "fromView" }) + ], Combobox.prototype, "autocomplete", void 0); + __decorate([ + observable + ], Combobox.prototype, "maxHeight", void 0); + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Combobox.prototype, "open", void 0); + __decorate([ + attr + ], Combobox.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Combobox.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Combobox.prototype, "position", void 0); + DelegatesARIACombobox = class { + }; + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0); + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIACombobox, DelegatesARIAListbox); + applyMixins(Combobox, StartEnd, DelegatesARIACombobox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js + var init_combobox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js + var init_combobox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js"() { + init_combobox(); + init_combobox_options(); + init_combobox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js + function composedParent(element) { + const parentNode = element.parentElement; + if (parentNode) { + return parentNode; + } else { + const rootNode = element.getRootNode(); + if (rootNode.host instanceof HTMLElement) { + return rootNode.host; + } + } + return null; + } + var init_composed_parent = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js + function composedContains(reference, test) { + let current = test; + while (current !== null) { + if (current === reference) { + return true; + } + current = composedParent(current); + } + return false; + } + var init_composed_contains = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js"() { + init_composed_parent(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js + function isFastElement(element) { + return element instanceof FASTElement; + } + var defaultElement, QueuedStyleSheetTarget, ConstructableStyleSheetTarget, DocumentStyleSheetTarget, HeadStyleElementStyleSheetTarget, StyleElementStyleSheetTarget, ElementStyleSheetTarget, RootStyleSheetTarget, propertyTargetCache, propertyTargetCtor, PropertyTargetManager; + var init_custom_property_manager = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js"() { + init_tslib_es6(); + init_esm(); + defaultElement = document.createElement("div"); + QueuedStyleSheetTarget = class { + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + ConstructableStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor(source) { + super(); + const sheet = new CSSStyleSheet(); + sheet[prependToAdoptedStyleSheetsSymbol] = true; + this.target = sheet.cssRules[sheet.insertRule(":host{}")].style; + source.$fastController.addStyles(ElementStyles.create([sheet])); + } + }; + DocumentStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + const sheet = new CSSStyleSheet(); + this.target = sheet.cssRules[sheet.insertRule(":root{}")].style; + document.adoptedStyleSheets = [ + ...document.adoptedStyleSheets, + sheet + ]; + } + }; + HeadStyleElementStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + this.style = document.createElement("style"); + document.head.appendChild(this.style); + const { sheet } = this.style; + if (sheet) { + const index2 = sheet.insertRule(":root{}", sheet.cssRules.length); + this.target = sheet.cssRules[index2].style; + } + } + }; + StyleElementStyleSheetTarget = class { + constructor(target) { + this.store = /* @__PURE__ */ new Map(); + this.target = null; + const controller = target.$fastController; + this.style = document.createElement("style"); + controller.addStyles(this.style); + Observable.getNotifier(controller).subscribe(this, "isConnected"); + this.handleChange(controller, "isConnected"); + } + targetChanged() { + if (this.target !== null) { + for (const [key, value] of this.store.entries()) { + this.target.setProperty(key, value); + } + } + } + setProperty(name, value) { + this.store.set(name, value); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.setProperty(name, value); + } + }); + } + removeProperty(name) { + this.store.delete(name); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.removeProperty(name); + } + }); + } + handleChange(source, key) { + const { sheet } = this.style; + if (sheet) { + const index2 = sheet.insertRule(":host{}", sheet.cssRules.length); + this.target = sheet.cssRules[index2].style; + } else { + this.target = null; + } + } + }; + __decorate([ + observable + ], StyleElementStyleSheetTarget.prototype, "target", void 0); + ElementStyleSheetTarget = class { + constructor(source) { + this.target = source.style; + } + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + RootStyleSheetTarget = class _RootStyleSheetTarget { + setProperty(name, value) { + _RootStyleSheetTarget.properties[name] = value; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); + } + } + removeProperty(name) { + delete _RootStyleSheetTarget.properties[name]; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); + } + } + static registerRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (!roots.has(root)) { + roots.add(root); + const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.setProperty(key, _RootStyleSheetTarget.properties[key]); + } + } + } + static unregisterRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (roots.has(root)) { + roots.delete(root); + const target = PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.removeProperty(key); + } + } + } + /** + * Returns the document when provided the default element, + * otherwise is a no-op + * @param root - the root to normalize + */ + static normalizeRoot(root) { + return root === defaultElement ? document : root; + } + }; + RootStyleSheetTarget.roots = /* @__PURE__ */ new Set(); + RootStyleSheetTarget.properties = {}; + propertyTargetCache = /* @__PURE__ */ new WeakMap(); + propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; + PropertyTargetManager = Object.freeze({ + getOrCreate(source) { + if (propertyTargetCache.has(source)) { + return propertyTargetCache.get(source); + } + let target; + if (source === defaultElement) { + target = new RootStyleSheetTarget(); + } else if (source instanceof Document) { + target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); + } else if (isFastElement(source)) { + target = new propertyTargetCtor(source); + } else { + target = new ElementStyleSheetTarget(source); + } + propertyTargetCache.set(source, target); + return target; + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js + function create(nameOrConfig) { + return DesignTokenImpl.from(nameOrConfig); + } + var DesignTokenImpl, CustomPropertyReflector, DesignTokenBindingObserver, Store, nodeCache, childToParent, DesignTokenNode, DesignToken; + var init_design_token = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js"() { + init_tslib_es6(); + init_esm(); + init_composed_parent(); + init_composed_contains(); + init_custom_property_manager(); + init_custom_property_manager(); + DesignTokenImpl = class _DesignTokenImpl extends CSSDirective { + constructor(configuration) { + super(); + this.subscribers = /* @__PURE__ */ new WeakMap(); + this._appliedTo = /* @__PURE__ */ new Set(); + this.name = configuration.name; + if (configuration.cssCustomPropertyName !== null) { + this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`; + this.cssVar = `var(${this.cssCustomProperty})`; + } + this.id = _DesignTokenImpl.uniqueId(); + _DesignTokenImpl.tokensById.set(this.id, this); + } + get appliedTo() { + return [...this._appliedTo]; + } + static from(nameOrConfig) { + return new _DesignTokenImpl({ + name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, + cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName + }); + } + static isCSSDesignToken(token) { + return typeof token.cssCustomProperty === "string"; + } + static isDerivedDesignTokenValue(value) { + return typeof value === "function"; + } + /** + * Gets a token by ID. Returns undefined if the token was not found. + * @param id - The ID of the token + * @returns + */ + static getTokenById(id) { + return _DesignTokenImpl.tokensById.get(id); + } + getOrCreateSubscriberSet(target = this) { + return this.subscribers.get(target) || this.subscribers.set(target, /* @__PURE__ */ new Set()) && this.subscribers.get(target); + } + createCSS() { + return this.cssVar || ""; + } + getValueFor(element) { + const value = DesignTokenNode.getOrCreate(element).get(this); + if (value !== void 0) { + return value; + } + throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${element} or an ancestor of ${element}.`); + } + setValueFor(element, value) { + this._appliedTo.add(element); + if (value instanceof _DesignTokenImpl) { + value = this.alias(value); + } + DesignTokenNode.getOrCreate(element).set(this, value); + return this; + } + deleteValueFor(element) { + this._appliedTo.delete(element); + if (DesignTokenNode.existsFor(element)) { + DesignTokenNode.getOrCreate(element).delete(this); + } + return this; + } + withDefault(value) { + this.setValueFor(defaultElement, value); + return this; + } + subscribe(subscriber, target) { + const subscriberSet = this.getOrCreateSubscriberSet(target); + if (target && !DesignTokenNode.existsFor(target)) { + DesignTokenNode.getOrCreate(target); + } + if (!subscriberSet.has(subscriber)) { + subscriberSet.add(subscriber); + } + } + unsubscribe(subscriber, target) { + const list = this.subscribers.get(target || this); + if (list && list.has(subscriber)) { + list.delete(subscriber); + } + } + /** + * Notifies subscribers that the value for an element has changed. + * @param element - The element to emit a notification for + */ + notify(element) { + const record = Object.freeze({ token: this, target: element }); + if (this.subscribers.has(this)) { + this.subscribers.get(this).forEach((sub) => sub.handleChange(record)); + } + if (this.subscribers.has(element)) { + this.subscribers.get(element).forEach((sub) => sub.handleChange(record)); + } + } + /** + * Alias the token to the provided token. + * @param token - the token to alias to + */ + alias(token) { + return ((target) => token.getValueFor(target)); + } + }; + DesignTokenImpl.uniqueId = /* @__PURE__ */ (() => { + let id = 0; + return () => { + id++; + return id.toString(16); + }; + })(); + DesignTokenImpl.tokensById = /* @__PURE__ */ new Map(); + CustomPropertyReflector = class { + startReflection(token, target) { + token.subscribe(this, target); + this.handleChange({ token, target }); + } + stopReflection(token, target) { + token.unsubscribe(this, target); + this.remove(token, target); + } + handleChange(record) { + const { token, target } = record; + this.add(token, target); + } + add(token, target) { + PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); + } + remove(token, target) { + PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); + } + resolveCSSValue(value) { + return value && typeof value.createCSS === "function" ? value.createCSS() : value; + } + }; + DesignTokenBindingObserver = class { + constructor(source, token, node) { + this.source = source; + this.token = token; + this.node = node; + this.dependencies = /* @__PURE__ */ new Set(); + this.observer = Observable.binding(source, this, false); + this.observer.handleChange = this.observer.call; + this.handleChange(); + } + disconnect() { + this.observer.disconnect(); + } + /** + * @internal + */ + handleChange() { + try { + this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); + } catch (e) { + console.error(e); + } + } + }; + Store = class { + constructor() { + this.values = /* @__PURE__ */ new Map(); + } + set(token, value) { + if (this.values.get(token) !== value) { + this.values.set(token, value); + Observable.getNotifier(this).notify(token.id); + } + } + get(token) { + Observable.track(this, token.id); + return this.values.get(token); + } + delete(token) { + this.values.delete(token); + Observable.getNotifier(this).notify(token.id); + } + all() { + return this.values.entries(); + } + }; + nodeCache = /* @__PURE__ */ new WeakMap(); + childToParent = /* @__PURE__ */ new WeakMap(); + DesignTokenNode = class _DesignTokenNode { + constructor(target) { + this.target = target; + this.store = new Store(); + this.children = []; + this.assignedValues = /* @__PURE__ */ new Map(); + this.reflecting = /* @__PURE__ */ new Set(); + this.bindingObservers = /* @__PURE__ */ new Map(); + this.tokenValueChangeHandler = { + handleChange: (source, arg) => { + const token = DesignTokenImpl.getTokenById(arg); + if (token) { + token.notify(this.target); + this.updateCSSTokenReflection(source, token); + } + } + }; + nodeCache.set(target, this); + Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); + if (target instanceof FASTElement) { + target.$fastController.addBehaviors([this]); + } else if (target.isConnected) { + this.bind(); + } + } + /** + * Returns a DesignTokenNode for an element. + * Creates a new instance if one does not already exist for a node, + * otherwise returns the cached instance + * + * @param target - The HTML element to retrieve a DesignTokenNode for + */ + static getOrCreate(target) { + return nodeCache.get(target) || new _DesignTokenNode(target); + } + /** + * Determines if a DesignTokenNode has been created for a target + * @param target - The element to test + */ + static existsFor(target) { + return nodeCache.has(target); + } + /** + * Searches for and return the nearest parent DesignTokenNode. + * Null is returned if no node is found or the node provided is for a default element. + */ + static findParent(node) { + if (!(defaultElement === node.target)) { + let parent = composedParent(node.target); + while (parent !== null) { + if (nodeCache.has(parent)) { + return nodeCache.get(parent); + } + parent = composedParent(parent); + } + return _DesignTokenNode.getOrCreate(defaultElement); + } + return null; + } + /** + * Finds the closest node with a value explicitly assigned for a token, otherwise null. + * @param token - The token to look for + * @param start - The node to start looking for value assignment + * @returns + */ + static findClosestAssignedNode(token, start) { + let current = start; + do { + if (current.has(token)) { + return current; + } + current = current.parent ? current.parent : current.target !== defaultElement ? _DesignTokenNode.getOrCreate(defaultElement) : null; + } while (current !== null); + return null; + } + /** + * The parent DesignTokenNode, or null. + */ + get parent() { + return childToParent.get(this) || null; + } + updateCSSTokenReflection(source, token) { + if (DesignTokenImpl.isCSSDesignToken(token)) { + const parent = this.parent; + const reflecting = this.isReflecting(token); + if (parent) { + const parentValue = parent.get(token); + const sourceValue = source.get(token); + if (parentValue !== sourceValue && !reflecting) { + this.reflectToCSS(token); + } else if (parentValue === sourceValue && reflecting) { + this.stopReflectToCSS(token); + } + } else if (!reflecting) { + this.reflectToCSS(token); + } + } + } + /** + * Checks if a token has been assigned an explicit value the node. + * @param token - the token to check. + */ + has(token) { + return this.assignedValues.has(token); + } + /** + * Gets the value of a token for a node + * @param token - The token to retrieve the value for + * @returns + */ + get(token) { + const value = this.store.get(token); + if (value !== void 0) { + return value; + } + const raw = this.getRaw(token); + if (raw !== void 0) { + this.hydrate(token, raw); + return this.get(token); + } + } + /** + * Retrieves the raw assigned value of a token from the nearest assigned node. + * @param token - The token to retrieve a raw value for + * @returns + */ + getRaw(token) { + var _a; + if (this.assignedValues.has(token)) { + return this.assignedValues.get(token); + } + return (_a = _DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); + } + /** + * Sets a token to a value for a node + * @param token - The token to set + * @param value - The value to set the token to + */ + set(token, value) { + if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { + this.tearDownBindingObserver(token); + } + this.assignedValues.set(token, value); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + this.setupBindingObserver(token, value); + } else { + this.store.set(token, value); + } + } + /** + * Deletes a token value for the node. + * @param token - The token to delete the value for + */ + delete(token) { + this.assignedValues.delete(token); + this.tearDownBindingObserver(token); + const upstream = this.getRaw(token); + if (upstream) { + this.hydrate(token, upstream); + } else { + this.store.delete(token); + } + } + /** + * Invoked when the DesignTokenNode.target is attached to the document + */ + bind() { + const parent = _DesignTokenNode.findParent(this); + if (parent) { + parent.appendChild(this); + } + for (const key of this.assignedValues.keys()) { + key.notify(this.target); + } + } + /** + * Invoked when the DesignTokenNode.target is detached from the document + */ + unbind() { + if (this.parent) { + const parent = childToParent.get(this); + parent.removeChild(this); + } + for (const token of this.bindingObservers.keys()) { + this.tearDownBindingObserver(token); + } + } + /** + * Appends a child to a parent DesignTokenNode. + * @param child - The child to append to the node + */ + appendChild(child) { + if (child.parent) { + childToParent.get(child).removeChild(child); + } + const reParent = this.children.filter((x) => child.contains(x)); + childToParent.set(child, this); + this.children.push(child); + reParent.forEach((x) => child.appendChild(x)); + Observable.getNotifier(this.store).subscribe(child); + for (const [token, value] of this.store.all()) { + child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); + child.updateCSSTokenReflection(child.store, token); + } + } + /** + * Removes a child from a node. + * @param child - The child to remove. + */ + removeChild(child) { + const childIndex = this.children.indexOf(child); + if (childIndex !== -1) { + this.children.splice(childIndex, 1); + } + Observable.getNotifier(this.store).unsubscribe(child); + if (child.parent !== this) { + return false; + } + const deleted = childToParent.delete(child); + for (const [token] of this.store.all()) { + child.hydrate(token, child.getRaw(token)); + child.updateCSSTokenReflection(child.store, token); + } + return deleted; + } + /** + * Tests whether a provided node is contained by + * the calling node. + * @param test - The node to test + */ + contains(test) { + return composedContains(this.target, test.target); + } + /** + * Instructs the node to reflect a design token for the provided token. + * @param token - The design token to reflect + */ + reflectToCSS(token) { + if (!this.isReflecting(token)) { + this.reflecting.add(token); + _DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); + } + } + /** + * Stops reflecting a DesignToken to CSS + * @param token - The design token to stop reflecting + */ + stopReflectToCSS(token) { + if (this.isReflecting(token)) { + this.reflecting.delete(token); + _DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); + } + } + /** + * Determines if a token is being reflected to CSS for a node. + * @param token - The token to check for reflection + * @returns + */ + isReflecting(token) { + return this.reflecting.has(token); + } + /** + * Handle changes to upstream tokens + * @param source - The parent DesignTokenNode + * @param property - The token ID that changed + */ + handleChange(source, property) { + const token = DesignTokenImpl.getTokenById(property); + if (!token) { + return; + } + this.hydrate(token, this.getRaw(token)); + this.updateCSSTokenReflection(this.store, token); + } + /** + * Hydrates a token with a DesignTokenValue, making retrieval available. + * @param token - The token to hydrate + * @param value - The value to hydrate + */ + hydrate(token, value) { + if (!this.has(token)) { + const observer = this.bindingObservers.get(token); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + if (observer) { + if (observer.source !== value) { + this.tearDownBindingObserver(token); + this.setupBindingObserver(token, value); + } + } else { + this.setupBindingObserver(token, value); + } + } else { + if (observer) { + this.tearDownBindingObserver(token); + } + this.store.set(token, value); + } + } + } + /** + * Sets up a binding observer for a derived token value that notifies token + * subscribers on change. + * + * @param token - The token to notify when the binding updates + * @param source - The binding source + */ + setupBindingObserver(token, source) { + const binding = new DesignTokenBindingObserver(source, token, this); + this.bindingObservers.set(token, binding); + return binding; + } + /** + * Tear down a binding observer for a token. + */ + tearDownBindingObserver(token) { + if (this.bindingObservers.has(token)) { + this.bindingObservers.get(token).disconnect(); + this.bindingObservers.delete(token); + return true; + } + return false; + } + }; + DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); + __decorate([ + observable + ], DesignTokenNode.prototype, "children", void 0); + DesignToken = Object.freeze({ + create, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been connected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * 3. The HTMLElement is not connected to the document when token values are set. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyConnection(element) { + if (!element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).bind(); + return true; + }, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been disconnected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyDisconnection(element) { + if (element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).unbind(); + return true; + }, + /** + * Registers and element or document as a DesignToken root. + * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via + * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all + * registered roots. + * @param target - The root to register + */ + registerRoot(target = defaultElement) { + RootStyleSheetTarget.registerRoot(target); + }, + /** + * Unregister an element or document as a DesignToken root. + * @param target - The root to deregister + */ + unregisterRoot(target = defaultElement) { + RootStyleSheetTarget.unregisterRoot(target); + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js + function extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) { + if (typeof params === "string") { + return { + name: params, + type: elementDefinitionType, + callback: elementDefinitionCallback + }; + } else { + return params; + } + } + var ElementDisambiguation, elementTypesByTag, elementTagsByType, rootDesignSystem, designSystemKey, DesignSystem, DefaultDesignSystem, ElementDefinitionEntry; + var init_design_system = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"() { + init_esm(); + init_foundation_element(); + init_di(); + init_design_token(); + init_component_presentation(); + ElementDisambiguation = Object.freeze({ + /** + * Skip defining the element but still call the provided callback passed + * to DesignSystemRegistrationContext.tryDefineElement + */ + definitionCallbackOnly: null, + /** + * Ignore the duplicate element entirely. + */ + ignoreDuplicate: /* @__PURE__ */ Symbol() + }); + elementTypesByTag = /* @__PURE__ */ new Map(); + elementTagsByType = /* @__PURE__ */ new Map(); + rootDesignSystem = null; + designSystemKey = DI.createInterface((x) => x.cachedCallback((handler) => { + if (rootDesignSystem === null) { + rootDesignSystem = new DefaultDesignSystem(null, handler); + } + return rootDesignSystem; + })); + DesignSystem = Object.freeze({ + /** + * Returns the HTML element name that the type is defined as. + * @param type - The type to lookup. + * @public + */ + tagFor(type) { + return elementTagsByType.get(type); + }, + /** + * Searches the DOM hierarchy for the design system that is responsible + * for the provided element. + * @param element - The element to locate the design system for. + * @returns The located design system. + * @public + */ + responsibleFor(element) { + const owned = element.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.findResponsibleContainer(element); + return container.get(designSystemKey); + }, + /** + * Gets the DesignSystem if one is explicitly defined on the provided element; + * otherwise creates a design system defined directly on the element. + * @param element - The element to get or create a design system for. + * @returns The design system. + * @public + */ + getOrCreate(node) { + if (!node) { + if (rootDesignSystem === null) { + rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey); + } + return rootDesignSystem; + } + const owned = node.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.getOrCreateDOMContainer(node); + if (container.has(designSystemKey, false)) { + return container.get(designSystemKey); + } else { + const system = new DefaultDesignSystem(node, container); + container.register(Registration.instance(designSystemKey, system)); + return system; + } + } + }); + DefaultDesignSystem = class { + constructor(owner, container) { + this.owner = owner; + this.container = container; + this.designTokensInitialized = false; + this.prefix = "fast"; + this.shadowRootMode = void 0; + this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly; + if (owner !== null) { + owner.$$designSystem$$ = this; + } + } + withPrefix(prefix) { + this.prefix = prefix; + return this; + } + withShadowRootMode(mode) { + this.shadowRootMode = mode; + return this; + } + withElementDisambiguation(callback2) { + this.disambiguate = callback2; + return this; + } + withDesignTokenRoot(root) { + this.designTokenRoot = root; + return this; + } + register(...registrations) { + const container = this.container; + const elementDefinitionEntries = []; + const disambiguate = this.disambiguate; + const shadowRootMode = this.shadowRootMode; + const context = { + elementPrefix: this.prefix, + tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) { + const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback); + const { name, callback: callback2, baseClass } = extractedParams; + let { type } = extractedParams; + let elementName = name; + let typeFoundByName = elementTypesByTag.get(elementName); + let needsDefine = true; + while (typeFoundByName) { + const result = disambiguate(elementName, type, typeFoundByName); + switch (result) { + case ElementDisambiguation.ignoreDuplicate: + return; + case ElementDisambiguation.definitionCallbackOnly: + needsDefine = false; + typeFoundByName = void 0; + break; + default: + elementName = result; + typeFoundByName = elementTypesByTag.get(elementName); + break; + } + } + if (needsDefine) { + if (elementTagsByType.has(type) || type === FoundationElement) { + type = class extends type { + }; + } + elementTypesByTag.set(elementName, type); + elementTagsByType.set(type, elementName); + if (baseClass) { + elementTagsByType.set(baseClass, elementName); + } + } + elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback2, needsDefine)); + } + }; + if (!this.designTokensInitialized) { + this.designTokensInitialized = true; + if (this.designTokenRoot !== null) { + DesignToken.registerRoot(this.designTokenRoot); + } + } + container.registerWithContext(context, ...registrations); + for (const entry of elementDefinitionEntries) { + entry.callback(entry); + if (entry.willDefine && entry.definition !== null) { + entry.definition.define(); + } + } + return this; + } + }; + ElementDefinitionEntry = class { + constructor(container, name, type, shadowRootMode, callback2, willDefine) { + this.container = container; + this.name = name; + this.type = type; + this.shadowRootMode = shadowRootMode; + this.callback = callback2; + this.willDefine = willDefine; + this.definition = null; + } + definePresentation(presentation) { + ComponentPresentation.define(this.name, presentation, this.container); + } + defineElement(definition) { + this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name })); + } + tagFor(type) { + return DesignSystem.tagFor(type); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js + var init_registration_context = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js + var init_design_system2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js"() { + init_design_system(); + init_component_presentation(); + init_registration_context(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/index.js + var init_di2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/index.js"() { + init_di(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js + var init_dialog_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js"() { + } + }); + + // node_modules/tabbable/dist/index.esm.js + var candidateSelectors, candidateSelector, NoElement, matches, getRootNode, getTabindex, isInput, isHiddenInput, isDetailsWithSummary, getCheckedRadio, isTabbableRadio, isRadio, isNonTabbableRadio, isZeroArea, isHidden, isDisabledFromFieldset, isNodeMatchingSelectorFocusable, isNodeMatchingSelectorTabbable, isTabbable, focusableCandidateSelector, isFocusable; + var init_index_esm = __esm({ + "node_modules/tabbable/dist/index.esm.js"() { + candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + NoElement = typeof Element === "undefined"; + matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; + }; + getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } + }; + isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot2 = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot2 === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot2(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js + var Dialog; + var init_dialog = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + Dialog = class _Dialog extends FoundationElement { + constructor() { + super(...arguments); + this.modal = true; + this.hidden = false; + this.trapFocus = true; + this.trapFocusChanged = () => { + if (this.$fastController.isConnected) { + this.updateTrapFocus(); + } + }; + this.isTrappingFocus = false; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && !this.hidden) { + switch (e.key) { + case keyEscape: + this.dismiss(); + e.preventDefault(); + break; + case keyTab: + this.handleTabKeyDown(e); + break; + } + } + }; + this.handleDocumentFocus = (e) => { + if (!e.defaultPrevented && this.shouldForceFocus(e.target)) { + this.focusFirstElement(); + e.preventDefault(); + } + }; + this.handleTabKeyDown = (e) => { + if (!this.trapFocus || this.hidden) { + return; + } + const bounds = this.getTabQueueBounds(); + if (bounds.length === 0) { + return; + } + if (bounds.length === 1) { + bounds[0].focus(); + e.preventDefault(); + return; + } + if (e.shiftKey && e.target === bounds[0]) { + bounds[bounds.length - 1].focus(); + e.preventDefault(); + } else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) { + bounds[0].focus(); + e.preventDefault(); + } + return; + }; + this.getTabQueueBounds = () => { + const bounds = []; + return _Dialog.reduceTabbableItems(bounds, this); + }; + this.focusFirstElement = () => { + const bounds = this.getTabQueueBounds(); + if (bounds.length > 0) { + bounds[0].focus(); + } else { + if (this.dialog instanceof HTMLElement) { + this.dialog.focus(); + } + } + }; + this.shouldForceFocus = (currentFocusElement) => { + return this.isTrappingFocus && !this.contains(currentFocusElement); + }; + this.shouldTrapFocus = () => { + return this.trapFocus && !this.hidden; + }; + this.updateTrapFocus = (shouldTrapFocusOverride) => { + const shouldTrapFocus = shouldTrapFocusOverride === void 0 ? this.shouldTrapFocus() : shouldTrapFocusOverride; + if (shouldTrapFocus && !this.isTrappingFocus) { + this.isTrappingFocus = true; + document.addEventListener("focusin", this.handleDocumentFocus); + DOM.queueUpdate(() => { + if (this.shouldForceFocus(document.activeElement)) { + this.focusFirstElement(); + } + }); + } else if (!shouldTrapFocus && this.isTrappingFocus) { + this.isTrappingFocus = false; + document.removeEventListener("focusin", this.handleDocumentFocus); + } + }; + } + /** + * @internal + */ + dismiss() { + this.$emit("dismiss"); + this.$emit("cancel"); + } + /** + * The method to show the dialog. + * + * @public + */ + show() { + this.hidden = false; + } + /** + * The method to hide the dialog. + * + * @public + */ + hide() { + this.hidden = true; + this.$emit("close"); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + document.addEventListener("keydown", this.handleDocumentKeydown); + this.notifier = Observable.getNotifier(this); + this.notifier.subscribe(this, "hidden"); + this.updateTrapFocus(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.updateTrapFocus(false); + this.notifier.unsubscribe(this, "hidden"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "hidden": + this.updateTrapFocus(); + break; + default: + break; + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceTabbableItems(elements3, element) { + if (element.getAttribute("tabindex") === "-1") { + return elements3; + } + if (isTabbable(element) || _Dialog.isFocusableFastElement(element) && _Dialog.hasTabbableShadow(element)) { + elements3.push(element); + return elements3; + } + if (element.childElementCount) { + return elements3.concat(Array.from(element.children).reduce(_Dialog.reduceTabbableItems, [])); + } + return elements3; + } + /** + * Test if element is focusable fast element + * + * @param element - The element to check + * + * @internal + */ + static isFocusableFastElement(element) { + var _a, _b; + return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus); + } + /** + * Test if the element has a focusable shadow + * + * @param element - The element to check + * + * @internal + */ + static hasTabbableShadow(element) { + var _a, _b; + return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("*")) !== null && _b !== void 0 ? _b : []).some((x) => { + return isTabbable(x); + }); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "modal", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "hidden", void 0); + __decorate([ + attr({ attribute: "trap-focus", mode: "boolean" }) + ], Dialog.prototype, "trapFocus", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], Dialog.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], Dialog.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], Dialog.prototype, "ariaLabel", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js + var init_dialog2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js"() { + init_dialog_template(); + init_dialog(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js + var init_disclosure_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js + var Disclosure; + var init_disclosure = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Disclosure = class extends FoundationElement { + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.setup(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.details.removeEventListener("toggle", this.onToggle); + } + /** + * Show extra content. + */ + show() { + this.details.open = true; + } + /** + * Hide extra content. + */ + hide() { + this.details.open = false; + } + /** + * Toggle the current(expanded/collapsed) state. + */ + toggle() { + this.details.open = !this.details.open; + } + /** + * Register listener and set default disclosure mode + */ + setup() { + this.onToggle = this.onToggle.bind(this); + this.details.addEventListener("toggle", this.onToggle); + if (this.expanded) { + this.show(); + } + } + /** + * Update the aria attr and fire `toggle` event + */ + onToggle() { + this.expanded = this.details.open; + this.$emit("toggle"); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Disclosure.prototype, "expanded", void 0); + __decorate([ + attr + ], Disclosure.prototype, "title", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js + var init_disclosure2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js"() { + init_disclosure_template(); + init_disclosure(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js + var dividerTemplate; + var init_divider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js"() { + init_esm(); + dividerTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js + var DividerRole; + var init_divider_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js"() { + DividerRole = { + /** + * The divider semantically separates content + */ + separator: "separator", + /** + * The divider has no semantic value and is for visual presentation only. + */ + presentation: "presentation" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js + var Divider; + var init_divider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_divider_options(); + Divider = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = DividerRole.separator; + this.orientation = Orientation.horizontal; + } + }; + __decorate([ + attr + ], Divider.prototype, "role", void 0); + __decorate([ + attr + ], Divider.prototype, "orientation", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js + var init_divider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js"() { + init_divider_template(); + init_divider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js + var FlipperDirection; + var init_flipper_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js"() { + FlipperDirection = { + next: "next", + previous: "previous" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js + var init_flipper_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js + var Flipper; + var init_flipper = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_flipper_options(); + Flipper = class extends FoundationElement { + constructor() { + super(...arguments); + this.hiddenFromAT = true; + this.direction = FlipperDirection.next; + } + /** + * Simulate a click event when the flipper has focus and the user hits enter or space keys + * Blur focus if the user hits escape key + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + if (!this.hiddenFromAT) { + const key = e.key; + if (key === "Enter" || key === "Space") { + this.$emit("click", e); + } + if (key === "Escape") { + this.blur(); + } + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Flipper.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "aria-hidden", converter: booleanConverter }) + ], Flipper.prototype, "hiddenFromAT", void 0); + __decorate([ + attr + ], Flipper.prototype, "direction", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js + var init_flipper2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js"() { + init_flipper_template(); + init_flipper(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js + var init_form_associated2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js"() { + init_form_associated(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js + var init_foundation_element2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js"() { + init_foundation_element(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js + var listboxOptionTemplate; + var init_listbox_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js"() { + init_esm(); + init_start_end(); + listboxOptionTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js + var init_listbox_option2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js"() { + init_listbox_option(); + init_listbox_option_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js + var ListboxElement; + var init_listbox_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + ListboxElement = class extends Listbox { + constructor() { + super(...arguments); + this.activeIndex = -1; + this.rangeStartIndex = -1; + } + /** + * Returns the last checked option. + * + * @internal + */ + get activeOption() { + return this.options[this.activeIndex]; + } + /** + * Returns the list of checked options. + * + * @internal + */ + get checkedOptions() { + var _a; + return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((o) => o.checked); + } + /** + * Returns the index of the first selected option. + * + * @internal + */ + get firstSelectedOptionIndex() { + return this.options.indexOf(this.firstSelectedOption); + } + /** + * Updates the `ariaActiveDescendant` property when the active index changes. + * + * @param prev - the previous active index + * @param next - the next active index + * + * @internal + */ + activeIndexChanged(prev, next) { + var _a, _b; + this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; + this.focusAndScrollOptionIntoView(); + } + /** + * Toggles the checked state for the currently active option. + * + * @remarks + * Multiple-selection mode only. + * + * @internal + */ + checkActiveIndex() { + if (!this.multiple) { + return; + } + const activeItem = this.activeOption; + if (activeItem) { + activeItem.checked = true; + } + } + /** + * Sets the active index to the first option and marks it as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkFirstOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex + 1; + } + this.options.forEach((o, i) => { + o.checked = inRange2(i, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and sets the matching option as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkLastOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange2(i, this.rangeStartIndex, this.options.length); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = this.options.length - 1; + this.checkActiveIndex(); + } + /** + * @override + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("focusout", this.focusoutHandler); + } + /** + * @override + * @internal + */ + disconnectedCallback() { + this.removeEventListener("focusout", this.focusoutHandler); + super.disconnectedCallback(); + } + /** + * Increments the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkNextOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange2(i, this.rangeStartIndex, this.activeIndex + 1); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkPreviousOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + if (this.checkedOptions.length === 1) { + this.rangeStartIndex += 1; + } + this.options.forEach((o, i) => { + o.checked = inRange2(i, this.activeIndex, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex -= this.activeIndex > 0 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Handles click events for listbox options. + * + * @param e - the event object + * + * @override + * @internal + */ + clickHandler(e) { + var _a; + if (!this.multiple) { + return super.clickHandler(e); + } + const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`); + if (!captured || captured.disabled) { + return; + } + this.uncheckAllOptions(); + this.activeIndex = this.options.indexOf(captured); + this.checkActiveIndex(); + this.toggleSelectedForAllCheckedOptions(); + return true; + } + /** + * @override + * @internal + */ + focusAndScrollOptionIntoView() { + super.focusAndScrollOptionIntoView(this.activeOption); + } + /** + * In multiple-selection mode: + * If any options are selected, the first selected option is checked when + * the listbox receives focus. If no options are selected, the first + * selectable option is checked. + * + * @override + * @internal + */ + focusinHandler(e) { + if (!this.multiple) { + return super.focusinHandler(e); + } + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.uncheckAllOptions(); + if (this.activeIndex === -1) { + this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0; + } + this.checkActiveIndex(); + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Unchecks all options when the listbox loses focus. + * + * @internal + */ + focusoutHandler(e) { + if (this.multiple) { + this.uncheckAllOptions(); + } + } + /** + * Handles keydown actions for listbox navigation and typeahead + * + * @override + * @internal + */ + keydownHandler(e) { + if (!this.multiple) { + return super.keydownHandler(e); + } + if (this.disabled) { + return true; + } + const { key, shiftKey } = e; + this.shouldSkipFocus = false; + switch (key) { + // Select the first available option + case keyHome: { + this.checkFirstOption(shiftKey); + return; + } + // Select the next selectable option + case keyArrowDown: { + this.checkNextOption(shiftKey); + return; + } + // Select the previous selectable option + case keyArrowUp: { + this.checkPreviousOption(shiftKey); + return; + } + // Select the last available option + case keyEnd: { + this.checkLastOption(shiftKey); + return; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEscape: { + this.uncheckAllOptions(); + this.checkActiveIndex(); + return true; + } + case keySpace: { + e.preventDefault(); + if (this.typeAheadExpired) { + this.toggleSelectedForAllCheckedOptions(); + return; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @override + * @internal + */ + mousedownHandler(e) { + if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) { + return super.mousedownHandler(e); + } + } + /** + * Switches between single-selection and multi-selection mode. + * + * @internal + */ + multipleChanged(prev, next) { + var _a; + this.ariaMultiSelectable = next ? "true" : null; + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + o.checked = next ? false : void 0; + }); + this.setSelectedOptions(); + } + /** + * Sets an option as selected and gives it focus. + * + * @override + * @public + */ + setSelectedOptions() { + if (!this.multiple) { + super.setSelectedOptions(); + return; + } + if (this.$fastController.isConnected && this.options) { + this.selectedOptions = this.options.filter((o) => o.selected); + this.focusAndScrollOptionIntoView(); + } + } + /** + * Ensures the size is a positive integer when the property is updated. + * + * @param prev - the previous size value + * @param next - the current size value + * + * @internal + */ + sizeChanged(prev, next) { + var _a; + const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10)); + if (size !== next) { + DOM.queueUpdate(() => { + this.size = size; + }); + } + } + /** + * Toggles the selected state of the provided options. If any provided items + * are in an unselected state, all items are set to selected. If every + * provided item is selected, they are all unselected. + * + * @internal + */ + toggleSelectedForAllCheckedOptions() { + const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled); + const force = !enabledCheckedOptions.every((o) => o.selected); + enabledCheckedOptions.forEach((o) => o.selected = force); + this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]); + this.setSelectedOptions(); + } + /** + * @override + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (!this.multiple) { + super.typeaheadBufferChanged(prev, next); + return; + } + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + const activeIndex = this.options.indexOf(typeaheadMatches[0]); + if (activeIndex > -1) { + this.activeIndex = activeIndex; + this.uncheckAllOptions(); + this.checkActiveIndex(); + } + this.typeAheadExpired = false; + } + } + /** + * Unchecks all options. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - reset the rangeStartIndex + * + * @internal + */ + uncheckAllOptions(preserveChecked = false) { + this.options.forEach((o) => o.checked = this.multiple ? false : void 0); + if (!preserveChecked) { + this.rangeStartIndex = -1; + } + } + }; + __decorate([ + observable + ], ListboxElement.prototype, "activeIndex", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxElement.prototype, "multiple", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], ListboxElement.prototype, "size", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js + var init_listbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js + var init_listbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js"() { + init_listbox(); + init_listbox_element(); + init_listbox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js + var PickerMenu; + var init_picker_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js"() { + init_tslib_es6(); + init_dist2(); + init_esm(); + init_foundation_element(); + PickerMenu = class extends FoundationElement { + constructor() { + super(...arguments); + this.optionElements = []; + } + menuElementsChanged() { + this.updateOptions(); + } + headerElementsChanged() { + this.updateOptions(); + } + footerElementsChanged() { + this.updateOptions(); + } + updateOptions() { + this.optionElements.splice(0, this.optionElements.length); + this.addSlottedListItems(this.headerElements); + this.addSlottedListItems(this.menuElements); + this.addSlottedListItems(this.footerElements); + this.$emit("optionsupdated", { bubbles: false }); + } + addSlottedListItems(slotChildren) { + if (slotChildren === void 0) { + return; + } + slotChildren.forEach((child) => { + if (child.nodeType === 1 && child.getAttribute("role") === "listitem") { + child.id = child.id || uniqueId("option-"); + this.optionElements.push(child); + } + }); + } + }; + __decorate([ + observable + ], PickerMenu.prototype, "menuElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "headerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "footerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "suggestionsAvailableText", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js + var defaultContentsTemplate, PickerMenuOption; + var init_picker_menu_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + defaultContentsTemplate = html` + +`; + PickerMenuOption = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.disconnectView(); + } + handleClick(e) { + if (e.defaultPrevented) { + return false; + } + this.handleInvoked(); + return false; + } + handleInvoked() { + this.$emit("pickeroptioninvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerMenuOption.prototype, "value", void 0); + __decorate([ + observable + ], PickerMenuOption.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js + var init_picker_list = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js + var defaultContentsTemplate2, PickerListItem; + var init_picker_list_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + defaultContentsTemplate2 = html` + +`; + PickerListItem = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + this.disconnectView(); + super.disconnectedCallback(); + } + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + if (e.key === keyEnter) { + this.handleInvoke(); + return false; + } + return true; + } + handleClick(e) { + if (!e.defaultPrevented) { + this.handleInvoke(); + } + return false; + } + handleInvoke() { + this.$emit("pickeriteminvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate2.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerListItem.prototype, "value", void 0); + __decorate([ + observable + ], PickerListItem.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js + var init_picker_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js + var _Picker, FormAssociatedPicker; + var init_picker_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Picker = class extends FoundationElement { + }; + FormAssociatedPicker = class extends FormAssociated(_Picker) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js + var pickerInputTemplate, Picker; + var init_picker = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_anchored_region2(); + init_picker_menu_option(); + init_picker_list_item(); + init_picker_form_associated(); + pickerInputTemplate = html` + +`; + Picker = class extends FormAssociatedPicker { + constructor() { + super(...arguments); + this.selection = ""; + this.filterSelected = true; + this.filterQuery = true; + this.noSuggestionsText = "No suggestions available"; + this.suggestionsAvailableText = "Suggestions available"; + this.loadingText = "Loading suggestions"; + this.menuPlacement = "bottom-fill"; + this.showLoading = false; + this.optionsList = []; + this.filteredOptionsList = []; + this.flyoutOpen = false; + this.menuFocusIndex = -1; + this.showNoOptions = false; + this.selectedItems = []; + this.inputElementView = null; + this.handleTextInput = (e) => { + this.query = this.inputElement.value; + }; + this.handleInputClick = (e) => { + e.preventDefault(); + this.toggleFlyout(true); + }; + this.setRegionProps = () => { + if (!this.flyoutOpen) { + return; + } + if (this.region === null || this.region === void 0) { + DOM.queueUpdate(this.setRegionProps); + return; + } + this.region.anchorElement = this.inputElement; + }; + this.configLookup = { + top: FlyoutPosTop, + bottom: FlyoutPosBottom, + tallest: FlyoutPosTallest, + "top-fill": FlyoutPosTopFill, + "bottom-fill": FlyoutPosBottomFill, + "tallest-fill": FlyoutPosTallestFill + }; + } + selectionChanged() { + if (this.$fastController.isConnected) { + this.handleSelectionChange(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.value = this.selection; + this.validate(); + } + } + } + optionsChanged() { + this.optionsList = this.options.split(",").map((opt) => opt.trim()).filter((opt) => opt !== ""); + } + menuPlacementChanged() { + if (this.$fastController.isConnected) { + this.updateMenuConfig(); + } + } + showLoadingChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + listItemTemplateChanged() { + this.updateListItemTemplate(); + } + defaultListItemTemplateChanged() { + this.updateListItemTemplate(); + } + menuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + defaultMenuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + optionsListChanged() { + this.updateFilteredOptions(); + } + queryChanged() { + if (this.$fastController.isConnected) { + if (this.inputElement.value !== this.query) { + this.inputElement.value = this.query; + } + this.updateFilteredOptions(); + this.$emit("querychange", { bubbles: false }); + } + } + filteredOptionsListChanged() { + if (this.$fastController.isConnected) { + this.showNoOptions = this.filteredOptionsList.length === 0 && this.menuElement.querySelectorAll('[role="listitem"]').length === 0; + this.setFocusedOption(this.showNoOptions ? -1 : 0); + } + } + flyoutOpenChanged() { + if (this.flyoutOpen) { + DOM.queueUpdate(this.setRegionProps); + this.$emit("menuopening", { bubbles: false }); + } else { + this.$emit("menuclosing", { bubbles: false }); + } + } + showNoOptionsChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.listElement = document.createElement(this.selectedListTag); + this.appendChild(this.listElement); + this.itemsPlaceholderElement = document.createComment(""); + this.listElement.append(this.itemsPlaceholderElement); + this.inputElementView = pickerInputTemplate.render(this, this.listElement); + const match = this.menuTag.toUpperCase(); + this.menuElement = Array.from(this.children).find((element) => { + return element.tagName === match; + }); + if (this.menuElement === void 0) { + this.menuElement = document.createElement(this.menuTag); + this.appendChild(this.menuElement); + } + if (this.menuElement.id === "") { + this.menuElement.id = uniqueId("listbox-"); + } + this.menuId = this.menuElement.id; + this.optionsPlaceholder = document.createComment(""); + this.menuElement.append(this.optionsPlaceholder); + this.updateMenuConfig(); + DOM.queueUpdate(() => this.initialize()); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.toggleFlyout(false); + this.inputElement.removeEventListener("input", this.handleTextInput); + this.inputElement.removeEventListener("click", this.handleInputClick); + if (this.inputElementView !== null) { + this.inputElementView.dispose(); + this.inputElementView = null; + } + } + /** + * Move focus to the input element + * @public + */ + focus() { + this.inputElement.focus(); + } + /** + * Initialize the component. This is delayed a frame to ensure children are connected as well. + */ + initialize() { + this.updateListItemTemplate(); + this.updateOptionTemplate(); + this.itemsRepeatBehavior = new RepeatDirective((x) => x.selectedItems, (x) => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement); + this.inputElement.addEventListener("input", this.handleTextInput); + this.inputElement.addEventListener("click", this.handleInputClick); + this.$fastController.addBehaviors([this.itemsRepeatBehavior]); + this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText; + this.menuElement.addEventListener("optionsupdated", this.handleMenuOptionsUpdated); + this.optionsRepeatBehavior = new RepeatDirective((x) => x.filteredOptionsList, (x) => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder); + this.$fastController.addBehaviors([this.optionsRepeatBehavior]); + this.handleSelectionChange(); + } + /** + * Toggles the menu flyout + */ + toggleFlyout(open) { + if (this.flyoutOpen === open) { + return; + } + if (open && document.activeElement === this.inputElement) { + this.flyoutOpen = open; + DOM.queueUpdate(() => { + if (this.menuElement !== void 0) { + this.setFocusedOption(0); + } else { + this.disableMenu(); + } + }); + return; + } + this.flyoutOpen = false; + this.disableMenu(); + return; + } + /** + * Handle the menu options updated event from the child menu + */ + handleMenuOptionsUpdated(e) { + e.preventDefault(); + if (this.flyoutOpen) { + this.setFocusedOption(0); + } + } + /** + * Handle key down events. + */ + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + // TODO: what should "home" and "end" keys do, exactly? + // + // case keyHome: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.setFocusedOption(0); + // } + // } + // return false; + // } + // case keyEnd: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.toggleFlyout(true); + // this.setFocusedOption(this.menuElement.optionElements.length - 1); + // } + // } + // return false; + // } + case keyArrowDown: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const nextFocusOptionIndex = this.flyoutOpen ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1) : 0; + this.setFocusedOption(nextFocusOptionIndex); + } + return false; + } + case keyArrowUp: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const previousFocusOptionIndex = this.flyoutOpen ? Math.max(this.menuFocusIndex - 1, 0) : 0; + this.setFocusedOption(previousFocusOptionIndex); + } + return false; + } + case keyEscape: { + this.toggleFlyout(false); + return false; + } + case keyEnter: { + if (this.menuFocusIndex !== -1 && this.menuElement.optionElements.length > this.menuFocusIndex) { + this.menuElement.optionElements[this.menuFocusIndex].click(); + } + return false; + } + case keyArrowRight: { + if (document.activeElement !== this.inputElement) { + this.incrementFocusedItem(1); + return false; + } + return true; + } + case keyArrowLeft: { + if (this.inputElement.selectionStart === 0) { + this.incrementFocusedItem(-1); + return false; + } + return true; + } + case keyDelete: + case keyBackspace: { + if (document.activeElement === null) { + return true; + } + if (document.activeElement === this.inputElement) { + if (this.inputElement.selectionStart === 0) { + this.selection = this.selectedItems.slice(0, this.selectedItems.length - 1).toString(); + this.toggleFlyout(false); + return false; + } + return true; + } + const selectedItems = Array.from(this.listElement.children); + const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement); + if (currentFocusedItemIndex > -1) { + this.selection = this.selectedItems.splice(currentFocusedItemIndex, 1).toString(); + DOM.queueUpdate(() => { + selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus(); + }); + return false; + } + return true; + } + } + this.toggleFlyout(true); + return true; + } + /** + * Handle focus in events. + */ + handleFocusIn(e) { + return false; + } + /** + * Handle focus out events. + */ + handleFocusOut(e) { + if (this.menuElement === void 0 || !this.menuElement.contains(e.relatedTarget)) { + this.toggleFlyout(false); + } + return false; + } + /** + * The list of selected items has changed + */ + handleSelectionChange() { + if (this.selectedItems.toString() === this.selection) { + return; + } + this.selectedItems = this.selection === "" ? [] : this.selection.split(","); + this.updateFilteredOptions(); + DOM.queueUpdate(() => { + this.checkMaxItems(); + }); + this.$emit("selectionchange", { bubbles: false }); + } + /** + * Anchored region is loaded, menu and options exist in the DOM. + */ + handleRegionLoaded(e) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + this.$emit("menuloaded", { bubbles: false }); + }); + } + /** + * Checks if the maximum number of items has been chosen and updates the ui. + */ + checkMaxItems() { + if (this.inputElement === void 0) { + return; + } + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + if (document.activeElement === this.inputElement) { + const selectedItemInstances = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + selectedItemInstances[selectedItemInstances.length - 1].focus(); + } + this.inputElement.hidden = true; + } else { + this.inputElement.hidden = false; + } + } + /** + * A list item has been invoked. + */ + handleItemInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerListItem) { + const listItems = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + const itemIndex = listItems.indexOf(e.target); + if (itemIndex !== -1) { + const newSelection = this.selectedItems.slice(); + newSelection.splice(itemIndex, 1); + this.selection = newSelection.toString(); + DOM.queueUpdate(() => this.incrementFocusedItem(0)); + } + return false; + } + return true; + } + /** + * A menu option has been invoked. + */ + handleOptionInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerMenuOption) { + if (e.target.value !== void 0) { + this.selection = `${this.selection}${this.selection === "" ? "" : ","}${e.target.value}`; + } + this.inputElement.value = ""; + this.query = ""; + this.inputElement.focus(); + this.toggleFlyout(false); + return false; + } + return true; + } + /** + * Increments the focused list item by the specified amount + */ + incrementFocusedItem(increment) { + if (this.selectedItems.length === 0) { + this.inputElement.focus(); + return; + } + const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + if (document.activeElement !== null) { + let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement); + if (currentFocusedItemIndex === -1) { + currentFocusedItemIndex = selectedItemsAsElements.length; + } + const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment)); + if (newFocusedItemIndex === selectedItemsAsElements.length) { + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + selectedItemsAsElements[newFocusedItemIndex - 1].focus(); + } else { + this.inputElement.focus(); + } + } else { + selectedItemsAsElements[newFocusedItemIndex].focus(); + } + } + } + /** + * Disables the menu. Note that the menu can be open, just doens't have any valid options on display. + */ + disableMenu() { + var _a, _b, _c; + this.menuFocusIndex = -1; + this.menuFocusOptionId = void 0; + (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant"); + (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns"); + (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded"); + } + /** + * Sets the currently focused menu option by index + */ + setFocusedOption(optionIndex) { + if (!this.flyoutOpen || optionIndex === -1 || this.showNoOptions || this.showLoading) { + this.disableMenu(); + return; + } + if (this.menuElement.optionElements.length === 0) { + return; + } + this.menuElement.optionElements.forEach((element) => { + element.setAttribute("aria-selected", "false"); + }); + this.menuFocusIndex = optionIndex; + if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) { + this.menuFocusIndex = this.menuElement.optionElements.length - 1; + } + this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id; + this.inputElement.setAttribute("aria-owns", this.menuId); + this.inputElement.setAttribute("aria-expanded", "true"); + this.inputElement.setAttribute("aria-activedescendant", this.menuFocusOptionId); + const focusedOption = this.menuElement.optionElements[this.menuFocusIndex]; + focusedOption.setAttribute("aria-selected", "true"); + this.menuElement.scrollTo(0, focusedOption.offsetTop); + } + /** + * Updates the template used for the list item repeat behavior + */ + updateListItemTemplate() { + var _a; + this.activeListItemTemplate = (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate; + } + /** + * Updates the template used for the menu option repeat behavior + */ + updateOptionTemplate() { + var _a; + this.activeMenuOptionTemplate = (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate; + } + /** + * Updates the filtered options array + */ + updateFilteredOptions() { + this.filteredOptionsList = this.optionsList.slice(0); + if (this.filterSelected) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => this.selectedItems.indexOf(el2) === -1); + } + if (this.filterQuery && this.query !== "" && this.query !== void 0) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => el2.indexOf(this.query) !== -1); + } + } + /** + * Updates the menu configuration + */ + updateMenuConfig() { + let newConfig = this.configLookup[this.menuPlacement]; + if (newConfig === null) { + newConfig = FlyoutPosBottomFill; + } + this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false }); + } + }; + __decorate([ + attr({ attribute: "selection" }) + ], Picker.prototype, "selection", void 0); + __decorate([ + attr({ attribute: "options" }) + ], Picker.prototype, "options", void 0); + __decorate([ + attr({ attribute: "filter-selected", mode: "boolean" }) + ], Picker.prototype, "filterSelected", void 0); + __decorate([ + attr({ attribute: "filter-query", mode: "boolean" }) + ], Picker.prototype, "filterQuery", void 0); + __decorate([ + attr({ attribute: "max-selected" }) + ], Picker.prototype, "maxSelected", void 0); + __decorate([ + attr({ attribute: "no-suggestions-text" }) + ], Picker.prototype, "noSuggestionsText", void 0); + __decorate([ + attr({ attribute: "suggestions-available-text" }) + ], Picker.prototype, "suggestionsAvailableText", void 0); + __decorate([ + attr({ attribute: "loading-text" }) + ], Picker.prototype, "loadingText", void 0); + __decorate([ + attr({ attribute: "label" }) + ], Picker.prototype, "label", void 0); + __decorate([ + attr({ attribute: "labelledby" }) + ], Picker.prototype, "labelledBy", void 0); + __decorate([ + attr({ attribute: "placeholder" }) + ], Picker.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "menu-placement" }) + ], Picker.prototype, "menuPlacement", void 0); + __decorate([ + observable + ], Picker.prototype, "showLoading", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "optionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "query", void 0); + __decorate([ + observable + ], Picker.prototype, "filteredOptionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "flyoutOpen", void 0); + __decorate([ + observable + ], Picker.prototype, "menuId", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedListTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusIndex", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusOptionId", void 0); + __decorate([ + observable + ], Picker.prototype, "showNoOptions", void 0); + __decorate([ + observable + ], Picker.prototype, "menuConfig", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js + var init_picker_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js + var init_picker_menu_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js + var init_picker_list_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js + var init_picker_list_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js + var init_picker2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js"() { + init_picker_template(); + init_picker(); + init_picker_menu_template(); + init_picker_menu(); + init_picker_menu_option_template(); + init_picker_menu_option(); + init_picker_list_template(); + init_picker_list(); + init_picker_list_item_template(); + init_picker_list_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js + var MenuItemRole, roleForMenuItem; + var init_menu_item_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js"() { + MenuItemRole = { + /** + * The menu item has a "menuitem" role + */ + menuitem: "menuitem", + /** + * The menu item has a "menuitemcheckbox" role + */ + menuitemcheckbox: "menuitemcheckbox", + /** + * The menu item has a "menuitemradio" role + */ + menuitemradio: "menuitemradio" + }; + roleForMenuItem = { + [MenuItemRole.menuitem]: "menuitem", + [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox", + [MenuItemRole.menuitemradio]: "menuitemradio" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js + var MenuItem; + var init_menu_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_start_end(); + init_direction(); + init_apply_mixins(); + init_menu_item_options(); + MenuItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = MenuItemRole.menuitem; + this.hasSubmenu = false; + this.currentDirection = Direction.ltr; + this.focusSubmenuOnLoad = false; + this.handleMenuItemKeyDown = (e) => { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.invoke(); + return false; + case keyArrowRight: + this.expandAndFocus(); + return false; + case keyArrowLeft: + if (this.expanded) { + this.expanded = false; + this.focus(); + return false; + } + } + return true; + }; + this.handleMenuItemClick = (e) => { + if (e.defaultPrevented || this.disabled) { + return false; + } + this.invoke(); + return false; + }; + this.submenuLoaded = () => { + if (!this.focusSubmenuOnLoad) { + return; + } + this.focusSubmenuOnLoad = false; + if (this.hasSubmenu) { + this.submenu.focus(); + this.setAttribute("tabindex", "-1"); + } + }; + this.handleMouseOver = (e) => { + if (this.disabled || !this.hasSubmenu || this.expanded) { + return false; + } + this.expanded = true; + return false; + }; + this.handleMouseOut = (e) => { + if (!this.expanded || this.contains(document.activeElement)) { + return false; + } + this.expanded = false; + return false; + }; + this.expandAndFocus = () => { + if (!this.hasSubmenu) { + return; + } + this.focusSubmenuOnLoad = true; + this.expanded = true; + }; + this.invoke = () => { + if (this.disabled) { + return; + } + switch (this.role) { + case MenuItemRole.menuitemcheckbox: + this.checked = !this.checked; + break; + case MenuItemRole.menuitem: + this.updateSubmenu(); + if (this.hasSubmenu) { + this.expandAndFocus(); + } else { + this.$emit("change"); + } + break; + case MenuItemRole.menuitemradio: + if (!this.checked) { + this.checked = true; + } + break; + } + }; + this.updateSubmenu = () => { + this.submenu = this.domChildren().find((element) => { + return element.getAttribute("role") === "menu"; + }); + this.hasSubmenu = this.submenu === void 0 ? false : true; + }; + } + expandedChanged(oldValue) { + if (this.$fastController.isConnected) { + if (this.submenu === void 0) { + return; + } + if (this.expanded === false) { + this.submenu.collapseExpandedItem(); + } else { + this.currentDirection = getDirection(this); + } + this.$emit("expanded-change", this, { bubbles: false }); + } + } + checkedChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.$emit("change"); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.updateSubmenu(); + }); + if (!this.startColumnCount) { + this.startColumnCount = 1; + } + this.observer = new MutationObserver(this.updateSubmenu); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.submenu = void 0; + if (this.observer !== void 0) { + this.observer.disconnect(); + this.observer = void 0; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "disabled", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "expanded", void 0); + __decorate([ + observable + ], MenuItem.prototype, "startColumnCount", void 0); + __decorate([ + attr + ], MenuItem.prototype, "role", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "checked", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenuRegion", void 0); + __decorate([ + observable + ], MenuItem.prototype, "hasSubmenu", void 0); + __decorate([ + observable + ], MenuItem.prototype, "currentDirection", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenu", void 0); + applyMixins(MenuItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js + var init_menu_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js + var init_menu_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js"() { + init_menu_item_template(); + init_menu_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js + var init_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js + var Menu; + var init_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_menu_item2(); + init_foundation_element(); + Menu = class _Menu extends FoundationElement { + constructor() { + super(...arguments); + this.expandedItem = null; + this.focusIndex = -1; + this.isNestedMenu = () => { + return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem"; + }; + this.handleFocusOut = (e) => { + if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) { + this.collapseExpandedItem(); + const focusIndex = this.menuItems.findIndex(this.isFocusableElement); + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.menuItems[focusIndex].setAttribute("tabindex", "0"); + this.focusIndex = focusIndex; + } + }; + this.handleItemFocus = (e) => { + const targetItem = e.target; + if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.focusIndex = this.menuItems.indexOf(targetItem); + targetItem.setAttribute("tabindex", "0"); + } + }; + this.handleExpandedChanged = (e) => { + if (e.defaultPrevented || e.target === null || this.menuItems === void 0 || this.menuItems.indexOf(e.target) < 0) { + return; + } + e.preventDefault(); + const changedItem = e.target; + if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) { + this.expandedItem = null; + return; + } + if (changedItem.expanded) { + if (this.expandedItem !== null && this.expandedItem !== changedItem) { + this.expandedItem.expanded = false; + } + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.expandedItem = changedItem; + this.focusIndex = this.menuItems.indexOf(changedItem); + changedItem.setAttribute("tabindex", "0"); + } + }; + this.removeItemListeners = () => { + if (this.menuItems !== void 0) { + this.menuItems.forEach((item) => { + item.removeEventListener("expanded-change", this.handleExpandedChanged); + item.removeEventListener("focus", this.handleItemFocus); + }); + } + }; + this.setItems = () => { + const newItems = this.domChildren(); + this.removeItemListeners(); + this.menuItems = newItems; + const menuItems = this.menuItems.filter(this.isMenuItemElement); + if (menuItems.length) { + this.focusIndex = 0; + } + function elementIndent(el2) { + const role = el2.getAttribute("role"); + const startSlot = el2.querySelector("[slot=start]"); + if (role !== MenuItemRole.menuitem && startSlot === null) { + return 1; + } else if (role === MenuItemRole.menuitem && startSlot !== null) { + return 1; + } else if (role !== MenuItemRole.menuitem && startSlot !== null) { + return 2; + } else { + return 0; + } + } + const indent = menuItems.reduce((accum, current) => { + const elementValue = elementIndent(current); + return accum > elementValue ? accum : elementValue; + }, 0); + menuItems.forEach((item, index2) => { + item.setAttribute("tabindex", index2 === 0 ? "0" : "-1"); + item.addEventListener("expanded-change", this.handleExpandedChanged); + item.addEventListener("focus", this.handleItemFocus); + if (item instanceof MenuItem || "startColumnCount" in item) { + item.startColumnCount = indent; + } + }); + }; + this.changeHandler = (e) => { + if (this.menuItems === void 0) { + return; + } + const changedMenuItem = e.target; + const changeItemIndex = this.menuItems.indexOf(changedMenuItem); + if (changeItemIndex === -1) { + return; + } + if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) { + for (let i = changeItemIndex - 1; i >= 0; --i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + const maxIndex = this.menuItems.length - 1; + for (let i = changeItemIndex + 1; i <= maxIndex; ++i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + } + }; + this.isMenuItemElement = (el2) => { + return isHTMLElement(el2) && _Menu.focusableElementRoles.hasOwnProperty(el2.getAttribute("role")); + }; + this.isFocusableElement = (el2) => { + return this.isMenuItemElement(el2); + }; + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.menuItems !== void 0) { + this.setItems(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.setItems(); + }); + this.addEventListener("change", this.changeHandler); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeItemListeners(); + this.menuItems = void 0; + this.removeEventListener("change", this.changeHandler); + } + /** + * Focuses the first item in the menu. + * + * @public + */ + focus() { + this.setFocus(0, 1); + } + /** + * Collapses any expanded menu items. + * + * @public + */ + collapseExpandedItem() { + if (this.expandedItem !== null) { + this.expandedItem.expanded = false; + this.expandedItem = null; + } + } + /** + * @internal + */ + handleMenuKeyDown(e) { + if (e.defaultPrevented || this.menuItems === void 0) { + return; + } + switch (e.key) { + case keyArrowDown: + this.setFocus(this.focusIndex + 1, 1); + return; + case keyArrowUp: + this.setFocus(this.focusIndex - 1, -1); + return; + case keyEnd: + this.setFocus(this.menuItems.length - 1, -1); + return; + case keyHome: + this.setFocus(0, 1); + return; + default: + return true; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + setFocus(focusIndex, adjustment) { + if (this.menuItems === void 0) { + return; + } + while (focusIndex >= 0 && focusIndex < this.menuItems.length) { + const child = this.menuItems[focusIndex]; + if (this.isFocusableElement(child)) { + if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + } + this.focusIndex = focusIndex; + child.setAttribute("tabindex", "0"); + child.focus(); + break; + } + focusIndex += adjustment; + } + } + }; + Menu.focusableElementRoles = roleForMenuItem; + __decorate([ + observable + ], Menu.prototype, "items", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js + var init_menu2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js"() { + init_menu_template(); + init_menu(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js + var init_number_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js + var _TextField, FormAssociatedTextField; + var init_text_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextField = class extends FoundationElement { + }; + FormAssociatedTextField = class extends FormAssociated(_TextField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js + var TextFieldType; + var init_text_field_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js"() { + TextFieldType = { + /** + * An email TextField + */ + email: "email", + /** + * A password TextField + */ + password: "password", + /** + * A telephone TextField + */ + tel: "tel", + /** + * A text TextField + */ + text: "text", + /** + * A URL TextField + */ + url: "url" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js + var TextField, DelegatesARIATextbox; + var init_text_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_text_field_form_associated(); + init_text_field_options(); + TextField = class extends FormAssociatedTextField { + constructor() { + super(...arguments); + this.type = TextFieldType.text; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + typeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + this.validate(); + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the text field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], TextField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "autofocus", void 0); + __decorate([ + attr + ], TextField.prototype, "placeholder", void 0); + __decorate([ + attr + ], TextField.prototype, "type", void 0); + __decorate([ + attr + ], TextField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "minlength", void 0); + __decorate([ + attr + ], TextField.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextField.prototype, "defaultSlottedNodes", void 0); + DelegatesARIATextbox = class { + }; + applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties); + applyMixins(TextField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js + var _NumberField, FormAssociatedNumberField; + var init_number_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _NumberField = class extends FoundationElement { + }; + FormAssociatedNumberField = class extends FormAssociated(_NumberField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js + var NumberField; + var init_number_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_text_field(); + init_number_field_form_associated(); + NumberField = class extends FormAssociatedNumberField { + constructor() { + super(...arguments); + this.hideStep = false; + this.step = 1; + this.isUserInput = false; + } + /** + * Ensures that the max is greater than the min and that the value + * is less than the max + * @param previous - the previous max value + * @param next - updated max value + * + * @internal + */ + maxChanged(previous, next) { + var _a; + this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next); + const min = Math.min(this.min, this.max); + if (this.min !== void 0 && this.min !== min) { + this.min = min; + } + this.value = this.getValidValue(this.value); + } + /** + * Ensures that the min is less than the max and that the value + * is greater than the min + * @param previous - previous min value + * @param next - updated min value + * + * @internal + */ + minChanged(previous, next) { + var _a; + this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next); + const max = Math.max(this.min, this.max); + if (this.max !== void 0 && this.max !== max) { + this.max = max; + } + this.value = this.getValidValue(this.value); + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * Validates that the value is a number between the min and max + * @param previous - previous stored value + * @param next - value being updated + * @param updateControl - should the text field be updated with value, defaults to true + * @internal + */ + valueChanged(previous, next) { + this.value = this.getValidValue(next); + if (next !== this.value) { + return; + } + if (this.control && !this.isUserInput) { + this.control.value = this.value; + } + super.valueChanged(previous, this.value); + if (previous !== void 0 && !this.isUserInput) { + this.$emit("input"); + this.$emit("change"); + } + this.isUserInput = false; + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Sets the internal value to a valid number between the min and max properties + * @param value - user input + * + * @internal + */ + getValidValue(value) { + var _a, _b; + let validValue = parseFloat(parseFloat(value).toPrecision(12)); + if (isNaN(validValue)) { + validValue = ""; + } else { + validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue); + validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString(); + } + return validValue; + } + /** + * Increments the value using the step value + * + * @public + */ + stepUp() { + const value = parseFloat(this.value); + const stepUpValue = !isNaN(value) ? value + this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? this.step : 0; + this.value = stepUpValue.toString(); + } + /** + * Decrements the value using the step value + * + * @public + */ + stepDown() { + const value = parseFloat(this.value); + const stepDownValue = !isNaN(value) ? value - this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? 0 - this.step : 0; + this.value = stepDownValue.toString(); + } + /** + * Sets up the initial state of the number field + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "number"); + this.validate(); + this.control.value = this.value; + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the number field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, ""); + this.isUserInput = true; + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** + * Handles the internal control's `keydown` event + * @internal + */ + handleKeyDown(e) { + const key = e.key; + switch (key) { + case keyArrowUp: + this.stepUp(); + return false; + case keyArrowDown: + this.stepDown(); + return false; + } + return true; + } + /** + * Handles populating the input field with a validated value when + * leaving the input field. + * @internal + */ + handleBlur() { + this.control.value = this.value; + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], NumberField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], NumberField.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "hide-step", mode: "boolean" }) + ], NumberField.prototype, "hideStep", void 0); + __decorate([ + attr + ], NumberField.prototype, "placeholder", void 0); + __decorate([ + attr + ], NumberField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "minlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "size", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "step", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "min", void 0); + __decorate([ + observable + ], NumberField.prototype, "defaultSlottedNodes", void 0); + applyMixins(NumberField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js + var init_number_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js"() { + init_number_field_template(); + init_number_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js + var progressSegments, progressRingTemplate; + var init_progress_ring_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js"() { + init_esm(); + progressSegments = 44; + progressRingTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js + var init_progress_ring = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js"() { + init_progress_ring_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js + var BaseProgress; + var init_base_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + BaseProgress = class extends FoundationElement { + constructor() { + super(...arguments); + this.percentComplete = 0; + } + valueChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + minChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + maxChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updatePercentComplete(); + } + updatePercentComplete() { + const min = typeof this.min === "number" ? this.min : 0; + const max = typeof this.max === "number" ? this.max : 100; + const value = typeof this.value === "number" ? this.value : 0; + const range2 = max - min; + this.percentComplete = range2 === 0 ? 0 : Math.fround((value - min) / range2 * 100); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "value", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "max", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], BaseProgress.prototype, "paused", void 0); + __decorate([ + observable + ], BaseProgress.prototype, "percentComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js + var init_progress_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js + var init_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js"() { + init_base_progress(); + init_progress_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js + var radioGroupTemplate; + var init_radio_group_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js"() { + init_esm(); + init_dist2(); + radioGroupTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js + var RadioGroup; + var init_radio_group = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + RadioGroup = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = Orientation.horizontal; + this.radioChangeHandler = (e) => { + const changedRadio = e.target; + if (changedRadio.checked) { + this.slottedRadioButtons.forEach((radio) => { + if (radio !== changedRadio) { + radio.checked = false; + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + } + }); + this.selectedRadio = changedRadio; + this.value = changedRadio.value; + changedRadio.setAttribute("tabindex", "0"); + this.focusedRadio = changedRadio; + } + e.stopPropagation(); + }; + this.moveToRadioByIndex = (group, index2) => { + const radio = group[index2]; + if (!this.isInsideToolbar) { + radio.setAttribute("tabindex", "0"); + if (radio.readOnly) { + this.slottedRadioButtons.forEach((nextRadio) => { + if (nextRadio !== radio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + radio.checked = true; + this.selectedRadio = radio; + } + } + this.focusedRadio = radio; + radio.focus(); + }; + this.moveRightOffGroup = () => { + var _a; + (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.moveLeftOffGroup = () => { + var _a; + (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.focusOutHandler = (e) => { + const group = this.slottedRadioButtons; + const radio = e.target; + const index2 = radio !== null ? group.indexOf(radio) : 0; + const focusedIndex = this.focusedRadio ? group.indexOf(this.focusedRadio) : -1; + if (focusedIndex === 0 && index2 === focusedIndex || focusedIndex === group.length - 1 && focusedIndex === index2) { + if (!this.selectedRadio) { + this.focusedRadio = group[0]; + this.focusedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.focusedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + this.focusedRadio = this.selectedRadio; + if (!this.isInsideFoundationToolbar) { + this.selectedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.selectedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } + } + } + return true; + }; + this.clickHandler = (e) => { + const radio = e.target; + if (radio) { + const group = this.slottedRadioButtons; + if (radio.checked || group.indexOf(radio) === 0) { + radio.setAttribute("tabindex", "0"); + this.selectedRadio = radio; + } else { + radio.setAttribute("tabindex", "-1"); + this.selectedRadio = null; + } + this.focusedRadio = radio; + } + e.preventDefault(); + }; + this.shouldMoveOffGroupToTheRight = (index2, group, key) => { + return index2 === group.length && this.isInsideToolbar && key === keyArrowRight; + }; + this.shouldMoveOffGroupToTheLeft = (group, key) => { + const index2 = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + return index2 < 0 && this.isInsideToolbar && key === keyArrowLeft; + }; + this.checkFocusedRadio = () => { + if (this.focusedRadio !== null && !this.focusedRadio.readOnly && !this.focusedRadio.checked) { + this.focusedRadio.checked = true; + this.focusedRadio.setAttribute("tabindex", "0"); + this.focusedRadio.focus(); + this.selectedRadio = this.focusedRadio; + } + }; + this.moveRight = (e) => { + const group = this.slottedRadioButtons; + let index2 = 0; + index2 = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1; + if (this.shouldMoveOffGroupToTheRight(index2, group, e.key)) { + this.moveRightOffGroup(); + return; + } else if (index2 === group.length) { + index2 = 0; + } + while (index2 < group.length && group.length > 1) { + if (!group[index2].disabled) { + this.moveToRadioByIndex(group, index2); + break; + } else if (this.focusedRadio && index2 === group.indexOf(this.focusedRadio)) { + break; + } else if (index2 + 1 >= group.length) { + if (this.isInsideToolbar) { + break; + } else { + index2 = 0; + } + } else { + index2 += 1; + } + } + }; + this.moveLeft = (e) => { + const group = this.slottedRadioButtons; + let index2 = 0; + index2 = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + index2 = index2 < 0 ? group.length - 1 : index2; + if (this.shouldMoveOffGroupToTheLeft(group, e.key)) { + this.moveLeftOffGroup(); + return; + } + while (index2 >= 0 && group.length > 1) { + if (!group[index2].disabled) { + this.moveToRadioByIndex(group, index2); + break; + } else if (this.focusedRadio && index2 === group.indexOf(this.focusedRadio)) { + break; + } else if (index2 - 1 < 0) { + index2 = group.length - 1; + } else { + index2 -= 1; + } + } + }; + this.keydownHandler = (e) => { + const key = e.key; + if (key in ArrowKeys && this.isInsideFoundationToolbar) { + return true; + } + switch (key) { + case keyEnter: { + this.checkFocusedRadio(); + break; + } + case keyArrowRight: + case keyArrowDown: { + if (this.direction === Direction.ltr) { + this.moveRight(e); + } else { + this.moveLeft(e); + } + break; + } + case keyArrowLeft: + case keyArrowUp: { + if (this.direction === Direction.ltr) { + this.moveLeft(e); + } else { + this.moveRight(e); + } + break; + } + default: { + return true; + } + } + }; + } + readOnlyChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.readOnly) { + radio.readOnly = true; + } else { + radio.readOnly = false; + } + }); + } + } + disabledChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.disabled) { + radio.disabled = true; + } else { + radio.disabled = false; + } + }); + } + } + nameChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + radio.setAttribute("name", this.name); + }); + } + } + valueChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + if (radio.value === this.value) { + radio.checked = true; + this.selectedRadio = radio; + } + }); + } + this.$emit("change"); + } + slottedRadioButtonsChanged(oldValue, newValue) { + if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) { + this.setupRadioButtons(); + } + } + get parentToolbar() { + return this.closest('[role="toolbar"]'); + } + get isInsideToolbar() { + var _a; + return (_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false; + } + get isInsideFoundationToolbar() { + var _a; + return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + this.setupRadioButtons(); + } + disconnectedCallback() { + this.slottedRadioButtons.forEach((radio) => { + radio.removeEventListener("change", this.radioChangeHandler); + }); + } + setupRadioButtons() { + const checkedRadios = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0; + if (numberOfCheckedRadios > 1) { + const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1]; + lastCheckedRadio.checked = true; + } + let foundMatchingVal = false; + this.slottedRadioButtons.forEach((radio) => { + if (this.name !== void 0) { + radio.setAttribute("name", this.name); + } + if (this.disabled) { + radio.disabled = true; + } + if (this.readOnly) { + radio.readOnly = true; + } + if (this.value && this.value === radio.value) { + this.selectedRadio = radio; + this.focusedRadio = radio; + radio.checked = true; + radio.setAttribute("tabindex", "0"); + foundMatchingVal = true; + } else { + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + radio.checked = false; + } + radio.addEventListener("change", this.radioChangeHandler); + }); + if (this.value === void 0 && this.slottedRadioButtons.length > 0) { + const checkedRadios2 = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios2 = checkedRadios2 !== null ? checkedRadios2.length : 0; + if (numberOfCheckedRadios2 > 0 && !foundMatchingVal) { + const lastCheckedRadio = checkedRadios2[numberOfCheckedRadios2 - 1]; + lastCheckedRadio.checked = true; + this.focusedRadio = lastCheckedRadio; + lastCheckedRadio.setAttribute("tabindex", "0"); + } else { + this.slottedRadioButtons[0].setAttribute("tabindex", "0"); + this.focusedRadio = this.slottedRadioButtons[0]; + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], RadioGroup.prototype, "readOnly", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], RadioGroup.prototype, "disabled", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "name", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "value", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "orientation", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "childItems", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "slottedRadioButtons", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js + var init_radio_group2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js"() { + init_radio_group_template(); + init_radio_group(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js + var radioTemplate; + var init_radio_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js"() { + init_esm(); + radioTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js + var _Radio, FormAssociatedRadio; + var init_radio_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Radio = class extends FoundationElement { + }; + FormAssociatedRadio = class extends CheckableFormAssociated(_Radio) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js + var Radio; + var init_radio = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_radio_form_associated(); + Radio = class extends FormAssociatedRadio { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + switch (e.key) { + case keySpace: + if (!this.checked && !this.readOnly) { + this.checked = true; + } + return; + } + return true; + }; + this.proxy.setAttribute("type", "radio"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * @internal + */ + defaultCheckedChanged() { + var _a; + if (this.$fastController.isConnected && !this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false; + this.dirtyChecked = false; + } + } + } + /** + * @internal + */ + connectedCallback() { + var _a, _b; + super.connectedCallback(); + this.validate(); + if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" && this.getAttribute("tabindex") === null) { + if (!this.disabled) { + this.setAttribute("tabindex", "0"); + } + } + if (this.checkedAttribute) { + if (!this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false; + this.dirtyChecked = false; + } + } + } + } + isInsideRadioGroup() { + const parent = this.closest("[role=radiogroup]"); + return parent !== null; + } + /** + * @internal + */ + clickHandler(e) { + if (!this.disabled && !this.readOnly && !this.checked) { + this.checked = true; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Radio.prototype, "readOnly", void 0); + __decorate([ + observable + ], Radio.prototype, "name", void 0); + __decorate([ + observable + ], Radio.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js + var init_radio2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js"() { + init_radio_template(); + init_radio(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js + var HorizontalScroll; + var init_horizontal_scroll = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + HorizontalScroll = class extends FoundationElement { + constructor() { + super(...arguments); + this.framesPerSecond = 60; + this.updatingItems = false; + this.speed = 600; + this.easing = "ease-in-out"; + this.flippersHiddenFromAT = false; + this.scrolling = false; + this.resizeDetector = null; + } + /** + * The calculated duration for a frame. + * + * @internal + */ + get frameTime() { + return 1e3 / this.framesPerSecond; + } + /** + * Firing scrollstart and scrollend events + * @internal + */ + scrollingChanged(prev, next) { + if (this.scrollContainer) { + const event = this.scrolling == true ? "scrollstart" : "scrollend"; + this.$emit(event, this.scrollContainer.scrollLeft); + } + } + /** + * In RTL mode + * @internal + */ + get isRtl() { + return this.scrollItems.length > 1 && this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft; + } + connectedCallback() { + super.connectedCallback(); + this.initializeResizeDetector(); + } + disconnectedCallback() { + this.disconnectResizeDetector(); + super.disconnectedCallback(); + } + /** + * Updates scroll stops and flippers when scroll items change + * @param previous - current scroll items + * @param next - new updated scroll items + * @public + */ + scrollItemsChanged(previous, next) { + if (next && !this.updatingItems) { + DOM.queueUpdate(() => this.setStops()); + } + } + /** + * destroys the instance's resize observer + * @internal + */ + disconnectResizeDetector() { + if (this.resizeDetector) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + * @internal + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.resized.bind(this)); + this.resizeDetector.observe(this); + } + /** + * Looks for slots and uses child nodes instead + * @internal + */ + updateScrollStops() { + this.updatingItems = true; + const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => { + if (scrollItem instanceof HTMLSlotElement) { + return scrollItems.concat(scrollItem.assignedElements()); + } + scrollItems.push(scrollItem); + return scrollItems; + }, []); + this.scrollItems = updatedItems; + this.updatingItems = false; + } + /** + * Finds all of the scroll stops between elements + * @internal + */ + setStops() { + this.updateScrollStops(); + const { scrollContainer: container } = this; + const { scrollLeft } = container; + const { width: containerWidth, left: containerLeft } = container.getBoundingClientRect(); + this.width = containerWidth; + let lastStop = 0; + let stops = this.scrollItems.map((item, index2) => { + const { left, width } = item.getBoundingClientRect(); + const leftPosition = Math.round(left + scrollLeft - containerLeft); + const right = Math.round(leftPosition + width); + if (this.isRtl) { + return -right; + } + lastStop = right; + return index2 === 0 ? 0 : leftPosition; + }).concat(lastStop); + stops = this.fixScrollMisalign(stops); + stops.sort((a, b) => Math.abs(a) - Math.abs(b)); + this.scrollStops = stops; + this.setFlippers(); + } + /** + * Checks to see if the stops are returning values + * otherwise it will try to reinitialize them + * + * @returns boolean indicating that current scrollStops are valid non-zero values + * @internal + */ + validateStops(reinit = true) { + const hasStops = () => !!this.scrollStops.find((stop) => stop > 0); + if (!hasStops() && reinit) { + this.setStops(); + } + return hasStops(); + } + /** + * + */ + fixScrollMisalign(stops) { + if (this.isRtl && stops.some((stop) => stop > 0)) { + stops.sort((a, b) => b - a); + const offset = stops[0]; + stops = stops.map((stop) => stop - offset); + } + return stops; + } + /** + * Sets the controls view if enabled + * @internal + */ + setFlippers() { + var _a, _b; + const position = this.scrollContainer.scrollLeft; + (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle("disabled", position === 0); + if (this.scrollStops) { + const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]); + (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", this.validateStops(false) && Math.abs(position) + this.width >= lastStop); + } + } + /** + * Function that can scroll an item into view. + * @param item - An item index, a scroll item or a child of one of the scroll items + * @param padding - Padding of the viewport where the active item shouldn't be + * @param rightPadding - Optional right padding. Uses the padding if not defined + * + * @public + */ + scrollInView(item, padding = 0, rightPadding) { + var _a; + if (typeof item !== "number" && item) { + item = this.scrollItems.findIndex((scrollItem) => scrollItem === item || scrollItem.contains(item)); + } + if (item !== void 0) { + rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding; + const { scrollContainer: container, scrollStops, scrollItems: items } = this; + const { scrollLeft } = this.scrollContainer; + const { width: containerWidth } = container.getBoundingClientRect(); + const itemStart = scrollStops[item]; + const { width } = items[item].getBoundingClientRect(); + const itemEnd = itemStart + width; + const isBefore = scrollLeft + padding > itemStart; + if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) { + const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b); + const scrollTo = (_a = stops.find((position) => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0; + this.scrollToPosition(scrollTo); + } + } + } + /** + * Lets the user arrow left and right through the horizontal scroll + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + this.scrollToPrevious(); + break; + case "ArrowRight": + this.scrollToNext(); + break; + } + } + /** + * Scrolls items to the left + * @public + */ + scrollToPrevious() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop, index2) => stop >= scrollPosition && (this.isRtl || index2 === this.scrollStops.length - 1 || this.scrollStops[index2 + 1] > scrollPosition)); + const right = Math.abs(this.scrollStops[current + 1]); + let nextIndex = this.scrollStops.findIndex((stop) => Math.abs(stop) + this.width > right); + if (nextIndex >= current || nextIndex === -1) { + nextIndex = current > 0 ? current - 1 : 0; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Scrolls items to the right + * @public + */ + scrollToNext() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop) => Math.abs(stop) >= Math.abs(scrollPosition)); + const outOfView = this.scrollStops.findIndex((stop) => Math.abs(scrollPosition) + this.width <= Math.abs(stop)); + let nextIndex = current; + if (outOfView > current + 2) { + nextIndex = outOfView - 2; + } else if (current < this.scrollStops.length - 2) { + nextIndex = current + 1; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Handles scrolling with easing + * @param position - starting position + * @param newPosition - position to scroll to + * @public + */ + scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) { + var _a; + if (this.scrolling) { + return; + } + this.scrolling = true; + const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`; + this.content.style.setProperty("transition-duration", seconds); + const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue("transition-duration")); + const transitionendHandler = (e) => { + if (e && e.target !== e.currentTarget) { + return; + } + this.content.style.setProperty("transition-duration", "0s"); + this.content.style.removeProperty("transform"); + this.scrollContainer.style.setProperty("scroll-behavior", "auto"); + this.scrollContainer.scrollLeft = newPosition; + this.setFlippers(); + this.content.removeEventListener("transitionend", transitionendHandler); + this.scrolling = false; + }; + if (computedDuration === 0) { + transitionendHandler(); + return; + } + this.content.addEventListener("transitionend", transitionendHandler); + const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth; + let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue); + if (this.isRtl) { + transitionStop = this.scrollContainer.scrollLeft + Math.min(Math.abs(newPosition), maxScrollValue); + } + this.content.style.setProperty("transition-property", "transform"); + this.content.style.setProperty("transition-timing-function", this.easing); + this.content.style.setProperty("transform", `translateX(${transitionStop}px)`); + } + /** + * Monitors resize event on the horizontal-scroll element + * @public + */ + resized() { + if (this.resizeTimeout) { + this.resizeTimeout = clearTimeout(this.resizeTimeout); + } + this.resizeTimeout = setTimeout(() => { + this.width = this.scrollContainer.offsetWidth; + this.setFlippers(); + }, this.frameTime); + } + /** + * Monitors scrolled event on the content container + * @public + */ + scrolled() { + if (this.scrollTimeout) { + this.scrollTimeout = clearTimeout(this.scrollTimeout); + } + this.scrollTimeout = setTimeout(() => { + this.setFlippers(); + }, this.frameTime); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], HorizontalScroll.prototype, "speed", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "duration", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "easing", void 0); + __decorate([ + attr({ attribute: "flippers-hidden-from-at", converter: booleanConverter }) + ], HorizontalScroll.prototype, "flippersHiddenFromAT", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrolling", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrollItems", void 0); + __decorate([ + attr({ attribute: "view" }) + ], HorizontalScroll.prototype, "view", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js + var init_horizontal_scroll_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js + var init_horizontal_scroll2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js"() { + init_horizontal_scroll(); + init_horizontal_scroll_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js + function whitespaceFilter(value, index2, array) { + return value.nodeType !== Node.TEXT_NODE ? true : typeof value.nodeValue === "string" && !!value.nodeValue.trim().length; + } + var init_whitespace_filter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js + var init_search_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js + var _Search, FormAssociatedSearch; + var init_search_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Search = class extends FoundationElement { + }; + FormAssociatedSearch = class extends FormAssociated(_Search) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.js + var Search, DelegatesARIASearch; + var init_search = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_search_form_associated(); + Search = class extends FormAssociatedSearch { + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Handles the control's clear value event + * @public + */ + handleClearInput() { + this.value = ""; + this.control.focus(); + this.handleChange(); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Search.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "autofocus", void 0); + __decorate([ + attr + ], Search.prototype, "placeholder", void 0); + __decorate([ + attr + ], Search.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "minlength", void 0); + __decorate([ + attr + ], Search.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "spellcheck", void 0); + __decorate([ + observable + ], Search.prototype, "defaultSlottedNodes", void 0); + DelegatesARIASearch = class { + }; + applyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties); + applyMixins(Search, StartEnd, DelegatesARIASearch); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/index.js + var init_search2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/index.js"() { + init_search_template(); + init_search(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js + var _Select, FormAssociatedSelect; + var init_select_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js"() { + init_listbox_element(); + init_form_associated(); + _Select = class extends ListboxElement { + }; + FormAssociatedSelect = class extends FormAssociated(_Select) { + constructor() { + super(...arguments); + this.proxy = document.createElement("select"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.js + var Select, DelegatesARIASelect; + var init_select = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_apply_mixins(); + init_select_form_associated(); + init_select_options(); + Select = class extends FormAssociatedSelect { + constructor() { + super(...arguments); + this.open = false; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + } + /** + * Sets focus and synchronizes ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged(prev, next) { + if (!this.collapsible) { + return; + } + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + this.indexWhenOpened = this.selectedIndex; + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The component is collapsible when in single-selection mode with no size attribute. + * + * @internal + */ + get collapsible() { + return !(this.multiple || typeof this.size === "number"); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c, _d, _e, _f, _g; + const prev = `${this._value}`; + if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) { + const selectedIndex = this._options.findIndex((el2) => el2.value === next); + const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; + const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null; + if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) { + next = ""; + this.selectedIndex = selectedIndex; + } + next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + this.updateDisplayValue(); + } + } + /** + * Sets the value and display value to match the first selected option. + * + * @param shouldEmit - if true, the input and change events will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a, _b; + if (this.$fastController.isConnected) { + this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; + } + if (shouldEmit) { + this.$emit("input"); + this.$emit("change", this, { + bubbles: true, + composed: void 0 + }); + } + } + /** + * Updates the proxy value when the selected index changes. + * + * @param prev - the previous selected index + * @param next - the next selected index + * + * @internal + */ + selectedIndexChanged(prev, next) { + super.selectedIndexChanged(prev, next); + this.updateValue(); + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * The value displayed on the button. + * + * @public + */ + get displayValue() { + var _a, _b; + Observable.track(this, "displayValue"); + return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ""; + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + this.setProxyOptions(); + super.setDefaultSelectedOption(); + if (this.selectedIndex === -1) { + this.selectedIndex = 0; + } + } + /** + * Handle opening and closing the listbox when the select is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + if (this.disabled) { + return; + } + if (this.open) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && captured.disabled) { + return; + } + } + super.clickHandler(e); + this.open = this.collapsible && !this.open; + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + return true; + } + /** + * Handles focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + var _a; + super.focusoutHandler(e); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) { + this.open = false; + if (this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + } + } + /** + * Updates the value when an option's value changes. + * + * @param source - the source object + * @param propertyName - the property to evaluate + * + * @internal + * @override + */ + handleChange(source, propertyName) { + super.handleChange(source, propertyName); + if (propertyName === "value") { + this.updateValue(); + } + } + /** + * Synchronize the form-associated proxy and updates the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "value"); + }); + super.slottedOptionsChanged(prev, next); + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.subscribe(this, "value"); + }); + this.setProxyOptions(); + this.updateValue(); + } + /** + * Prevents focus when size is set and a scrollbar is clicked. + * + * @param e - the mouse event object + * + * @override + * @internal + */ + mousedownHandler(e) { + var _a; + if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) { + return super.mousedownHandler(e); + } + return this.collapsible; + } + /** + * Sets the multiple property on the proxy element. + * + * @param prev - the previous multiple value + * @param next - the current multiple value + */ + multipleChanged(prev, next) { + super.multipleChanged(prev, next); + if (this.proxy) { + this.proxy.multiple = next; + } + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @override + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + super.selectedOptionsChanged(prev, next); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => { + var _a2; + const proxyOption = (_a2 = this.proxy) === null || _a2 === void 0 ? void 0 : _a2.options.item(i); + if (proxyOption) { + proxyOption.selected = o.selected; + } + }); + } + /** + * Sets the selected index to match the first option with the selected attribute, or + * the first selectable option. + * + * @override + * @internal + */ + setDefaultSelectedOption() { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter); + const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex((el2) => el2.hasAttribute("selected") || el2.selected || el2.value === this.value); + if (selectedIndex !== -1) { + this.selectedIndex = selectedIndex; + return; + } + this.selectedIndex = 0; + } + /** + * Resets and fills the proxy to match the component's options. + * + * @internal + */ + setProxyOptions() { + if (this.proxy instanceof HTMLSelectElement && this.options) { + this.proxy.options.length = 0; + this.options.forEach((option) => { + const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null); + if (proxyOption) { + this.proxy.options.add(proxyOption); + } + }); + } + } + /** + * Handle keyboard interaction for the select. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + super.keydownHandler(e); + const key = e.key || e.key.charCodeAt(0); + switch (key) { + case keySpace: { + e.preventDefault(); + if (this.collapsible && this.typeAheadExpired) { + this.open = !this.open; + } + break; + } + case keyHome: + case keyEnd: { + e.preventDefault(); + break; + } + case keyEnter: { + e.preventDefault(); + this.open = !this.open; + break; + } + case keyEscape: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + break; + } + case keyTab: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + return true; + } + } + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + this.indexWhenOpened = this.selectedIndex; + } + return !(key === keyArrowDown || key === keyArrowUp); + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + this.addEventListener("contentchange", this.updateDisplayValue); + } + disconnectedCallback() { + this.removeEventListener("contentchange", this.updateDisplayValue); + super.disconnectedCallback(); + } + /** + * Updates the proxy's size property when the size attribute changes. + * + * @param prev - the previous size + * @param next - the current size + * + * @override + * @internal + */ + sizeChanged(prev, next) { + super.sizeChanged(prev, next); + if (this.proxy) { + this.proxy.size = next; + } + } + /** + * + * @internal + */ + updateDisplayValue() { + if (this.collapsible) { + Observable.notify(this, "displayValue"); + } + } + }; + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Select.prototype, "open", void 0); + __decorate([ + volatile + ], Select.prototype, "collapsible", null); + __decorate([ + observable + ], Select.prototype, "control", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Select.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Select.prototype, "position", void 0); + __decorate([ + observable + ], Select.prototype, "maxHeight", void 0); + DelegatesARIASelect = class { + }; + __decorate([ + observable + ], DelegatesARIASelect.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIASelect, DelegatesARIAListbox); + applyMixins(Select, StartEnd, DelegatesARIASelect); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js + var selectTemplate; + var init_select_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js"() { + init_esm(); + init_listbox(); + init_start_end(); + selectTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/index.js + var init_select2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/index.js"() { + init_select(); + init_select_options(); + init_select_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js + var init_skeleton_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js + var Skeleton; + var init_skeleton = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Skeleton = class extends FoundationElement { + constructor() { + super(...arguments); + this.shape = "rect"; + } + }; + __decorate([ + attr + ], Skeleton.prototype, "fill", void 0); + __decorate([ + attr + ], Skeleton.prototype, "shape", void 0); + __decorate([ + attr + ], Skeleton.prototype, "pattern", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Skeleton.prototype, "shimmer", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js + var init_skeleton2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js"() { + init_skeleton_template(); + init_skeleton(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js + var init_slider_label_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js + function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) { + let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition)); + if (direction === Direction.rtl) { + pct = 1 - pct; + } + return pct; + } + var init_slider_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js"() { + init_dist2(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js + var defaultConfig, SliderLabel; + var init_slider_label = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_slider_utilities(); + init_foundation_element(); + defaultConfig = { + min: 0, + max: 0, + direction: Direction.ltr, + orientation: Orientation.horizontal, + disabled: false + }; + SliderLabel = class extends FoundationElement { + constructor() { + super(...arguments); + this.hideMark = false; + this.sliderDirection = Direction.ltr; + this.getSliderConfiguration = () => { + if (!this.isSliderConfig(this.parentNode)) { + this.sliderDirection = defaultConfig.direction || Direction.ltr; + this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal; + this.sliderMaxPosition = defaultConfig.max; + this.sliderMinPosition = defaultConfig.min; + } else { + const parentSlider = this.parentNode; + const { min, max, direction, orientation, disabled } = parentSlider; + if (disabled !== void 0) { + this.disabled = disabled; + } + this.sliderDirection = direction || Direction.ltr; + this.sliderOrientation = orientation || Orientation.horizontal; + this.sliderMaxPosition = max; + this.sliderMinPosition = min; + } + }; + this.positionAsStyle = () => { + const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr; + const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition)); + let rightNum = Math.round((1 - pct) * 100); + let leftNum = Math.round(pct * 100); + if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) { + rightNum = 50; + leftNum = 50; + } + if (this.sliderOrientation === Orientation.horizontal) { + return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`; + } else { + return `top: ${leftNum}%; bottom: ${rightNum}%;`; + } + }; + } + positionChanged() { + this.positionStyle = this.positionAsStyle(); + } + /** + * @internal + */ + sliderOrientationChanged() { + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.getSliderConfiguration(); + this.positionStyle = this.positionAsStyle(); + this.notifier = Observable.getNotifier(this.parentNode); + this.notifier.subscribe(this, "orientation"); + this.notifier.subscribe(this, "direction"); + this.notifier.subscribe(this, "max"); + this.notifier.subscribe(this, "min"); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.notifier.unsubscribe(this, "orientation"); + this.notifier.unsubscribe(this, "direction"); + this.notifier.unsubscribe(this, "max"); + this.notifier.unsubscribe(this, "min"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "direction": + this.sliderDirection = source.direction; + break; + case "orientation": + this.sliderOrientation = source.orientation; + break; + case "max": + this.sliderMaxPosition = source.max; + break; + case "min": + this.sliderMinPosition = source.min; + break; + default: + break; + } + this.positionStyle = this.positionAsStyle(); + } + isSliderConfig(node) { + return node.max !== void 0 && node.min !== void 0; + } + }; + __decorate([ + observable + ], SliderLabel.prototype, "positionStyle", void 0); + __decorate([ + attr + ], SliderLabel.prototype, "position", void 0); + __decorate([ + attr({ attribute: "hide-mark", mode: "boolean" }) + ], SliderLabel.prototype, "hideMark", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], SliderLabel.prototype, "disabled", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderOrientation", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMinPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMaxPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js + var init_slider_label2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js"() { + init_slider_label_template(); + init_slider_label(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js + var init_slider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js + var _Slider, FormAssociatedSlider; + var init_slider_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Slider = class extends FoundationElement { + }; + FormAssociatedSlider = class extends FormAssociated(_Slider) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js + var SliderMode, Slider; + var init_slider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_slider_utilities(); + init_slider_form_associated(); + SliderMode = { + singleValue: "single-value" + }; + Slider = class extends FormAssociatedSlider { + constructor() { + super(...arguments); + this.direction = Direction.ltr; + this.isDragging = false; + this.trackWidth = 0; + this.trackMinWidth = 0; + this.trackHeight = 0; + this.trackLeft = 0; + this.trackMinHeight = 0; + this.valueTextFormatter = () => null; + this.min = 0; + this.max = 10; + this.step = 1; + this.orientation = Orientation.horizontal; + this.mode = SliderMode.singleValue; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + if (e.key === keyHome) { + e.preventDefault(); + this.value = `${this.min}`; + } else if (e.key === keyEnd) { + e.preventDefault(); + this.value = `${this.max}`; + } else if (!e.shiftKey) { + switch (e.key) { + case keyArrowRight: + case keyArrowUp: + e.preventDefault(); + this.increment(); + break; + case keyArrowLeft: + case keyArrowDown: + e.preventDefault(); + this.decrement(); + break; + } + } + }; + this.setupTrackConstraints = () => { + const clientRect = this.track.getBoundingClientRect(); + this.trackWidth = this.track.clientWidth; + this.trackMinWidth = this.track.clientLeft; + this.trackHeight = clientRect.bottom; + this.trackMinHeight = clientRect.top; + this.trackLeft = this.getBoundingClientRect().left; + if (this.trackWidth === 0) { + this.trackWidth = 1; + } + }; + this.setupListeners = (remove = false) => { + const eventAction = `${remove ? "remove" : "add"}EventListener`; + this[eventAction]("keydown", this.keypressHandler); + this[eventAction]("mousedown", this.handleMouseDown); + this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { + passive: true + }); + this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { + passive: true + }); + if (remove) { + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + } + }; + this.initialValue = ""; + this.handleThumbMouseDown = (event) => { + if (event) { + if (this.readOnly || this.disabled || event.defaultPrevented) { + return; + } + event.target.focus(); + } + const eventAction = `${event !== null ? "add" : "remove"}EventListener`; + window[eventAction]("mouseup", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchmove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchend", this.handleWindowMouseUp); + this.isDragging = event !== null; + }; + this.handleMouseMove = (e) => { + if (this.readOnly || this.disabled || e.defaultPrevented) { + return; + } + const sourceEvent = window.TouchEvent && e instanceof TouchEvent ? e.touches[0] : e; + const eventValue = this.orientation === Orientation.horizontal ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft : sourceEvent.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(eventValue)}`; + }; + this.calculateNewValue = (rawValue) => { + const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal ? this.trackMinWidth : this.trackMinHeight, this.orientation === Orientation.horizontal ? this.trackWidth : this.trackHeight, this.direction); + const newValue = (this.max - this.min) * newPosition + this.min; + return this.convertToConstrainedValue(newValue); + }; + this.handleWindowMouseUp = (event) => { + this.stopDragging(); + }; + this.stopDragging = () => { + this.isDragging = false; + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + }; + this.handleMouseDown = (e) => { + const eventAction = `${e !== null ? "add" : "remove"}EventListener`; + if (e === null || !this.disabled && !this.readOnly) { + window[eventAction]("mouseup", this.handleWindowMouseUp); + window.document[eventAction]("mouseleave", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove); + if (e) { + e.preventDefault(); + this.setupTrackConstraints(); + e.target.focus(); + const controlValue = this.orientation === Orientation.horizontal ? e.pageX - document.documentElement.scrollLeft - this.trackLeft : e.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(controlValue)}`; + } + } + }; + this.convertToConstrainedValue = (value) => { + if (isNaN(value)) { + value = this.min; + } + let constrainedValue = value - this.min; + const roundedConstrainedValue = Math.round(constrainedValue / this.step); + const remainderValue = constrainedValue - roundedConstrainedValue * (this.stepMultiplier * this.step) / this.stepMultiplier; + constrainedValue = remainderValue >= Number(this.step) / 2 ? constrainedValue - remainderValue + Number(this.step) : constrainedValue - remainderValue; + return constrainedValue + this.min; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * @internal + */ + valueChanged(previous, next) { + super.valueChanged(previous, next); + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + this.$emit("change"); + } + minChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.min = `${this.min}`; + } + this.validate(); + } + maxChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.max = `${this.max}`; + } + this.validate(); + } + stepChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.step = `${this.step}`; + } + this.updateStepMultiplier(); + this.validate(); + } + orientationChanged() { + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "range"); + this.direction = getDirection(this); + this.updateStepMultiplier(); + this.setupTrackConstraints(); + this.setupListeners(); + this.setupDefaultValue(); + this.setThumbPositionForOrientation(this.direction); + } + /** + * @internal + */ + disconnectedCallback() { + this.setupListeners(true); + } + /** + * Increment the value by the step + * + * @public + */ + increment() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step); + const incrementedVal = this.convertToConstrainedValue(newVal); + const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`; + this.value = incrementedValString; + } + /** + * Decrement the value by the step + * + * @public + */ + decrement() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step); + const decrementedVal = this.convertToConstrainedValue(newVal); + const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`; + this.value = decrementedValString; + } + /** + * Places the thumb based on the current value + * + * @public + * @param direction - writing mode + */ + setThumbPositionForOrientation(direction) { + const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction); + const percentage = (1 - newPct) * 100; + if (this.orientation === Orientation.horizontal) { + this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`; + } else { + this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`; + } + } + /** + * Update the step multiplier used to ensure rounding errors from steps that + * are not whole numbers + */ + updateStepMultiplier() { + const stepString = this.step + ""; + const decimalPlacesOfStep = !!(this.step % 1) ? stepString.length - stepString.indexOf(".") - 1 : 0; + this.stepMultiplier = Math.pow(10, decimalPlacesOfStep); + } + get midpoint() { + return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`; + } + setupDefaultValue() { + if (typeof this.value === "string") { + if (this.value.length === 0) { + this.initialValue = this.midpoint; + } else { + const value = parseFloat(this.value); + if (!Number.isNaN(value) && (value < this.min || value > this.max)) { + this.value = this.midpoint; + } + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Slider.prototype, "readOnly", void 0); + __decorate([ + observable + ], Slider.prototype, "direction", void 0); + __decorate([ + observable + ], Slider.prototype, "isDragging", void 0); + __decorate([ + observable + ], Slider.prototype, "position", void 0); + __decorate([ + observable + ], Slider.prototype, "trackWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "trackLeft", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "valueTextFormatter", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "step", void 0); + __decorate([ + attr + ], Slider.prototype, "orientation", void 0); + __decorate([ + attr + ], Slider.prototype, "mode", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js + var init_slider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js"() { + init_slider_template(); + init_slider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js + var init_switch_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js + var _Switch, FormAssociatedSwitch; + var init_switch_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Switch = class extends FoundationElement { + }; + FormAssociatedSwitch = class extends CheckableFormAssociated(_Switch) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js + var Switch; + var init_switch = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_switch_form_associated(); + Switch = class extends FormAssociatedSwitch { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + this.readOnly ? this.classList.add("readonly") : this.classList.remove("readonly"); + } + /** + * @internal + */ + checkedChanged(prev, next) { + super.checkedChanged(prev, next); + this.checked ? this.classList.add("checked") : this.classList.remove("checked"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Switch.prototype, "readOnly", void 0); + __decorate([ + observable + ], Switch.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js + var init_switch2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js"() { + init_switch_template(); + init_switch(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js + var tabPanelTemplate; + var init_tab_panel_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js"() { + init_esm(); + tabPanelTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js + var TabPanel; + var init_tab_panel = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js"() { + init_foundation_element(); + TabPanel = class extends FoundationElement { + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js + var init_tab_panel2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js"() { + init_tab_panel_template(); + init_tab_panel(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js + var tabTemplate; + var init_tab_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js"() { + init_esm(); + tabTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js + var Tab; + var init_tab = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Tab = class extends FoundationElement { + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tab.prototype, "disabled", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js + var init_tab2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js"() { + init_tab_template(); + init_tab(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js + var tabsTemplate; + var init_tabs_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js"() { + init_esm(); + init_start_end(); + tabsTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js + var TabsOrientation, Tabs; + var init_tabs = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TabsOrientation = { + vertical: "vertical", + horizontal: "horizontal" + }; + Tabs = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = TabsOrientation.horizontal; + this.activeindicator = true; + this.showActiveIndicator = true; + this.prevActiveTabIndex = 0; + this.activeTabIndex = 0; + this.ticking = false; + this.change = () => { + this.$emit("change", this.activetab); + }; + this.isDisabledElement = (el2) => { + return el2.getAttribute("aria-disabled") === "true"; + }; + this.isHiddenElement = (el2) => { + return el2.hasAttribute("hidden"); + }; + this.isFocusableElement = (el2) => { + return !this.isDisabledElement(el2) && !this.isHiddenElement(el2); + }; + this.setTabs = () => { + const gridHorizontalProperty = "gridColumn"; + const gridVerticalProperty = "gridRow"; + const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty; + this.activeTabIndex = this.getActiveIndex(); + this.showActiveIndicator = false; + this.tabs.forEach((tab, index2) => { + if (tab.slot === "tab") { + const isActiveTab = this.activeTabIndex === index2 && this.isFocusableElement(tab); + if (this.activeindicator && this.isFocusableElement(tab)) { + this.showActiveIndicator = true; + } + const tabId = this.tabIds[index2]; + const tabpanelId = this.tabpanelIds[index2]; + tab.setAttribute("id", tabId); + tab.setAttribute("aria-selected", isActiveTab ? "true" : "false"); + tab.setAttribute("aria-controls", tabpanelId); + tab.addEventListener("click", this.handleTabClick); + tab.addEventListener("keydown", this.handleTabKeyDown); + tab.setAttribute("tabindex", isActiveTab ? "0" : "-1"); + if (isActiveTab) { + this.activetab = tab; + this.activeid = tabId; + } + } + tab.style[gridHorizontalProperty] = ""; + tab.style[gridVerticalProperty] = ""; + tab.style[gridProperty] = `${index2 + 1}`; + !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical"); + }); + }; + this.setTabPanels = () => { + this.tabpanels.forEach((tabpanel, index2) => { + const tabId = this.tabIds[index2]; + const tabpanelId = this.tabpanelIds[index2]; + tabpanel.setAttribute("id", tabpanelId); + tabpanel.setAttribute("aria-labelledby", tabId); + this.activeTabIndex !== index2 ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden"); + }); + }; + this.handleTabClick = (event) => { + const selectedTab = event.currentTarget; + if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) { + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = this.tabs.indexOf(selectedTab); + this.setComponent(); + } + }; + this.handleTabKeyDown = (event) => { + if (this.isHorizontal()) { + switch (event.key) { + case keyArrowLeft: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowRight: + event.preventDefault(); + this.adjustForward(event); + break; + } + } else { + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowDown: + event.preventDefault(); + this.adjustForward(event); + break; + } + } + switch (event.key) { + case keyHome: + event.preventDefault(); + this.adjust(-this.activeTabIndex); + break; + case keyEnd: + event.preventDefault(); + this.adjust(this.tabs.length - this.activeTabIndex - 1); + break; + } + }; + this.adjustForward = (e) => { + const group = this.tabs; + let index2 = 0; + index2 = this.activetab ? group.indexOf(this.activetab) + 1 : 1; + if (index2 === group.length) { + index2 = 0; + } + while (index2 < group.length && group.length > 1) { + if (this.isFocusableElement(group[index2])) { + this.moveToTabByIndex(group, index2); + break; + } else if (this.activetab && index2 === group.indexOf(this.activetab)) { + break; + } else if (index2 + 1 >= group.length) { + index2 = 0; + } else { + index2 += 1; + } + } + }; + this.adjustBackward = (e) => { + const group = this.tabs; + let index2 = 0; + index2 = this.activetab ? group.indexOf(this.activetab) - 1 : 0; + index2 = index2 < 0 ? group.length - 1 : index2; + while (index2 >= 0 && group.length > 1) { + if (this.isFocusableElement(group[index2])) { + this.moveToTabByIndex(group, index2); + break; + } else if (index2 - 1 < 0) { + index2 = group.length - 1; + } else { + index2 -= 1; + } + } + }; + this.moveToTabByIndex = (group, index2) => { + const tab = group[index2]; + this.activetab = tab; + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = index2; + tab.focus(); + this.setComponent(); + }; + } + /** + * @internal + */ + orientationChanged() { + if (this.$fastController.isConnected) { + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + activeidChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabsChanged() { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabpanelsChanged() { + if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + getActiveIndex() { + const id = this.activeid; + if (id !== void 0) { + return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid); + } else { + return 0; + } + } + getTabIds() { + return this.tabs.map((tab) => { + var _a; + return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`; + }); + } + getTabPanelIds() { + return this.tabpanels.map((tabPanel) => { + var _a; + return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`; + }); + } + setComponent() { + if (this.activeTabIndex !== this.prevActiveTabIndex) { + this.activeid = this.tabIds[this.activeTabIndex]; + this.focusTab(); + this.change(); + } + } + isHorizontal() { + return this.orientation === TabsOrientation.horizontal; + } + handleActiveIndicatorPosition() { + if (this.showActiveIndicator && this.activeindicator && this.activeTabIndex !== this.prevActiveTabIndex) { + if (this.ticking) { + this.ticking = false; + } else { + this.ticking = true; + this.animateActiveIndicator(); + } + } + } + animateActiveIndicator() { + this.ticking = true; + const gridProperty = this.isHorizontal() ? "gridColumn" : "gridRow"; + const translateProperty = this.isHorizontal() ? "translateX" : "translateY"; + const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop"; + const prev = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + const next = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const dif = next - prev; + this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; + this.activeIndicatorRef.classList.add("activeIndicatorTransition"); + this.activeIndicatorRef.addEventListener("transitionend", () => { + this.ticking = false; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`; + this.activeIndicatorRef.classList.remove("activeIndicatorTransition"); + }); + } + /** + * The adjust method for FASTTabs + * @public + * @remarks + * This method allows the active index to be adjusted by numerical increments + */ + adjust(adjustment) { + const focusableTabs = this.tabs.filter((t) => this.isFocusableElement(t)); + const currentActiveTabIndex = focusableTabs.indexOf(this.activetab); + const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment); + const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]); + if (nextIndex > -1) { + this.moveToTabByIndex(this.tabs, nextIndex); + } + } + focusTab() { + this.tabs[this.activeTabIndex].focus(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.activeTabIndex = this.getActiveIndex(); + } + }; + __decorate([ + attr + ], Tabs.prototype, "orientation", void 0); + __decorate([ + attr + ], Tabs.prototype, "activeid", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabs", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabpanels", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Tabs.prototype, "activeindicator", void 0); + __decorate([ + observable + ], Tabs.prototype, "activeIndicatorRef", void 0); + __decorate([ + observable + ], Tabs.prototype, "showActiveIndicator", void 0); + applyMixins(Tabs, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js + var init_tabs2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js"() { + init_tabs_template(); + init_tabs(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js + var _TextArea, FormAssociatedTextArea; + var init_text_area_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextArea = class extends FoundationElement { + }; + FormAssociatedTextArea = class extends FormAssociated(_TextArea) { + constructor() { + super(...arguments); + this.proxy = document.createElement("textarea"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js + var TextAreaResize; + var init_text_area_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js"() { + TextAreaResize = { + /** + * No resize. + */ + none: "none", + /** + * Resize vertically and horizontally. + */ + both: "both", + /** + * Resize horizontally. + */ + horizontal: "horizontal", + /** + * Resize vertically. + */ + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js + var TextArea; + var init_text_area = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js"() { + init_tslib_es6(); + init_esm(); + init_text_field(); + init_apply_mixins(); + init_text_area_form_associated(); + init_text_area_options(); + TextArea = class extends FormAssociatedTextArea { + constructor() { + super(...arguments); + this.resize = TextAreaResize.none; + this.cols = 20; + this.handleTextInput = () => { + this.value = this.control.value; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.readOnly = this.readOnly; + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.autofocus = this.autofocus; + } + } + listChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.setAttribute("list", this.list); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.maxLength = this.maxlength; + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.minLength = this.minlength; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * Selects all the text in the text area + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "readOnly", void 0); + __decorate([ + attr + ], TextArea.prototype, "resize", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], TextArea.prototype, "formId", void 0); + __decorate([ + attr + ], TextArea.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "minlength", void 0); + __decorate([ + attr + ], TextArea.prototype, "name", void 0); + __decorate([ + attr + ], TextArea.prototype, "placeholder", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "cols", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "rows", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextArea.prototype, "defaultSlottedNodes", void 0); + applyMixins(TextArea, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js + var textAreaTemplate; + var init_text_area_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js"() { + init_esm(); + init_text_area(); + textAreaTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js + var init_text_area2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js"() { + init_text_area_template(); + init_text_area(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js + var textFieldTemplate; + var init_text_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js"() { + init_esm(); + init_start_end(); + init_whitespace_filter(); + textFieldTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js + var init_text_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js"() { + init_text_field_template(); + init_text_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js + var init_toolbar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js + function getRootActiveElement(element) { + const rootNode = element.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.activeElement; + } + return document.activeElement; + } + var init_root_active_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js + var ToolbarArrowKeyMap, Toolbar, DelegatesARIAToolbar; + var init_toolbar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + init_direction(); + init_root_active_element(); + ToolbarArrowKeyMap = Object.freeze({ + [ArrowKeys.ArrowUp]: { + [Orientation.vertical]: -1 + }, + [ArrowKeys.ArrowDown]: { + [Orientation.vertical]: 1 + }, + [ArrowKeys.ArrowLeft]: { + [Orientation.horizontal]: { + [Direction.ltr]: -1, + [Direction.rtl]: 1 + } + }, + [ArrowKeys.ArrowRight]: { + [Orientation.horizontal]: { + [Direction.ltr]: 1, + [Direction.rtl]: -1 + } + } + }); + Toolbar = class _Toolbar extends FoundationElement { + constructor() { + super(...arguments); + this._activeIndex = 0; + this.direction = Direction.ltr; + this.orientation = Orientation.horizontal; + } + /** + * The index of the currently focused element, clamped between 0 and the last element. + * + * @internal + */ + get activeIndex() { + Observable.track(this, "activeIndex"); + return this._activeIndex; + } + set activeIndex(value) { + if (this.$fastController.isConnected) { + this._activeIndex = limit(0, this.focusableElements.length - 1, value); + Observable.notify(this, "activeIndex"); + } + } + slottedItemsChanged() { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * Set the activeIndex when a focusable element in the toolbar is clicked. + * + * @internal + */ + mouseDownHandler(e) { + var _a; + const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.findIndex((x) => x.contains(e.target)); + if (activeIndex > -1 && this.activeIndex !== activeIndex) { + this.setFocusedElement(activeIndex); + } + return true; + } + childItemsChanged(prev, next) { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + } + /** + * When the toolbar receives focus, set the currently active element as focused. + * + * @internal + */ + focusinHandler(e) { + const relatedTarget = e.relatedTarget; + if (!relatedTarget || this.contains(relatedTarget)) { + return; + } + this.setFocusedElement(); + } + /** + * Determines a value that can be used to iterate a list with the arrow keys. + * + * @param this - An element with an orientation and direction + * @param key - The event key value + * @internal + */ + getDirectionalIncrementer(key) { + var _a, _b, _c, _d, _e; + return (_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0; + } + /** + * Handle keyboard events for the toolbar. + * + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) { + return true; + } + const incrementer = this.getDirectionalIncrementer(key); + if (!incrementer) { + return !e.target.closest("[role=radiogroup]"); + } + const nextIndex = this.activeIndex + incrementer; + if (this.focusableElements[nextIndex]) { + e.preventDefault(); + } + this.setFocusedElement(nextIndex); + return true; + } + /** + * get all the slotted elements + * @internal + */ + get allSlottedItems() { + return [ + ...this.start.assignedElements(), + ...this.slottedItems, + ...this.end.assignedElements() + ]; + } + /** + * Prepare the slotted elements which can be focusable. + * + * @internal + */ + reduceFocusableElements() { + var _a; + const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex]; + this.focusableElements = this.allSlottedItems.reduce(_Toolbar.reduceFocusableItems, []); + const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement); + this.activeIndex = Math.max(0, adjustedActiveIndex); + this.setFocusableElements(); + } + /** + * Set the activeIndex and focus the corresponding control. + * + * @param activeIndex - The new index to set + * @internal + */ + setFocusedElement(activeIndex = this.activeIndex) { + this.activeIndex = activeIndex; + this.setFocusableElements(); + if (this.focusableElements[this.activeIndex] && // Don't focus the toolbar element if some event handlers moved + // the focus on another element in the page. + this.contains(getRootActiveElement(this))) { + this.focusableElements[this.activeIndex].focus(); + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceFocusableItems(elements3, element) { + var _a, _b, _c, _d; + const isRoleRadio = element.getAttribute("role") === "radio"; + const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus; + const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some((x) => isFocusable(x)); + if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) { + elements3.push(element); + return elements3; + } + if (element.childElementCount) { + return elements3.concat(Array.from(element.children).reduce(_Toolbar.reduceFocusableItems, [])); + } + return elements3; + } + /** + * @internal + */ + setFocusableElements() { + if (this.$fastController.isConnected && this.focusableElements.length > 0) { + this.focusableElements.forEach((element, index2) => { + element.tabIndex = this.activeIndex === index2 ? 0 : -1; + }); + } + } + }; + __decorate([ + observable + ], Toolbar.prototype, "direction", void 0); + __decorate([ + attr + ], Toolbar.prototype, "orientation", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedItems", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedLabel", void 0); + __decorate([ + observable + ], Toolbar.prototype, "childItems", void 0); + DelegatesARIAToolbar = class { + }; + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], DelegatesARIAToolbar.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], DelegatesARIAToolbar.prototype, "ariaLabel", void 0); + applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties); + applyMixins(Toolbar, StartEnd, DelegatesARIAToolbar); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js + var init_toolbar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js"() { + init_toolbar_template(); + init_toolbar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js + var init_tooltip_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js + var TooltipPosition; + var init_tooltip_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js"() { + TooltipPosition = { + /** + * The tooltip is positioned above the element + */ + top: "top", + /** + * The tooltip is positioned to the right of the element + */ + right: "right", + /** + * The tooltip is positioned below the element + */ + bottom: "bottom", + /** + * The tooltip is positioned to the left of the element + */ + left: "left", + /** + * The tooltip is positioned before the element + */ + start: "start", + /** + * The tooltip is positioned after the element + */ + end: "end", + /** + * The tooltip is positioned above the element and to the left + */ + topLeft: "top-left", + /** + * The tooltip is positioned above the element and to the right + */ + topRight: "top-right", + /** + * The tooltip is positioned below the element and to the left + */ + bottomLeft: "bottom-left", + /** + * The tooltip is positioned below the element and to the right + */ + bottomRight: "bottom-right", + /** + * The tooltip is positioned above the element and to the left + */ + topStart: "top-start", + /** + * The tooltip is positioned above the element and to the right + */ + topEnd: "top-end", + /** + * The tooltip is positioned below the element and to the left + */ + bottomStart: "bottom-start", + /** + * The tooltip is positioned below the element and to the right + */ + bottomEnd: "bottom-end" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js + var Tooltip2; + var init_tooltip = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + init_tooltip_options(); + Tooltip2 = class extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.delay = 300; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.horizontalInset = "false"; + this.verticalInset = "false"; + this.horizontalScaling = "content"; + this.verticalScaling = "content"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = void 0; + this.tooltipVisible = false; + this.currentDirection = Direction.ltr; + this.showDelayTimer = null; + this.hideDelayTimer = null; + this.isAnchorHoveredFocused = false; + this.isRegionHovered = false; + this.handlePositionChange = (ev) => { + this.classList.toggle("top", this.region.verticalPosition === "start"); + this.classList.toggle("bottom", this.region.verticalPosition === "end"); + this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd"); + this.classList.toggle("center-vertical", this.region.verticalPosition === "center"); + this.classList.toggle("left", this.region.horizontalPosition === "start"); + this.classList.toggle("right", this.region.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd"); + this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center"); + }; + this.handleRegionMouseOver = (ev) => { + this.isRegionHovered = true; + }; + this.handleRegionMouseOut = (ev) => { + this.isRegionHovered = false; + this.startHideDelayTimer(); + }; + this.handleAnchorMouseOver = (ev) => { + if (this.tooltipVisible) { + this.isAnchorHoveredFocused = true; + return; + } + this.startShowDelayTimer(); + }; + this.handleAnchorMouseOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.handleAnchorFocusIn = (ev) => { + this.startShowDelayTimer(); + }; + this.handleAnchorFocusOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.startHideDelayTimer = () => { + this.clearHideDelayTimer(); + if (!this.tooltipVisible) { + return; + } + this.hideDelayTimer = window.setTimeout(() => { + this.updateTooltipVisibility(); + }, 60); + }; + this.clearHideDelayTimer = () => { + if (this.hideDelayTimer !== null) { + clearTimeout(this.hideDelayTimer); + this.hideDelayTimer = null; + } + }; + this.startShowDelayTimer = () => { + if (this.isAnchorHoveredFocused) { + return; + } + if (this.delay > 1) { + if (this.showDelayTimer === null) + this.showDelayTimer = window.setTimeout(() => { + this.startHover(); + }, this.delay); + return; + } + this.startHover(); + }; + this.startHover = () => { + this.isAnchorHoveredFocused = true; + this.updateTooltipVisibility(); + }; + this.clearShowDelayTimer = () => { + if (this.showDelayTimer !== null) { + clearTimeout(this.showDelayTimer); + this.showDelayTimer = null; + } + }; + this.getAnchor = () => { + const rootNode = this.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.getElementById(this.anchor); + } + return document.getElementById(this.anchor); + }; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && this.tooltipVisible) { + switch (e.key) { + case keyEscape: + this.isAnchorHoveredFocused = false; + this.updateTooltipVisibility(); + this.$emit("dismiss"); + break; + } + } + }; + this.updateTooltipVisibility = () => { + if (this.visible === false) { + this.hideTooltip(); + } else if (this.visible === true) { + this.showTooltip(); + return; + } else { + if (this.isAnchorHoveredFocused || this.isRegionHovered) { + this.showTooltip(); + return; + } + this.hideTooltip(); + } + }; + this.showTooltip = () => { + if (this.tooltipVisible) { + return; + } + this.currentDirection = getDirection(this); + this.tooltipVisible = true; + document.addEventListener("keydown", this.handleDocumentKeydown); + DOM.queueUpdate(this.setRegionProps); + }; + this.hideTooltip = () => { + if (!this.tooltipVisible) { + return; + } + this.clearHideDelayTimer(); + if (this.region !== null && this.region !== void 0) { + this.region.removeEventListener("positionchange", this.handlePositionChange); + this.region.viewportElement = null; + this.region.anchorElement = null; + this.region.removeEventListener("mouseover", this.handleRegionMouseOver); + this.region.removeEventListener("mouseout", this.handleRegionMouseOut); + } + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.tooltipVisible = false; + }; + this.setRegionProps = () => { + if (!this.tooltipVisible) { + return; + } + this.region.viewportElement = this.viewportElement; + this.region.anchorElement = this.anchorElement; + this.region.addEventListener("positionchange", this.handlePositionChange); + this.region.addEventListener("mouseover", this.handleRegionMouseOver, { + passive: true + }); + this.region.addEventListener("mouseout", this.handleRegionMouseOut, { + passive: true + }); + }; + } + visibleChanged() { + if (this.$fastController.isConnected) { + this.updateTooltipVisibility(); + this.updateLayout(); + } + } + anchorChanged() { + if (this.$fastController.isConnected) { + this.anchorElement = this.getAnchor(); + } + } + positionChanged() { + if (this.$fastController.isConnected) { + this.updateLayout(); + } + } + anchorElementChanged(oldValue) { + if (this.$fastController.isConnected) { + if (oldValue !== null && oldValue !== void 0) { + oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver); + oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut); + oldValue.removeEventListener("focusin", this.handleAnchorFocusIn); + oldValue.removeEventListener("focusout", this.handleAnchorFocusOut); + } + if (this.anchorElement !== null && this.anchorElement !== void 0) { + this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true }); + this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true }); + this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, { + passive: true + }); + this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true }); + const anchorId = this.anchorElement.id; + if (this.anchorElement.parentElement !== null) { + this.anchorElement.parentElement.querySelectorAll(":hover").forEach((element) => { + if (element.id === anchorId) { + this.startShowDelayTimer(); + } + }); + } + } + if (this.region !== null && this.region !== void 0 && this.tooltipVisible) { + this.region.anchorElement = this.anchorElement; + } + this.updateLayout(); + } + } + viewportElementChanged() { + if (this.region !== null && this.region !== void 0) { + this.region.viewportElement = this.viewportElement; + } + this.updateLayout(); + } + connectedCallback() { + super.connectedCallback(); + this.anchorElement = this.getAnchor(); + this.updateTooltipVisibility(); + } + disconnectedCallback() { + this.hideTooltip(); + this.clearShowDelayTimer(); + this.clearHideDelayTimer(); + super.disconnectedCallback(); + } + /** + * updated the properties being passed to the anchored region + */ + updateLayout() { + this.verticalPositioningMode = "locktodefault"; + this.horizontalPositioningMode = "locktodefault"; + switch (this.position) { + case TooltipPosition.top: + case TooltipPosition.bottom: + this.verticalDefaultPosition = this.position; + this.horizontalDefaultPosition = "center"; + break; + case TooltipPosition.right: + case TooltipPosition.left: + case TooltipPosition.start: + case TooltipPosition.end: + this.verticalDefaultPosition = "center"; + this.horizontalDefaultPosition = this.position; + break; + case TooltipPosition.topLeft: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.topRight: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.bottomLeft: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.bottomRight: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.topStart: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.topEnd: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "end"; + break; + case TooltipPosition.bottomStart: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.bottomEnd: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "end"; + break; + default: + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = "center"; + break; + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tooltip2.prototype, "visible", void 0); + __decorate([ + attr + ], Tooltip2.prototype, "anchor", void 0); + __decorate([ + attr + ], Tooltip2.prototype, "delay", void 0); + __decorate([ + attr + ], Tooltip2.prototype, "position", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], Tooltip2.prototype, "autoUpdateMode", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock" }) + ], Tooltip2.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock" }) + ], Tooltip2.prototype, "verticalViewportLock", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "anchorElement", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "viewportElement", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "verticalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "horizontalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "horizontalInset", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "verticalInset", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "horizontalScaling", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "verticalScaling", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "verticalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "tooltipVisible", void 0); + __decorate([ + observable + ], Tooltip2.prototype, "currentDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js + var init_tooltip2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js"() { + init_tooltip_template(); + init_tooltip(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js + var init_tree_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js + function isTreeItemElement(el2) { + return isHTMLElement(el2) && el2.getAttribute("role") === "treeitem"; + } + var TreeItem; + var init_tree_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TreeItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.expanded = false; + this.focusable = false; + this.isNestedItem = () => { + return isTreeItemElement(this.parentElement); + }; + this.handleExpandCollapseButtonClick = (e) => { + if (!this.disabled && !e.defaultPrevented) { + this.expanded = !this.expanded; + } + }; + this.handleFocus = (e) => { + this.setAttribute("tabindex", "0"); + }; + this.handleBlur = (e) => { + this.setAttribute("tabindex", "-1"); + }; + } + expandedChanged() { + if (this.$fastController.isConnected) { + this.$emit("expanded-change", this); + } + } + selectedChanged() { + if (this.$fastController.isConnected) { + this.$emit("selected-change", this); + } + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.items.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = true; + } + }); + } + } + /** + * Places document focus on a tree item + * + * @public + * @param el - the element to focus + */ + static focusItem(el2) { + el2.focusable = true; + el2.focus(); + } + /** + * Gets number of children + * + * @internal + */ + childItemLength() { + const treeChildren = this.childItems.filter((item) => { + return isTreeItemElement(item); + }); + return treeChildren ? treeChildren.length : 0; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "expanded", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "selected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "disabled", void 0); + __decorate([ + observable + ], TreeItem.prototype, "focusable", void 0); + __decorate([ + observable + ], TreeItem.prototype, "childItems", void 0); + __decorate([ + observable + ], TreeItem.prototype, "items", void 0); + __decorate([ + observable + ], TreeItem.prototype, "nested", void 0); + __decorate([ + observable + ], TreeItem.prototype, "renderCollapsedChildren", void 0); + applyMixins(TreeItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js + var init_tree_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js"() { + init_tree_item_template(); + init_tree_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js + var init_tree_view_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js + var TreeView; + var init_tree_view = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_tree_item(); + init_foundation_element(); + TreeView = class extends FoundationElement { + constructor() { + super(...arguments); + this.currentFocused = null; + this.handleFocus = (e) => { + if (this.slottedTreeItems.length < 1) { + return; + } + if (e.target === this) { + if (this.currentFocused === null) { + this.currentFocused = this.getValidFocusableItem(); + } + if (this.currentFocused !== null) { + TreeItem.focusItem(this.currentFocused); + } + return; + } + if (this.contains(e.target)) { + this.setAttribute("tabindex", "-1"); + this.currentFocused = e.target; + } + }; + this.handleBlur = (e) => { + if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) { + this.setAttribute("tabindex", "0"); + } + }; + this.handleKeyDown = (e) => { + if (e.defaultPrevented) { + return; + } + if (this.slottedTreeItems.length < 1) { + return true; + } + const treeItems = this.getVisibleNodes(); + switch (e.key) { + case keyHome: + if (treeItems.length) { + TreeItem.focusItem(treeItems[0]); + } + return; + case keyEnd: + if (treeItems.length) { + TreeItem.focusItem(treeItems[treeItems.length - 1]); + } + return; + case keyArrowLeft: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) { + item.expanded = false; + } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) { + TreeItem.focusItem(item.parentElement); + } + } + return false; + case keyArrowRight: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) { + item.expanded = true; + } else if (item instanceof TreeItem && item.childItemLength() > 0) { + this.focusNextNode(1, e.target); + } + } + return; + case keyArrowDown: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(1, e.target); + } + return; + case keyArrowUp: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(-1, e.target); + } + return; + case keyEnter: + this.handleClick(e); + return; + } + return true; + }; + this.handleSelectedChange = (e) => { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (item.selected) { + if (this.currentSelected && this.currentSelected !== item) { + this.currentSelected.selected = false; + } + this.currentSelected = item; + } else if (!item.selected && this.currentSelected === item) { + this.currentSelected = null; + } + return; + }; + this.setItems = () => { + const selectedItem = this.treeView.querySelector("[aria-selected='true']"); + this.currentSelected = selectedItem; + if (this.currentFocused === null || !this.contains(this.currentFocused)) { + this.currentFocused = this.getValidFocusableItem(); + } + this.nested = this.checkForNestedItems(); + const treeItems = this.getVisibleNodes(); + treeItems.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = this.nested; + } + }); + }; + this.isFocusableElement = (el2) => { + return isTreeItemElement(el2); + }; + this.isSelectedElement = (el2) => { + return el2.selected; + }; + } + slottedTreeItemsChanged() { + if (this.$fastController.isConnected) { + this.setItems(); + } + } + connectedCallback() { + super.connectedCallback(); + this.setAttribute("tabindex", "0"); + DOM.queueUpdate(() => { + this.setItems(); + }); + } + /** + * Handles click events bubbling up + * + * @internal + */ + handleClick(e) { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (!item.disabled) { + item.selected = !item.selected; + } + return; + } + /** + * Move focus to a tree item based on its offset from the provided item + */ + focusNextNode(delta, item) { + const visibleNodes = this.getVisibleNodes(); + if (!visibleNodes) { + return; + } + const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta]; + if (isHTMLElement(focusItem)) { + TreeItem.focusItem(focusItem); + } + } + /** + * checks if there are any nested tree items + */ + getValidFocusableItem() { + const treeItems = this.getVisibleNodes(); + let focusIndex = treeItems.findIndex(this.isSelectedElement); + if (focusIndex === -1) { + focusIndex = treeItems.findIndex(this.isFocusableElement); + } + if (focusIndex !== -1) { + return treeItems[focusIndex]; + } + return null; + } + /** + * checks if there are any nested tree items + */ + checkForNestedItems() { + return this.slottedTreeItems.some((node) => { + return isTreeItemElement(node) && node.querySelector("[role='treeitem']"); + }); + } + getVisibleNodes() { + return getDisplayedNodes(this, "[role='treeitem']") || []; + } + }; + __decorate([ + attr({ attribute: "render-collapsed-nodes" }) + ], TreeView.prototype, "renderCollapsedNodes", void 0); + __decorate([ + observable + ], TreeView.prototype, "currentSelected", void 0); + __decorate([ + observable + ], TreeView.prototype, "slottedTreeItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js + var init_tree_view2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js"() { + init_tree_view_template(); + init_tree_view(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js + var MatchMediaBehavior, MatchMediaStyleSheetBehavior, forcedColorsStylesheetBehavior, darkModeStylesheetBehavior, lightModeStylesheetBehavior; + var init_match_media_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js"() { + MatchMediaBehavior = class { + /** + * + * @param query - The media query to operate from. + */ + constructor(query) { + this.listenerCache = /* @__PURE__ */ new WeakMap(); + this.query = query; + } + /** + * Binds the behavior to the element. + * @param source - The element for which the behavior is bound. + */ + bind(source) { + const { query } = this; + const listener = this.constructListener(source); + listener.bind(query)(); + query.addListener(listener); + this.listenerCache.set(source, listener); + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + */ + unbind(source) { + const listener = this.listenerCache.get(source); + if (listener) { + this.query.removeListener(listener); + this.listenerCache.delete(source); + } + } + }; + MatchMediaStyleSheetBehavior = class _MatchMediaStyleSheetBehavior extends MatchMediaBehavior { + /** + * Constructs a {@link MatchMediaStyleSheetBehavior} instance. + * @param query - The media query to operate from. + * @param styles - The styles to coordinate with the query. + */ + constructor(query, styles) { + super(query); + this.styles = styles; + } + /** + * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for + * a provided query. + * @param query - The media query to operate from. + * + * @public + * @example + * + * ```ts + * import { css } from "@microsoft/fast-element"; + * import { MatchMediaStyleSheetBehavior } from "@microsoft/fast-foundation"; + * + * const landscapeBehavior = MatchMediaStyleSheetBehavior.with( + * window.matchMedia("(orientation: landscape)") + * ); + * const styles = css` + * :host { + * width: 200px; + * height: 400px; + * } + * ` + * .withBehaviors(landscapeBehavior(css` + * :host { + * width: 400px; + * height: 200px; + * } + * `)) + * ``` + */ + static with(query) { + return (styles) => { + return new _MatchMediaStyleSheetBehavior(query, styles); + }; + } + /** + * Constructs a match-media listener for a provided element. + * @param source - the element for which to attach or detach styles. + * @internal + */ + constructListener(source) { + let attached = false; + const styles = this.styles; + return function listener() { + const { matches: matches2 } = this; + if (matches2 && !attached) { + source.$fastController.addStyles(styles); + attached = matches2; + } else if (!matches2 && attached) { + source.$fastController.removeStyles(styles); + attached = matches2; + } + }; + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + * @internal + */ + unbind(source) { + super.unbind(source); + source.$fastController.removeStyles(this.styles); + } + }; + forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)")); + darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)")); + lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)")); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js + var init_property_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js + var disabledCursor; + var init_disabled = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js"() { + disabledCursor = "not-allowed"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js + function display(displayValue) { + return `${hidden}:host{display:${displayValue}}`; + } + var hidden; + var init_display = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js"() { + hidden = `:host([hidden]){display:none}`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js + var focusVisible; + var init_focus = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js"() { + init_dist2(); + focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js + var init_style = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js"() { + init_disabled(); + init_display(); + init_focus(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js + var init_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js"() { + init_apply_mixins(); + init_composed_parent(); + init_match_media_stylesheet_behavior(); + init_property_stylesheet_behavior(); + init_style(); + init_direction(); + init_whitespace_filter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/index.js + var init_esm2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/index.js"() { + init_accordion_item2(); + init_accordion2(); + init_anchor2(); + init_anchored_region2(); + init_avatar2(); + init_badge2(); + init_breadcrumb_item2(); + init_breadcrumb2(); + init_button2(); + init_calendar2(); + init_card2(); + init_checkbox2(); + init_combobox2(); + init_data_grid2(); + init_design_system2(); + init_design_token(); + init_di2(); + init_dialog2(); + init_disclosure2(); + init_divider2(); + init_flipper2(); + init_form_associated2(); + init_foundation_element2(); + init_listbox_option2(); + init_listbox2(); + init_picker2(); + init_menu_item2(); + init_menu2(); + init_number_field2(); + init_patterns(); + init_progress_ring(); + init_progress(); + init_radio_group2(); + init_radio2(); + init_horizontal_scroll2(); + init_search2(); + init_select2(); + init_skeleton2(); + init_slider_label2(); + init_slider2(); + init_switch2(); + init_tab_panel2(); + init_tab2(); + init_tabs2(); + init_text_area2(); + init_text_field2(); + init_toolbar2(); + init_tooltip2(); + init_tree_item2(); + init_tree_view2(); + init_utilities(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js + function provideVSCodeDesignSystem(element) { + return DesignSystem.getOrCreate(element).withPrefix("vscode"); + } + var init_vscode_design_system = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js"() { + init_esm2(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js + function initThemeChangeListener(tokenMappings2) { + window.addEventListener("load", () => { + const observer = new MutationObserver(() => { + applyCurrentTheme(tokenMappings2); + }); + observer.observe(document.body, { + attributes: true, + attributeFilter: ["class"] + }); + applyCurrentTheme(tokenMappings2); + }); + } + function applyCurrentTheme(tokenMappings2) { + const styles = getComputedStyle(document.body); + const body = document.querySelector("body"); + if (body) { + const themeKind = body.getAttribute("data-vscode-theme-kind"); + for (const [vscodeTokenName, toolkitToken] of tokenMappings2) { + let value = styles.getPropertyValue(vscodeTokenName).toString(); + if (themeKind === "vscode-high-contrast") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + value = "transparent"; + } + if (toolkitToken.name === "button-icon-hover-background") { + value = "transparent"; + } + } else if (themeKind === "vscode-high-contrast-light") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + switch (toolkitToken.name) { + case "button-primary-hover-background": + value = "#0F4A85"; + break; + case "button-secondary-hover-background": + value = "transparent"; + break; + case "button-icon-hover-background": + value = "transparent"; + break; + } + } + } else { + if (toolkitToken.name === "contrast-active-border") { + value = "transparent"; + } + } + toolkitToken.setValueFor(body, value); + } + } + } + var init_applyTheme = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js + function create2(name, vscodeThemeVar) { + const designToken = DesignToken.create(name); + if (vscodeThemeVar) { + if (vscodeThemeVar.includes("--fake-vscode-token")) { + const uniqueId2 = "id" + Math.random().toString(16).slice(2); + vscodeThemeVar = `${vscodeThemeVar}-${uniqueId2}`; + } + tokenMappings.set(vscodeThemeVar, designToken); + } + if (!isThemeListenerInitialized) { + initThemeChangeListener(tokenMappings); + isThemeListenerInitialized = true; + } + return designToken; + } + var tokenMappings, isThemeListenerInitialized; + var init_create = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js"() { + init_esm2(); + init_applyTheme(); + tokenMappings = /* @__PURE__ */ new Map(); + isThemeListenerInitialized = false; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js + var background, borderWidth, contrastActiveBorder, contrastBorder, cornerRadius, cornerRadiusRound, designUnit, disabledOpacity, focusBorder, fontFamily, fontWeight, foreground, inputHeight, inputMinWidth, typeRampBaseFontSize, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1LineHeight, scrollbarWidth, scrollbarHeight, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, badgeBackground, badgeForeground, buttonBorder, buttonIconBackground, buttonIconCornerRadius, buttonIconFocusBorderOffset, buttonIconHoverBackground, buttonIconPadding, buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonPaddingHorizontal, buttonPaddingVertical, checkboxBackground, checkboxBorder, checkboxCornerRadius, checkboxForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, dividerBackground, dropdownBackground, dropdownBorder, dropdownForeground, dropdownListMaxHeight, inputBackground, inputForeground, inputPlaceholderForeground, linkActiveForeground, linkForeground, progressBackground, panelTabActiveBorder, panelTabActiveForeground, panelTabForeground, panelViewBackground, panelViewBorder, tagCornerRadius; + var init_design_tokens = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js"() { + init_create(); + background = create2("background", "--vscode-editor-background").withDefault("#1e1e1e"); + borderWidth = create2("border-width").withDefault(1); + contrastActiveBorder = create2("contrast-active-border", "--vscode-contrastActiveBorder").withDefault("#f38518"); + contrastBorder = create2("contrast-border", "--vscode-contrastBorder").withDefault("#6fc3df"); + cornerRadius = create2("corner-radius").withDefault(0); + cornerRadiusRound = create2("corner-radius-round").withDefault(2); + designUnit = create2("design-unit").withDefault(4); + disabledOpacity = create2("disabled-opacity").withDefault(0.4); + focusBorder = create2("focus-border", "--vscode-focusBorder").withDefault("#007fd4"); + fontFamily = create2("font-family", "--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"); + fontWeight = create2("font-weight", "--vscode-font-weight").withDefault("400"); + foreground = create2("foreground", "--vscode-foreground").withDefault("#cccccc"); + inputHeight = create2("input-height").withDefault("26"); + inputMinWidth = create2("input-min-width").withDefault("100px"); + typeRampBaseFontSize = create2("type-ramp-base-font-size", "--vscode-font-size").withDefault("13px"); + typeRampBaseLineHeight = create2("type-ramp-base-line-height").withDefault("normal"); + typeRampMinus1FontSize = create2("type-ramp-minus1-font-size").withDefault("11px"); + typeRampMinus1LineHeight = create2("type-ramp-minus1-line-height").withDefault("16px"); + typeRampMinus2FontSize = create2("type-ramp-minus2-font-size").withDefault("9px"); + typeRampMinus2LineHeight = create2("type-ramp-minus2-line-height").withDefault("16px"); + typeRampPlus1FontSize = create2("type-ramp-plus1-font-size").withDefault("16px"); + typeRampPlus1LineHeight = create2("type-ramp-plus1-line-height").withDefault("24px"); + scrollbarWidth = create2("scrollbarWidth").withDefault("10px"); + scrollbarHeight = create2("scrollbarHeight").withDefault("10px"); + scrollbarSliderBackground = create2("scrollbar-slider-background", "--vscode-scrollbarSlider-background").withDefault("#79797966"); + scrollbarSliderHoverBackground = create2("scrollbar-slider-hover-background", "--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"); + scrollbarSliderActiveBackground = create2("scrollbar-slider-active-background", "--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"); + badgeBackground = create2("badge-background", "--vscode-badge-background").withDefault("#4d4d4d"); + badgeForeground = create2("badge-foreground", "--vscode-badge-foreground").withDefault("#ffffff"); + buttonBorder = create2("button-border", "--vscode-button-border").withDefault("transparent"); + buttonIconBackground = create2("button-icon-background").withDefault("transparent"); + buttonIconCornerRadius = create2("button-icon-corner-radius").withDefault("5px"); + buttonIconFocusBorderOffset = create2("button-icon-outline-offset").withDefault(0); + buttonIconHoverBackground = create2("button-icon-hover-background", "--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"); + buttonIconPadding = create2("button-icon-padding").withDefault("3px"); + buttonPrimaryBackground = create2("button-primary-background", "--vscode-button-background").withDefault("#0e639c"); + buttonPrimaryForeground = create2("button-primary-foreground", "--vscode-button-foreground").withDefault("#ffffff"); + buttonPrimaryHoverBackground = create2("button-primary-hover-background", "--vscode-button-hoverBackground").withDefault("#1177bb"); + buttonSecondaryBackground = create2("button-secondary-background", "--vscode-button-secondaryBackground").withDefault("#3a3d41"); + buttonSecondaryForeground = create2("button-secondary-foreground", "--vscode-button-secondaryForeground").withDefault("#ffffff"); + buttonSecondaryHoverBackground = create2("button-secondary-hover-background", "--vscode-button-secondaryHoverBackground").withDefault("#45494e"); + buttonPaddingHorizontal = create2("button-padding-horizontal").withDefault("11px"); + buttonPaddingVertical = create2("button-padding-vertical").withDefault("4px"); + checkboxBackground = create2("checkbox-background", "--vscode-checkbox-background").withDefault("#3c3c3c"); + checkboxBorder = create2("checkbox-border", "--vscode-checkbox-border").withDefault("#3c3c3c"); + checkboxCornerRadius = create2("checkbox-corner-radius").withDefault(3); + checkboxForeground = create2("checkbox-foreground", "--vscode-checkbox-foreground").withDefault("#f0f0f0"); + listActiveSelectionBackground = create2("list-active-selection-background", "--vscode-list-activeSelectionBackground").withDefault("#094771"); + listActiveSelectionForeground = create2("list-active-selection-foreground", "--vscode-list-activeSelectionForeground").withDefault("#ffffff"); + listHoverBackground = create2("list-hover-background", "--vscode-list-hoverBackground").withDefault("#2a2d2e"); + dividerBackground = create2("divider-background", "--vscode-settings-dropdownListBorder").withDefault("#454545"); + dropdownBackground = create2("dropdown-background", "--vscode-dropdown-background").withDefault("#3c3c3c"); + dropdownBorder = create2("dropdown-border", "--vscode-dropdown-border").withDefault("#3c3c3c"); + dropdownForeground = create2("dropdown-foreground", "--vscode-dropdown-foreground").withDefault("#f0f0f0"); + dropdownListMaxHeight = create2("dropdown-list-max-height").withDefault("200px"); + inputBackground = create2("input-background", "--vscode-input-background").withDefault("#3c3c3c"); + inputForeground = create2("input-foreground", "--vscode-input-foreground").withDefault("#cccccc"); + inputPlaceholderForeground = create2("input-placeholder-foreground", "--vscode-input-placeholderForeground").withDefault("#cccccc"); + linkActiveForeground = create2("link-active-foreground", "--vscode-textLink-activeForeground").withDefault("#3794ff"); + linkForeground = create2("link-foreground", "--vscode-textLink-foreground").withDefault("#3794ff"); + progressBackground = create2("progress-background", "--vscode-progressBar-background").withDefault("#0e70c0"); + panelTabActiveBorder = create2("panel-tab-active-border", "--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"); + panelTabActiveForeground = create2("panel-tab-active-foreground", "--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"); + panelTabForeground = create2("panel-tab-foreground", "--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"); + panelViewBackground = create2("panel-view-background", "--vscode-panel-background").withDefault("#1e1e1e"); + panelViewBorder = create2("panel-view-border", "--vscode-panel-border").withDefault("#80808059"); + tagCornerRadius = create2("tag-corner-radius").withDefault("2px"); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js + var badgeStyles; + var init_badge_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + badgeStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + text-align: center; + } + .control { + align-items: center; + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: 11px; + box-sizing: border-box; + color: ${badgeForeground}; + display: flex; + height: calc(${designUnit} * 4px); + justify-content: center; + min-width: calc(${designUnit} * 4px + 2px); + min-height: calc(${designUnit} * 4px + 2px); + padding: 3px 6px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js + var Badge2, vsCodeBadge; + var init_badge3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js"() { + init_esm2(); + init_badge_styles(); + Badge2 = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.circular) { + this.circular = true; + } + } + }; + vsCodeBadge = Badge2.compose({ + baseName: "badge", + template: badgeTemplate, + styles: badgeStyles + }); + } + }); + + // node_modules/tslib/tslib.es6.mjs + function __decorate2(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es62 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js + var BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles, buttonStyles; + var init_button_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + BaseButtonStyles = css` + ${display("inline-flex")} :host { + outline: none; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${buttonPrimaryForeground}; + background: ${buttonPrimaryBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + fill: currentColor; + cursor: pointer; + } + .control { + background: transparent; + height: inherit; + flex-grow: 1; + box-sizing: border-box; + display: inline-flex; + justify-content: center; + align-items: center; + padding: ${buttonPaddingVertical} ${buttonPaddingHorizontal}; + white-space: wrap; + outline: none; + text-decoration: none; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + color: inherit; + border-radius: inherit; + fill: inherit; + cursor: inherit; + font-family: inherit; + } + :host(:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host(:active) { + background: ${buttonPrimaryBackground}; + } + .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + .control::-moz-focus-inner { + border: 0; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + background: ${buttonPrimaryBackground}; + cursor: ${disabledCursor}; + } + .content { + display: flex; + } + .start { + display: flex; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-end: 8px; + } +`; + PrimaryButtonStyles = css` + :host([appearance='primary']) { + background: ${buttonPrimaryBackground}; + color: ${buttonPrimaryForeground}; + } + :host([appearance='primary']:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host([appearance='primary']:active) .control:active { + background: ${buttonPrimaryBackground}; + } + :host([appearance='primary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='primary'][disabled]) { + background: ${buttonPrimaryBackground}; + } +`; + SecondaryButtonStyles = css` + :host([appearance='secondary']) { + background: ${buttonSecondaryBackground}; + color: ${buttonSecondaryForeground}; + } + :host([appearance='secondary']:hover) { + background: ${buttonSecondaryHoverBackground}; + } + :host([appearance='secondary']:active) .control:active { + background: ${buttonSecondaryBackground}; + } + :host([appearance='secondary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='secondary'][disabled]) { + background: ${buttonSecondaryBackground}; + } +`; + IconButtonStyles = css` + :host([appearance='icon']) { + background: ${buttonIconBackground}; + border-radius: ${buttonIconCornerRadius}; + color: ${foreground}; + } + :host([appearance='icon']:hover) { + background: ${buttonIconHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } + :host([appearance='icon']) .control { + padding: ${buttonIconPadding}; + border: none; + } + :host([appearance='icon']:active) .control:active { + background: ${buttonIconHoverBackground}; + } + :host([appearance='icon']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: ${buttonIconFocusBorderOffset}; + } + :host([appearance='icon'][disabled]) { + background: ${buttonIconBackground}; + } +`; + buttonStyles = (context, definition) => css` + ${BaseButtonStyles} + ${PrimaryButtonStyles} + ${SecondaryButtonStyles} + ${IconButtonStyles} +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/index.js + var Button2, vsCodeButton; + var init_button3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/index.js"() { + init_tslib_es62(); + init_esm(); + init_esm2(); + init_button_styles(); + Button2 = class extends Button { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.appearance) { + const appearanceValue = this.getAttribute("appearance"); + this.appearance = appearanceValue; + } + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "appearance" && newVal === "icon") { + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.ariaLabel = "Icon Button"; + } + } + if (attrName === "aria-label") { + this.ariaLabel = newVal; + } + if (attrName === "disabled") { + this.disabled = newVal !== null; + } + } + }; + __decorate2([ + attr + ], Button2.prototype, "appearance", void 0); + vsCodeButton = Button2.compose({ + baseName: "button", + template: buttonTemplate, + styles: buttonStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js + var checkboxStyles; + var init_checkbox_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + checkboxStyles = (context, defintiion) => css` + ${display("inline-flex")} :host { + align-items: center; + outline: none; + margin: calc(${designUnit} * 1px) 0; + user-select: none; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control { + position: relative; + width: calc(${designUnit} * 4px + 2px); + height: calc(${designUnit} * 4px + 2px); + box-sizing: border-box; + border-radius: calc(${checkboxCornerRadius} * 1px); + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + background: ${checkboxBackground}; + outline: none; + cursor: pointer; + } + .label { + font-family: ${fontFamily}; + color: ${foreground}; + padding-inline-start: calc(${designUnit} * 2px + 2px); + margin-inline-end: calc(${designUnit} * 2px + 2px); + cursor: pointer; + } + .label__hidden { + display: none; + visibility: hidden; + } + .checked-indicator { + width: 100%; + height: 100%; + display: block; + fill: ${foreground}; + opacity: 0; + pointer-events: none; + } + .indeterminate-indicator { + border-radius: 2px; + background: ${foreground}; + position: absolute; + top: 50%; + left: 50%; + width: 50%; + height: 50%; + transform: translate(-50%, -50%); + opacity: 0; + } + :host(:enabled) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:enabled) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host(.disabled) .label, + :host(.readonly) .label, + :host(.readonly) .control, + :host(.disabled) .control { + cursor: ${disabledCursor}; + } + :host(.checked:not(.indeterminate)) .checked-indicator, + :host(.indeterminate) .indeterminate-indicator { + opacity: 1; + } + :host(.disabled) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js + var Checkbox2, vsCodeCheckbox; + var init_checkbox3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js"() { + init_esm2(); + init_checkbox_styles(); + Checkbox2 = class extends Checkbox { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Checkbox"); + } + } + }; + vsCodeCheckbox = Checkbox2.compose({ + baseName: "checkbox", + template: checkboxTemplate, + styles: checkboxStyles, + checkedIndicator: ` + + + + `, + indeterminateIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js + var dataGridStyles; + var init_data_grid_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js"() { + init_esm(); + dataGridStyles = (context, definition) => css` + :host { + display: flex; + position: relative; + flex-direction: column; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js + var dataGridRowStyles; + var init_data_grid_row_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js"() { + init_esm(); + init_design_tokens(); + dataGridRowStyles = (context, definition) => css` + :host { + display: grid; + padding: calc((${designUnit} / 4) * 1px) 0; + box-sizing: border-box; + width: 100%; + background: transparent; + } + :host(.header) { + } + :host(.sticky-header) { + background: ${background}; + position: sticky; + top: 0; + } + :host(:hover) { + background: ${listHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js + var dataGridCellStyles; + var init_data_grid_cell_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dataGridCellStyles = (context, definition) => css` + :host { + padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px); + color: ${foreground}; + opacity: 1; + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + font-weight: 400; + border: solid calc(${borderWidth} * 1px) transparent; + border-radius: calc(${cornerRadius} * 1px); + white-space: wrap; + overflow-wrap: anywhere; + } + :host(.column-header) { + font-weight: 600; + } + :host(:${focusVisible}), + :host(:focus), + :host(:active) { + background: ${listActiveSelectionBackground}; + border: solid calc(${borderWidth} * 1px) ${focusBorder}; + color: ${listActiveSelectionForeground}; + outline: none; + } + :host(:${focusVisible}) ::slotted(*), + :host(:focus) ::slotted(*), + :host(:active) ::slotted(*) { + color: ${listActiveSelectionForeground} !important; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js + var DataGrid2, vsCodeDataGrid, DataGridRow2, vsCodeDataGridRow, DataGridCell2, vsCodeDataGridCell; + var init_data_grid3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js"() { + init_esm2(); + init_data_grid_styles(); + init_data_grid_row_styles(); + init_data_grid_cell_styles(); + DataGrid2 = class extends DataGrid { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Data Grid"); + } + } + }; + vsCodeDataGrid = DataGrid2.compose({ + baseName: "data-grid", + baseClass: DataGrid, + template: dataGridTemplate, + styles: dataGridStyles + }); + DataGridRow2 = class extends DataGridRow { + }; + vsCodeDataGridRow = DataGridRow2.compose({ + baseName: "data-grid-row", + baseClass: DataGridRow, + template: dataGridRowTemplate, + styles: dataGridRowStyles + }); + DataGridCell2 = class extends DataGridCell { + }; + vsCodeDataGridCell = DataGridCell2.compose({ + baseName: "data-grid-cell", + baseClass: DataGridCell, + template: dataGridCellTemplate, + styles: dataGridCellStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js + var dividerStyles; + var init_divider_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dividerStyles = (context, definition) => css` + ${display("block")} :host { + border: none; + border-top: calc(${borderWidth} * 1px) solid ${dividerBackground}; + box-sizing: content-box; + height: 0; + margin: calc(${designUnit} * 1px) 0; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js + var Divider2, vsCodeDivider; + var init_divider3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js"() { + init_esm2(); + init_divider_styles(); + Divider2 = class extends Divider { + }; + vsCodeDivider = Divider2.compose({ + baseName: "divider", + template: dividerTemplate, + styles: dividerStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js + var dropdownStyles; + var init_dropdown_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dropdownStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: ${dropdownBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + color: ${foreground}; + contain: contents; + font-family: ${fontFamily}; + height: calc(${inputHeight} * 1px); + position: relative; + user-select: none; + min-width: ${inputMinWidth}; + outline: none; + vertical-align: top; + } + .control { + align-items: center; + box-sizing: border-box; + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + cursor: pointer; + display: flex; + font-family: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + min-height: 100%; + padding: 2px 6px 2px 8px; + width: 100%; + } + .listbox { + background: ${dropdownBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + display: inline-flex; + flex-direction: column; + left: 0; + max-height: ${dropdownListMaxHeight}; + padding: 0; + overflow-y: auto; + position: absolute; + width: 100%; + z-index: 1; + } + .listbox[hidden] { + display: none; + } + :host(:${focusVisible}) .control { + border-color: ${focusBorder}; + } + :host(:not([disabled]):hover) { + background: ${dropdownBackground}; + border-color: ${dropdownBorder}; + } + :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + cursor: ${disabledCursor}; + user-select: none; + } + :host([disabled]:hover) { + background: ${dropdownBackground}; + color: ${foreground}; + fill: currentcolor; + } + :host(:not([disabled])) .control:active { + border-color: ${focusBorder}; + } + :host(:empty) .listbox { + display: none; + } + :host([open]) .control { + border-color: ${focusBorder}; + } + :host([open][position='above']) .listbox { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + :host([open][position='below']) .listbox { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + :host([open][position='above']) .listbox { + bottom: calc(${inputHeight} * 1px); + } + :host([open][position='below']) .listbox { + top: calc(${inputHeight} * 1px); + } + .selected-value { + flex: 1 1 auto; + font-family: inherit; + overflow: hidden; + text-align: start; + text-overflow: ellipsis; + white-space: nowrap; + } + .indicator { + flex: 0 0 auto; + margin-inline-start: 1em; + } + slot[name='listbox'] { + display: none; + width: 100%; + } + :host([open]) slot[name='listbox'] { + display: flex; + position: absolute; + } + .end { + margin-inline-start: auto; + } + .start, + .end, + .indicator, + .select-indicator, + ::slotted(svg), + ::slotted(span) { + fill: currentcolor; + height: 1em; + min-height: calc(${designUnit} * 4px); + min-width: calc(${designUnit} * 4px); + width: 1em; + } + ::slotted([role='option']), + ::slotted(option) { + flex: 0 0 auto; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js + var Dropdown, vsCodeDropdown; + var init_dropdown = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js"() { + init_esm2(); + init_dropdown_styles(); + Dropdown = class extends Select { + }; + vsCodeDropdown = Dropdown.compose({ + baseName: "dropdown", + template: selectTemplate, + styles: dropdownStyles, + indicator: ` + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js + var linkStyles; + var init_link_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + linkStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: transparent; + box-sizing: border-box; + color: ${linkForeground}; + cursor: pointer; + fill: currentcolor; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + outline: none; + } + .control { + background: transparent; + border: calc(${borderWidth} * 1px) solid transparent; + border-radius: calc(${cornerRadius} * 1px); + box-sizing: border-box; + color: inherit; + cursor: inherit; + fill: inherit; + font-family: inherit; + height: inherit; + padding: 0; + outline: none; + text-decoration: none; + word-break: break-word; + } + .control::-moz-focus-inner { + border: 0; + } + :host(:hover) { + color: ${linkActiveForeground}; + } + :host(:hover) .content { + text-decoration: underline; + } + :host(:active) { + background: transparent; + color: ${linkActiveForeground}; + } + :host(:${focusVisible}) .control, + :host(:focus) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/index.js + var Link, vsCodeLink; + var init_link = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/index.js"() { + init_esm2(); + init_link_styles(); + Link = class extends Anchor { + }; + vsCodeLink = Link.compose({ + baseName: "link", + template: anchorTemplate, + styles: linkStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js + var optionStyles; + var init_option_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + optionStyles = (context, definition) => css` + ${display("inline-flex")} :host { + font-family: var(--body-font); + border-radius: ${cornerRadius}; + border: calc(${borderWidth} * 1px) solid transparent; + box-sizing: border-box; + color: ${foreground}; + cursor: pointer; + fill: currentcolor; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: 0; + outline: none; + overflow: hidden; + padding: 0 calc((${designUnit} / 2) * 1px) + calc((${designUnit} / 4) * 1px); + user-select: none; + white-space: nowrap; + } + :host(:${focusVisible}) { + border-color: ${focusBorder}; + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([aria-selected='true']) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:active) { + background: ${listActiveSelectionBackground}; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):hover) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):active) { + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]:hover) { + background-color: inherit; + } + .content { + grid-column-start: 2; + justify-self: start; + overflow: hidden; + text-overflow: ellipsis; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/index.js + var Option2, vsCodeOption; + var init_option = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/index.js"() { + init_esm2(); + init_option_styles(); + Option2 = class extends ListboxOption { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Option"); + } + } + }; + vsCodeOption = Option2.compose({ + baseName: "option", + template: listboxOptionTemplate, + styles: optionStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js + var panelsStyles; + var init_panels_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelsStyles = (context, definition) => css` + ${display("grid")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${foreground}; + grid-template-columns: auto 1fr auto; + grid-template-rows: auto 1fr; + overflow-x: auto; + } + .tablist { + display: grid; + grid-template-rows: auto auto; + grid-template-columns: auto; + column-gap: calc(${designUnit} * 8px); + position: relative; + width: max-content; + align-self: end; + padding: calc(${designUnit} * 1px) calc(${designUnit} * 1px) 0; + box-sizing: border-box; + } + .start, + .end { + align-self: center; + } + .activeIndicator { + grid-row: 2; + grid-column: 1; + width: 100%; + height: calc((${designUnit} / 4) * 1px); + justify-self: center; + background: ${panelTabActiveForeground}; + margin: 0; + border-radius: calc(${cornerRadius} * 1px); + } + .activeIndicatorTransition { + transition: transform 0.01s linear; + } + .tabpanel { + grid-row: 2; + grid-column-start: 1; + grid-column-end: 4; + position: relative; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js + var panelTabStyles; + var init_panel_tab_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelTabStyles = (context, definition) => css` + ${display("inline-flex")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + height: calc(${designUnit} * 7px); + padding: calc(${designUnit} * 1px) 0; + color: ${panelTabForeground}; + fill: currentcolor; + border-radius: calc(${cornerRadius} * 1px); + border: solid calc(${borderWidth} * 1px) transparent; + align-items: center; + justify-content: center; + grid-row: 1; + cursor: pointer; + } + :host(:hover) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:active) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:hover) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:active) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:${focusVisible}) { + outline: none; + border: solid calc(${borderWidth} * 1px) ${panelTabActiveBorder}; + } + :host(:focus) { + outline: none; + } + ::slotted(vscode-badge) { + margin-inline-start: calc(${designUnit} * 2px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js + var panelViewStyles; + var init_panel_view_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelViewStyles = (context, definition) => css` + ${display("flex")} :host { + color: inherit; + background-color: transparent; + border: solid calc(${borderWidth} * 1px) transparent; + box-sizing: border-box; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: 10px calc((${designUnit} + 2) * 1px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js + var Panels, vsCodePanels, PanelTab, vsCodePanelTab, PanelView, vsCodePanelView; + var init_panels = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js"() { + init_esm2(); + init_panels_styles(); + init_panel_tab_styles(); + init_panel_view_styles(); + Panels = class extends Tabs { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.orientation) { + this.orientation = TabsOrientation.horizontal; + } + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Panels"); + } + } + }; + vsCodePanels = Panels.compose({ + baseName: "panels", + template: tabsTemplate, + styles: panelsStyles + }); + PanelTab = class extends Tab { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.disabled) { + this.disabled = false; + } + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } + } + }; + vsCodePanelTab = PanelTab.compose({ + baseName: "panel-tab", + template: tabTemplate, + styles: panelTabStyles + }); + PanelView = class extends TabPanel { + }; + vsCodePanelView = PanelView.compose({ + baseName: "panel-view", + template: tabPanelTemplate, + styles: panelViewStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js + var progressRingStyles; + var init_progress_ring_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + progressRingStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: center; + outline: none; + height: calc(${designUnit} * 7px); + width: calc(${designUnit} * 7px); + margin: 0; + } + .progress { + height: 100%; + width: 100%; + } + .background { + fill: none; + stroke: transparent; + stroke-width: calc(${designUnit} / 2 * 1px); + } + .indeterminate-indicator-1 { + fill: none; + stroke: ${progressBackground}; + stroke-width: calc(${designUnit} / 2 * 1px); + stroke-linecap: square; + transform-origin: 50% 50%; + transform: rotate(-90deg); + transition: all 0.2s ease-in-out; + animation: spin-infinite 2s linear infinite; + } + @keyframes spin-infinite { + 0% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(0deg); + } + 50% { + stroke-dasharray: 21.99px 21.99px; + transform: rotate(450deg); + } + 100% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(1080deg); + } + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js + var ProgressRing, vsCodeProgressRing; + var init_progress_ring2 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js"() { + init_esm2(); + init_progress_ring_styles(); + ProgressRing = class extends BaseProgress { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.paused) { + this.paused = false; + } + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-live", "assertive"); + this.setAttribute("role", "alert"); + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "value") { + this.removeAttribute("value"); + } + } + }; + vsCodeProgressRing = ProgressRing.compose({ + baseName: "progress-ring", + template: progressRingTemplate, + styles: progressRingStyles, + indeterminateIndicator: ` + + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js + var radioGroupStyles; + var init_radio_group_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioGroupStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: flex-start; + margin: calc(${designUnit} * 1px) 0; + flex-direction: column; + } + .positioning-region { + display: flex; + flex-wrap: wrap; + } + :host([orientation='vertical']) .positioning-region { + flex-direction: column; + } + :host([orientation='horizontal']) .positioning-region { + flex-direction: row; + } + ::slotted([slot='label']) { + color: ${foreground}; + font-size: ${typeRampBaseFontSize}; + margin: calc(${designUnit} * 1px) 0; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js + var RadioGroup2, vsCodeRadioGroup; + var init_radio_group3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js"() { + init_dist2(); + init_esm2(); + init_radio_group_styles(); + RadioGroup2 = class extends RadioGroup { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const label = this.querySelector("label"); + if (label) { + const id = "radio-group-" + Math.random().toString(16).slice(2); + label.setAttribute("id", id); + this.setAttribute("aria-labelledby", id); + } + } + }; + vsCodeRadioGroup = RadioGroup2.compose({ + baseName: "radio-group", + template: radioGroupTemplate, + styles: radioGroupStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js + var radioStyles; + var init_radio_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioStyles = (context, definition) => css` + ${display("inline-flex")} :host { + align-items: center; + flex-direction: row; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: calc(${designUnit} * 1px) 0; + outline: none; + position: relative; + transition: all 0.2s ease-in-out; + user-select: none; + } + .control { + background: ${checkboxBackground}; + border-radius: 999px; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + box-sizing: border-box; + cursor: pointer; + height: calc(${designUnit} * 4px); + position: relative; + outline: none; + width: calc(${designUnit} * 4px); + } + .label { + color: ${foreground}; + cursor: pointer; + font-family: ${fontFamily}; + margin-inline-end: calc(${designUnit} * 2px + 2px); + padding-inline-start: calc(${designUnit} * 2px + 2px); + } + .label__hidden { + display: none; + visibility: hidden; + } + .control, + .checked-indicator { + flex-shrink: 0; + } + .checked-indicator { + background: ${foreground}; + border-radius: 999px; + display: inline-block; + inset: calc(${designUnit} * 1px); + opacity: 0; + pointer-events: none; + position: absolute; + } + :host(:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:not([disabled])) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked='true']) .control { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:active { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked="true"]:${focusVisible}:not([disabled])) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([aria-checked='true']) .checked-indicator { + opacity: 1; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js + var Radio2, vsCodeRadio; + var init_radio3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js"() { + init_esm2(); + init_radio_styles(); + Radio2 = class extends Radio { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Radio"); + } + } + }; + vsCodeRadio = Radio2.compose({ + baseName: "radio", + template: radioTemplate, + styles: radioStyles, + checkedIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js + var tagStyles; + var init_tag_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + tagStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + } + .control { + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: ${tagCornerRadius}; + color: ${badgeForeground}; + padding: calc(${designUnit} * 0.5px) calc(${designUnit} * 1px); + text-transform: uppercase; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js + var Tag, vsCodeTag; + var init_tag = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js"() { + init_esm2(); + init_tag_styles(); + Tag = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.circular) { + this.circular = false; + } + } + }; + vsCodeTag = Tag.compose({ + baseName: "tag", + template: badgeTemplate, + styles: tagStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js + var textAreaStyles; + var init_text_area_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textAreaStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .control { + box-sizing: border-box; + position: relative; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + font: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: calc(${designUnit} * 2px + 1px); + width: 100%; + min-width: ${inputMinWidth}; + resize: none; + } + .control:hover:enabled { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + .control:active:enabled { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .control::-webkit-scrollbar { + width: ${scrollbarWidth}; + height: ${scrollbarHeight}; + } + .control::-webkit-scrollbar-corner { + background: ${inputBackground}; + } + .control::-webkit-scrollbar-thumb { + background: ${scrollbarSliderBackground}; + } + .control::-webkit-scrollbar-thumb:hover { + background: ${scrollbarSliderHoverBackground}; + } + .control::-webkit-scrollbar-thumb:active { + background: ${scrollbarSliderActiveBackground}; + } + :host(:focus-within:not([disabled])) .control { + border-color: ${focusBorder}; + } + :host([resize='both']) .control { + resize: both; + } + :host([resize='horizontal']) .control { + resize: horizontal; + } + :host([resize='vertical']) .control { + resize: vertical; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js + var TextArea2, vsCodeTextArea; + var init_text_area3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js"() { + init_esm2(); + init_text_area_styles(); + TextArea2 = class extends TextArea { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text area"); + } + } + }; + vsCodeTextArea = TextArea2.compose({ + baseName: "text-area", + template: textAreaTemplate, + styles: textAreaStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js + var textFieldStyles; + var init_text_field_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textFieldStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .root { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: row; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + height: calc(${inputHeight} * 1px); + min-width: ${inputMinWidth}; + } + .control { + -webkit-appearance: none; + font: inherit; + background: transparent; + border: 0; + color: inherit; + height: calc(100% - (${designUnit} * 1px)); + width: 100%; + margin-top: auto; + margin-bottom: auto; + border: none; + padding: 0 calc(${designUnit} * 2px + 1px); + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + .start, + .end { + display: flex; + margin: auto; + fill: currentcolor; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-start: calc(${designUnit} * 2px); + } + .end { + margin-inline-end: calc(${designUnit} * 2px); + } + :host(:hover:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + :host(:active:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + :host(:focus-within:not([disabled])) .root { + border-color: ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js + var TextField2, vsCodeTextField; + var init_text_field3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js"() { + init_esm2(); + init_text_field_styles(); + TextField2 = class extends TextField { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text field"); + } + } + }; + vsCodeTextField = TextField2.compose({ + baseName: "text-field", + template: textFieldTemplate, + styles: textFieldStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js + var allComponents; + var init_custom_elements = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js"() { + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + allComponents = { + vsCodeBadge, + vsCodeButton, + vsCodeCheckbox, + vsCodeDataGrid, + vsCodeDataGridCell, + vsCodeDataGridRow, + vsCodeDivider, + vsCodeDropdown, + vsCodeLink, + vsCodeOption, + vsCodePanels, + vsCodePanelTab, + vsCodePanelView, + vsCodeProgressRing, + vsCodeRadioGroup, + vsCodeRadio, + vsCodeTag, + vsCodeTextArea, + vsCodeTextField, + register(container, ...rest) { + if (!container) { + return; + } + for (const key in this) { + if (key === "register") { + continue; + } + this[key]().register(container, ...rest); + } + } + }; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/index.js + var dist_exports = {}; + __export(dist_exports, { + Badge: () => Badge2, + Button: () => Button2, + Checkbox: () => Checkbox2, + DataGrid: () => DataGrid2, + DataGridCell: () => DataGridCell2, + DataGridCellTypes: () => DataGridCellTypes, + DataGridRow: () => DataGridRow2, + DataGridRowTypes: () => DataGridRowTypes, + Divider: () => Divider2, + DividerRole: () => DividerRole, + Dropdown: () => Dropdown, + DropdownPosition: () => SelectPosition, + GenerateHeaderOptions: () => GenerateHeaderOptions, + Link: () => Link, + Option: () => Option2, + PanelTab: () => PanelTab, + PanelView: () => PanelView, + Panels: () => Panels, + ProgressRing: () => ProgressRing, + Radio: () => Radio2, + RadioGroup: () => RadioGroup2, + RadioGroupOrientation: () => Orientation, + Tag: () => Tag, + TextArea: () => TextArea2, + TextAreaResize: () => TextAreaResize, + TextField: () => TextField2, + TextFieldType: () => TextFieldType, + allComponents: () => allComponents, + provideVSCodeDesignSystem: () => provideVSCodeDesignSystem, + vsCodeBadge: () => vsCodeBadge, + vsCodeButton: () => vsCodeButton, + vsCodeCheckbox: () => vsCodeCheckbox, + vsCodeDataGrid: () => vsCodeDataGrid, + vsCodeDataGridCell: () => vsCodeDataGridCell, + vsCodeDataGridRow: () => vsCodeDataGridRow, + vsCodeDivider: () => vsCodeDivider, + vsCodeDropdown: () => vsCodeDropdown, + vsCodeLink: () => vsCodeLink, + vsCodeOption: () => vsCodeOption, + vsCodePanelTab: () => vsCodePanelTab, + vsCodePanelView: () => vsCodePanelView, + vsCodePanels: () => vsCodePanels, + vsCodeProgressRing: () => vsCodeProgressRing, + vsCodeRadio: () => vsCodeRadio, + vsCodeRadioGroup: () => vsCodeRadioGroup, + vsCodeTag: () => vsCodeTag, + vsCodeTextArea: () => vsCodeTextArea, + vsCodeTextField: () => vsCodeTextField + }); + var init_dist3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/index.js"() { + init_vscode_design_system(); + init_custom_elements(); + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + } + }); + + // src/webview/shared/domUtils.ts + function el(tag, className, text) { + const node = document.createElement(tag); + if (className) { + node.className = className; + } + if (text !== void 0) { + node.textContent = text; + } + return node; + } + function createButton(configOrId, label, appearance) { + const button = document.createElement("vscode-button"); + if (typeof configOrId === "string") { + button.id = configOrId; + button.textContent = label || ""; + if (appearance) { + button.setAttribute("appearance", appearance); + } + } else { + const config = configOrId; + button.id = config.id; + button.textContent = config.label; + if (config.appearance) { + button.setAttribute("appearance", config.appearance); + } + } + return button; + } + + // src/webview/shared/buttonConfig.ts + var BUTTONS = { + "btn-refresh": { + id: "btn-refresh", + label: "\u{1F504} Refresh", + appearance: "primary" + }, + "btn-details": { + id: "btn-details", + label: "\u{1F916} Details" + }, + "btn-chart": { + id: "btn-chart", + label: "\u{1F4C8} Chart" + }, + "btn-usage": { + id: "btn-usage", + label: "\u{1F4CA} Usage Analysis" + }, + "btn-diagnostics": { + id: "btn-diagnostics", + label: "\u{1F50D} Diagnostics" + }, + "btn-maturity": { + id: "btn-maturity", + label: "\u{1F3AF} Fluency Score" + }, + "btn-dashboard": { + id: "btn-dashboard", + label: "\u{1F4CA} Team Dashboard" + }, + "btn-level-viewer": { + id: "btn-level-viewer", + label: "\u{1F50D} Level Viewer" + }, + "btn-environmental": { + id: "btn-environmental", + label: "\u{1F33F} Environmental Impact" + } + }; + + // src/webview/shared/theme.css + var theme_default = '/**\n * Shared theme variables for all webview panels\n * Uses VS Code theme tokens for automatic light/dark theme support\n */\n\n:root {\n /* VS Code base colors */\n --bg-primary: var(--vscode-editor-background);\n --bg-secondary: var(--vscode-sideBar-background);\n --bg-tertiary: var(--vscode-editorWidget-background);\n --text-primary: var(--vscode-editor-foreground);\n --text-secondary: var(--vscode-descriptionForeground);\n --text-muted: var(--vscode-disabledForeground);\n --border-color: var(--vscode-panel-border);\n --border-subtle: var(--vscode-widget-border);\n \n /* Button colors */\n --button-bg: var(--vscode-button-background);\n --button-fg: var(--vscode-button-foreground);\n --button-hover-bg: var(--vscode-button-hoverBackground);\n --button-secondary-bg: var(--vscode-button-secondaryBackground);\n --button-secondary-fg: var(--vscode-button-secondaryForeground);\n --button-secondary-hover-bg: var(--vscode-button-secondaryHoverBackground);\n \n /* Input colors */\n --input-bg: var(--vscode-input-background);\n --input-fg: var(--vscode-input-foreground);\n --input-border: var(--vscode-input-border);\n \n /* List/card colors */\n --list-hover-bg: var(--vscode-list-hoverBackground);\n --list-active-bg: var(--vscode-list-activeSelectionBackground);\n --list-active-fg: var(--vscode-list-activeSelectionForeground);\n --list-inactive-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Alternating row colors for better readability */\n --row-alternate-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Badge colors */\n --badge-bg: var(--vscode-badge-background);\n --badge-fg: var(--vscode-badge-foreground);\n \n /* Focus colors */\n --focus-border: var(--vscode-focusBorder);\n \n /* Link colors */\n --link-color: var(--vscode-textLink-foreground);\n --link-hover-color: var(--vscode-textLink-activeForeground);\n \n /* Status colors */\n --error-fg: var(--vscode-errorForeground);\n --warning-fg: var(--vscode-editorWarning-foreground);\n --success-fg: var(--vscode-terminal-ansiGreen);\n \n /* Shadow for cards */\n --shadow-color: rgb(0, 0, 0, 0.16);\n --shadow-hover-color: rgb(0, 0, 0, 0.24);\n}\n\n/* Light theme adjustments */\nbody[data-vscode-theme-kind="vscode-light"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --shadow-color: rgb(0, 0, 0, 0.08);\n --shadow-hover-color: rgb(0, 0, 0, 0.12);\n}\n\n/* High contrast mode adjustments */\nbody[data-vscode-theme-kind="vscode-high-contrast"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --border-color: var(--vscode-contrastBorder);\n --border-subtle: var(--vscode-contrastBorder);\n}\n'; + + // src/webview/chart/styles.css + var styles_default = "body {\n margin: 0;\n background: var(--bg-primary);\n color: var(--text-primary);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n\n.container {\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 32px;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding-bottom: 4px;\n}\n\n.header-left {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.header-icon {\n font-size: 20px;\n}\n\n.header-title {\n font-size: 16px;\n font-weight: 700;\n color: var(--text-primary);\n text-align: left;\n}\n\n.button-row {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.section {\n background: var(--bg-secondary);\n border: 1px solid var(--border-color);\n border-radius: 10px;\n padding: 16px;\n box-shadow: 0 4px 10px var(--shadow-color);\n text-align: center;\n}\n\n.section h3 {\n margin: 0 0 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--text-primary);\n letter-spacing: 0.2px;\n text-align: left;\n}\n\n.cards {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\n gap: 10px;\n text-align: center;\n}\n\n.cards + .cards {\n margin-top: 16px;\n}\n\n.card {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-subtle);\n border-radius: 8px;\n padding: 12px;\n box-shadow: 0 2px 6px var(--shadow-color);\n text-align: center;\n}\n\n.card-label {\n color: var(--text-secondary);\n font-size: 11px;\n margin-bottom: 6px;\n}\n\n.card-value {\n color: var(--text-primary);\n font-size: 18px;\n font-weight: 700;\n}\n\n.card-sub {\n color: var(--text-muted);\n font-size: 11px;\n margin-top: 2px;\n}\n\n.chart-shell {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-subtle);\n border-radius: 10px;\n padding: 12px;\n box-shadow: 0 2px 8px var(--shadow-color);\n text-align: center;\n}\n\n.chart-controls {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n margin-bottom: 8px;\n justify-content: center;\n}\n\n.toggle {\n background: var(--button-secondary-bg);\n border: 1px solid var(--border-subtle);\n color: var(--text-primary);\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.toggle.active {\n background: var(--button-bg);\n border-color: var(--button-bg);\n color: var(--button-fg);\n}\n\n.toggle:hover {\n background: var(--button-secondary-hover-bg);\n}\n\n.toggle.active:hover {\n background: var(--button-hover-bg);\n}\n\n.canvas-wrap {\n position: relative;\n height: 420px;\n}\n\n.footer {\n color: var(--text-muted);\n font-size: 11px;\n margin-top: 6px;\n text-align: center;\n}\n\n.footer em {\n color: var(--text-secondary);\n}\n"; + + // src/webview/chart/main.ts + var vscode = acquireVsCodeApi(); + var initialData = window.__INITIAL_CHART__; + var chart; + var Chart2; + async function loadChartModule() { + if (Chart2) { + return; + } + const mod = await Promise.resolve().then(() => (init_auto(), auto_exports)); + Chart2 = mod.default; + } + var currentView = "total"; + var pendingView = null; + function renderLayout(data) { + const root = document.getElementById("root"); + if (!root) { + return; + } + root.replaceChildren(); + const themeStyle = document.createElement("style"); + themeStyle.textContent = theme_default; + const style = document.createElement("style"); + style.textContent = styles_default; + const container = el("div", "container"); + const header = el("div", "header"); + const headerLeft = el("div", "header-left"); + const icon = el("span", "header-icon", "\u{1F4C8}"); + const title = el("span", "header-title", "Token Usage - Last 30 Days"); + headerLeft.append(icon, title); + const buttons = el("div", "button-row"); + buttons.append( + createButton(BUTTONS["btn-refresh"]), + createButton(BUTTONS["btn-details"]), + createButton(BUTTONS["btn-usage"]), + createButton(BUTTONS["btn-environmental"]), + createButton(BUTTONS["btn-diagnostics"]), + createButton(BUTTONS["btn-maturity"]) + ); + if (data.backendConfigured) { + buttons.append(createButton(BUTTONS["btn-dashboard"])); + } + header.append(headerLeft, buttons); + const summarySection = el("div", "section"); + summarySection.append(el("h3", "", "\u{1F4CA} Summary")); + const cards = el("div", "cards"); + cards.append( + buildCard("Total Days", data.dailyCount.toLocaleString()), + buildCard("Total Tokens", data.totalTokens.toLocaleString()), + buildCard("Avg Tokens / Day", data.avgTokensPerDay.toLocaleString()), + buildCard("Total Sessions", data.totalSessions.toLocaleString()) + ); + summarySection.append(cards); + const editorCards = buildEditorCards(data.editorTotalsMap); + if (editorCards) { + summarySection.append(editorCards); + } + const chartSection = el("div", "section"); + chartSection.append(el("h3", "", "\u{1F4CA} Charts")); + const chartShell = el("div", "chart-shell"); + const toggles = el("div", "chart-controls"); + const totalBtn = el("button", "toggle active", "Total Tokens"); + totalBtn.id = "view-total"; + const modelBtn = el("button", "toggle", "By Model"); + modelBtn.id = "view-model"; + const editorBtn = el("button", "toggle", "By Editor"); + editorBtn.id = "view-editor"; + const repoBtn = el("button", "toggle", "By Repository"); + repoBtn.id = "view-repository"; + toggles.append(totalBtn, modelBtn, editorBtn, repoBtn); + const canvasWrap = el("div", "canvas-wrap"); + const canvas = document.createElement("canvas"); + canvas.id = "token-chart"; + canvasWrap.append(canvas); + chartShell.append(toggles, canvasWrap); + chartSection.append(chartShell); + const footer = el("div", "footer", `Day-by-day token usage for the last 30 days +Last updated: ${new Date(data.lastUpdated).toLocaleString()} +Updates automatically every 5 minutes.`); + container.append(header, summarySection, chartSection, footer); + root.append(themeStyle, style, container); + wireInteractions(data); + void setupChart(canvas, data); + } + function buildCard(label, value) { + const card = el("div", "card"); + card.append(el("div", "card-label", label), el("div", "card-value", value)); + return card; + } + function buildEditorCards(editorTotals) { + const entries = Object.entries(editorTotals); + if (!entries.length) { + return null; + } + const wrap = el("div", "cards"); + entries.forEach(([editor, tokens]) => { + wrap.append(buildCard(editor, tokens.toLocaleString())); + }); + return wrap; + } + function wireInteractions(data) { + const refresh = document.getElementById("btn-refresh"); + refresh?.addEventListener("click", () => vscode.postMessage({ command: "refresh" })); + const details = document.getElementById("btn-details"); + details?.addEventListener("click", () => vscode.postMessage({ command: "showDetails" })); + const usage = document.getElementById("btn-usage"); + usage?.addEventListener("click", () => vscode.postMessage({ command: "showUsageAnalysis" })); + const diagnostics = document.getElementById("btn-diagnostics"); + diagnostics?.addEventListener("click", () => vscode.postMessage({ command: "showDiagnostics" })); + const maturity = document.getElementById("btn-maturity"); + maturity?.addEventListener("click", () => vscode.postMessage({ command: "showMaturity" })); + const dashboard = document.getElementById("btn-dashboard"); + dashboard?.addEventListener("click", () => vscode.postMessage({ command: "showDashboard" })); + const environmental = document.getElementById("btn-environmental"); + environmental?.addEventListener("click", () => vscode.postMessage({ command: "showEnvironmental" })); + const viewButtons = [ + { id: "view-total", view: "total" }, + { id: "view-model", view: "model" }, + { id: "view-editor", view: "editor" }, + { id: "view-repository", view: "repository" } + ]; + viewButtons.forEach(({ id, view }) => { + const btn = document.getElementById(id); + btn?.addEventListener("click", () => { + void switchView(view, data); + }); + }); + } + async function setupChart(canvas, data) { + const ctx = canvas.getContext("2d"); + if (!ctx) { + return; + } + await loadChartModule(); + if (!Chart2) { + return; + } + chart = new Chart2(ctx, createConfig("total", data)); + if (pendingView !== null && pendingView !== "total") { + const viewToRestore = pendingView; + currentView = "total"; + await switchView(viewToRestore, data); + } + pendingView = null; + } + async function switchView(view, data) { + if (currentView === view) { + return; + } + currentView = view; + setActive(view); + if (!chart) { + return; + } + const canvas = chart.canvas; + chart.destroy(); + if (!canvas) { + return; + } + const ctx = canvas.getContext("2d"); + if (!ctx) { + return; + } + await loadChartModule(); + if (!Chart2) { + return; + } + chart = new Chart2(ctx, createConfig(view, data)); + } + function setActive(view) { + ["view-total", "view-model", "view-editor", "view-repository"].forEach((id) => { + const btn = document.getElementById(id); + if (!btn) { + return; + } + btn.classList.toggle("active", id === `view-${view}`); + }); + } + function createConfig(view, data) { + const styles = getComputedStyle(document.body); + const textColor = styles.getPropertyValue("--text-primary") || "#e0e0e0"; + const mutedColor = styles.getPropertyValue("--text-muted") || "#999999"; + const borderColor = styles.getPropertyValue("--border-subtle") || "#3a3a40"; + const bgColor = styles.getPropertyValue("--bg-tertiary") || "#1e1e1e"; + const gridColor = "rgba(128, 128, 128, 0.15)"; + const baseOptions = { + responsive: true, + maintainAspectRatio: false, + interaction: { mode: "index", intersect: false }, + plugins: { + legend: { position: "top", labels: { color: textColor, font: { size: 12 } } }, + tooltip: { + backgroundColor: bgColor, + titleColor: textColor, + bodyColor: textColor, + borderColor, + borderWidth: 1, + padding: 10, + displayColors: true + } + }, + scales: { + x: { grid: { color: gridColor }, ticks: { color: textColor, font: { size: 11 } } } + } + }; + if (view === "total") { + return { + type: "bar", + data: { + labels: data.labels, + datasets: [ + { + label: "Tokens", + data: data.tokensData, + backgroundColor: "rgba(54, 162, 235, 0.6)", + borderColor: "rgba(54, 162, 235, 1)", + borderWidth: 1, + yAxisID: "y" + }, + { + label: "Sessions", + data: data.sessionsData, + backgroundColor: "rgba(255, 99, 132, 0.6)", + borderColor: "rgba(255, 99, 132, 1)", + borderWidth: 1, + type: "line", + yAxisID: "y1" + } + ] + }, + options: { + ...baseOptions, + scales: { + ...baseOptions.scales, + y: { + type: "linear", + display: true, + position: "left", + grid: { color: gridColor }, + ticks: { color: textColor, font: { size: 11 }, callback: (value) => Number(value).toLocaleString() }, + title: { display: true, text: "Tokens", color: textColor, font: { size: 12, weight: "bold" } } + }, + y1: { + type: "linear", + display: true, + position: "right", + grid: { drawOnChartArea: false }, + ticks: { color: textColor, font: { size: 11 } }, + title: { display: true, text: "Sessions", color: textColor, font: { size: 12, weight: "bold" } } + } + } + } + }; + } + const datasets = view === "model" ? data.modelDatasets : view === "repository" ? data.repositoryDatasets : data.editorDatasets; + const sessionsDataset = { + label: "Sessions", + data: data.sessionsData, + backgroundColor: "rgba(255, 99, 132, 0.6)", + borderColor: "rgba(255, 99, 132, 1)", + borderWidth: 2, + type: "line", + yAxisID: "y1", + stack: void 0 + // Don't stack the line + }; + return { + type: "bar", + data: { labels: data.labels, datasets: [...datasets, sessionsDataset] }, + options: { + ...baseOptions, + plugins: { + ...baseOptions.plugins, + legend: { position: "top", labels: { color: textColor, font: { size: 11 } } } + }, + scales: { + ...baseOptions.scales, + y: { + stacked: true, + grid: { color: gridColor }, + ticks: { color: textColor, font: { size: 11 }, callback: (value) => Number(value).toLocaleString() }, + title: { display: true, text: "Tokens", color: textColor, font: { size: 12, weight: "bold" } } + }, + x: { stacked: true, grid: { color: gridColor }, ticks: { color: textColor, font: { size: 11 } } }, + y1: { + type: "linear", + display: true, + position: "right", + grid: { drawOnChartArea: false }, + ticks: { color: textColor, font: { size: 11 } }, + title: { display: true, text: "Sessions", color: textColor, font: { size: 12, weight: "bold" } } + } + } + } + }; + } + async function bootstrap() { + const { provideVSCodeDesignSystem: provideVSCodeDesignSystem2, vsCodeButton: vsCodeButton2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports)); + provideVSCodeDesignSystem2().register(vsCodeButton2()); + if (!initialData) { + const root = document.getElementById("root"); + if (root) { + root.textContent = "No data available."; + } + return; + } + renderLayout(initialData); + } + void bootstrap(); + window.addEventListener("message", (event) => { + const message = event.data; + if (message.command === "updateChartData") { + pendingView = currentView; + renderLayout(message.data); + } + }); +})(); +/*! Bundled license information: + +@kurkle/color/dist/color.esm.js: + (*! + * @kurkle/color v0.3.4 + * https://github.com/kurkle/color#readme + * (c) 2024 Jukka Kurkela + * Released under the MIT License + *) + +chart.js/dist/chunks/helpers.dataset.js: +chart.js/dist/chart.js: + (*! + * Chart.js v4.5.1 + * https://www.chartjs.org + * (c) 2025 Chart.js Contributors + * Released under the MIT License + *) + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tabbable/dist/index.esm.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=chart.js.map diff --git a/visualstudio-extension/src/CopilotTokenTracker/webview/details.js b/visualstudio-extension/src/CopilotTokenTracker/webview/details.js new file mode 100644 index 00000000..7448bf06 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/webview/details.js @@ -0,0 +1,20839 @@ +"use strict"; +(() => { + var __defProp = Object.defineProperty; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); + }; + + // node_modules/@microsoft/fast-element/dist/esm/platform.js + function createMetadataLocator() { + const metadataLookup = /* @__PURE__ */ new WeakMap(); + return function(target) { + let metadata = metadataLookup.get(target); + if (metadata === void 0) { + let currentTarget = Reflect.getPrototypeOf(target); + while (metadata === void 0 && currentTarget !== null) { + metadata = metadataLookup.get(currentTarget); + currentTarget = Reflect.getPrototypeOf(currentTarget); + } + metadata = metadata === void 0 ? [] : metadata.slice(0); + metadataLookup.set(target, metadata); + } + return metadata; + }; + } + var $global, propConfig, FAST, emptyArray; + var init_platform = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/platform.js"() { + $global = (function() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + try { + return new Function("return this")(); + } catch (_a) { + return {}; + } + })(); + if ($global.trustedTypes === void 0) { + $global.trustedTypes = { createPolicy: (n, r) => r }; + } + propConfig = { + configurable: false, + enumerable: false, + writable: false + }; + if ($global.FAST === void 0) { + Reflect.defineProperty($global, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, propConfig)); + } + FAST = $global.FAST; + if (FAST.getById === void 0) { + const storage = /* @__PURE__ */ Object.create(null); + Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) { + let found = storage[id]; + if (found === void 0) { + found = initialize ? storage[id] = initialize() : null; + } + return found; + } }, propConfig)); + } + emptyArray = Object.freeze([]); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/dom.js + var updateQueue, fastHTMLPolicy, htmlPolicy, marker, _interpolationStart, _interpolationEnd, DOM; + var init_dom = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/dom.js"() { + init_platform(); + updateQueue = $global.FAST.getById(1, () => { + const tasks = []; + const pendingErrors = []; + function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } + } + function tryRunTask(task) { + try { + task.call(); + } catch (error) { + pendingErrors.push(error); + setTimeout(throwFirstError, 0); + } + } + function process() { + const capacity = 1024; + let index = 0; + while (index < tasks.length) { + tryRunTask(tasks[index]); + index++; + if (index > capacity) { + for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) { + tasks[scan] = tasks[scan + index]; + } + tasks.length -= index; + index = 0; + } + } + tasks.length = 0; + } + function enqueue(callable) { + if (tasks.length < 1) { + $global.requestAnimationFrame(process); + } + tasks.push(callable); + } + return Object.freeze({ + enqueue, + process + }); + }); + fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { + createHTML: (html2) => html2 + }); + htmlPolicy = fastHTMLPolicy; + marker = `fast-${Math.random().toString(36).substring(2, 8)}`; + _interpolationStart = `${marker}{`; + _interpolationEnd = `}${marker}`; + DOM = Object.freeze({ + /** + * Indicates whether the DOM supports the adoptedStyleSheets feature. + */ + supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, + /** + * Sets the HTML trusted types policy used by the templating engine. + * @param policy - The policy to set for HTML. + * @remarks + * This API can only be called once, for security reasons. It should be + * called by the application developer at the start of their program. + */ + setHTMLPolicy(policy) { + if (htmlPolicy !== fastHTMLPolicy) { + throw new Error("The HTML policy can only be set once."); + } + htmlPolicy = policy; + }, + /** + * Turns a string into trusted HTML using the configured trusted types policy. + * @param html - The string to turn into trusted HTML. + * @remarks + * Used internally by the template engine when creating templates + * and setting innerHTML. + */ + createHTML(html2) { + return htmlPolicy.createHTML(html2); + }, + /** + * Determines if the provided node is a template marker used by the runtime. + * @param node - The node to test. + */ + isMarker(node) { + return node && node.nodeType === 8 && node.data.startsWith(marker); + }, + /** + * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. + * @param node - The marker node to extract the index from. + */ + extractDirectiveIndexFromMarker(node) { + return parseInt(node.data.replace(`${marker}:`, "")); + }, + /** + * Creates a placeholder string suitable for marking out a location *within* + * an attribute value or HTML content. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by binding directives. + */ + createInterpolationPlaceholder(index) { + return `${_interpolationStart}${index}${_interpolationEnd}`; + }, + /** + * Creates a placeholder that manifests itself as an attribute on an + * element. + * @param attributeName - The name of the custom attribute. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by attribute directives such as `ref`, `slotted`, and `children`. + */ + createCustomAttributePlaceholder(attributeName, index) { + return `${attributeName}="${this.createInterpolationPlaceholder(index)}"`; + }, + /** + * Creates a placeholder that manifests itself as a marker within the DOM structure. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by structural directives such as `repeat`. + */ + createBlockPlaceholder(index) { + return ``; + }, + /** + * Schedules DOM update work in the next async batch. + * @param callable - The callable function or object to queue. + */ + queueUpdate: updateQueue.enqueue, + /** + * Immediately processes all work previously scheduled + * through queueUpdate. + * @remarks + * This also forces nextUpdate promises + * to resolve. + */ + processUpdates: updateQueue.process, + /** + * Resolves with the next DOM update. + */ + nextUpdate() { + return new Promise(updateQueue.enqueue); + }, + /** + * Sets an attribute value on an element. + * @param element - The element to set the attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is `null` or `undefined`, the attribute is removed, otherwise + * it is set to the provided value using the standard `setAttribute` API. + */ + setAttribute(element, attributeName, value) { + if (value === null || value === void 0) { + element.removeAttribute(attributeName); + } else { + element.setAttribute(attributeName, value); + } + }, + /** + * Sets a boolean attribute value. + * @param element - The element to set the boolean attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is true, the attribute is added; otherwise it is removed. + */ + setBooleanAttribute(element, attributeName, value) { + value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); + }, + /** + * Removes all the child nodes of the provided parent node. + * @param parent - The node to remove the children from. + */ + removeChildNodes(parent) { + for (let child = parent.firstChild; child !== null; child = parent.firstChild) { + parent.removeChild(child); + } + }, + /** + * Creates a TreeWalker configured to walk a template fragment. + * @param fragment - The fragment to walk. + */ + createTemplateWalker(fragment) { + return document.createTreeWalker( + fragment, + 133, + // element, text, comment + null, + false + ); + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js + var SubscriberSet, PropertyChangeNotifier; + var init_notifier = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js"() { + SubscriberSet = class { + /** + * Creates an instance of SubscriberSet for the specified source. + * @param source - The object source that subscribers will receive notifications from. + * @param initialSubscriber - An initial subscriber to changes. + */ + constructor(source, initialSubscriber) { + this.sub1 = void 0; + this.sub2 = void 0; + this.spillover = void 0; + this.source = source; + this.sub1 = initialSubscriber; + } + /** + * Checks whether the provided subscriber has been added to this set. + * @param subscriber - The subscriber to test for inclusion in this set. + */ + has(subscriber) { + return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + */ + subscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.has(subscriber)) { + return; + } + if (this.sub1 === void 0) { + this.sub1 = subscriber; + return; + } + if (this.sub2 === void 0) { + this.sub2 = subscriber; + return; + } + this.spillover = [this.sub1, this.sub2, subscriber]; + this.sub1 = void 0; + this.sub2 = void 0; + } else { + const index = spillover.indexOf(subscriber); + if (index === -1) { + spillover.push(subscriber); + } + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + */ + unsubscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.sub1 === subscriber) { + this.sub1 = void 0; + } else if (this.sub2 === subscriber) { + this.sub2 = void 0; + } + } else { + const index = spillover.indexOf(subscriber); + if (index !== -1) { + spillover.splice(index, 1); + } + } + } + /** + * Notifies all subscribers. + * @param args - Data passed along to subscribers during notification. + */ + notify(args) { + const spillover = this.spillover; + const source = this.source; + if (spillover === void 0) { + const sub1 = this.sub1; + const sub2 = this.sub2; + if (sub1 !== void 0) { + sub1.handleChange(source, args); + } + if (sub2 !== void 0) { + sub2.handleChange(source, args); + } + } else { + for (let i = 0, ii = spillover.length; i < ii; ++i) { + spillover[i].handleChange(source, args); + } + } + } + }; + PropertyChangeNotifier = class { + /** + * Creates an instance of PropertyChangeNotifier for the specified source. + * @param source - The object source that subscribers will receive notifications from. + */ + constructor(source) { + this.subscribers = {}; + this.sourceSubscribers = null; + this.source = source; + } + /** + * Notifies all subscribers, based on the specified property. + * @param propertyName - The property name, passed along to subscribers during notification. + */ + notify(propertyName) { + var _a; + const subscribers = this.subscribers[propertyName]; + if (subscribers !== void 0) { + subscribers.notify(propertyName); + } + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. + */ + subscribe(subscriber, propertyToWatch) { + var _a; + if (propertyToWatch) { + let subscribers = this.subscribers[propertyToWatch]; + if (subscribers === void 0) { + this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); + } + subscribers.subscribe(subscriber); + } else { + this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); + this.sourceSubscribers.subscribe(subscriber); + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. + */ + unsubscribe(subscriber, propertyToUnwatch) { + var _a; + if (propertyToUnwatch) { + const subscribers = this.subscribers[propertyToUnwatch]; + if (subscribers !== void 0) { + subscribers.unsubscribe(subscriber); + } + } else { + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/observable.js + function observable(target, nameOrAccessor) { + Observable.defineProperty(target, nameOrAccessor); + } + function volatile(target, name, descriptor) { + return Object.assign({}, descriptor, { + get: function() { + Observable.trackVolatile(); + return descriptor.get.apply(this); + } + }); + } + var Observable, contextEvent, ExecutionContext, defaultExecutionContext; + var init_observable = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/observable.js"() { + init_dom(); + init_platform(); + init_notifier(); + Observable = FAST.getById(2, () => { + const volatileRegex = /(:|&&|\|\||if)/; + const notifierLookup = /* @__PURE__ */ new WeakMap(); + const queueUpdate = DOM.queueUpdate; + let watcher = void 0; + let createArrayObserver = (array) => { + throw new Error("Must call enableArrayObservation before observing arrays."); + }; + function getNotifier(source) { + let found = source.$fastController || notifierLookup.get(source); + if (found === void 0) { + if (Array.isArray(source)) { + found = createArrayObserver(source); + } else { + notifierLookup.set(source, found = new PropertyChangeNotifier(source)); + } + } + return found; + } + const getAccessors = createMetadataLocator(); + class DefaultObservableAccessor { + constructor(name) { + this.name = name; + this.field = `_${name}`; + this.callback = `${name}Changed`; + } + getValue(source) { + if (watcher !== void 0) { + watcher.watch(source, this.name); + } + return source[this.field]; + } + setValue(source, newValue) { + const field = this.field; + const oldValue = source[field]; + if (oldValue !== newValue) { + source[field] = newValue; + const callback = source[this.callback]; + if (typeof callback === "function") { + callback.call(source, oldValue, newValue); + } + getNotifier(source).notify(this.name); + } + } + } + class BindingObserverImplementation extends SubscriberSet { + constructor(binding, initialSubscriber, isVolatileBinding = false) { + super(binding, initialSubscriber); + this.binding = binding; + this.isVolatileBinding = isVolatileBinding; + this.needsRefresh = true; + this.needsQueue = true; + this.first = this; + this.last = null; + this.propertySource = void 0; + this.propertyName = void 0; + this.notifier = void 0; + this.next = void 0; + } + observe(source, context) { + if (this.needsRefresh && this.last !== null) { + this.disconnect(); + } + const previousWatcher = watcher; + watcher = this.needsRefresh ? this : void 0; + this.needsRefresh = this.isVolatileBinding; + const result = this.binding(source, context); + watcher = previousWatcher; + return result; + } + disconnect() { + if (this.last !== null) { + let current = this.first; + while (current !== void 0) { + current.notifier.unsubscribe(this, current.propertyName); + current = current.next; + } + this.last = null; + this.needsRefresh = this.needsQueue = true; + } + } + watch(propertySource, propertyName) { + const prev = this.last; + const notifier = getNotifier(propertySource); + const current = prev === null ? this.first : {}; + current.propertySource = propertySource; + current.propertyName = propertyName; + current.notifier = notifier; + notifier.subscribe(this, propertyName); + if (prev !== null) { + if (!this.needsRefresh) { + let prevValue; + watcher = void 0; + prevValue = prev.propertySource[prev.propertyName]; + watcher = this; + if (propertySource === prevValue) { + this.needsRefresh = true; + } + } + prev.next = current; + } + this.last = current; + } + handleChange() { + if (this.needsQueue) { + this.needsQueue = false; + queueUpdate(this); + } + } + call() { + if (this.last !== null) { + this.needsQueue = true; + this.notify(this); + } + } + records() { + let next = this.first; + return { + next: () => { + const current = next; + if (current === void 0) { + return { value: void 0, done: true }; + } else { + next = next.next; + return { + value: current, + done: false + }; + } + }, + [Symbol.iterator]: function() { + return this; + } + }; + } + } + return Object.freeze({ + /** + * @internal + * @param factory - The factory used to create array observers. + */ + setArrayObserverFactory(factory) { + createArrayObserver = factory; + }, + /** + * Gets a notifier for an object or Array. + * @param source - The object or Array to get the notifier for. + */ + getNotifier, + /** + * Records a property change for a source object. + * @param source - The object to record the change against. + * @param propertyName - The property to track as changed. + */ + track(source, propertyName) { + if (watcher !== void 0) { + watcher.watch(source, propertyName); + } + }, + /** + * Notifies watchers that the currently executing property getter or function is volatile + * with respect to its observable dependencies. + */ + trackVolatile() { + if (watcher !== void 0) { + watcher.needsRefresh = true; + } + }, + /** + * Notifies subscribers of a source object of changes. + * @param source - the object to notify of changes. + * @param args - The change args to pass to subscribers. + */ + notify(source, args) { + getNotifier(source).notify(args); + }, + /** + * Defines an observable property on an object or prototype. + * @param target - The target object to define the observable on. + * @param nameOrAccessor - The name of the property to define as observable; + * or a custom accessor that specifies the property name and accessor implementation. + */ + defineProperty(target, nameOrAccessor) { + if (typeof nameOrAccessor === "string") { + nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); + } + getAccessors(target).push(nameOrAccessor); + Reflect.defineProperty(target, nameOrAccessor.name, { + enumerable: true, + get: function() { + return nameOrAccessor.getValue(this); + }, + set: function(newValue) { + nameOrAccessor.setValue(this, newValue); + } + }); + }, + /** + * Finds all the observable accessors defined on the target, + * including its prototype chain. + * @param target - The target object to search for accessor on. + */ + getAccessors, + /** + * Creates a {@link BindingObserver} that can watch the + * provided {@link Binding} for changes. + * @param binding - The binding to observe. + * @param initialSubscriber - An initial subscriber to changes in the binding value. + * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. + */ + binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) { + return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding); + }, + /** + * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated + * on every evaluation of the value. + * @param binding - The binding to inspect. + */ + isVolatileBinding(binding) { + return volatileRegex.test(binding.toString()); + } + }); + }); + contextEvent = FAST.getById(3, () => { + let current = null; + return { + get() { + return current; + }, + set(event) { + current = event; + } + }; + }); + ExecutionContext = class { + constructor() { + this.index = 0; + this.length = 0; + this.parent = null; + this.parentContext = null; + } + /** + * The current event within an event handler. + */ + get event() { + return contextEvent.get(); + } + /** + * Indicates whether the current item within a repeat context + * has an even index. + */ + get isEven() { + return this.index % 2 === 0; + } + /** + * Indicates whether the current item within a repeat context + * has an odd index. + */ + get isOdd() { + return this.index % 2 !== 0; + } + /** + * Indicates whether the current item within a repeat context + * is the first item in the collection. + */ + get isFirst() { + return this.index === 0; + } + /** + * Indicates whether the current item within a repeat context + * is somewhere in the middle of the collection. + */ + get isInMiddle() { + return !this.isFirst && !this.isLast; + } + /** + * Indicates whether the current item within a repeat context + * is the last item in the collection. + */ + get isLast() { + return this.index === this.length - 1; + } + /** + * Sets the event for the current execution context. + * @param event - The event to set. + * @internal + */ + static setEvent(event) { + contextEvent.set(event); + } + }; + Observable.defineProperty(ExecutionContext.prototype, "index"); + Observable.defineProperty(ExecutionContext.prototype, "length"); + defaultExecutionContext = Object.seal(new ExecutionContext()); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js + var HTMLDirective, TargetedHTMLDirective, AttachedBehaviorHTMLDirective; + var init_html_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js"() { + init_dom(); + HTMLDirective = class { + constructor() { + this.targetIndex = 0; + } + }; + TargetedHTMLDirective = class extends HTMLDirective { + constructor() { + super(...arguments); + this.createPlaceholder = DOM.createInterpolationPlaceholder; + } + }; + AttachedBehaviorHTMLDirective = class extends HTMLDirective { + /** + * + * @param name - The name of the behavior; used as a custom attribute on the element. + * @param behavior - The behavior to instantiate and attach to the element. + * @param options - Options to pass to the behavior during creation. + */ + constructor(name, behavior, options) { + super(); + this.name = name; + this.behavior = behavior; + this.options = options; + } + /** + * Creates a placeholder string based on the directive's index within the template. + * @param index - The index of the directive within the template. + * @remarks + * Creates a custom attribute placeholder. + */ + createPlaceholder(index) { + return DOM.createCustomAttributePlaceholder(this.name, index); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + * @remarks + * Creates an instance of the `behavior` type this directive was constructed with + * and passes the target and options to that `behavior`'s constructor. + */ + createBehavior(target) { + return new this.behavior(target, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/binding.js + function normalBind(source, context) { + this.source = source; + this.context = context; + if (this.bindingObserver === null) { + this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); + } + this.updateTarget(this.bindingObserver.observe(source, context)); + } + function triggerBind(source, context) { + this.source = source; + this.context = context; + this.target.addEventListener(this.targetName, this); + } + function normalUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + } + function contentUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.unbind(); + view.needsBindOnly = true; + } + } + function triggerUnbind() { + this.target.removeEventListener(this.targetName, this); + this.source = null; + this.context = null; + } + function updateAttributeTarget(value) { + DOM.setAttribute(this.target, this.targetName, value); + } + function updateBooleanAttributeTarget(value) { + DOM.setBooleanAttribute(this.target, this.targetName, value); + } + function updateContentTarget(value) { + if (value === null || value === void 0) { + value = ""; + } + if (value.create) { + this.target.textContent = ""; + let view = this.target.$fastView; + if (view === void 0) { + view = value.create(); + } else { + if (this.target.$fastTemplate !== value) { + if (view.isComposed) { + view.remove(); + view.unbind(); + } + view = value.create(); + } + } + if (!view.isComposed) { + view.isComposed = true; + view.bind(this.source, this.context); + view.insertBefore(this.target); + this.target.$fastView = view; + this.target.$fastTemplate = value; + } else if (view.needsBindOnly) { + view.needsBindOnly = false; + view.bind(this.source, this.context); + } + } else { + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.isComposed = false; + view.remove(); + if (view.needsBindOnly) { + view.needsBindOnly = false; + } else { + view.unbind(); + } + } + this.target.textContent = value; + } + } + function updatePropertyTarget(value) { + this.target[this.targetName] = value; + } + function updateClassTarget(value) { + const classVersions = this.classVersions || /* @__PURE__ */ Object.create(null); + const target = this.target; + let version = this.version || 0; + if (value !== null && value !== void 0 && value.length) { + const names = value.split(/\s+/); + for (let i = 0, ii = names.length; i < ii; ++i) { + const currentName = names[i]; + if (currentName === "") { + continue; + } + classVersions[currentName] = version; + target.classList.add(currentName); + } + } + this.classVersions = classVersions; + this.version = version + 1; + if (version === 0) { + return; + } + version -= 1; + for (const name in classVersions) { + if (classVersions[name] === version) { + target.classList.remove(name); + } + } + } + var HTMLBindingDirective, BindingBehavior; + var init_binding = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/binding.js"() { + init_dom(); + init_observable(); + init_html_directive(); + HTMLBindingDirective = class extends TargetedHTMLDirective { + /** + * Creates an instance of BindingDirective. + * @param binding - A binding that returns the data used to update the DOM. + */ + constructor(binding) { + super(); + this.binding = binding; + this.bind = normalBind; + this.unbind = normalUnbind; + this.updateTarget = updateAttributeTarget; + this.isBindingVolatile = Observable.isVolatileBinding(this.binding); + } + /** + * Gets/sets the name of the attribute or property that this + * binding is targeting. + */ + get targetName() { + return this.originalTargetName; + } + set targetName(value) { + this.originalTargetName = value; + if (value === void 0) { + return; + } + switch (value[0]) { + case ":": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updatePropertyTarget; + if (this.cleanedTargetName === "innerHTML") { + const binding = this.binding; + this.binding = (s, c) => DOM.createHTML(binding(s, c)); + } + break; + case "?": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updateBooleanAttributeTarget; + break; + case "@": + this.cleanedTargetName = value.substr(1); + this.bind = triggerBind; + this.unbind = triggerUnbind; + break; + default: + this.cleanedTargetName = value; + if (value === "class") { + this.updateTarget = updateClassTarget; + } + break; + } + } + /** + * Makes this binding target the content of an element rather than + * a particular attribute or property. + */ + targetAtContent() { + this.updateTarget = updateContentTarget; + this.unbind = contentUnbind; + } + /** + * Creates the runtime BindingBehavior instance based on the configuration + * information stored in the BindingDirective. + * @param target - The target node that the binding behavior should attach to. + */ + createBehavior(target) { + return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); + } + }; + BindingBehavior = class { + /** + * Creates an instance of BindingBehavior. + * @param target - The target of the data updates. + * @param binding - The binding that returns the latest value for an update. + * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. + * @param bind - The operation to perform during binding. + * @param unbind - The operation to perform during unbinding. + * @param updateTarget - The operation to perform when updating. + * @param targetName - The name of the target attribute or property to update. + */ + constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { + this.source = null; + this.context = null; + this.bindingObserver = null; + this.target = target; + this.binding = binding; + this.isBindingVolatile = isBindingVolatile; + this.bind = bind; + this.unbind = unbind; + this.updateTarget = updateTarget; + this.targetName = targetName; + } + /** @internal */ + handleChange() { + this.updateTarget(this.bindingObserver.observe(this.source, this.context)); + } + /** @internal */ + handleEvent(event) { + ExecutionContext.setEvent(event); + const result = this.binding(this.source, this.context); + ExecutionContext.setEvent(null); + if (result !== true) { + event.preventDefault(); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js + function createAggregateBinding(parts) { + if (parts.length === 1) { + return parts[0]; + } + let targetName; + const partCount = parts.length; + const finalParts = parts.map((x) => { + if (typeof x === "string") { + return () => x; + } + targetName = x.targetName || targetName; + return x.binding; + }); + const binding = (scope, context) => { + let output = ""; + for (let i = 0; i < partCount; ++i) { + output += finalParts[i](scope, context); + } + return output; + }; + const directive = new HTMLBindingDirective(binding); + directive.targetName = targetName; + return directive; + } + function parseContent(context, value) { + const valueParts = value.split(_interpolationStart); + if (valueParts.length === 1) { + return null; + } + const bindingParts = []; + for (let i = 0, ii = valueParts.length; i < ii; ++i) { + const current = valueParts[i]; + const index = current.indexOf(_interpolationEnd); + let literal; + if (index === -1) { + literal = current; + } else { + const directiveIndex = parseInt(current.substring(0, index)); + bindingParts.push(context.directives[directiveIndex]); + literal = current.substring(index + interpolationEndLength); + } + if (literal !== "") { + bindingParts.push(literal); + } + } + return bindingParts; + } + function compileAttributes(context, node, includeBasicValues = false) { + const attributes = node.attributes; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const attr2 = attributes[i]; + const attrValue = attr2.value; + const parseResult = parseContent(context, attrValue); + let result = null; + if (parseResult === null) { + if (includeBasicValues) { + result = new HTMLBindingDirective(() => attrValue); + result.targetName = attr2.name; + } + } else { + result = createAggregateBinding(parseResult); + } + if (result !== null) { + node.removeAttributeNode(attr2); + i--; + ii--; + context.addFactory(result); + } + } + } + function compileContent(context, node, walker) { + const parseResult = parseContent(context, node.textContent); + if (parseResult !== null) { + let lastNode = node; + for (let i = 0, ii = parseResult.length; i < ii; ++i) { + const currentPart = parseResult[i]; + const currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); + if (typeof currentPart === "string") { + currentNode.textContent = currentPart; + } else { + currentNode.textContent = " "; + context.captureContentBinding(currentPart); + } + lastNode = currentNode; + context.targetIndex++; + if (currentNode !== node) { + walker.nextNode(); + } + } + context.targetIndex--; + } + } + function compileTemplate(template, directives) { + const fragment = template.content; + document.adoptNode(fragment); + const context = CompilationContext.borrow(directives); + compileAttributes(context, template, true); + const hostBehaviorFactories = context.behaviorFactories; + context.reset(); + const walker = DOM.createTemplateWalker(fragment); + let node; + while (node = walker.nextNode()) { + context.targetIndex++; + switch (node.nodeType) { + case 1: + compileAttributes(context, node); + break; + case 3: + compileContent(context, node, walker); + break; + case 8: + if (DOM.isMarker(node)) { + context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); + } + } + } + let targetOffset = 0; + if ( + // If the first node in a fragment is a marker, that means it's an unstable first node, + // because something like a when, repeat, etc. could add nodes before the marker. + // To mitigate this, we insert a stable first node. However, if we insert a node, + // that will alter the result of the TreeWalker. So, we also need to offset the target index. + DOM.isMarker(fragment.firstChild) || // Or if there is only one node and a directive, it means the template's content + // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by + // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. + fragment.childNodes.length === 1 && directives.length + ) { + fragment.insertBefore(document.createComment(""), fragment.firstChild); + targetOffset = -1; + } + const viewBehaviorFactories = context.behaviorFactories; + context.release(); + return { + fragment, + viewBehaviorFactories, + hostBehaviorFactories, + targetOffset + }; + } + var sharedContext, CompilationContext, interpolationEndLength; + var init_compiler = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js"() { + init_dom(); + init_binding(); + sharedContext = null; + CompilationContext = class _CompilationContext { + addFactory(factory) { + factory.targetIndex = this.targetIndex; + this.behaviorFactories.push(factory); + } + captureContentBinding(directive) { + directive.targetAtContent(); + this.addFactory(directive); + } + reset() { + this.behaviorFactories = []; + this.targetIndex = -1; + } + release() { + sharedContext = this; + } + static borrow(directives) { + const shareable = sharedContext || new _CompilationContext(); + shareable.directives = directives; + shareable.reset(); + sharedContext = null; + return shareable; + } + }; + interpolationEndLength = _interpolationEnd.length; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/view.js + var range, HTMLView; + var init_view = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/view.js"() { + range = document.createRange(); + HTMLView = class { + /** + * Constructs an instance of HTMLView. + * @param fragment - The html fragment that contains the nodes for this view. + * @param behaviors - The behaviors to be applied to this view. + */ + constructor(fragment, behaviors) { + this.fragment = fragment; + this.behaviors = behaviors; + this.source = null; + this.context = null; + this.firstChild = fragment.firstChild; + this.lastChild = fragment.lastChild; + } + /** + * Appends the view's DOM nodes to the referenced node. + * @param node - The parent node to append the view's DOM nodes to. + */ + appendTo(node) { + node.appendChild(this.fragment); + } + /** + * Inserts the view's DOM nodes before the referenced node. + * @param node - The node to insert the view's DOM before. + */ + insertBefore(node) { + if (this.fragment.hasChildNodes()) { + node.parentNode.insertBefore(this.fragment, node); + } else { + const end = this.lastChild; + if (node.previousSibling === end) + return; + const parentNode = node.parentNode; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parentNode.insertBefore(current, node); + current = next; + } + parentNode.insertBefore(end, node); + } + } + /** + * Removes the view's DOM nodes. + * The nodes are not disposed and the view can later be re-inserted. + */ + remove() { + const fragment = this.fragment; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + fragment.appendChild(current); + current = next; + } + fragment.appendChild(end); + } + /** + * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. + * Once a view has been disposed, it cannot be inserted or bound again. + */ + dispose() { + const parent = this.firstChild.parentNode; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parent.removeChild(current); + current = next; + } + parent.removeChild(end); + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + } + /** + * Binds a view's behaviors to its binding source. + * @param source - The binding source for the view's binding behaviors. + * @param context - The execution context to run the behaviors within. + */ + bind(source, context) { + const behaviors = this.behaviors; + if (this.source === source) { + return; + } else if (this.source !== null) { + const oldSource = this.source; + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + const current = behaviors[i]; + current.unbind(oldSource); + current.bind(source, context); + } + } else { + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].bind(source, context); + } + } + } + /** + * Unbinds a view's behaviors from its binding source. + */ + unbind() { + if (this.source === null) { + return; + } + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + this.source = null; + } + /** + * Efficiently disposes of a contiguous range of synthetic view instances. + * @param views - A contiguous range of views to be disposed. + */ + static disposeContiguousBatch(views) { + if (views.length === 0) { + return; + } + range.setStartBefore(views[0].firstChild); + range.setEndAfter(views[views.length - 1].lastChild); + range.deleteContents(); + for (let i = 0, ii = views.length; i < ii; ++i) { + const view = views[i]; + const behaviors = view.behaviors; + const oldSource = view.source; + for (let j = 0, jj = behaviors.length; j < jj; ++j) { + behaviors[j].unbind(oldSource); + } + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/template.js + function html(strings, ...values) { + const directives = []; + let html2 = ""; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + const currentString = strings[i]; + let value = values[i]; + html2 += currentString; + if (value instanceof ViewTemplate) { + const template = value; + value = () => template; + } + if (typeof value === "function") { + value = new HTMLBindingDirective(value); + } + if (value instanceof TargetedHTMLDirective) { + const match = lastAttributeNameRegex.exec(currentString); + if (match !== null) { + value.targetName = match[2]; + } + } + if (value instanceof HTMLDirective) { + html2 += value.createPlaceholder(directives.length); + directives.push(value); + } else { + html2 += value; + } + } + html2 += strings[strings.length - 1]; + return new ViewTemplate(html2, directives); + } + var ViewTemplate, lastAttributeNameRegex; + var init_template = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/template.js"() { + init_dom(); + init_observable(); + init_compiler(); + init_view(); + init_html_directive(); + init_binding(); + ViewTemplate = class { + /** + * Creates an instance of ViewTemplate. + * @param html - The html representing what this template will instantiate, including placeholders for directives. + * @param directives - The directives that will be connected to placeholders in the html. + */ + constructor(html2, directives) { + this.behaviorCount = 0; + this.hasHostBehaviors = false; + this.fragment = null; + this.targetOffset = 0; + this.viewBehaviorFactories = null; + this.hostBehaviorFactories = null; + this.html = html2; + this.directives = directives; + } + /** + * Creates an HTMLView instance based on this template definition. + * @param hostBindingTarget - The element that host behaviors will be bound to. + */ + create(hostBindingTarget) { + if (this.fragment === null) { + let template; + const html2 = this.html; + if (typeof html2 === "string") { + template = document.createElement("template"); + template.innerHTML = DOM.createHTML(html2); + const fec = template.content.firstElementChild; + if (fec !== null && fec.tagName === "TEMPLATE") { + template = fec; + } + } else { + template = html2; + } + const result = compileTemplate(template, this.directives); + this.fragment = result.fragment; + this.viewBehaviorFactories = result.viewBehaviorFactories; + this.hostBehaviorFactories = result.hostBehaviorFactories; + this.targetOffset = result.targetOffset; + this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; + this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; + } + const fragment = this.fragment.cloneNode(true); + const viewFactories = this.viewBehaviorFactories; + const behaviors = new Array(this.behaviorCount); + const walker = DOM.createTemplateWalker(fragment); + let behaviorIndex = 0; + let targetIndex = this.targetOffset; + let node = walker.nextNode(); + for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { + const factory = viewFactories[behaviorIndex]; + const factoryIndex = factory.targetIndex; + while (node !== null) { + if (targetIndex === factoryIndex) { + behaviors[behaviorIndex] = factory.createBehavior(node); + break; + } else { + node = walker.nextNode(); + targetIndex++; + } + } + } + if (this.hasHostBehaviors) { + const hostFactories = this.hostBehaviorFactories; + for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) { + behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); + } + } + return new HTMLView(fragment, behaviors); + } + /** + * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. + * @param source - The data source to bind the template to. + * @param host - The Element where the template will be rendered. + * @param hostBindingTarget - An HTML element to target the host bindings at if different from the + * host that the template is being attached to. + */ + render(source, host, hostBindingTarget) { + if (typeof host === "string") { + host = document.getElementById(host); + } + if (hostBindingTarget === void 0) { + hostBindingTarget = host; + } + const view = this.create(hostBindingTarget); + view.bind(source, defaultExecutionContext); + view.appendTo(host); + return view; + } + }; + lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ + /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js + function reduceStyles(styles) { + return styles.map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x]).reduce((prev, curr) => prev.concat(curr), []); + } + function reduceBehaviors(styles) { + return styles.map((x) => x instanceof ElementStyles ? x.behaviors : null).reduce((prev, curr) => { + if (curr === null) { + return prev; + } + if (prev === null) { + prev = []; + } + return prev.concat(curr); + }, null); + } + function separateSheetsToPrepend(sheets) { + const prepend = []; + const append = []; + sheets.forEach((x) => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x)); + return { prepend, append }; + } + function getNextStyleClass() { + return `fast-style-class-${++styleClassId}`; + } + var ElementStyles, prependToAdoptedStyleSheetsSymbol, addAdoptedStyleSheets, removeAdoptedStyleSheets, AdoptedStyleSheetsStyles, styleClassId, StyleElementStyles; + var init_element_styles = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js"() { + init_dom(); + ElementStyles = class { + constructor() { + this.targets = /* @__PURE__ */ new WeakSet(); + } + /** @internal */ + addStylesTo(target) { + this.targets.add(target); + } + /** @internal */ + removeStylesFrom(target) { + this.targets.delete(target); + } + /** @internal */ + isAttachedTo(target) { + return this.targets.has(target); + } + /** + * Associates behaviors with this set of styles. + * @param behaviors - The behaviors to associate. + */ + withBehaviors(...behaviors) { + this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); + return this; + } + }; + ElementStyles.create = (() => { + if (DOM.supportsAdoptedStyleSheets) { + const styleSheetCache = /* @__PURE__ */ new Map(); + return (styles) => ( + // eslint-disable-next-line @typescript-eslint/no-use-before-define + new AdoptedStyleSheetsStyles(styles, styleSheetCache) + ); + } + return (styles) => new StyleElementStyles(styles); + })(); + prependToAdoptedStyleSheetsSymbol = /* @__PURE__ */ Symbol("prependToAdoptedStyleSheets"); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append]; + }; + removeAdoptedStyleSheets = (target, sheets) => { + target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1); + }; + if (DOM.supportsAdoptedStyleSheets) { + try { + document.adoptedStyleSheets.push(); + document.adoptedStyleSheets.splice(); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets.splice(0, 0, ...prepend); + target.adoptedStyleSheets.push(...append); + }; + removeAdoptedStyleSheets = (target, sheets) => { + for (const sheet of sheets) { + const index = target.adoptedStyleSheets.indexOf(sheet); + if (index !== -1) { + target.adoptedStyleSheets.splice(index, 1); + } + } + }; + } catch (e) { + } + } + AdoptedStyleSheetsStyles = class extends ElementStyles { + constructor(styles, styleSheetCache) { + super(); + this.styles = styles; + this.styleSheetCache = styleSheetCache; + this._styleSheets = void 0; + this.behaviors = reduceBehaviors(styles); + } + get styleSheets() { + if (this._styleSheets === void 0) { + const styles = this.styles; + const styleSheetCache = this.styleSheetCache; + this._styleSheets = reduceStyles(styles).map((x) => { + if (x instanceof CSSStyleSheet) { + return x; + } + let sheet = styleSheetCache.get(x); + if (sheet === void 0) { + sheet = new CSSStyleSheet(); + sheet.replaceSync(x); + styleSheetCache.set(x, sheet); + } + return sheet; + }); + } + return this._styleSheets; + } + addStylesTo(target) { + addAdoptedStyleSheets(target, this.styleSheets); + super.addStylesTo(target); + } + removeStylesFrom(target) { + removeAdoptedStyleSheets(target, this.styleSheets); + super.removeStylesFrom(target); + } + }; + styleClassId = 0; + StyleElementStyles = class extends ElementStyles { + constructor(styles) { + super(); + this.styles = styles; + this.behaviors = null; + this.behaviors = reduceBehaviors(styles); + this.styleSheets = reduceStyles(styles); + this.styleClass = getNextStyleClass(); + } + addStylesTo(target) { + const styleSheets = this.styleSheets; + const styleClass = this.styleClass; + target = this.normalizeTarget(target); + for (let i = 0; i < styleSheets.length; i++) { + const element = document.createElement("style"); + element.innerHTML = styleSheets[i]; + element.className = styleClass; + target.append(element); + } + super.addStylesTo(target); + } + removeStylesFrom(target) { + target = this.normalizeTarget(target); + const styles = target.querySelectorAll(`.${this.styleClass}`); + for (let i = 0, ii = styles.length; i < ii; ++i) { + target.removeChild(styles[i]); + } + super.removeStylesFrom(target); + } + isAttachedTo(target) { + return super.isAttachedTo(this.normalizeTarget(target)); + } + normalizeTarget(target) { + return target === document ? document.body : target; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/attributes.js + function attr(configOrTarget, prop) { + let config; + function decorator($target, $prop) { + if (arguments.length > 1) { + config.property = $prop; + } + AttributeConfiguration.locate($target.constructor).push(config); + } + if (arguments.length > 1) { + config = {}; + decorator(configOrTarget, prop); + return; + } + config = configOrTarget === void 0 ? {} : configOrTarget; + return decorator; + } + var AttributeConfiguration, booleanConverter, nullableNumberConverter, AttributeDefinition; + var init_attributes = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/attributes.js"() { + init_observable(); + init_dom(); + init_platform(); + AttributeConfiguration = Object.freeze({ + /** + * Locates all attribute configurations associated with a type. + */ + locate: createMetadataLocator() + }); + booleanConverter = { + toView(value) { + return value ? "true" : "false"; + }, + fromView(value) { + if (value === null || value === void 0 || value === "false" || value === false || value === 0) { + return false; + } + return true; + } + }; + nullableNumberConverter = { + toView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number.toString(); + }, + fromView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number; + } + }; + AttributeDefinition = class _AttributeDefinition { + /** + * Creates an instance of AttributeDefinition. + * @param Owner - The class constructor that owns this attribute. + * @param name - The name of the property associated with the attribute. + * @param attribute - The name of the attribute in HTML. + * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. + * @param converter - A {@link ValueConverter} that integrates with the property getter/setter + * to convert values to and from a DOM string. + */ + constructor(Owner, name, attribute = name.toLowerCase(), mode = "reflect", converter) { + this.guards = /* @__PURE__ */ new Set(); + this.Owner = Owner; + this.name = name; + this.attribute = attribute; + this.mode = mode; + this.converter = converter; + this.fieldName = `_${name}`; + this.callbackName = `${name}Changed`; + this.hasCallback = this.callbackName in Owner.prototype; + if (mode === "boolean" && converter === void 0) { + this.converter = booleanConverter; + } + } + /** + * Sets the value of the attribute/property on the source element. + * @param source - The source element to access. + * @param value - The value to set the attribute/property to. + */ + setValue(source, newValue) { + const oldValue = source[this.fieldName]; + const converter = this.converter; + if (converter !== void 0) { + newValue = converter.fromView(newValue); + } + if (oldValue !== newValue) { + source[this.fieldName] = newValue; + this.tryReflectToAttribute(source); + if (this.hasCallback) { + source[this.callbackName](oldValue, newValue); + } + source.$fastController.notify(this.name); + } + } + /** + * Gets the value of the attribute/property on the source element. + * @param source - The source element to access. + */ + getValue(source) { + Observable.track(source, this.name); + return source[this.fieldName]; + } + /** @internal */ + onAttributeChangedCallback(element, value) { + if (this.guards.has(element)) { + return; + } + this.guards.add(element); + this.setValue(element, value); + this.guards.delete(element); + } + tryReflectToAttribute(element) { + const mode = this.mode; + const guards = this.guards; + if (guards.has(element) || mode === "fromView") { + return; + } + DOM.queueUpdate(() => { + guards.add(element); + const latestValue = element[this.fieldName]; + switch (mode) { + case "reflect": + const converter = this.converter; + DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); + break; + case "boolean": + DOM.setBooleanAttribute(element, this.attribute, latestValue); + break; + } + guards.delete(element); + }); + } + /** + * Collects all attribute definitions associated with the owner. + * @param Owner - The class constructor to collect attribute for. + * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. + * @internal + */ + static collect(Owner, ...attributeLists) { + const attributes = []; + attributeLists.push(AttributeConfiguration.locate(Owner)); + for (let i = 0, ii = attributeLists.length; i < ii; ++i) { + const list = attributeLists[i]; + if (list === void 0) { + continue; + } + for (let j = 0, jj = list.length; j < jj; ++j) { + const config = list[j]; + if (typeof config === "string") { + attributes.push(new _AttributeDefinition(Owner, config)); + } else { + attributes.push(new _AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); + } + } + } + return attributes; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js + var defaultShadowOptions, defaultElementOptions, fastRegistry, FASTElementDefinition; + var init_fast_definitions = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js"() { + init_platform(); + init_observable(); + init_element_styles(); + init_attributes(); + defaultShadowOptions = { mode: "open" }; + defaultElementOptions = {}; + fastRegistry = FAST.getById(4, () => { + const typeToDefinition = /* @__PURE__ */ new Map(); + return Object.freeze({ + register(definition) { + if (typeToDefinition.has(definition.type)) { + return false; + } + typeToDefinition.set(definition.type, definition); + return true; + }, + getByType(key) { + return typeToDefinition.get(key); + } + }); + }); + FASTElementDefinition = class { + /** + * Creates an instance of FASTElementDefinition. + * @param type - The type this definition is being created for. + * @param nameOrConfig - The name of the element to define or a config object + * that describes the element to define. + */ + constructor(type, nameOrConfig = type.definition) { + if (typeof nameOrConfig === "string") { + nameOrConfig = { name: nameOrConfig }; + } + this.type = type; + this.name = nameOrConfig.name; + this.template = nameOrConfig.template; + const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); + const observedAttributes = new Array(attributes.length); + const propertyLookup = {}; + const attributeLookup = {}; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const current = attributes[i]; + observedAttributes[i] = current.attribute; + propertyLookup[current.name] = current; + attributeLookup[current.attribute] = current; + } + this.attributes = attributes; + this.observedAttributes = observedAttributes; + this.propertyLookup = propertyLookup; + this.attributeLookup = attributeLookup; + this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); + this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); + this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof ElementStyles ? nameOrConfig.styles : ElementStyles.create([nameOrConfig.styles]); + } + /** + * Indicates if this element has been defined in at least one registry. + */ + get isDefined() { + return !!fastRegistry.getByType(this.type); + } + /** + * Defines a custom element based on this definition. + * @param registry - The element registry to define the element in. + */ + define(registry = customElements) { + const type = this.type; + if (fastRegistry.register(this)) { + const attributes = this.attributes; + const proto = type.prototype; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + Observable.defineProperty(proto, attributes[i]); + } + Reflect.defineProperty(type, "observedAttributes", { + value: this.observedAttributes, + enumerable: true + }); + } + if (!registry.get(this.name)) { + registry.define(this.name, type, this.elementOptions); + } + return this; + } + }; + FASTElementDefinition.forType = fastRegistry.getByType; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/controller.js + function getShadowRoot(element) { + return element.shadowRoot || shadowRoots.get(element) || null; + } + var shadowRoots, defaultEventOptions, Controller; + var init_controller = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/controller.js"() { + init_dom(); + init_notifier(); + init_observable(); + init_fast_definitions(); + shadowRoots = /* @__PURE__ */ new WeakMap(); + defaultEventOptions = { + bubbles: true, + composed: true, + cancelable: true + }; + Controller = class _Controller extends PropertyChangeNotifier { + /** + * Creates a Controller to control the specified element. + * @param element - The element to be controlled by this controller. + * @param definition - The element definition metadata that instructs this + * controller in how to handle rendering and other platform integrations. + * @internal + */ + constructor(element, definition) { + super(element); + this.boundObservables = null; + this.behaviors = null; + this.needsInitialization = true; + this._template = null; + this._styles = null; + this._isConnected = false; + this.$fastController = this; + this.view = null; + this.element = element; + this.definition = definition; + const shadowOptions = definition.shadowOptions; + if (shadowOptions !== void 0) { + const shadowRoot = element.attachShadow(shadowOptions); + if (shadowOptions.mode === "closed") { + shadowRoots.set(element, shadowRoot); + } + } + const accessors = Observable.getAccessors(element); + if (accessors.length > 0) { + const boundObservables = this.boundObservables = /* @__PURE__ */ Object.create(null); + for (let i = 0, ii = accessors.length; i < ii; ++i) { + const propertyName = accessors[i].name; + const value = element[propertyName]; + if (value !== void 0) { + delete element[propertyName]; + boundObservables[propertyName] = value; + } + } + } + } + /** + * Indicates whether or not the custom element has been + * connected to the document. + */ + get isConnected() { + Observable.track(this, "isConnected"); + return this._isConnected; + } + setIsConnected(value) { + this._isConnected = value; + Observable.notify(this, "isConnected"); + } + /** + * Gets/sets the template used to render the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get template() { + return this._template; + } + set template(value) { + if (this._template === value) { + return; + } + this._template = value; + if (!this.needsInitialization) { + this.renderTemplate(value); + } + } + /** + * Gets/sets the primary styles used for the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get styles() { + return this._styles; + } + set styles(value) { + if (this._styles === value) { + return; + } + if (this._styles !== null) { + this.removeStyles(this._styles); + } + this._styles = value; + if (!this.needsInitialization && value !== null) { + this.addStyles(value); + } + } + /** + * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. + * @param styles - The styles to add. + */ + addStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.append(styles); + } else if (!styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.addStylesTo(target); + if (sourceBehaviors !== null) { + this.addBehaviors(sourceBehaviors); + } + } + } + /** + * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. + * @param styles - the styles to remove. + */ + removeStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.removeChild(styles); + } else if (styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.removeStylesFrom(target); + if (sourceBehaviors !== null) { + this.removeBehaviors(sourceBehaviors); + } + } + } + /** + * Adds behaviors to this element. + * @param behaviors - The behaviors to add. + */ + addBehaviors(behaviors) { + const targetBehaviors = this.behaviors || (this.behaviors = /* @__PURE__ */ new Map()); + const length = behaviors.length; + const behaviorsToBind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); + } else { + targetBehaviors.set(behavior, 1); + behaviorsToBind.push(behavior); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToBind.length; ++i) { + behaviorsToBind[i].bind(element, defaultExecutionContext); + } + } + } + /** + * Removes behaviors from this element. + * @param behaviors - The behaviors to remove. + * @param force - Forces unbinding of behaviors. + */ + removeBehaviors(behaviors, force = false) { + const targetBehaviors = this.behaviors; + if (targetBehaviors === null) { + return; + } + const length = behaviors.length; + const behaviorsToUnbind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + const count = targetBehaviors.get(behavior) - 1; + count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToUnbind.length; ++i) { + behaviorsToUnbind[i].unbind(element); + } + } + } + /** + * Runs connected lifecycle behavior on the associated element. + */ + onConnectedCallback() { + if (this._isConnected) { + return; + } + const element = this.element; + if (this.needsInitialization) { + this.finishInitialization(); + } else if (this.view !== null) { + this.view.bind(element, defaultExecutionContext); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + for (const [behavior] of behaviors) { + behavior.bind(element, defaultExecutionContext); + } + } + this.setIsConnected(true); + } + /** + * Runs disconnected lifecycle behavior on the associated element. + */ + onDisconnectedCallback() { + if (!this._isConnected) { + return; + } + this.setIsConnected(false); + const view = this.view; + if (view !== null) { + view.unbind(); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + const element = this.element; + for (const [behavior] of behaviors) { + behavior.unbind(element); + } + } + } + /** + * Runs the attribute changed callback for the associated element. + * @param name - The name of the attribute that changed. + * @param oldValue - The previous value of the attribute. + * @param newValue - The new value of the attribute. + */ + onAttributeChangedCallback(name, oldValue, newValue) { + const attrDef = this.definition.attributeLookup[name]; + if (attrDef !== void 0) { + attrDef.onAttributeChangedCallback(this.element, newValue); + } + } + /** + * Emits a custom HTML event. + * @param type - The type name of the event. + * @param detail - The event detail object to send with the event. + * @param options - The event options. By default bubbles and composed. + * @remarks + * Only emits events if connected. + */ + emit(type, detail, options) { + if (this._isConnected) { + return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options))); + } + return false; + } + finishInitialization() { + const element = this.element; + const boundObservables = this.boundObservables; + if (boundObservables !== null) { + const propertyNames = Object.keys(boundObservables); + for (let i = 0, ii = propertyNames.length; i < ii; ++i) { + const propertyName = propertyNames[i]; + element[propertyName] = boundObservables[propertyName]; + } + this.boundObservables = null; + } + const definition = this.definition; + if (this._template === null) { + if (this.element.resolveTemplate) { + this._template = this.element.resolveTemplate(); + } else if (definition.template) { + this._template = definition.template || null; + } + } + if (this._template !== null) { + this.renderTemplate(this._template); + } + if (this._styles === null) { + if (this.element.resolveStyles) { + this._styles = this.element.resolveStyles(); + } else if (definition.styles) { + this._styles = definition.styles || null; + } + } + if (this._styles !== null) { + this.addStyles(this._styles); + } + this.needsInitialization = false; + } + renderTemplate(template) { + const element = this.element; + const host = getShadowRoot(element) || element; + if (this.view !== null) { + this.view.dispose(); + this.view = null; + } else if (!this.needsInitialization) { + DOM.removeChildNodes(host); + } + if (template) { + this.view = template.render(element, host, element); + } + } + /** + * Locates or creates a controller for the specified element. + * @param element - The element to return the controller for. + * @remarks + * The specified element must have a {@link FASTElementDefinition} + * registered either through the use of the {@link customElement} + * decorator or a call to `FASTElement.define`. + */ + static forCustomElement(element) { + const controller = element.$fastController; + if (controller !== void 0) { + return controller; + } + const definition = FASTElementDefinition.forType(element.constructor); + if (definition === void 0) { + throw new Error("Missing FASTElement definition."); + } + return element.$fastController = new _Controller(element, definition); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js + function createFASTElement(BaseType) { + return class extends BaseType { + constructor() { + super(); + Controller.forCustomElement(this); + } + $emit(type, detail, options) { + return this.$fastController.emit(type, detail, options); + } + connectedCallback() { + this.$fastController.onConnectedCallback(); + } + disconnectedCallback() { + this.$fastController.onDisconnectedCallback(); + } + attributeChangedCallback(name, oldValue, newValue) { + this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); + } + }; + } + var FASTElement; + var init_fast_element = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js"() { + init_controller(); + init_fast_definitions(); + FASTElement = Object.assign(createFASTElement(HTMLElement), { + /** + * Creates a new FASTElement base class inherited from the + * provided base type. + * @param BaseType - The base element type to inherit from. + */ + from(BaseType) { + return createFASTElement(BaseType); + }, + /** + * Defines a platform custom element based on the provided type and definition. + * @param type - The custom element type to define. + * @param nameOrDef - The name of the element to define or a definition object + * that describes the element to define. + */ + define(type, nameOrDef) { + return new FASTElementDefinition(type, nameOrDef).define().type; + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js + var CSSDirective; + var init_css_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js"() { + CSSDirective = class { + /** + * Creates a CSS fragment to interpolate into the CSS document. + * @returns - the string to interpolate into CSS + */ + createCSS() { + return ""; + } + /** + * Creates a behavior to bind to the host element. + * @returns - the behavior to bind to the host element, or undefined. + */ + createBehavior() { + return void 0; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css.js + function collectStyles(strings, values) { + const styles = []; + let cssString = ""; + const behaviors = []; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + cssString += strings[i]; + let value = values[i]; + if (value instanceof CSSDirective) { + const behavior = value.createBehavior(); + value = value.createCSS(); + if (behavior) { + behaviors.push(behavior); + } + } + if (value instanceof ElementStyles || value instanceof CSSStyleSheet) { + if (cssString.trim() !== "") { + styles.push(cssString); + cssString = ""; + } + styles.push(value); + } else { + cssString += value; + } + } + cssString += strings[strings.length - 1]; + if (cssString.trim() !== "") { + styles.push(cssString); + } + return { + styles, + behaviors + }; + } + function css(strings, ...values) { + const { styles, behaviors } = collectStyles(strings, values); + const elementStyles = ElementStyles.create(styles); + if (behaviors.length) { + elementStyles.withBehaviors(...behaviors); + } + return elementStyles; + } + var init_css = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css.js"() { + init_css_directive(); + init_element_styles(); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js + function newSplice(index, removed, addedCount) { + return { + index, + removed, + addedCount + }; + } + function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { + const rowCount = oldEnd - oldStart + 1; + const columnCount = currentEnd - currentStart + 1; + const distances = new Array(rowCount); + let north; + let west; + for (let i = 0; i < rowCount; ++i) { + distances[i] = new Array(columnCount); + distances[i][0] = i; + } + for (let j = 0; j < columnCount; ++j) { + distances[0][j] = j; + } + for (let i = 1; i < rowCount; ++i) { + for (let j = 1; j < columnCount; ++j) { + if (current[currentStart + j - 1] === old[oldStart + i - 1]) { + distances[i][j] = distances[i - 1][j - 1]; + } else { + north = distances[i - 1][j] + 1; + west = distances[i][j - 1] + 1; + distances[i][j] = north < west ? north : west; + } + } + } + return distances; + } + function spliceOperationsFromEditDistances(distances) { + let i = distances.length - 1; + let j = distances[0].length - 1; + let current = distances[i][j]; + const edits = []; + while (i > 0 || j > 0) { + if (i === 0) { + edits.push(EDIT_ADD); + j--; + continue; + } + if (j === 0) { + edits.push(EDIT_DELETE); + i--; + continue; + } + const northWest = distances[i - 1][j - 1]; + const west = distances[i - 1][j]; + const north = distances[i][j - 1]; + let min; + if (west < north) { + min = west < northWest ? west : northWest; + } else { + min = north < northWest ? north : northWest; + } + if (min === northWest) { + if (northWest === current) { + edits.push(EDIT_LEAVE); + } else { + edits.push(EDIT_UPDATE); + current = northWest; + } + i--; + j--; + } else if (min === west) { + edits.push(EDIT_DELETE); + i--; + current = west; + } else { + edits.push(EDIT_ADD); + j--; + current = north; + } + } + edits.reverse(); + return edits; + } + function sharedPrefix(current, old, searchLength) { + for (let i = 0; i < searchLength; ++i) { + if (current[i] !== old[i]) { + return i; + } + } + return searchLength; + } + function sharedSuffix(current, old, searchLength) { + let index1 = current.length; + let index2 = old.length; + let count = 0; + while (count < searchLength && current[--index1] === old[--index2]) { + count++; + } + return count; + } + function intersect(start1, end1, start2, end2) { + if (end1 < start2 || end2 < start1) { + return -1; + } + if (end1 === start2 || end2 === start1) { + return 0; + } + if (start1 < start2) { + if (end1 < end2) { + return end1 - start2; + } + return end2 - start2; + } + if (end2 < end1) { + return end2 - start1; + } + return end1 - start1; + } + function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { + let prefixCount = 0; + let suffixCount = 0; + const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); + if (currentStart === 0 && oldStart === 0) { + prefixCount = sharedPrefix(current, old, minLength); + } + if (currentEnd === current.length && oldEnd === old.length) { + suffixCount = sharedSuffix(current, old, minLength - prefixCount); + } + currentStart += prefixCount; + oldStart += prefixCount; + currentEnd -= suffixCount; + oldEnd -= suffixCount; + if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) { + return emptyArray; + } + if (currentStart === currentEnd) { + const splice2 = newSplice(currentStart, [], 0); + while (oldStart < oldEnd) { + splice2.removed.push(old[oldStart++]); + } + return [splice2]; + } else if (oldStart === oldEnd) { + return [newSplice(currentStart, [], currentEnd - currentStart)]; + } + const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); + const splices = []; + let splice = void 0; + let index = currentStart; + let oldIndex = oldStart; + for (let i = 0; i < ops.length; ++i) { + switch (ops[i]) { + case EDIT_LEAVE: + if (splice !== void 0) { + splices.push(splice); + splice = void 0; + } + index++; + oldIndex++; + break; + case EDIT_UPDATE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + case EDIT_ADD: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + break; + case EDIT_DELETE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + } + } + if (splice !== void 0) { + splices.push(splice); + } + return splices; + } + function mergeSplice(splices, index, removed, addedCount) { + const splice = newSplice(index, removed, addedCount); + let inserted = false; + let insertionOffset = 0; + for (let i = 0; i < splices.length; i++) { + const current = splices[i]; + current.index += insertionOffset; + if (inserted) { + continue; + } + const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount); + if (intersectCount >= 0) { + splices.splice(i, 1); + i--; + insertionOffset -= current.addedCount - current.removed.length; + splice.addedCount += current.addedCount - intersectCount; + const deleteCount = splice.removed.length + current.removed.length - intersectCount; + if (!splice.addedCount && !deleteCount) { + inserted = true; + } else { + let currentRemoved = current.removed; + if (splice.index < current.index) { + const prepend = splice.removed.slice(0, current.index - splice.index); + $push.apply(prepend, currentRemoved); + currentRemoved = prepend; + } + if (splice.index + splice.removed.length > current.index + current.addedCount) { + const append = splice.removed.slice(current.index + current.addedCount - splice.index); + $push.apply(currentRemoved, append); + } + splice.removed = currentRemoved; + if (current.index < splice.index) { + splice.index = current.index; + } + } + } else if (splice.index < current.index) { + inserted = true; + splices.splice(i, 0, splice); + i++; + const offset = splice.addedCount - splice.removed.length; + current.index += offset; + insertionOffset += offset; + } + } + if (!inserted) { + splices.push(splice); + } + } + function createInitialSplices(changeRecords) { + const splices = []; + for (let i = 0, ii = changeRecords.length; i < ii; i++) { + const record = changeRecords[i]; + mergeSplice(splices, record.index, record.removed, record.addedCount); + } + return splices; + } + function projectArraySplices(array, changeRecords) { + let splices = []; + const initialSplices = createInitialSplices(changeRecords); + for (let i = 0, ii = initialSplices.length; i < ii; ++i) { + const splice = initialSplices[i]; + if (splice.addedCount === 1 && splice.removed.length === 1) { + if (splice.removed[0] !== array[splice.index]) { + splices.push(splice); + } + continue; + } + splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length)); + } + return splices; + } + var EDIT_LEAVE, EDIT_UPDATE, EDIT_ADD, EDIT_DELETE, $push; + var init_array_change_records = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js"() { + init_platform(); + EDIT_LEAVE = 0; + EDIT_UPDATE = 1; + EDIT_ADD = 2; + EDIT_DELETE = 3; + $push = Array.prototype.push; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js + function adjustIndex(changeRecord, array) { + let index = changeRecord.index; + const arrayLength = array.length; + if (index > arrayLength) { + index = arrayLength - changeRecord.addedCount; + } else if (index < 0) { + index = arrayLength + changeRecord.removed.length + index - changeRecord.addedCount; + } + if (index < 0) { + index = 0; + } + changeRecord.index = index; + return changeRecord; + } + function enableArrayObservation() { + if (arrayObservationEnabled) { + return; + } + arrayObservationEnabled = true; + Observable.setArrayObserverFactory((collection) => { + return new ArrayObserver(collection); + }); + const proto = Array.prototype; + if (proto.$fastPatch) { + return; + } + Reflect.defineProperty(proto, "$fastPatch", { + value: 1, + enumerable: false + }); + const pop = proto.pop; + const push = proto.push; + const reverse = proto.reverse; + const shift = proto.shift; + const sort = proto.sort; + const splice = proto.splice; + const unshift = proto.unshift; + proto.pop = function() { + const notEmpty = this.length > 0; + const methodCallResult = pop.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(this.length, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.push = function() { + const methodCallResult = push.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this)); + } + return methodCallResult; + }; + proto.reverse = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = reverse.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.shift = function() { + const notEmpty = this.length > 0; + const methodCallResult = shift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(0, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.sort = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = sort.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.splice = function() { + const methodCallResult = splice.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this)); + } + return methodCallResult; + }; + proto.unshift = function() { + const methodCallResult = unshift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this)); + } + return methodCallResult; + }; + } + var arrayObservationEnabled, ArrayObserver; + var init_array_observer = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js"() { + init_dom(); + init_array_change_records(); + init_notifier(); + init_observable(); + arrayObservationEnabled = false; + ArrayObserver = class extends SubscriberSet { + constructor(source) { + super(source); + this.oldCollection = void 0; + this.splices = void 0; + this.needsQueue = true; + this.call = this.flush; + Reflect.defineProperty(source, "$fastController", { + value: this, + enumerable: false + }); + } + subscribe(subscriber) { + this.flush(); + super.subscribe(subscriber); + } + addSplice(splice) { + if (this.splices === void 0) { + this.splices = [splice]; + } else { + this.splices.push(splice); + } + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + reset(oldCollection) { + this.oldCollection = oldCollection; + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + flush() { + const splices = this.splices; + const oldCollection = this.oldCollection; + if (splices === void 0 && oldCollection === void 0) { + return; + } + this.needsQueue = true; + this.splices = void 0; + this.oldCollection = void 0; + const finalSplices = oldCollection === void 0 ? projectArraySplices(this.source, splices) : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length); + this.notify(finalSplices); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/ref.js + function ref(propertyName) { + return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); + } + var RefBehavior; + var init_ref = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/ref.js"() { + init_html_directive(); + RefBehavior = class { + /** + * Creates an instance of RefBehavior. + * @param target - The element to reference. + * @param propertyName - The name of the property to assign the reference to. + */ + constructor(target, propertyName) { + this.target = target; + this.propertyName = propertyName; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + source[this.propertyName] = this.target; + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ + unbind() { + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/interfaces.js + var isFunction; + var init_interfaces = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/interfaces.js"() { + isFunction = (object) => typeof object === "function"; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/when.js + function normalizeBinding(value) { + return value === void 0 ? noTemplate : isFunction(value) ? value : () => value; + } + function when(binding, templateOrTemplateBinding, elseTemplateOrTemplateBinding) { + const dataBinding = isFunction(binding) ? binding : () => binding; + const templateBinding = normalizeBinding(templateOrTemplateBinding); + const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding); + return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context); + } + var noTemplate; + var init_when = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/when.js"() { + init_interfaces(); + noTemplate = () => null; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js + function bindWithoutPositioning(view, items, index, context) { + view.bind(items[index], context); + } + function bindWithPositioning(view, items, index, context) { + const childContext = Object.create(context); + childContext.index = index; + childContext.length = items.length; + view.bind(items[index], childContext); + } + var defaultRepeatOptions, RepeatBehavior, RepeatDirective; + var init_repeat = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js"() { + init_dom(); + init_observable(); + init_array_observer(); + init_platform(); + init_html_directive(); + init_view(); + defaultRepeatOptions = Object.freeze({ + positioning: false, + recycle: true + }); + RepeatBehavior = class { + /** + * Creates an instance of RepeatBehavior. + * @param location - The location in the DOM to render the repeat. + * @param itemsBinding - The array to render. + * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies. + * @param templateBinding - The template to render for each item. + * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies. + * @param options - Options used to turn on special repeat features. + */ + constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) { + this.location = location; + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.source = null; + this.views = []; + this.items = null; + this.itemsObserver = null; + this.originalContext = void 0; + this.childContext = void 0; + this.bindView = bindWithoutPositioning; + this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile); + this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile); + if (options.positioning) { + this.bindView = bindWithPositioning; + } + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source, context) { + this.source = source; + this.originalContext = context; + this.childContext = Object.create(context); + this.childContext.parent = source; + this.childContext.parentContext = this.originalContext; + this.items = this.itemsBindingObserver.observe(source, this.originalContext); + this.template = this.templateBindingObserver.observe(source, this.originalContext); + this.observeItems(true); + this.refreshAllViews(); + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.source = null; + this.items = null; + if (this.itemsObserver !== null) { + this.itemsObserver.unsubscribe(this); + } + this.unbindAllViews(); + this.itemsBindingObserver.disconnect(); + this.templateBindingObserver.disconnect(); + } + /** @internal */ + handleChange(source, args) { + if (source === this.itemsBinding) { + this.items = this.itemsBindingObserver.observe(this.source, this.originalContext); + this.observeItems(); + this.refreshAllViews(); + } else if (source === this.templateBinding) { + this.template = this.templateBindingObserver.observe(this.source, this.originalContext); + this.refreshAllViews(true); + } else { + this.updateViews(args); + } + } + observeItems(force = false) { + if (!this.items) { + this.items = emptyArray; + return; + } + const oldObserver = this.itemsObserver; + const newObserver = this.itemsObserver = Observable.getNotifier(this.items); + const hasNewObserver = oldObserver !== newObserver; + if (hasNewObserver && oldObserver !== null) { + oldObserver.unsubscribe(this); + } + if (hasNewObserver || force) { + newObserver.subscribe(this); + } + } + updateViews(splices) { + const childContext = this.childContext; + const views = this.views; + const bindView = this.bindView; + const items = this.items; + const template = this.template; + const recycle = this.options.recycle; + const leftoverViews = []; + let leftoverIndex = 0; + let availableViews = 0; + for (let i = 0, ii = splices.length; i < ii; ++i) { + const splice = splices[i]; + const removed = splice.removed; + let removeIndex = 0; + let addIndex = splice.index; + const end = addIndex + splice.addedCount; + const removedViews = views.splice(splice.index, removed.length); + const totalAvailableViews = availableViews = leftoverViews.length + removedViews.length; + for (; addIndex < end; ++addIndex) { + const neighbor = views[addIndex]; + const location = neighbor ? neighbor.firstChild : this.location; + let view; + if (recycle && availableViews > 0) { + if (removeIndex <= totalAvailableViews && removedViews.length > 0) { + view = removedViews[removeIndex]; + removeIndex++; + } else { + view = leftoverViews[leftoverIndex]; + leftoverIndex++; + } + availableViews--; + } else { + view = template.create(); + } + views.splice(addIndex, 0, view); + bindView(view, items, addIndex, childContext); + view.insertBefore(location); + } + if (removedViews[removeIndex]) { + leftoverViews.push(...removedViews.slice(removeIndex)); + } + } + for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) { + leftoverViews[i].dispose(); + } + if (this.options.positioning) { + for (let i = 0, ii = views.length; i < ii; ++i) { + const currentContext = views[i].context; + currentContext.length = ii; + currentContext.index = i; + } + } + } + refreshAllViews(templateChanged = false) { + const items = this.items; + const childContext = this.childContext; + const template = this.template; + const location = this.location; + const bindView = this.bindView; + let itemsLength = items.length; + let views = this.views; + let viewsLength = views.length; + if (itemsLength === 0 || templateChanged || !this.options.recycle) { + HTMLView.disposeContiguousBatch(views); + viewsLength = 0; + } + if (viewsLength === 0) { + this.views = views = new Array(itemsLength); + for (let i = 0; i < itemsLength; ++i) { + const view = template.create(); + bindView(view, items, i, childContext); + views[i] = view; + view.insertBefore(location); + } + } else { + let i = 0; + for (; i < itemsLength; ++i) { + if (i < viewsLength) { + const view = views[i]; + bindView(view, items, i, childContext); + } else { + const view = template.create(); + bindView(view, items, i, childContext); + views.push(view); + view.insertBefore(location); + } + } + const removed = views.splice(i, viewsLength - i); + for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) { + removed[i].dispose(); + } + } + } + unbindAllViews() { + const views = this.views; + for (let i = 0, ii = views.length; i < ii; ++i) { + views[i].unbind(); + } + } + }; + RepeatDirective = class extends HTMLDirective { + /** + * Creates an instance of RepeatDirective. + * @param itemsBinding - The binding that provides the array to render. + * @param templateBinding - The template binding used to obtain a template to render for each item in the array. + * @param options - Options used to turn on special repeat features. + */ + constructor(itemsBinding, templateBinding, options) { + super(); + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.createPlaceholder = DOM.createBlockPlaceholder; + enableArrayObservation(); + this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding); + this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + */ + createBehavior(target) { + return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js + function elements(selector) { + if (selector) { + return function(value, index, array) { + return value.nodeType === 1 && value.matches(selector); + }; + } + return function(value, index, array) { + return value.nodeType === 1; + }; + } + var NodeObservationBehavior; + var init_node_observation = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js"() { + init_observable(); + init_platform(); + NodeObservationBehavior = class { + /** + * Creates an instance of NodeObservationBehavior. + * @param target - The target to assign the nodes property on. + * @param options - The options to use in configuring node observation. + */ + constructor(target, options) { + this.target = target; + this.options = options; + this.source = null; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + const name = this.options.property; + this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name); + this.source = source; + this.updateTarget(this.computeNodes()); + if (this.shouldUpdate) { + this.observe(); + } + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.updateTarget(emptyArray); + this.source = null; + if (this.shouldUpdate) { + this.disconnect(); + } + } + /** @internal */ + handleEvent() { + this.updateTarget(this.computeNodes()); + } + computeNodes() { + let nodes = this.getNodes(); + if (this.options.filter !== void 0) { + nodes = nodes.filter(this.options.filter); + } + return nodes; + } + updateTarget(value) { + this.source[this.options.property] = value; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js + function slotted(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { property: propertyOrOptions }; + } + return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions); + } + var SlottedBehavior; + var init_slotted = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js"() { + init_html_directive(); + init_node_observation(); + SlottedBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of SlottedBehavior. + * @param target - The slot element target to observe. + * @param options - The options to use when observing the slot. + */ + constructor(target, options) { + super(target, options); + } + /** + * Begins observation of the nodes. + */ + observe() { + this.target.addEventListener("slotchange", this); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.target.removeEventListener("slotchange", this); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + return this.target.assignedNodes(this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/children.js + function children(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { + property: propertyOrOptions + }; + } + return new AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions); + } + var ChildrenBehavior; + var init_children = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/children.js"() { + init_html_directive(); + init_node_observation(); + ChildrenBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of ChildrenBehavior. + * @param target - The element target to observe children on. + * @param options - The options to use when observing the element children. + */ + constructor(target, options) { + super(target, options); + this.observer = null; + options.childList = true; + } + /** + * Begins observation of the nodes. + */ + observe() { + if (this.observer === null) { + this.observer = new MutationObserver(this.handleEvent.bind(this)); + } + this.observer.observe(this.target, this.options); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.observer.disconnect(); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + if ("subtree" in this.options) { + return Array.from(this.target.querySelectorAll(this.options.selector)); + } + return Array.from(this.target.childNodes); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/index.js + var init_esm = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/index.js"() { + init_platform(); + init_template(); + init_fast_element(); + init_fast_definitions(); + init_attributes(); + init_controller(); + init_compiler(); + init_element_styles(); + init_css(); + init_css_directive(); + init_view(); + init_observable(); + init_notifier(); + init_dom(); + init_binding(); + init_html_directive(); + init_ref(); + init_when(); + init_repeat(); + init_slotted(); + init_children(); + init_node_observation(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js + var StartEnd, endSlotTemplate, startSlotTemplate, endTemplate, startTemplate; + var init_start_end = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js"() { + init_esm(); + StartEnd = class { + handleStartContentChange() { + this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); + } + handleEndContentChange() { + this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); + } + }; + endSlotTemplate = (context, definition) => html` + definition.end ? "end" : void 0} + > + + ${definition.end || ""} + + +`; + startSlotTemplate = (context, definition) => html` + + + ${definition.start || ""} + + +`; + endTemplate = html` + + + +`; + startTemplate = html` + + + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js + var init_accordion_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es6 = __esm({ + "node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/di.js + function cloneArrayWithPossibleProps(source) { + const clone = source.slice(); + const keys = Object.keys(source); + const len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + clone[key] = source[key]; + } + } + return clone; + } + function getParamTypes(key) { + return (Type) => { + return Reflect.getOwnMetadata(key, Type); + }; + } + function createResolver(getter) { + return function(key) { + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor); + }; + return resolver; + }; + } + function createAllResolver(getter) { + return function(key, searchAncestors) { + searchAncestors = !!searchAncestors; + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor, searchAncestors); + }; + return resolver; + }; + } + function ignore(target, property, descriptor) { + DI.inject(ignore)(target, property, descriptor); + } + function createNewInstance(key, handler) { + return handler.getFactory(key).construct(handler); + } + function containerGetKey(d) { + return this.get(d); + } + function transformInstance(inst, transform) { + return transform(inst); + } + function isRegistry(obj) { + return typeof obj.register === "function"; + } + function isSelfRegistry(obj) { + return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; + } + function isRegisterInRequester(obj) { + return isSelfRegistry(obj) && obj.registerInRequestor; + } + function isClass(obj) { + return obj.prototype !== void 0; + } + function cacheCallbackResult(fun) { + return function(handler, requestor, resolver) { + if (cache.has(resolver)) { + return cache.get(resolver); + } + const t = fun(handler, requestor, resolver); + cache.set(resolver, t); + return t; + }; + } + function validateKey(key) { + if (key === null || key === void 0) { + throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); + } + } + function buildAllResponse(resolver, handler, requestor) { + if (resolver instanceof ResolverImpl && resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].resolve(handler, requestor); + } + return results; + } + return [resolver.resolve(handler, requestor)]; + } + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + function isArrayIndex(value) { + switch (typeof value) { + case "number": + return value >= 0 && (value | 0) === value; + case "string": { + const result = isNumericLookup[value]; + if (result !== void 0) { + return result; + } + const length = value.length; + if (length === 0) { + return isNumericLookup[value] = false; + } + let ch = 0; + for (let i = 0; i < length; ++i) { + ch = value.charCodeAt(i); + if (i === 0 && ch === 48 && length > 1 || ch < 48 || ch > 57) { + return isNumericLookup[value] = false; + } + } + return isNumericLookup[value] = true; + } + default: + return false; + } + } + var metadataByTarget, ResolverBuilder, DefaultResolver, ContainerConfiguration, dependencyLookup, rootDOMContainer, DI, Container, inject, defaultSingletonOptions, all, lazy, optional, newInstanceForScope, newInstanceOf, ResolverImpl, FactoryImpl, containerResolver, InstrinsicTypeNames, DILocateParentEventType, factories, ContainerImpl, cache, Registration, defaultFriendlyName, isNativeFunction, isNumericLookup; + var init_di = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"() { + init_esm(); + metadataByTarget = /* @__PURE__ */ new Map(); + if (!("metadata" in Reflect)) { + Reflect.metadata = function(key, value) { + return function(target) { + Reflect.defineMetadata(key, value, target); + }; + }; + Reflect.defineMetadata = function(key, value, target) { + let metadata = metadataByTarget.get(target); + if (metadata === void 0) { + metadataByTarget.set(target, metadata = /* @__PURE__ */ new Map()); + } + metadata.set(key, value); + }; + Reflect.getOwnMetadata = function(key, target) { + const metadata = metadataByTarget.get(target); + if (metadata !== void 0) { + return metadata.get(key); + } + return void 0; + }; + } + ResolverBuilder = class { + /** + * + * @param container - The container to create resolvers for. + * @param key - The key to register resolvers under. + */ + constructor(container, key) { + this.container = container; + this.key = key; + } + /** + * Creates a resolver for an existing object instance. + * @param value - The instance to resolve. + * @returns The resolver. + */ + instance(value) { + return this.registerResolver(0, value); + } + /** + * Creates a resolver that enforces a singleton lifetime. + * @param value - The type to create and cache the singleton for. + * @returns The resolver. + */ + singleton(value) { + return this.registerResolver(1, value); + } + /** + * Creates a resolver that creates a new instance for every dependency request. + * @param value - The type to create instances of. + * @returns - The resolver. + */ + transient(value) { + return this.registerResolver(2, value); + } + /** + * Creates a resolver that invokes a callback function for every dependency resolution + * request, allowing custom logic to return the dependency. + * @param value - The callback to call during resolution. + * @returns The resolver. + */ + callback(value) { + return this.registerResolver(3, value); + } + /** + * Creates a resolver that invokes a callback function the first time that a dependency + * resolution is requested. The returned value is then cached and provided for all + * subsequent requests. + * @param value - The callback to call during the first resolution. + * @returns The resolver. + */ + cachedCallback(value) { + return this.registerResolver(3, cacheCallbackResult(value)); + } + /** + * Aliases the current key to a different key. + * @param destinationKey - The key to point the alias to. + * @returns The resolver. + */ + aliasTo(destinationKey) { + return this.registerResolver(5, destinationKey); + } + registerResolver(strategy, state) { + const { container, key } = this; + this.container = this.key = void 0; + return container.registerResolver(key, new ResolverImpl(key, strategy, state)); + } + }; + DefaultResolver = Object.freeze({ + /** + * Disables auto-registration and throws for all un-registered dependencies. + * @param key - The key to create the resolver for. + */ + none(key) { + throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`); + }, + /** + * Provides default singleton resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + singleton(key) { + return new ResolverImpl(key, 1, key); + }, + /** + * Provides default transient resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + transient(key) { + return new ResolverImpl(key, 2, key); + } + }); + ContainerConfiguration = Object.freeze({ + /** + * The default configuration used when creating a DOM-disconnected container. + * @remarks + * The default creates a root container, with no parent container. It does not handle + * owner requests and it uses singleton resolution behavior for auto-registration. + */ + default: Object.freeze({ + parentLocator: () => null, + responsibleForOwnerRequests: false, + defaultResolver: DefaultResolver.singleton + }) + }); + dependencyLookup = /* @__PURE__ */ new Map(); + rootDOMContainer = null; + DI = Object.freeze({ + /** + * Creates a new dependency injection container. + * @param config - The configuration for the container. + * @returns A newly created dependency injection container. + */ + createContainer(config) { + return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); + }, + /** + * Finds the dependency injection container responsible for providing dependencies + * to the specified node. + * @param node - The node to find the responsible container for. + * @returns The container responsible for providing dependencies to the node. + * @remarks + * This will be the same as the parent container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findResponsibleContainer(node) { + const owned = node.$$container$$; + if (owned && owned.responsibleForOwnerRequests) { + return owned; + } + return DI.findParentContainer(node); + }, + /** + * Find the dependency injection container up the DOM tree from this node. + * @param node - The node to find the parent container for. + * @returns The parent container of this node. + * @remarks + * This will be the same as the responsible container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findParentContainer(node) { + const event = new CustomEvent(DILocateParentEventType, { + bubbles: true, + composed: true, + cancelable: true, + detail: { container: void 0 } + }); + node.dispatchEvent(event); + return event.detail.container || DI.getOrCreateDOMContainer(); + }, + /** + * Returns a dependency injection container if one is explicitly owned by the specified + * node. If one is not owned, then a new container is created and assigned to the node. + * @param node - The node to find or create the container for. + * @param config - The configuration for the container if one needs to be created. + * @returns The located or created container. + * @remarks + * This API does not search for a responsible or parent container. It looks only for a container + * directly defined on the specified node and creates one at that location if one does not + * already exist. + */ + getOrCreateDOMContainer(node, config) { + if (!node) { + return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: () => null + }))); + } + return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: DI.findParentContainer + })); + }, + /** + * Gets the "design:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getDesignParamtypes: getParamTypes("design:paramtypes"), + /** + * Gets the "di:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getAnnotationParamtypes: getParamTypes("di:paramtypes"), + /** + * + * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, + * an empty metadata array is created and added. + * @returns The metadata array. + */ + getOrCreateAnnotationParamTypes(Type) { + let annotationParamtypes = this.getAnnotationParamtypes(Type); + if (annotationParamtypes === void 0) { + Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); + } + return annotationParamtypes; + }, + /** + * Gets the dependency keys representing what is needed to instantiate the specified type. + * @param Type - The type to get the dependencies for. + * @returns An array of dependency keys. + */ + getDependencies(Type) { + let dependencies = dependencyLookup.get(Type); + if (dependencies === void 0) { + const inject2 = Type.inject; + if (inject2 === void 0) { + const designParamtypes = DI.getDesignParamtypes(Type); + const annotationParamtypes = DI.getAnnotationParamtypes(Type); + if (designParamtypes === void 0) { + if (annotationParamtypes === void 0) { + const Proto = Object.getPrototypeOf(Type); + if (typeof Proto === "function" && Proto !== Function.prototype) { + dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); + } else { + dependencies = []; + } + } else { + dependencies = cloneArrayWithPossibleProps(annotationParamtypes); + } + } else if (annotationParamtypes === void 0) { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + } else { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + let len = annotationParamtypes.length; + let auAnnotationParamtype; + for (let i = 0; i < len; ++i) { + auAnnotationParamtype = annotationParamtypes[i]; + if (auAnnotationParamtype !== void 0) { + dependencies[i] = auAnnotationParamtype; + } + } + const keys = Object.keys(annotationParamtypes); + len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + dependencies[key] = annotationParamtypes[key]; + } + } + } + } else { + dependencies = cloneArrayWithPossibleProps(inject2); + } + dependencyLookup.set(Type, dependencies); + } + return dependencies; + }, + /** + * Defines a property on a web component class. The value of this property will + * be resolved from the dependency injection container responsible for the element + * instance, based on where it is connected in the DOM. + * @param target - The target to define the property on. + * @param propertyName - The name of the property to define. + * @param key - The dependency injection key. + * @param respectConnection - Indicates whether or not to update the property value if the + * hosting component is disconnected and then re-connected at a different location in the DOM. + * @remarks + * The respectConnection option is only applicable to elements that descend from FASTElement. + */ + defineProperty(target, propertyName, key, respectConnection = false) { + const diPropertyKey = `$di_${propertyName}`; + Reflect.defineProperty(target, propertyName, { + get: function() { + let value = this[diPropertyKey]; + if (value === void 0) { + const container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); + value = container.get(key); + this[diPropertyKey] = value; + if (respectConnection && this instanceof FASTElement) { + const notifier = this.$fastController; + const handleChange = () => { + const newContainer = DI.findResponsibleContainer(this); + const newValue = newContainer.get(key); + const oldValue = this[diPropertyKey]; + if (newValue !== oldValue) { + this[diPropertyKey] = value; + notifier.notify(propertyName); + } + }; + notifier.subscribe({ handleChange }, "isConnected"); + } + } + return value; + } + }); + }, + /** + * Creates a dependency injection key. + * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a + * default resolution for the dependency. + * @param configuror - If a friendly name was provided for the first parameter, then an optional + * lambda that configures a default resolution for the dependency can be provided second. + * @returns The created key. + * @remarks + * The created key can be used as a property decorator or constructor parameter decorator, + * in addition to its standard use in an inject array or through direct container APIs. + */ + createInterface(nameConfigOrCallback, configuror) { + const configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; + const friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; + const respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; + const Interface = function(target, property, index) { + if (target == null || new.target !== void 0) { + throw new Error(`No registration for interface: '${Interface.friendlyName}'`); + } + if (property) { + DI.defineProperty(target, property, Interface, respectConnection); + } else { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + annotationParamtypes[index] = Interface; + } + }; + Interface.$isInterface = true; + Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; + if (configure != null) { + Interface.register = function(container, key) { + return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); + }; + } + Interface.toString = function toString() { + return `InterfaceSymbol<${Interface.friendlyName}>`; + }; + return Interface; + }, + /** + * A decorator that specifies what to inject into its target. + * @param dependencies - The dependencies to inject. + * @returns The decorator to be applied to the target class. + * @remarks + * The decorator can be used to decorate a class, listing all of the classes dependencies. + * Or it can be used to decorate a constructor paramter, indicating what to inject for that + * parameter. + * Or it can be used for a web component property, indicating what that property should resolve to. + */ + inject(...dependencies) { + return function(target, key, descriptor) { + if (typeof descriptor === "number") { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + const dep = dependencies[0]; + if (dep !== void 0) { + annotationParamtypes[descriptor] = dep; + } + } else if (key) { + DI.defineProperty(target, key, dependencies[0]); + } else { + const annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); + let dep; + for (let i = 0; i < dependencies.length; ++i) { + dep = dependencies[i]; + if (dep !== void 0) { + annotationParamtypes[i] = dep; + } + } + } + }; + }, + /** + * Registers the `target` class as a transient dependency; each time the dependency is resolved + * a new instance will be created. + * + * @param target - The class / constructor function to register as transient. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.transient(Foo); + * ``` + * + * @example + * Inline declaration + * + * ```ts + * const Foo = DI.transient(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + transient(target) { + target.register = function register(container) { + const registration = Registration.transient(target, target); + return registration.register(container); + }; + target.registerInRequestor = false; + return target; + }, + /** + * Registers the `target` class as a singleton dependency; the class will only be created once. Each + * consecutive time the dependency is resolved, the same instance will be returned. + * + * @param target - The class / constructor function to register as a singleton. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.singleton(Foo); + * ``` + * + * @example + * Inline declaration + * ```ts + * const Foo = DI.singleton(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + singleton(target, options = defaultSingletonOptions) { + target.register = function register(container) { + const registration = Registration.singleton(target, target); + return registration.register(container); + }; + target.registerInRequestor = options.scoped; + return target; + } + }); + Container = DI.createInterface("Container"); + inject = DI.inject; + defaultSingletonOptions = { scoped: false }; + all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors)); + lazy = createResolver((key, handler, requestor) => { + return () => requestor.get(key); + }); + optional = createResolver((key, handler, requestor) => { + if (requestor.has(key, true)) { + return requestor.get(key); + } else { + return void 0; + } + }); + ignore.$isResolver = true; + ignore.resolve = () => void 0; + newInstanceForScope = createResolver((key, handler, requestor) => { + const instance = createNewInstance(key, handler); + const resolver = new ResolverImpl(key, 0, instance); + requestor.registerResolver(key, resolver); + return instance; + }); + newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler)); + ResolverImpl = class { + constructor(key, strategy, state) { + this.key = key; + this.strategy = strategy; + this.state = state; + this.resolving = false; + } + get $isResolver() { + return true; + } + register(container) { + return container.registerResolver(this.key, this); + } + resolve(handler, requestor) { + switch (this.strategy) { + case 0: + return this.state; + case 1: { + if (this.resolving) { + throw new Error(`Cyclic dependency found: ${this.state.name}`); + } + this.resolving = true; + this.state = handler.getFactory(this.state).construct(requestor); + this.strategy = 0; + this.resolving = false; + return this.state; + } + case 2: { + const factory = handler.getFactory(this.state); + if (factory === null) { + throw new Error(`Resolver for ${String(this.key)} returned a null factory`); + } + return factory.construct(requestor); + } + case 3: + return this.state(handler, requestor, this); + case 4: + return this.state[0].resolve(handler, requestor); + case 5: + return requestor.get(this.state); + default: + throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`); + } + } + getFactory(container) { + var _a, _b, _c; + switch (this.strategy) { + case 1: + case 2: + return container.getFactory(this.state); + case 5: + return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; + default: + return null; + } + } + }; + FactoryImpl = class { + constructor(Type, dependencies) { + this.Type = Type; + this.dependencies = dependencies; + this.transformers = null; + } + construct(container, dynamicDependencies) { + let instance; + if (dynamicDependencies === void 0) { + instance = new this.Type(...this.dependencies.map(containerGetKey, container)); + } else { + instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies); + } + if (this.transformers == null) { + return instance; + } + return this.transformers.reduce(transformInstance, instance); + } + registerTransformer(transformer) { + (this.transformers || (this.transformers = [])).push(transformer); + } + }; + containerResolver = { + $isResolver: true, + resolve(handler, requestor) { + return requestor; + } + }; + InstrinsicTypeNames = /* @__PURE__ */ new Set([ + "Array", + "ArrayBuffer", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Number", + "Object", + "Promise", + "RangeError", + "ReferenceError", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "URIError", + "WeakMap", + "WeakSet" + ]); + DILocateParentEventType = "__DI_LOCATE_PARENT__"; + factories = /* @__PURE__ */ new Map(); + ContainerImpl = class _ContainerImpl { + constructor(owner, config) { + this.owner = owner; + this.config = config; + this._parent = void 0; + this.registerDepth = 0; + this.context = null; + if (owner !== null) { + owner.$$container$$ = this; + } + this.resolvers = /* @__PURE__ */ new Map(); + this.resolvers.set(Container, containerResolver); + if (owner instanceof Node) { + owner.addEventListener(DILocateParentEventType, (e) => { + if (e.composedPath()[0] !== this.owner) { + e.detail.container = this; + e.stopImmediatePropagation(); + } + }); + } + } + get parent() { + if (this._parent === void 0) { + this._parent = this.config.parentLocator(this.owner); + } + return this._parent; + } + get depth() { + return this.parent === null ? 0 : this.parent.depth + 1; + } + get responsibleForOwnerRequests() { + return this.config.responsibleForOwnerRequests; + } + registerWithContext(context, ...params) { + this.context = context; + this.register(...params); + this.context = null; + return this; + } + register(...params) { + if (++this.registerDepth === 100) { + throw new Error("Unable to autoregister dependency"); + } + let current; + let keys; + let value; + let j; + let jj; + const context = this.context; + for (let i = 0, ii = params.length; i < ii; ++i) { + current = params[i]; + if (!isObject(current)) { + continue; + } + if (isRegistry(current)) { + current.register(this, context); + } else if (isClass(current)) { + Registration.singleton(current, current).register(this); + } else { + keys = Object.keys(current); + j = 0; + jj = keys.length; + for (; j < jj; ++j) { + value = current[keys[j]]; + if (!isObject(value)) { + continue; + } + if (isRegistry(value)) { + value.register(this, context); + } else { + this.register(value); + } + } + } + } + --this.registerDepth; + return this; + } + registerResolver(key, resolver) { + validateKey(key); + const resolvers = this.resolvers; + const result = resolvers.get(key); + if (result == null) { + resolvers.set(key, resolver); + } else if (result instanceof ResolverImpl && result.strategy === 4) { + result.state.push(resolver); + } else { + resolvers.set(key, new ResolverImpl(key, 4, [result, resolver])); + } + return resolver; + } + registerTransformer(key, transformer) { + const resolver = this.getResolver(key); + if (resolver == null) { + return false; + } + if (resolver.getFactory) { + const factory = resolver.getFactory(this); + if (factory == null) { + return false; + } + factory.registerTransformer(transformer); + return true; + } + return false; + } + getResolver(key, autoRegister = true) { + validateKey(key); + if (key.resolve !== void 0) { + return key; + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + return autoRegister ? this.jitRegister(key, handler) : null; + } + current = current.parent; + } else { + return resolver; + } + } + return null; + } + has(key, searchAncestors = false) { + return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; + } + get(key) { + validateKey(key); + if (key.$isResolver) { + return key.resolve(this, this); + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + resolver = this.jitRegister(key, handler); + return resolver.resolve(current, this); + } + current = current.parent; + } else { + return resolver.resolve(current, this); + } + } + throw new Error(`Unable to resolve key: ${String(key)}`); + } + getAll(key, searchAncestors = false) { + validateKey(key); + const requestor = this; + let current = requestor; + let resolver; + if (searchAncestors) { + let resolutions = emptyArray; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver != null) { + resolutions = resolutions.concat( + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + buildAllResponse(resolver, current, requestor) + ); + } + current = current.parent; + } + return resolutions; + } else { + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + current = current.parent; + if (current == null) { + return emptyArray; + } + } else { + return buildAllResponse(resolver, current, requestor); + } + } + } + return emptyArray; + } + getFactory(Type) { + let factory = factories.get(Type); + if (factory === void 0) { + if (isNativeFunction(Type)) { + throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`); + } + factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); + } + return factory; + } + registerFactory(key, factory) { + factories.set(key, factory); + } + createChild(config) { + return new _ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this })); + } + jitRegister(keyAsValue, handler) { + if (typeof keyAsValue !== "function") { + throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`); + } + if (InstrinsicTypeNames.has(keyAsValue.name)) { + throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`); + } + if (isRegistry(keyAsValue)) { + const registrationResolver = keyAsValue.register(handler); + if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { + const newResolver = handler.resolvers.get(keyAsValue); + if (newResolver != void 0) { + return newResolver; + } + throw new Error("A valid resolver was not returned from the static register method"); + } + return registrationResolver; + } else if (keyAsValue.$isInterface) { + throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`); + } else { + const resolver = this.config.defaultResolver(keyAsValue, handler); + handler.resolvers.set(keyAsValue, resolver); + return resolver; + } + } + }; + cache = /* @__PURE__ */ new WeakMap(); + Registration = Object.freeze({ + /** + * Allows you to pass an instance. + * Every time you request this {@link Key} you will get this instance back. + * + * @example + * ``` + * Registration.instance(Foo, new Foo())); + * ``` + * + * @param key - The key to register the instance under. + * @param value - The instance to return when the key is requested. + */ + instance(key, value) { + return new ResolverImpl(key, 0, value); + }, + /** + * Creates an instance from the class. + * Every time you request this {@link Key} you will get the same one back. + * + * @example + * ``` + * Registration.singleton(Foo, Foo); + * ``` + * + * @param key - The key to register the singleton under. + * @param value - The class to instantiate as a singleton when first requested. + */ + singleton(key, value) { + return new ResolverImpl(key, 1, value); + }, + /** + * Creates an instance from a class. + * Every time you request this {@link Key} you will get a new instance. + * + * @example + * ``` + * Registration.instance(Foo, Foo); + * ``` + * + * @param key - The key to register the instance type under. + * @param value - The class to instantiate each time the key is requested. + */ + transient(key, value) { + return new ResolverImpl(key, 2, value); + }, + /** + * Delegates to a callback function to provide the dependency. + * Every time you request this {@link Key} the callback will be invoked to provide + * the dependency. + * + * @example + * ``` + * Registration.callback(Foo, () => new Foo()); + * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + */ + callback(key, callback) { + return new ResolverImpl(key, 3, callback); + }, + /** + * Delegates to a callback function to provide the dependency and then caches the + * dependency for future requests. + * + * @example + * ``` + * Registration.cachedCallback(Foo, () => new Foo()); + * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + * @remarks + * If you pass the same Registration to another container, the same cached value will be used. + * Should all references to the resolver returned be removed, the cache will expire. + */ + cachedCallback(key, callback) { + return new ResolverImpl(key, 3, cacheCallbackResult(callback)); + }, + /** + * Creates an alternate {@link Key} to retrieve an instance by. + * + * @example + * ``` + * Register.singleton(Foo, Foo) + * Register.aliasTo(Foo, MyFoos); + * + * container.getAll(MyFoos) // contains an instance of Foo + * ``` + * + * @param originalKey - The original key that has been registered. + * @param aliasKey - The alias to the original key. + */ + aliasTo(originalKey, aliasKey) { + return new ResolverImpl(aliasKey, 5, originalKey); + } + }); + defaultFriendlyName = "(anonymous)"; + isNativeFunction = /* @__PURE__ */ (function() { + const lookup = /* @__PURE__ */ new WeakMap(); + let isNative = false; + let sourceText = ""; + let i = 0; + return function(fn) { + isNative = lookup.get(fn); + if (isNative === void 0) { + sourceText = fn.toString(); + i = sourceText.length; + isNative = // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string + i >= 29 && // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. + i <= 100 && // This whole heuristic *could* be tricked by a comment. Do we need to care about that? + sourceText.charCodeAt(i - 1) === 125 && // } + // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. + sourceText.charCodeAt(i - 2) <= 32 && // whitespace + sourceText.charCodeAt(i - 3) === 93 && // ] + sourceText.charCodeAt(i - 4) === 101 && // e + sourceText.charCodeAt(i - 5) === 100 && // d + sourceText.charCodeAt(i - 6) === 111 && // o + sourceText.charCodeAt(i - 7) === 99 && // c + sourceText.charCodeAt(i - 8) === 32 && // + sourceText.charCodeAt(i - 9) === 101 && // e + sourceText.charCodeAt(i - 10) === 118 && // v + sourceText.charCodeAt(i - 11) === 105 && // i + sourceText.charCodeAt(i - 12) === 116 && // t + sourceText.charCodeAt(i - 13) === 97 && // a + sourceText.charCodeAt(i - 14) === 110 && // n + sourceText.charCodeAt(i - 15) === 88; + lookup.set(fn, isNative); + } + return isNative; + }; + })(); + isNumericLookup = {}; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js + function presentationKeyFromTag(tagName) { + return `${tagName.toLowerCase()}:presentation`; + } + var presentationRegistry, ComponentPresentation, DefaultComponentPresentation; + var init_component_presentation = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js"() { + init_esm(); + init_di(); + presentationRegistry = /* @__PURE__ */ new Map(); + ComponentPresentation = Object.freeze({ + /** + * Defines a component presentation for an element. + * @param tagName - The element name to define the presentation for. + * @param presentation - The presentation that will be applied to matching elements. + * @param container - The dependency injection container to register the configuration in. + * @public + */ + define(tagName, presentation, container) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === void 0) { + presentationRegistry.set(key, presentation); + } else { + presentationRegistry.set(key, false); + } + container.register(Registration.instance(key, presentation)); + }, + /** + * Finds a component presentation for the specified element name, + * searching the DOM hierarchy starting from the provided element. + * @param tagName - The name of the element to locate the presentation for. + * @param element - The element to begin the search from. + * @returns The component presentation or null if none is found. + * @public + */ + forTag(tagName, element) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === false) { + const container = DI.findResponsibleContainer(element); + return container.get(key); + } + return existing || null; + } + }); + DefaultComponentPresentation = class { + /** + * Creates an instance of DefaultComponentPresentation. + * @param template - The template to apply to the element. + * @param styles - The styles to apply to the element. + * @public + */ + constructor(template, styles) { + this.template = template || null; + this.styles = styles === void 0 ? null : Array.isArray(styles) ? ElementStyles.create(styles) : styles instanceof ElementStyles ? styles : ElementStyles.create([styles]); + } + /** + * Applies the presentation details to the specified element. + * @param element - The element to apply the presentation details to. + * @public + */ + applyTo(element) { + const controller = element.$fastController; + if (controller.template === null) { + controller.template = this.template; + } + if (controller.styles === null) { + controller.styles = this.styles; + } + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js + function resolveOption(option, context, definition) { + if (typeof option === "function") { + return option(context, definition); + } + return option; + } + var FoundationElement, FoundationElementRegistry; + var init_foundation_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js"() { + init_tslib_es6(); + init_esm(); + init_component_presentation(); + FoundationElement = class _FoundationElement extends FASTElement { + constructor() { + super(...arguments); + this._presentation = void 0; + } + /** + * A property which resolves the ComponentPresentation instance + * for the current component. + * @public + */ + get $presentation() { + if (this._presentation === void 0) { + this._presentation = ComponentPresentation.forTag(this.tagName, this); + } + return this._presentation; + } + templateChanged() { + if (this.template !== void 0) { + this.$fastController.template = this.template; + } + } + stylesChanged() { + if (this.styles !== void 0) { + this.$fastController.styles = this.styles; + } + } + /** + * The connected callback for this FASTElement. + * @remarks + * This method is invoked by the platform whenever this FoundationElement + * becomes connected to the document. + * @public + */ + connectedCallback() { + if (this.$presentation !== null) { + this.$presentation.applyTo(this); + } + super.connectedCallback(); + } + /** + * Defines an element registry function with a set of element definition defaults. + * @param elementDefinition - The definition of the element to create the registry + * function for. + * @public + */ + static compose(elementDefinition) { + return (overrideDefinition = {}) => new FoundationElementRegistry(this === _FoundationElement ? class extends _FoundationElement { + } : this, elementDefinition, overrideDefinition); + } + }; + __decorate([ + observable + ], FoundationElement.prototype, "template", void 0); + __decorate([ + observable + ], FoundationElement.prototype, "styles", void 0); + FoundationElementRegistry = class { + constructor(type, elementDefinition, overrideDefinition) { + this.type = type; + this.elementDefinition = elementDefinition; + this.overrideDefinition = overrideDefinition; + this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); + } + register(container, context) { + const definition = this.definition; + const overrideDefinition = this.overrideDefinition; + const prefix = definition.prefix || context.elementPrefix; + const name = `${prefix}-${definition.baseName}`; + context.tryDefineElement({ + name, + type: this.type, + baseClass: this.elementDefinition.baseClass, + callback: (x) => { + const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); + x.definePresentation(presentation); + let shadowOptions = resolveOption(definition.shadowOptions, x, definition); + if (x.shadowRootMode) { + if (shadowOptions) { + if (!overrideDefinition.shadowOptions) { + shadowOptions.mode = x.shadowRootMode; + } + } else if (shadowOptions !== null) { + shadowOptions = { mode: x.shadowRootMode }; + } + } + x.defineElement({ + elementOptions: resolveOption(definition.elementOptions, x, definition), + shadowOptions, + attributes: resolveOption(definition.attributes, x, definition) + }); + } + }); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js + function applyMixins(derivedCtor, ...baseCtors) { + const derivedAttributes = AttributeConfiguration.locate(derivedCtor); + baseCtors.forEach((baseCtor) => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { + if (name !== "constructor") { + Object.defineProperty( + derivedCtor.prototype, + name, + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + Object.getOwnPropertyDescriptor(baseCtor.prototype, name) + ); + } + }); + const baseAttributes = AttributeConfiguration.locate(baseCtor); + baseAttributes.forEach((x) => derivedAttributes.push(x)); + }); + } + var init_apply_mixins = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js"() { + init_esm(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js + var AccordionItem; + var init_accordion_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_start_end(); + init_apply_mixins(); + AccordionItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.headinglevel = 2; + this.expanded = false; + this.clickHandler = (e) => { + this.expanded = !this.expanded; + this.change(); + }; + this.change = () => { + this.$emit("change"); + }; + } + }; + __decorate([ + attr({ + attribute: "heading-level", + mode: "fromView", + converter: nullableNumberConverter + }) + ], AccordionItem.prototype, "headinglevel", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], AccordionItem.prototype, "expanded", void 0); + __decorate([ + attr + ], AccordionItem.prototype, "id", void 0); + applyMixins(AccordionItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js + var init_accordion_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js"() { + init_accordion_item_template(); + init_accordion_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js + var init_accordion_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/aria.js + var Orientation; + var init_aria = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/aria.js"() { + Orientation = { + horizontal: "horizontal", + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/array.js + function findLastIndex(array, predicate) { + let k = array.length; + while (k--) { + if (predicate(array[k], k, array)) { + return k; + } + } + return -1; + } + var init_array = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/array.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/class-names.js + var init_class_names = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/class-names.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-dom.js + function canUseDOM() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + var init_can_use_dom = __esm({ + "node_modules/exenv-es6/dist/can-use-dom.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-event-listeners.js + var init_can_use_event_listeners = __esm({ + "node_modules/exenv-es6/dist/can-use-event-listeners.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-viewport.js + var init_can_use_viewport = __esm({ + "node_modules/exenv-es6/dist/can-use-viewport.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-workers.js + var init_can_use_workers = __esm({ + "node_modules/exenv-es6/dist/can-use-workers.js"() { + } + }); + + // node_modules/exenv-es6/dist/index.js + var init_dist = __esm({ + "node_modules/exenv-es6/dist/index.js"() { + init_can_use_dom(); + init_can_use_event_listeners(); + init_can_use_viewport(); + init_can_use_workers(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/dom.js + function isHTMLElement(...args) { + return args.every((arg) => arg instanceof HTMLElement); + } + function getDisplayedNodes(rootNode, selector) { + if (!rootNode || !selector || !isHTMLElement(rootNode)) { + return; + } + const nodes = Array.from(rootNode.querySelectorAll(selector)); + return nodes.filter((node) => node.offsetParent !== null); + } + function getNonce() { + const node = document.querySelector('meta[property="csp-nonce"]'); + if (node) { + return node.getAttribute("content"); + } else { + return null; + } + } + function canUseFocusVisible() { + if (typeof _canUseFocusVisible === "boolean") { + return _canUseFocusVisible; + } + if (!canUseDOM()) { + _canUseFocusVisible = false; + return _canUseFocusVisible; + } + const styleElement = document.createElement("style"); + const styleNonce = getNonce(); + if (styleNonce !== null) { + styleElement.setAttribute("nonce", styleNonce); + } + document.head.appendChild(styleElement); + try { + styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); + _canUseFocusVisible = true; + } catch (e) { + _canUseFocusVisible = false; + } finally { + document.head.removeChild(styleElement); + } + return _canUseFocusVisible; + } + var _canUseFocusVisible; + var init_dom2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/dom.js"() { + init_dist(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/events.js + var eventFocus, eventFocusIn, eventFocusOut, eventKeyDown, eventResize, eventScroll; + var init_events = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/events.js"() { + eventFocus = "focus"; + eventFocusIn = "focusin"; + eventFocusOut = "focusout"; + eventKeyDown = "keydown"; + eventResize = "resize"; + eventScroll = "scroll"; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/html.js + var init_html = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/html.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/key-codes.js + var KeyCodes, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, keyEscape, keyHome, keyEnd, keyFunction2, keyPageDown, keyPageUp, keySpace, keyTab, keyBackspace, keyDelete, ArrowKeys; + var init_key_codes = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/key-codes.js"() { + (function(KeyCodes2) { + KeyCodes2[KeyCodes2["alt"] = 18] = "alt"; + KeyCodes2[KeyCodes2["arrowDown"] = 40] = "arrowDown"; + KeyCodes2[KeyCodes2["arrowLeft"] = 37] = "arrowLeft"; + KeyCodes2[KeyCodes2["arrowRight"] = 39] = "arrowRight"; + KeyCodes2[KeyCodes2["arrowUp"] = 38] = "arrowUp"; + KeyCodes2[KeyCodes2["back"] = 8] = "back"; + KeyCodes2[KeyCodes2["backSlash"] = 220] = "backSlash"; + KeyCodes2[KeyCodes2["break"] = 19] = "break"; + KeyCodes2[KeyCodes2["capsLock"] = 20] = "capsLock"; + KeyCodes2[KeyCodes2["closeBracket"] = 221] = "closeBracket"; + KeyCodes2[KeyCodes2["colon"] = 186] = "colon"; + KeyCodes2[KeyCodes2["colon2"] = 59] = "colon2"; + KeyCodes2[KeyCodes2["comma"] = 188] = "comma"; + KeyCodes2[KeyCodes2["ctrl"] = 17] = "ctrl"; + KeyCodes2[KeyCodes2["delete"] = 46] = "delete"; + KeyCodes2[KeyCodes2["end"] = 35] = "end"; + KeyCodes2[KeyCodes2["enter"] = 13] = "enter"; + KeyCodes2[KeyCodes2["equals"] = 187] = "equals"; + KeyCodes2[KeyCodes2["equals2"] = 61] = "equals2"; + KeyCodes2[KeyCodes2["equals3"] = 107] = "equals3"; + KeyCodes2[KeyCodes2["escape"] = 27] = "escape"; + KeyCodes2[KeyCodes2["forwardSlash"] = 191] = "forwardSlash"; + KeyCodes2[KeyCodes2["function1"] = 112] = "function1"; + KeyCodes2[KeyCodes2["function10"] = 121] = "function10"; + KeyCodes2[KeyCodes2["function11"] = 122] = "function11"; + KeyCodes2[KeyCodes2["function12"] = 123] = "function12"; + KeyCodes2[KeyCodes2["function2"] = 113] = "function2"; + KeyCodes2[KeyCodes2["function3"] = 114] = "function3"; + KeyCodes2[KeyCodes2["function4"] = 115] = "function4"; + KeyCodes2[KeyCodes2["function5"] = 116] = "function5"; + KeyCodes2[KeyCodes2["function6"] = 117] = "function6"; + KeyCodes2[KeyCodes2["function7"] = 118] = "function7"; + KeyCodes2[KeyCodes2["function8"] = 119] = "function8"; + KeyCodes2[KeyCodes2["function9"] = 120] = "function9"; + KeyCodes2[KeyCodes2["home"] = 36] = "home"; + KeyCodes2[KeyCodes2["insert"] = 45] = "insert"; + KeyCodes2[KeyCodes2["menu"] = 93] = "menu"; + KeyCodes2[KeyCodes2["minus"] = 189] = "minus"; + KeyCodes2[KeyCodes2["minus2"] = 109] = "minus2"; + KeyCodes2[KeyCodes2["numLock"] = 144] = "numLock"; + KeyCodes2[KeyCodes2["numPad0"] = 96] = "numPad0"; + KeyCodes2[KeyCodes2["numPad1"] = 97] = "numPad1"; + KeyCodes2[KeyCodes2["numPad2"] = 98] = "numPad2"; + KeyCodes2[KeyCodes2["numPad3"] = 99] = "numPad3"; + KeyCodes2[KeyCodes2["numPad4"] = 100] = "numPad4"; + KeyCodes2[KeyCodes2["numPad5"] = 101] = "numPad5"; + KeyCodes2[KeyCodes2["numPad6"] = 102] = "numPad6"; + KeyCodes2[KeyCodes2["numPad7"] = 103] = "numPad7"; + KeyCodes2[KeyCodes2["numPad8"] = 104] = "numPad8"; + KeyCodes2[KeyCodes2["numPad9"] = 105] = "numPad9"; + KeyCodes2[KeyCodes2["numPadDivide"] = 111] = "numPadDivide"; + KeyCodes2[KeyCodes2["numPadDot"] = 110] = "numPadDot"; + KeyCodes2[KeyCodes2["numPadMinus"] = 109] = "numPadMinus"; + KeyCodes2[KeyCodes2["numPadMultiply"] = 106] = "numPadMultiply"; + KeyCodes2[KeyCodes2["numPadPlus"] = 107] = "numPadPlus"; + KeyCodes2[KeyCodes2["openBracket"] = 219] = "openBracket"; + KeyCodes2[KeyCodes2["pageDown"] = 34] = "pageDown"; + KeyCodes2[KeyCodes2["pageUp"] = 33] = "pageUp"; + KeyCodes2[KeyCodes2["period"] = 190] = "period"; + KeyCodes2[KeyCodes2["print"] = 44] = "print"; + KeyCodes2[KeyCodes2["quote"] = 222] = "quote"; + KeyCodes2[KeyCodes2["scrollLock"] = 145] = "scrollLock"; + KeyCodes2[KeyCodes2["shift"] = 16] = "shift"; + KeyCodes2[KeyCodes2["space"] = 32] = "space"; + KeyCodes2[KeyCodes2["tab"] = 9] = "tab"; + KeyCodes2[KeyCodes2["tilde"] = 192] = "tilde"; + KeyCodes2[KeyCodes2["windowsLeft"] = 91] = "windowsLeft"; + KeyCodes2[KeyCodes2["windowsOpera"] = 219] = "windowsOpera"; + KeyCodes2[KeyCodes2["windowsRight"] = 92] = "windowsRight"; + })(KeyCodes || (KeyCodes = {})); + keyArrowDown = "ArrowDown"; + keyArrowLeft = "ArrowLeft"; + keyArrowRight = "ArrowRight"; + keyArrowUp = "ArrowUp"; + keyEnter = "Enter"; + keyEscape = "Escape"; + keyHome = "Home"; + keyEnd = "End"; + keyFunction2 = "F2"; + keyPageDown = "PageDown"; + keyPageUp = "PageUp"; + keySpace = " "; + keyTab = "Tab"; + keyBackspace = "Backspace"; + keyDelete = "Delete"; + ArrowKeys = { + ArrowDown: keyArrowDown, + ArrowLeft: keyArrowLeft, + ArrowRight: keyArrowRight, + ArrowUp: keyArrowUp + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/localization.js + var Direction; + var init_localization = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/localization.js"() { + (function(Direction2) { + Direction2["ltr"] = "ltr"; + Direction2["rtl"] = "rtl"; + })(Direction || (Direction = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/numbers.js + function wrapInBounds(min, max, value) { + if (value < min) { + return max; + } else if (value > max) { + return min; + } + return value; + } + function limit(min, max, value) { + return Math.min(Math.max(value, min), max); + } + function inRange(value, min, max = 0) { + [min, max] = [min, max].sort((a, b) => a - b); + return min <= value && value < max; + } + var init_numbers = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/numbers.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/strings.js + function uniqueId(prefix = "") { + return `${prefix}${uniqueIdCounter++}`; + } + var uniqueIdCounter; + var init_strings = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/strings.js"() { + uniqueIdCounter = 0; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/query.js + var init_query = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/query.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js + var RtlScrollConverter; + var init_rtl_scroll_converter = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js"() { + init_dist(); + init_localization(); + RtlScrollConverter = class _RtlScrollConverter { + /** + * Gets the scrollLeft value of the provided element + */ + static getScrollLeft(scrolledElement, direction) { + if (direction === Direction.rtl) { + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + return scrolledElement.scrollLeft; + } + /** + * Sets the scrollLeft value of the provided element + */ + static setScrollLeft(scrolledElement, scrollValue, direction) { + if (direction === Direction.rtl) { + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, scrollValue); + return; + } + scrolledElement.scrollLeft = scrollValue; + } + /** + * The initial rtl scroll converter getter function, it calls the browser test to set the correct converter + * functions and then invokes the getter + */ + static initialGetRtlScrollConverter(scrolledElement) { + _RtlScrollConverter.initializeRtlScrollConverters(); + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + /** + * The "direct" rtl get scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft; + } + /** + * The "inverted" get scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedGetRtlScrollConverter(scrolledElement) { + return -Math.abs(scrolledElement.scrollLeft); + } + /** + * The "reverse" get scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft - (scrolledElement.scrollWidth - scrolledElement.clientWidth); + } + /** + * The initial rtl scroll converter setter function, it calls the browser test to set the correct converter + * functions and then invokes the setter + */ + static initialSetRtlScrollConverter(scrolledElement, newScrollValue) { + _RtlScrollConverter.initializeRtlScrollConverters(); + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, newScrollValue); + } + /** + * The "direct" rtl set scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = newScrollValue; + } + /** + * The "inverted" set scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = Math.abs(newScrollValue); + } + /** + * The "reverse" set scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseSetRtlScrollConverter(scrolledElement, newScrollValue) { + const maxScroll = scrolledElement.scrollWidth - scrolledElement.clientWidth; + scrolledElement.scrollLeft = maxScroll + newScrollValue; + } + /** + * detects the appropriate rtl scroll converter functions and assigns them + * should only run once + */ + static initializeRtlScrollConverters() { + if (!canUseDOM()) { + _RtlScrollConverter.applyDirectScrollConverters(); + return; + } + const testElement = _RtlScrollConverter.getTestElement(); + document.body.appendChild(testElement); + _RtlScrollConverter.checkForScrollType(testElement); + document.body.removeChild(testElement); + } + /** + * checks the provided test element to determine scroll type + * and apply appropriate converters + */ + static checkForScrollType(testElement) { + if (_RtlScrollConverter.isReverse(testElement)) { + _RtlScrollConverter.applyReverseScrollConverters(); + } else { + if (_RtlScrollConverter.isDirect(testElement)) { + _RtlScrollConverter.applyDirectScrollConverters(); + } else { + _RtlScrollConverter.applyInvertedScrollConverters(); + } + } + } + /** + * checks test element initial state for rtl "reverse" mode + */ + static isReverse(testElement) { + return testElement.scrollLeft > 0; + } + /** + * checks test element for rtl "direct" mode + */ + static isDirect(testElement) { + testElement.scrollLeft = -1; + return testElement.scrollLeft < 0; + } + /** + * apply direct scroll conververters + */ + static applyDirectScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.directSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.directGetRtlScrollConverter; + } + /** + * apply inverted scroll conververters + */ + static applyInvertedScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.invertedSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.invertedGetRtlScrollConverter; + } + /** + * apply reverse scroll conververters + */ + static applyReverseScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.reverseSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.reverseGetRtlScrollConverter; + } + /** + * generate a test element for rtl testing + */ + static getTestElement() { + const testElement = document.createElement("div"); + testElement.appendChild(document.createTextNode("ABCD")); + testElement.dir = "rtl"; + testElement.style.fontSize = "14px"; + testElement.style.width = "4px"; + testElement.style.height = "1px"; + testElement.style.position = "absolute"; + testElement.style.top = "-1000px"; + testElement.style.overflow = "scroll"; + return testElement; + } + }; + RtlScrollConverter.getRtlScrollLeftConverter = RtlScrollConverter.initialGetRtlScrollConverter; + RtlScrollConverter.setRtlScrollLeftConverter = RtlScrollConverter.initialSetRtlScrollConverter; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/system-colors.js + var SystemColors; + var init_system_colors = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/system-colors.js"() { + (function(SystemColors2) { + SystemColors2["Canvas"] = "Canvas"; + SystemColors2["CanvasText"] = "CanvasText"; + SystemColors2["LinkText"] = "LinkText"; + SystemColors2["VisitedText"] = "VisitedText"; + SystemColors2["ActiveText"] = "ActiveText"; + SystemColors2["ButtonFace"] = "ButtonFace"; + SystemColors2["ButtonText"] = "ButtonText"; + SystemColors2["Field"] = "Field"; + SystemColors2["FieldText"] = "FieldText"; + SystemColors2["Highlight"] = "Highlight"; + SystemColors2["HighlightText"] = "HighlightText"; + SystemColors2["GrayText"] = "GrayText"; + })(SystemColors || (SystemColors = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/index.js + var init_dist2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/index.js"() { + init_aria(); + init_array(); + init_class_names(); + init_dom2(); + init_events(); + init_html(); + init_key_codes(); + init_localization(); + init_numbers(); + init_strings(); + init_query(); + init_rtl_scroll_converter(); + init_system_colors(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js + var AccordionExpandMode, Accordion; + var init_accordion = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_accordion_item(); + AccordionExpandMode = { + /** + * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. + */ + single: "single", + /** + * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously. + */ + multi: "multi" + }; + Accordion = class extends FoundationElement { + constructor() { + super(...arguments); + this.expandmode = AccordionExpandMode.multi; + this.activeItemIndex = 0; + this.change = () => { + this.$emit("change", this.activeid); + }; + this.setItems = () => { + var _a; + if (this.accordionItems.length === 0) { + return; + } + this.accordionIds = this.getItemIds(); + this.accordionItems.forEach((item, index) => { + if (item instanceof AccordionItem) { + item.addEventListener("change", this.activeItemChange); + if (this.isSingleExpandMode()) { + this.activeItemIndex !== index ? item.expanded = false : item.expanded = true; + } + } + const itemId = this.accordionIds[index]; + item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId); + this.activeid = this.accordionIds[this.activeItemIndex]; + item.addEventListener("keydown", this.handleItemKeyDown); + item.addEventListener("focus", this.handleItemFocus); + }); + if (this.isSingleExpandMode()) { + const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0]; + expandedItem.setAttribute("aria-disabled", "true"); + } + }; + this.removeItemListeners = (oldValue) => { + oldValue.forEach((item, index) => { + item.removeEventListener("change", this.activeItemChange); + item.removeEventListener("keydown", this.handleItemKeyDown); + item.removeEventListener("focus", this.handleItemFocus); + }); + }; + this.activeItemChange = (event) => { + if (event.defaultPrevented || event.target !== event.currentTarget) { + return; + } + event.preventDefault(); + const selectedItem = event.target; + this.activeid = selectedItem.getAttribute("id"); + if (this.isSingleExpandMode()) { + this.resetItems(); + selectedItem.expanded = true; + selectedItem.setAttribute("aria-disabled", "true"); + this.accordionItems.forEach((item) => { + if (!item.hasAttribute("disabled") && item.id !== this.activeid) { + item.removeAttribute("aria-disabled"); + } + }); + } + this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem); + this.change(); + }; + this.handleItemKeyDown = (event) => { + if (event.target !== event.currentTarget) { + return; + } + this.accordionIds = this.getItemIds(); + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjust(-1); + break; + case keyArrowDown: + event.preventDefault(); + this.adjust(1); + break; + case keyHome: + this.activeItemIndex = 0; + this.focusItem(); + break; + case keyEnd: + this.activeItemIndex = this.accordionItems.length - 1; + this.focusItem(); + break; + } + }; + this.handleItemFocus = (event) => { + if (event.target === event.currentTarget) { + const focusedItem = event.target; + const focusedIndex = this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem); + if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { + this.activeItemIndex = focusedIndex; + this.activeid = this.accordionIds[this.activeItemIndex]; + } + } + }; + } + /** + * @internal + */ + accordionItemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.removeItemListeners(oldValue); + this.setItems(); + } + } + findExpandedItem() { + for (let item = 0; item < this.accordionItems.length; item++) { + if (this.accordionItems[item].getAttribute("expanded") === "true") { + return this.accordionItems[item]; + } + } + return null; + } + resetItems() { + this.accordionItems.forEach((item, index) => { + item.expanded = false; + }); + } + getItemIds() { + return this.accordionItems.map((accordionItem) => { + return accordionItem.getAttribute("id"); + }); + } + isSingleExpandMode() { + return this.expandmode === AccordionExpandMode.single; + } + adjust(adjustment) { + this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment); + this.focusItem(); + } + focusItem() { + const element = this.accordionItems[this.activeItemIndex]; + if (element instanceof AccordionItem) { + element.expandbutton.focus(); + } + } + }; + __decorate([ + attr({ attribute: "expand-mode" }) + ], Accordion.prototype, "expandmode", void 0); + __decorate([ + observable + ], Accordion.prototype, "accordionItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js + var init_accordion2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js"() { + init_accordion_template(); + init_accordion(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js + var anchorTemplate; + var init_anchor_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js"() { + init_esm(); + init_start_end(); + anchorTemplate = (context, definition) => html` + + ${startSlotTemplate(context, definition)} + + + + ${endSlotTemplate(context, definition)} + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js + var ARIAGlobalStatesAndProperties; + var init_aria_global = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js"() { + init_tslib_es6(); + init_esm(); + ARIAGlobalStatesAndProperties = class { + }; + __decorate([ + attr({ attribute: "aria-atomic" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); + __decorate([ + attr({ attribute: "aria-busy" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); + __decorate([ + attr({ attribute: "aria-controls" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); + __decorate([ + attr({ attribute: "aria-current" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-details" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); + __decorate([ + attr({ attribute: "aria-disabled" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); + __decorate([ + attr({ attribute: "aria-errormessage" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); + __decorate([ + attr({ attribute: "aria-flowto" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); + __decorate([ + attr({ attribute: "aria-haspopup" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); + __decorate([ + attr({ attribute: "aria-hidden" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); + __decorate([ + attr({ attribute: "aria-invalid" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); + __decorate([ + attr({ attribute: "aria-keyshortcuts" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-live" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); + __decorate([ + attr({ attribute: "aria-owns" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); + __decorate([ + attr({ attribute: "aria-relevant" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); + __decorate([ + attr({ attribute: "aria-roledescription" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js + var init_patterns = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js"() { + init_aria_global(); + init_start_end(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js + var Anchor, DelegatesARIALink; + var init_anchor = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_patterns(); + init_apply_mixins(); + Anchor = class extends FoundationElement { + constructor() { + super(...arguments); + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + var _a2; + (_a2 = this.control) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + } + }; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.handleUnsupportedDelegatesFocus(); + } + }; + __decorate([ + attr + ], Anchor.prototype, "download", void 0); + __decorate([ + attr + ], Anchor.prototype, "href", void 0); + __decorate([ + attr + ], Anchor.prototype, "hreflang", void 0); + __decorate([ + attr + ], Anchor.prototype, "ping", void 0); + __decorate([ + attr + ], Anchor.prototype, "referrerpolicy", void 0); + __decorate([ + attr + ], Anchor.prototype, "rel", void 0); + __decorate([ + attr + ], Anchor.prototype, "target", void 0); + __decorate([ + attr + ], Anchor.prototype, "type", void 0); + __decorate([ + observable + ], Anchor.prototype, "defaultSlottedContent", void 0); + DelegatesARIALink = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIALink.prototype, "ariaExpanded", void 0); + applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties); + applyMixins(Anchor, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js + var init_anchor2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js"() { + init_anchor_template(); + init_anchor(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js + var init_anchored_region_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js + var getDirection; + var init_direction = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js"() { + init_dist2(); + getDirection = (rootNode) => { + const dirNode = rootNode.closest("[dir]"); + return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js + var IntersectionService; + var init_intersection_service = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js"() { + init_esm(); + IntersectionService = class { + constructor() { + this.intersectionDetector = null; + this.observedElements = /* @__PURE__ */ new Map(); + this.requestPosition = (target, callback) => { + var _a; + if (this.intersectionDetector === null) { + return; + } + if (this.observedElements.has(target)) { + (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback); + return; + } + this.observedElements.set(target, [callback]); + this.intersectionDetector.observe(target); + }; + this.cancelRequestPosition = (target, callback) => { + const callbacks = this.observedElements.get(target); + if (callbacks !== void 0) { + const callBackIndex = callbacks.indexOf(callback); + if (callBackIndex !== -1) { + callbacks.splice(callBackIndex, 1); + } + } + }; + this.initializeIntersectionDetector = () => { + if (!$global.IntersectionObserver) { + return; + } + this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { + root: null, + rootMargin: "0px", + threshold: [0, 1] + }); + }; + this.handleIntersection = (entries) => { + if (this.intersectionDetector === null) { + return; + } + const pendingCallbacks = []; + const pendingCallbackParams = []; + entries.forEach((entry) => { + var _a; + (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); + const thisElementCallbacks = this.observedElements.get(entry.target); + if (thisElementCallbacks !== void 0) { + thisElementCallbacks.forEach((callback) => { + let targetCallbackIndex = pendingCallbacks.indexOf(callback); + if (targetCallbackIndex === -1) { + targetCallbackIndex = pendingCallbacks.length; + pendingCallbacks.push(callback); + pendingCallbackParams.push([]); + } + pendingCallbackParams[targetCallbackIndex].push(entry); + }); + this.observedElements.delete(entry.target); + } + }); + pendingCallbacks.forEach((callback, index) => { + callback(pendingCallbackParams[index]); + }); + }; + this.initializeIntersectionDetector(); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js + var AnchoredRegion; + var init_anchored_region = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_direction(); + init_intersection_service(); + AnchoredRegion = class _AnchoredRegion extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.viewport = ""; + this.horizontalPositioningMode = "uncontrolled"; + this.horizontalDefaultPosition = "unset"; + this.horizontalViewportLock = false; + this.horizontalInset = false; + this.horizontalScaling = "content"; + this.verticalPositioningMode = "uncontrolled"; + this.verticalDefaultPosition = "unset"; + this.verticalViewportLock = false; + this.verticalInset = false; + this.verticalScaling = "content"; + this.fixedPlacement = false; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.initialLayoutComplete = false; + this.resizeDetector = null; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.pendingPositioningUpdate = false; + this.pendingReset = false; + this.currentDirection = Direction.ltr; + this.regionVisible = false; + this.forceUpdate = false; + this.updateThreshold = 0.5; + this.update = () => { + if (!this.pendingPositioningUpdate) { + this.requestPositionUpdates(); + } + }; + this.startObservers = () => { + this.stopObservers(); + if (this.anchorElement === null) { + return; + } + this.requestPositionUpdates(); + if (this.resizeDetector !== null) { + this.resizeDetector.observe(this.anchorElement); + this.resizeDetector.observe(this); + } + }; + this.requestPositionUpdates = () => { + if (this.anchorElement === null || this.pendingPositioningUpdate) { + return; + } + _AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection); + _AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection); + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection); + } + this.pendingPositioningUpdate = true; + }; + this.stopObservers = () => { + if (this.pendingPositioningUpdate) { + this.pendingPositioningUpdate = false; + _AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection); + if (this.anchorElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection); + } + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection); + } + } + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + } + }; + this.getViewport = () => { + if (typeof this.viewport !== "string" || this.viewport === "") { + return document.documentElement; + } + return document.getElementById(this.viewport); + }; + this.getAnchor = () => { + return document.getElementById(this.anchor); + }; + this.handleIntersection = (entries) => { + if (!this.pendingPositioningUpdate) { + return; + } + this.pendingPositioningUpdate = false; + if (!this.applyIntersectionEntries(entries)) { + return; + } + this.updateLayout(); + }; + this.applyIntersectionEntries = (entries) => { + const regionEntry = entries.find((x) => x.target === this); + const anchorEntry = entries.find((x) => x.target === this.anchorElement); + const viewportEntry = entries.find((x) => x.target === this.viewportElement); + if (regionEntry === void 0 || viewportEntry === void 0 || anchorEntry === void 0) { + return false; + } + if (!this.regionVisible || this.forceUpdate || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0 || this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) || this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) || this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) { + this.regionRect = regionEntry.boundingClientRect; + this.anchorRect = anchorEntry.boundingClientRect; + if (this.viewportElement === document.documentElement) { + this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x + document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y + document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height); + } else { + this.viewportRect = viewportEntry.boundingClientRect; + } + this.updateRegionOffset(); + this.forceUpdate = false; + return true; + } + return false; + }; + this.updateRegionOffset = () => { + if (this.anchorRect && this.regionRect) { + this.baseHorizontalOffset = this.baseHorizontalOffset + (this.anchorRect.left - this.regionRect.left) + (this.translateX - this.baseHorizontalOffset); + this.baseVerticalOffset = this.baseVerticalOffset + (this.anchorRect.top - this.regionRect.top) + (this.translateY - this.baseVerticalOffset); + } + }; + this.isRectDifferent = (rectA, rectB) => { + if (Math.abs(rectA.top - rectB.top) > this.updateThreshold || Math.abs(rectA.right - rectB.right) > this.updateThreshold || Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold || Math.abs(rectA.left - rectB.left) > this.updateThreshold) { + return true; + } + return false; + }; + this.handleResize = (entries) => { + this.update(); + }; + this.reset = () => { + if (!this.pendingReset) { + return; + } + this.pendingReset = false; + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + if (this.viewportElement === null) { + this.viewportElement = this.getViewport(); + } + this.currentDirection = getDirection(this); + this.startObservers(); + }; + this.updateLayout = () => { + let desiredVerticalPosition = void 0; + let desiredHorizontalPosition = void 0; + if (this.horizontalPositioningMode !== "uncontrolled") { + const horizontalOptions = this.getPositioningOptions(this.horizontalInset); + if (this.horizontalDefaultPosition === "center") { + desiredHorizontalPosition = "center"; + } else if (this.horizontalDefaultPosition !== "unset") { + let dirCorrectedHorizontalDefaultPosition = this.horizontalDefaultPosition; + if (dirCorrectedHorizontalDefaultPosition === "start" || dirCorrectedHorizontalDefaultPosition === "end") { + const newDirection = getDirection(this); + if (newDirection !== this.currentDirection) { + this.currentDirection = newDirection; + this.initialize(); + return; + } + if (this.currentDirection === Direction.ltr) { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right"; + } else { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left"; + } + } + switch (dirCorrectedHorizontalDefaultPosition) { + case "left": + desiredHorizontalPosition = this.horizontalInset ? "insetStart" : "start"; + break; + case "right": + desiredHorizontalPosition = this.horizontalInset ? "insetEnd" : "end"; + break; + } + } + const horizontalThreshold = this.horizontalThreshold !== void 0 ? this.horizontalThreshold : this.regionRect !== void 0 ? this.regionRect.width : 0; + const anchorLeft = this.anchorRect !== void 0 ? this.anchorRect.left : 0; + const anchorRight = this.anchorRect !== void 0 ? this.anchorRect.right : 0; + const anchorWidth = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + const viewportLeft = this.viewportRect !== void 0 ? this.viewportRect.left : 0; + const viewportRight = this.viewportRect !== void 0 ? this.viewportRect.right : 0; + if (desiredHorizontalPosition === void 0 || !(this.horizontalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold) { + desiredHorizontalPosition = this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) > this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) ? horizontalOptions[0] : horizontalOptions[1]; + } + } + if (this.verticalPositioningMode !== "uncontrolled") { + const verticalOptions = this.getPositioningOptions(this.verticalInset); + if (this.verticalDefaultPosition === "center") { + desiredVerticalPosition = "center"; + } else if (this.verticalDefaultPosition !== "unset") { + switch (this.verticalDefaultPosition) { + case "top": + desiredVerticalPosition = this.verticalInset ? "insetStart" : "start"; + break; + case "bottom": + desiredVerticalPosition = this.verticalInset ? "insetEnd" : "end"; + break; + } + } + const verticalThreshold = this.verticalThreshold !== void 0 ? this.verticalThreshold : this.regionRect !== void 0 ? this.regionRect.height : 0; + const anchorTop = this.anchorRect !== void 0 ? this.anchorRect.top : 0; + const anchorBottom = this.anchorRect !== void 0 ? this.anchorRect.bottom : 0; + const anchorHeight = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + const viewportTop = this.viewportRect !== void 0 ? this.viewportRect.top : 0; + const viewportBottom = this.viewportRect !== void 0 ? this.viewportRect.bottom : 0; + if (desiredVerticalPosition === void 0 || !(this.verticalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold) { + desiredVerticalPosition = this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) > this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) ? verticalOptions[0] : verticalOptions[1]; + } + } + const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition); + const positionChanged = this.horizontalPosition !== desiredHorizontalPosition || this.verticalPosition !== desiredVerticalPosition; + this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension); + this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension); + this.updateRegionStyle(); + if (!this.initialLayoutComplete) { + this.initialLayoutComplete = true; + this.requestPositionUpdates(); + return; + } + if (!this.regionVisible) { + this.regionVisible = true; + this.style.removeProperty("pointer-events"); + this.style.removeProperty("opacity"); + this.classList.toggle("loaded", true); + this.$emit("loaded", this, { bubbles: false }); + } + this.updatePositionClasses(); + if (positionChanged) { + this.$emit("positionchange", this, { bubbles: false }); + } + }; + this.updateRegionStyle = () => { + this.style.width = this.regionWidth; + this.style.height = this.regionHeight; + this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`; + }; + this.updatePositionClasses = () => { + this.classList.toggle("top", this.verticalPosition === "start"); + this.classList.toggle("bottom", this.verticalPosition === "end"); + this.classList.toggle("inset-top", this.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.verticalPosition === "insetEnd"); + this.classList.toggle("vertical-center", this.verticalPosition === "center"); + this.classList.toggle("left", this.horizontalPosition === "start"); + this.classList.toggle("right", this.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.horizontalPosition === "insetEnd"); + this.classList.toggle("horizontal-center", this.horizontalPosition === "center"); + }; + this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => { + if (desiredHorizontalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionWidth = 0; + switch (this.horizontalScaling) { + case "anchor": + case "fill": + nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width; + this.regionWidth = `${nextRegionWidth}px`; + break; + case "content": + nextRegionWidth = this.regionRect.width; + this.regionWidth = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredHorizontalPosition) { + case "start": + this.translateX = this.baseHorizontalOffset - nextRegionWidth; + if (this.horizontalViewportLock && this.anchorRect.left > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.right); + } + break; + case "insetStart": + this.translateX = this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.right); + } + break; + case "insetEnd": + this.translateX = this.baseHorizontalOffset; + if (this.horizontalViewportLock && this.anchorRect.left < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.left); + } + break; + case "end": + this.translateX = this.baseHorizontalOffset + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.left); + } + break; + case "center": + sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2; + this.translateX = this.baseHorizontalOffset + sizeDelta; + if (this.horizontalViewportLock) { + const regionLeft = this.anchorRect.left + sizeDelta; + const regionRight = this.anchorRect.right - sizeDelta; + if (regionLeft < this.viewportRect.left && !(regionRight > this.viewportRect.right)) { + this.translateX = this.translateX - (regionLeft - this.viewportRect.left); + } else if (regionRight > this.viewportRect.right && !(regionLeft < this.viewportRect.left)) { + this.translateX = this.translateX - (regionRight - this.viewportRect.right); + } + } + break; + } + this.horizontalPosition = desiredHorizontalPosition; + }; + this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => { + if (desiredVerticalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionHeight = 0; + switch (this.verticalScaling) { + case "anchor": + case "fill": + nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height; + this.regionHeight = `${nextRegionHeight}px`; + break; + case "content": + nextRegionHeight = this.regionRect.height; + this.regionHeight = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredVerticalPosition) { + case "start": + this.translateY = this.baseVerticalOffset - nextRegionHeight; + if (this.verticalViewportLock && this.anchorRect.top > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.bottom); + } + break; + case "insetStart": + this.translateY = this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.bottom); + } + break; + case "insetEnd": + this.translateY = this.baseVerticalOffset; + if (this.verticalViewportLock && this.anchorRect.top < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.top); + } + break; + case "end": + this.translateY = this.baseVerticalOffset + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.top); + } + break; + case "center": + sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2; + this.translateY = this.baseVerticalOffset + sizeDelta; + if (this.verticalViewportLock) { + const regionTop = this.anchorRect.top + sizeDelta; + const regionBottom = this.anchorRect.bottom - sizeDelta; + if (regionTop < this.viewportRect.top && !(regionBottom > this.viewportRect.bottom)) { + this.translateY = this.translateY - (regionTop - this.viewportRect.top); + } else if (regionBottom > this.viewportRect.bottom && !(regionTop < this.viewportRect.top)) { + this.translateY = this.translateY - (regionBottom - this.viewportRect.bottom); + } + } + } + this.verticalPosition = desiredVerticalPosition; + }; + this.getPositioningOptions = (inset) => { + if (inset) { + return ["insetStart", "insetEnd"]; + } + return ["start", "end"]; + }; + this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => { + const spaceStart = anchorStart - viewportStart; + const spaceEnd = viewportEnd - (anchorStart + anchorSpan); + switch (positionOption) { + case "start": + return spaceStart; + case "insetStart": + return spaceStart + anchorSpan; + case "insetEnd": + return spaceEnd + anchorSpan; + case "end": + return spaceEnd; + case "center": + return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan; + } + }; + this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => { + const newRegionDimension = { + height: this.regionRect !== void 0 ? this.regionRect.height : 0, + width: this.regionRect !== void 0 ? this.regionRect.width : 0 + }; + if (desiredHorizontalPosition !== void 0 && this.horizontalScaling === "fill") { + newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== void 0 ? this.anchorRect.left : 0, this.anchorRect !== void 0 ? this.anchorRect.right : 0, this.anchorRect !== void 0 ? this.anchorRect.width : 0, this.viewportRect !== void 0 ? this.viewportRect.left : 0, this.viewportRect !== void 0 ? this.viewportRect.right : 0); + } else if (this.horizontalScaling === "anchor") { + newRegionDimension.width = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + } + if (desiredVerticalPosition !== void 0 && this.verticalScaling === "fill") { + newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== void 0 ? this.anchorRect.top : 0, this.anchorRect !== void 0 ? this.anchorRect.bottom : 0, this.anchorRect !== void 0 ? this.anchorRect.height : 0, this.viewportRect !== void 0 ? this.viewportRect.top : 0, this.viewportRect !== void 0 ? this.viewportRect.bottom : 0); + } else if (this.verticalScaling === "anchor") { + newRegionDimension.height = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + } + return newRegionDimension; + }; + this.startAutoUpdateEventListeners = () => { + window.addEventListener(eventResize, this.update, { passive: true }); + window.addEventListener(eventScroll, this.update, { + passive: true, + capture: true + }); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.observe(this.viewportElement); + } + }; + this.stopAutoUpdateEventListeners = () => { + window.removeEventListener(eventResize, this.update); + window.removeEventListener(eventScroll, this.update); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.unobserve(this.viewportElement); + } + }; + } + anchorChanged() { + if (this.initialLayoutComplete) { + this.anchorElement = this.getAnchor(); + } + } + viewportChanged() { + if (this.initialLayoutComplete) { + this.viewportElement = this.getViewport(); + } + } + horizontalPositioningModeChanged() { + this.requestReset(); + } + horizontalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + horizontalViewportLockChanged() { + this.updateForAttributeChange(); + } + horizontalInsetChanged() { + this.updateForAttributeChange(); + } + horizontalThresholdChanged() { + this.updateForAttributeChange(); + } + horizontalScalingChanged() { + this.updateForAttributeChange(); + } + verticalPositioningModeChanged() { + this.requestReset(); + } + verticalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + verticalViewportLockChanged() { + this.updateForAttributeChange(); + } + verticalInsetChanged() { + this.updateForAttributeChange(); + } + verticalThresholdChanged() { + this.updateForAttributeChange(); + } + verticalScalingChanged() { + this.updateForAttributeChange(); + } + fixedPlacementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + autoUpdateModeChanged(prevMode, newMode) { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + if (prevMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + if (newMode === "auto") { + this.startAutoUpdateEventListeners(); + } + } + } + anchorElementChanged() { + this.requestReset(); + } + viewportElementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.autoUpdateMode === "auto") { + this.startAutoUpdateEventListeners(); + } + this.initialize(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.autoUpdateMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + this.stopObservers(); + this.disconnectResizeDetector(); + } + /** + * @internal + */ + adoptedCallback() { + this.initialize(); + } + /** + * destroys the instance's resize observer + */ + disconnectResizeDetector() { + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.handleResize); + } + /** + * react to attribute changes that don't require a reset + */ + updateForAttributeChange() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.forceUpdate = true; + this.update(); + } + } + /** + * fully initializes the component + */ + initialize() { + this.initializeResizeDetector(); + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + this.requestReset(); + } + /** + * Request a reset if there are currently no open requests + */ + requestReset() { + if (this.$fastController.isConnected && this.pendingReset === false) { + this.setInitialState(); + DOM.queueUpdate(() => this.reset()); + this.pendingReset = true; + } + } + /** + * sets the starting configuration for component internal values + */ + setInitialState() { + this.initialLayoutComplete = false; + this.regionVisible = false; + this.translateX = 0; + this.translateY = 0; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.viewportRect = void 0; + this.regionRect = void 0; + this.anchorRect = void 0; + this.verticalPosition = void 0; + this.horizontalPosition = void 0; + this.style.opacity = "0"; + this.style.pointerEvents = "none"; + this.forceUpdate = false; + this.style.position = this.fixedPlacement ? "fixed" : "absolute"; + this.updatePositionClasses(); + this.updateRegionStyle(); + } + }; + AnchoredRegion.intersectionService = new IntersectionService(); + __decorate([ + attr + ], AnchoredRegion.prototype, "anchor", void 0); + __decorate([ + attr + ], AnchoredRegion.prototype, "viewport", void 0); + __decorate([ + attr({ attribute: "horizontal-positioning-mode" }) + ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0); + __decorate([ + attr({ attribute: "horizontal-default-position" }) + ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "horizontal-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalInset", void 0); + __decorate([ + attr({ attribute: "horizontal-threshold" }) + ], AnchoredRegion.prototype, "horizontalThreshold", void 0); + __decorate([ + attr({ attribute: "horizontal-scaling" }) + ], AnchoredRegion.prototype, "horizontalScaling", void 0); + __decorate([ + attr({ attribute: "vertical-positioning-mode" }) + ], AnchoredRegion.prototype, "verticalPositioningMode", void 0); + __decorate([ + attr({ attribute: "vertical-default-position" }) + ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalInset", void 0); + __decorate([ + attr({ attribute: "vertical-threshold" }) + ], AnchoredRegion.prototype, "verticalThreshold", void 0); + __decorate([ + attr({ attribute: "vertical-scaling" }) + ], AnchoredRegion.prototype, "verticalScaling", void 0); + __decorate([ + attr({ attribute: "fixed-placement", mode: "boolean" }) + ], AnchoredRegion.prototype, "fixedPlacement", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], AnchoredRegion.prototype, "autoUpdateMode", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "anchorElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "viewportElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "initialLayoutComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js + var horizontalAnchorOverlay, FlyoutPosTop, FlyoutPosBottom, FlyoutPosTallest, FlyoutPosTopFill, FlyoutPosBottomFill, FlyoutPosTallestFill; + var init_anchored_region_config = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js"() { + horizontalAnchorOverlay = { + horizontalDefaultPosition: "center", + horizontalPositioningMode: "locktodefault", + horizontalInset: false, + horizontalScaling: "anchor" + }; + FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "top", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "bottom", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: "dynamic", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: "fill" }); + FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: "fill" }); + FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: "fill" }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js + var init_anchored_region2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js"() { + init_anchored_region_template(); + init_anchored_region(); + init_anchored_region_config(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js + var init_avatar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js + var Avatar; + var init_avatar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Avatar = class extends FoundationElement { + /** + * Internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.shape) { + this.shape = "circle"; + } + } + }; + __decorate([ + attr + ], Avatar.prototype, "fill", void 0); + __decorate([ + attr + ], Avatar.prototype, "color", void 0); + __decorate([ + attr + ], Avatar.prototype, "link", void 0); + __decorate([ + attr + ], Avatar.prototype, "shape", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js + var init_avatar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js"() { + init_avatar_template(); + init_avatar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js + var badgeTemplate; + var init_badge_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js"() { + init_esm(); + badgeTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js + var Badge; + var init_badge = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Badge = class extends FoundationElement { + constructor() { + super(...arguments); + this.generateBadgeStyle = () => { + if (!this.fill && !this.color) { + return; + } + const fill = `background-color: var(--badge-fill-${this.fill});`; + const color = `color: var(--badge-color-${this.color});`; + if (this.fill && !this.color) { + return fill; + } else if (this.color && !this.fill) { + return color; + } else { + return `${color} ${fill}`; + } + }; + } + }; + __decorate([ + attr({ attribute: "fill" }) + ], Badge.prototype, "fill", void 0); + __decorate([ + attr({ attribute: "color" }) + ], Badge.prototype, "color", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Badge.prototype, "circular", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js + var init_badge2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js"() { + init_badge_template(); + init_badge(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js + var init_breadcrumb_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js + var BreadcrumbItem; + var init_breadcrumb_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js"() { + init_tslib_es6(); + init_esm(); + init_anchor(); + init_patterns(); + init_apply_mixins(); + BreadcrumbItem = class extends Anchor { + constructor() { + super(...arguments); + this.separator = true; + } + }; + __decorate([ + observable + ], BreadcrumbItem.prototype, "separator", void 0); + applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js + var init_breadcrumb_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js"() { + init_breadcrumb_item_template(); + init_breadcrumb_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js + var init_breadcrumb_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js + var Breadcrumb; + var init_breadcrumb = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js"() { + init_tslib_es6(); + init_esm(); + init_breadcrumb_item(); + init_foundation_element(); + Breadcrumb = class extends FoundationElement { + slottedBreadcrumbItemsChanged() { + if (this.$fastController.isConnected) { + if (this.slottedBreadcrumbItems === void 0 || this.slottedBreadcrumbItems.length === 0) { + return; + } + const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1]; + this.slottedBreadcrumbItems.forEach((item) => { + const itemIsLastNode = item === lastNode; + this.setItemSeparator(item, itemIsLastNode); + this.setAriaCurrent(item, itemIsLastNode); + }); + } + } + setItemSeparator(item, isLastNode) { + if (item instanceof BreadcrumbItem) { + item.separator = !isLastNode; + } + } + /** + * Finds href on childnodes in the light DOM or shadow DOM. + * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href. + */ + findChildWithHref(node) { + var _a, _b; + if (node.childElementCount > 0) { + return node.querySelector("a[href]"); + } else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) { + return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]"); + } else + return null; + } + /** + * Sets ARIA Current for the current node + * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node, + * otherwise apply aria-current to the host element, with an href + */ + setAriaCurrent(item, isLastNode) { + const childNodeWithHref = this.findChildWithHref(item); + if (childNodeWithHref === null && item.hasAttribute("href") && item instanceof BreadcrumbItem) { + isLastNode ? item.setAttribute("aria-current", "page") : item.removeAttribute("aria-current"); + } else if (childNodeWithHref !== null) { + isLastNode ? childNodeWithHref.setAttribute("aria-current", "page") : childNodeWithHref.removeAttribute("aria-current"); + } + } + }; + __decorate([ + observable + ], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js + var init_breadcrumb2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js"() { + init_breadcrumb_template(); + init_breadcrumb(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js + var buttonTemplate; + var init_button_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js"() { + init_esm(); + init_start_end(); + buttonTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js + function FormAssociated(BaseCtor) { + const C = class extends BaseCtor { + constructor(...args) { + super(...args); + this.dirtyValue = false; + this.disabled = false; + this.proxyEventsToBlock = ["change", "click"]; + this.proxyInitialized = false; + this.required = false; + this.initialValue = this.initialValue || ""; + if (!this.elementInternals) { + this.formResetCallback = this.formResetCallback.bind(this); + } + } + /** + * Must evaluate to true to enable elementInternals. + * Feature detects API support and resolve respectively + * + * @internal + */ + static get formAssociated() { + return supportsElementInternals; + } + /** + * Returns the validity state of the element + * + * @alpha + */ + get validity() { + return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; + } + /** + * Retrieve a reference to the associated form. + * Returns null if not associated to any form. + * + * @alpha + */ + get form() { + return this.elementInternals ? this.elementInternals.form : this.proxy.form; + } + /** + * Retrieve the localized validation message, + * or custom validation message if set. + * + * @alpha + */ + get validationMessage() { + return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; + } + /** + * Whether the element will be validated when the + * form is submitted + */ + get willValidate() { + return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; + } + /** + * A reference to all associated label elements + */ + get labels() { + if (this.elementInternals) { + return Object.freeze(Array.from(this.elementInternals.labels)); + } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { + const parentLabels = this.proxy.labels; + const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)); + const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; + return Object.freeze(labels); + } else { + return emptyArray; + } + } + /** + * Invoked when the `value` property changes + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `valueChanged` method + * They must be sure to invoke `super.valueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + valueChanged(previous, next) { + this.dirtyValue = true; + if (this.proxy instanceof HTMLElement) { + this.proxy.value = this.value; + } + this.currentValue = this.value; + this.setFormValue(this.value); + this.validate(); + } + currentValueChanged() { + this.value = this.currentValue; + } + /** + * Invoked when the `initialValue` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `initialValueChanged` method + * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + /** + * Invoked when the `disabled` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `disabledChanged` method + * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + disabledChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.disabled = this.disabled; + } + DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled)); + } + /** + * Invoked when the `name` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `nameChanged` method + * They must be sure to invoke `super.nameChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + nameChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.name = this.name; + } + } + /** + * Invoked when the `required` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `requiredChanged` method + * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + requiredChanged(prev, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.required = this.required; + } + DOM.queueUpdate(() => this.classList.toggle("required", this.required)); + this.validate(); + } + /** + * The element internals object. Will only exist + * in browsers supporting the attachInternals API + */ + get elementInternals() { + if (!supportsElementInternals) { + return null; + } + let internals = InternalsMap.get(this); + if (!internals) { + internals = this.attachInternals(); + InternalsMap.set(this, internals); + } + return internals; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("keypress", this._keypressHandler); + if (!this.value) { + this.value = this.initialValue; + this.dirtyValue = false; + } + if (!this.elementInternals) { + this.attachProxy(); + if (this.form) { + this.form.addEventListener("reset", this.formResetCallback); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.proxyEventsToBlock.forEach((name) => this.proxy.removeEventListener(name, this.stopPropagation)); + if (!this.elementInternals && this.form) { + this.form.removeEventListener("reset", this.formResetCallback); + } + } + /** + * Return the current validity of the element. + */ + checkValidity() { + return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); + } + /** + * Return the current validity of the element. + * If false, fires an invalid event at the element. + */ + reportValidity() { + return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); + } + /** + * Set the validity of the control. In cases when the elementInternals object is not + * available (and the proxy element is used to report validity), this function will + * do nothing unless a message is provided, at which point the setCustomValidity method + * of the proxy element will be invoked with the provided message. + * @param flags - Validity flags + * @param message - Optional message to supply + * @param anchor - Optional element used by UA to display an interactive validation UI + */ + setValidity(flags, message, anchor) { + if (this.elementInternals) { + this.elementInternals.setValidity(flags, message, anchor); + } else if (typeof message === "string") { + this.proxy.setCustomValidity(message); + } + } + /** + * Invoked when a connected component's form or fieldset has its disabled + * state changed. + * @param disabled - the disabled value of the form / fieldset + */ + formDisabledCallback(disabled) { + this.disabled = disabled; + } + formResetCallback() { + this.value = this.initialValue; + this.dirtyValue = false; + } + /** + * Attach the proxy element to the DOM + */ + attachProxy() { + var _a; + if (!this.proxyInitialized) { + this.proxyInitialized = true; + this.proxy.style.display = "none"; + this.proxyEventsToBlock.forEach((name) => this.proxy.addEventListener(name, this.stopPropagation)); + this.proxy.disabled = this.disabled; + this.proxy.required = this.required; + if (typeof this.name === "string") { + this.proxy.name = this.name; + } + if (typeof this.value === "string") { + this.proxy.value = this.value; + } + this.proxy.setAttribute("slot", proxySlotName); + this.proxySlot = document.createElement("slot"); + this.proxySlot.setAttribute("name", proxySlotName); + } + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); + this.appendChild(this.proxy); + } + /** + * Detach the proxy element from the DOM + */ + detachProxy() { + var _a; + this.removeChild(this.proxy); + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate(anchor) { + if (this.proxy instanceof HTMLElement) { + this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); + } + } + /** + * Associates the provided value (and optional state) with the parent form. + * @param value - The value to set + * @param state - The state object provided to during session restores and when autofilling. + */ + setFormValue(value, state) { + if (this.elementInternals) { + this.elementInternals.setFormValue(value, state || value); + } + } + _keypressHandler(e) { + switch (e.key) { + case keyEnter: + if (this.form instanceof HTMLFormElement) { + const defaultButton = this.form.querySelector("[type=submit]"); + defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); + } + break; + } + } + /** + * Used to stop propagation of proxy element events + * @param e - Event object + */ + stopPropagation(e) { + e.stopPropagation(); + } + }; + attr({ mode: "boolean" })(C.prototype, "disabled"); + attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue"); + attr({ attribute: "current-value" })(C.prototype, "currentValue"); + attr(C.prototype, "name"); + attr({ mode: "boolean" })(C.prototype, "required"); + observable(C.prototype, "value"); + return C; + } + function CheckableFormAssociated(BaseCtor) { + class C extends FormAssociated(BaseCtor) { + } + class D extends C { + constructor(...args) { + super(args); + this.dirtyChecked = false; + this.checkedAttribute = false; + this.checked = false; + this.dirtyChecked = false; + } + checkedAttributeChanged() { + this.defaultChecked = this.checkedAttribute; + } + /** + * @internal + */ + defaultCheckedChanged() { + if (!this.dirtyChecked) { + this.checked = this.defaultChecked; + this.dirtyChecked = false; + } + } + checkedChanged(prev, next) { + if (!this.dirtyChecked) { + this.dirtyChecked = true; + } + this.currentChecked = this.checked; + this.updateForm(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.checked = this.checked; + } + if (prev !== void 0) { + this.$emit("change"); + } + this.validate(); + } + currentCheckedChanged(prev, next) { + this.checked = this.currentChecked; + } + updateForm() { + const value = this.checked ? this.value : null; + this.setFormValue(value, value); + } + connectedCallback() { + super.connectedCallback(); + this.updateForm(); + } + formResetCallback() { + super.formResetCallback(); + this.checked = !!this.checkedAttribute; + this.dirtyChecked = false; + } + } + attr({ attribute: "checked", mode: "boolean" })(D.prototype, "checkedAttribute"); + attr({ attribute: "current-checked", converter: booleanConverter })(D.prototype, "currentChecked"); + observable(D.prototype, "defaultChecked"); + observable(D.prototype, "checked"); + return D; + } + var proxySlotName, ElementInternalsKey, supportsElementInternals, InternalsMap; + var init_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js"() { + init_esm(); + init_dist2(); + proxySlotName = "form-associated-proxy"; + ElementInternalsKey = "ElementInternals"; + supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; + InternalsMap = /* @__PURE__ */ new WeakMap(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js + var _Button, FormAssociatedButton; + var init_button_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Button = class extends FoundationElement { + }; + FormAssociatedButton = class extends FormAssociated(_Button) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.js + var Button, DelegatesARIAButton; + var init_button = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_button_form_associated(); + Button = class extends FormAssociatedButton { + constructor() { + super(...arguments); + this.handleClick = (e) => { + var _a; + if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) { + e.stopPropagation(); + } + }; + this.handleSubmission = () => { + if (!this.form) { + return; + } + const attached = this.proxy.isConnected; + if (!attached) { + this.attachProxy(); + } + typeof this.form.requestSubmit === "function" ? this.form.requestSubmit(this.proxy) : this.proxy.click(); + if (!attached) { + this.detachProxy(); + } + }; + this.handleFormReset = () => { + var _a; + (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset(); + }; + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + this.control.focus(); + }; + } + }; + } + formactionChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formAction = this.formaction; + } + } + formenctypeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formEnctype = this.formenctype; + } + } + formmethodChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formMethod = this.formmethod; + } + } + formnovalidateChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formNoValidate = this.formnovalidate; + } + } + formtargetChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formTarget = this.formtarget; + } + } + typeChanged(previous, next) { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + } + next === "submit" && this.addEventListener("click", this.handleSubmission); + previous === "submit" && this.removeEventListener("click", this.handleSubmission); + next === "reset" && this.addEventListener("click", this.handleFormReset); + previous === "reset" && this.removeEventListener("click", this.handleFormReset); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.handleUnsupportedDelegatesFocus(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.addEventListener("click", this.handleClick); + }); + } + } + /** + * @internal + */ + disconnectedCallback() { + var _a; + super.disconnectedCallback(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.removeEventListener("click", this.handleClick); + }); + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], Button.prototype, "formId", void 0); + __decorate([ + attr + ], Button.prototype, "formaction", void 0); + __decorate([ + attr + ], Button.prototype, "formenctype", void 0); + __decorate([ + attr + ], Button.prototype, "formmethod", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "formnovalidate", void 0); + __decorate([ + attr + ], Button.prototype, "formtarget", void 0); + __decorate([ + attr + ], Button.prototype, "type", void 0); + __decorate([ + observable + ], Button.prototype, "defaultSlottedContent", void 0); + DelegatesARIAButton = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIAButton.prototype, "ariaExpanded", void 0); + __decorate([ + attr({ attribute: "aria-pressed" }) + ], DelegatesARIAButton.prototype, "ariaPressed", void 0); + applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties); + applyMixins(Button, StartEnd, DelegatesARIAButton); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/index.js + var init_button2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/index.js"() { + init_button_template(); + init_button(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js + var DateFormatter; + var init_date_formatter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js"() { + DateFormatter = class { + constructor(config) { + this.dayFormat = "numeric"; + this.weekdayFormat = "long"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.date = /* @__PURE__ */ new Date(); + if (config) { + for (const key in config) { + const value = config[key]; + if (key === "date") { + this.date = this.getDateObject(value); + } else { + this[key] = value; + } + } + } + } + /** + * Helper function to make sure that the DateFormatter is working with an instance of Date + * @param date - The date as an object, string or Date insance + * @returns - A Date instance + * @public + */ + getDateObject(date) { + if (typeof date === "string") { + const dates = date.split(/[/-]/); + if (dates.length < 3) { + return /* @__PURE__ */ new Date(); + } + return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10)); + } else if ("day" in date && "month" in date && "year" in date) { + const { day, month, year } = date; + return new Date(year, month - 1, day); + } + return date; + } + /** + * + * @param date - a valide date as either a Date, string, objec or a DateFormatter + * @param format - The formatting for the string + * @param locale - locale data used for formatting + * @returns A localized string of the date provided + * @public + */ + getDate(date = this.date, format = { + weekday: this.weekdayFormat, + month: this.monthFormat, + day: this.dayFormat, + year: this.yearFormat + }, locale = this.locale) { + const dateObj = this.getDateObject(date); + if (!dateObj.getTime()) { + return ""; + } + const optionsWithTimeZone = Object.assign({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }, format); + return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj); + } + /** + * + * @param day - Day to localize + * @param format - The formatting for the day + * @param locale - The locale data used for formatting + * @returns - A localized number for the day + * @public + */ + getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) { + return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale); + } + /** + * + * @param month - The month to localize + * @param format - The formatting for the month + * @param locale - The locale data used for formatting + * @returns - A localized name of the month + * @public + */ + getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) { + return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale); + } + /** + * + * @param year - The year to localize + * @param format - The formatting for the year + * @param locale - The locale data used for formatting + * @returns - A localized string for the year + * @public + */ + getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) { + return this.getDate({ month: 2, day: 2, year }, { year: format }, locale); + } + /** + * + * @param weekday - The number of the weekday, defaults to Sunday + * @param format - The formatting for the weekday label + * @param locale - The locale data used for formatting + * @returns - A formatted weekday label + * @public + */ + getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) { + const date = `1-${weekday + 1}-2017`; + return this.getDate(date, { weekday: format }, locale); + } + /** + * + * @param format - The formatting for the weekdays + * @param locale - The locale data used for formatting + * @returns - An array of the weekday labels + * @public + */ + getWeekdays(format = this.weekdayFormat, locale = this.locale) { + return Array(7).fill(null).map((_, day) => this.getWeekday(day, format, locale)); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js + var Calendar; + var init_calendar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_date_formatter(); + Calendar = class extends FoundationElement { + constructor() { + super(...arguments); + this.dateFormatter = new DateFormatter(); + this.readonly = false; + this.locale = "en-US"; + this.month = (/* @__PURE__ */ new Date()).getMonth() + 1; + this.year = (/* @__PURE__ */ new Date()).getFullYear(); + this.dayFormat = "numeric"; + this.weekdayFormat = "short"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.minWeeks = 0; + this.disabledDates = ""; + this.selectedDates = ""; + this.oneDayInMs = 864e5; + } + localeChanged() { + this.dateFormatter.locale = this.locale; + } + dayFormatChanged() { + this.dateFormatter.dayFormat = this.dayFormat; + } + weekdayFormatChanged() { + this.dateFormatter.weekdayFormat = this.weekdayFormat; + } + monthFormatChanged() { + this.dateFormatter.monthFormat = this.monthFormat; + } + yearFormatChanged() { + this.dateFormatter.yearFormat = this.yearFormat; + } + /** + * Gets data needed to render about a calendar month as well as the previous and next months + * @param year - year of the calendar + * @param month - month of the calendar + * @returns - an object with data about the current and 2 surrounding months + * @public + */ + getMonthInfo(month = this.month, year = this.year) { + const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay(); + const getLength = (date) => { + const nextMonth2 = new Date(date.getFullYear(), date.getMonth() + 1, 1); + return new Date(nextMonth2.getTime() - this.oneDayInMs).getDate(); + }; + const thisMonth = new Date(year, month - 1); + const nextMonth = new Date(year, month); + const previousMonth = new Date(year, month - 2); + return { + length: getLength(thisMonth), + month, + start: getFirstDay(thisMonth), + year, + previous: { + length: getLength(previousMonth), + month: previousMonth.getMonth() + 1, + start: getFirstDay(previousMonth), + year: previousMonth.getFullYear() + }, + next: { + length: getLength(nextMonth), + month: nextMonth.getMonth() + 1, + start: getFirstDay(nextMonth), + year: nextMonth.getFullYear() + } + }; + } + /** + * A list of calendar days + * @param info - an object containing the information needed to render a calendar month + * @param minWeeks - minimum number of weeks to show + * @returns a list of days in a calendar month + * @public + */ + getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) { + minWeeks = minWeeks > 10 ? 10 : minWeeks; + const { start, length, previous, next } = info; + const days = []; + let dayCount = 1 - start; + while (dayCount < length + 1 || days.length < minWeeks || days[days.length - 1].length % 7 !== 0) { + const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info; + const day = dayCount < 1 ? previous.length + dayCount : dayCount > length ? dayCount - length : dayCount; + const dateString = `${month}-${day}-${year}`; + const disabled = this.dateInString(dateString, this.disabledDates); + const selected = this.dateInString(dateString, this.selectedDates); + const date = { + day, + month, + year, + disabled, + selected + }; + const target = days[days.length - 1]; + if (days.length === 0 || target.length % 7 === 0) { + days.push([date]); + } else { + target.push(date); + } + dayCount++; + } + return days; + } + /** + * A helper function that checks if a date exists in a list of dates + * @param date - A date objec that includes the day, month and year + * @param datesString - a comma separated list of dates + * @returns - Returns true if it found the date in the list of dates + * @public + */ + dateInString(date, datesString) { + const dates = datesString.split(",").map((str) => str.trim()); + date = typeof date === "string" ? date : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; + return dates.some((d) => d === date); + } + /** + * Creates a class string for the day container + * @param date - date of the calendar cell + * @returns - string of class names + * @public + */ + getDayClassNames(date, todayString) { + const { day, month, year, disabled, selected } = date; + const today = todayString === `${month}-${day}-${year}`; + const inactive = this.month !== month; + return [ + "day", + today && "today", + inactive && "inactive", + disabled && "disabled", + selected && "selected" + ].filter(Boolean).join(" "); + } + /** + * Returns a list of weekday labels + * @returns An array of weekday text and full text if abbreviated + * @public + */ + getWeekdayText() { + const weekdayText = this.dateFormatter.getWeekdays().map((text) => ({ text })); + if (this.weekdayFormat !== "long") { + const longText = this.dateFormatter.getWeekdays("long"); + weekdayText.forEach((weekday, index) => { + weekday.abbr = longText[index]; + }); + } + return weekdayText; + } + /** + * Emits the "date-select" event with the day, month and year. + * @param date - Date cell + * @public + */ + handleDateSelect(event, day) { + event.preventDefault; + this.$emit("dateselected", day); + } + /** + * Handles keyboard events on a cell + * @param event - Keyboard event + * @param date - Date of the cell selected + */ + handleKeydown(event, date) { + if (event.key === keyEnter) { + this.handleDateSelect(event, date); + } + return true; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Calendar.prototype, "readonly", void 0); + __decorate([ + attr + ], Calendar.prototype, "locale", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "month", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "year", void 0); + __decorate([ + attr({ attribute: "day-format", mode: "fromView" }) + ], Calendar.prototype, "dayFormat", void 0); + __decorate([ + attr({ attribute: "weekday-format", mode: "fromView" }) + ], Calendar.prototype, "weekdayFormat", void 0); + __decorate([ + attr({ attribute: "month-format", mode: "fromView" }) + ], Calendar.prototype, "monthFormat", void 0); + __decorate([ + attr({ attribute: "year-format", mode: "fromView" }) + ], Calendar.prototype, "yearFormat", void 0); + __decorate([ + attr({ attribute: "min-weeks", converter: nullableNumberConverter }) + ], Calendar.prototype, "minWeeks", void 0); + __decorate([ + attr({ attribute: "disabled-dates" }) + ], Calendar.prototype, "disabledDates", void 0); + __decorate([ + attr({ attribute: "selected-dates" }) + ], Calendar.prototype, "selectedDates", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js + var GenerateHeaderOptions, DataGridCellTypes, DataGridRowTypes; + var init_data_grid_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js"() { + GenerateHeaderOptions = { + none: "none", + default: "default", + sticky: "sticky" + }; + DataGridCellTypes = { + default: "default", + columnHeader: "columnheader", + rowHeader: "rowheader" + }; + DataGridRowTypes = { + default: "default", + header: "header", + stickyHeader: "sticky-header" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js + var DataGridRow; + var init_data_grid_row = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGridRow = class extends FoundationElement { + constructor() { + super(...arguments); + this.rowType = DataGridRowTypes.default; + this.rowData = null; + this.columnDefinitions = null; + this.isActiveRow = false; + this.cellsRepeatBehavior = null; + this.cellsPlaceholder = null; + this.focusColumnIndex = 0; + this.refocusOnLoad = false; + this.updateRowStyle = () => { + this.style.gridTemplateColumns = this.gridTemplateColumns; + }; + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowStyle(); + } + } + rowTypeChanged() { + if (this.$fastController.isConnected) { + this.updateItemTemplate(); + } + } + rowDataChanged() { + if (this.rowData !== null && this.isActiveRow) { + this.refocusOnLoad = true; + return; + } + } + cellItemTemplateChanged() { + this.updateItemTemplate(); + } + headerCellItemTemplateChanged() { + this.updateItemTemplate(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.cellsRepeatBehavior === null) { + this.cellsPlaceholder = document.createComment(""); + this.appendChild(this.cellsPlaceholder); + this.updateItemTemplate(); + this.cellsRepeatBehavior = new RepeatDirective((x) => x.columnDefinitions, (x) => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder); + this.$fastController.addBehaviors([this.cellsRepeatBehavior]); + } + this.addEventListener("cell-focused", this.handleCellFocus); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.updateRowStyle(); + if (this.refocusOnLoad) { + this.refocusOnLoad = false; + if (this.cellElements.length > this.focusColumnIndex) { + this.cellElements[this.focusColumnIndex].focus(); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("cell-focused", this.handleCellFocus); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + } + handleFocusout(e) { + if (!this.contains(e.target)) { + this.isActiveRow = false; + this.focusColumnIndex = 0; + } + } + handleCellFocus(e) { + this.isActiveRow = true; + this.focusColumnIndex = this.cellElements.indexOf(e.target); + this.$emit("row-focused", this); + } + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusColumnIndex = 0; + switch (e.key) { + case keyArrowLeft: + newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyArrowRight: + newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyHome: + if (!e.ctrlKey) { + this.cellElements[0].focus(); + e.preventDefault(); + } + break; + case keyEnd: + if (!e.ctrlKey) { + this.cellElements[this.cellElements.length - 1].focus(); + e.preventDefault(); + } + break; + } + } + updateItemTemplate() { + this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate; + } + }; + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGridRow.prototype, "gridTemplateColumns", void 0); + __decorate([ + attr({ attribute: "row-type" }) + ], DataGridRow.prototype, "rowType", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowIndex", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "isActiveRow", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "activeCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js + function createRowItemTemplate(context) { + const rowTag = context.tagFor(DataGridRow); + return html` + <${rowTag} + :rowData="${(x) => x}" + :cellItemTemplate="${(x, c) => c.parent.cellItemTemplate}" + :headerCellItemTemplate="${(x, c) => c.parent.headerCellItemTemplate}" + > +`; + } + var dataGridTemplate; + var init_data_grid_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js"() { + init_esm(); + init_data_grid_row(); + dataGridTemplate = (context, definition) => { + const rowItemTemplate = createRowItemTemplate(context); + const rowTag = context.tagFor(DataGridRow); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js + var DataGrid; + var init_data_grid = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGrid = class _DataGrid extends FoundationElement { + constructor() { + super(); + this.noTabbing = false; + this.generateHeader = GenerateHeaderOptions.default; + this.rowsData = []; + this.columnDefinitions = null; + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + this.rowsPlaceholder = null; + this.generatedHeader = null; + this.isUpdatingFocus = false; + this.pendingFocusUpdate = false; + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = true; + this.generatedGridTemplateColumns = ""; + this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => { + if (this.rowElements.length === 0) { + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + return; + } + const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex)); + const focusRow = this.rowElements[focusRowIndex]; + const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'); + const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex)); + const focusTarget = cells[focusColumnIndex]; + if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) { + focusTarget.scrollIntoView({ block: "center", inline: "center" }); + } + focusTarget.focus(); + }; + this.onChildListChange = (mutations, observer) => { + if (mutations && mutations.length) { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((newNode) => { + if (newNode.nodeType === 1 && newNode.getAttribute("role") === "row") { + newNode.columnDefinitions = this.columnDefinitions; + } + }); + }); + this.queueRowIndexUpdate(); + } + }; + this.queueRowIndexUpdate = () => { + if (!this.rowindexUpdateQueued) { + this.rowindexUpdateQueued = true; + DOM.queueUpdate(this.updateRowIndexes); + } + }; + this.updateRowIndexes = () => { + let newGridTemplateColumns = this.gridTemplateColumns; + if (newGridTemplateColumns === void 0) { + if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) { + const firstRow = this.rowElements[0]; + this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" "); + } + newGridTemplateColumns = this.generatedGridTemplateColumns; + } + this.rowElements.forEach((element, index) => { + const thisRow = element; + thisRow.rowIndex = index; + thisRow.gridTemplateColumns = newGridTemplateColumns; + if (this.columnDefinitionsStale) { + thisRow.columnDefinitions = this.columnDefinitions; + } + }); + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = false; + }; + } + /** + * generates a gridTemplateColumns based on columndata array + */ + static generateTemplateColumns(columnDefinitions) { + let templateColumns = ""; + columnDefinitions.forEach((column) => { + templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`; + }); + return templateColumns; + } + noTabbingChanged() { + if (this.$fastController.isConnected) { + if (this.noTabbing) { + this.setAttribute("tabIndex", "-1"); + } else { + this.setAttribute("tabIndex", this.contains(document.activeElement) || this === document.activeElement ? "-1" : "0"); + } + } + } + generateHeaderChanged() { + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowIndexes(); + } + } + rowsDataChanged() { + if (this.columnDefinitions === null && this.rowsData.length > 0) { + this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]); + } + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + columnDefinitionsChanged() { + if (this.columnDefinitions === null) { + this.generatedGridTemplateColumns = ""; + return; + } + this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(this.columnDefinitions); + if (this.$fastController.isConnected) { + this.columnDefinitionsStale = true; + this.queueRowIndexUpdate(); + } + } + headerCellItemTemplateChanged() { + if (this.$fastController.isConnected) { + if (this.generatedHeader !== null) { + this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate; + } + } + } + focusRowIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + focusColumnIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.rowItemTemplate === void 0) { + this.rowItemTemplate = this.defaultRowItemTemplate; + } + this.rowsPlaceholder = document.createComment(""); + this.appendChild(this.rowsPlaceholder); + this.toggleGeneratedHeader(); + this.rowsRepeatBehavior = new RepeatDirective((x) => x.rowsData, (x) => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder); + this.$fastController.addBehaviors([this.rowsRepeatBehavior]); + this.addEventListener("row-focused", this.handleRowFocus); + this.addEventListener(eventFocus, this.handleFocus); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.addEventListener(eventFocusOut, this.handleFocusOut); + this.observer = new MutationObserver(this.onChildListChange); + this.observer.observe(this, { childList: true }); + if (this.noTabbing) { + this.setAttribute("tabindex", "-1"); + } + DOM.queueUpdate(this.queueRowIndexUpdate); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("row-focused", this.handleRowFocus); + this.removeEventListener(eventFocus, this.handleFocus); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.removeEventListener(eventFocusOut, this.handleFocusOut); + this.observer.disconnect(); + this.rowsPlaceholder = null; + this.generatedHeader = null; + } + /** + * @internal + */ + handleRowFocus(e) { + this.isUpdatingFocus = true; + const focusRow = e.target; + this.focusRowIndex = this.rowElements.indexOf(focusRow); + this.focusColumnIndex = focusRow.focusColumnIndex; + this.setAttribute("tabIndex", "-1"); + this.isUpdatingFocus = false; + } + /** + * @internal + */ + handleFocus(e) { + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + /** + * @internal + */ + handleFocusOut(e) { + if (e.relatedTarget === null || !this.contains(e.relatedTarget)) { + this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0"); + } + } + /** + * @internal + */ + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusRowIndex; + const maxIndex = this.rowElements.length - 1; + const currentGridBottom = this.offsetHeight + this.scrollTop; + const lastRow = this.rowElements[maxIndex]; + switch (e.key) { + case keyArrowUp: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true); + break; + case keyArrowDown: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true); + break; + case keyPageUp: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex === 0) { + this.focusOnCell(0, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex - 1; + for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop < this.scrollTop) { + this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyPageDown: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) { + this.focusOnCell(maxIndex, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex + 1; + for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) { + let stickyHeaderOffset = 0; + if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) { + stickyHeaderOffset = this.generatedHeader.clientHeight; + } + this.scrollTop = thisRow.offsetTop - stickyHeaderOffset; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyHome: + if (e.ctrlKey) { + e.preventDefault(); + this.focusOnCell(0, 0, true); + } + break; + case keyEnd: + if (e.ctrlKey && this.columnDefinitions !== null) { + e.preventDefault(); + this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true); + } + break; + } + } + queueFocusUpdate() { + if (this.isUpdatingFocus && (this.contains(document.activeElement) || this === document.activeElement)) { + return; + } + if (this.pendingFocusUpdate === false) { + this.pendingFocusUpdate = true; + DOM.queueUpdate(() => this.updateFocus()); + } + } + updateFocus() { + this.pendingFocusUpdate = false; + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + toggleGeneratedHeader() { + if (this.generatedHeader !== null) { + this.removeChild(this.generatedHeader); + this.generatedHeader = null; + } + if (this.generateHeader !== GenerateHeaderOptions.none && this.rowsData.length > 0) { + const generatedHeaderElement = document.createElement(this.rowElementTag); + this.generatedHeader = generatedHeaderElement; + this.generatedHeader.columnDefinitions = this.columnDefinitions; + this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns; + this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header; + if (this.firstChild !== null || this.rowsPlaceholder !== null) { + this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder); + } + return; + } + } + }; + DataGrid.generateColumns = (row) => { + return Object.getOwnPropertyNames(row).map((property, index) => { + return { + columnDataKey: property, + gridColumn: `${index}` + }; + }); + }; + __decorate([ + attr({ attribute: "no-tabbing", mode: "boolean" }) + ], DataGrid.prototype, "noTabbing", void 0); + __decorate([ + attr({ attribute: "generate-header" }) + ], DataGrid.prototype, "generateHeader", void 0); + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGrid.prototype, "gridTemplateColumns", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowsData", void 0); + __decorate([ + observable + ], DataGrid.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusRowIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusColumnIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "defaultRowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElementTag", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js + var defaultCellContentsTemplate, defaultHeaderCellContentsTemplate, DataGridCell; + var init_data_grid_cell = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + defaultCellContentsTemplate = html` + +`; + defaultHeaderCellContentsTemplate = html` + +`; + DataGridCell = class extends FoundationElement { + constructor() { + super(...arguments); + this.cellType = DataGridCellTypes.default; + this.rowData = null; + this.columnDefinition = null; + this.isActiveCell = false; + this.customCellView = null; + this.updateCellStyle = () => { + this.style.gridColumn = this.gridColumn; + }; + } + cellTypeChanged() { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + gridColumnChanged() { + if (this.$fastController.isConnected) { + this.updateCellStyle(); + } + } + columnDefinitionChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.addEventListener(eventFocusIn, this.handleFocusin); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === void 0 ? 0 : this.columnDefinition.gridColumn}`; + this.updateCellView(); + this.updateCellStyle(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener(eventFocusIn, this.handleFocusin); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.disconnectCellView(); + } + handleFocusin(e) { + if (this.isActiveCell) { + return; + } + this.isActiveCell = true; + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + default: + if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + } + this.$emit("cell-focused", this); + } + handleFocusout(e) { + if (this !== document.activeElement && !this.contains(document.activeElement)) { + this.isActiveCell = false; + } + } + handleKeydown(e) { + if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) { + return; + } + switch (e.key) { + case keyEnter: + case keyFunction2: + if (this.contains(document.activeElement) && document.activeElement !== this) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + default: + if (this.columnDefinition.cellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + } + break; + case keyEscape: + if (this.contains(document.activeElement) && document.activeElement !== this) { + this.focus(); + e.preventDefault(); + } + break; + } + } + updateCellView() { + this.disconnectCellView(); + if (this.columnDefinition === null) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellTemplate !== void 0) { + this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this); + } else { + this.customCellView = defaultHeaderCellContentsTemplate.render(this, this); + } + break; + case void 0: + case DataGridCellTypes.rowHeader: + case DataGridCellTypes.default: + if (this.columnDefinition.cellTemplate !== void 0) { + this.customCellView = this.columnDefinition.cellTemplate.render(this, this); + } else { + this.customCellView = defaultCellContentsTemplate.render(this, this); + } + break; + } + } + disconnectCellView() { + if (this.customCellView !== null) { + this.customCellView.dispose(); + this.customCellView = null; + } + } + }; + __decorate([ + attr({ attribute: "cell-type" }) + ], DataGridCell.prototype, "cellType", void 0); + __decorate([ + attr({ attribute: "grid-column" }) + ], DataGridCell.prototype, "gridColumn", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "columnDefinition", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js + function createCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}" + grid-column="${(x, c) => c.index + 1}" + :rowData="${(x, c) => c.parent.rowData}" + :columnDefinition="${(x) => x}" + > +`; + } + function createHeaderCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="columnheader" + grid-column="${(x, c) => c.index + 1}" + :columnDefinition="${(x) => x}" + > +`; + } + var dataGridRowTemplate; + var init_data_grid_row_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js"() { + init_esm(); + init_data_grid_cell(); + dataGridRowTemplate = (context, definition) => { + const cellItemTemplate = createCellItemTemplate(context); + const headerCellItemTemplate = createHeaderCellItemTemplate(context); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js + var dataGridCellTemplate; + var init_data_grid_cell_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js"() { + init_esm(); + dataGridCellTemplate = (context, definition) => { + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js + var init_data_grid2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js"() { + init_data_grid_template(); + init_data_grid(); + init_data_grid_row_template(); + init_data_grid_row(); + init_data_grid_cell_template(); + init_data_grid_cell(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js + var CalendarTitleTemplate; + var init_calendar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js"() { + init_esm(); + CalendarTitleTemplate = html` +
+ + ${(x) => x.dateFormatter.getMonth(x.month)} + + ${(x) => x.dateFormatter.getYear(x.year)} +
+`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js + var init_calendar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js"() { + init_calendar(); + init_calendar_template(); + init_date_formatter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js + var init_card_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.js + var init_card = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/index.js + var init_card2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/index.js"() { + init_card_template(); + init_card(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js + var checkboxTemplate; + var init_checkbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js"() { + init_esm(); + checkboxTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js + var _Checkbox, FormAssociatedCheckbox; + var init_checkbox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Checkbox = class extends FoundationElement { + }; + FormAssociatedCheckbox = class extends CheckableFormAssociated(_Checkbox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js + var Checkbox; + var init_checkbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_checkbox_form_associated(); + Checkbox = class extends FormAssociatedCheckbox { + constructor() { + super(); + this.initialValue = "on"; + this.indeterminate = false; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keySpace: + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Checkbox.prototype, "readOnly", void 0); + __decorate([ + observable + ], Checkbox.prototype, "defaultSlottedNodes", void 0); + __decorate([ + observable + ], Checkbox.prototype, "indeterminate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js + var init_checkbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js"() { + init_checkbox_template(); + init_checkbox(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js + function isListboxOption(el2) { + return isHTMLElement(el2) && (el2.getAttribute("role") === "option" || el2 instanceof HTMLOptionElement); + } + var ListboxOption, DelegatesARIAListboxOption; + var init_listbox_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + ListboxOption = class extends FoundationElement { + constructor(text, value, defaultSelected, selected) { + super(); + this.defaultSelected = false; + this.dirtySelected = false; + this.selected = this.defaultSelected; + this.dirtyValue = false; + if (text) { + this.textContent = text; + } + if (value) { + this.initialValue = value; + } + if (defaultSelected) { + this.defaultSelected = defaultSelected; + } + if (selected) { + this.selected = selected; + } + this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected); + this.proxy.disabled = this.disabled; + } + /** + * Updates the ariaChecked property when the checked property changes. + * + * @param prev - the previous checked value + * @param next - the current checked value + * + * @public + */ + checkedChanged(prev, next) { + if (typeof next === "boolean") { + this.ariaChecked = next ? "true" : "false"; + return; + } + this.ariaChecked = null; + } + /** + * Updates the proxy's text content when the default slot changes. + * @param prev - the previous content value + * @param next - the current content value + * + * @internal + */ + contentChanged(prev, next) { + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.textContent = this.textContent; + } + this.$emit("contentchange", null, { bubbles: true }); + } + defaultSelectedChanged() { + if (!this.dirtySelected) { + this.selected = this.defaultSelected; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.defaultSelected; + } + } + } + disabledChanged(prev, next) { + this.ariaDisabled = this.disabled ? "true" : "false"; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.disabled = this.disabled; + } + } + selectedAttributeChanged() { + this.defaultSelected = this.selectedAttribute; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.defaultSelected = this.defaultSelected; + } + } + selectedChanged() { + this.ariaSelected = this.selected ? "true" : "false"; + if (!this.dirtySelected) { + this.dirtySelected = true; + } + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.selected; + } + } + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + get label() { + var _a; + return (_a = this.value) !== null && _a !== void 0 ? _a : this.text; + } + get text() { + var _a, _b; + return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : ""; + } + set value(next) { + const newValue = `${next !== null && next !== void 0 ? next : ""}`; + this._value = newValue; + this.dirtyValue = true; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.value = newValue; + } + Observable.notify(this, "value"); + } + get value() { + var _a; + Observable.track(this, "value"); + return (_a = this._value) !== null && _a !== void 0 ? _a : this.text; + } + get form() { + return this.proxy ? this.proxy.form : null; + } + }; + __decorate([ + observable + ], ListboxOption.prototype, "checked", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "content", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "defaultSelected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxOption.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "selected", mode: "boolean" }) + ], ListboxOption.prototype, "selectedAttribute", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "selected", void 0); + __decorate([ + attr({ attribute: "value", mode: "fromView" }) + ], ListboxOption.prototype, "initialValue", void 0); + DelegatesARIAListboxOption = class { + }; + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0); + applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties); + applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js + var Listbox, DelegatesARIAListbox; + var init_listbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_listbox_option(); + init_aria_global(); + init_apply_mixins(); + Listbox = class _Listbox extends FoundationElement { + constructor() { + super(...arguments); + this._options = []; + this.selectedIndex = -1; + this.selectedOptions = []; + this.shouldSkipFocus = false; + this.typeaheadBuffer = ""; + this.typeaheadExpired = true; + this.typeaheadTimeout = -1; + } + /** + * The first selected option. + * + * @internal + */ + get firstSelectedOption() { + var _a; + return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null; + } + /** + * Returns true if there is one or more selectable option. + * + * @internal + */ + get hasSelectableOptions() { + return this.options.length > 0 && !this.options.every((o) => o.disabled); + } + /** + * The number of options. + * + * @public + */ + get length() { + var _a, _b; + return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + } + /** + * The list of options. + * + * @public + */ + get options() { + Observable.track(this, "options"); + return this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Flag for the typeahead timeout expiration. + * + * @deprecated use `Listbox.typeaheadExpired` + * @internal + */ + get typeAheadExpired() { + return this.typeaheadExpired; + } + set typeAheadExpired(value) { + this.typeaheadExpired = value; + } + /** + * Handle click events for listbox options. + * + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && !captured.disabled) { + this.selectedIndex = this.options.indexOf(captured); + return true; + } + } + /** + * Ensures that the provided option is focused and scrolled into view. + * + * @param optionToFocus - The option to focus + * @internal + */ + focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) { + if (this.contains(document.activeElement) && optionToFocus !== null) { + optionToFocus.focus(); + requestAnimationFrame(() => { + optionToFocus.scrollIntoView({ block: "nearest" }); + }); + } + } + /** + * Handles `focusin` actions for the component. When the component receives focus, + * the list of selected options is refreshed and the first selected option is scrolled + * into view. + * + * @internal + */ + focusinHandler(e) { + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Returns the options which match the current typeahead buffer. + * + * @internal + */ + getTypeaheadMatches() { + const pattern = this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp(`^${pattern}`, "gi"); + return this.options.filter((o) => o.text.trim().match(re)); + } + /** + * Determines the index of the next option which is selectable, if any. + * + * @param prev - the previous selected index + * @param next - the next index to select + * + * @internal + */ + getSelectableIndex(prev = this.selectedIndex, next) { + const direction = prev > next ? -1 : prev < next ? 1 : 0; + const potentialDirection = prev + direction; + let nextSelectableOption = null; + switch (direction) { + case -1: { + nextSelectableOption = this.options.reduceRight((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + case 1: { + nextSelectableOption = this.options.reduce((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + } + return this.options.indexOf(nextSelectableOption); + } + /** + * Handles external changes to child options. + * + * @param source - the source object + * @param propertyName - the property + * + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "selected": { + if (_Listbox.slottedOptionFilter(source)) { + this.selectedIndex = this.options.indexOf(source); + } + this.setSelectedOptions(); + break; + } + } + } + /** + * Moves focus to an option whose label matches characters typed by the user. + * Consecutive keystrokes are batched into a buffer of search text used + * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes + * between consecutive keystrokes, the search restarts. + * + * @param key - the key to be evaluated + * + * @internal + */ + handleTypeAhead(key) { + if (this.typeaheadTimeout) { + window.clearTimeout(this.typeaheadTimeout); + } + this.typeaheadTimeout = window.setTimeout(() => this.typeaheadExpired = true, _Listbox.TYPE_AHEAD_TIMEOUT_MS); + if (key.length > 1) { + return; + } + this.typeaheadBuffer = `${this.typeaheadExpired ? "" : this.typeaheadBuffer}${key}`; + } + /** + * Handles `keydown` actions for listbox navigation and typeahead. + * + * @internal + */ + keydownHandler(e) { + if (this.disabled) { + return true; + } + this.shouldSkipFocus = false; + const key = e.key; + switch (key) { + // Select the first available option + case keyHome: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectFirstOption(); + } + break; + } + // Select the next selectable option + case keyArrowDown: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectNextOption(); + } + break; + } + // Select the previous selectable option + case keyArrowUp: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectPreviousOption(); + } + break; + } + // Select the last available option + case keyEnd: { + e.preventDefault(); + this.selectLastOption(); + break; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEnter: + case keyEscape: { + return true; + } + case keySpace: { + if (this.typeaheadExpired) { + return true; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @internal + */ + mousedownHandler(e) { + this.shouldSkipFocus = !this.contains(document.activeElement); + return true; + } + /** + * Switches between single-selection and multi-selection mode. + * + * @param prev - the previous value of the `multiple` attribute + * @param next - the next value of the `multiple` attribute + * + * @internal + */ + multipleChanged(prev, next) { + this.ariaMultiSelectable = next ? "true" : null; + } + /** + * Updates the list of selected options when the `selectedIndex` changes. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + var _a; + if (!this.hasSelectableOptions) { + this.selectedIndex = -1; + return; + } + if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") { + const selectableIndex = this.getSelectableIndex(prev, next); + const newNext = selectableIndex > -1 ? selectableIndex : prev; + this.selectedIndex = newNext; + if (next === newNext) { + this.selectedIndexChanged(next, newNext); + } + return; + } + this.setSelectedOptions(); + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + const filteredNext = next.filter(_Listbox.slottedOptionFilter); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "selected"); + o.selected = filteredNext.includes(o); + notifier.subscribe(this, "selected"); + }); + } + /** + * Moves focus to the first selectable option. + * + * @public + */ + selectFirstOption() { + var _a, _b; + if (!this.disabled) { + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((o) => !o.disabled)) !== null && _b !== void 0 ? _b : -1; + } + } + /** + * Moves focus to the last selectable option. + * + * @internal + */ + selectLastOption() { + if (!this.disabled) { + this.selectedIndex = findLastIndex(this.options, (o) => !o.disabled); + } + } + /** + * Moves focus to the next selectable option. + * + * @internal + */ + selectNextOption() { + if (!this.disabled && this.selectedIndex < this.options.length - 1) { + this.selectedIndex += 1; + } + } + /** + * Moves focus to the previous selectable option. + * + * @internal + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex > 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Updates the selected index to match the first selected option. + * + * @internal + */ + setDefaultSelectedOption() { + var _a, _b; + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((el2) => el2.defaultSelected)) !== null && _b !== void 0 ? _b : -1; + } + /** + * Sets an option as selected and gives it focus. + * + * @public + */ + setSelectedOptions() { + var _a, _b, _c; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) { + this.selectedOptions = [this.options[this.selectedIndex]]; + this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""; + this.focusAndScrollOptionIntoView(); + } + } + /** + * Updates the list of options and resets the selected option when the slotted option content changes. + * + * @param prev - the previous list of slotted options + * @param next - the current list of slotted options + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options = next.reduce((options, item) => { + if (isListboxOption(item)) { + options.push(item); + } + return options; + }, []); + const setSize = `${this.options.length}`; + this.options.forEach((option, index) => { + if (!option.id) { + option.id = uniqueId("option-"); + } + option.ariaPosInSet = `${index + 1}`; + option.ariaSetSize = setSize; + }); + if (this.$fastController.isConnected) { + this.setSelectedOptions(); + this.setDefaultSelectedOption(); + } + } + /** + * Updates the filtered list of options when the typeahead buffer changes. + * + * @param prev - the previous typeahead buffer value + * @param next - the current typeahead buffer value + * + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + if (typeaheadMatches.length) { + const selectedIndex = this.options.indexOf(typeaheadMatches[0]); + if (selectedIndex > -1) { + this.selectedIndex = selectedIndex; + } + } + this.typeaheadExpired = false; + } + } + }; + Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; + Listbox.TYPE_AHEAD_TIMEOUT_MS = 1e3; + __decorate([ + attr({ mode: "boolean" }) + ], Listbox.prototype, "disabled", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedIndex", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "slottedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "typeaheadBuffer", void 0); + DelegatesARIAListbox = class { + }; + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaDisabled", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaExpanded", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0); + applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties); + applyMixins(Listbox, DelegatesARIAListbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js + var SelectPosition; + var init_select_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js"() { + SelectPosition = { + above: "above", + below: "below" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js + var _Combobox, FormAssociatedCombobox; + var init_combobox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js"() { + init_form_associated(); + init_listbox(); + _Combobox = class extends Listbox { + }; + FormAssociatedCombobox = class extends FormAssociated(_Combobox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js + var ComboboxAutocomplete; + var init_combobox_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js"() { + ComboboxAutocomplete = { + inline: "inline", + list: "list", + both: "both", + none: "none" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js + var Combobox, DelegatesARIACombobox; + var init_combobox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_select_options(); + init_apply_mixins(); + init_combobox_form_associated(); + init_combobox_options(); + Combobox = class extends FormAssociatedCombobox { + constructor() { + super(...arguments); + this._value = ""; + this.filteredOptions = []; + this.filter = ""; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + this.open = false; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + super.formResetCallback(); + this.setDefaultSelectedOption(); + this.updateValue(); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + get isAutocompleteInline() { + return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth; + } + get isAutocompleteList() { + return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth; + } + get isAutocompleteBoth() { + return this.autocomplete === ComboboxAutocomplete.both; + } + /** + * Sets focus and synchronize ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged() { + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The list of options. + * + * @public + * @remarks + * Overrides `Listbox.options`. + */ + get options() { + Observable.track(this, "options"); + return this.filteredOptions.length ? this.filteredOptions : this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Updates the placeholder on the proxy element. + * @internal + */ + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c; + const prev = `${this._value}`; + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.text.toLowerCase() === next.toLowerCase()); + const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text; + const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text; + this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex; + next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + } + } + /** + * Handle opening and closing the listbox when the combobox is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (this.disabled || (captured === null || captured === void 0 ? void 0 : captured.disabled)) { + return; + } + if (this.open) { + if (e.composedPath()[0] === this.control) { + return; + } + if (captured) { + this.selectedOptions = [captured]; + this.control.value = captured.text; + this.clearSelectionRange(); + this.updateValue(true); + } + } + this.open = !this.open; + if (this.open) { + this.control.focus(); + } + return true; + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + if (this.value) { + this.initialValue = this.value; + } + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Filter available options by text value. + * + * @public + */ + filterOptions() { + if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) { + this.filter = ""; + } + const filter = this.filter.toLowerCase(); + this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase())); + if (this.isAutocompleteList) { + if (!this.filteredOptions.length && !filter) { + this.filteredOptions = this._options; + } + this._options.forEach((o) => { + o.hidden = !this.filteredOptions.includes(o); + }); + } + } + /** + * Focus the control and scroll the first selected option into view. + * + * @internal + * @remarks + * Overrides: `Listbox.focusAndScrollOptionIntoView` + */ + focusAndScrollOptionIntoView() { + if (this.contains(document.activeElement)) { + this.control.focus(); + if (this.firstSelectedOption) { + requestAnimationFrame(() => { + var _a; + (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest" }); + }); + } + } + } + /** + * Handle focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + this.syncValue(); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!this.options || !this.options.includes(focusTarget)) { + this.open = false; + } + } + /** + * Handle content changes on the control input. + * + * @param e - the input event + * @internal + */ + inputHandler(e) { + this.filter = this.control.value; + this.filterOptions(); + if (!this.isAutocompleteInline) { + this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value); + } + if (e.inputType.includes("deleteContent") || !this.filter.length) { + return true; + } + if (this.isAutocompleteList && !this.open) { + this.open = true; + } + if (this.isAutocompleteInline) { + if (this.filteredOptions.length) { + this.selectedOptions = [this.filteredOptions[0]]; + this.selectedIndex = this.options.indexOf(this.firstSelectedOption); + this.setInlineSelection(); + } else { + this.selectedIndex = -1; + } + } + return; + } + /** + * Handle keydown actions for listbox navigation. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (e.ctrlKey || e.shiftKey) { + return true; + } + switch (key) { + case "Enter": { + this.syncValue(); + if (this.isAutocompleteInline) { + this.filter = this.value; + } + this.open = false; + this.clearSelectionRange(); + break; + } + case "Escape": { + if (!this.isAutocompleteInline) { + this.selectedIndex = -1; + } + if (this.open) { + this.open = false; + break; + } + this.value = ""; + this.control.value = ""; + this.filter = ""; + this.filterOptions(); + break; + } + case "Tab": { + this.setInputToSelection(); + if (!this.open) { + return true; + } + e.preventDefault(); + this.open = false; + break; + } + case "ArrowUp": + case "ArrowDown": { + this.filterOptions(); + if (!this.open) { + this.open = true; + break; + } + if (this.filteredOptions.length > 0) { + super.keydownHandler(e); + } + if (this.isAutocompleteInline) { + this.setInlineSelection(); + } + break; + } + default: { + return true; + } + } + } + /** + * Handle keyup actions for value input and text field manipulations. + * + * @param e - the keyboard event + * @internal + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + case "ArrowRight": + case "Backspace": + case "Delete": + case "Home": + case "End": { + this.filter = this.control.value; + this.selectedIndex = -1; + this.filterOptions(); + break; + } + } + } + /** + * Ensure that the selectedIndex is within the current allowable filtered range. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + if (this.$fastController.isConnected) { + next = limit(-1, this.options.length - 1, next); + if (next !== this.selectedIndex) { + this.selectedIndex = next; + return; + } + super.selectedIndexChanged(prev, next); + } + } + /** + * Move focus to the previous selectable option. + * + * @internal + * @remarks + * Overrides `Listbox.selectPreviousOption` + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex >= 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Set the default selected options at initialization or reset. + * + * @internal + * @remarks + * Overrides `Listbox.setDefaultSelectedOption` + */ + setDefaultSelectedOption() { + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.getAttribute("selected") !== null || el2.selected); + this.selectedIndex = selectedIndex; + if (!this.dirtyValue && this.firstSelectedOption) { + this.value = this.firstSelectedOption.text; + } + this.setSelectedOptions(); + } + } + /** + * Focus and set the content of the control based on the first selected option. + * + * @internal + */ + setInputToSelection() { + if (this.firstSelectedOption) { + this.control.value = this.firstSelectedOption.text; + this.control.focus(); + } + } + /** + * Focus, set and select the content of the control based on the first selected option. + * + * @internal + */ + setInlineSelection() { + if (this.firstSelectedOption) { + this.setInputToSelection(); + this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward"); + } + } + /** + * Determines if a value update should involve emitting a change event, then updates the value. + * + * @internal + */ + syncValue() { + var _a; + const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value; + this.updateValue(this.value !== newValue); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @param force - direction to force the listbox to display + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * Ensure that the entire list of options is used when setting the selected property. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + * @remarks + * Overrides: `Listbox.selectedOptionsChanged` + */ + selectedOptionsChanged(prev, next) { + if (this.$fastController.isConnected) { + this._options.forEach((o) => { + o.selected = next.includes(o); + }); + } + } + /** + * Synchronize the form-associated proxy and update the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + super.slottedOptionsChanged(prev, next); + this.updateValue(); + } + /** + * Sets the value and to match the first selected option. + * + * @param shouldEmit - if true, the change event will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a; + if (this.$fastController.isConnected) { + this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value; + this.control.value = this.value; + } + if (shouldEmit) { + this.$emit("change"); + } + } + /** + * @internal + */ + clearSelectionRange() { + const controlValueLength = this.control.value.length; + this.control.setSelectionRange(controlValueLength, controlValueLength); + } + }; + __decorate([ + attr({ attribute: "autocomplete", mode: "fromView" }) + ], Combobox.prototype, "autocomplete", void 0); + __decorate([ + observable + ], Combobox.prototype, "maxHeight", void 0); + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Combobox.prototype, "open", void 0); + __decorate([ + attr + ], Combobox.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Combobox.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Combobox.prototype, "position", void 0); + DelegatesARIACombobox = class { + }; + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0); + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIACombobox, DelegatesARIAListbox); + applyMixins(Combobox, StartEnd, DelegatesARIACombobox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js + var init_combobox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js + var init_combobox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js"() { + init_combobox(); + init_combobox_options(); + init_combobox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js + function composedParent(element) { + const parentNode = element.parentElement; + if (parentNode) { + return parentNode; + } else { + const rootNode = element.getRootNode(); + if (rootNode.host instanceof HTMLElement) { + return rootNode.host; + } + } + return null; + } + var init_composed_parent = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js + function composedContains(reference, test) { + let current = test; + while (current !== null) { + if (current === reference) { + return true; + } + current = composedParent(current); + } + return false; + } + var init_composed_contains = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js"() { + init_composed_parent(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js + function isFastElement(element) { + return element instanceof FASTElement; + } + var defaultElement, QueuedStyleSheetTarget, ConstructableStyleSheetTarget, DocumentStyleSheetTarget, HeadStyleElementStyleSheetTarget, StyleElementStyleSheetTarget, ElementStyleSheetTarget, RootStyleSheetTarget, propertyTargetCache, propertyTargetCtor, PropertyTargetManager; + var init_custom_property_manager = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js"() { + init_tslib_es6(); + init_esm(); + defaultElement = document.createElement("div"); + QueuedStyleSheetTarget = class { + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + ConstructableStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor(source) { + super(); + const sheet = new CSSStyleSheet(); + sheet[prependToAdoptedStyleSheetsSymbol] = true; + this.target = sheet.cssRules[sheet.insertRule(":host{}")].style; + source.$fastController.addStyles(ElementStyles.create([sheet])); + } + }; + DocumentStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + const sheet = new CSSStyleSheet(); + this.target = sheet.cssRules[sheet.insertRule(":root{}")].style; + document.adoptedStyleSheets = [ + ...document.adoptedStyleSheets, + sheet + ]; + } + }; + HeadStyleElementStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + this.style = document.createElement("style"); + document.head.appendChild(this.style); + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":root{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } + } + }; + StyleElementStyleSheetTarget = class { + constructor(target) { + this.store = /* @__PURE__ */ new Map(); + this.target = null; + const controller = target.$fastController; + this.style = document.createElement("style"); + controller.addStyles(this.style); + Observable.getNotifier(controller).subscribe(this, "isConnected"); + this.handleChange(controller, "isConnected"); + } + targetChanged() { + if (this.target !== null) { + for (const [key, value] of this.store.entries()) { + this.target.setProperty(key, value); + } + } + } + setProperty(name, value) { + this.store.set(name, value); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.setProperty(name, value); + } + }); + } + removeProperty(name) { + this.store.delete(name); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.removeProperty(name); + } + }); + } + handleChange(source, key) { + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":host{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } else { + this.target = null; + } + } + }; + __decorate([ + observable + ], StyleElementStyleSheetTarget.prototype, "target", void 0); + ElementStyleSheetTarget = class { + constructor(source) { + this.target = source.style; + } + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + RootStyleSheetTarget = class _RootStyleSheetTarget { + setProperty(name, value) { + _RootStyleSheetTarget.properties[name] = value; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); + } + } + removeProperty(name) { + delete _RootStyleSheetTarget.properties[name]; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); + } + } + static registerRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (!roots.has(root)) { + roots.add(root); + const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.setProperty(key, _RootStyleSheetTarget.properties[key]); + } + } + } + static unregisterRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (roots.has(root)) { + roots.delete(root); + const target = PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.removeProperty(key); + } + } + } + /** + * Returns the document when provided the default element, + * otherwise is a no-op + * @param root - the root to normalize + */ + static normalizeRoot(root) { + return root === defaultElement ? document : root; + } + }; + RootStyleSheetTarget.roots = /* @__PURE__ */ new Set(); + RootStyleSheetTarget.properties = {}; + propertyTargetCache = /* @__PURE__ */ new WeakMap(); + propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; + PropertyTargetManager = Object.freeze({ + getOrCreate(source) { + if (propertyTargetCache.has(source)) { + return propertyTargetCache.get(source); + } + let target; + if (source === defaultElement) { + target = new RootStyleSheetTarget(); + } else if (source instanceof Document) { + target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); + } else if (isFastElement(source)) { + target = new propertyTargetCtor(source); + } else { + target = new ElementStyleSheetTarget(source); + } + propertyTargetCache.set(source, target); + return target; + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js + function create(nameOrConfig) { + return DesignTokenImpl.from(nameOrConfig); + } + var DesignTokenImpl, CustomPropertyReflector, DesignTokenBindingObserver, Store, nodeCache, childToParent, DesignTokenNode, DesignToken; + var init_design_token = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js"() { + init_tslib_es6(); + init_esm(); + init_composed_parent(); + init_composed_contains(); + init_custom_property_manager(); + init_custom_property_manager(); + DesignTokenImpl = class _DesignTokenImpl extends CSSDirective { + constructor(configuration) { + super(); + this.subscribers = /* @__PURE__ */ new WeakMap(); + this._appliedTo = /* @__PURE__ */ new Set(); + this.name = configuration.name; + if (configuration.cssCustomPropertyName !== null) { + this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`; + this.cssVar = `var(${this.cssCustomProperty})`; + } + this.id = _DesignTokenImpl.uniqueId(); + _DesignTokenImpl.tokensById.set(this.id, this); + } + get appliedTo() { + return [...this._appliedTo]; + } + static from(nameOrConfig) { + return new _DesignTokenImpl({ + name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, + cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName + }); + } + static isCSSDesignToken(token) { + return typeof token.cssCustomProperty === "string"; + } + static isDerivedDesignTokenValue(value) { + return typeof value === "function"; + } + /** + * Gets a token by ID. Returns undefined if the token was not found. + * @param id - The ID of the token + * @returns + */ + static getTokenById(id) { + return _DesignTokenImpl.tokensById.get(id); + } + getOrCreateSubscriberSet(target = this) { + return this.subscribers.get(target) || this.subscribers.set(target, /* @__PURE__ */ new Set()) && this.subscribers.get(target); + } + createCSS() { + return this.cssVar || ""; + } + getValueFor(element) { + const value = DesignTokenNode.getOrCreate(element).get(this); + if (value !== void 0) { + return value; + } + throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${element} or an ancestor of ${element}.`); + } + setValueFor(element, value) { + this._appliedTo.add(element); + if (value instanceof _DesignTokenImpl) { + value = this.alias(value); + } + DesignTokenNode.getOrCreate(element).set(this, value); + return this; + } + deleteValueFor(element) { + this._appliedTo.delete(element); + if (DesignTokenNode.existsFor(element)) { + DesignTokenNode.getOrCreate(element).delete(this); + } + return this; + } + withDefault(value) { + this.setValueFor(defaultElement, value); + return this; + } + subscribe(subscriber, target) { + const subscriberSet = this.getOrCreateSubscriberSet(target); + if (target && !DesignTokenNode.existsFor(target)) { + DesignTokenNode.getOrCreate(target); + } + if (!subscriberSet.has(subscriber)) { + subscriberSet.add(subscriber); + } + } + unsubscribe(subscriber, target) { + const list = this.subscribers.get(target || this); + if (list && list.has(subscriber)) { + list.delete(subscriber); + } + } + /** + * Notifies subscribers that the value for an element has changed. + * @param element - The element to emit a notification for + */ + notify(element) { + const record = Object.freeze({ token: this, target: element }); + if (this.subscribers.has(this)) { + this.subscribers.get(this).forEach((sub) => sub.handleChange(record)); + } + if (this.subscribers.has(element)) { + this.subscribers.get(element).forEach((sub) => sub.handleChange(record)); + } + } + /** + * Alias the token to the provided token. + * @param token - the token to alias to + */ + alias(token) { + return ((target) => token.getValueFor(target)); + } + }; + DesignTokenImpl.uniqueId = /* @__PURE__ */ (() => { + let id = 0; + return () => { + id++; + return id.toString(16); + }; + })(); + DesignTokenImpl.tokensById = /* @__PURE__ */ new Map(); + CustomPropertyReflector = class { + startReflection(token, target) { + token.subscribe(this, target); + this.handleChange({ token, target }); + } + stopReflection(token, target) { + token.unsubscribe(this, target); + this.remove(token, target); + } + handleChange(record) { + const { token, target } = record; + this.add(token, target); + } + add(token, target) { + PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); + } + remove(token, target) { + PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); + } + resolveCSSValue(value) { + return value && typeof value.createCSS === "function" ? value.createCSS() : value; + } + }; + DesignTokenBindingObserver = class { + constructor(source, token, node) { + this.source = source; + this.token = token; + this.node = node; + this.dependencies = /* @__PURE__ */ new Set(); + this.observer = Observable.binding(source, this, false); + this.observer.handleChange = this.observer.call; + this.handleChange(); + } + disconnect() { + this.observer.disconnect(); + } + /** + * @internal + */ + handleChange() { + try { + this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); + } catch (e) { + console.error(e); + } + } + }; + Store = class { + constructor() { + this.values = /* @__PURE__ */ new Map(); + } + set(token, value) { + if (this.values.get(token) !== value) { + this.values.set(token, value); + Observable.getNotifier(this).notify(token.id); + } + } + get(token) { + Observable.track(this, token.id); + return this.values.get(token); + } + delete(token) { + this.values.delete(token); + Observable.getNotifier(this).notify(token.id); + } + all() { + return this.values.entries(); + } + }; + nodeCache = /* @__PURE__ */ new WeakMap(); + childToParent = /* @__PURE__ */ new WeakMap(); + DesignTokenNode = class _DesignTokenNode { + constructor(target) { + this.target = target; + this.store = new Store(); + this.children = []; + this.assignedValues = /* @__PURE__ */ new Map(); + this.reflecting = /* @__PURE__ */ new Set(); + this.bindingObservers = /* @__PURE__ */ new Map(); + this.tokenValueChangeHandler = { + handleChange: (source, arg) => { + const token = DesignTokenImpl.getTokenById(arg); + if (token) { + token.notify(this.target); + this.updateCSSTokenReflection(source, token); + } + } + }; + nodeCache.set(target, this); + Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); + if (target instanceof FASTElement) { + target.$fastController.addBehaviors([this]); + } else if (target.isConnected) { + this.bind(); + } + } + /** + * Returns a DesignTokenNode for an element. + * Creates a new instance if one does not already exist for a node, + * otherwise returns the cached instance + * + * @param target - The HTML element to retrieve a DesignTokenNode for + */ + static getOrCreate(target) { + return nodeCache.get(target) || new _DesignTokenNode(target); + } + /** + * Determines if a DesignTokenNode has been created for a target + * @param target - The element to test + */ + static existsFor(target) { + return nodeCache.has(target); + } + /** + * Searches for and return the nearest parent DesignTokenNode. + * Null is returned if no node is found or the node provided is for a default element. + */ + static findParent(node) { + if (!(defaultElement === node.target)) { + let parent = composedParent(node.target); + while (parent !== null) { + if (nodeCache.has(parent)) { + return nodeCache.get(parent); + } + parent = composedParent(parent); + } + return _DesignTokenNode.getOrCreate(defaultElement); + } + return null; + } + /** + * Finds the closest node with a value explicitly assigned for a token, otherwise null. + * @param token - The token to look for + * @param start - The node to start looking for value assignment + * @returns + */ + static findClosestAssignedNode(token, start) { + let current = start; + do { + if (current.has(token)) { + return current; + } + current = current.parent ? current.parent : current.target !== defaultElement ? _DesignTokenNode.getOrCreate(defaultElement) : null; + } while (current !== null); + return null; + } + /** + * The parent DesignTokenNode, or null. + */ + get parent() { + return childToParent.get(this) || null; + } + updateCSSTokenReflection(source, token) { + if (DesignTokenImpl.isCSSDesignToken(token)) { + const parent = this.parent; + const reflecting = this.isReflecting(token); + if (parent) { + const parentValue = parent.get(token); + const sourceValue = source.get(token); + if (parentValue !== sourceValue && !reflecting) { + this.reflectToCSS(token); + } else if (parentValue === sourceValue && reflecting) { + this.stopReflectToCSS(token); + } + } else if (!reflecting) { + this.reflectToCSS(token); + } + } + } + /** + * Checks if a token has been assigned an explicit value the node. + * @param token - the token to check. + */ + has(token) { + return this.assignedValues.has(token); + } + /** + * Gets the value of a token for a node + * @param token - The token to retrieve the value for + * @returns + */ + get(token) { + const value = this.store.get(token); + if (value !== void 0) { + return value; + } + const raw = this.getRaw(token); + if (raw !== void 0) { + this.hydrate(token, raw); + return this.get(token); + } + } + /** + * Retrieves the raw assigned value of a token from the nearest assigned node. + * @param token - The token to retrieve a raw value for + * @returns + */ + getRaw(token) { + var _a; + if (this.assignedValues.has(token)) { + return this.assignedValues.get(token); + } + return (_a = _DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); + } + /** + * Sets a token to a value for a node + * @param token - The token to set + * @param value - The value to set the token to + */ + set(token, value) { + if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { + this.tearDownBindingObserver(token); + } + this.assignedValues.set(token, value); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + this.setupBindingObserver(token, value); + } else { + this.store.set(token, value); + } + } + /** + * Deletes a token value for the node. + * @param token - The token to delete the value for + */ + delete(token) { + this.assignedValues.delete(token); + this.tearDownBindingObserver(token); + const upstream = this.getRaw(token); + if (upstream) { + this.hydrate(token, upstream); + } else { + this.store.delete(token); + } + } + /** + * Invoked when the DesignTokenNode.target is attached to the document + */ + bind() { + const parent = _DesignTokenNode.findParent(this); + if (parent) { + parent.appendChild(this); + } + for (const key of this.assignedValues.keys()) { + key.notify(this.target); + } + } + /** + * Invoked when the DesignTokenNode.target is detached from the document + */ + unbind() { + if (this.parent) { + const parent = childToParent.get(this); + parent.removeChild(this); + } + for (const token of this.bindingObservers.keys()) { + this.tearDownBindingObserver(token); + } + } + /** + * Appends a child to a parent DesignTokenNode. + * @param child - The child to append to the node + */ + appendChild(child) { + if (child.parent) { + childToParent.get(child).removeChild(child); + } + const reParent = this.children.filter((x) => child.contains(x)); + childToParent.set(child, this); + this.children.push(child); + reParent.forEach((x) => child.appendChild(x)); + Observable.getNotifier(this.store).subscribe(child); + for (const [token, value] of this.store.all()) { + child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); + child.updateCSSTokenReflection(child.store, token); + } + } + /** + * Removes a child from a node. + * @param child - The child to remove. + */ + removeChild(child) { + const childIndex = this.children.indexOf(child); + if (childIndex !== -1) { + this.children.splice(childIndex, 1); + } + Observable.getNotifier(this.store).unsubscribe(child); + if (child.parent !== this) { + return false; + } + const deleted = childToParent.delete(child); + for (const [token] of this.store.all()) { + child.hydrate(token, child.getRaw(token)); + child.updateCSSTokenReflection(child.store, token); + } + return deleted; + } + /** + * Tests whether a provided node is contained by + * the calling node. + * @param test - The node to test + */ + contains(test) { + return composedContains(this.target, test.target); + } + /** + * Instructs the node to reflect a design token for the provided token. + * @param token - The design token to reflect + */ + reflectToCSS(token) { + if (!this.isReflecting(token)) { + this.reflecting.add(token); + _DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); + } + } + /** + * Stops reflecting a DesignToken to CSS + * @param token - The design token to stop reflecting + */ + stopReflectToCSS(token) { + if (this.isReflecting(token)) { + this.reflecting.delete(token); + _DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); + } + } + /** + * Determines if a token is being reflected to CSS for a node. + * @param token - The token to check for reflection + * @returns + */ + isReflecting(token) { + return this.reflecting.has(token); + } + /** + * Handle changes to upstream tokens + * @param source - The parent DesignTokenNode + * @param property - The token ID that changed + */ + handleChange(source, property) { + const token = DesignTokenImpl.getTokenById(property); + if (!token) { + return; + } + this.hydrate(token, this.getRaw(token)); + this.updateCSSTokenReflection(this.store, token); + } + /** + * Hydrates a token with a DesignTokenValue, making retrieval available. + * @param token - The token to hydrate + * @param value - The value to hydrate + */ + hydrate(token, value) { + if (!this.has(token)) { + const observer = this.bindingObservers.get(token); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + if (observer) { + if (observer.source !== value) { + this.tearDownBindingObserver(token); + this.setupBindingObserver(token, value); + } + } else { + this.setupBindingObserver(token, value); + } + } else { + if (observer) { + this.tearDownBindingObserver(token); + } + this.store.set(token, value); + } + } + } + /** + * Sets up a binding observer for a derived token value that notifies token + * subscribers on change. + * + * @param token - The token to notify when the binding updates + * @param source - The binding source + */ + setupBindingObserver(token, source) { + const binding = new DesignTokenBindingObserver(source, token, this); + this.bindingObservers.set(token, binding); + return binding; + } + /** + * Tear down a binding observer for a token. + */ + tearDownBindingObserver(token) { + if (this.bindingObservers.has(token)) { + this.bindingObservers.get(token).disconnect(); + this.bindingObservers.delete(token); + return true; + } + return false; + } + }; + DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); + __decorate([ + observable + ], DesignTokenNode.prototype, "children", void 0); + DesignToken = Object.freeze({ + create, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been connected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * 3. The HTMLElement is not connected to the document when token values are set. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyConnection(element) { + if (!element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).bind(); + return true; + }, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been disconnected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyDisconnection(element) { + if (element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).unbind(); + return true; + }, + /** + * Registers and element or document as a DesignToken root. + * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via + * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all + * registered roots. + * @param target - The root to register + */ + registerRoot(target = defaultElement) { + RootStyleSheetTarget.registerRoot(target); + }, + /** + * Unregister an element or document as a DesignToken root. + * @param target - The root to deregister + */ + unregisterRoot(target = defaultElement) { + RootStyleSheetTarget.unregisterRoot(target); + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js + function extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) { + if (typeof params === "string") { + return { + name: params, + type: elementDefinitionType, + callback: elementDefinitionCallback + }; + } else { + return params; + } + } + var ElementDisambiguation, elementTypesByTag, elementTagsByType, rootDesignSystem, designSystemKey, DesignSystem, DefaultDesignSystem, ElementDefinitionEntry; + var init_design_system = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"() { + init_esm(); + init_foundation_element(); + init_di(); + init_design_token(); + init_component_presentation(); + ElementDisambiguation = Object.freeze({ + /** + * Skip defining the element but still call the provided callback passed + * to DesignSystemRegistrationContext.tryDefineElement + */ + definitionCallbackOnly: null, + /** + * Ignore the duplicate element entirely. + */ + ignoreDuplicate: /* @__PURE__ */ Symbol() + }); + elementTypesByTag = /* @__PURE__ */ new Map(); + elementTagsByType = /* @__PURE__ */ new Map(); + rootDesignSystem = null; + designSystemKey = DI.createInterface((x) => x.cachedCallback((handler) => { + if (rootDesignSystem === null) { + rootDesignSystem = new DefaultDesignSystem(null, handler); + } + return rootDesignSystem; + })); + DesignSystem = Object.freeze({ + /** + * Returns the HTML element name that the type is defined as. + * @param type - The type to lookup. + * @public + */ + tagFor(type) { + return elementTagsByType.get(type); + }, + /** + * Searches the DOM hierarchy for the design system that is responsible + * for the provided element. + * @param element - The element to locate the design system for. + * @returns The located design system. + * @public + */ + responsibleFor(element) { + const owned = element.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.findResponsibleContainer(element); + return container.get(designSystemKey); + }, + /** + * Gets the DesignSystem if one is explicitly defined on the provided element; + * otherwise creates a design system defined directly on the element. + * @param element - The element to get or create a design system for. + * @returns The design system. + * @public + */ + getOrCreate(node) { + if (!node) { + if (rootDesignSystem === null) { + rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey); + } + return rootDesignSystem; + } + const owned = node.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.getOrCreateDOMContainer(node); + if (container.has(designSystemKey, false)) { + return container.get(designSystemKey); + } else { + const system = new DefaultDesignSystem(node, container); + container.register(Registration.instance(designSystemKey, system)); + return system; + } + } + }); + DefaultDesignSystem = class { + constructor(owner, container) { + this.owner = owner; + this.container = container; + this.designTokensInitialized = false; + this.prefix = "fast"; + this.shadowRootMode = void 0; + this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly; + if (owner !== null) { + owner.$$designSystem$$ = this; + } + } + withPrefix(prefix) { + this.prefix = prefix; + return this; + } + withShadowRootMode(mode) { + this.shadowRootMode = mode; + return this; + } + withElementDisambiguation(callback) { + this.disambiguate = callback; + return this; + } + withDesignTokenRoot(root) { + this.designTokenRoot = root; + return this; + } + register(...registrations) { + const container = this.container; + const elementDefinitionEntries = []; + const disambiguate = this.disambiguate; + const shadowRootMode = this.shadowRootMode; + const context = { + elementPrefix: this.prefix, + tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) { + const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback); + const { name, callback, baseClass } = extractedParams; + let { type } = extractedParams; + let elementName = name; + let typeFoundByName = elementTypesByTag.get(elementName); + let needsDefine = true; + while (typeFoundByName) { + const result = disambiguate(elementName, type, typeFoundByName); + switch (result) { + case ElementDisambiguation.ignoreDuplicate: + return; + case ElementDisambiguation.definitionCallbackOnly: + needsDefine = false; + typeFoundByName = void 0; + break; + default: + elementName = result; + typeFoundByName = elementTypesByTag.get(elementName); + break; + } + } + if (needsDefine) { + if (elementTagsByType.has(type) || type === FoundationElement) { + type = class extends type { + }; + } + elementTypesByTag.set(elementName, type); + elementTagsByType.set(type, elementName); + if (baseClass) { + elementTagsByType.set(baseClass, elementName); + } + } + elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine)); + } + }; + if (!this.designTokensInitialized) { + this.designTokensInitialized = true; + if (this.designTokenRoot !== null) { + DesignToken.registerRoot(this.designTokenRoot); + } + } + container.registerWithContext(context, ...registrations); + for (const entry of elementDefinitionEntries) { + entry.callback(entry); + if (entry.willDefine && entry.definition !== null) { + entry.definition.define(); + } + } + return this; + } + }; + ElementDefinitionEntry = class { + constructor(container, name, type, shadowRootMode, callback, willDefine) { + this.container = container; + this.name = name; + this.type = type; + this.shadowRootMode = shadowRootMode; + this.callback = callback; + this.willDefine = willDefine; + this.definition = null; + } + definePresentation(presentation) { + ComponentPresentation.define(this.name, presentation, this.container); + } + defineElement(definition) { + this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name })); + } + tagFor(type) { + return DesignSystem.tagFor(type); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js + var init_registration_context = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js + var init_design_system2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js"() { + init_design_system(); + init_component_presentation(); + init_registration_context(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/index.js + var init_di2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/index.js"() { + init_di(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js + var init_dialog_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js"() { + } + }); + + // node_modules/tabbable/dist/index.esm.js + var candidateSelectors, candidateSelector, NoElement, matches, getRootNode, getTabindex, isInput, isHiddenInput, isDetailsWithSummary, getCheckedRadio, isTabbableRadio, isRadio, isNonTabbableRadio, isZeroArea, isHidden, isDisabledFromFieldset, isNodeMatchingSelectorFocusable, isNodeMatchingSelectorTabbable, isTabbable, focusableCandidateSelector, isFocusable; + var init_index_esm = __esm({ + "node_modules/tabbable/dist/index.esm.js"() { + candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + NoElement = typeof Element === "undefined"; + matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; + }; + getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } + }; + isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot2 = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot2 === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot2(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js + var Dialog; + var init_dialog = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + Dialog = class _Dialog extends FoundationElement { + constructor() { + super(...arguments); + this.modal = true; + this.hidden = false; + this.trapFocus = true; + this.trapFocusChanged = () => { + if (this.$fastController.isConnected) { + this.updateTrapFocus(); + } + }; + this.isTrappingFocus = false; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && !this.hidden) { + switch (e.key) { + case keyEscape: + this.dismiss(); + e.preventDefault(); + break; + case keyTab: + this.handleTabKeyDown(e); + break; + } + } + }; + this.handleDocumentFocus = (e) => { + if (!e.defaultPrevented && this.shouldForceFocus(e.target)) { + this.focusFirstElement(); + e.preventDefault(); + } + }; + this.handleTabKeyDown = (e) => { + if (!this.trapFocus || this.hidden) { + return; + } + const bounds = this.getTabQueueBounds(); + if (bounds.length === 0) { + return; + } + if (bounds.length === 1) { + bounds[0].focus(); + e.preventDefault(); + return; + } + if (e.shiftKey && e.target === bounds[0]) { + bounds[bounds.length - 1].focus(); + e.preventDefault(); + } else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) { + bounds[0].focus(); + e.preventDefault(); + } + return; + }; + this.getTabQueueBounds = () => { + const bounds = []; + return _Dialog.reduceTabbableItems(bounds, this); + }; + this.focusFirstElement = () => { + const bounds = this.getTabQueueBounds(); + if (bounds.length > 0) { + bounds[0].focus(); + } else { + if (this.dialog instanceof HTMLElement) { + this.dialog.focus(); + } + } + }; + this.shouldForceFocus = (currentFocusElement) => { + return this.isTrappingFocus && !this.contains(currentFocusElement); + }; + this.shouldTrapFocus = () => { + return this.trapFocus && !this.hidden; + }; + this.updateTrapFocus = (shouldTrapFocusOverride) => { + const shouldTrapFocus = shouldTrapFocusOverride === void 0 ? this.shouldTrapFocus() : shouldTrapFocusOverride; + if (shouldTrapFocus && !this.isTrappingFocus) { + this.isTrappingFocus = true; + document.addEventListener("focusin", this.handleDocumentFocus); + DOM.queueUpdate(() => { + if (this.shouldForceFocus(document.activeElement)) { + this.focusFirstElement(); + } + }); + } else if (!shouldTrapFocus && this.isTrappingFocus) { + this.isTrappingFocus = false; + document.removeEventListener("focusin", this.handleDocumentFocus); + } + }; + } + /** + * @internal + */ + dismiss() { + this.$emit("dismiss"); + this.$emit("cancel"); + } + /** + * The method to show the dialog. + * + * @public + */ + show() { + this.hidden = false; + } + /** + * The method to hide the dialog. + * + * @public + */ + hide() { + this.hidden = true; + this.$emit("close"); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + document.addEventListener("keydown", this.handleDocumentKeydown); + this.notifier = Observable.getNotifier(this); + this.notifier.subscribe(this, "hidden"); + this.updateTrapFocus(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.updateTrapFocus(false); + this.notifier.unsubscribe(this, "hidden"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "hidden": + this.updateTrapFocus(); + break; + default: + break; + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceTabbableItems(elements2, element) { + if (element.getAttribute("tabindex") === "-1") { + return elements2; + } + if (isTabbable(element) || _Dialog.isFocusableFastElement(element) && _Dialog.hasTabbableShadow(element)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Dialog.reduceTabbableItems, [])); + } + return elements2; + } + /** + * Test if element is focusable fast element + * + * @param element - The element to check + * + * @internal + */ + static isFocusableFastElement(element) { + var _a, _b; + return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus); + } + /** + * Test if the element has a focusable shadow + * + * @param element - The element to check + * + * @internal + */ + static hasTabbableShadow(element) { + var _a, _b; + return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("*")) !== null && _b !== void 0 ? _b : []).some((x) => { + return isTabbable(x); + }); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "modal", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "hidden", void 0); + __decorate([ + attr({ attribute: "trap-focus", mode: "boolean" }) + ], Dialog.prototype, "trapFocus", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], Dialog.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], Dialog.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], Dialog.prototype, "ariaLabel", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js + var init_dialog2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js"() { + init_dialog_template(); + init_dialog(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js + var init_disclosure_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js + var Disclosure; + var init_disclosure = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Disclosure = class extends FoundationElement { + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.setup(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.details.removeEventListener("toggle", this.onToggle); + } + /** + * Show extra content. + */ + show() { + this.details.open = true; + } + /** + * Hide extra content. + */ + hide() { + this.details.open = false; + } + /** + * Toggle the current(expanded/collapsed) state. + */ + toggle() { + this.details.open = !this.details.open; + } + /** + * Register listener and set default disclosure mode + */ + setup() { + this.onToggle = this.onToggle.bind(this); + this.details.addEventListener("toggle", this.onToggle); + if (this.expanded) { + this.show(); + } + } + /** + * Update the aria attr and fire `toggle` event + */ + onToggle() { + this.expanded = this.details.open; + this.$emit("toggle"); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Disclosure.prototype, "expanded", void 0); + __decorate([ + attr + ], Disclosure.prototype, "title", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js + var init_disclosure2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js"() { + init_disclosure_template(); + init_disclosure(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js + var dividerTemplate; + var init_divider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js"() { + init_esm(); + dividerTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js + var DividerRole; + var init_divider_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js"() { + DividerRole = { + /** + * The divider semantically separates content + */ + separator: "separator", + /** + * The divider has no semantic value and is for visual presentation only. + */ + presentation: "presentation" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js + var Divider; + var init_divider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_divider_options(); + Divider = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = DividerRole.separator; + this.orientation = Orientation.horizontal; + } + }; + __decorate([ + attr + ], Divider.prototype, "role", void 0); + __decorate([ + attr + ], Divider.prototype, "orientation", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js + var init_divider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js"() { + init_divider_template(); + init_divider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js + var FlipperDirection; + var init_flipper_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js"() { + FlipperDirection = { + next: "next", + previous: "previous" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js + var init_flipper_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js + var Flipper; + var init_flipper = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_flipper_options(); + Flipper = class extends FoundationElement { + constructor() { + super(...arguments); + this.hiddenFromAT = true; + this.direction = FlipperDirection.next; + } + /** + * Simulate a click event when the flipper has focus and the user hits enter or space keys + * Blur focus if the user hits escape key + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + if (!this.hiddenFromAT) { + const key = e.key; + if (key === "Enter" || key === "Space") { + this.$emit("click", e); + } + if (key === "Escape") { + this.blur(); + } + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Flipper.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "aria-hidden", converter: booleanConverter }) + ], Flipper.prototype, "hiddenFromAT", void 0); + __decorate([ + attr + ], Flipper.prototype, "direction", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js + var init_flipper2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js"() { + init_flipper_template(); + init_flipper(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js + var init_form_associated2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js"() { + init_form_associated(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js + var init_foundation_element2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js"() { + init_foundation_element(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js + var listboxOptionTemplate; + var init_listbox_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js"() { + init_esm(); + init_start_end(); + listboxOptionTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js + var init_listbox_option2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js"() { + init_listbox_option(); + init_listbox_option_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js + var ListboxElement; + var init_listbox_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + ListboxElement = class extends Listbox { + constructor() { + super(...arguments); + this.activeIndex = -1; + this.rangeStartIndex = -1; + } + /** + * Returns the last checked option. + * + * @internal + */ + get activeOption() { + return this.options[this.activeIndex]; + } + /** + * Returns the list of checked options. + * + * @internal + */ + get checkedOptions() { + var _a; + return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((o) => o.checked); + } + /** + * Returns the index of the first selected option. + * + * @internal + */ + get firstSelectedOptionIndex() { + return this.options.indexOf(this.firstSelectedOption); + } + /** + * Updates the `ariaActiveDescendant` property when the active index changes. + * + * @param prev - the previous active index + * @param next - the next active index + * + * @internal + */ + activeIndexChanged(prev, next) { + var _a, _b; + this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; + this.focusAndScrollOptionIntoView(); + } + /** + * Toggles the checked state for the currently active option. + * + * @remarks + * Multiple-selection mode only. + * + * @internal + */ + checkActiveIndex() { + if (!this.multiple) { + return; + } + const activeItem = this.activeOption; + if (activeItem) { + activeItem.checked = true; + } + } + /** + * Sets the active index to the first option and marks it as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkFirstOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex + 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and sets the matching option as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkLastOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.options.length); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = this.options.length - 1; + this.checkActiveIndex(); + } + /** + * @override + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("focusout", this.focusoutHandler); + } + /** + * @override + * @internal + */ + disconnectedCallback() { + this.removeEventListener("focusout", this.focusoutHandler); + super.disconnectedCallback(); + } + /** + * Increments the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkNextOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.activeIndex + 1); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkPreviousOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + if (this.checkedOptions.length === 1) { + this.rangeStartIndex += 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.activeIndex, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex -= this.activeIndex > 0 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Handles click events for listbox options. + * + * @param e - the event object + * + * @override + * @internal + */ + clickHandler(e) { + var _a; + if (!this.multiple) { + return super.clickHandler(e); + } + const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`); + if (!captured || captured.disabled) { + return; + } + this.uncheckAllOptions(); + this.activeIndex = this.options.indexOf(captured); + this.checkActiveIndex(); + this.toggleSelectedForAllCheckedOptions(); + return true; + } + /** + * @override + * @internal + */ + focusAndScrollOptionIntoView() { + super.focusAndScrollOptionIntoView(this.activeOption); + } + /** + * In multiple-selection mode: + * If any options are selected, the first selected option is checked when + * the listbox receives focus. If no options are selected, the first + * selectable option is checked. + * + * @override + * @internal + */ + focusinHandler(e) { + if (!this.multiple) { + return super.focusinHandler(e); + } + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.uncheckAllOptions(); + if (this.activeIndex === -1) { + this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0; + } + this.checkActiveIndex(); + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Unchecks all options when the listbox loses focus. + * + * @internal + */ + focusoutHandler(e) { + if (this.multiple) { + this.uncheckAllOptions(); + } + } + /** + * Handles keydown actions for listbox navigation and typeahead + * + * @override + * @internal + */ + keydownHandler(e) { + if (!this.multiple) { + return super.keydownHandler(e); + } + if (this.disabled) { + return true; + } + const { key, shiftKey } = e; + this.shouldSkipFocus = false; + switch (key) { + // Select the first available option + case keyHome: { + this.checkFirstOption(shiftKey); + return; + } + // Select the next selectable option + case keyArrowDown: { + this.checkNextOption(shiftKey); + return; + } + // Select the previous selectable option + case keyArrowUp: { + this.checkPreviousOption(shiftKey); + return; + } + // Select the last available option + case keyEnd: { + this.checkLastOption(shiftKey); + return; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEscape: { + this.uncheckAllOptions(); + this.checkActiveIndex(); + return true; + } + case keySpace: { + e.preventDefault(); + if (this.typeAheadExpired) { + this.toggleSelectedForAllCheckedOptions(); + return; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @override + * @internal + */ + mousedownHandler(e) { + if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) { + return super.mousedownHandler(e); + } + } + /** + * Switches between single-selection and multi-selection mode. + * + * @internal + */ + multipleChanged(prev, next) { + var _a; + this.ariaMultiSelectable = next ? "true" : null; + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + o.checked = next ? false : void 0; + }); + this.setSelectedOptions(); + } + /** + * Sets an option as selected and gives it focus. + * + * @override + * @public + */ + setSelectedOptions() { + if (!this.multiple) { + super.setSelectedOptions(); + return; + } + if (this.$fastController.isConnected && this.options) { + this.selectedOptions = this.options.filter((o) => o.selected); + this.focusAndScrollOptionIntoView(); + } + } + /** + * Ensures the size is a positive integer when the property is updated. + * + * @param prev - the previous size value + * @param next - the current size value + * + * @internal + */ + sizeChanged(prev, next) { + var _a; + const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10)); + if (size !== next) { + DOM.queueUpdate(() => { + this.size = size; + }); + } + } + /** + * Toggles the selected state of the provided options. If any provided items + * are in an unselected state, all items are set to selected. If every + * provided item is selected, they are all unselected. + * + * @internal + */ + toggleSelectedForAllCheckedOptions() { + const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled); + const force = !enabledCheckedOptions.every((o) => o.selected); + enabledCheckedOptions.forEach((o) => o.selected = force); + this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]); + this.setSelectedOptions(); + } + /** + * @override + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (!this.multiple) { + super.typeaheadBufferChanged(prev, next); + return; + } + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + const activeIndex = this.options.indexOf(typeaheadMatches[0]); + if (activeIndex > -1) { + this.activeIndex = activeIndex; + this.uncheckAllOptions(); + this.checkActiveIndex(); + } + this.typeAheadExpired = false; + } + } + /** + * Unchecks all options. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - reset the rangeStartIndex + * + * @internal + */ + uncheckAllOptions(preserveChecked = false) { + this.options.forEach((o) => o.checked = this.multiple ? false : void 0); + if (!preserveChecked) { + this.rangeStartIndex = -1; + } + } + }; + __decorate([ + observable + ], ListboxElement.prototype, "activeIndex", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxElement.prototype, "multiple", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], ListboxElement.prototype, "size", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js + var init_listbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js + var init_listbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js"() { + init_listbox(); + init_listbox_element(); + init_listbox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js + var PickerMenu; + var init_picker_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js"() { + init_tslib_es6(); + init_dist2(); + init_esm(); + init_foundation_element(); + PickerMenu = class extends FoundationElement { + constructor() { + super(...arguments); + this.optionElements = []; + } + menuElementsChanged() { + this.updateOptions(); + } + headerElementsChanged() { + this.updateOptions(); + } + footerElementsChanged() { + this.updateOptions(); + } + updateOptions() { + this.optionElements.splice(0, this.optionElements.length); + this.addSlottedListItems(this.headerElements); + this.addSlottedListItems(this.menuElements); + this.addSlottedListItems(this.footerElements); + this.$emit("optionsupdated", { bubbles: false }); + } + addSlottedListItems(slotChildren) { + if (slotChildren === void 0) { + return; + } + slotChildren.forEach((child) => { + if (child.nodeType === 1 && child.getAttribute("role") === "listitem") { + child.id = child.id || uniqueId("option-"); + this.optionElements.push(child); + } + }); + } + }; + __decorate([ + observable + ], PickerMenu.prototype, "menuElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "headerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "footerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "suggestionsAvailableText", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js + var defaultContentsTemplate, PickerMenuOption; + var init_picker_menu_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + defaultContentsTemplate = html` + +`; + PickerMenuOption = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.disconnectView(); + } + handleClick(e) { + if (e.defaultPrevented) { + return false; + } + this.handleInvoked(); + return false; + } + handleInvoked() { + this.$emit("pickeroptioninvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerMenuOption.prototype, "value", void 0); + __decorate([ + observable + ], PickerMenuOption.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js + var init_picker_list = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js + var defaultContentsTemplate2, PickerListItem; + var init_picker_list_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + defaultContentsTemplate2 = html` + +`; + PickerListItem = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + this.disconnectView(); + super.disconnectedCallback(); + } + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + if (e.key === keyEnter) { + this.handleInvoke(); + return false; + } + return true; + } + handleClick(e) { + if (!e.defaultPrevented) { + this.handleInvoke(); + } + return false; + } + handleInvoke() { + this.$emit("pickeriteminvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate2.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerListItem.prototype, "value", void 0); + __decorate([ + observable + ], PickerListItem.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js + var init_picker_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js + var _Picker, FormAssociatedPicker; + var init_picker_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Picker = class extends FoundationElement { + }; + FormAssociatedPicker = class extends FormAssociated(_Picker) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js + var pickerInputTemplate, Picker; + var init_picker = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_anchored_region2(); + init_picker_menu_option(); + init_picker_list_item(); + init_picker_form_associated(); + pickerInputTemplate = html` + +`; + Picker = class extends FormAssociatedPicker { + constructor() { + super(...arguments); + this.selection = ""; + this.filterSelected = true; + this.filterQuery = true; + this.noSuggestionsText = "No suggestions available"; + this.suggestionsAvailableText = "Suggestions available"; + this.loadingText = "Loading suggestions"; + this.menuPlacement = "bottom-fill"; + this.showLoading = false; + this.optionsList = []; + this.filteredOptionsList = []; + this.flyoutOpen = false; + this.menuFocusIndex = -1; + this.showNoOptions = false; + this.selectedItems = []; + this.inputElementView = null; + this.handleTextInput = (e) => { + this.query = this.inputElement.value; + }; + this.handleInputClick = (e) => { + e.preventDefault(); + this.toggleFlyout(true); + }; + this.setRegionProps = () => { + if (!this.flyoutOpen) { + return; + } + if (this.region === null || this.region === void 0) { + DOM.queueUpdate(this.setRegionProps); + return; + } + this.region.anchorElement = this.inputElement; + }; + this.configLookup = { + top: FlyoutPosTop, + bottom: FlyoutPosBottom, + tallest: FlyoutPosTallest, + "top-fill": FlyoutPosTopFill, + "bottom-fill": FlyoutPosBottomFill, + "tallest-fill": FlyoutPosTallestFill + }; + } + selectionChanged() { + if (this.$fastController.isConnected) { + this.handleSelectionChange(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.value = this.selection; + this.validate(); + } + } + } + optionsChanged() { + this.optionsList = this.options.split(",").map((opt) => opt.trim()).filter((opt) => opt !== ""); + } + menuPlacementChanged() { + if (this.$fastController.isConnected) { + this.updateMenuConfig(); + } + } + showLoadingChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + listItemTemplateChanged() { + this.updateListItemTemplate(); + } + defaultListItemTemplateChanged() { + this.updateListItemTemplate(); + } + menuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + defaultMenuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + optionsListChanged() { + this.updateFilteredOptions(); + } + queryChanged() { + if (this.$fastController.isConnected) { + if (this.inputElement.value !== this.query) { + this.inputElement.value = this.query; + } + this.updateFilteredOptions(); + this.$emit("querychange", { bubbles: false }); + } + } + filteredOptionsListChanged() { + if (this.$fastController.isConnected) { + this.showNoOptions = this.filteredOptionsList.length === 0 && this.menuElement.querySelectorAll('[role="listitem"]').length === 0; + this.setFocusedOption(this.showNoOptions ? -1 : 0); + } + } + flyoutOpenChanged() { + if (this.flyoutOpen) { + DOM.queueUpdate(this.setRegionProps); + this.$emit("menuopening", { bubbles: false }); + } else { + this.$emit("menuclosing", { bubbles: false }); + } + } + showNoOptionsChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.listElement = document.createElement(this.selectedListTag); + this.appendChild(this.listElement); + this.itemsPlaceholderElement = document.createComment(""); + this.listElement.append(this.itemsPlaceholderElement); + this.inputElementView = pickerInputTemplate.render(this, this.listElement); + const match = this.menuTag.toUpperCase(); + this.menuElement = Array.from(this.children).find((element) => { + return element.tagName === match; + }); + if (this.menuElement === void 0) { + this.menuElement = document.createElement(this.menuTag); + this.appendChild(this.menuElement); + } + if (this.menuElement.id === "") { + this.menuElement.id = uniqueId("listbox-"); + } + this.menuId = this.menuElement.id; + this.optionsPlaceholder = document.createComment(""); + this.menuElement.append(this.optionsPlaceholder); + this.updateMenuConfig(); + DOM.queueUpdate(() => this.initialize()); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.toggleFlyout(false); + this.inputElement.removeEventListener("input", this.handleTextInput); + this.inputElement.removeEventListener("click", this.handleInputClick); + if (this.inputElementView !== null) { + this.inputElementView.dispose(); + this.inputElementView = null; + } + } + /** + * Move focus to the input element + * @public + */ + focus() { + this.inputElement.focus(); + } + /** + * Initialize the component. This is delayed a frame to ensure children are connected as well. + */ + initialize() { + this.updateListItemTemplate(); + this.updateOptionTemplate(); + this.itemsRepeatBehavior = new RepeatDirective((x) => x.selectedItems, (x) => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement); + this.inputElement.addEventListener("input", this.handleTextInput); + this.inputElement.addEventListener("click", this.handleInputClick); + this.$fastController.addBehaviors([this.itemsRepeatBehavior]); + this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText; + this.menuElement.addEventListener("optionsupdated", this.handleMenuOptionsUpdated); + this.optionsRepeatBehavior = new RepeatDirective((x) => x.filteredOptionsList, (x) => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder); + this.$fastController.addBehaviors([this.optionsRepeatBehavior]); + this.handleSelectionChange(); + } + /** + * Toggles the menu flyout + */ + toggleFlyout(open) { + if (this.flyoutOpen === open) { + return; + } + if (open && document.activeElement === this.inputElement) { + this.flyoutOpen = open; + DOM.queueUpdate(() => { + if (this.menuElement !== void 0) { + this.setFocusedOption(0); + } else { + this.disableMenu(); + } + }); + return; + } + this.flyoutOpen = false; + this.disableMenu(); + return; + } + /** + * Handle the menu options updated event from the child menu + */ + handleMenuOptionsUpdated(e) { + e.preventDefault(); + if (this.flyoutOpen) { + this.setFocusedOption(0); + } + } + /** + * Handle key down events. + */ + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + // TODO: what should "home" and "end" keys do, exactly? + // + // case keyHome: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.setFocusedOption(0); + // } + // } + // return false; + // } + // case keyEnd: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.toggleFlyout(true); + // this.setFocusedOption(this.menuElement.optionElements.length - 1); + // } + // } + // return false; + // } + case keyArrowDown: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const nextFocusOptionIndex = this.flyoutOpen ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1) : 0; + this.setFocusedOption(nextFocusOptionIndex); + } + return false; + } + case keyArrowUp: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const previousFocusOptionIndex = this.flyoutOpen ? Math.max(this.menuFocusIndex - 1, 0) : 0; + this.setFocusedOption(previousFocusOptionIndex); + } + return false; + } + case keyEscape: { + this.toggleFlyout(false); + return false; + } + case keyEnter: { + if (this.menuFocusIndex !== -1 && this.menuElement.optionElements.length > this.menuFocusIndex) { + this.menuElement.optionElements[this.menuFocusIndex].click(); + } + return false; + } + case keyArrowRight: { + if (document.activeElement !== this.inputElement) { + this.incrementFocusedItem(1); + return false; + } + return true; + } + case keyArrowLeft: { + if (this.inputElement.selectionStart === 0) { + this.incrementFocusedItem(-1); + return false; + } + return true; + } + case keyDelete: + case keyBackspace: { + if (document.activeElement === null) { + return true; + } + if (document.activeElement === this.inputElement) { + if (this.inputElement.selectionStart === 0) { + this.selection = this.selectedItems.slice(0, this.selectedItems.length - 1).toString(); + this.toggleFlyout(false); + return false; + } + return true; + } + const selectedItems = Array.from(this.listElement.children); + const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement); + if (currentFocusedItemIndex > -1) { + this.selection = this.selectedItems.splice(currentFocusedItemIndex, 1).toString(); + DOM.queueUpdate(() => { + selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus(); + }); + return false; + } + return true; + } + } + this.toggleFlyout(true); + return true; + } + /** + * Handle focus in events. + */ + handleFocusIn(e) { + return false; + } + /** + * Handle focus out events. + */ + handleFocusOut(e) { + if (this.menuElement === void 0 || !this.menuElement.contains(e.relatedTarget)) { + this.toggleFlyout(false); + } + return false; + } + /** + * The list of selected items has changed + */ + handleSelectionChange() { + if (this.selectedItems.toString() === this.selection) { + return; + } + this.selectedItems = this.selection === "" ? [] : this.selection.split(","); + this.updateFilteredOptions(); + DOM.queueUpdate(() => { + this.checkMaxItems(); + }); + this.$emit("selectionchange", { bubbles: false }); + } + /** + * Anchored region is loaded, menu and options exist in the DOM. + */ + handleRegionLoaded(e) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + this.$emit("menuloaded", { bubbles: false }); + }); + } + /** + * Checks if the maximum number of items has been chosen and updates the ui. + */ + checkMaxItems() { + if (this.inputElement === void 0) { + return; + } + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + if (document.activeElement === this.inputElement) { + const selectedItemInstances = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + selectedItemInstances[selectedItemInstances.length - 1].focus(); + } + this.inputElement.hidden = true; + } else { + this.inputElement.hidden = false; + } + } + /** + * A list item has been invoked. + */ + handleItemInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerListItem) { + const listItems = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + const itemIndex = listItems.indexOf(e.target); + if (itemIndex !== -1) { + const newSelection = this.selectedItems.slice(); + newSelection.splice(itemIndex, 1); + this.selection = newSelection.toString(); + DOM.queueUpdate(() => this.incrementFocusedItem(0)); + } + return false; + } + return true; + } + /** + * A menu option has been invoked. + */ + handleOptionInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerMenuOption) { + if (e.target.value !== void 0) { + this.selection = `${this.selection}${this.selection === "" ? "" : ","}${e.target.value}`; + } + this.inputElement.value = ""; + this.query = ""; + this.inputElement.focus(); + this.toggleFlyout(false); + return false; + } + return true; + } + /** + * Increments the focused list item by the specified amount + */ + incrementFocusedItem(increment) { + if (this.selectedItems.length === 0) { + this.inputElement.focus(); + return; + } + const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + if (document.activeElement !== null) { + let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement); + if (currentFocusedItemIndex === -1) { + currentFocusedItemIndex = selectedItemsAsElements.length; + } + const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment)); + if (newFocusedItemIndex === selectedItemsAsElements.length) { + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + selectedItemsAsElements[newFocusedItemIndex - 1].focus(); + } else { + this.inputElement.focus(); + } + } else { + selectedItemsAsElements[newFocusedItemIndex].focus(); + } + } + } + /** + * Disables the menu. Note that the menu can be open, just doens't have any valid options on display. + */ + disableMenu() { + var _a, _b, _c; + this.menuFocusIndex = -1; + this.menuFocusOptionId = void 0; + (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant"); + (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns"); + (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded"); + } + /** + * Sets the currently focused menu option by index + */ + setFocusedOption(optionIndex) { + if (!this.flyoutOpen || optionIndex === -1 || this.showNoOptions || this.showLoading) { + this.disableMenu(); + return; + } + if (this.menuElement.optionElements.length === 0) { + return; + } + this.menuElement.optionElements.forEach((element) => { + element.setAttribute("aria-selected", "false"); + }); + this.menuFocusIndex = optionIndex; + if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) { + this.menuFocusIndex = this.menuElement.optionElements.length - 1; + } + this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id; + this.inputElement.setAttribute("aria-owns", this.menuId); + this.inputElement.setAttribute("aria-expanded", "true"); + this.inputElement.setAttribute("aria-activedescendant", this.menuFocusOptionId); + const focusedOption = this.menuElement.optionElements[this.menuFocusIndex]; + focusedOption.setAttribute("aria-selected", "true"); + this.menuElement.scrollTo(0, focusedOption.offsetTop); + } + /** + * Updates the template used for the list item repeat behavior + */ + updateListItemTemplate() { + var _a; + this.activeListItemTemplate = (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate; + } + /** + * Updates the template used for the menu option repeat behavior + */ + updateOptionTemplate() { + var _a; + this.activeMenuOptionTemplate = (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate; + } + /** + * Updates the filtered options array + */ + updateFilteredOptions() { + this.filteredOptionsList = this.optionsList.slice(0); + if (this.filterSelected) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => this.selectedItems.indexOf(el2) === -1); + } + if (this.filterQuery && this.query !== "" && this.query !== void 0) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => el2.indexOf(this.query) !== -1); + } + } + /** + * Updates the menu configuration + */ + updateMenuConfig() { + let newConfig = this.configLookup[this.menuPlacement]; + if (newConfig === null) { + newConfig = FlyoutPosBottomFill; + } + this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false }); + } + }; + __decorate([ + attr({ attribute: "selection" }) + ], Picker.prototype, "selection", void 0); + __decorate([ + attr({ attribute: "options" }) + ], Picker.prototype, "options", void 0); + __decorate([ + attr({ attribute: "filter-selected", mode: "boolean" }) + ], Picker.prototype, "filterSelected", void 0); + __decorate([ + attr({ attribute: "filter-query", mode: "boolean" }) + ], Picker.prototype, "filterQuery", void 0); + __decorate([ + attr({ attribute: "max-selected" }) + ], Picker.prototype, "maxSelected", void 0); + __decorate([ + attr({ attribute: "no-suggestions-text" }) + ], Picker.prototype, "noSuggestionsText", void 0); + __decorate([ + attr({ attribute: "suggestions-available-text" }) + ], Picker.prototype, "suggestionsAvailableText", void 0); + __decorate([ + attr({ attribute: "loading-text" }) + ], Picker.prototype, "loadingText", void 0); + __decorate([ + attr({ attribute: "label" }) + ], Picker.prototype, "label", void 0); + __decorate([ + attr({ attribute: "labelledby" }) + ], Picker.prototype, "labelledBy", void 0); + __decorate([ + attr({ attribute: "placeholder" }) + ], Picker.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "menu-placement" }) + ], Picker.prototype, "menuPlacement", void 0); + __decorate([ + observable + ], Picker.prototype, "showLoading", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "optionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "query", void 0); + __decorate([ + observable + ], Picker.prototype, "filteredOptionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "flyoutOpen", void 0); + __decorate([ + observable + ], Picker.prototype, "menuId", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedListTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusIndex", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusOptionId", void 0); + __decorate([ + observable + ], Picker.prototype, "showNoOptions", void 0); + __decorate([ + observable + ], Picker.prototype, "menuConfig", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js + var init_picker_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js + var init_picker_menu_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js + var init_picker_list_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js + var init_picker_list_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js + var init_picker2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js"() { + init_picker_template(); + init_picker(); + init_picker_menu_template(); + init_picker_menu(); + init_picker_menu_option_template(); + init_picker_menu_option(); + init_picker_list_template(); + init_picker_list(); + init_picker_list_item_template(); + init_picker_list_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js + var MenuItemRole, roleForMenuItem; + var init_menu_item_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js"() { + MenuItemRole = { + /** + * The menu item has a "menuitem" role + */ + menuitem: "menuitem", + /** + * The menu item has a "menuitemcheckbox" role + */ + menuitemcheckbox: "menuitemcheckbox", + /** + * The menu item has a "menuitemradio" role + */ + menuitemradio: "menuitemradio" + }; + roleForMenuItem = { + [MenuItemRole.menuitem]: "menuitem", + [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox", + [MenuItemRole.menuitemradio]: "menuitemradio" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js + var MenuItem; + var init_menu_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_start_end(); + init_direction(); + init_apply_mixins(); + init_menu_item_options(); + MenuItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = MenuItemRole.menuitem; + this.hasSubmenu = false; + this.currentDirection = Direction.ltr; + this.focusSubmenuOnLoad = false; + this.handleMenuItemKeyDown = (e) => { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.invoke(); + return false; + case keyArrowRight: + this.expandAndFocus(); + return false; + case keyArrowLeft: + if (this.expanded) { + this.expanded = false; + this.focus(); + return false; + } + } + return true; + }; + this.handleMenuItemClick = (e) => { + if (e.defaultPrevented || this.disabled) { + return false; + } + this.invoke(); + return false; + }; + this.submenuLoaded = () => { + if (!this.focusSubmenuOnLoad) { + return; + } + this.focusSubmenuOnLoad = false; + if (this.hasSubmenu) { + this.submenu.focus(); + this.setAttribute("tabindex", "-1"); + } + }; + this.handleMouseOver = (e) => { + if (this.disabled || !this.hasSubmenu || this.expanded) { + return false; + } + this.expanded = true; + return false; + }; + this.handleMouseOut = (e) => { + if (!this.expanded || this.contains(document.activeElement)) { + return false; + } + this.expanded = false; + return false; + }; + this.expandAndFocus = () => { + if (!this.hasSubmenu) { + return; + } + this.focusSubmenuOnLoad = true; + this.expanded = true; + }; + this.invoke = () => { + if (this.disabled) { + return; + } + switch (this.role) { + case MenuItemRole.menuitemcheckbox: + this.checked = !this.checked; + break; + case MenuItemRole.menuitem: + this.updateSubmenu(); + if (this.hasSubmenu) { + this.expandAndFocus(); + } else { + this.$emit("change"); + } + break; + case MenuItemRole.menuitemradio: + if (!this.checked) { + this.checked = true; + } + break; + } + }; + this.updateSubmenu = () => { + this.submenu = this.domChildren().find((element) => { + return element.getAttribute("role") === "menu"; + }); + this.hasSubmenu = this.submenu === void 0 ? false : true; + }; + } + expandedChanged(oldValue) { + if (this.$fastController.isConnected) { + if (this.submenu === void 0) { + return; + } + if (this.expanded === false) { + this.submenu.collapseExpandedItem(); + } else { + this.currentDirection = getDirection(this); + } + this.$emit("expanded-change", this, { bubbles: false }); + } + } + checkedChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.$emit("change"); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.updateSubmenu(); + }); + if (!this.startColumnCount) { + this.startColumnCount = 1; + } + this.observer = new MutationObserver(this.updateSubmenu); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.submenu = void 0; + if (this.observer !== void 0) { + this.observer.disconnect(); + this.observer = void 0; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "disabled", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "expanded", void 0); + __decorate([ + observable + ], MenuItem.prototype, "startColumnCount", void 0); + __decorate([ + attr + ], MenuItem.prototype, "role", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "checked", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenuRegion", void 0); + __decorate([ + observable + ], MenuItem.prototype, "hasSubmenu", void 0); + __decorate([ + observable + ], MenuItem.prototype, "currentDirection", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenu", void 0); + applyMixins(MenuItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js + var init_menu_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js + var init_menu_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js"() { + init_menu_item_template(); + init_menu_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js + var init_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js + var Menu; + var init_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_menu_item2(); + init_foundation_element(); + Menu = class _Menu extends FoundationElement { + constructor() { + super(...arguments); + this.expandedItem = null; + this.focusIndex = -1; + this.isNestedMenu = () => { + return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem"; + }; + this.handleFocusOut = (e) => { + if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) { + this.collapseExpandedItem(); + const focusIndex = this.menuItems.findIndex(this.isFocusableElement); + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.menuItems[focusIndex].setAttribute("tabindex", "0"); + this.focusIndex = focusIndex; + } + }; + this.handleItemFocus = (e) => { + const targetItem = e.target; + if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.focusIndex = this.menuItems.indexOf(targetItem); + targetItem.setAttribute("tabindex", "0"); + } + }; + this.handleExpandedChanged = (e) => { + if (e.defaultPrevented || e.target === null || this.menuItems === void 0 || this.menuItems.indexOf(e.target) < 0) { + return; + } + e.preventDefault(); + const changedItem = e.target; + if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) { + this.expandedItem = null; + return; + } + if (changedItem.expanded) { + if (this.expandedItem !== null && this.expandedItem !== changedItem) { + this.expandedItem.expanded = false; + } + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.expandedItem = changedItem; + this.focusIndex = this.menuItems.indexOf(changedItem); + changedItem.setAttribute("tabindex", "0"); + } + }; + this.removeItemListeners = () => { + if (this.menuItems !== void 0) { + this.menuItems.forEach((item) => { + item.removeEventListener("expanded-change", this.handleExpandedChanged); + item.removeEventListener("focus", this.handleItemFocus); + }); + } + }; + this.setItems = () => { + const newItems = this.domChildren(); + this.removeItemListeners(); + this.menuItems = newItems; + const menuItems = this.menuItems.filter(this.isMenuItemElement); + if (menuItems.length) { + this.focusIndex = 0; + } + function elementIndent(el2) { + const role = el2.getAttribute("role"); + const startSlot = el2.querySelector("[slot=start]"); + if (role !== MenuItemRole.menuitem && startSlot === null) { + return 1; + } else if (role === MenuItemRole.menuitem && startSlot !== null) { + return 1; + } else if (role !== MenuItemRole.menuitem && startSlot !== null) { + return 2; + } else { + return 0; + } + } + const indent = menuItems.reduce((accum, current) => { + const elementValue = elementIndent(current); + return accum > elementValue ? accum : elementValue; + }, 0); + menuItems.forEach((item, index) => { + item.setAttribute("tabindex", index === 0 ? "0" : "-1"); + item.addEventListener("expanded-change", this.handleExpandedChanged); + item.addEventListener("focus", this.handleItemFocus); + if (item instanceof MenuItem || "startColumnCount" in item) { + item.startColumnCount = indent; + } + }); + }; + this.changeHandler = (e) => { + if (this.menuItems === void 0) { + return; + } + const changedMenuItem = e.target; + const changeItemIndex = this.menuItems.indexOf(changedMenuItem); + if (changeItemIndex === -1) { + return; + } + if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) { + for (let i = changeItemIndex - 1; i >= 0; --i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + const maxIndex = this.menuItems.length - 1; + for (let i = changeItemIndex + 1; i <= maxIndex; ++i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + } + }; + this.isMenuItemElement = (el2) => { + return isHTMLElement(el2) && _Menu.focusableElementRoles.hasOwnProperty(el2.getAttribute("role")); + }; + this.isFocusableElement = (el2) => { + return this.isMenuItemElement(el2); + }; + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.menuItems !== void 0) { + this.setItems(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.setItems(); + }); + this.addEventListener("change", this.changeHandler); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeItemListeners(); + this.menuItems = void 0; + this.removeEventListener("change", this.changeHandler); + } + /** + * Focuses the first item in the menu. + * + * @public + */ + focus() { + this.setFocus(0, 1); + } + /** + * Collapses any expanded menu items. + * + * @public + */ + collapseExpandedItem() { + if (this.expandedItem !== null) { + this.expandedItem.expanded = false; + this.expandedItem = null; + } + } + /** + * @internal + */ + handleMenuKeyDown(e) { + if (e.defaultPrevented || this.menuItems === void 0) { + return; + } + switch (e.key) { + case keyArrowDown: + this.setFocus(this.focusIndex + 1, 1); + return; + case keyArrowUp: + this.setFocus(this.focusIndex - 1, -1); + return; + case keyEnd: + this.setFocus(this.menuItems.length - 1, -1); + return; + case keyHome: + this.setFocus(0, 1); + return; + default: + return true; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + setFocus(focusIndex, adjustment) { + if (this.menuItems === void 0) { + return; + } + while (focusIndex >= 0 && focusIndex < this.menuItems.length) { + const child = this.menuItems[focusIndex]; + if (this.isFocusableElement(child)) { + if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + } + this.focusIndex = focusIndex; + child.setAttribute("tabindex", "0"); + child.focus(); + break; + } + focusIndex += adjustment; + } + } + }; + Menu.focusableElementRoles = roleForMenuItem; + __decorate([ + observable + ], Menu.prototype, "items", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js + var init_menu2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js"() { + init_menu_template(); + init_menu(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js + var init_number_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js + var _TextField, FormAssociatedTextField; + var init_text_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextField = class extends FoundationElement { + }; + FormAssociatedTextField = class extends FormAssociated(_TextField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js + var TextFieldType; + var init_text_field_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js"() { + TextFieldType = { + /** + * An email TextField + */ + email: "email", + /** + * A password TextField + */ + password: "password", + /** + * A telephone TextField + */ + tel: "tel", + /** + * A text TextField + */ + text: "text", + /** + * A URL TextField + */ + url: "url" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js + var TextField, DelegatesARIATextbox; + var init_text_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_text_field_form_associated(); + init_text_field_options(); + TextField = class extends FormAssociatedTextField { + constructor() { + super(...arguments); + this.type = TextFieldType.text; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + typeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + this.validate(); + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the text field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], TextField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "autofocus", void 0); + __decorate([ + attr + ], TextField.prototype, "placeholder", void 0); + __decorate([ + attr + ], TextField.prototype, "type", void 0); + __decorate([ + attr + ], TextField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "minlength", void 0); + __decorate([ + attr + ], TextField.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextField.prototype, "defaultSlottedNodes", void 0); + DelegatesARIATextbox = class { + }; + applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties); + applyMixins(TextField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js + var _NumberField, FormAssociatedNumberField; + var init_number_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _NumberField = class extends FoundationElement { + }; + FormAssociatedNumberField = class extends FormAssociated(_NumberField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js + var NumberField; + var init_number_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_text_field(); + init_number_field_form_associated(); + NumberField = class extends FormAssociatedNumberField { + constructor() { + super(...arguments); + this.hideStep = false; + this.step = 1; + this.isUserInput = false; + } + /** + * Ensures that the max is greater than the min and that the value + * is less than the max + * @param previous - the previous max value + * @param next - updated max value + * + * @internal + */ + maxChanged(previous, next) { + var _a; + this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next); + const min = Math.min(this.min, this.max); + if (this.min !== void 0 && this.min !== min) { + this.min = min; + } + this.value = this.getValidValue(this.value); + } + /** + * Ensures that the min is less than the max and that the value + * is greater than the min + * @param previous - previous min value + * @param next - updated min value + * + * @internal + */ + minChanged(previous, next) { + var _a; + this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next); + const max = Math.max(this.min, this.max); + if (this.max !== void 0 && this.max !== max) { + this.max = max; + } + this.value = this.getValidValue(this.value); + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * Validates that the value is a number between the min and max + * @param previous - previous stored value + * @param next - value being updated + * @param updateControl - should the text field be updated with value, defaults to true + * @internal + */ + valueChanged(previous, next) { + this.value = this.getValidValue(next); + if (next !== this.value) { + return; + } + if (this.control && !this.isUserInput) { + this.control.value = this.value; + } + super.valueChanged(previous, this.value); + if (previous !== void 0 && !this.isUserInput) { + this.$emit("input"); + this.$emit("change"); + } + this.isUserInput = false; + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Sets the internal value to a valid number between the min and max properties + * @param value - user input + * + * @internal + */ + getValidValue(value) { + var _a, _b; + let validValue = parseFloat(parseFloat(value).toPrecision(12)); + if (isNaN(validValue)) { + validValue = ""; + } else { + validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue); + validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString(); + } + return validValue; + } + /** + * Increments the value using the step value + * + * @public + */ + stepUp() { + const value = parseFloat(this.value); + const stepUpValue = !isNaN(value) ? value + this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? this.step : 0; + this.value = stepUpValue.toString(); + } + /** + * Decrements the value using the step value + * + * @public + */ + stepDown() { + const value = parseFloat(this.value); + const stepDownValue = !isNaN(value) ? value - this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? 0 - this.step : 0; + this.value = stepDownValue.toString(); + } + /** + * Sets up the initial state of the number field + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "number"); + this.validate(); + this.control.value = this.value; + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the number field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, ""); + this.isUserInput = true; + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** + * Handles the internal control's `keydown` event + * @internal + */ + handleKeyDown(e) { + const key = e.key; + switch (key) { + case keyArrowUp: + this.stepUp(); + return false; + case keyArrowDown: + this.stepDown(); + return false; + } + return true; + } + /** + * Handles populating the input field with a validated value when + * leaving the input field. + * @internal + */ + handleBlur() { + this.control.value = this.value; + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], NumberField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], NumberField.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "hide-step", mode: "boolean" }) + ], NumberField.prototype, "hideStep", void 0); + __decorate([ + attr + ], NumberField.prototype, "placeholder", void 0); + __decorate([ + attr + ], NumberField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "minlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "size", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "step", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "min", void 0); + __decorate([ + observable + ], NumberField.prototype, "defaultSlottedNodes", void 0); + applyMixins(NumberField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js + var init_number_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js"() { + init_number_field_template(); + init_number_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js + var progressSegments, progressRingTemplate; + var init_progress_ring_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js"() { + init_esm(); + progressSegments = 44; + progressRingTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js + var init_progress_ring = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js"() { + init_progress_ring_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js + var BaseProgress; + var init_base_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + BaseProgress = class extends FoundationElement { + constructor() { + super(...arguments); + this.percentComplete = 0; + } + valueChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + minChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + maxChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updatePercentComplete(); + } + updatePercentComplete() { + const min = typeof this.min === "number" ? this.min : 0; + const max = typeof this.max === "number" ? this.max : 100; + const value = typeof this.value === "number" ? this.value : 0; + const range2 = max - min; + this.percentComplete = range2 === 0 ? 0 : Math.fround((value - min) / range2 * 100); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "value", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "max", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], BaseProgress.prototype, "paused", void 0); + __decorate([ + observable + ], BaseProgress.prototype, "percentComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js + var init_progress_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js + var init_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js"() { + init_base_progress(); + init_progress_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js + var radioGroupTemplate; + var init_radio_group_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js"() { + init_esm(); + init_dist2(); + radioGroupTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js + var RadioGroup; + var init_radio_group = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + RadioGroup = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = Orientation.horizontal; + this.radioChangeHandler = (e) => { + const changedRadio = e.target; + if (changedRadio.checked) { + this.slottedRadioButtons.forEach((radio) => { + if (radio !== changedRadio) { + radio.checked = false; + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + } + }); + this.selectedRadio = changedRadio; + this.value = changedRadio.value; + changedRadio.setAttribute("tabindex", "0"); + this.focusedRadio = changedRadio; + } + e.stopPropagation(); + }; + this.moveToRadioByIndex = (group, index) => { + const radio = group[index]; + if (!this.isInsideToolbar) { + radio.setAttribute("tabindex", "0"); + if (radio.readOnly) { + this.slottedRadioButtons.forEach((nextRadio) => { + if (nextRadio !== radio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + radio.checked = true; + this.selectedRadio = radio; + } + } + this.focusedRadio = radio; + radio.focus(); + }; + this.moveRightOffGroup = () => { + var _a; + (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.moveLeftOffGroup = () => { + var _a; + (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.focusOutHandler = (e) => { + const group = this.slottedRadioButtons; + const radio = e.target; + const index = radio !== null ? group.indexOf(radio) : 0; + const focusedIndex = this.focusedRadio ? group.indexOf(this.focusedRadio) : -1; + if (focusedIndex === 0 && index === focusedIndex || focusedIndex === group.length - 1 && focusedIndex === index) { + if (!this.selectedRadio) { + this.focusedRadio = group[0]; + this.focusedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.focusedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + this.focusedRadio = this.selectedRadio; + if (!this.isInsideFoundationToolbar) { + this.selectedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.selectedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } + } + } + return true; + }; + this.clickHandler = (e) => { + const radio = e.target; + if (radio) { + const group = this.slottedRadioButtons; + if (radio.checked || group.indexOf(radio) === 0) { + radio.setAttribute("tabindex", "0"); + this.selectedRadio = radio; + } else { + radio.setAttribute("tabindex", "-1"); + this.selectedRadio = null; + } + this.focusedRadio = radio; + } + e.preventDefault(); + }; + this.shouldMoveOffGroupToTheRight = (index, group, key) => { + return index === group.length && this.isInsideToolbar && key === keyArrowRight; + }; + this.shouldMoveOffGroupToTheLeft = (group, key) => { + const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + return index < 0 && this.isInsideToolbar && key === keyArrowLeft; + }; + this.checkFocusedRadio = () => { + if (this.focusedRadio !== null && !this.focusedRadio.readOnly && !this.focusedRadio.checked) { + this.focusedRadio.checked = true; + this.focusedRadio.setAttribute("tabindex", "0"); + this.focusedRadio.focus(); + this.selectedRadio = this.focusedRadio; + } + }; + this.moveRight = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1; + if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) { + this.moveRightOffGroup(); + return; + } else if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index + 1 >= group.length) { + if (this.isInsideToolbar) { + break; + } else { + index = 0; + } + } else { + index += 1; + } + } + }; + this.moveLeft = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + if (this.shouldMoveOffGroupToTheLeft(group, e.key)) { + this.moveLeftOffGroup(); + return; + } + while (index >= 0 && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.keydownHandler = (e) => { + const key = e.key; + if (key in ArrowKeys && this.isInsideFoundationToolbar) { + return true; + } + switch (key) { + case keyEnter: { + this.checkFocusedRadio(); + break; + } + case keyArrowRight: + case keyArrowDown: { + if (this.direction === Direction.ltr) { + this.moveRight(e); + } else { + this.moveLeft(e); + } + break; + } + case keyArrowLeft: + case keyArrowUp: { + if (this.direction === Direction.ltr) { + this.moveLeft(e); + } else { + this.moveRight(e); + } + break; + } + default: { + return true; + } + } + }; + } + readOnlyChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.readOnly) { + radio.readOnly = true; + } else { + radio.readOnly = false; + } + }); + } + } + disabledChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.disabled) { + radio.disabled = true; + } else { + radio.disabled = false; + } + }); + } + } + nameChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + radio.setAttribute("name", this.name); + }); + } + } + valueChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + if (radio.value === this.value) { + radio.checked = true; + this.selectedRadio = radio; + } + }); + } + this.$emit("change"); + } + slottedRadioButtonsChanged(oldValue, newValue) { + if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) { + this.setupRadioButtons(); + } + } + get parentToolbar() { + return this.closest('[role="toolbar"]'); + } + get isInsideToolbar() { + var _a; + return (_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false; + } + get isInsideFoundationToolbar() { + var _a; + return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + this.setupRadioButtons(); + } + disconnectedCallback() { + this.slottedRadioButtons.forEach((radio) => { + radio.removeEventListener("change", this.radioChangeHandler); + }); + } + setupRadioButtons() { + const checkedRadios = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0; + if (numberOfCheckedRadios > 1) { + const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1]; + lastCheckedRadio.checked = true; + } + let foundMatchingVal = false; + this.slottedRadioButtons.forEach((radio) => { + if (this.name !== void 0) { + radio.setAttribute("name", this.name); + } + if (this.disabled) { + radio.disabled = true; + } + if (this.readOnly) { + radio.readOnly = true; + } + if (this.value && this.value === radio.value) { + this.selectedRadio = radio; + this.focusedRadio = radio; + radio.checked = true; + radio.setAttribute("tabindex", "0"); + foundMatchingVal = true; + } else { + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + radio.checked = false; + } + radio.addEventListener("change", this.radioChangeHandler); + }); + if (this.value === void 0 && this.slottedRadioButtons.length > 0) { + const checkedRadios2 = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios2 = checkedRadios2 !== null ? checkedRadios2.length : 0; + if (numberOfCheckedRadios2 > 0 && !foundMatchingVal) { + const lastCheckedRadio = checkedRadios2[numberOfCheckedRadios2 - 1]; + lastCheckedRadio.checked = true; + this.focusedRadio = lastCheckedRadio; + lastCheckedRadio.setAttribute("tabindex", "0"); + } else { + this.slottedRadioButtons[0].setAttribute("tabindex", "0"); + this.focusedRadio = this.slottedRadioButtons[0]; + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], RadioGroup.prototype, "readOnly", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], RadioGroup.prototype, "disabled", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "name", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "value", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "orientation", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "childItems", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "slottedRadioButtons", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js + var init_radio_group2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js"() { + init_radio_group_template(); + init_radio_group(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js + var radioTemplate; + var init_radio_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js"() { + init_esm(); + radioTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js + var _Radio, FormAssociatedRadio; + var init_radio_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Radio = class extends FoundationElement { + }; + FormAssociatedRadio = class extends CheckableFormAssociated(_Radio) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js + var Radio; + var init_radio = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_radio_form_associated(); + Radio = class extends FormAssociatedRadio { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + switch (e.key) { + case keySpace: + if (!this.checked && !this.readOnly) { + this.checked = true; + } + return; + } + return true; + }; + this.proxy.setAttribute("type", "radio"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * @internal + */ + defaultCheckedChanged() { + var _a; + if (this.$fastController.isConnected && !this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false; + this.dirtyChecked = false; + } + } + } + /** + * @internal + */ + connectedCallback() { + var _a, _b; + super.connectedCallback(); + this.validate(); + if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" && this.getAttribute("tabindex") === null) { + if (!this.disabled) { + this.setAttribute("tabindex", "0"); + } + } + if (this.checkedAttribute) { + if (!this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false; + this.dirtyChecked = false; + } + } + } + } + isInsideRadioGroup() { + const parent = this.closest("[role=radiogroup]"); + return parent !== null; + } + /** + * @internal + */ + clickHandler(e) { + if (!this.disabled && !this.readOnly && !this.checked) { + this.checked = true; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Radio.prototype, "readOnly", void 0); + __decorate([ + observable + ], Radio.prototype, "name", void 0); + __decorate([ + observable + ], Radio.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js + var init_radio2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js"() { + init_radio_template(); + init_radio(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js + var HorizontalScroll; + var init_horizontal_scroll = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + HorizontalScroll = class extends FoundationElement { + constructor() { + super(...arguments); + this.framesPerSecond = 60; + this.updatingItems = false; + this.speed = 600; + this.easing = "ease-in-out"; + this.flippersHiddenFromAT = false; + this.scrolling = false; + this.resizeDetector = null; + } + /** + * The calculated duration for a frame. + * + * @internal + */ + get frameTime() { + return 1e3 / this.framesPerSecond; + } + /** + * Firing scrollstart and scrollend events + * @internal + */ + scrollingChanged(prev, next) { + if (this.scrollContainer) { + const event = this.scrolling == true ? "scrollstart" : "scrollend"; + this.$emit(event, this.scrollContainer.scrollLeft); + } + } + /** + * In RTL mode + * @internal + */ + get isRtl() { + return this.scrollItems.length > 1 && this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft; + } + connectedCallback() { + super.connectedCallback(); + this.initializeResizeDetector(); + } + disconnectedCallback() { + this.disconnectResizeDetector(); + super.disconnectedCallback(); + } + /** + * Updates scroll stops and flippers when scroll items change + * @param previous - current scroll items + * @param next - new updated scroll items + * @public + */ + scrollItemsChanged(previous, next) { + if (next && !this.updatingItems) { + DOM.queueUpdate(() => this.setStops()); + } + } + /** + * destroys the instance's resize observer + * @internal + */ + disconnectResizeDetector() { + if (this.resizeDetector) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + * @internal + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.resized.bind(this)); + this.resizeDetector.observe(this); + } + /** + * Looks for slots and uses child nodes instead + * @internal + */ + updateScrollStops() { + this.updatingItems = true; + const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => { + if (scrollItem instanceof HTMLSlotElement) { + return scrollItems.concat(scrollItem.assignedElements()); + } + scrollItems.push(scrollItem); + return scrollItems; + }, []); + this.scrollItems = updatedItems; + this.updatingItems = false; + } + /** + * Finds all of the scroll stops between elements + * @internal + */ + setStops() { + this.updateScrollStops(); + const { scrollContainer: container } = this; + const { scrollLeft } = container; + const { width: containerWidth, left: containerLeft } = container.getBoundingClientRect(); + this.width = containerWidth; + let lastStop = 0; + let stops = this.scrollItems.map((item, index) => { + const { left, width } = item.getBoundingClientRect(); + const leftPosition = Math.round(left + scrollLeft - containerLeft); + const right = Math.round(leftPosition + width); + if (this.isRtl) { + return -right; + } + lastStop = right; + return index === 0 ? 0 : leftPosition; + }).concat(lastStop); + stops = this.fixScrollMisalign(stops); + stops.sort((a, b) => Math.abs(a) - Math.abs(b)); + this.scrollStops = stops; + this.setFlippers(); + } + /** + * Checks to see if the stops are returning values + * otherwise it will try to reinitialize them + * + * @returns boolean indicating that current scrollStops are valid non-zero values + * @internal + */ + validateStops(reinit = true) { + const hasStops = () => !!this.scrollStops.find((stop) => stop > 0); + if (!hasStops() && reinit) { + this.setStops(); + } + return hasStops(); + } + /** + * + */ + fixScrollMisalign(stops) { + if (this.isRtl && stops.some((stop) => stop > 0)) { + stops.sort((a, b) => b - a); + const offset = stops[0]; + stops = stops.map((stop) => stop - offset); + } + return stops; + } + /** + * Sets the controls view if enabled + * @internal + */ + setFlippers() { + var _a, _b; + const position = this.scrollContainer.scrollLeft; + (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle("disabled", position === 0); + if (this.scrollStops) { + const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]); + (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", this.validateStops(false) && Math.abs(position) + this.width >= lastStop); + } + } + /** + * Function that can scroll an item into view. + * @param item - An item index, a scroll item or a child of one of the scroll items + * @param padding - Padding of the viewport where the active item shouldn't be + * @param rightPadding - Optional right padding. Uses the padding if not defined + * + * @public + */ + scrollInView(item, padding = 0, rightPadding) { + var _a; + if (typeof item !== "number" && item) { + item = this.scrollItems.findIndex((scrollItem) => scrollItem === item || scrollItem.contains(item)); + } + if (item !== void 0) { + rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding; + const { scrollContainer: container, scrollStops, scrollItems: items } = this; + const { scrollLeft } = this.scrollContainer; + const { width: containerWidth } = container.getBoundingClientRect(); + const itemStart = scrollStops[item]; + const { width } = items[item].getBoundingClientRect(); + const itemEnd = itemStart + width; + const isBefore = scrollLeft + padding > itemStart; + if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) { + const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b); + const scrollTo = (_a = stops.find((position) => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0; + this.scrollToPosition(scrollTo); + } + } + } + /** + * Lets the user arrow left and right through the horizontal scroll + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + this.scrollToPrevious(); + break; + case "ArrowRight": + this.scrollToNext(); + break; + } + } + /** + * Scrolls items to the left + * @public + */ + scrollToPrevious() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition && (this.isRtl || index === this.scrollStops.length - 1 || this.scrollStops[index + 1] > scrollPosition)); + const right = Math.abs(this.scrollStops[current + 1]); + let nextIndex = this.scrollStops.findIndex((stop) => Math.abs(stop) + this.width > right); + if (nextIndex >= current || nextIndex === -1) { + nextIndex = current > 0 ? current - 1 : 0; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Scrolls items to the right + * @public + */ + scrollToNext() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop) => Math.abs(stop) >= Math.abs(scrollPosition)); + const outOfView = this.scrollStops.findIndex((stop) => Math.abs(scrollPosition) + this.width <= Math.abs(stop)); + let nextIndex = current; + if (outOfView > current + 2) { + nextIndex = outOfView - 2; + } else if (current < this.scrollStops.length - 2) { + nextIndex = current + 1; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Handles scrolling with easing + * @param position - starting position + * @param newPosition - position to scroll to + * @public + */ + scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) { + var _a; + if (this.scrolling) { + return; + } + this.scrolling = true; + const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`; + this.content.style.setProperty("transition-duration", seconds); + const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue("transition-duration")); + const transitionendHandler = (e) => { + if (e && e.target !== e.currentTarget) { + return; + } + this.content.style.setProperty("transition-duration", "0s"); + this.content.style.removeProperty("transform"); + this.scrollContainer.style.setProperty("scroll-behavior", "auto"); + this.scrollContainer.scrollLeft = newPosition; + this.setFlippers(); + this.content.removeEventListener("transitionend", transitionendHandler); + this.scrolling = false; + }; + if (computedDuration === 0) { + transitionendHandler(); + return; + } + this.content.addEventListener("transitionend", transitionendHandler); + const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth; + let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue); + if (this.isRtl) { + transitionStop = this.scrollContainer.scrollLeft + Math.min(Math.abs(newPosition), maxScrollValue); + } + this.content.style.setProperty("transition-property", "transform"); + this.content.style.setProperty("transition-timing-function", this.easing); + this.content.style.setProperty("transform", `translateX(${transitionStop}px)`); + } + /** + * Monitors resize event on the horizontal-scroll element + * @public + */ + resized() { + if (this.resizeTimeout) { + this.resizeTimeout = clearTimeout(this.resizeTimeout); + } + this.resizeTimeout = setTimeout(() => { + this.width = this.scrollContainer.offsetWidth; + this.setFlippers(); + }, this.frameTime); + } + /** + * Monitors scrolled event on the content container + * @public + */ + scrolled() { + if (this.scrollTimeout) { + this.scrollTimeout = clearTimeout(this.scrollTimeout); + } + this.scrollTimeout = setTimeout(() => { + this.setFlippers(); + }, this.frameTime); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], HorizontalScroll.prototype, "speed", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "duration", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "easing", void 0); + __decorate([ + attr({ attribute: "flippers-hidden-from-at", converter: booleanConverter }) + ], HorizontalScroll.prototype, "flippersHiddenFromAT", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrolling", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrollItems", void 0); + __decorate([ + attr({ attribute: "view" }) + ], HorizontalScroll.prototype, "view", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js + var init_horizontal_scroll_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js + var init_horizontal_scroll2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js"() { + init_horizontal_scroll(); + init_horizontal_scroll_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js + function whitespaceFilter(value, index, array) { + return value.nodeType !== Node.TEXT_NODE ? true : typeof value.nodeValue === "string" && !!value.nodeValue.trim().length; + } + var init_whitespace_filter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js + var init_search_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js + var _Search, FormAssociatedSearch; + var init_search_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Search = class extends FoundationElement { + }; + FormAssociatedSearch = class extends FormAssociated(_Search) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.js + var Search, DelegatesARIASearch; + var init_search = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_search_form_associated(); + Search = class extends FormAssociatedSearch { + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Handles the control's clear value event + * @public + */ + handleClearInput() { + this.value = ""; + this.control.focus(); + this.handleChange(); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Search.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "autofocus", void 0); + __decorate([ + attr + ], Search.prototype, "placeholder", void 0); + __decorate([ + attr + ], Search.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "minlength", void 0); + __decorate([ + attr + ], Search.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "spellcheck", void 0); + __decorate([ + observable + ], Search.prototype, "defaultSlottedNodes", void 0); + DelegatesARIASearch = class { + }; + applyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties); + applyMixins(Search, StartEnd, DelegatesARIASearch); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/index.js + var init_search2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/index.js"() { + init_search_template(); + init_search(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js + var _Select, FormAssociatedSelect; + var init_select_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js"() { + init_listbox_element(); + init_form_associated(); + _Select = class extends ListboxElement { + }; + FormAssociatedSelect = class extends FormAssociated(_Select) { + constructor() { + super(...arguments); + this.proxy = document.createElement("select"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.js + var Select, DelegatesARIASelect; + var init_select = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_apply_mixins(); + init_select_form_associated(); + init_select_options(); + Select = class extends FormAssociatedSelect { + constructor() { + super(...arguments); + this.open = false; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + } + /** + * Sets focus and synchronizes ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged(prev, next) { + if (!this.collapsible) { + return; + } + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + this.indexWhenOpened = this.selectedIndex; + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The component is collapsible when in single-selection mode with no size attribute. + * + * @internal + */ + get collapsible() { + return !(this.multiple || typeof this.size === "number"); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c, _d, _e, _f, _g; + const prev = `${this._value}`; + if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) { + const selectedIndex = this._options.findIndex((el2) => el2.value === next); + const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; + const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null; + if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) { + next = ""; + this.selectedIndex = selectedIndex; + } + next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + this.updateDisplayValue(); + } + } + /** + * Sets the value and display value to match the first selected option. + * + * @param shouldEmit - if true, the input and change events will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a, _b; + if (this.$fastController.isConnected) { + this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; + } + if (shouldEmit) { + this.$emit("input"); + this.$emit("change", this, { + bubbles: true, + composed: void 0 + }); + } + } + /** + * Updates the proxy value when the selected index changes. + * + * @param prev - the previous selected index + * @param next - the next selected index + * + * @internal + */ + selectedIndexChanged(prev, next) { + super.selectedIndexChanged(prev, next); + this.updateValue(); + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * The value displayed on the button. + * + * @public + */ + get displayValue() { + var _a, _b; + Observable.track(this, "displayValue"); + return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ""; + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + this.setProxyOptions(); + super.setDefaultSelectedOption(); + if (this.selectedIndex === -1) { + this.selectedIndex = 0; + } + } + /** + * Handle opening and closing the listbox when the select is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + if (this.disabled) { + return; + } + if (this.open) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && captured.disabled) { + return; + } + } + super.clickHandler(e); + this.open = this.collapsible && !this.open; + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + return true; + } + /** + * Handles focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + var _a; + super.focusoutHandler(e); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) { + this.open = false; + if (this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + } + } + /** + * Updates the value when an option's value changes. + * + * @param source - the source object + * @param propertyName - the property to evaluate + * + * @internal + * @override + */ + handleChange(source, propertyName) { + super.handleChange(source, propertyName); + if (propertyName === "value") { + this.updateValue(); + } + } + /** + * Synchronize the form-associated proxy and updates the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "value"); + }); + super.slottedOptionsChanged(prev, next); + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.subscribe(this, "value"); + }); + this.setProxyOptions(); + this.updateValue(); + } + /** + * Prevents focus when size is set and a scrollbar is clicked. + * + * @param e - the mouse event object + * + * @override + * @internal + */ + mousedownHandler(e) { + var _a; + if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) { + return super.mousedownHandler(e); + } + return this.collapsible; + } + /** + * Sets the multiple property on the proxy element. + * + * @param prev - the previous multiple value + * @param next - the current multiple value + */ + multipleChanged(prev, next) { + super.multipleChanged(prev, next); + if (this.proxy) { + this.proxy.multiple = next; + } + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @override + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + super.selectedOptionsChanged(prev, next); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => { + var _a2; + const proxyOption = (_a2 = this.proxy) === null || _a2 === void 0 ? void 0 : _a2.options.item(i); + if (proxyOption) { + proxyOption.selected = o.selected; + } + }); + } + /** + * Sets the selected index to match the first option with the selected attribute, or + * the first selectable option. + * + * @override + * @internal + */ + setDefaultSelectedOption() { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter); + const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex((el2) => el2.hasAttribute("selected") || el2.selected || el2.value === this.value); + if (selectedIndex !== -1) { + this.selectedIndex = selectedIndex; + return; + } + this.selectedIndex = 0; + } + /** + * Resets and fills the proxy to match the component's options. + * + * @internal + */ + setProxyOptions() { + if (this.proxy instanceof HTMLSelectElement && this.options) { + this.proxy.options.length = 0; + this.options.forEach((option) => { + const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null); + if (proxyOption) { + this.proxy.options.add(proxyOption); + } + }); + } + } + /** + * Handle keyboard interaction for the select. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + super.keydownHandler(e); + const key = e.key || e.key.charCodeAt(0); + switch (key) { + case keySpace: { + e.preventDefault(); + if (this.collapsible && this.typeAheadExpired) { + this.open = !this.open; + } + break; + } + case keyHome: + case keyEnd: { + e.preventDefault(); + break; + } + case keyEnter: { + e.preventDefault(); + this.open = !this.open; + break; + } + case keyEscape: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + break; + } + case keyTab: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + return true; + } + } + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + this.indexWhenOpened = this.selectedIndex; + } + return !(key === keyArrowDown || key === keyArrowUp); + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + this.addEventListener("contentchange", this.updateDisplayValue); + } + disconnectedCallback() { + this.removeEventListener("contentchange", this.updateDisplayValue); + super.disconnectedCallback(); + } + /** + * Updates the proxy's size property when the size attribute changes. + * + * @param prev - the previous size + * @param next - the current size + * + * @override + * @internal + */ + sizeChanged(prev, next) { + super.sizeChanged(prev, next); + if (this.proxy) { + this.proxy.size = next; + } + } + /** + * + * @internal + */ + updateDisplayValue() { + if (this.collapsible) { + Observable.notify(this, "displayValue"); + } + } + }; + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Select.prototype, "open", void 0); + __decorate([ + volatile + ], Select.prototype, "collapsible", null); + __decorate([ + observable + ], Select.prototype, "control", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Select.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Select.prototype, "position", void 0); + __decorate([ + observable + ], Select.prototype, "maxHeight", void 0); + DelegatesARIASelect = class { + }; + __decorate([ + observable + ], DelegatesARIASelect.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIASelect, DelegatesARIAListbox); + applyMixins(Select, StartEnd, DelegatesARIASelect); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js + var selectTemplate; + var init_select_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js"() { + init_esm(); + init_listbox(); + init_start_end(); + selectTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/index.js + var init_select2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/index.js"() { + init_select(); + init_select_options(); + init_select_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js + var init_skeleton_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js + var Skeleton; + var init_skeleton = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Skeleton = class extends FoundationElement { + constructor() { + super(...arguments); + this.shape = "rect"; + } + }; + __decorate([ + attr + ], Skeleton.prototype, "fill", void 0); + __decorate([ + attr + ], Skeleton.prototype, "shape", void 0); + __decorate([ + attr + ], Skeleton.prototype, "pattern", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Skeleton.prototype, "shimmer", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js + var init_skeleton2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js"() { + init_skeleton_template(); + init_skeleton(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js + var init_slider_label_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js + function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) { + let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition)); + if (direction === Direction.rtl) { + pct = 1 - pct; + } + return pct; + } + var init_slider_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js"() { + init_dist2(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js + var defaultConfig, SliderLabel; + var init_slider_label = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_slider_utilities(); + init_foundation_element(); + defaultConfig = { + min: 0, + max: 0, + direction: Direction.ltr, + orientation: Orientation.horizontal, + disabled: false + }; + SliderLabel = class extends FoundationElement { + constructor() { + super(...arguments); + this.hideMark = false; + this.sliderDirection = Direction.ltr; + this.getSliderConfiguration = () => { + if (!this.isSliderConfig(this.parentNode)) { + this.sliderDirection = defaultConfig.direction || Direction.ltr; + this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal; + this.sliderMaxPosition = defaultConfig.max; + this.sliderMinPosition = defaultConfig.min; + } else { + const parentSlider = this.parentNode; + const { min, max, direction, orientation, disabled } = parentSlider; + if (disabled !== void 0) { + this.disabled = disabled; + } + this.sliderDirection = direction || Direction.ltr; + this.sliderOrientation = orientation || Orientation.horizontal; + this.sliderMaxPosition = max; + this.sliderMinPosition = min; + } + }; + this.positionAsStyle = () => { + const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr; + const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition)); + let rightNum = Math.round((1 - pct) * 100); + let leftNum = Math.round(pct * 100); + if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) { + rightNum = 50; + leftNum = 50; + } + if (this.sliderOrientation === Orientation.horizontal) { + return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`; + } else { + return `top: ${leftNum}%; bottom: ${rightNum}%;`; + } + }; + } + positionChanged() { + this.positionStyle = this.positionAsStyle(); + } + /** + * @internal + */ + sliderOrientationChanged() { + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.getSliderConfiguration(); + this.positionStyle = this.positionAsStyle(); + this.notifier = Observable.getNotifier(this.parentNode); + this.notifier.subscribe(this, "orientation"); + this.notifier.subscribe(this, "direction"); + this.notifier.subscribe(this, "max"); + this.notifier.subscribe(this, "min"); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.notifier.unsubscribe(this, "orientation"); + this.notifier.unsubscribe(this, "direction"); + this.notifier.unsubscribe(this, "max"); + this.notifier.unsubscribe(this, "min"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "direction": + this.sliderDirection = source.direction; + break; + case "orientation": + this.sliderOrientation = source.orientation; + break; + case "max": + this.sliderMaxPosition = source.max; + break; + case "min": + this.sliderMinPosition = source.min; + break; + default: + break; + } + this.positionStyle = this.positionAsStyle(); + } + isSliderConfig(node) { + return node.max !== void 0 && node.min !== void 0; + } + }; + __decorate([ + observable + ], SliderLabel.prototype, "positionStyle", void 0); + __decorate([ + attr + ], SliderLabel.prototype, "position", void 0); + __decorate([ + attr({ attribute: "hide-mark", mode: "boolean" }) + ], SliderLabel.prototype, "hideMark", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], SliderLabel.prototype, "disabled", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderOrientation", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMinPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMaxPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js + var init_slider_label2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js"() { + init_slider_label_template(); + init_slider_label(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js + var init_slider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js + var _Slider, FormAssociatedSlider; + var init_slider_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Slider = class extends FoundationElement { + }; + FormAssociatedSlider = class extends FormAssociated(_Slider) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js + var SliderMode, Slider; + var init_slider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_slider_utilities(); + init_slider_form_associated(); + SliderMode = { + singleValue: "single-value" + }; + Slider = class extends FormAssociatedSlider { + constructor() { + super(...arguments); + this.direction = Direction.ltr; + this.isDragging = false; + this.trackWidth = 0; + this.trackMinWidth = 0; + this.trackHeight = 0; + this.trackLeft = 0; + this.trackMinHeight = 0; + this.valueTextFormatter = () => null; + this.min = 0; + this.max = 10; + this.step = 1; + this.orientation = Orientation.horizontal; + this.mode = SliderMode.singleValue; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + if (e.key === keyHome) { + e.preventDefault(); + this.value = `${this.min}`; + } else if (e.key === keyEnd) { + e.preventDefault(); + this.value = `${this.max}`; + } else if (!e.shiftKey) { + switch (e.key) { + case keyArrowRight: + case keyArrowUp: + e.preventDefault(); + this.increment(); + break; + case keyArrowLeft: + case keyArrowDown: + e.preventDefault(); + this.decrement(); + break; + } + } + }; + this.setupTrackConstraints = () => { + const clientRect = this.track.getBoundingClientRect(); + this.trackWidth = this.track.clientWidth; + this.trackMinWidth = this.track.clientLeft; + this.trackHeight = clientRect.bottom; + this.trackMinHeight = clientRect.top; + this.trackLeft = this.getBoundingClientRect().left; + if (this.trackWidth === 0) { + this.trackWidth = 1; + } + }; + this.setupListeners = (remove = false) => { + const eventAction = `${remove ? "remove" : "add"}EventListener`; + this[eventAction]("keydown", this.keypressHandler); + this[eventAction]("mousedown", this.handleMouseDown); + this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { + passive: true + }); + this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { + passive: true + }); + if (remove) { + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + } + }; + this.initialValue = ""; + this.handleThumbMouseDown = (event) => { + if (event) { + if (this.readOnly || this.disabled || event.defaultPrevented) { + return; + } + event.target.focus(); + } + const eventAction = `${event !== null ? "add" : "remove"}EventListener`; + window[eventAction]("mouseup", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchmove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchend", this.handleWindowMouseUp); + this.isDragging = event !== null; + }; + this.handleMouseMove = (e) => { + if (this.readOnly || this.disabled || e.defaultPrevented) { + return; + } + const sourceEvent = window.TouchEvent && e instanceof TouchEvent ? e.touches[0] : e; + const eventValue = this.orientation === Orientation.horizontal ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft : sourceEvent.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(eventValue)}`; + }; + this.calculateNewValue = (rawValue) => { + const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal ? this.trackMinWidth : this.trackMinHeight, this.orientation === Orientation.horizontal ? this.trackWidth : this.trackHeight, this.direction); + const newValue = (this.max - this.min) * newPosition + this.min; + return this.convertToConstrainedValue(newValue); + }; + this.handleWindowMouseUp = (event) => { + this.stopDragging(); + }; + this.stopDragging = () => { + this.isDragging = false; + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + }; + this.handleMouseDown = (e) => { + const eventAction = `${e !== null ? "add" : "remove"}EventListener`; + if (e === null || !this.disabled && !this.readOnly) { + window[eventAction]("mouseup", this.handleWindowMouseUp); + window.document[eventAction]("mouseleave", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove); + if (e) { + e.preventDefault(); + this.setupTrackConstraints(); + e.target.focus(); + const controlValue = this.orientation === Orientation.horizontal ? e.pageX - document.documentElement.scrollLeft - this.trackLeft : e.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(controlValue)}`; + } + } + }; + this.convertToConstrainedValue = (value) => { + if (isNaN(value)) { + value = this.min; + } + let constrainedValue = value - this.min; + const roundedConstrainedValue = Math.round(constrainedValue / this.step); + const remainderValue = constrainedValue - roundedConstrainedValue * (this.stepMultiplier * this.step) / this.stepMultiplier; + constrainedValue = remainderValue >= Number(this.step) / 2 ? constrainedValue - remainderValue + Number(this.step) : constrainedValue - remainderValue; + return constrainedValue + this.min; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * @internal + */ + valueChanged(previous, next) { + super.valueChanged(previous, next); + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + this.$emit("change"); + } + minChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.min = `${this.min}`; + } + this.validate(); + } + maxChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.max = `${this.max}`; + } + this.validate(); + } + stepChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.step = `${this.step}`; + } + this.updateStepMultiplier(); + this.validate(); + } + orientationChanged() { + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "range"); + this.direction = getDirection(this); + this.updateStepMultiplier(); + this.setupTrackConstraints(); + this.setupListeners(); + this.setupDefaultValue(); + this.setThumbPositionForOrientation(this.direction); + } + /** + * @internal + */ + disconnectedCallback() { + this.setupListeners(true); + } + /** + * Increment the value by the step + * + * @public + */ + increment() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step); + const incrementedVal = this.convertToConstrainedValue(newVal); + const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`; + this.value = incrementedValString; + } + /** + * Decrement the value by the step + * + * @public + */ + decrement() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step); + const decrementedVal = this.convertToConstrainedValue(newVal); + const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`; + this.value = decrementedValString; + } + /** + * Places the thumb based on the current value + * + * @public + * @param direction - writing mode + */ + setThumbPositionForOrientation(direction) { + const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction); + const percentage = (1 - newPct) * 100; + if (this.orientation === Orientation.horizontal) { + this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`; + } else { + this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`; + } + } + /** + * Update the step multiplier used to ensure rounding errors from steps that + * are not whole numbers + */ + updateStepMultiplier() { + const stepString = this.step + ""; + const decimalPlacesOfStep = !!(this.step % 1) ? stepString.length - stepString.indexOf(".") - 1 : 0; + this.stepMultiplier = Math.pow(10, decimalPlacesOfStep); + } + get midpoint() { + return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`; + } + setupDefaultValue() { + if (typeof this.value === "string") { + if (this.value.length === 0) { + this.initialValue = this.midpoint; + } else { + const value = parseFloat(this.value); + if (!Number.isNaN(value) && (value < this.min || value > this.max)) { + this.value = this.midpoint; + } + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Slider.prototype, "readOnly", void 0); + __decorate([ + observable + ], Slider.prototype, "direction", void 0); + __decorate([ + observable + ], Slider.prototype, "isDragging", void 0); + __decorate([ + observable + ], Slider.prototype, "position", void 0); + __decorate([ + observable + ], Slider.prototype, "trackWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "trackLeft", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "valueTextFormatter", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "step", void 0); + __decorate([ + attr + ], Slider.prototype, "orientation", void 0); + __decorate([ + attr + ], Slider.prototype, "mode", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js + var init_slider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js"() { + init_slider_template(); + init_slider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js + var init_switch_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js + var _Switch, FormAssociatedSwitch; + var init_switch_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Switch = class extends FoundationElement { + }; + FormAssociatedSwitch = class extends CheckableFormAssociated(_Switch) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js + var Switch; + var init_switch = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_switch_form_associated(); + Switch = class extends FormAssociatedSwitch { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + this.readOnly ? this.classList.add("readonly") : this.classList.remove("readonly"); + } + /** + * @internal + */ + checkedChanged(prev, next) { + super.checkedChanged(prev, next); + this.checked ? this.classList.add("checked") : this.classList.remove("checked"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Switch.prototype, "readOnly", void 0); + __decorate([ + observable + ], Switch.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js + var init_switch2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js"() { + init_switch_template(); + init_switch(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js + var tabPanelTemplate; + var init_tab_panel_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js"() { + init_esm(); + tabPanelTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js + var TabPanel; + var init_tab_panel = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js"() { + init_foundation_element(); + TabPanel = class extends FoundationElement { + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js + var init_tab_panel2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js"() { + init_tab_panel_template(); + init_tab_panel(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js + var tabTemplate; + var init_tab_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js"() { + init_esm(); + tabTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js + var Tab; + var init_tab = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Tab = class extends FoundationElement { + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tab.prototype, "disabled", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js + var init_tab2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js"() { + init_tab_template(); + init_tab(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js + var tabsTemplate; + var init_tabs_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js"() { + init_esm(); + init_start_end(); + tabsTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js + var TabsOrientation, Tabs; + var init_tabs = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TabsOrientation = { + vertical: "vertical", + horizontal: "horizontal" + }; + Tabs = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = TabsOrientation.horizontal; + this.activeindicator = true; + this.showActiveIndicator = true; + this.prevActiveTabIndex = 0; + this.activeTabIndex = 0; + this.ticking = false; + this.change = () => { + this.$emit("change", this.activetab); + }; + this.isDisabledElement = (el2) => { + return el2.getAttribute("aria-disabled") === "true"; + }; + this.isHiddenElement = (el2) => { + return el2.hasAttribute("hidden"); + }; + this.isFocusableElement = (el2) => { + return !this.isDisabledElement(el2) && !this.isHiddenElement(el2); + }; + this.setTabs = () => { + const gridHorizontalProperty = "gridColumn"; + const gridVerticalProperty = "gridRow"; + const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty; + this.activeTabIndex = this.getActiveIndex(); + this.showActiveIndicator = false; + this.tabs.forEach((tab, index) => { + if (tab.slot === "tab") { + const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab); + if (this.activeindicator && this.isFocusableElement(tab)) { + this.showActiveIndicator = true; + } + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tab.setAttribute("id", tabId); + tab.setAttribute("aria-selected", isActiveTab ? "true" : "false"); + tab.setAttribute("aria-controls", tabpanelId); + tab.addEventListener("click", this.handleTabClick); + tab.addEventListener("keydown", this.handleTabKeyDown); + tab.setAttribute("tabindex", isActiveTab ? "0" : "-1"); + if (isActiveTab) { + this.activetab = tab; + this.activeid = tabId; + } + } + tab.style[gridHorizontalProperty] = ""; + tab.style[gridVerticalProperty] = ""; + tab.style[gridProperty] = `${index + 1}`; + !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical"); + }); + }; + this.setTabPanels = () => { + this.tabpanels.forEach((tabpanel, index) => { + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tabpanel.setAttribute("id", tabpanelId); + tabpanel.setAttribute("aria-labelledby", tabId); + this.activeTabIndex !== index ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden"); + }); + }; + this.handleTabClick = (event) => { + const selectedTab = event.currentTarget; + if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) { + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = this.tabs.indexOf(selectedTab); + this.setComponent(); + } + }; + this.handleTabKeyDown = (event) => { + if (this.isHorizontal()) { + switch (event.key) { + case keyArrowLeft: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowRight: + event.preventDefault(); + this.adjustForward(event); + break; + } + } else { + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowDown: + event.preventDefault(); + this.adjustForward(event); + break; + } + } + switch (event.key) { + case keyHome: + event.preventDefault(); + this.adjust(-this.activeTabIndex); + break; + case keyEnd: + event.preventDefault(); + this.adjust(this.tabs.length - this.activeTabIndex - 1); + break; + } + }; + this.adjustForward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) + 1 : 1; + if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (this.activetab && index === group.indexOf(this.activetab)) { + break; + } else if (index + 1 >= group.length) { + index = 0; + } else { + index += 1; + } + } + }; + this.adjustBackward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + while (index >= 0 && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.moveToTabByIndex = (group, index) => { + const tab = group[index]; + this.activetab = tab; + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = index; + tab.focus(); + this.setComponent(); + }; + } + /** + * @internal + */ + orientationChanged() { + if (this.$fastController.isConnected) { + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + activeidChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabsChanged() { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabpanelsChanged() { + if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + getActiveIndex() { + const id = this.activeid; + if (id !== void 0) { + return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid); + } else { + return 0; + } + } + getTabIds() { + return this.tabs.map((tab) => { + var _a; + return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`; + }); + } + getTabPanelIds() { + return this.tabpanels.map((tabPanel) => { + var _a; + return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`; + }); + } + setComponent() { + if (this.activeTabIndex !== this.prevActiveTabIndex) { + this.activeid = this.tabIds[this.activeTabIndex]; + this.focusTab(); + this.change(); + } + } + isHorizontal() { + return this.orientation === TabsOrientation.horizontal; + } + handleActiveIndicatorPosition() { + if (this.showActiveIndicator && this.activeindicator && this.activeTabIndex !== this.prevActiveTabIndex) { + if (this.ticking) { + this.ticking = false; + } else { + this.ticking = true; + this.animateActiveIndicator(); + } + } + } + animateActiveIndicator() { + this.ticking = true; + const gridProperty = this.isHorizontal() ? "gridColumn" : "gridRow"; + const translateProperty = this.isHorizontal() ? "translateX" : "translateY"; + const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop"; + const prev = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + const next = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const dif = next - prev; + this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; + this.activeIndicatorRef.classList.add("activeIndicatorTransition"); + this.activeIndicatorRef.addEventListener("transitionend", () => { + this.ticking = false; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`; + this.activeIndicatorRef.classList.remove("activeIndicatorTransition"); + }); + } + /** + * The adjust method for FASTTabs + * @public + * @remarks + * This method allows the active index to be adjusted by numerical increments + */ + adjust(adjustment) { + const focusableTabs = this.tabs.filter((t) => this.isFocusableElement(t)); + const currentActiveTabIndex = focusableTabs.indexOf(this.activetab); + const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment); + const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]); + if (nextIndex > -1) { + this.moveToTabByIndex(this.tabs, nextIndex); + } + } + focusTab() { + this.tabs[this.activeTabIndex].focus(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.activeTabIndex = this.getActiveIndex(); + } + }; + __decorate([ + attr + ], Tabs.prototype, "orientation", void 0); + __decorate([ + attr + ], Tabs.prototype, "activeid", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabs", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabpanels", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Tabs.prototype, "activeindicator", void 0); + __decorate([ + observable + ], Tabs.prototype, "activeIndicatorRef", void 0); + __decorate([ + observable + ], Tabs.prototype, "showActiveIndicator", void 0); + applyMixins(Tabs, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js + var init_tabs2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js"() { + init_tabs_template(); + init_tabs(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js + var _TextArea, FormAssociatedTextArea; + var init_text_area_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextArea = class extends FoundationElement { + }; + FormAssociatedTextArea = class extends FormAssociated(_TextArea) { + constructor() { + super(...arguments); + this.proxy = document.createElement("textarea"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js + var TextAreaResize; + var init_text_area_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js"() { + TextAreaResize = { + /** + * No resize. + */ + none: "none", + /** + * Resize vertically and horizontally. + */ + both: "both", + /** + * Resize horizontally. + */ + horizontal: "horizontal", + /** + * Resize vertically. + */ + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js + var TextArea; + var init_text_area = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js"() { + init_tslib_es6(); + init_esm(); + init_text_field(); + init_apply_mixins(); + init_text_area_form_associated(); + init_text_area_options(); + TextArea = class extends FormAssociatedTextArea { + constructor() { + super(...arguments); + this.resize = TextAreaResize.none; + this.cols = 20; + this.handleTextInput = () => { + this.value = this.control.value; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.readOnly = this.readOnly; + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.autofocus = this.autofocus; + } + } + listChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.setAttribute("list", this.list); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.maxLength = this.maxlength; + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.minLength = this.minlength; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * Selects all the text in the text area + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "readOnly", void 0); + __decorate([ + attr + ], TextArea.prototype, "resize", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], TextArea.prototype, "formId", void 0); + __decorate([ + attr + ], TextArea.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "minlength", void 0); + __decorate([ + attr + ], TextArea.prototype, "name", void 0); + __decorate([ + attr + ], TextArea.prototype, "placeholder", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "cols", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "rows", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextArea.prototype, "defaultSlottedNodes", void 0); + applyMixins(TextArea, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js + var textAreaTemplate; + var init_text_area_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js"() { + init_esm(); + init_text_area(); + textAreaTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js + var init_text_area2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js"() { + init_text_area_template(); + init_text_area(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js + var textFieldTemplate; + var init_text_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js"() { + init_esm(); + init_start_end(); + init_whitespace_filter(); + textFieldTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js + var init_text_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js"() { + init_text_field_template(); + init_text_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js + var init_toolbar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js + function getRootActiveElement(element) { + const rootNode = element.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.activeElement; + } + return document.activeElement; + } + var init_root_active_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js + var ToolbarArrowKeyMap, Toolbar, DelegatesARIAToolbar; + var init_toolbar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + init_direction(); + init_root_active_element(); + ToolbarArrowKeyMap = Object.freeze({ + [ArrowKeys.ArrowUp]: { + [Orientation.vertical]: -1 + }, + [ArrowKeys.ArrowDown]: { + [Orientation.vertical]: 1 + }, + [ArrowKeys.ArrowLeft]: { + [Orientation.horizontal]: { + [Direction.ltr]: -1, + [Direction.rtl]: 1 + } + }, + [ArrowKeys.ArrowRight]: { + [Orientation.horizontal]: { + [Direction.ltr]: 1, + [Direction.rtl]: -1 + } + } + }); + Toolbar = class _Toolbar extends FoundationElement { + constructor() { + super(...arguments); + this._activeIndex = 0; + this.direction = Direction.ltr; + this.orientation = Orientation.horizontal; + } + /** + * The index of the currently focused element, clamped between 0 and the last element. + * + * @internal + */ + get activeIndex() { + Observable.track(this, "activeIndex"); + return this._activeIndex; + } + set activeIndex(value) { + if (this.$fastController.isConnected) { + this._activeIndex = limit(0, this.focusableElements.length - 1, value); + Observable.notify(this, "activeIndex"); + } + } + slottedItemsChanged() { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * Set the activeIndex when a focusable element in the toolbar is clicked. + * + * @internal + */ + mouseDownHandler(e) { + var _a; + const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.findIndex((x) => x.contains(e.target)); + if (activeIndex > -1 && this.activeIndex !== activeIndex) { + this.setFocusedElement(activeIndex); + } + return true; + } + childItemsChanged(prev, next) { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + } + /** + * When the toolbar receives focus, set the currently active element as focused. + * + * @internal + */ + focusinHandler(e) { + const relatedTarget = e.relatedTarget; + if (!relatedTarget || this.contains(relatedTarget)) { + return; + } + this.setFocusedElement(); + } + /** + * Determines a value that can be used to iterate a list with the arrow keys. + * + * @param this - An element with an orientation and direction + * @param key - The event key value + * @internal + */ + getDirectionalIncrementer(key) { + var _a, _b, _c, _d, _e; + return (_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0; + } + /** + * Handle keyboard events for the toolbar. + * + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) { + return true; + } + const incrementer = this.getDirectionalIncrementer(key); + if (!incrementer) { + return !e.target.closest("[role=radiogroup]"); + } + const nextIndex = this.activeIndex + incrementer; + if (this.focusableElements[nextIndex]) { + e.preventDefault(); + } + this.setFocusedElement(nextIndex); + return true; + } + /** + * get all the slotted elements + * @internal + */ + get allSlottedItems() { + return [ + ...this.start.assignedElements(), + ...this.slottedItems, + ...this.end.assignedElements() + ]; + } + /** + * Prepare the slotted elements which can be focusable. + * + * @internal + */ + reduceFocusableElements() { + var _a; + const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex]; + this.focusableElements = this.allSlottedItems.reduce(_Toolbar.reduceFocusableItems, []); + const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement); + this.activeIndex = Math.max(0, adjustedActiveIndex); + this.setFocusableElements(); + } + /** + * Set the activeIndex and focus the corresponding control. + * + * @param activeIndex - The new index to set + * @internal + */ + setFocusedElement(activeIndex = this.activeIndex) { + this.activeIndex = activeIndex; + this.setFocusableElements(); + if (this.focusableElements[this.activeIndex] && // Don't focus the toolbar element if some event handlers moved + // the focus on another element in the page. + this.contains(getRootActiveElement(this))) { + this.focusableElements[this.activeIndex].focus(); + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceFocusableItems(elements2, element) { + var _a, _b, _c, _d; + const isRoleRadio = element.getAttribute("role") === "radio"; + const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus; + const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some((x) => isFocusable(x)); + if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Toolbar.reduceFocusableItems, [])); + } + return elements2; + } + /** + * @internal + */ + setFocusableElements() { + if (this.$fastController.isConnected && this.focusableElements.length > 0) { + this.focusableElements.forEach((element, index) => { + element.tabIndex = this.activeIndex === index ? 0 : -1; + }); + } + } + }; + __decorate([ + observable + ], Toolbar.prototype, "direction", void 0); + __decorate([ + attr + ], Toolbar.prototype, "orientation", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedItems", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedLabel", void 0); + __decorate([ + observable + ], Toolbar.prototype, "childItems", void 0); + DelegatesARIAToolbar = class { + }; + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], DelegatesARIAToolbar.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], DelegatesARIAToolbar.prototype, "ariaLabel", void 0); + applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties); + applyMixins(Toolbar, StartEnd, DelegatesARIAToolbar); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js + var init_toolbar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js"() { + init_toolbar_template(); + init_toolbar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js + var init_tooltip_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js + var TooltipPosition; + var init_tooltip_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js"() { + TooltipPosition = { + /** + * The tooltip is positioned above the element + */ + top: "top", + /** + * The tooltip is positioned to the right of the element + */ + right: "right", + /** + * The tooltip is positioned below the element + */ + bottom: "bottom", + /** + * The tooltip is positioned to the left of the element + */ + left: "left", + /** + * The tooltip is positioned before the element + */ + start: "start", + /** + * The tooltip is positioned after the element + */ + end: "end", + /** + * The tooltip is positioned above the element and to the left + */ + topLeft: "top-left", + /** + * The tooltip is positioned above the element and to the right + */ + topRight: "top-right", + /** + * The tooltip is positioned below the element and to the left + */ + bottomLeft: "bottom-left", + /** + * The tooltip is positioned below the element and to the right + */ + bottomRight: "bottom-right", + /** + * The tooltip is positioned above the element and to the left + */ + topStart: "top-start", + /** + * The tooltip is positioned above the element and to the right + */ + topEnd: "top-end", + /** + * The tooltip is positioned below the element and to the left + */ + bottomStart: "bottom-start", + /** + * The tooltip is positioned below the element and to the right + */ + bottomEnd: "bottom-end" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js + var Tooltip; + var init_tooltip = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + init_tooltip_options(); + Tooltip = class extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.delay = 300; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.horizontalInset = "false"; + this.verticalInset = "false"; + this.horizontalScaling = "content"; + this.verticalScaling = "content"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = void 0; + this.tooltipVisible = false; + this.currentDirection = Direction.ltr; + this.showDelayTimer = null; + this.hideDelayTimer = null; + this.isAnchorHoveredFocused = false; + this.isRegionHovered = false; + this.handlePositionChange = (ev) => { + this.classList.toggle("top", this.region.verticalPosition === "start"); + this.classList.toggle("bottom", this.region.verticalPosition === "end"); + this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd"); + this.classList.toggle("center-vertical", this.region.verticalPosition === "center"); + this.classList.toggle("left", this.region.horizontalPosition === "start"); + this.classList.toggle("right", this.region.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd"); + this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center"); + }; + this.handleRegionMouseOver = (ev) => { + this.isRegionHovered = true; + }; + this.handleRegionMouseOut = (ev) => { + this.isRegionHovered = false; + this.startHideDelayTimer(); + }; + this.handleAnchorMouseOver = (ev) => { + if (this.tooltipVisible) { + this.isAnchorHoveredFocused = true; + return; + } + this.startShowDelayTimer(); + }; + this.handleAnchorMouseOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.handleAnchorFocusIn = (ev) => { + this.startShowDelayTimer(); + }; + this.handleAnchorFocusOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.startHideDelayTimer = () => { + this.clearHideDelayTimer(); + if (!this.tooltipVisible) { + return; + } + this.hideDelayTimer = window.setTimeout(() => { + this.updateTooltipVisibility(); + }, 60); + }; + this.clearHideDelayTimer = () => { + if (this.hideDelayTimer !== null) { + clearTimeout(this.hideDelayTimer); + this.hideDelayTimer = null; + } + }; + this.startShowDelayTimer = () => { + if (this.isAnchorHoveredFocused) { + return; + } + if (this.delay > 1) { + if (this.showDelayTimer === null) + this.showDelayTimer = window.setTimeout(() => { + this.startHover(); + }, this.delay); + return; + } + this.startHover(); + }; + this.startHover = () => { + this.isAnchorHoveredFocused = true; + this.updateTooltipVisibility(); + }; + this.clearShowDelayTimer = () => { + if (this.showDelayTimer !== null) { + clearTimeout(this.showDelayTimer); + this.showDelayTimer = null; + } + }; + this.getAnchor = () => { + const rootNode = this.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.getElementById(this.anchor); + } + return document.getElementById(this.anchor); + }; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && this.tooltipVisible) { + switch (e.key) { + case keyEscape: + this.isAnchorHoveredFocused = false; + this.updateTooltipVisibility(); + this.$emit("dismiss"); + break; + } + } + }; + this.updateTooltipVisibility = () => { + if (this.visible === false) { + this.hideTooltip(); + } else if (this.visible === true) { + this.showTooltip(); + return; + } else { + if (this.isAnchorHoveredFocused || this.isRegionHovered) { + this.showTooltip(); + return; + } + this.hideTooltip(); + } + }; + this.showTooltip = () => { + if (this.tooltipVisible) { + return; + } + this.currentDirection = getDirection(this); + this.tooltipVisible = true; + document.addEventListener("keydown", this.handleDocumentKeydown); + DOM.queueUpdate(this.setRegionProps); + }; + this.hideTooltip = () => { + if (!this.tooltipVisible) { + return; + } + this.clearHideDelayTimer(); + if (this.region !== null && this.region !== void 0) { + this.region.removeEventListener("positionchange", this.handlePositionChange); + this.region.viewportElement = null; + this.region.anchorElement = null; + this.region.removeEventListener("mouseover", this.handleRegionMouseOver); + this.region.removeEventListener("mouseout", this.handleRegionMouseOut); + } + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.tooltipVisible = false; + }; + this.setRegionProps = () => { + if (!this.tooltipVisible) { + return; + } + this.region.viewportElement = this.viewportElement; + this.region.anchorElement = this.anchorElement; + this.region.addEventListener("positionchange", this.handlePositionChange); + this.region.addEventListener("mouseover", this.handleRegionMouseOver, { + passive: true + }); + this.region.addEventListener("mouseout", this.handleRegionMouseOut, { + passive: true + }); + }; + } + visibleChanged() { + if (this.$fastController.isConnected) { + this.updateTooltipVisibility(); + this.updateLayout(); + } + } + anchorChanged() { + if (this.$fastController.isConnected) { + this.anchorElement = this.getAnchor(); + } + } + positionChanged() { + if (this.$fastController.isConnected) { + this.updateLayout(); + } + } + anchorElementChanged(oldValue) { + if (this.$fastController.isConnected) { + if (oldValue !== null && oldValue !== void 0) { + oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver); + oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut); + oldValue.removeEventListener("focusin", this.handleAnchorFocusIn); + oldValue.removeEventListener("focusout", this.handleAnchorFocusOut); + } + if (this.anchorElement !== null && this.anchorElement !== void 0) { + this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true }); + this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true }); + this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, { + passive: true + }); + this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true }); + const anchorId = this.anchorElement.id; + if (this.anchorElement.parentElement !== null) { + this.anchorElement.parentElement.querySelectorAll(":hover").forEach((element) => { + if (element.id === anchorId) { + this.startShowDelayTimer(); + } + }); + } + } + if (this.region !== null && this.region !== void 0 && this.tooltipVisible) { + this.region.anchorElement = this.anchorElement; + } + this.updateLayout(); + } + } + viewportElementChanged() { + if (this.region !== null && this.region !== void 0) { + this.region.viewportElement = this.viewportElement; + } + this.updateLayout(); + } + connectedCallback() { + super.connectedCallback(); + this.anchorElement = this.getAnchor(); + this.updateTooltipVisibility(); + } + disconnectedCallback() { + this.hideTooltip(); + this.clearShowDelayTimer(); + this.clearHideDelayTimer(); + super.disconnectedCallback(); + } + /** + * updated the properties being passed to the anchored region + */ + updateLayout() { + this.verticalPositioningMode = "locktodefault"; + this.horizontalPositioningMode = "locktodefault"; + switch (this.position) { + case TooltipPosition.top: + case TooltipPosition.bottom: + this.verticalDefaultPosition = this.position; + this.horizontalDefaultPosition = "center"; + break; + case TooltipPosition.right: + case TooltipPosition.left: + case TooltipPosition.start: + case TooltipPosition.end: + this.verticalDefaultPosition = "center"; + this.horizontalDefaultPosition = this.position; + break; + case TooltipPosition.topLeft: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.topRight: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.bottomLeft: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.bottomRight: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.topStart: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.topEnd: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "end"; + break; + case TooltipPosition.bottomStart: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.bottomEnd: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "end"; + break; + default: + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = "center"; + break; + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tooltip.prototype, "visible", void 0); + __decorate([ + attr + ], Tooltip.prototype, "anchor", void 0); + __decorate([ + attr + ], Tooltip.prototype, "delay", void 0); + __decorate([ + attr + ], Tooltip.prototype, "position", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], Tooltip.prototype, "autoUpdateMode", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock" }) + ], Tooltip.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock" }) + ], Tooltip.prototype, "verticalViewportLock", void 0); + __decorate([ + observable + ], Tooltip.prototype, "anchorElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "viewportElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "tooltipVisible", void 0); + __decorate([ + observable + ], Tooltip.prototype, "currentDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js + var init_tooltip2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js"() { + init_tooltip_template(); + init_tooltip(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js + var init_tree_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js + function isTreeItemElement(el2) { + return isHTMLElement(el2) && el2.getAttribute("role") === "treeitem"; + } + var TreeItem; + var init_tree_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TreeItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.expanded = false; + this.focusable = false; + this.isNestedItem = () => { + return isTreeItemElement(this.parentElement); + }; + this.handleExpandCollapseButtonClick = (e) => { + if (!this.disabled && !e.defaultPrevented) { + this.expanded = !this.expanded; + } + }; + this.handleFocus = (e) => { + this.setAttribute("tabindex", "0"); + }; + this.handleBlur = (e) => { + this.setAttribute("tabindex", "-1"); + }; + } + expandedChanged() { + if (this.$fastController.isConnected) { + this.$emit("expanded-change", this); + } + } + selectedChanged() { + if (this.$fastController.isConnected) { + this.$emit("selected-change", this); + } + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.items.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = true; + } + }); + } + } + /** + * Places document focus on a tree item + * + * @public + * @param el - the element to focus + */ + static focusItem(el2) { + el2.focusable = true; + el2.focus(); + } + /** + * Gets number of children + * + * @internal + */ + childItemLength() { + const treeChildren = this.childItems.filter((item) => { + return isTreeItemElement(item); + }); + return treeChildren ? treeChildren.length : 0; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "expanded", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "selected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "disabled", void 0); + __decorate([ + observable + ], TreeItem.prototype, "focusable", void 0); + __decorate([ + observable + ], TreeItem.prototype, "childItems", void 0); + __decorate([ + observable + ], TreeItem.prototype, "items", void 0); + __decorate([ + observable + ], TreeItem.prototype, "nested", void 0); + __decorate([ + observable + ], TreeItem.prototype, "renderCollapsedChildren", void 0); + applyMixins(TreeItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js + var init_tree_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js"() { + init_tree_item_template(); + init_tree_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js + var init_tree_view_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js + var TreeView; + var init_tree_view = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_tree_item(); + init_foundation_element(); + TreeView = class extends FoundationElement { + constructor() { + super(...arguments); + this.currentFocused = null; + this.handleFocus = (e) => { + if (this.slottedTreeItems.length < 1) { + return; + } + if (e.target === this) { + if (this.currentFocused === null) { + this.currentFocused = this.getValidFocusableItem(); + } + if (this.currentFocused !== null) { + TreeItem.focusItem(this.currentFocused); + } + return; + } + if (this.contains(e.target)) { + this.setAttribute("tabindex", "-1"); + this.currentFocused = e.target; + } + }; + this.handleBlur = (e) => { + if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) { + this.setAttribute("tabindex", "0"); + } + }; + this.handleKeyDown = (e) => { + if (e.defaultPrevented) { + return; + } + if (this.slottedTreeItems.length < 1) { + return true; + } + const treeItems = this.getVisibleNodes(); + switch (e.key) { + case keyHome: + if (treeItems.length) { + TreeItem.focusItem(treeItems[0]); + } + return; + case keyEnd: + if (treeItems.length) { + TreeItem.focusItem(treeItems[treeItems.length - 1]); + } + return; + case keyArrowLeft: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) { + item.expanded = false; + } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) { + TreeItem.focusItem(item.parentElement); + } + } + return false; + case keyArrowRight: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) { + item.expanded = true; + } else if (item instanceof TreeItem && item.childItemLength() > 0) { + this.focusNextNode(1, e.target); + } + } + return; + case keyArrowDown: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(1, e.target); + } + return; + case keyArrowUp: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(-1, e.target); + } + return; + case keyEnter: + this.handleClick(e); + return; + } + return true; + }; + this.handleSelectedChange = (e) => { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (item.selected) { + if (this.currentSelected && this.currentSelected !== item) { + this.currentSelected.selected = false; + } + this.currentSelected = item; + } else if (!item.selected && this.currentSelected === item) { + this.currentSelected = null; + } + return; + }; + this.setItems = () => { + const selectedItem = this.treeView.querySelector("[aria-selected='true']"); + this.currentSelected = selectedItem; + if (this.currentFocused === null || !this.contains(this.currentFocused)) { + this.currentFocused = this.getValidFocusableItem(); + } + this.nested = this.checkForNestedItems(); + const treeItems = this.getVisibleNodes(); + treeItems.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = this.nested; + } + }); + }; + this.isFocusableElement = (el2) => { + return isTreeItemElement(el2); + }; + this.isSelectedElement = (el2) => { + return el2.selected; + }; + } + slottedTreeItemsChanged() { + if (this.$fastController.isConnected) { + this.setItems(); + } + } + connectedCallback() { + super.connectedCallback(); + this.setAttribute("tabindex", "0"); + DOM.queueUpdate(() => { + this.setItems(); + }); + } + /** + * Handles click events bubbling up + * + * @internal + */ + handleClick(e) { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (!item.disabled) { + item.selected = !item.selected; + } + return; + } + /** + * Move focus to a tree item based on its offset from the provided item + */ + focusNextNode(delta, item) { + const visibleNodes = this.getVisibleNodes(); + if (!visibleNodes) { + return; + } + const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta]; + if (isHTMLElement(focusItem)) { + TreeItem.focusItem(focusItem); + } + } + /** + * checks if there are any nested tree items + */ + getValidFocusableItem() { + const treeItems = this.getVisibleNodes(); + let focusIndex = treeItems.findIndex(this.isSelectedElement); + if (focusIndex === -1) { + focusIndex = treeItems.findIndex(this.isFocusableElement); + } + if (focusIndex !== -1) { + return treeItems[focusIndex]; + } + return null; + } + /** + * checks if there are any nested tree items + */ + checkForNestedItems() { + return this.slottedTreeItems.some((node) => { + return isTreeItemElement(node) && node.querySelector("[role='treeitem']"); + }); + } + getVisibleNodes() { + return getDisplayedNodes(this, "[role='treeitem']") || []; + } + }; + __decorate([ + attr({ attribute: "render-collapsed-nodes" }) + ], TreeView.prototype, "renderCollapsedNodes", void 0); + __decorate([ + observable + ], TreeView.prototype, "currentSelected", void 0); + __decorate([ + observable + ], TreeView.prototype, "slottedTreeItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js + var init_tree_view2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js"() { + init_tree_view_template(); + init_tree_view(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js + var MatchMediaBehavior, MatchMediaStyleSheetBehavior, forcedColorsStylesheetBehavior, darkModeStylesheetBehavior, lightModeStylesheetBehavior; + var init_match_media_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js"() { + MatchMediaBehavior = class { + /** + * + * @param query - The media query to operate from. + */ + constructor(query) { + this.listenerCache = /* @__PURE__ */ new WeakMap(); + this.query = query; + } + /** + * Binds the behavior to the element. + * @param source - The element for which the behavior is bound. + */ + bind(source) { + const { query } = this; + const listener = this.constructListener(source); + listener.bind(query)(); + query.addListener(listener); + this.listenerCache.set(source, listener); + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + */ + unbind(source) { + const listener = this.listenerCache.get(source); + if (listener) { + this.query.removeListener(listener); + this.listenerCache.delete(source); + } + } + }; + MatchMediaStyleSheetBehavior = class _MatchMediaStyleSheetBehavior extends MatchMediaBehavior { + /** + * Constructs a {@link MatchMediaStyleSheetBehavior} instance. + * @param query - The media query to operate from. + * @param styles - The styles to coordinate with the query. + */ + constructor(query, styles) { + super(query); + this.styles = styles; + } + /** + * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for + * a provided query. + * @param query - The media query to operate from. + * + * @public + * @example + * + * ```ts + * import { css } from "@microsoft/fast-element"; + * import { MatchMediaStyleSheetBehavior } from "@microsoft/fast-foundation"; + * + * const landscapeBehavior = MatchMediaStyleSheetBehavior.with( + * window.matchMedia("(orientation: landscape)") + * ); + * const styles = css` + * :host { + * width: 200px; + * height: 400px; + * } + * ` + * .withBehaviors(landscapeBehavior(css` + * :host { + * width: 400px; + * height: 200px; + * } + * `)) + * ``` + */ + static with(query) { + return (styles) => { + return new _MatchMediaStyleSheetBehavior(query, styles); + }; + } + /** + * Constructs a match-media listener for a provided element. + * @param source - the element for which to attach or detach styles. + * @internal + */ + constructListener(source) { + let attached = false; + const styles = this.styles; + return function listener() { + const { matches: matches2 } = this; + if (matches2 && !attached) { + source.$fastController.addStyles(styles); + attached = matches2; + } else if (!matches2 && attached) { + source.$fastController.removeStyles(styles); + attached = matches2; + } + }; + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + * @internal + */ + unbind(source) { + super.unbind(source); + source.$fastController.removeStyles(this.styles); + } + }; + forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)")); + darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)")); + lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)")); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js + var init_property_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js + var disabledCursor; + var init_disabled = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js"() { + disabledCursor = "not-allowed"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js + function display(displayValue) { + return `${hidden}:host{display:${displayValue}}`; + } + var hidden; + var init_display = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js"() { + hidden = `:host([hidden]){display:none}`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js + var focusVisible; + var init_focus = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js"() { + init_dist2(); + focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js + var init_style = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js"() { + init_disabled(); + init_display(); + init_focus(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js + var init_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js"() { + init_apply_mixins(); + init_composed_parent(); + init_match_media_stylesheet_behavior(); + init_property_stylesheet_behavior(); + init_style(); + init_direction(); + init_whitespace_filter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/index.js + var init_esm2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/index.js"() { + init_accordion_item2(); + init_accordion2(); + init_anchor2(); + init_anchored_region2(); + init_avatar2(); + init_badge2(); + init_breadcrumb_item2(); + init_breadcrumb2(); + init_button2(); + init_calendar2(); + init_card2(); + init_checkbox2(); + init_combobox2(); + init_data_grid2(); + init_design_system2(); + init_design_token(); + init_di2(); + init_dialog2(); + init_disclosure2(); + init_divider2(); + init_flipper2(); + init_form_associated2(); + init_foundation_element2(); + init_listbox_option2(); + init_listbox2(); + init_picker2(); + init_menu_item2(); + init_menu2(); + init_number_field2(); + init_patterns(); + init_progress_ring(); + init_progress(); + init_radio_group2(); + init_radio2(); + init_horizontal_scroll2(); + init_search2(); + init_select2(); + init_skeleton2(); + init_slider_label2(); + init_slider2(); + init_switch2(); + init_tab_panel2(); + init_tab2(); + init_tabs2(); + init_text_area2(); + init_text_field2(); + init_toolbar2(); + init_tooltip2(); + init_tree_item2(); + init_tree_view2(); + init_utilities(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js + function provideVSCodeDesignSystem(element) { + return DesignSystem.getOrCreate(element).withPrefix("vscode"); + } + var init_vscode_design_system = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js"() { + init_esm2(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js + function initThemeChangeListener(tokenMappings2) { + window.addEventListener("load", () => { + const observer = new MutationObserver(() => { + applyCurrentTheme(tokenMappings2); + }); + observer.observe(document.body, { + attributes: true, + attributeFilter: ["class"] + }); + applyCurrentTheme(tokenMappings2); + }); + } + function applyCurrentTheme(tokenMappings2) { + const styles = getComputedStyle(document.body); + const body = document.querySelector("body"); + if (body) { + const themeKind = body.getAttribute("data-vscode-theme-kind"); + for (const [vscodeTokenName, toolkitToken] of tokenMappings2) { + let value = styles.getPropertyValue(vscodeTokenName).toString(); + if (themeKind === "vscode-high-contrast") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + value = "transparent"; + } + if (toolkitToken.name === "button-icon-hover-background") { + value = "transparent"; + } + } else if (themeKind === "vscode-high-contrast-light") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + switch (toolkitToken.name) { + case "button-primary-hover-background": + value = "#0F4A85"; + break; + case "button-secondary-hover-background": + value = "transparent"; + break; + case "button-icon-hover-background": + value = "transparent"; + break; + } + } + } else { + if (toolkitToken.name === "contrast-active-border") { + value = "transparent"; + } + } + toolkitToken.setValueFor(body, value); + } + } + } + var init_applyTheme = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js + function create2(name, vscodeThemeVar) { + const designToken = DesignToken.create(name); + if (vscodeThemeVar) { + if (vscodeThemeVar.includes("--fake-vscode-token")) { + const uniqueId2 = "id" + Math.random().toString(16).slice(2); + vscodeThemeVar = `${vscodeThemeVar}-${uniqueId2}`; + } + tokenMappings.set(vscodeThemeVar, designToken); + } + if (!isThemeListenerInitialized) { + initThemeChangeListener(tokenMappings); + isThemeListenerInitialized = true; + } + return designToken; + } + var tokenMappings, isThemeListenerInitialized; + var init_create = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js"() { + init_esm2(); + init_applyTheme(); + tokenMappings = /* @__PURE__ */ new Map(); + isThemeListenerInitialized = false; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js + var background, borderWidth, contrastActiveBorder, contrastBorder, cornerRadius, cornerRadiusRound, designUnit, disabledOpacity, focusBorder, fontFamily, fontWeight, foreground, inputHeight, inputMinWidth, typeRampBaseFontSize, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1LineHeight, scrollbarWidth, scrollbarHeight, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, badgeBackground, badgeForeground, buttonBorder, buttonIconBackground, buttonIconCornerRadius, buttonIconFocusBorderOffset, buttonIconHoverBackground, buttonIconPadding, buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonPaddingHorizontal, buttonPaddingVertical, checkboxBackground, checkboxBorder, checkboxCornerRadius, checkboxForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, dividerBackground, dropdownBackground, dropdownBorder, dropdownForeground, dropdownListMaxHeight, inputBackground, inputForeground, inputPlaceholderForeground, linkActiveForeground, linkForeground, progressBackground, panelTabActiveBorder, panelTabActiveForeground, panelTabForeground, panelViewBackground, panelViewBorder, tagCornerRadius; + var init_design_tokens = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js"() { + init_create(); + background = create2("background", "--vscode-editor-background").withDefault("#1e1e1e"); + borderWidth = create2("border-width").withDefault(1); + contrastActiveBorder = create2("contrast-active-border", "--vscode-contrastActiveBorder").withDefault("#f38518"); + contrastBorder = create2("contrast-border", "--vscode-contrastBorder").withDefault("#6fc3df"); + cornerRadius = create2("corner-radius").withDefault(0); + cornerRadiusRound = create2("corner-radius-round").withDefault(2); + designUnit = create2("design-unit").withDefault(4); + disabledOpacity = create2("disabled-opacity").withDefault(0.4); + focusBorder = create2("focus-border", "--vscode-focusBorder").withDefault("#007fd4"); + fontFamily = create2("font-family", "--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"); + fontWeight = create2("font-weight", "--vscode-font-weight").withDefault("400"); + foreground = create2("foreground", "--vscode-foreground").withDefault("#cccccc"); + inputHeight = create2("input-height").withDefault("26"); + inputMinWidth = create2("input-min-width").withDefault("100px"); + typeRampBaseFontSize = create2("type-ramp-base-font-size", "--vscode-font-size").withDefault("13px"); + typeRampBaseLineHeight = create2("type-ramp-base-line-height").withDefault("normal"); + typeRampMinus1FontSize = create2("type-ramp-minus1-font-size").withDefault("11px"); + typeRampMinus1LineHeight = create2("type-ramp-minus1-line-height").withDefault("16px"); + typeRampMinus2FontSize = create2("type-ramp-minus2-font-size").withDefault("9px"); + typeRampMinus2LineHeight = create2("type-ramp-minus2-line-height").withDefault("16px"); + typeRampPlus1FontSize = create2("type-ramp-plus1-font-size").withDefault("16px"); + typeRampPlus1LineHeight = create2("type-ramp-plus1-line-height").withDefault("24px"); + scrollbarWidth = create2("scrollbarWidth").withDefault("10px"); + scrollbarHeight = create2("scrollbarHeight").withDefault("10px"); + scrollbarSliderBackground = create2("scrollbar-slider-background", "--vscode-scrollbarSlider-background").withDefault("#79797966"); + scrollbarSliderHoverBackground = create2("scrollbar-slider-hover-background", "--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"); + scrollbarSliderActiveBackground = create2("scrollbar-slider-active-background", "--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"); + badgeBackground = create2("badge-background", "--vscode-badge-background").withDefault("#4d4d4d"); + badgeForeground = create2("badge-foreground", "--vscode-badge-foreground").withDefault("#ffffff"); + buttonBorder = create2("button-border", "--vscode-button-border").withDefault("transparent"); + buttonIconBackground = create2("button-icon-background").withDefault("transparent"); + buttonIconCornerRadius = create2("button-icon-corner-radius").withDefault("5px"); + buttonIconFocusBorderOffset = create2("button-icon-outline-offset").withDefault(0); + buttonIconHoverBackground = create2("button-icon-hover-background", "--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"); + buttonIconPadding = create2("button-icon-padding").withDefault("3px"); + buttonPrimaryBackground = create2("button-primary-background", "--vscode-button-background").withDefault("#0e639c"); + buttonPrimaryForeground = create2("button-primary-foreground", "--vscode-button-foreground").withDefault("#ffffff"); + buttonPrimaryHoverBackground = create2("button-primary-hover-background", "--vscode-button-hoverBackground").withDefault("#1177bb"); + buttonSecondaryBackground = create2("button-secondary-background", "--vscode-button-secondaryBackground").withDefault("#3a3d41"); + buttonSecondaryForeground = create2("button-secondary-foreground", "--vscode-button-secondaryForeground").withDefault("#ffffff"); + buttonSecondaryHoverBackground = create2("button-secondary-hover-background", "--vscode-button-secondaryHoverBackground").withDefault("#45494e"); + buttonPaddingHorizontal = create2("button-padding-horizontal").withDefault("11px"); + buttonPaddingVertical = create2("button-padding-vertical").withDefault("4px"); + checkboxBackground = create2("checkbox-background", "--vscode-checkbox-background").withDefault("#3c3c3c"); + checkboxBorder = create2("checkbox-border", "--vscode-checkbox-border").withDefault("#3c3c3c"); + checkboxCornerRadius = create2("checkbox-corner-radius").withDefault(3); + checkboxForeground = create2("checkbox-foreground", "--vscode-checkbox-foreground").withDefault("#f0f0f0"); + listActiveSelectionBackground = create2("list-active-selection-background", "--vscode-list-activeSelectionBackground").withDefault("#094771"); + listActiveSelectionForeground = create2("list-active-selection-foreground", "--vscode-list-activeSelectionForeground").withDefault("#ffffff"); + listHoverBackground = create2("list-hover-background", "--vscode-list-hoverBackground").withDefault("#2a2d2e"); + dividerBackground = create2("divider-background", "--vscode-settings-dropdownListBorder").withDefault("#454545"); + dropdownBackground = create2("dropdown-background", "--vscode-dropdown-background").withDefault("#3c3c3c"); + dropdownBorder = create2("dropdown-border", "--vscode-dropdown-border").withDefault("#3c3c3c"); + dropdownForeground = create2("dropdown-foreground", "--vscode-dropdown-foreground").withDefault("#f0f0f0"); + dropdownListMaxHeight = create2("dropdown-list-max-height").withDefault("200px"); + inputBackground = create2("input-background", "--vscode-input-background").withDefault("#3c3c3c"); + inputForeground = create2("input-foreground", "--vscode-input-foreground").withDefault("#cccccc"); + inputPlaceholderForeground = create2("input-placeholder-foreground", "--vscode-input-placeholderForeground").withDefault("#cccccc"); + linkActiveForeground = create2("link-active-foreground", "--vscode-textLink-activeForeground").withDefault("#3794ff"); + linkForeground = create2("link-foreground", "--vscode-textLink-foreground").withDefault("#3794ff"); + progressBackground = create2("progress-background", "--vscode-progressBar-background").withDefault("#0e70c0"); + panelTabActiveBorder = create2("panel-tab-active-border", "--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"); + panelTabActiveForeground = create2("panel-tab-active-foreground", "--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"); + panelTabForeground = create2("panel-tab-foreground", "--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"); + panelViewBackground = create2("panel-view-background", "--vscode-panel-background").withDefault("#1e1e1e"); + panelViewBorder = create2("panel-view-border", "--vscode-panel-border").withDefault("#80808059"); + tagCornerRadius = create2("tag-corner-radius").withDefault("2px"); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js + var badgeStyles; + var init_badge_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + badgeStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + text-align: center; + } + .control { + align-items: center; + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: 11px; + box-sizing: border-box; + color: ${badgeForeground}; + display: flex; + height: calc(${designUnit} * 4px); + justify-content: center; + min-width: calc(${designUnit} * 4px + 2px); + min-height: calc(${designUnit} * 4px + 2px); + padding: 3px 6px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js + var Badge2, vsCodeBadge; + var init_badge3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js"() { + init_esm2(); + init_badge_styles(); + Badge2 = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.circular) { + this.circular = true; + } + } + }; + vsCodeBadge = Badge2.compose({ + baseName: "badge", + template: badgeTemplate, + styles: badgeStyles + }); + } + }); + + // node_modules/tslib/tslib.es6.mjs + function __decorate2(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es62 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js + var BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles, buttonStyles; + var init_button_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + BaseButtonStyles = css` + ${display("inline-flex")} :host { + outline: none; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${buttonPrimaryForeground}; + background: ${buttonPrimaryBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + fill: currentColor; + cursor: pointer; + } + .control { + background: transparent; + height: inherit; + flex-grow: 1; + box-sizing: border-box; + display: inline-flex; + justify-content: center; + align-items: center; + padding: ${buttonPaddingVertical} ${buttonPaddingHorizontal}; + white-space: wrap; + outline: none; + text-decoration: none; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + color: inherit; + border-radius: inherit; + fill: inherit; + cursor: inherit; + font-family: inherit; + } + :host(:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host(:active) { + background: ${buttonPrimaryBackground}; + } + .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + .control::-moz-focus-inner { + border: 0; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + background: ${buttonPrimaryBackground}; + cursor: ${disabledCursor}; + } + .content { + display: flex; + } + .start { + display: flex; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-end: 8px; + } +`; + PrimaryButtonStyles = css` + :host([appearance='primary']) { + background: ${buttonPrimaryBackground}; + color: ${buttonPrimaryForeground}; + } + :host([appearance='primary']:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host([appearance='primary']:active) .control:active { + background: ${buttonPrimaryBackground}; + } + :host([appearance='primary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='primary'][disabled]) { + background: ${buttonPrimaryBackground}; + } +`; + SecondaryButtonStyles = css` + :host([appearance='secondary']) { + background: ${buttonSecondaryBackground}; + color: ${buttonSecondaryForeground}; + } + :host([appearance='secondary']:hover) { + background: ${buttonSecondaryHoverBackground}; + } + :host([appearance='secondary']:active) .control:active { + background: ${buttonSecondaryBackground}; + } + :host([appearance='secondary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='secondary'][disabled]) { + background: ${buttonSecondaryBackground}; + } +`; + IconButtonStyles = css` + :host([appearance='icon']) { + background: ${buttonIconBackground}; + border-radius: ${buttonIconCornerRadius}; + color: ${foreground}; + } + :host([appearance='icon']:hover) { + background: ${buttonIconHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } + :host([appearance='icon']) .control { + padding: ${buttonIconPadding}; + border: none; + } + :host([appearance='icon']:active) .control:active { + background: ${buttonIconHoverBackground}; + } + :host([appearance='icon']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: ${buttonIconFocusBorderOffset}; + } + :host([appearance='icon'][disabled]) { + background: ${buttonIconBackground}; + } +`; + buttonStyles = (context, definition) => css` + ${BaseButtonStyles} + ${PrimaryButtonStyles} + ${SecondaryButtonStyles} + ${IconButtonStyles} +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/index.js + var Button2, vsCodeButton; + var init_button3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/index.js"() { + init_tslib_es62(); + init_esm(); + init_esm2(); + init_button_styles(); + Button2 = class extends Button { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.appearance) { + const appearanceValue = this.getAttribute("appearance"); + this.appearance = appearanceValue; + } + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "appearance" && newVal === "icon") { + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.ariaLabel = "Icon Button"; + } + } + if (attrName === "aria-label") { + this.ariaLabel = newVal; + } + if (attrName === "disabled") { + this.disabled = newVal !== null; + } + } + }; + __decorate2([ + attr + ], Button2.prototype, "appearance", void 0); + vsCodeButton = Button2.compose({ + baseName: "button", + template: buttonTemplate, + styles: buttonStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js + var checkboxStyles; + var init_checkbox_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + checkboxStyles = (context, defintiion) => css` + ${display("inline-flex")} :host { + align-items: center; + outline: none; + margin: calc(${designUnit} * 1px) 0; + user-select: none; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control { + position: relative; + width: calc(${designUnit} * 4px + 2px); + height: calc(${designUnit} * 4px + 2px); + box-sizing: border-box; + border-radius: calc(${checkboxCornerRadius} * 1px); + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + background: ${checkboxBackground}; + outline: none; + cursor: pointer; + } + .label { + font-family: ${fontFamily}; + color: ${foreground}; + padding-inline-start: calc(${designUnit} * 2px + 2px); + margin-inline-end: calc(${designUnit} * 2px + 2px); + cursor: pointer; + } + .label__hidden { + display: none; + visibility: hidden; + } + .checked-indicator { + width: 100%; + height: 100%; + display: block; + fill: ${foreground}; + opacity: 0; + pointer-events: none; + } + .indeterminate-indicator { + border-radius: 2px; + background: ${foreground}; + position: absolute; + top: 50%; + left: 50%; + width: 50%; + height: 50%; + transform: translate(-50%, -50%); + opacity: 0; + } + :host(:enabled) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:enabled) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host(.disabled) .label, + :host(.readonly) .label, + :host(.readonly) .control, + :host(.disabled) .control { + cursor: ${disabledCursor}; + } + :host(.checked:not(.indeterminate)) .checked-indicator, + :host(.indeterminate) .indeterminate-indicator { + opacity: 1; + } + :host(.disabled) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js + var Checkbox2, vsCodeCheckbox; + var init_checkbox3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js"() { + init_esm2(); + init_checkbox_styles(); + Checkbox2 = class extends Checkbox { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Checkbox"); + } + } + }; + vsCodeCheckbox = Checkbox2.compose({ + baseName: "checkbox", + template: checkboxTemplate, + styles: checkboxStyles, + checkedIndicator: ` + + + + `, + indeterminateIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js + var dataGridStyles; + var init_data_grid_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js"() { + init_esm(); + dataGridStyles = (context, definition) => css` + :host { + display: flex; + position: relative; + flex-direction: column; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js + var dataGridRowStyles; + var init_data_grid_row_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js"() { + init_esm(); + init_design_tokens(); + dataGridRowStyles = (context, definition) => css` + :host { + display: grid; + padding: calc((${designUnit} / 4) * 1px) 0; + box-sizing: border-box; + width: 100%; + background: transparent; + } + :host(.header) { + } + :host(.sticky-header) { + background: ${background}; + position: sticky; + top: 0; + } + :host(:hover) { + background: ${listHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js + var dataGridCellStyles; + var init_data_grid_cell_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dataGridCellStyles = (context, definition) => css` + :host { + padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px); + color: ${foreground}; + opacity: 1; + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + font-weight: 400; + border: solid calc(${borderWidth} * 1px) transparent; + border-radius: calc(${cornerRadius} * 1px); + white-space: wrap; + overflow-wrap: anywhere; + } + :host(.column-header) { + font-weight: 600; + } + :host(:${focusVisible}), + :host(:focus), + :host(:active) { + background: ${listActiveSelectionBackground}; + border: solid calc(${borderWidth} * 1px) ${focusBorder}; + color: ${listActiveSelectionForeground}; + outline: none; + } + :host(:${focusVisible}) ::slotted(*), + :host(:focus) ::slotted(*), + :host(:active) ::slotted(*) { + color: ${listActiveSelectionForeground} !important; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js + var DataGrid2, vsCodeDataGrid, DataGridRow2, vsCodeDataGridRow, DataGridCell2, vsCodeDataGridCell; + var init_data_grid3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js"() { + init_esm2(); + init_data_grid_styles(); + init_data_grid_row_styles(); + init_data_grid_cell_styles(); + DataGrid2 = class extends DataGrid { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Data Grid"); + } + } + }; + vsCodeDataGrid = DataGrid2.compose({ + baseName: "data-grid", + baseClass: DataGrid, + template: dataGridTemplate, + styles: dataGridStyles + }); + DataGridRow2 = class extends DataGridRow { + }; + vsCodeDataGridRow = DataGridRow2.compose({ + baseName: "data-grid-row", + baseClass: DataGridRow, + template: dataGridRowTemplate, + styles: dataGridRowStyles + }); + DataGridCell2 = class extends DataGridCell { + }; + vsCodeDataGridCell = DataGridCell2.compose({ + baseName: "data-grid-cell", + baseClass: DataGridCell, + template: dataGridCellTemplate, + styles: dataGridCellStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js + var dividerStyles; + var init_divider_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dividerStyles = (context, definition) => css` + ${display("block")} :host { + border: none; + border-top: calc(${borderWidth} * 1px) solid ${dividerBackground}; + box-sizing: content-box; + height: 0; + margin: calc(${designUnit} * 1px) 0; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js + var Divider2, vsCodeDivider; + var init_divider3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js"() { + init_esm2(); + init_divider_styles(); + Divider2 = class extends Divider { + }; + vsCodeDivider = Divider2.compose({ + baseName: "divider", + template: dividerTemplate, + styles: dividerStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js + var dropdownStyles; + var init_dropdown_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dropdownStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: ${dropdownBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + color: ${foreground}; + contain: contents; + font-family: ${fontFamily}; + height: calc(${inputHeight} * 1px); + position: relative; + user-select: none; + min-width: ${inputMinWidth}; + outline: none; + vertical-align: top; + } + .control { + align-items: center; + box-sizing: border-box; + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + cursor: pointer; + display: flex; + font-family: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + min-height: 100%; + padding: 2px 6px 2px 8px; + width: 100%; + } + .listbox { + background: ${dropdownBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + display: inline-flex; + flex-direction: column; + left: 0; + max-height: ${dropdownListMaxHeight}; + padding: 0; + overflow-y: auto; + position: absolute; + width: 100%; + z-index: 1; + } + .listbox[hidden] { + display: none; + } + :host(:${focusVisible}) .control { + border-color: ${focusBorder}; + } + :host(:not([disabled]):hover) { + background: ${dropdownBackground}; + border-color: ${dropdownBorder}; + } + :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + cursor: ${disabledCursor}; + user-select: none; + } + :host([disabled]:hover) { + background: ${dropdownBackground}; + color: ${foreground}; + fill: currentcolor; + } + :host(:not([disabled])) .control:active { + border-color: ${focusBorder}; + } + :host(:empty) .listbox { + display: none; + } + :host([open]) .control { + border-color: ${focusBorder}; + } + :host([open][position='above']) .listbox { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + :host([open][position='below']) .listbox { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + :host([open][position='above']) .listbox { + bottom: calc(${inputHeight} * 1px); + } + :host([open][position='below']) .listbox { + top: calc(${inputHeight} * 1px); + } + .selected-value { + flex: 1 1 auto; + font-family: inherit; + overflow: hidden; + text-align: start; + text-overflow: ellipsis; + white-space: nowrap; + } + .indicator { + flex: 0 0 auto; + margin-inline-start: 1em; + } + slot[name='listbox'] { + display: none; + width: 100%; + } + :host([open]) slot[name='listbox'] { + display: flex; + position: absolute; + } + .end { + margin-inline-start: auto; + } + .start, + .end, + .indicator, + .select-indicator, + ::slotted(svg), + ::slotted(span) { + fill: currentcolor; + height: 1em; + min-height: calc(${designUnit} * 4px); + min-width: calc(${designUnit} * 4px); + width: 1em; + } + ::slotted([role='option']), + ::slotted(option) { + flex: 0 0 auto; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js + var Dropdown, vsCodeDropdown; + var init_dropdown = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js"() { + init_esm2(); + init_dropdown_styles(); + Dropdown = class extends Select { + }; + vsCodeDropdown = Dropdown.compose({ + baseName: "dropdown", + template: selectTemplate, + styles: dropdownStyles, + indicator: ` + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js + var linkStyles; + var init_link_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + linkStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: transparent; + box-sizing: border-box; + color: ${linkForeground}; + cursor: pointer; + fill: currentcolor; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + outline: none; + } + .control { + background: transparent; + border: calc(${borderWidth} * 1px) solid transparent; + border-radius: calc(${cornerRadius} * 1px); + box-sizing: border-box; + color: inherit; + cursor: inherit; + fill: inherit; + font-family: inherit; + height: inherit; + padding: 0; + outline: none; + text-decoration: none; + word-break: break-word; + } + .control::-moz-focus-inner { + border: 0; + } + :host(:hover) { + color: ${linkActiveForeground}; + } + :host(:hover) .content { + text-decoration: underline; + } + :host(:active) { + background: transparent; + color: ${linkActiveForeground}; + } + :host(:${focusVisible}) .control, + :host(:focus) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/index.js + var Link, vsCodeLink; + var init_link = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/index.js"() { + init_esm2(); + init_link_styles(); + Link = class extends Anchor { + }; + vsCodeLink = Link.compose({ + baseName: "link", + template: anchorTemplate, + styles: linkStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js + var optionStyles; + var init_option_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + optionStyles = (context, definition) => css` + ${display("inline-flex")} :host { + font-family: var(--body-font); + border-radius: ${cornerRadius}; + border: calc(${borderWidth} * 1px) solid transparent; + box-sizing: border-box; + color: ${foreground}; + cursor: pointer; + fill: currentcolor; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: 0; + outline: none; + overflow: hidden; + padding: 0 calc((${designUnit} / 2) * 1px) + calc((${designUnit} / 4) * 1px); + user-select: none; + white-space: nowrap; + } + :host(:${focusVisible}) { + border-color: ${focusBorder}; + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([aria-selected='true']) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:active) { + background: ${listActiveSelectionBackground}; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):hover) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):active) { + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]:hover) { + background-color: inherit; + } + .content { + grid-column-start: 2; + justify-self: start; + overflow: hidden; + text-overflow: ellipsis; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/index.js + var Option2, vsCodeOption; + var init_option = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/index.js"() { + init_esm2(); + init_option_styles(); + Option2 = class extends ListboxOption { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Option"); + } + } + }; + vsCodeOption = Option2.compose({ + baseName: "option", + template: listboxOptionTemplate, + styles: optionStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js + var panelsStyles; + var init_panels_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelsStyles = (context, definition) => css` + ${display("grid")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${foreground}; + grid-template-columns: auto 1fr auto; + grid-template-rows: auto 1fr; + overflow-x: auto; + } + .tablist { + display: grid; + grid-template-rows: auto auto; + grid-template-columns: auto; + column-gap: calc(${designUnit} * 8px); + position: relative; + width: max-content; + align-self: end; + padding: calc(${designUnit} * 1px) calc(${designUnit} * 1px) 0; + box-sizing: border-box; + } + .start, + .end { + align-self: center; + } + .activeIndicator { + grid-row: 2; + grid-column: 1; + width: 100%; + height: calc((${designUnit} / 4) * 1px); + justify-self: center; + background: ${panelTabActiveForeground}; + margin: 0; + border-radius: calc(${cornerRadius} * 1px); + } + .activeIndicatorTransition { + transition: transform 0.01s linear; + } + .tabpanel { + grid-row: 2; + grid-column-start: 1; + grid-column-end: 4; + position: relative; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js + var panelTabStyles; + var init_panel_tab_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelTabStyles = (context, definition) => css` + ${display("inline-flex")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + height: calc(${designUnit} * 7px); + padding: calc(${designUnit} * 1px) 0; + color: ${panelTabForeground}; + fill: currentcolor; + border-radius: calc(${cornerRadius} * 1px); + border: solid calc(${borderWidth} * 1px) transparent; + align-items: center; + justify-content: center; + grid-row: 1; + cursor: pointer; + } + :host(:hover) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:active) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:hover) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:active) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:${focusVisible}) { + outline: none; + border: solid calc(${borderWidth} * 1px) ${panelTabActiveBorder}; + } + :host(:focus) { + outline: none; + } + ::slotted(vscode-badge) { + margin-inline-start: calc(${designUnit} * 2px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js + var panelViewStyles; + var init_panel_view_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelViewStyles = (context, definition) => css` + ${display("flex")} :host { + color: inherit; + background-color: transparent; + border: solid calc(${borderWidth} * 1px) transparent; + box-sizing: border-box; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: 10px calc((${designUnit} + 2) * 1px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js + var Panels, vsCodePanels, PanelTab, vsCodePanelTab, PanelView, vsCodePanelView; + var init_panels = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js"() { + init_esm2(); + init_panels_styles(); + init_panel_tab_styles(); + init_panel_view_styles(); + Panels = class extends Tabs { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.orientation) { + this.orientation = TabsOrientation.horizontal; + } + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Panels"); + } + } + }; + vsCodePanels = Panels.compose({ + baseName: "panels", + template: tabsTemplate, + styles: panelsStyles + }); + PanelTab = class extends Tab { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.disabled) { + this.disabled = false; + } + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } + } + }; + vsCodePanelTab = PanelTab.compose({ + baseName: "panel-tab", + template: tabTemplate, + styles: panelTabStyles + }); + PanelView = class extends TabPanel { + }; + vsCodePanelView = PanelView.compose({ + baseName: "panel-view", + template: tabPanelTemplate, + styles: panelViewStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js + var progressRingStyles; + var init_progress_ring_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + progressRingStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: center; + outline: none; + height: calc(${designUnit} * 7px); + width: calc(${designUnit} * 7px); + margin: 0; + } + .progress { + height: 100%; + width: 100%; + } + .background { + fill: none; + stroke: transparent; + stroke-width: calc(${designUnit} / 2 * 1px); + } + .indeterminate-indicator-1 { + fill: none; + stroke: ${progressBackground}; + stroke-width: calc(${designUnit} / 2 * 1px); + stroke-linecap: square; + transform-origin: 50% 50%; + transform: rotate(-90deg); + transition: all 0.2s ease-in-out; + animation: spin-infinite 2s linear infinite; + } + @keyframes spin-infinite { + 0% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(0deg); + } + 50% { + stroke-dasharray: 21.99px 21.99px; + transform: rotate(450deg); + } + 100% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(1080deg); + } + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js + var ProgressRing, vsCodeProgressRing; + var init_progress_ring2 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js"() { + init_esm2(); + init_progress_ring_styles(); + ProgressRing = class extends BaseProgress { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.paused) { + this.paused = false; + } + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-live", "assertive"); + this.setAttribute("role", "alert"); + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "value") { + this.removeAttribute("value"); + } + } + }; + vsCodeProgressRing = ProgressRing.compose({ + baseName: "progress-ring", + template: progressRingTemplate, + styles: progressRingStyles, + indeterminateIndicator: ` + + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js + var radioGroupStyles; + var init_radio_group_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioGroupStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: flex-start; + margin: calc(${designUnit} * 1px) 0; + flex-direction: column; + } + .positioning-region { + display: flex; + flex-wrap: wrap; + } + :host([orientation='vertical']) .positioning-region { + flex-direction: column; + } + :host([orientation='horizontal']) .positioning-region { + flex-direction: row; + } + ::slotted([slot='label']) { + color: ${foreground}; + font-size: ${typeRampBaseFontSize}; + margin: calc(${designUnit} * 1px) 0; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js + var RadioGroup2, vsCodeRadioGroup; + var init_radio_group3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js"() { + init_dist2(); + init_esm2(); + init_radio_group_styles(); + RadioGroup2 = class extends RadioGroup { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const label = this.querySelector("label"); + if (label) { + const id = "radio-group-" + Math.random().toString(16).slice(2); + label.setAttribute("id", id); + this.setAttribute("aria-labelledby", id); + } + } + }; + vsCodeRadioGroup = RadioGroup2.compose({ + baseName: "radio-group", + template: radioGroupTemplate, + styles: radioGroupStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js + var radioStyles; + var init_radio_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioStyles = (context, definition) => css` + ${display("inline-flex")} :host { + align-items: center; + flex-direction: row; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: calc(${designUnit} * 1px) 0; + outline: none; + position: relative; + transition: all 0.2s ease-in-out; + user-select: none; + } + .control { + background: ${checkboxBackground}; + border-radius: 999px; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + box-sizing: border-box; + cursor: pointer; + height: calc(${designUnit} * 4px); + position: relative; + outline: none; + width: calc(${designUnit} * 4px); + } + .label { + color: ${foreground}; + cursor: pointer; + font-family: ${fontFamily}; + margin-inline-end: calc(${designUnit} * 2px + 2px); + padding-inline-start: calc(${designUnit} * 2px + 2px); + } + .label__hidden { + display: none; + visibility: hidden; + } + .control, + .checked-indicator { + flex-shrink: 0; + } + .checked-indicator { + background: ${foreground}; + border-radius: 999px; + display: inline-block; + inset: calc(${designUnit} * 1px); + opacity: 0; + pointer-events: none; + position: absolute; + } + :host(:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:not([disabled])) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked='true']) .control { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:active { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked="true"]:${focusVisible}:not([disabled])) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([aria-checked='true']) .checked-indicator { + opacity: 1; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js + var Radio2, vsCodeRadio; + var init_radio3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js"() { + init_esm2(); + init_radio_styles(); + Radio2 = class extends Radio { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Radio"); + } + } + }; + vsCodeRadio = Radio2.compose({ + baseName: "radio", + template: radioTemplate, + styles: radioStyles, + checkedIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js + var tagStyles; + var init_tag_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + tagStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + } + .control { + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: ${tagCornerRadius}; + color: ${badgeForeground}; + padding: calc(${designUnit} * 0.5px) calc(${designUnit} * 1px); + text-transform: uppercase; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js + var Tag, vsCodeTag; + var init_tag = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js"() { + init_esm2(); + init_tag_styles(); + Tag = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.circular) { + this.circular = false; + } + } + }; + vsCodeTag = Tag.compose({ + baseName: "tag", + template: badgeTemplate, + styles: tagStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js + var textAreaStyles; + var init_text_area_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textAreaStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .control { + box-sizing: border-box; + position: relative; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + font: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: calc(${designUnit} * 2px + 1px); + width: 100%; + min-width: ${inputMinWidth}; + resize: none; + } + .control:hover:enabled { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + .control:active:enabled { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .control::-webkit-scrollbar { + width: ${scrollbarWidth}; + height: ${scrollbarHeight}; + } + .control::-webkit-scrollbar-corner { + background: ${inputBackground}; + } + .control::-webkit-scrollbar-thumb { + background: ${scrollbarSliderBackground}; + } + .control::-webkit-scrollbar-thumb:hover { + background: ${scrollbarSliderHoverBackground}; + } + .control::-webkit-scrollbar-thumb:active { + background: ${scrollbarSliderActiveBackground}; + } + :host(:focus-within:not([disabled])) .control { + border-color: ${focusBorder}; + } + :host([resize='both']) .control { + resize: both; + } + :host([resize='horizontal']) .control { + resize: horizontal; + } + :host([resize='vertical']) .control { + resize: vertical; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js + var TextArea2, vsCodeTextArea; + var init_text_area3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js"() { + init_esm2(); + init_text_area_styles(); + TextArea2 = class extends TextArea { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text area"); + } + } + }; + vsCodeTextArea = TextArea2.compose({ + baseName: "text-area", + template: textAreaTemplate, + styles: textAreaStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js + var textFieldStyles; + var init_text_field_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textFieldStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .root { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: row; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + height: calc(${inputHeight} * 1px); + min-width: ${inputMinWidth}; + } + .control { + -webkit-appearance: none; + font: inherit; + background: transparent; + border: 0; + color: inherit; + height: calc(100% - (${designUnit} * 1px)); + width: 100%; + margin-top: auto; + margin-bottom: auto; + border: none; + padding: 0 calc(${designUnit} * 2px + 1px); + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + .start, + .end { + display: flex; + margin: auto; + fill: currentcolor; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-start: calc(${designUnit} * 2px); + } + .end { + margin-inline-end: calc(${designUnit} * 2px); + } + :host(:hover:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + :host(:active:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + :host(:focus-within:not([disabled])) .root { + border-color: ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js + var TextField2, vsCodeTextField; + var init_text_field3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js"() { + init_esm2(); + init_text_field_styles(); + TextField2 = class extends TextField { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text field"); + } + } + }; + vsCodeTextField = TextField2.compose({ + baseName: "text-field", + template: textFieldTemplate, + styles: textFieldStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js + var allComponents; + var init_custom_elements = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js"() { + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + allComponents = { + vsCodeBadge, + vsCodeButton, + vsCodeCheckbox, + vsCodeDataGrid, + vsCodeDataGridCell, + vsCodeDataGridRow, + vsCodeDivider, + vsCodeDropdown, + vsCodeLink, + vsCodeOption, + vsCodePanels, + vsCodePanelTab, + vsCodePanelView, + vsCodeProgressRing, + vsCodeRadioGroup, + vsCodeRadio, + vsCodeTag, + vsCodeTextArea, + vsCodeTextField, + register(container, ...rest) { + if (!container) { + return; + } + for (const key in this) { + if (key === "register") { + continue; + } + this[key]().register(container, ...rest); + } + } + }; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/index.js + var dist_exports = {}; + __export(dist_exports, { + Badge: () => Badge2, + Button: () => Button2, + Checkbox: () => Checkbox2, + DataGrid: () => DataGrid2, + DataGridCell: () => DataGridCell2, + DataGridCellTypes: () => DataGridCellTypes, + DataGridRow: () => DataGridRow2, + DataGridRowTypes: () => DataGridRowTypes, + Divider: () => Divider2, + DividerRole: () => DividerRole, + Dropdown: () => Dropdown, + DropdownPosition: () => SelectPosition, + GenerateHeaderOptions: () => GenerateHeaderOptions, + Link: () => Link, + Option: () => Option2, + PanelTab: () => PanelTab, + PanelView: () => PanelView, + Panels: () => Panels, + ProgressRing: () => ProgressRing, + Radio: () => Radio2, + RadioGroup: () => RadioGroup2, + RadioGroupOrientation: () => Orientation, + Tag: () => Tag, + TextArea: () => TextArea2, + TextAreaResize: () => TextAreaResize, + TextField: () => TextField2, + TextFieldType: () => TextFieldType, + allComponents: () => allComponents, + provideVSCodeDesignSystem: () => provideVSCodeDesignSystem, + vsCodeBadge: () => vsCodeBadge, + vsCodeButton: () => vsCodeButton, + vsCodeCheckbox: () => vsCodeCheckbox, + vsCodeDataGrid: () => vsCodeDataGrid, + vsCodeDataGridCell: () => vsCodeDataGridCell, + vsCodeDataGridRow: () => vsCodeDataGridRow, + vsCodeDivider: () => vsCodeDivider, + vsCodeDropdown: () => vsCodeDropdown, + vsCodeLink: () => vsCodeLink, + vsCodeOption: () => vsCodeOption, + vsCodePanelTab: () => vsCodePanelTab, + vsCodePanelView: () => vsCodePanelView, + vsCodePanels: () => vsCodePanels, + vsCodeProgressRing: () => vsCodeProgressRing, + vsCodeRadio: () => vsCodeRadio, + vsCodeRadioGroup: () => vsCodeRadioGroup, + vsCodeTag: () => vsCodeTag, + vsCodeTextArea: () => vsCodeTextArea, + vsCodeTextField: () => vsCodeTextField + }); + var init_dist3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/index.js"() { + init_vscode_design_system(); + init_custom_elements(); + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + } + }); + + // src/webview/shared/modelUtils.ts + function getModelDisplayName(model) { + const names = { + "gpt-4": "GPT-4", + "gpt-4.1": "GPT-4.1", + "gpt-4o": "GPT-4o", + "gpt-4o-mini": "GPT-4o Mini", + "gpt-3.5-turbo": "GPT-3.5 Turbo", + "gpt-5": "GPT-5", + "gpt-5-codex": "GPT-5 Codex (Preview)", + "gpt-5-mini": "GPT-5 Mini", + "gpt-5.1": "GPT-5.1", + "gpt-5.1-codex": "GPT-5.1 Codex", + "gpt-5.1-codex-max": "GPT-5.1 Codex Max", + "gpt-5.1-codex-mini": "GPT-5.1 Codex Mini (Preview)", + "gpt-5.2": "GPT-5.2", + "gpt-5.2-codex": "GPT-5.2 Codex", + "claude-sonnet-3.5": "Claude Sonnet 3.5", + "claude-sonnet-3.7": "Claude Sonnet 3.7", + "claude-sonnet-4": "Claude Sonnet 4", + "claude-sonnet-4.5": "Claude Sonnet 4.5", + "claude-haiku": "Claude Haiku", + "claude-haiku-4.5": "Claude Haiku 4.5", + "claude-opus-4.1": "Claude Opus 4.1", + "claude-opus-4.5": "Claude Opus 4.5", + "gemini-2.5-pro": "Gemini 2.5 Pro", + "gemini-3-flash": "Gemini 3 Flash", + "gemini-3-pro": "Gemini 3 Pro", + "gemini-3-pro-preview": "Gemini 3 Pro (Preview)", + "grok-code-fast-1": "Grok Code Fast 1", + "raptor-mini": "Raptor Mini", + "o3-mini": "o3-mini", + "o4-mini": "o4-mini (Preview)" + }; + return names[model] || model; + } + + // src/tokenEstimators.json + var tokenEstimators_default = { + $schema: "http://json-schema.org/draft-07/schema#", + description: "Character-to-token ratio estimators for different AI models. Used to estimate token counts from text length.", + estimators: { + "gpt-4": 0.25, + "gpt-4.1": 0.25, + "gpt-4.1-mini": 0.25, + "gpt-4o": 0.25, + "gpt-4o-mini": 0.25, + "gpt-4-turbo": 0.25, + "gpt-3.5-turbo": 0.25, + "gpt-5": 0.25, + "gpt-5-codex": 0.25, + "gpt-5-mini": 0.25, + "gpt-5.1": 0.25, + "gpt-5.1-codex": 0.25, + "gpt-5.1-codex-max": 0.25, + "gpt-5.1-codex-mini": 0.25, + "gpt-5.2": 0.25, + "gpt-5.2-codex": 0.25, + "gpt-5.2-pro": 0.25, + "gpt-5.3-codex": 0.25, + "gpt-5.4": 0.25, + "gpt-4.1-nano": 0.25, + "gemini-2.0-flash": 0.25, + "gemini-2.0-flash-lite": 0.25, + "gemini-2.5-flash": 0.25, + "gemini-2.5-flash-lite": 0.25, + "claude-sonnet-3.5": 0.24, + "claude-sonnet-3.7": 0.24, + "claude-sonnet-4": 0.24, + "claude-sonnet-4.5": 0.24, + "claude-sonnet-4.6": 0.24, + "claude-haiku": 0.24, + "claude-haiku-4.5": 0.24, + "claude-opus-4.1": 0.24, + "claude-opus-4.5": 0.24, + "claude-opus-4.6": 0.24, + "claude-opus-4.6-(fast-mode)-(preview)": 0.24, + "claude-opus-4.6-fast": 0.24, + "gemini-2.5-pro": 0.25, + "gemini-3-flash": 0.25, + "gemini-3-pro": 0.25, + "gemini-3-pro-preview": 0.25, + "gemini-3.1-pro": 0.25, + "grok-code-fast-1": 0.25, + "raptor-mini": 0.25, + goldeneye: 0.25, + "o1-preview": 0.25, + "o1-mini": 0.25, + "o3-mini": 0.25, + "o4-mini": 0.25 + } + }; + + // src/webview/shared/formatUtils.ts + var tokenEstimators = tokenEstimators_default.estimators; + var currentLocale; + function getEditorIcon(editor) { + const icons = { + "VS Code": "\u{1F499}", + "VS Code Insiders": "\u{1F49A}", + "VS Code Exploration": "\u{1F9EA}", + "VS Code Server": "\u2601\uFE0F", + "VS Code Server (Insiders)": "\u2601\uFE0F", + "VSCodium": "\u{1F537}", + "Cursor": "\u26A1", + "Copilot CLI": "\u{1F916}", + "OpenCode": "\u{1F7E2}", + "Visual Studio": "\u{1FA9F}", + "Unknown": "\u2753" + }; + return icons[editor] || "\u{1F4DD}"; + } + function getCharsPerToken(model) { + const ratio = tokenEstimators[model] ?? 0.25; + return 1 / ratio; + } + function formatFixed(value, digits) { + return new Intl.NumberFormat(currentLocale, { + minimumFractionDigits: digits, + maximumFractionDigits: digits + }).format(value); + } + function formatPercent(value, digits = 1) { + return `${formatFixed(value, digits)}%`; + } + function formatNumber(value) { + return value.toLocaleString(currentLocale); + } + function formatCost(value) { + return new Intl.NumberFormat(currentLocale, { + style: "currency", + currency: "USD", + minimumFractionDigits: 4, + maximumFractionDigits: 4 + }).format(value); + } + + // src/webview/shared/domUtils.ts + function el(tag, className, text) { + const node = document.createElement(tag); + if (className) { + node.className = className; + } + if (text !== void 0) { + node.textContent = text; + } + return node; + } + function createButton(configOrId, label, appearance) { + const button = document.createElement("vscode-button"); + if (typeof configOrId === "string") { + button.id = configOrId; + button.textContent = label || ""; + if (appearance) { + button.setAttribute("appearance", appearance); + } + } else { + const config = configOrId; + button.id = config.id; + button.textContent = config.label; + if (config.appearance) { + button.setAttribute("appearance", config.appearance); + } + } + return button; + } + + // src/webview/shared/buttonConfig.ts + var BUTTONS = { + "btn-refresh": { + id: "btn-refresh", + label: "\u{1F504} Refresh", + appearance: "primary" + }, + "btn-details": { + id: "btn-details", + label: "\u{1F916} Details" + }, + "btn-chart": { + id: "btn-chart", + label: "\u{1F4C8} Chart" + }, + "btn-usage": { + id: "btn-usage", + label: "\u{1F4CA} Usage Analysis" + }, + "btn-diagnostics": { + id: "btn-diagnostics", + label: "\u{1F50D} Diagnostics" + }, + "btn-maturity": { + id: "btn-maturity", + label: "\u{1F3AF} Fluency Score" + }, + "btn-dashboard": { + id: "btn-dashboard", + label: "\u{1F4CA} Team Dashboard" + }, + "btn-level-viewer": { + id: "btn-level-viewer", + label: "\u{1F50D} Level Viewer" + }, + "btn-environmental": { + id: "btn-environmental", + label: "\u{1F33F} Environmental Impact" + } + }; + + // src/webview/shared/theme.css + var theme_default = '/**\n * Shared theme variables for all webview panels\n * Uses VS Code theme tokens for automatic light/dark theme support\n */\n\n:root {\n /* VS Code base colors */\n --bg-primary: var(--vscode-editor-background);\n --bg-secondary: var(--vscode-sideBar-background);\n --bg-tertiary: var(--vscode-editorWidget-background);\n --text-primary: var(--vscode-editor-foreground);\n --text-secondary: var(--vscode-descriptionForeground);\n --text-muted: var(--vscode-disabledForeground);\n --border-color: var(--vscode-panel-border);\n --border-subtle: var(--vscode-widget-border);\n \n /* Button colors */\n --button-bg: var(--vscode-button-background);\n --button-fg: var(--vscode-button-foreground);\n --button-hover-bg: var(--vscode-button-hoverBackground);\n --button-secondary-bg: var(--vscode-button-secondaryBackground);\n --button-secondary-fg: var(--vscode-button-secondaryForeground);\n --button-secondary-hover-bg: var(--vscode-button-secondaryHoverBackground);\n \n /* Input colors */\n --input-bg: var(--vscode-input-background);\n --input-fg: var(--vscode-input-foreground);\n --input-border: var(--vscode-input-border);\n \n /* List/card colors */\n --list-hover-bg: var(--vscode-list-hoverBackground);\n --list-active-bg: var(--vscode-list-activeSelectionBackground);\n --list-active-fg: var(--vscode-list-activeSelectionForeground);\n --list-inactive-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Alternating row colors for better readability */\n --row-alternate-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Badge colors */\n --badge-bg: var(--vscode-badge-background);\n --badge-fg: var(--vscode-badge-foreground);\n \n /* Focus colors */\n --focus-border: var(--vscode-focusBorder);\n \n /* Link colors */\n --link-color: var(--vscode-textLink-foreground);\n --link-hover-color: var(--vscode-textLink-activeForeground);\n \n /* Status colors */\n --error-fg: var(--vscode-errorForeground);\n --warning-fg: var(--vscode-editorWarning-foreground);\n --success-fg: var(--vscode-terminal-ansiGreen);\n \n /* Shadow for cards */\n --shadow-color: rgb(0, 0, 0, 0.16);\n --shadow-hover-color: rgb(0, 0, 0, 0.24);\n}\n\n/* Light theme adjustments */\nbody[data-vscode-theme-kind="vscode-light"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --shadow-color: rgb(0, 0, 0, 0.08);\n --shadow-hover-color: rgb(0, 0, 0, 0.12);\n}\n\n/* High contrast mode adjustments */\nbody[data-vscode-theme-kind="vscode-high-contrast"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --border-color: var(--vscode-contrastBorder);\n --border-subtle: var(--vscode-contrastBorder);\n}\n'; + + // src/webview/details/styles.css + var styles_default = "body {\n margin: 0;\n background: var(--bg-primary);\n color: var(--text-primary);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n\n.container {\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding-bottom: 4px;\n}\n\n.title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 700;\n color: var(--text-primary);\n}\n\n.button-row {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.sections {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.section {\n background: var(--bg-secondary);\n border: 1px solid var(--border-color);\n border-radius: 10px;\n padding: 12px;\n box-shadow: 0 4px 10px var(--shadow-color);\n}\n\n.section h3 {\n margin: 0 0 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--text-primary);\n letter-spacing: 0.2px;\n}\n\n.stats-table {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n background: var(--bg-tertiary);\n border: 1px solid var(--border-subtle);\n border-radius: 8px;\n overflow: hidden;\n}\n\n.stats-table thead {\n background: var(--list-hover-bg);\n}\n\n.stats-table th,\n.stats-table td {\n padding: 10px 12px;\n border-bottom: 1px solid var(--border-subtle);\n vertical-align: middle;\n}\n\n.stats-table th {\n text-align: left;\n color: var(--text-secondary);\n font-weight: 700;\n font-size: 12px;\n letter-spacing: 0.1px;\n}\n\n.stats-table td {\n color: var(--text-primary);\n font-size: 12px;\n}\n\n.stats-table th.align-right,\n.stats-table td.align-right {\n text-align: right;\n}\n\n.metric-label {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-weight: 600;\n}\n\n.period-header {\n display: flex;\n align-items: center;\n gap: 4px;\n color: var(--text-secondary);\n}\n\n.align-right .period-header {\n justify-content: flex-end;\n}\n\n.value-right {\n text-align: right;\n}\n\n.muted {\n color: var(--text-muted);\n font-size: 11px;\n margin-top: 4px;\n}\n\n.notes {\n margin: 4px 0 0;\n padding-left: 16px;\n color: var(--text-secondary);\n}\n\n.notes li {\n margin: 4px 0;\n line-height: 1.4;\n}\n\n.footer {\n color: var(--text-muted);\n font-size: 11px;\n margin-top: 6px;\n}\n"; + + // src/webview/details/main.ts + var vscode = acquireVsCodeApi(); + var initialData = window.__INITIAL_DETAILS__; + console.log("[CopilotTokenTracker] details webview loaded"); + console.log("[CopilotTokenTracker] window.__INITIAL_DETAILS__:", window.__INITIAL_DETAILS__); + console.log("[CopilotTokenTracker] initialData:", initialData); + var _initSort = initialData?.sortSettings; + var editorSortKey = _initSort?.editor?.key ?? "name"; + var editorSortDir = _initSort?.editor?.dir ?? "asc"; + var modelSortKey = _initSort?.model?.key ?? "name"; + var modelSortDir = _initSort?.model?.dir ?? "asc"; + function calculateProjection(last30DaysValue) { + const daysInYear = 365.25; + return last30DaysValue / 30 * daysInYear; + } + function render(stats) { + const root = document.getElementById("root"); + if (!root) { + return; + } + const projectedTokens = Math.round(calculateProjection(stats.last30Days.tokens)); + const projectedSessions = Math.round(calculateProjection(stats.last30Days.sessions)); + const projectedCo2 = calculateProjection(stats.last30Days.co2); + const projectedWater = calculateProjection(stats.last30Days.waterUsage); + const projectedCost = calculateProjection(stats.last30Days.estimatedCost); + const projectedTrees = calculateProjection(stats.last30Days.treesEquivalent); + renderShell(root, stats, { + projectedTokens, + projectedSessions, + projectedCo2, + projectedWater, + projectedCost, + projectedTrees + }); + wireButtons(); + } + function renderShell(root, stats, projections) { + const lastUpdated = new Date(stats.lastUpdated); + root.replaceChildren(); + const themeStyle = document.createElement("style"); + themeStyle.textContent = theme_default; + const style = document.createElement("style"); + style.textContent = styles_default; + const container = el("div", "container"); + const header = el("div", "header"); + const title = el("div", "title", "\u{1F916} Copilot Token Usage"); + const buttonRow = el("div", "button-row"); + buttonRow.append( + createButton(BUTTONS["btn-refresh"]), + createButton(BUTTONS["btn-chart"]), + createButton(BUTTONS["btn-usage"]), + createButton(BUTTONS["btn-environmental"]), + createButton(BUTTONS["btn-diagnostics"]), + createButton(BUTTONS["btn-maturity"]) + ); + if (stats.backendConfigured) { + buttonRow.append(createButton(BUTTONS["btn-dashboard"])); + } + header.append(title, buttonRow); + const footer = el("div", "footer", `Last updated: ${lastUpdated.toLocaleString()} \xB7 Updates every 5 minutes`); + const sections = el("div", "sections"); + sections.append(buildMetricsSection(stats, projections)); + const editorSection = buildEditorUsageSection(stats); + if (editorSection) { + sections.append(editorSection); + } + const modelSection = buildModelUsageSection(stats); + if (modelSection) { + sections.append(modelSection); + } + container.append(header, sections, footer); + root.append(themeStyle, style, container); + } + function buildMetricsSection(stats, projections) { + const section = el("div", "section"); + const heading = el("h3"); + heading.textContent = "\u{1F916} Copilot Token Usage"; + section.append(heading); + const table = document.createElement("table"); + table.className = "stats-table"; + const thead = document.createElement("thead"); + const headerRow = document.createElement("tr"); + const headers = [ + { icon: "\u{1F4CA}", text: "Metric" }, + { icon: "\u{1F4C5}", text: "Today" }, + { icon: "\u{1F4C8}", text: "Last 30 Days" }, + { icon: "\u{1F4C6}", text: "Previous Month" }, + { icon: "\u{1F30D}", text: "Projected Year" } + ]; + headers.forEach((h, idx) => { + const th = document.createElement("th"); + th.className = idx === 0 ? "" : "align-right"; + const wrap = el("div", "period-header"); + wrap.textContent = `${h.icon} ${h.text}`; + th.append(wrap); + headerRow.append(th); + }); + thead.append(headerRow); + table.append(thead); + const tbody = document.createElement("tbody"); + const rows = [ + { label: "Tokens (total)", icon: "\u{1F7E3}", color: "#c37bff", today: formatNumber(stats.today.tokens), last30Days: formatNumber(stats.last30Days.tokens), lastMonth: formatNumber(stats.lastMonth.tokens), projected: formatNumber(projections.projectedTokens) }, + { label: "Tokens (user estimated)", icon: "\u{1F4DD}", color: "#b39ddb", today: formatNumber(stats.today.estimatedTokens), last30Days: formatNumber(stats.last30Days.estimatedTokens), lastMonth: formatNumber(stats.lastMonth.estimatedTokens), projected: "\u2014" }, + { label: "Service overhead %", icon: "\u2601\uFE0F", color: "#90a4ae", today: (stats.today.actualTokens || 0) > 0 ? formatPercent((stats.today.tokens - stats.today.estimatedTokens) / stats.today.tokens * 100) : "\u2014", last30Days: (stats.last30Days.actualTokens || 0) > 0 ? formatPercent((stats.last30Days.tokens - stats.last30Days.estimatedTokens) / stats.last30Days.tokens * 100) : "\u2014", lastMonth: (stats.lastMonth.actualTokens || 0) > 0 ? formatPercent((stats.lastMonth.tokens - stats.lastMonth.estimatedTokens) / stats.lastMonth.tokens * 100) : "\u2014", projected: "\u2014" }, + { label: "Thinking tokens", icon: "\u{1F9E0}", color: "#a78bfa", today: formatNumber(stats.today.thinkingTokens || 0), last30Days: formatNumber(stats.last30Days.thinkingTokens || 0), lastMonth: formatNumber(stats.lastMonth.thinkingTokens || 0), projected: "\u2014" }, + { label: "Estimated cost", icon: "\u{1FA99}", color: "#ffd166", today: formatCost(stats.today.estimatedCost), last30Days: formatCost(stats.last30Days.estimatedCost), lastMonth: formatCost(stats.lastMonth.estimatedCost), projected: formatCost(projections.projectedCost) }, + { label: "Sessions", icon: "\u{1F4C5}", color: "#66aaff", today: formatNumber(stats.today.sessions), last30Days: formatNumber(stats.last30Days.sessions), lastMonth: formatNumber(stats.lastMonth.sessions), projected: formatNumber(projections.projectedSessions) }, + { label: "Average interactions/session", icon: "\u{1F4AC}", color: "#8ce0ff", today: formatNumber(stats.today.avgInteractionsPerSession), last30Days: formatNumber(stats.last30Days.avgInteractionsPerSession), lastMonth: formatNumber(stats.lastMonth.avgInteractionsPerSession), projected: "\u2014" }, + { label: "Average tokens/session", icon: "\u{1F522}", color: "#7ce38b", today: formatNumber(stats.today.avgTokensPerSession), last30Days: formatNumber(stats.last30Days.avgTokensPerSession), lastMonth: formatNumber(stats.lastMonth.avgTokensPerSession), projected: "\u2014" } + ]; + rows.forEach((row) => { + const tr = document.createElement("tr"); + const labelTd = document.createElement("td"); + const labelWrapper = document.createElement("span"); + labelWrapper.className = "metric-label"; + const iconSpan = document.createElement("span"); + iconSpan.textContent = row.icon; + if (row.color) { + iconSpan.style.color = row.color; + } + const textSpan = document.createElement("span"); + textSpan.textContent = row.label; + labelWrapper.append(iconSpan, textSpan); + labelTd.append(labelWrapper); + const todayTd = document.createElement("td"); + todayTd.className = "value-right align-right"; + todayTd.textContent = row.today; + const last30DaysTd = document.createElement("td"); + last30DaysTd.className = "value-right align-right"; + last30DaysTd.textContent = row.last30Days; + const lastMonthTd = document.createElement("td"); + lastMonthTd.className = "value-right align-right"; + lastMonthTd.textContent = row.lastMonth; + const projTd = document.createElement("td"); + projTd.className = "value-right align-right"; + projTd.textContent = row.projected; + tr.append(labelTd, todayTd, last30DaysTd, lastMonthTd, projTd); + tbody.append(tr); + }); + table.append(tbody); + section.append(table); + return section; + } + function getSortIndicator(colKey, activeKey, dir) { + if (colKey !== activeKey) { + return " \u2195"; + } + return dir === "asc" ? " \u2191" : " \u2193"; + } + function saveSortSettings() { + vscode.postMessage({ + command: "saveSortSettings", + settings: { + editor: { key: editorSortKey, dir: editorSortDir }, + model: { key: modelSortKey, dir: modelSortDir } + } + }); + } + function buildEditorTbody(stats, allEditors) { + const todayTotal = Object.values(stats.today.editorUsage).reduce((sum, e) => sum + e.tokens, 0); + const last30DaysTotal = Object.values(stats.last30Days.editorUsage).reduce((sum, e) => sum + e.tokens, 0); + const lastMonthTotal = Object.values(stats.lastMonth.editorUsage).reduce((sum, e) => sum + e.tokens, 0); + const items = allEditors.map((editor) => { + const todayUsage = stats.today.editorUsage[editor] || { tokens: 0, sessions: 0 }; + const last30DaysUsage = stats.last30Days.editorUsage[editor] || { tokens: 0, sessions: 0 }; + const lastMonthUsage = stats.lastMonth.editorUsage[editor] || { tokens: 0, sessions: 0 }; + return { + editor, + todayUsage, + last30DaysUsage, + lastMonthUsage, + projectedTokens: Math.round(calculateProjection(last30DaysUsage.tokens)), + projectedSessions: Math.round(calculateProjection(last30DaysUsage.sessions)) + }; + }); + items.sort((a, b) => { + let cmp; + switch (editorSortKey) { + case "name": + cmp = a.editor.localeCompare(b.editor); + break; + case "today": + cmp = a.todayUsage.tokens - b.todayUsage.tokens; + break; + case "last30Days": + cmp = a.last30DaysUsage.tokens - b.last30DaysUsage.tokens; + break; + case "lastMonth": + cmp = a.lastMonthUsage.tokens - b.lastMonthUsage.tokens; + break; + case "projected": + cmp = a.projectedTokens - b.projectedTokens; + break; + default: + cmp = 0; + } + return editorSortDir === "asc" ? cmp : -cmp; + }); + const tbody = document.createElement("tbody"); + items.forEach(({ editor, todayUsage, last30DaysUsage, lastMonthUsage, projectedTokens, projectedSessions }) => { + const todayPercent = todayTotal > 0 ? todayUsage.tokens / todayTotal * 100 : 0; + const last30DaysPercent = last30DaysTotal > 0 ? last30DaysUsage.tokens / last30DaysTotal * 100 : 0; + const lastMonthPercent = lastMonthTotal > 0 ? lastMonthUsage.tokens / lastMonthTotal * 100 : 0; + const tr = document.createElement("tr"); + const labelTd = document.createElement("td"); + const labelWrapper = document.createElement("span"); + labelWrapper.className = "metric-label"; + labelWrapper.textContent = `${getEditorIcon(editor)} ${editor}`; + labelTd.append(labelWrapper); + const todayTd = document.createElement("td"); + todayTd.className = "value-right align-right"; + todayTd.textContent = formatNumber(todayUsage.tokens); + const todaySub = el("div", "muted", `${formatPercent(todayPercent)} \xB7 ${todayUsage.sessions} sessions`); + todayTd.append(todaySub); + const last30DaysTd = document.createElement("td"); + last30DaysTd.className = "value-right align-right"; + last30DaysTd.textContent = formatNumber(last30DaysUsage.tokens); + const last30DaysSub = el("div", "muted", `${formatPercent(last30DaysPercent)} \xB7 ${last30DaysUsage.sessions} sessions`); + last30DaysTd.append(last30DaysSub); + const lastMonthTd = document.createElement("td"); + lastMonthTd.className = "value-right align-right"; + lastMonthTd.textContent = formatNumber(lastMonthUsage.tokens); + const lastMonthSub = el("div", "muted", `${formatPercent(lastMonthPercent)} \xB7 ${lastMonthUsage.sessions} sessions`); + lastMonthTd.append(lastMonthSub); + const projTd = document.createElement("td"); + projTd.className = "value-right align-right"; + projTd.textContent = formatNumber(projectedTokens); + const projSub = el("div", "muted", `${projectedSessions} sessions`); + projTd.append(projSub); + tr.append(labelTd, todayTd, last30DaysTd, lastMonthTd, projTd); + tbody.append(tr); + }); + return tbody; + } + function buildEditorUsageSection(stats) { + const allEditors = /* @__PURE__ */ new Set([ + ...Object.keys(stats.today.editorUsage), + ...Object.keys(stats.last30Days.editorUsage), + ...Object.keys(stats.lastMonth.editorUsage) + ]); + if (allEditors.size === 0) { + return null; + } + const section = el("div", "section"); + const heading = el("h3"); + heading.textContent = "\u{1F4BB} Usage by Editor"; + section.append(heading); + const table = document.createElement("table"); + table.className = "stats-table"; + const thead = document.createElement("thead"); + const headerRow = document.createElement("tr"); + const editorColHeaders = [ + { icon: "\u{1F4DD}", text: "Editor", key: "name" }, + { icon: "\u{1F4C5}", text: "Today", key: "today" }, + { icon: "\u{1F4C8}", text: "Last 30 Days", key: "last30Days" }, + { icon: "\u{1F4C6}", text: "Previous Month", key: "lastMonth" }, + { icon: "\u{1F30D}", text: "Projected Year", key: "projected" } + ]; + const editorHeaderWraps = []; + editorColHeaders.forEach((h, idx) => { + const th = document.createElement("th"); + th.className = idx === 0 ? "" : "align-right"; + th.style.cursor = "pointer"; + th.style.userSelect = "none"; + th.title = `Sort by ${h.text}`; + const wrap = el("div", "period-header"); + wrap.textContent = `${h.icon} ${h.text}${getSortIndicator(h.key, editorSortKey, editorSortDir)}`; + th.append(wrap); + editorHeaderWraps.push(wrap); + th.addEventListener("click", () => { + if (editorSortKey === h.key) { + editorSortDir = editorSortDir === "asc" ? "desc" : "asc"; + } else { + editorSortKey = h.key; + editorSortDir = h.key === "name" ? "asc" : "desc"; + } + editorHeaderWraps.forEach((w, i) => { + w.textContent = `${editorColHeaders[i].icon} ${editorColHeaders[i].text}${getSortIndicator(editorColHeaders[i].key, editorSortKey, editorSortDir)}`; + }); + const newTbody = buildEditorTbody(stats, Array.from(allEditors)); + const oldTbody = table.querySelector("tbody"); + if (oldTbody) { + table.replaceChild(newTbody, oldTbody); + } else { + table.append(newTbody); + } + saveSortSettings(); + }); + headerRow.append(th); + }); + thead.append(headerRow); + table.append(thead); + table.append(buildEditorTbody(stats, Array.from(allEditors))); + section.append(table); + return section; + } + function buildModelTbody(stats, allModels) { + const items = allModels.map((model) => { + const todayUsage = stats.today.modelUsage[model] || { inputTokens: 0, outputTokens: 0 }; + const last30DaysUsage = stats.last30Days.modelUsage[model] || { inputTokens: 0, outputTokens: 0 }; + const lastMonthUsage = stats.lastMonth.modelUsage[model] || { inputTokens: 0, outputTokens: 0 }; + const todayTotal = todayUsage.inputTokens + todayUsage.outputTokens; + const last30DaysTotal = last30DaysUsage.inputTokens + last30DaysUsage.outputTokens; + const lastMonthTotal = lastMonthUsage.inputTokens + lastMonthUsage.outputTokens; + return { + model, + todayTotal, + todayInputPct: todayTotal > 0 ? todayUsage.inputTokens / todayTotal * 100 : 0, + todayOutputPct: todayTotal > 0 ? todayUsage.outputTokens / todayTotal * 100 : 0, + last30DaysTotal, + last30DaysInputPct: last30DaysTotal > 0 ? last30DaysUsage.inputTokens / last30DaysTotal * 100 : 0, + last30DaysOutputPct: last30DaysTotal > 0 ? last30DaysUsage.outputTokens / last30DaysTotal * 100 : 0, + lastMonthTotal, + lastMonthInputPct: lastMonthTotal > 0 ? lastMonthUsage.inputTokens / lastMonthTotal * 100 : 0, + lastMonthOutputPct: lastMonthTotal > 0 ? lastMonthUsage.outputTokens / lastMonthTotal * 100 : 0, + projected: Math.round(calculateProjection(last30DaysTotal)), + charsPerToken: getCharsPerToken(model) + }; + }); + items.sort((a, b) => { + let cmp; + switch (modelSortKey) { + case "name": + cmp = a.model.localeCompare(b.model); + break; + case "today": + cmp = a.todayTotal - b.todayTotal; + break; + case "last30Days": + cmp = a.last30DaysTotal - b.last30DaysTotal; + break; + case "lastMonth": + cmp = a.lastMonthTotal - b.lastMonthTotal; + break; + case "projected": + cmp = a.projected - b.projected; + break; + default: + cmp = 0; + } + return modelSortDir === "asc" ? cmp : -cmp; + }); + const tbody = document.createElement("tbody"); + items.forEach((item) => { + const tr = document.createElement("tr"); + const labelTd = document.createElement("td"); + const labelWrapper = document.createElement("span"); + labelWrapper.className = "metric-label"; + labelWrapper.innerHTML = `${getModelDisplayName(item.model)} (~${item.charsPerToken.toFixed(1)} chars/tk)`; + labelTd.append(labelWrapper); + const todayTd = document.createElement("td"); + todayTd.className = "value-right align-right"; + todayTd.textContent = formatNumber(item.todayTotal); + const todaySub = el("div", "muted", `\u2191${formatPercent(item.todayInputPct)} \u2193${formatPercent(item.todayOutputPct)}`); + todayTd.append(todaySub); + const last30DaysTd = document.createElement("td"); + last30DaysTd.className = "value-right align-right"; + last30DaysTd.textContent = formatNumber(item.last30DaysTotal); + const last30DaysSub = el("div", "muted", `\u2191${formatPercent(item.last30DaysInputPct)} \u2193${formatPercent(item.last30DaysOutputPct)}`); + last30DaysTd.append(last30DaysSub); + const lastMonthTd = document.createElement("td"); + lastMonthTd.className = "value-right align-right"; + lastMonthTd.textContent = formatNumber(item.lastMonthTotal); + const lastMonthSub = el("div", "muted", `\u2191${formatPercent(item.lastMonthInputPct)} \u2193${formatPercent(item.lastMonthOutputPct)}`); + lastMonthTd.append(lastMonthSub); + const projTd = document.createElement("td"); + projTd.className = "value-right align-right"; + projTd.textContent = formatNumber(item.projected); + tr.append(labelTd, todayTd, last30DaysTd, lastMonthTd, projTd); + tbody.append(tr); + }); + return tbody; + } + function buildModelUsageSection(stats) { + const allModels = /* @__PURE__ */ new Set([ + ...Object.keys(stats.today.modelUsage), + ...Object.keys(stats.last30Days.modelUsage), + ...Object.keys(stats.lastMonth.modelUsage) + ]); + if (allModels.size === 0) { + return null; + } + const section = el("div", "section"); + const heading = el("h3"); + heading.textContent = "\u{1F3AF} Model Usage (Tokens)"; + section.append(heading); + const table = document.createElement("table"); + table.className = "stats-table"; + const thead = document.createElement("thead"); + const headerRow = document.createElement("tr"); + const modelColHeaders = [ + { icon: "\u{1F9E0}", text: "Model", key: "name" }, + { icon: "\u{1F4C5}", text: "Today", key: "today" }, + { icon: "\u{1F4C8}", text: "Last 30 Days", key: "last30Days" }, + { icon: "\u{1F4C6}", text: "Previous Month", key: "lastMonth" }, + { icon: "\u{1F30D}", text: "Projected Year", key: "projected" } + ]; + const modelHeaderWraps = []; + modelColHeaders.forEach((h, idx) => { + const th = document.createElement("th"); + th.className = idx === 0 ? "" : "align-right"; + th.style.cursor = "pointer"; + th.style.userSelect = "none"; + th.title = `Sort by ${h.text}`; + const wrap = el("div", "period-header"); + wrap.textContent = `${h.icon} ${h.text}${getSortIndicator(h.key, modelSortKey, modelSortDir)}`; + th.append(wrap); + modelHeaderWraps.push(wrap); + th.addEventListener("click", () => { + if (modelSortKey === h.key) { + modelSortDir = modelSortDir === "asc" ? "desc" : "asc"; + } else { + modelSortKey = h.key; + modelSortDir = h.key === "name" ? "asc" : "desc"; + } + modelHeaderWraps.forEach((w, i) => { + w.textContent = `${modelColHeaders[i].icon} ${modelColHeaders[i].text}${getSortIndicator(modelColHeaders[i].key, modelSortKey, modelSortDir)}`; + }); + const newTbody = buildModelTbody(stats, Array.from(allModels)); + const oldTbody = table.querySelector("tbody"); + if (oldTbody) { + table.replaceChild(newTbody, oldTbody); + } else { + table.append(newTbody); + } + saveSortSettings(); + }); + headerRow.append(th); + }); + thead.append(headerRow); + table.append(thead); + table.append(buildModelTbody(stats, Array.from(allModels))); + section.append(table); + return section; + } + function wireButtons() { + const refresh = document.getElementById("btn-refresh"); + const chart = document.getElementById("btn-chart"); + const usage = document.getElementById("btn-usage"); + const diagnostics = document.getElementById("btn-diagnostics"); + refresh?.addEventListener("click", () => vscode.postMessage({ command: "refresh" })); + chart?.addEventListener("click", () => vscode.postMessage({ command: "showChart" })); + usage?.addEventListener("click", () => vscode.postMessage({ command: "showUsageAnalysis" })); + diagnostics?.addEventListener("click", () => vscode.postMessage({ command: "showDiagnostics" })); + const maturity = document.getElementById("btn-maturity"); + maturity?.addEventListener("click", () => vscode.postMessage({ command: "showMaturity" })); + const dashboard = document.getElementById("btn-dashboard"); + dashboard?.addEventListener("click", () => vscode.postMessage({ command: "showDashboard" })); + const environmental = document.getElementById("btn-environmental"); + environmental?.addEventListener("click", () => vscode.postMessage({ command: "showEnvironmental" })); + } + async function bootstrap() { + console.log("[CopilotTokenTracker] bootstrap called"); + const { provideVSCodeDesignSystem: provideVSCodeDesignSystem2, vsCodeButton: vsCodeButton2, vsCodeBadge: vsCodeBadge2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports)); + provideVSCodeDesignSystem2().register(vsCodeButton2(), vsCodeBadge2()); + if (initialData) { + console.log("[CopilotTokenTracker] Rendering details with initialData:", initialData); + render(initialData); + } else { + console.warn("[CopilotTokenTracker] No initialData found, rendering fallback."); + const root = document.getElementById("root"); + if (root) { + root.textContent = ""; + const fallback = document.createElement("div"); + fallback.style.padding = "16px"; + fallback.style.color = "#e7e7e7"; + fallback.textContent = "No data available."; + root.append(fallback); + } + } + } + window.addEventListener("message", (event) => { + const message = event.data; + if (message.command === "updateStats") { + render(message.data); + } + }); + void bootstrap(); +})(); +/*! Bundled license information: + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tabbable/dist/index.esm.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=details.js.map diff --git a/visualstudio-extension/src/CopilotTokenTracker/webview/diagnostics.js b/visualstudio-extension/src/CopilotTokenTracker/webview/diagnostics.js new file mode 100644 index 00000000..4ab02da3 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/webview/diagnostics.js @@ -0,0 +1,21620 @@ +"use strict"; +(() => { + var __defProp = Object.defineProperty; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); + }; + + // node_modules/@microsoft/fast-element/dist/esm/platform.js + function createMetadataLocator() { + const metadataLookup = /* @__PURE__ */ new WeakMap(); + return function(target) { + let metadata = metadataLookup.get(target); + if (metadata === void 0) { + let currentTarget = Reflect.getPrototypeOf(target); + while (metadata === void 0 && currentTarget !== null) { + metadata = metadataLookup.get(currentTarget); + currentTarget = Reflect.getPrototypeOf(currentTarget); + } + metadata = metadata === void 0 ? [] : metadata.slice(0); + metadataLookup.set(target, metadata); + } + return metadata; + }; + } + var $global, propConfig, FAST, emptyArray; + var init_platform = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/platform.js"() { + $global = (function() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + try { + return new Function("return this")(); + } catch (_a) { + return {}; + } + })(); + if ($global.trustedTypes === void 0) { + $global.trustedTypes = { createPolicy: (n, r) => r }; + } + propConfig = { + configurable: false, + enumerable: false, + writable: false + }; + if ($global.FAST === void 0) { + Reflect.defineProperty($global, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, propConfig)); + } + FAST = $global.FAST; + if (FAST.getById === void 0) { + const storage = /* @__PURE__ */ Object.create(null); + Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) { + let found = storage[id]; + if (found === void 0) { + found = initialize ? storage[id] = initialize() : null; + } + return found; + } }, propConfig)); + } + emptyArray = Object.freeze([]); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/dom.js + var updateQueue, fastHTMLPolicy, htmlPolicy, marker, _interpolationStart, _interpolationEnd, DOM; + var init_dom = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/dom.js"() { + init_platform(); + updateQueue = $global.FAST.getById(1, () => { + const tasks = []; + const pendingErrors = []; + function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } + } + function tryRunTask(task) { + try { + task.call(); + } catch (error) { + pendingErrors.push(error); + setTimeout(throwFirstError, 0); + } + } + function process() { + const capacity = 1024; + let index = 0; + while (index < tasks.length) { + tryRunTask(tasks[index]); + index++; + if (index > capacity) { + for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) { + tasks[scan] = tasks[scan + index]; + } + tasks.length -= index; + index = 0; + } + } + tasks.length = 0; + } + function enqueue(callable) { + if (tasks.length < 1) { + $global.requestAnimationFrame(process); + } + tasks.push(callable); + } + return Object.freeze({ + enqueue, + process + }); + }); + fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { + createHTML: (html2) => html2 + }); + htmlPolicy = fastHTMLPolicy; + marker = `fast-${Math.random().toString(36).substring(2, 8)}`; + _interpolationStart = `${marker}{`; + _interpolationEnd = `}${marker}`; + DOM = Object.freeze({ + /** + * Indicates whether the DOM supports the adoptedStyleSheets feature. + */ + supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, + /** + * Sets the HTML trusted types policy used by the templating engine. + * @param policy - The policy to set for HTML. + * @remarks + * This API can only be called once, for security reasons. It should be + * called by the application developer at the start of their program. + */ + setHTMLPolicy(policy) { + if (htmlPolicy !== fastHTMLPolicy) { + throw new Error("The HTML policy can only be set once."); + } + htmlPolicy = policy; + }, + /** + * Turns a string into trusted HTML using the configured trusted types policy. + * @param html - The string to turn into trusted HTML. + * @remarks + * Used internally by the template engine when creating templates + * and setting innerHTML. + */ + createHTML(html2) { + return htmlPolicy.createHTML(html2); + }, + /** + * Determines if the provided node is a template marker used by the runtime. + * @param node - The node to test. + */ + isMarker(node) { + return node && node.nodeType === 8 && node.data.startsWith(marker); + }, + /** + * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. + * @param node - The marker node to extract the index from. + */ + extractDirectiveIndexFromMarker(node) { + return parseInt(node.data.replace(`${marker}:`, "")); + }, + /** + * Creates a placeholder string suitable for marking out a location *within* + * an attribute value or HTML content. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by binding directives. + */ + createInterpolationPlaceholder(index) { + return `${_interpolationStart}${index}${_interpolationEnd}`; + }, + /** + * Creates a placeholder that manifests itself as an attribute on an + * element. + * @param attributeName - The name of the custom attribute. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by attribute directives such as `ref`, `slotted`, and `children`. + */ + createCustomAttributePlaceholder(attributeName, index) { + return `${attributeName}="${this.createInterpolationPlaceholder(index)}"`; + }, + /** + * Creates a placeholder that manifests itself as a marker within the DOM structure. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by structural directives such as `repeat`. + */ + createBlockPlaceholder(index) { + return ``; + }, + /** + * Schedules DOM update work in the next async batch. + * @param callable - The callable function or object to queue. + */ + queueUpdate: updateQueue.enqueue, + /** + * Immediately processes all work previously scheduled + * through queueUpdate. + * @remarks + * This also forces nextUpdate promises + * to resolve. + */ + processUpdates: updateQueue.process, + /** + * Resolves with the next DOM update. + */ + nextUpdate() { + return new Promise(updateQueue.enqueue); + }, + /** + * Sets an attribute value on an element. + * @param element - The element to set the attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is `null` or `undefined`, the attribute is removed, otherwise + * it is set to the provided value using the standard `setAttribute` API. + */ + setAttribute(element, attributeName, value) { + if (value === null || value === void 0) { + element.removeAttribute(attributeName); + } else { + element.setAttribute(attributeName, value); + } + }, + /** + * Sets a boolean attribute value. + * @param element - The element to set the boolean attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is true, the attribute is added; otherwise it is removed. + */ + setBooleanAttribute(element, attributeName, value) { + value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); + }, + /** + * Removes all the child nodes of the provided parent node. + * @param parent - The node to remove the children from. + */ + removeChildNodes(parent) { + for (let child = parent.firstChild; child !== null; child = parent.firstChild) { + parent.removeChild(child); + } + }, + /** + * Creates a TreeWalker configured to walk a template fragment. + * @param fragment - The fragment to walk. + */ + createTemplateWalker(fragment) { + return document.createTreeWalker( + fragment, + 133, + // element, text, comment + null, + false + ); + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js + var SubscriberSet, PropertyChangeNotifier; + var init_notifier = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js"() { + SubscriberSet = class { + /** + * Creates an instance of SubscriberSet for the specified source. + * @param source - The object source that subscribers will receive notifications from. + * @param initialSubscriber - An initial subscriber to changes. + */ + constructor(source, initialSubscriber) { + this.sub1 = void 0; + this.sub2 = void 0; + this.spillover = void 0; + this.source = source; + this.sub1 = initialSubscriber; + } + /** + * Checks whether the provided subscriber has been added to this set. + * @param subscriber - The subscriber to test for inclusion in this set. + */ + has(subscriber) { + return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + */ + subscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.has(subscriber)) { + return; + } + if (this.sub1 === void 0) { + this.sub1 = subscriber; + return; + } + if (this.sub2 === void 0) { + this.sub2 = subscriber; + return; + } + this.spillover = [this.sub1, this.sub2, subscriber]; + this.sub1 = void 0; + this.sub2 = void 0; + } else { + const index = spillover.indexOf(subscriber); + if (index === -1) { + spillover.push(subscriber); + } + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + */ + unsubscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.sub1 === subscriber) { + this.sub1 = void 0; + } else if (this.sub2 === subscriber) { + this.sub2 = void 0; + } + } else { + const index = spillover.indexOf(subscriber); + if (index !== -1) { + spillover.splice(index, 1); + } + } + } + /** + * Notifies all subscribers. + * @param args - Data passed along to subscribers during notification. + */ + notify(args) { + const spillover = this.spillover; + const source = this.source; + if (spillover === void 0) { + const sub1 = this.sub1; + const sub2 = this.sub2; + if (sub1 !== void 0) { + sub1.handleChange(source, args); + } + if (sub2 !== void 0) { + sub2.handleChange(source, args); + } + } else { + for (let i = 0, ii = spillover.length; i < ii; ++i) { + spillover[i].handleChange(source, args); + } + } + } + }; + PropertyChangeNotifier = class { + /** + * Creates an instance of PropertyChangeNotifier for the specified source. + * @param source - The object source that subscribers will receive notifications from. + */ + constructor(source) { + this.subscribers = {}; + this.sourceSubscribers = null; + this.source = source; + } + /** + * Notifies all subscribers, based on the specified property. + * @param propertyName - The property name, passed along to subscribers during notification. + */ + notify(propertyName) { + var _a; + const subscribers = this.subscribers[propertyName]; + if (subscribers !== void 0) { + subscribers.notify(propertyName); + } + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. + */ + subscribe(subscriber, propertyToWatch) { + var _a; + if (propertyToWatch) { + let subscribers = this.subscribers[propertyToWatch]; + if (subscribers === void 0) { + this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); + } + subscribers.subscribe(subscriber); + } else { + this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); + this.sourceSubscribers.subscribe(subscriber); + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. + */ + unsubscribe(subscriber, propertyToUnwatch) { + var _a; + if (propertyToUnwatch) { + const subscribers = this.subscribers[propertyToUnwatch]; + if (subscribers !== void 0) { + subscribers.unsubscribe(subscriber); + } + } else { + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/observable.js + function observable(target, nameOrAccessor) { + Observable.defineProperty(target, nameOrAccessor); + } + function volatile(target, name, descriptor) { + return Object.assign({}, descriptor, { + get: function() { + Observable.trackVolatile(); + return descriptor.get.apply(this); + } + }); + } + var Observable, contextEvent, ExecutionContext, defaultExecutionContext; + var init_observable = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/observable.js"() { + init_dom(); + init_platform(); + init_notifier(); + Observable = FAST.getById(2, () => { + const volatileRegex = /(:|&&|\|\||if)/; + const notifierLookup = /* @__PURE__ */ new WeakMap(); + const queueUpdate = DOM.queueUpdate; + let watcher = void 0; + let createArrayObserver = (array) => { + throw new Error("Must call enableArrayObservation before observing arrays."); + }; + function getNotifier(source) { + let found = source.$fastController || notifierLookup.get(source); + if (found === void 0) { + if (Array.isArray(source)) { + found = createArrayObserver(source); + } else { + notifierLookup.set(source, found = new PropertyChangeNotifier(source)); + } + } + return found; + } + const getAccessors = createMetadataLocator(); + class DefaultObservableAccessor { + constructor(name) { + this.name = name; + this.field = `_${name}`; + this.callback = `${name}Changed`; + } + getValue(source) { + if (watcher !== void 0) { + watcher.watch(source, this.name); + } + return source[this.field]; + } + setValue(source, newValue) { + const field = this.field; + const oldValue = source[field]; + if (oldValue !== newValue) { + source[field] = newValue; + const callback = source[this.callback]; + if (typeof callback === "function") { + callback.call(source, oldValue, newValue); + } + getNotifier(source).notify(this.name); + } + } + } + class BindingObserverImplementation extends SubscriberSet { + constructor(binding, initialSubscriber, isVolatileBinding = false) { + super(binding, initialSubscriber); + this.binding = binding; + this.isVolatileBinding = isVolatileBinding; + this.needsRefresh = true; + this.needsQueue = true; + this.first = this; + this.last = null; + this.propertySource = void 0; + this.propertyName = void 0; + this.notifier = void 0; + this.next = void 0; + } + observe(source, context) { + if (this.needsRefresh && this.last !== null) { + this.disconnect(); + } + const previousWatcher = watcher; + watcher = this.needsRefresh ? this : void 0; + this.needsRefresh = this.isVolatileBinding; + const result = this.binding(source, context); + watcher = previousWatcher; + return result; + } + disconnect() { + if (this.last !== null) { + let current = this.first; + while (current !== void 0) { + current.notifier.unsubscribe(this, current.propertyName); + current = current.next; + } + this.last = null; + this.needsRefresh = this.needsQueue = true; + } + } + watch(propertySource, propertyName) { + const prev = this.last; + const notifier = getNotifier(propertySource); + const current = prev === null ? this.first : {}; + current.propertySource = propertySource; + current.propertyName = propertyName; + current.notifier = notifier; + notifier.subscribe(this, propertyName); + if (prev !== null) { + if (!this.needsRefresh) { + let prevValue; + watcher = void 0; + prevValue = prev.propertySource[prev.propertyName]; + watcher = this; + if (propertySource === prevValue) { + this.needsRefresh = true; + } + } + prev.next = current; + } + this.last = current; + } + handleChange() { + if (this.needsQueue) { + this.needsQueue = false; + queueUpdate(this); + } + } + call() { + if (this.last !== null) { + this.needsQueue = true; + this.notify(this); + } + } + records() { + let next = this.first; + return { + next: () => { + const current = next; + if (current === void 0) { + return { value: void 0, done: true }; + } else { + next = next.next; + return { + value: current, + done: false + }; + } + }, + [Symbol.iterator]: function() { + return this; + } + }; + } + } + return Object.freeze({ + /** + * @internal + * @param factory - The factory used to create array observers. + */ + setArrayObserverFactory(factory) { + createArrayObserver = factory; + }, + /** + * Gets a notifier for an object or Array. + * @param source - The object or Array to get the notifier for. + */ + getNotifier, + /** + * Records a property change for a source object. + * @param source - The object to record the change against. + * @param propertyName - The property to track as changed. + */ + track(source, propertyName) { + if (watcher !== void 0) { + watcher.watch(source, propertyName); + } + }, + /** + * Notifies watchers that the currently executing property getter or function is volatile + * with respect to its observable dependencies. + */ + trackVolatile() { + if (watcher !== void 0) { + watcher.needsRefresh = true; + } + }, + /** + * Notifies subscribers of a source object of changes. + * @param source - the object to notify of changes. + * @param args - The change args to pass to subscribers. + */ + notify(source, args) { + getNotifier(source).notify(args); + }, + /** + * Defines an observable property on an object or prototype. + * @param target - The target object to define the observable on. + * @param nameOrAccessor - The name of the property to define as observable; + * or a custom accessor that specifies the property name and accessor implementation. + */ + defineProperty(target, nameOrAccessor) { + if (typeof nameOrAccessor === "string") { + nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); + } + getAccessors(target).push(nameOrAccessor); + Reflect.defineProperty(target, nameOrAccessor.name, { + enumerable: true, + get: function() { + return nameOrAccessor.getValue(this); + }, + set: function(newValue) { + nameOrAccessor.setValue(this, newValue); + } + }); + }, + /** + * Finds all the observable accessors defined on the target, + * including its prototype chain. + * @param target - The target object to search for accessor on. + */ + getAccessors, + /** + * Creates a {@link BindingObserver} that can watch the + * provided {@link Binding} for changes. + * @param binding - The binding to observe. + * @param initialSubscriber - An initial subscriber to changes in the binding value. + * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. + */ + binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) { + return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding); + }, + /** + * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated + * on every evaluation of the value. + * @param binding - The binding to inspect. + */ + isVolatileBinding(binding) { + return volatileRegex.test(binding.toString()); + } + }); + }); + contextEvent = FAST.getById(3, () => { + let current = null; + return { + get() { + return current; + }, + set(event) { + current = event; + } + }; + }); + ExecutionContext = class { + constructor() { + this.index = 0; + this.length = 0; + this.parent = null; + this.parentContext = null; + } + /** + * The current event within an event handler. + */ + get event() { + return contextEvent.get(); + } + /** + * Indicates whether the current item within a repeat context + * has an even index. + */ + get isEven() { + return this.index % 2 === 0; + } + /** + * Indicates whether the current item within a repeat context + * has an odd index. + */ + get isOdd() { + return this.index % 2 !== 0; + } + /** + * Indicates whether the current item within a repeat context + * is the first item in the collection. + */ + get isFirst() { + return this.index === 0; + } + /** + * Indicates whether the current item within a repeat context + * is somewhere in the middle of the collection. + */ + get isInMiddle() { + return !this.isFirst && !this.isLast; + } + /** + * Indicates whether the current item within a repeat context + * is the last item in the collection. + */ + get isLast() { + return this.index === this.length - 1; + } + /** + * Sets the event for the current execution context. + * @param event - The event to set. + * @internal + */ + static setEvent(event) { + contextEvent.set(event); + } + }; + Observable.defineProperty(ExecutionContext.prototype, "index"); + Observable.defineProperty(ExecutionContext.prototype, "length"); + defaultExecutionContext = Object.seal(new ExecutionContext()); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js + var HTMLDirective, TargetedHTMLDirective, AttachedBehaviorHTMLDirective; + var init_html_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js"() { + init_dom(); + HTMLDirective = class { + constructor() { + this.targetIndex = 0; + } + }; + TargetedHTMLDirective = class extends HTMLDirective { + constructor() { + super(...arguments); + this.createPlaceholder = DOM.createInterpolationPlaceholder; + } + }; + AttachedBehaviorHTMLDirective = class extends HTMLDirective { + /** + * + * @param name - The name of the behavior; used as a custom attribute on the element. + * @param behavior - The behavior to instantiate and attach to the element. + * @param options - Options to pass to the behavior during creation. + */ + constructor(name, behavior, options) { + super(); + this.name = name; + this.behavior = behavior; + this.options = options; + } + /** + * Creates a placeholder string based on the directive's index within the template. + * @param index - The index of the directive within the template. + * @remarks + * Creates a custom attribute placeholder. + */ + createPlaceholder(index) { + return DOM.createCustomAttributePlaceholder(this.name, index); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + * @remarks + * Creates an instance of the `behavior` type this directive was constructed with + * and passes the target and options to that `behavior`'s constructor. + */ + createBehavior(target) { + return new this.behavior(target, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/binding.js + function normalBind(source, context) { + this.source = source; + this.context = context; + if (this.bindingObserver === null) { + this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); + } + this.updateTarget(this.bindingObserver.observe(source, context)); + } + function triggerBind(source, context) { + this.source = source; + this.context = context; + this.target.addEventListener(this.targetName, this); + } + function normalUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + } + function contentUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.unbind(); + view.needsBindOnly = true; + } + } + function triggerUnbind() { + this.target.removeEventListener(this.targetName, this); + this.source = null; + this.context = null; + } + function updateAttributeTarget(value) { + DOM.setAttribute(this.target, this.targetName, value); + } + function updateBooleanAttributeTarget(value) { + DOM.setBooleanAttribute(this.target, this.targetName, value); + } + function updateContentTarget(value) { + if (value === null || value === void 0) { + value = ""; + } + if (value.create) { + this.target.textContent = ""; + let view = this.target.$fastView; + if (view === void 0) { + view = value.create(); + } else { + if (this.target.$fastTemplate !== value) { + if (view.isComposed) { + view.remove(); + view.unbind(); + } + view = value.create(); + } + } + if (!view.isComposed) { + view.isComposed = true; + view.bind(this.source, this.context); + view.insertBefore(this.target); + this.target.$fastView = view; + this.target.$fastTemplate = value; + } else if (view.needsBindOnly) { + view.needsBindOnly = false; + view.bind(this.source, this.context); + } + } else { + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.isComposed = false; + view.remove(); + if (view.needsBindOnly) { + view.needsBindOnly = false; + } else { + view.unbind(); + } + } + this.target.textContent = value; + } + } + function updatePropertyTarget(value) { + this.target[this.targetName] = value; + } + function updateClassTarget(value) { + const classVersions = this.classVersions || /* @__PURE__ */ Object.create(null); + const target = this.target; + let version = this.version || 0; + if (value !== null && value !== void 0 && value.length) { + const names = value.split(/\s+/); + for (let i = 0, ii = names.length; i < ii; ++i) { + const currentName = names[i]; + if (currentName === "") { + continue; + } + classVersions[currentName] = version; + target.classList.add(currentName); + } + } + this.classVersions = classVersions; + this.version = version + 1; + if (version === 0) { + return; + } + version -= 1; + for (const name in classVersions) { + if (classVersions[name] === version) { + target.classList.remove(name); + } + } + } + var HTMLBindingDirective, BindingBehavior; + var init_binding = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/binding.js"() { + init_dom(); + init_observable(); + init_html_directive(); + HTMLBindingDirective = class extends TargetedHTMLDirective { + /** + * Creates an instance of BindingDirective. + * @param binding - A binding that returns the data used to update the DOM. + */ + constructor(binding) { + super(); + this.binding = binding; + this.bind = normalBind; + this.unbind = normalUnbind; + this.updateTarget = updateAttributeTarget; + this.isBindingVolatile = Observable.isVolatileBinding(this.binding); + } + /** + * Gets/sets the name of the attribute or property that this + * binding is targeting. + */ + get targetName() { + return this.originalTargetName; + } + set targetName(value) { + this.originalTargetName = value; + if (value === void 0) { + return; + } + switch (value[0]) { + case ":": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updatePropertyTarget; + if (this.cleanedTargetName === "innerHTML") { + const binding = this.binding; + this.binding = (s, c) => DOM.createHTML(binding(s, c)); + } + break; + case "?": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updateBooleanAttributeTarget; + break; + case "@": + this.cleanedTargetName = value.substr(1); + this.bind = triggerBind; + this.unbind = triggerUnbind; + break; + default: + this.cleanedTargetName = value; + if (value === "class") { + this.updateTarget = updateClassTarget; + } + break; + } + } + /** + * Makes this binding target the content of an element rather than + * a particular attribute or property. + */ + targetAtContent() { + this.updateTarget = updateContentTarget; + this.unbind = contentUnbind; + } + /** + * Creates the runtime BindingBehavior instance based on the configuration + * information stored in the BindingDirective. + * @param target - The target node that the binding behavior should attach to. + */ + createBehavior(target) { + return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); + } + }; + BindingBehavior = class { + /** + * Creates an instance of BindingBehavior. + * @param target - The target of the data updates. + * @param binding - The binding that returns the latest value for an update. + * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. + * @param bind - The operation to perform during binding. + * @param unbind - The operation to perform during unbinding. + * @param updateTarget - The operation to perform when updating. + * @param targetName - The name of the target attribute or property to update. + */ + constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { + this.source = null; + this.context = null; + this.bindingObserver = null; + this.target = target; + this.binding = binding; + this.isBindingVolatile = isBindingVolatile; + this.bind = bind; + this.unbind = unbind; + this.updateTarget = updateTarget; + this.targetName = targetName; + } + /** @internal */ + handleChange() { + this.updateTarget(this.bindingObserver.observe(this.source, this.context)); + } + /** @internal */ + handleEvent(event) { + ExecutionContext.setEvent(event); + const result = this.binding(this.source, this.context); + ExecutionContext.setEvent(null); + if (result !== true) { + event.preventDefault(); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js + function createAggregateBinding(parts) { + if (parts.length === 1) { + return parts[0]; + } + let targetName; + const partCount = parts.length; + const finalParts = parts.map((x) => { + if (typeof x === "string") { + return () => x; + } + targetName = x.targetName || targetName; + return x.binding; + }); + const binding = (scope, context) => { + let output = ""; + for (let i = 0; i < partCount; ++i) { + output += finalParts[i](scope, context); + } + return output; + }; + const directive = new HTMLBindingDirective(binding); + directive.targetName = targetName; + return directive; + } + function parseContent(context, value) { + const valueParts = value.split(_interpolationStart); + if (valueParts.length === 1) { + return null; + } + const bindingParts = []; + for (let i = 0, ii = valueParts.length; i < ii; ++i) { + const current = valueParts[i]; + const index = current.indexOf(_interpolationEnd); + let literal; + if (index === -1) { + literal = current; + } else { + const directiveIndex = parseInt(current.substring(0, index)); + bindingParts.push(context.directives[directiveIndex]); + literal = current.substring(index + interpolationEndLength); + } + if (literal !== "") { + bindingParts.push(literal); + } + } + return bindingParts; + } + function compileAttributes(context, node, includeBasicValues = false) { + const attributes = node.attributes; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const attr2 = attributes[i]; + const attrValue = attr2.value; + const parseResult = parseContent(context, attrValue); + let result = null; + if (parseResult === null) { + if (includeBasicValues) { + result = new HTMLBindingDirective(() => attrValue); + result.targetName = attr2.name; + } + } else { + result = createAggregateBinding(parseResult); + } + if (result !== null) { + node.removeAttributeNode(attr2); + i--; + ii--; + context.addFactory(result); + } + } + } + function compileContent(context, node, walker) { + const parseResult = parseContent(context, node.textContent); + if (parseResult !== null) { + let lastNode = node; + for (let i = 0, ii = parseResult.length; i < ii; ++i) { + const currentPart = parseResult[i]; + const currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); + if (typeof currentPart === "string") { + currentNode.textContent = currentPart; + } else { + currentNode.textContent = " "; + context.captureContentBinding(currentPart); + } + lastNode = currentNode; + context.targetIndex++; + if (currentNode !== node) { + walker.nextNode(); + } + } + context.targetIndex--; + } + } + function compileTemplate(template, directives) { + const fragment = template.content; + document.adoptNode(fragment); + const context = CompilationContext.borrow(directives); + compileAttributes(context, template, true); + const hostBehaviorFactories = context.behaviorFactories; + context.reset(); + const walker = DOM.createTemplateWalker(fragment); + let node; + while (node = walker.nextNode()) { + context.targetIndex++; + switch (node.nodeType) { + case 1: + compileAttributes(context, node); + break; + case 3: + compileContent(context, node, walker); + break; + case 8: + if (DOM.isMarker(node)) { + context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); + } + } + } + let targetOffset = 0; + if ( + // If the first node in a fragment is a marker, that means it's an unstable first node, + // because something like a when, repeat, etc. could add nodes before the marker. + // To mitigate this, we insert a stable first node. However, if we insert a node, + // that will alter the result of the TreeWalker. So, we also need to offset the target index. + DOM.isMarker(fragment.firstChild) || // Or if there is only one node and a directive, it means the template's content + // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by + // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. + fragment.childNodes.length === 1 && directives.length + ) { + fragment.insertBefore(document.createComment(""), fragment.firstChild); + targetOffset = -1; + } + const viewBehaviorFactories = context.behaviorFactories; + context.release(); + return { + fragment, + viewBehaviorFactories, + hostBehaviorFactories, + targetOffset + }; + } + var sharedContext, CompilationContext, interpolationEndLength; + var init_compiler = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js"() { + init_dom(); + init_binding(); + sharedContext = null; + CompilationContext = class _CompilationContext { + addFactory(factory) { + factory.targetIndex = this.targetIndex; + this.behaviorFactories.push(factory); + } + captureContentBinding(directive) { + directive.targetAtContent(); + this.addFactory(directive); + } + reset() { + this.behaviorFactories = []; + this.targetIndex = -1; + } + release() { + sharedContext = this; + } + static borrow(directives) { + const shareable = sharedContext || new _CompilationContext(); + shareable.directives = directives; + shareable.reset(); + sharedContext = null; + return shareable; + } + }; + interpolationEndLength = _interpolationEnd.length; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/view.js + var range, HTMLView; + var init_view = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/view.js"() { + range = document.createRange(); + HTMLView = class { + /** + * Constructs an instance of HTMLView. + * @param fragment - The html fragment that contains the nodes for this view. + * @param behaviors - The behaviors to be applied to this view. + */ + constructor(fragment, behaviors) { + this.fragment = fragment; + this.behaviors = behaviors; + this.source = null; + this.context = null; + this.firstChild = fragment.firstChild; + this.lastChild = fragment.lastChild; + } + /** + * Appends the view's DOM nodes to the referenced node. + * @param node - The parent node to append the view's DOM nodes to. + */ + appendTo(node) { + node.appendChild(this.fragment); + } + /** + * Inserts the view's DOM nodes before the referenced node. + * @param node - The node to insert the view's DOM before. + */ + insertBefore(node) { + if (this.fragment.hasChildNodes()) { + node.parentNode.insertBefore(this.fragment, node); + } else { + const end = this.lastChild; + if (node.previousSibling === end) + return; + const parentNode = node.parentNode; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parentNode.insertBefore(current, node); + current = next; + } + parentNode.insertBefore(end, node); + } + } + /** + * Removes the view's DOM nodes. + * The nodes are not disposed and the view can later be re-inserted. + */ + remove() { + const fragment = this.fragment; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + fragment.appendChild(current); + current = next; + } + fragment.appendChild(end); + } + /** + * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. + * Once a view has been disposed, it cannot be inserted or bound again. + */ + dispose() { + const parent = this.firstChild.parentNode; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parent.removeChild(current); + current = next; + } + parent.removeChild(end); + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + } + /** + * Binds a view's behaviors to its binding source. + * @param source - The binding source for the view's binding behaviors. + * @param context - The execution context to run the behaviors within. + */ + bind(source, context) { + const behaviors = this.behaviors; + if (this.source === source) { + return; + } else if (this.source !== null) { + const oldSource = this.source; + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + const current = behaviors[i]; + current.unbind(oldSource); + current.bind(source, context); + } + } else { + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].bind(source, context); + } + } + } + /** + * Unbinds a view's behaviors from its binding source. + */ + unbind() { + if (this.source === null) { + return; + } + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + this.source = null; + } + /** + * Efficiently disposes of a contiguous range of synthetic view instances. + * @param views - A contiguous range of views to be disposed. + */ + static disposeContiguousBatch(views) { + if (views.length === 0) { + return; + } + range.setStartBefore(views[0].firstChild); + range.setEndAfter(views[views.length - 1].lastChild); + range.deleteContents(); + for (let i = 0, ii = views.length; i < ii; ++i) { + const view = views[i]; + const behaviors = view.behaviors; + const oldSource = view.source; + for (let j = 0, jj = behaviors.length; j < jj; ++j) { + behaviors[j].unbind(oldSource); + } + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/template.js + function html(strings, ...values) { + const directives = []; + let html2 = ""; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + const currentString = strings[i]; + let value = values[i]; + html2 += currentString; + if (value instanceof ViewTemplate) { + const template = value; + value = () => template; + } + if (typeof value === "function") { + value = new HTMLBindingDirective(value); + } + if (value instanceof TargetedHTMLDirective) { + const match = lastAttributeNameRegex.exec(currentString); + if (match !== null) { + value.targetName = match[2]; + } + } + if (value instanceof HTMLDirective) { + html2 += value.createPlaceholder(directives.length); + directives.push(value); + } else { + html2 += value; + } + } + html2 += strings[strings.length - 1]; + return new ViewTemplate(html2, directives); + } + var ViewTemplate, lastAttributeNameRegex; + var init_template = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/template.js"() { + init_dom(); + init_observable(); + init_compiler(); + init_view(); + init_html_directive(); + init_binding(); + ViewTemplate = class { + /** + * Creates an instance of ViewTemplate. + * @param html - The html representing what this template will instantiate, including placeholders for directives. + * @param directives - The directives that will be connected to placeholders in the html. + */ + constructor(html2, directives) { + this.behaviorCount = 0; + this.hasHostBehaviors = false; + this.fragment = null; + this.targetOffset = 0; + this.viewBehaviorFactories = null; + this.hostBehaviorFactories = null; + this.html = html2; + this.directives = directives; + } + /** + * Creates an HTMLView instance based on this template definition. + * @param hostBindingTarget - The element that host behaviors will be bound to. + */ + create(hostBindingTarget) { + if (this.fragment === null) { + let template; + const html2 = this.html; + if (typeof html2 === "string") { + template = document.createElement("template"); + template.innerHTML = DOM.createHTML(html2); + const fec = template.content.firstElementChild; + if (fec !== null && fec.tagName === "TEMPLATE") { + template = fec; + } + } else { + template = html2; + } + const result = compileTemplate(template, this.directives); + this.fragment = result.fragment; + this.viewBehaviorFactories = result.viewBehaviorFactories; + this.hostBehaviorFactories = result.hostBehaviorFactories; + this.targetOffset = result.targetOffset; + this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; + this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; + } + const fragment = this.fragment.cloneNode(true); + const viewFactories = this.viewBehaviorFactories; + const behaviors = new Array(this.behaviorCount); + const walker = DOM.createTemplateWalker(fragment); + let behaviorIndex = 0; + let targetIndex = this.targetOffset; + let node = walker.nextNode(); + for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { + const factory = viewFactories[behaviorIndex]; + const factoryIndex = factory.targetIndex; + while (node !== null) { + if (targetIndex === factoryIndex) { + behaviors[behaviorIndex] = factory.createBehavior(node); + break; + } else { + node = walker.nextNode(); + targetIndex++; + } + } + } + if (this.hasHostBehaviors) { + const hostFactories = this.hostBehaviorFactories; + for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) { + behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); + } + } + return new HTMLView(fragment, behaviors); + } + /** + * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. + * @param source - The data source to bind the template to. + * @param host - The Element where the template will be rendered. + * @param hostBindingTarget - An HTML element to target the host bindings at if different from the + * host that the template is being attached to. + */ + render(source, host, hostBindingTarget) { + if (typeof host === "string") { + host = document.getElementById(host); + } + if (hostBindingTarget === void 0) { + hostBindingTarget = host; + } + const view = this.create(hostBindingTarget); + view.bind(source, defaultExecutionContext); + view.appendTo(host); + return view; + } + }; + lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ + /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js + function reduceStyles(styles) { + return styles.map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x]).reduce((prev, curr) => prev.concat(curr), []); + } + function reduceBehaviors(styles) { + return styles.map((x) => x instanceof ElementStyles ? x.behaviors : null).reduce((prev, curr) => { + if (curr === null) { + return prev; + } + if (prev === null) { + prev = []; + } + return prev.concat(curr); + }, null); + } + function separateSheetsToPrepend(sheets) { + const prepend = []; + const append = []; + sheets.forEach((x) => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x)); + return { prepend, append }; + } + function getNextStyleClass() { + return `fast-style-class-${++styleClassId}`; + } + var ElementStyles, prependToAdoptedStyleSheetsSymbol, addAdoptedStyleSheets, removeAdoptedStyleSheets, AdoptedStyleSheetsStyles, styleClassId, StyleElementStyles; + var init_element_styles = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js"() { + init_dom(); + ElementStyles = class { + constructor() { + this.targets = /* @__PURE__ */ new WeakSet(); + } + /** @internal */ + addStylesTo(target) { + this.targets.add(target); + } + /** @internal */ + removeStylesFrom(target) { + this.targets.delete(target); + } + /** @internal */ + isAttachedTo(target) { + return this.targets.has(target); + } + /** + * Associates behaviors with this set of styles. + * @param behaviors - The behaviors to associate. + */ + withBehaviors(...behaviors) { + this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); + return this; + } + }; + ElementStyles.create = (() => { + if (DOM.supportsAdoptedStyleSheets) { + const styleSheetCache = /* @__PURE__ */ new Map(); + return (styles) => ( + // eslint-disable-next-line @typescript-eslint/no-use-before-define + new AdoptedStyleSheetsStyles(styles, styleSheetCache) + ); + } + return (styles) => new StyleElementStyles(styles); + })(); + prependToAdoptedStyleSheetsSymbol = /* @__PURE__ */ Symbol("prependToAdoptedStyleSheets"); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append]; + }; + removeAdoptedStyleSheets = (target, sheets) => { + target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1); + }; + if (DOM.supportsAdoptedStyleSheets) { + try { + document.adoptedStyleSheets.push(); + document.adoptedStyleSheets.splice(); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets.splice(0, 0, ...prepend); + target.adoptedStyleSheets.push(...append); + }; + removeAdoptedStyleSheets = (target, sheets) => { + for (const sheet of sheets) { + const index = target.adoptedStyleSheets.indexOf(sheet); + if (index !== -1) { + target.adoptedStyleSheets.splice(index, 1); + } + } + }; + } catch (e) { + } + } + AdoptedStyleSheetsStyles = class extends ElementStyles { + constructor(styles, styleSheetCache) { + super(); + this.styles = styles; + this.styleSheetCache = styleSheetCache; + this._styleSheets = void 0; + this.behaviors = reduceBehaviors(styles); + } + get styleSheets() { + if (this._styleSheets === void 0) { + const styles = this.styles; + const styleSheetCache = this.styleSheetCache; + this._styleSheets = reduceStyles(styles).map((x) => { + if (x instanceof CSSStyleSheet) { + return x; + } + let sheet = styleSheetCache.get(x); + if (sheet === void 0) { + sheet = new CSSStyleSheet(); + sheet.replaceSync(x); + styleSheetCache.set(x, sheet); + } + return sheet; + }); + } + return this._styleSheets; + } + addStylesTo(target) { + addAdoptedStyleSheets(target, this.styleSheets); + super.addStylesTo(target); + } + removeStylesFrom(target) { + removeAdoptedStyleSheets(target, this.styleSheets); + super.removeStylesFrom(target); + } + }; + styleClassId = 0; + StyleElementStyles = class extends ElementStyles { + constructor(styles) { + super(); + this.styles = styles; + this.behaviors = null; + this.behaviors = reduceBehaviors(styles); + this.styleSheets = reduceStyles(styles); + this.styleClass = getNextStyleClass(); + } + addStylesTo(target) { + const styleSheets = this.styleSheets; + const styleClass = this.styleClass; + target = this.normalizeTarget(target); + for (let i = 0; i < styleSheets.length; i++) { + const element = document.createElement("style"); + element.innerHTML = styleSheets[i]; + element.className = styleClass; + target.append(element); + } + super.addStylesTo(target); + } + removeStylesFrom(target) { + target = this.normalizeTarget(target); + const styles = target.querySelectorAll(`.${this.styleClass}`); + for (let i = 0, ii = styles.length; i < ii; ++i) { + target.removeChild(styles[i]); + } + super.removeStylesFrom(target); + } + isAttachedTo(target) { + return super.isAttachedTo(this.normalizeTarget(target)); + } + normalizeTarget(target) { + return target === document ? document.body : target; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/attributes.js + function attr(configOrTarget, prop) { + let config; + function decorator($target, $prop) { + if (arguments.length > 1) { + config.property = $prop; + } + AttributeConfiguration.locate($target.constructor).push(config); + } + if (arguments.length > 1) { + config = {}; + decorator(configOrTarget, prop); + return; + } + config = configOrTarget === void 0 ? {} : configOrTarget; + return decorator; + } + var AttributeConfiguration, booleanConverter, nullableNumberConverter, AttributeDefinition; + var init_attributes = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/attributes.js"() { + init_observable(); + init_dom(); + init_platform(); + AttributeConfiguration = Object.freeze({ + /** + * Locates all attribute configurations associated with a type. + */ + locate: createMetadataLocator() + }); + booleanConverter = { + toView(value) { + return value ? "true" : "false"; + }, + fromView(value) { + if (value === null || value === void 0 || value === "false" || value === false || value === 0) { + return false; + } + return true; + } + }; + nullableNumberConverter = { + toView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number.toString(); + }, + fromView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number; + } + }; + AttributeDefinition = class _AttributeDefinition { + /** + * Creates an instance of AttributeDefinition. + * @param Owner - The class constructor that owns this attribute. + * @param name - The name of the property associated with the attribute. + * @param attribute - The name of the attribute in HTML. + * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. + * @param converter - A {@link ValueConverter} that integrates with the property getter/setter + * to convert values to and from a DOM string. + */ + constructor(Owner, name, attribute = name.toLowerCase(), mode = "reflect", converter) { + this.guards = /* @__PURE__ */ new Set(); + this.Owner = Owner; + this.name = name; + this.attribute = attribute; + this.mode = mode; + this.converter = converter; + this.fieldName = `_${name}`; + this.callbackName = `${name}Changed`; + this.hasCallback = this.callbackName in Owner.prototype; + if (mode === "boolean" && converter === void 0) { + this.converter = booleanConverter; + } + } + /** + * Sets the value of the attribute/property on the source element. + * @param source - The source element to access. + * @param value - The value to set the attribute/property to. + */ + setValue(source, newValue) { + const oldValue = source[this.fieldName]; + const converter = this.converter; + if (converter !== void 0) { + newValue = converter.fromView(newValue); + } + if (oldValue !== newValue) { + source[this.fieldName] = newValue; + this.tryReflectToAttribute(source); + if (this.hasCallback) { + source[this.callbackName](oldValue, newValue); + } + source.$fastController.notify(this.name); + } + } + /** + * Gets the value of the attribute/property on the source element. + * @param source - The source element to access. + */ + getValue(source) { + Observable.track(source, this.name); + return source[this.fieldName]; + } + /** @internal */ + onAttributeChangedCallback(element, value) { + if (this.guards.has(element)) { + return; + } + this.guards.add(element); + this.setValue(element, value); + this.guards.delete(element); + } + tryReflectToAttribute(element) { + const mode = this.mode; + const guards = this.guards; + if (guards.has(element) || mode === "fromView") { + return; + } + DOM.queueUpdate(() => { + guards.add(element); + const latestValue = element[this.fieldName]; + switch (mode) { + case "reflect": + const converter = this.converter; + DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); + break; + case "boolean": + DOM.setBooleanAttribute(element, this.attribute, latestValue); + break; + } + guards.delete(element); + }); + } + /** + * Collects all attribute definitions associated with the owner. + * @param Owner - The class constructor to collect attribute for. + * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. + * @internal + */ + static collect(Owner, ...attributeLists) { + const attributes = []; + attributeLists.push(AttributeConfiguration.locate(Owner)); + for (let i = 0, ii = attributeLists.length; i < ii; ++i) { + const list = attributeLists[i]; + if (list === void 0) { + continue; + } + for (let j = 0, jj = list.length; j < jj; ++j) { + const config = list[j]; + if (typeof config === "string") { + attributes.push(new _AttributeDefinition(Owner, config)); + } else { + attributes.push(new _AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); + } + } + } + return attributes; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js + var defaultShadowOptions, defaultElementOptions, fastRegistry, FASTElementDefinition; + var init_fast_definitions = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js"() { + init_platform(); + init_observable(); + init_element_styles(); + init_attributes(); + defaultShadowOptions = { mode: "open" }; + defaultElementOptions = {}; + fastRegistry = FAST.getById(4, () => { + const typeToDefinition = /* @__PURE__ */ new Map(); + return Object.freeze({ + register(definition) { + if (typeToDefinition.has(definition.type)) { + return false; + } + typeToDefinition.set(definition.type, definition); + return true; + }, + getByType(key) { + return typeToDefinition.get(key); + } + }); + }); + FASTElementDefinition = class { + /** + * Creates an instance of FASTElementDefinition. + * @param type - The type this definition is being created for. + * @param nameOrConfig - The name of the element to define or a config object + * that describes the element to define. + */ + constructor(type, nameOrConfig = type.definition) { + if (typeof nameOrConfig === "string") { + nameOrConfig = { name: nameOrConfig }; + } + this.type = type; + this.name = nameOrConfig.name; + this.template = nameOrConfig.template; + const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); + const observedAttributes = new Array(attributes.length); + const propertyLookup = {}; + const attributeLookup = {}; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const current = attributes[i]; + observedAttributes[i] = current.attribute; + propertyLookup[current.name] = current; + attributeLookup[current.attribute] = current; + } + this.attributes = attributes; + this.observedAttributes = observedAttributes; + this.propertyLookup = propertyLookup; + this.attributeLookup = attributeLookup; + this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); + this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); + this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof ElementStyles ? nameOrConfig.styles : ElementStyles.create([nameOrConfig.styles]); + } + /** + * Indicates if this element has been defined in at least one registry. + */ + get isDefined() { + return !!fastRegistry.getByType(this.type); + } + /** + * Defines a custom element based on this definition. + * @param registry - The element registry to define the element in. + */ + define(registry = customElements) { + const type = this.type; + if (fastRegistry.register(this)) { + const attributes = this.attributes; + const proto = type.prototype; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + Observable.defineProperty(proto, attributes[i]); + } + Reflect.defineProperty(type, "observedAttributes", { + value: this.observedAttributes, + enumerable: true + }); + } + if (!registry.get(this.name)) { + registry.define(this.name, type, this.elementOptions); + } + return this; + } + }; + FASTElementDefinition.forType = fastRegistry.getByType; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/controller.js + function getShadowRoot(element) { + return element.shadowRoot || shadowRoots.get(element) || null; + } + var shadowRoots, defaultEventOptions, Controller; + var init_controller = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/controller.js"() { + init_dom(); + init_notifier(); + init_observable(); + init_fast_definitions(); + shadowRoots = /* @__PURE__ */ new WeakMap(); + defaultEventOptions = { + bubbles: true, + composed: true, + cancelable: true + }; + Controller = class _Controller extends PropertyChangeNotifier { + /** + * Creates a Controller to control the specified element. + * @param element - The element to be controlled by this controller. + * @param definition - The element definition metadata that instructs this + * controller in how to handle rendering and other platform integrations. + * @internal + */ + constructor(element, definition) { + super(element); + this.boundObservables = null; + this.behaviors = null; + this.needsInitialization = true; + this._template = null; + this._styles = null; + this._isConnected = false; + this.$fastController = this; + this.view = null; + this.element = element; + this.definition = definition; + const shadowOptions = definition.shadowOptions; + if (shadowOptions !== void 0) { + const shadowRoot = element.attachShadow(shadowOptions); + if (shadowOptions.mode === "closed") { + shadowRoots.set(element, shadowRoot); + } + } + const accessors = Observable.getAccessors(element); + if (accessors.length > 0) { + const boundObservables = this.boundObservables = /* @__PURE__ */ Object.create(null); + for (let i = 0, ii = accessors.length; i < ii; ++i) { + const propertyName = accessors[i].name; + const value = element[propertyName]; + if (value !== void 0) { + delete element[propertyName]; + boundObservables[propertyName] = value; + } + } + } + } + /** + * Indicates whether or not the custom element has been + * connected to the document. + */ + get isConnected() { + Observable.track(this, "isConnected"); + return this._isConnected; + } + setIsConnected(value) { + this._isConnected = value; + Observable.notify(this, "isConnected"); + } + /** + * Gets/sets the template used to render the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get template() { + return this._template; + } + set template(value) { + if (this._template === value) { + return; + } + this._template = value; + if (!this.needsInitialization) { + this.renderTemplate(value); + } + } + /** + * Gets/sets the primary styles used for the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get styles() { + return this._styles; + } + set styles(value) { + if (this._styles === value) { + return; + } + if (this._styles !== null) { + this.removeStyles(this._styles); + } + this._styles = value; + if (!this.needsInitialization && value !== null) { + this.addStyles(value); + } + } + /** + * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. + * @param styles - The styles to add. + */ + addStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.append(styles); + } else if (!styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.addStylesTo(target); + if (sourceBehaviors !== null) { + this.addBehaviors(sourceBehaviors); + } + } + } + /** + * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. + * @param styles - the styles to remove. + */ + removeStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.removeChild(styles); + } else if (styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.removeStylesFrom(target); + if (sourceBehaviors !== null) { + this.removeBehaviors(sourceBehaviors); + } + } + } + /** + * Adds behaviors to this element. + * @param behaviors - The behaviors to add. + */ + addBehaviors(behaviors) { + const targetBehaviors = this.behaviors || (this.behaviors = /* @__PURE__ */ new Map()); + const length = behaviors.length; + const behaviorsToBind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); + } else { + targetBehaviors.set(behavior, 1); + behaviorsToBind.push(behavior); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToBind.length; ++i) { + behaviorsToBind[i].bind(element, defaultExecutionContext); + } + } + } + /** + * Removes behaviors from this element. + * @param behaviors - The behaviors to remove. + * @param force - Forces unbinding of behaviors. + */ + removeBehaviors(behaviors, force = false) { + const targetBehaviors = this.behaviors; + if (targetBehaviors === null) { + return; + } + const length = behaviors.length; + const behaviorsToUnbind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + const count = targetBehaviors.get(behavior) - 1; + count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToUnbind.length; ++i) { + behaviorsToUnbind[i].unbind(element); + } + } + } + /** + * Runs connected lifecycle behavior on the associated element. + */ + onConnectedCallback() { + if (this._isConnected) { + return; + } + const element = this.element; + if (this.needsInitialization) { + this.finishInitialization(); + } else if (this.view !== null) { + this.view.bind(element, defaultExecutionContext); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + for (const [behavior] of behaviors) { + behavior.bind(element, defaultExecutionContext); + } + } + this.setIsConnected(true); + } + /** + * Runs disconnected lifecycle behavior on the associated element. + */ + onDisconnectedCallback() { + if (!this._isConnected) { + return; + } + this.setIsConnected(false); + const view = this.view; + if (view !== null) { + view.unbind(); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + const element = this.element; + for (const [behavior] of behaviors) { + behavior.unbind(element); + } + } + } + /** + * Runs the attribute changed callback for the associated element. + * @param name - The name of the attribute that changed. + * @param oldValue - The previous value of the attribute. + * @param newValue - The new value of the attribute. + */ + onAttributeChangedCallback(name, oldValue, newValue) { + const attrDef = this.definition.attributeLookup[name]; + if (attrDef !== void 0) { + attrDef.onAttributeChangedCallback(this.element, newValue); + } + } + /** + * Emits a custom HTML event. + * @param type - The type name of the event. + * @param detail - The event detail object to send with the event. + * @param options - The event options. By default bubbles and composed. + * @remarks + * Only emits events if connected. + */ + emit(type, detail, options) { + if (this._isConnected) { + return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options))); + } + return false; + } + finishInitialization() { + const element = this.element; + const boundObservables = this.boundObservables; + if (boundObservables !== null) { + const propertyNames = Object.keys(boundObservables); + for (let i = 0, ii = propertyNames.length; i < ii; ++i) { + const propertyName = propertyNames[i]; + element[propertyName] = boundObservables[propertyName]; + } + this.boundObservables = null; + } + const definition = this.definition; + if (this._template === null) { + if (this.element.resolveTemplate) { + this._template = this.element.resolveTemplate(); + } else if (definition.template) { + this._template = definition.template || null; + } + } + if (this._template !== null) { + this.renderTemplate(this._template); + } + if (this._styles === null) { + if (this.element.resolveStyles) { + this._styles = this.element.resolveStyles(); + } else if (definition.styles) { + this._styles = definition.styles || null; + } + } + if (this._styles !== null) { + this.addStyles(this._styles); + } + this.needsInitialization = false; + } + renderTemplate(template) { + const element = this.element; + const host = getShadowRoot(element) || element; + if (this.view !== null) { + this.view.dispose(); + this.view = null; + } else if (!this.needsInitialization) { + DOM.removeChildNodes(host); + } + if (template) { + this.view = template.render(element, host, element); + } + } + /** + * Locates or creates a controller for the specified element. + * @param element - The element to return the controller for. + * @remarks + * The specified element must have a {@link FASTElementDefinition} + * registered either through the use of the {@link customElement} + * decorator or a call to `FASTElement.define`. + */ + static forCustomElement(element) { + const controller = element.$fastController; + if (controller !== void 0) { + return controller; + } + const definition = FASTElementDefinition.forType(element.constructor); + if (definition === void 0) { + throw new Error("Missing FASTElement definition."); + } + return element.$fastController = new _Controller(element, definition); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js + function createFASTElement(BaseType) { + return class extends BaseType { + constructor() { + super(); + Controller.forCustomElement(this); + } + $emit(type, detail, options) { + return this.$fastController.emit(type, detail, options); + } + connectedCallback() { + this.$fastController.onConnectedCallback(); + } + disconnectedCallback() { + this.$fastController.onDisconnectedCallback(); + } + attributeChangedCallback(name, oldValue, newValue) { + this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); + } + }; + } + var FASTElement; + var init_fast_element = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js"() { + init_controller(); + init_fast_definitions(); + FASTElement = Object.assign(createFASTElement(HTMLElement), { + /** + * Creates a new FASTElement base class inherited from the + * provided base type. + * @param BaseType - The base element type to inherit from. + */ + from(BaseType) { + return createFASTElement(BaseType); + }, + /** + * Defines a platform custom element based on the provided type and definition. + * @param type - The custom element type to define. + * @param nameOrDef - The name of the element to define or a definition object + * that describes the element to define. + */ + define(type, nameOrDef) { + return new FASTElementDefinition(type, nameOrDef).define().type; + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js + var CSSDirective; + var init_css_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js"() { + CSSDirective = class { + /** + * Creates a CSS fragment to interpolate into the CSS document. + * @returns - the string to interpolate into CSS + */ + createCSS() { + return ""; + } + /** + * Creates a behavior to bind to the host element. + * @returns - the behavior to bind to the host element, or undefined. + */ + createBehavior() { + return void 0; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css.js + function collectStyles(strings, values) { + const styles = []; + let cssString = ""; + const behaviors = []; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + cssString += strings[i]; + let value = values[i]; + if (value instanceof CSSDirective) { + const behavior = value.createBehavior(); + value = value.createCSS(); + if (behavior) { + behaviors.push(behavior); + } + } + if (value instanceof ElementStyles || value instanceof CSSStyleSheet) { + if (cssString.trim() !== "") { + styles.push(cssString); + cssString = ""; + } + styles.push(value); + } else { + cssString += value; + } + } + cssString += strings[strings.length - 1]; + if (cssString.trim() !== "") { + styles.push(cssString); + } + return { + styles, + behaviors + }; + } + function css(strings, ...values) { + const { styles, behaviors } = collectStyles(strings, values); + const elementStyles = ElementStyles.create(styles); + if (behaviors.length) { + elementStyles.withBehaviors(...behaviors); + } + return elementStyles; + } + var init_css = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css.js"() { + init_css_directive(); + init_element_styles(); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js + function newSplice(index, removed, addedCount) { + return { + index, + removed, + addedCount + }; + } + function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { + const rowCount = oldEnd - oldStart + 1; + const columnCount = currentEnd - currentStart + 1; + const distances = new Array(rowCount); + let north; + let west; + for (let i = 0; i < rowCount; ++i) { + distances[i] = new Array(columnCount); + distances[i][0] = i; + } + for (let j = 0; j < columnCount; ++j) { + distances[0][j] = j; + } + for (let i = 1; i < rowCount; ++i) { + for (let j = 1; j < columnCount; ++j) { + if (current[currentStart + j - 1] === old[oldStart + i - 1]) { + distances[i][j] = distances[i - 1][j - 1]; + } else { + north = distances[i - 1][j] + 1; + west = distances[i][j - 1] + 1; + distances[i][j] = north < west ? north : west; + } + } + } + return distances; + } + function spliceOperationsFromEditDistances(distances) { + let i = distances.length - 1; + let j = distances[0].length - 1; + let current = distances[i][j]; + const edits = []; + while (i > 0 || j > 0) { + if (i === 0) { + edits.push(EDIT_ADD); + j--; + continue; + } + if (j === 0) { + edits.push(EDIT_DELETE); + i--; + continue; + } + const northWest = distances[i - 1][j - 1]; + const west = distances[i - 1][j]; + const north = distances[i][j - 1]; + let min; + if (west < north) { + min = west < northWest ? west : northWest; + } else { + min = north < northWest ? north : northWest; + } + if (min === northWest) { + if (northWest === current) { + edits.push(EDIT_LEAVE); + } else { + edits.push(EDIT_UPDATE); + current = northWest; + } + i--; + j--; + } else if (min === west) { + edits.push(EDIT_DELETE); + i--; + current = west; + } else { + edits.push(EDIT_ADD); + j--; + current = north; + } + } + edits.reverse(); + return edits; + } + function sharedPrefix(current, old, searchLength) { + for (let i = 0; i < searchLength; ++i) { + if (current[i] !== old[i]) { + return i; + } + } + return searchLength; + } + function sharedSuffix(current, old, searchLength) { + let index1 = current.length; + let index2 = old.length; + let count = 0; + while (count < searchLength && current[--index1] === old[--index2]) { + count++; + } + return count; + } + function intersect(start1, end1, start2, end2) { + if (end1 < start2 || end2 < start1) { + return -1; + } + if (end1 === start2 || end2 === start1) { + return 0; + } + if (start1 < start2) { + if (end1 < end2) { + return end1 - start2; + } + return end2 - start2; + } + if (end2 < end1) { + return end2 - start1; + } + return end1 - start1; + } + function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { + let prefixCount = 0; + let suffixCount = 0; + const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); + if (currentStart === 0 && oldStart === 0) { + prefixCount = sharedPrefix(current, old, minLength); + } + if (currentEnd === current.length && oldEnd === old.length) { + suffixCount = sharedSuffix(current, old, minLength - prefixCount); + } + currentStart += prefixCount; + oldStart += prefixCount; + currentEnd -= suffixCount; + oldEnd -= suffixCount; + if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) { + return emptyArray; + } + if (currentStart === currentEnd) { + const splice2 = newSplice(currentStart, [], 0); + while (oldStart < oldEnd) { + splice2.removed.push(old[oldStart++]); + } + return [splice2]; + } else if (oldStart === oldEnd) { + return [newSplice(currentStart, [], currentEnd - currentStart)]; + } + const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); + const splices = []; + let splice = void 0; + let index = currentStart; + let oldIndex = oldStart; + for (let i = 0; i < ops.length; ++i) { + switch (ops[i]) { + case EDIT_LEAVE: + if (splice !== void 0) { + splices.push(splice); + splice = void 0; + } + index++; + oldIndex++; + break; + case EDIT_UPDATE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + case EDIT_ADD: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + break; + case EDIT_DELETE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + } + } + if (splice !== void 0) { + splices.push(splice); + } + return splices; + } + function mergeSplice(splices, index, removed, addedCount) { + const splice = newSplice(index, removed, addedCount); + let inserted = false; + let insertionOffset = 0; + for (let i = 0; i < splices.length; i++) { + const current = splices[i]; + current.index += insertionOffset; + if (inserted) { + continue; + } + const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount); + if (intersectCount >= 0) { + splices.splice(i, 1); + i--; + insertionOffset -= current.addedCount - current.removed.length; + splice.addedCount += current.addedCount - intersectCount; + const deleteCount = splice.removed.length + current.removed.length - intersectCount; + if (!splice.addedCount && !deleteCount) { + inserted = true; + } else { + let currentRemoved = current.removed; + if (splice.index < current.index) { + const prepend = splice.removed.slice(0, current.index - splice.index); + $push.apply(prepend, currentRemoved); + currentRemoved = prepend; + } + if (splice.index + splice.removed.length > current.index + current.addedCount) { + const append = splice.removed.slice(current.index + current.addedCount - splice.index); + $push.apply(currentRemoved, append); + } + splice.removed = currentRemoved; + if (current.index < splice.index) { + splice.index = current.index; + } + } + } else if (splice.index < current.index) { + inserted = true; + splices.splice(i, 0, splice); + i++; + const offset = splice.addedCount - splice.removed.length; + current.index += offset; + insertionOffset += offset; + } + } + if (!inserted) { + splices.push(splice); + } + } + function createInitialSplices(changeRecords) { + const splices = []; + for (let i = 0, ii = changeRecords.length; i < ii; i++) { + const record = changeRecords[i]; + mergeSplice(splices, record.index, record.removed, record.addedCount); + } + return splices; + } + function projectArraySplices(array, changeRecords) { + let splices = []; + const initialSplices = createInitialSplices(changeRecords); + for (let i = 0, ii = initialSplices.length; i < ii; ++i) { + const splice = initialSplices[i]; + if (splice.addedCount === 1 && splice.removed.length === 1) { + if (splice.removed[0] !== array[splice.index]) { + splices.push(splice); + } + continue; + } + splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length)); + } + return splices; + } + var EDIT_LEAVE, EDIT_UPDATE, EDIT_ADD, EDIT_DELETE, $push; + var init_array_change_records = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js"() { + init_platform(); + EDIT_LEAVE = 0; + EDIT_UPDATE = 1; + EDIT_ADD = 2; + EDIT_DELETE = 3; + $push = Array.prototype.push; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js + function adjustIndex(changeRecord, array) { + let index = changeRecord.index; + const arrayLength = array.length; + if (index > arrayLength) { + index = arrayLength - changeRecord.addedCount; + } else if (index < 0) { + index = arrayLength + changeRecord.removed.length + index - changeRecord.addedCount; + } + if (index < 0) { + index = 0; + } + changeRecord.index = index; + return changeRecord; + } + function enableArrayObservation() { + if (arrayObservationEnabled) { + return; + } + arrayObservationEnabled = true; + Observable.setArrayObserverFactory((collection) => { + return new ArrayObserver(collection); + }); + const proto = Array.prototype; + if (proto.$fastPatch) { + return; + } + Reflect.defineProperty(proto, "$fastPatch", { + value: 1, + enumerable: false + }); + const pop = proto.pop; + const push = proto.push; + const reverse = proto.reverse; + const shift = proto.shift; + const sort = proto.sort; + const splice = proto.splice; + const unshift = proto.unshift; + proto.pop = function() { + const notEmpty = this.length > 0; + const methodCallResult = pop.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(this.length, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.push = function() { + const methodCallResult = push.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this)); + } + return methodCallResult; + }; + proto.reverse = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = reverse.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.shift = function() { + const notEmpty = this.length > 0; + const methodCallResult = shift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(0, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.sort = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = sort.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.splice = function() { + const methodCallResult = splice.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this)); + } + return methodCallResult; + }; + proto.unshift = function() { + const methodCallResult = unshift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this)); + } + return methodCallResult; + }; + } + var arrayObservationEnabled, ArrayObserver; + var init_array_observer = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js"() { + init_dom(); + init_array_change_records(); + init_notifier(); + init_observable(); + arrayObservationEnabled = false; + ArrayObserver = class extends SubscriberSet { + constructor(source) { + super(source); + this.oldCollection = void 0; + this.splices = void 0; + this.needsQueue = true; + this.call = this.flush; + Reflect.defineProperty(source, "$fastController", { + value: this, + enumerable: false + }); + } + subscribe(subscriber) { + this.flush(); + super.subscribe(subscriber); + } + addSplice(splice) { + if (this.splices === void 0) { + this.splices = [splice]; + } else { + this.splices.push(splice); + } + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + reset(oldCollection) { + this.oldCollection = oldCollection; + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + flush() { + const splices = this.splices; + const oldCollection = this.oldCollection; + if (splices === void 0 && oldCollection === void 0) { + return; + } + this.needsQueue = true; + this.splices = void 0; + this.oldCollection = void 0; + const finalSplices = oldCollection === void 0 ? projectArraySplices(this.source, splices) : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length); + this.notify(finalSplices); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/ref.js + function ref(propertyName) { + return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); + } + var RefBehavior; + var init_ref = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/ref.js"() { + init_html_directive(); + RefBehavior = class { + /** + * Creates an instance of RefBehavior. + * @param target - The element to reference. + * @param propertyName - The name of the property to assign the reference to. + */ + constructor(target, propertyName) { + this.target = target; + this.propertyName = propertyName; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + source[this.propertyName] = this.target; + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ + unbind() { + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/interfaces.js + var isFunction; + var init_interfaces = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/interfaces.js"() { + isFunction = (object) => typeof object === "function"; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/when.js + function normalizeBinding(value) { + return value === void 0 ? noTemplate : isFunction(value) ? value : () => value; + } + function when(binding, templateOrTemplateBinding, elseTemplateOrTemplateBinding) { + const dataBinding = isFunction(binding) ? binding : () => binding; + const templateBinding = normalizeBinding(templateOrTemplateBinding); + const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding); + return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context); + } + var noTemplate; + var init_when = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/when.js"() { + init_interfaces(); + noTemplate = () => null; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js + function bindWithoutPositioning(view, items, index, context) { + view.bind(items[index], context); + } + function bindWithPositioning(view, items, index, context) { + const childContext = Object.create(context); + childContext.index = index; + childContext.length = items.length; + view.bind(items[index], childContext); + } + var defaultRepeatOptions, RepeatBehavior, RepeatDirective; + var init_repeat = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js"() { + init_dom(); + init_observable(); + init_array_observer(); + init_platform(); + init_html_directive(); + init_view(); + defaultRepeatOptions = Object.freeze({ + positioning: false, + recycle: true + }); + RepeatBehavior = class { + /** + * Creates an instance of RepeatBehavior. + * @param location - The location in the DOM to render the repeat. + * @param itemsBinding - The array to render. + * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies. + * @param templateBinding - The template to render for each item. + * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies. + * @param options - Options used to turn on special repeat features. + */ + constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) { + this.location = location; + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.source = null; + this.views = []; + this.items = null; + this.itemsObserver = null; + this.originalContext = void 0; + this.childContext = void 0; + this.bindView = bindWithoutPositioning; + this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile); + this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile); + if (options.positioning) { + this.bindView = bindWithPositioning; + } + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source, context) { + this.source = source; + this.originalContext = context; + this.childContext = Object.create(context); + this.childContext.parent = source; + this.childContext.parentContext = this.originalContext; + this.items = this.itemsBindingObserver.observe(source, this.originalContext); + this.template = this.templateBindingObserver.observe(source, this.originalContext); + this.observeItems(true); + this.refreshAllViews(); + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.source = null; + this.items = null; + if (this.itemsObserver !== null) { + this.itemsObserver.unsubscribe(this); + } + this.unbindAllViews(); + this.itemsBindingObserver.disconnect(); + this.templateBindingObserver.disconnect(); + } + /** @internal */ + handleChange(source, args) { + if (source === this.itemsBinding) { + this.items = this.itemsBindingObserver.observe(this.source, this.originalContext); + this.observeItems(); + this.refreshAllViews(); + } else if (source === this.templateBinding) { + this.template = this.templateBindingObserver.observe(this.source, this.originalContext); + this.refreshAllViews(true); + } else { + this.updateViews(args); + } + } + observeItems(force = false) { + if (!this.items) { + this.items = emptyArray; + return; + } + const oldObserver = this.itemsObserver; + const newObserver = this.itemsObserver = Observable.getNotifier(this.items); + const hasNewObserver = oldObserver !== newObserver; + if (hasNewObserver && oldObserver !== null) { + oldObserver.unsubscribe(this); + } + if (hasNewObserver || force) { + newObserver.subscribe(this); + } + } + updateViews(splices) { + const childContext = this.childContext; + const views = this.views; + const bindView = this.bindView; + const items = this.items; + const template = this.template; + const recycle = this.options.recycle; + const leftoverViews = []; + let leftoverIndex = 0; + let availableViews = 0; + for (let i = 0, ii = splices.length; i < ii; ++i) { + const splice = splices[i]; + const removed = splice.removed; + let removeIndex = 0; + let addIndex = splice.index; + const end = addIndex + splice.addedCount; + const removedViews = views.splice(splice.index, removed.length); + const totalAvailableViews = availableViews = leftoverViews.length + removedViews.length; + for (; addIndex < end; ++addIndex) { + const neighbor = views[addIndex]; + const location = neighbor ? neighbor.firstChild : this.location; + let view; + if (recycle && availableViews > 0) { + if (removeIndex <= totalAvailableViews && removedViews.length > 0) { + view = removedViews[removeIndex]; + removeIndex++; + } else { + view = leftoverViews[leftoverIndex]; + leftoverIndex++; + } + availableViews--; + } else { + view = template.create(); + } + views.splice(addIndex, 0, view); + bindView(view, items, addIndex, childContext); + view.insertBefore(location); + } + if (removedViews[removeIndex]) { + leftoverViews.push(...removedViews.slice(removeIndex)); + } + } + for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) { + leftoverViews[i].dispose(); + } + if (this.options.positioning) { + for (let i = 0, ii = views.length; i < ii; ++i) { + const currentContext = views[i].context; + currentContext.length = ii; + currentContext.index = i; + } + } + } + refreshAllViews(templateChanged = false) { + const items = this.items; + const childContext = this.childContext; + const template = this.template; + const location = this.location; + const bindView = this.bindView; + let itemsLength = items.length; + let views = this.views; + let viewsLength = views.length; + if (itemsLength === 0 || templateChanged || !this.options.recycle) { + HTMLView.disposeContiguousBatch(views); + viewsLength = 0; + } + if (viewsLength === 0) { + this.views = views = new Array(itemsLength); + for (let i = 0; i < itemsLength; ++i) { + const view = template.create(); + bindView(view, items, i, childContext); + views[i] = view; + view.insertBefore(location); + } + } else { + let i = 0; + for (; i < itemsLength; ++i) { + if (i < viewsLength) { + const view = views[i]; + bindView(view, items, i, childContext); + } else { + const view = template.create(); + bindView(view, items, i, childContext); + views.push(view); + view.insertBefore(location); + } + } + const removed = views.splice(i, viewsLength - i); + for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) { + removed[i].dispose(); + } + } + } + unbindAllViews() { + const views = this.views; + for (let i = 0, ii = views.length; i < ii; ++i) { + views[i].unbind(); + } + } + }; + RepeatDirective = class extends HTMLDirective { + /** + * Creates an instance of RepeatDirective. + * @param itemsBinding - The binding that provides the array to render. + * @param templateBinding - The template binding used to obtain a template to render for each item in the array. + * @param options - Options used to turn on special repeat features. + */ + constructor(itemsBinding, templateBinding, options) { + super(); + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.createPlaceholder = DOM.createBlockPlaceholder; + enableArrayObservation(); + this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding); + this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + */ + createBehavior(target) { + return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js + function elements(selector) { + if (selector) { + return function(value, index, array) { + return value.nodeType === 1 && value.matches(selector); + }; + } + return function(value, index, array) { + return value.nodeType === 1; + }; + } + var NodeObservationBehavior; + var init_node_observation = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js"() { + init_observable(); + init_platform(); + NodeObservationBehavior = class { + /** + * Creates an instance of NodeObservationBehavior. + * @param target - The target to assign the nodes property on. + * @param options - The options to use in configuring node observation. + */ + constructor(target, options) { + this.target = target; + this.options = options; + this.source = null; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + const name = this.options.property; + this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name); + this.source = source; + this.updateTarget(this.computeNodes()); + if (this.shouldUpdate) { + this.observe(); + } + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.updateTarget(emptyArray); + this.source = null; + if (this.shouldUpdate) { + this.disconnect(); + } + } + /** @internal */ + handleEvent() { + this.updateTarget(this.computeNodes()); + } + computeNodes() { + let nodes = this.getNodes(); + if (this.options.filter !== void 0) { + nodes = nodes.filter(this.options.filter); + } + return nodes; + } + updateTarget(value) { + this.source[this.options.property] = value; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js + function slotted(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { property: propertyOrOptions }; + } + return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions); + } + var SlottedBehavior; + var init_slotted = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js"() { + init_html_directive(); + init_node_observation(); + SlottedBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of SlottedBehavior. + * @param target - The slot element target to observe. + * @param options - The options to use when observing the slot. + */ + constructor(target, options) { + super(target, options); + } + /** + * Begins observation of the nodes. + */ + observe() { + this.target.addEventListener("slotchange", this); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.target.removeEventListener("slotchange", this); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + return this.target.assignedNodes(this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/children.js + function children(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { + property: propertyOrOptions + }; + } + return new AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions); + } + var ChildrenBehavior; + var init_children = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/children.js"() { + init_html_directive(); + init_node_observation(); + ChildrenBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of ChildrenBehavior. + * @param target - The element target to observe children on. + * @param options - The options to use when observing the element children. + */ + constructor(target, options) { + super(target, options); + this.observer = null; + options.childList = true; + } + /** + * Begins observation of the nodes. + */ + observe() { + if (this.observer === null) { + this.observer = new MutationObserver(this.handleEvent.bind(this)); + } + this.observer.observe(this.target, this.options); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.observer.disconnect(); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + if ("subtree" in this.options) { + return Array.from(this.target.querySelectorAll(this.options.selector)); + } + return Array.from(this.target.childNodes); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/index.js + var init_esm = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/index.js"() { + init_platform(); + init_template(); + init_fast_element(); + init_fast_definitions(); + init_attributes(); + init_controller(); + init_compiler(); + init_element_styles(); + init_css(); + init_css_directive(); + init_view(); + init_observable(); + init_notifier(); + init_dom(); + init_binding(); + init_html_directive(); + init_ref(); + init_when(); + init_repeat(); + init_slotted(); + init_children(); + init_node_observation(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js + var StartEnd, endSlotTemplate, startSlotTemplate, endTemplate, startTemplate; + var init_start_end = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js"() { + init_esm(); + StartEnd = class { + handleStartContentChange() { + this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); + } + handleEndContentChange() { + this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); + } + }; + endSlotTemplate = (context, definition) => html` + definition.end ? "end" : void 0} + > + + ${definition.end || ""} + + +`; + startSlotTemplate = (context, definition) => html` + + + ${definition.start || ""} + + +`; + endTemplate = html` + + + +`; + startTemplate = html` + + + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js + var init_accordion_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es6 = __esm({ + "node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/di.js + function cloneArrayWithPossibleProps(source) { + const clone = source.slice(); + const keys = Object.keys(source); + const len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + clone[key] = source[key]; + } + } + return clone; + } + function getParamTypes(key) { + return (Type) => { + return Reflect.getOwnMetadata(key, Type); + }; + } + function createResolver(getter) { + return function(key) { + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor); + }; + return resolver; + }; + } + function createAllResolver(getter) { + return function(key, searchAncestors) { + searchAncestors = !!searchAncestors; + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor, searchAncestors); + }; + return resolver; + }; + } + function ignore(target, property, descriptor) { + DI.inject(ignore)(target, property, descriptor); + } + function createNewInstance(key, handler) { + return handler.getFactory(key).construct(handler); + } + function containerGetKey(d) { + return this.get(d); + } + function transformInstance(inst, transform) { + return transform(inst); + } + function isRegistry(obj) { + return typeof obj.register === "function"; + } + function isSelfRegistry(obj) { + return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; + } + function isRegisterInRequester(obj) { + return isSelfRegistry(obj) && obj.registerInRequestor; + } + function isClass(obj) { + return obj.prototype !== void 0; + } + function cacheCallbackResult(fun) { + return function(handler, requestor, resolver) { + if (cache.has(resolver)) { + return cache.get(resolver); + } + const t = fun(handler, requestor, resolver); + cache.set(resolver, t); + return t; + }; + } + function validateKey(key) { + if (key === null || key === void 0) { + throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); + } + } + function buildAllResponse(resolver, handler, requestor) { + if (resolver instanceof ResolverImpl && resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].resolve(handler, requestor); + } + return results; + } + return [resolver.resolve(handler, requestor)]; + } + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + function isArrayIndex(value) { + switch (typeof value) { + case "number": + return value >= 0 && (value | 0) === value; + case "string": { + const result = isNumericLookup[value]; + if (result !== void 0) { + return result; + } + const length = value.length; + if (length === 0) { + return isNumericLookup[value] = false; + } + let ch = 0; + for (let i = 0; i < length; ++i) { + ch = value.charCodeAt(i); + if (i === 0 && ch === 48 && length > 1 || ch < 48 || ch > 57) { + return isNumericLookup[value] = false; + } + } + return isNumericLookup[value] = true; + } + default: + return false; + } + } + var metadataByTarget, ResolverBuilder, DefaultResolver, ContainerConfiguration, dependencyLookup, rootDOMContainer, DI, Container, inject, defaultSingletonOptions, all, lazy, optional, newInstanceForScope, newInstanceOf, ResolverImpl, FactoryImpl, containerResolver, InstrinsicTypeNames, DILocateParentEventType, factories, ContainerImpl, cache, Registration, defaultFriendlyName, isNativeFunction, isNumericLookup; + var init_di = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"() { + init_esm(); + metadataByTarget = /* @__PURE__ */ new Map(); + if (!("metadata" in Reflect)) { + Reflect.metadata = function(key, value) { + return function(target) { + Reflect.defineMetadata(key, value, target); + }; + }; + Reflect.defineMetadata = function(key, value, target) { + let metadata = metadataByTarget.get(target); + if (metadata === void 0) { + metadataByTarget.set(target, metadata = /* @__PURE__ */ new Map()); + } + metadata.set(key, value); + }; + Reflect.getOwnMetadata = function(key, target) { + const metadata = metadataByTarget.get(target); + if (metadata !== void 0) { + return metadata.get(key); + } + return void 0; + }; + } + ResolverBuilder = class { + /** + * + * @param container - The container to create resolvers for. + * @param key - The key to register resolvers under. + */ + constructor(container, key) { + this.container = container; + this.key = key; + } + /** + * Creates a resolver for an existing object instance. + * @param value - The instance to resolve. + * @returns The resolver. + */ + instance(value) { + return this.registerResolver(0, value); + } + /** + * Creates a resolver that enforces a singleton lifetime. + * @param value - The type to create and cache the singleton for. + * @returns The resolver. + */ + singleton(value) { + return this.registerResolver(1, value); + } + /** + * Creates a resolver that creates a new instance for every dependency request. + * @param value - The type to create instances of. + * @returns - The resolver. + */ + transient(value) { + return this.registerResolver(2, value); + } + /** + * Creates a resolver that invokes a callback function for every dependency resolution + * request, allowing custom logic to return the dependency. + * @param value - The callback to call during resolution. + * @returns The resolver. + */ + callback(value) { + return this.registerResolver(3, value); + } + /** + * Creates a resolver that invokes a callback function the first time that a dependency + * resolution is requested. The returned value is then cached and provided for all + * subsequent requests. + * @param value - The callback to call during the first resolution. + * @returns The resolver. + */ + cachedCallback(value) { + return this.registerResolver(3, cacheCallbackResult(value)); + } + /** + * Aliases the current key to a different key. + * @param destinationKey - The key to point the alias to. + * @returns The resolver. + */ + aliasTo(destinationKey) { + return this.registerResolver(5, destinationKey); + } + registerResolver(strategy, state) { + const { container, key } = this; + this.container = this.key = void 0; + return container.registerResolver(key, new ResolverImpl(key, strategy, state)); + } + }; + DefaultResolver = Object.freeze({ + /** + * Disables auto-registration and throws for all un-registered dependencies. + * @param key - The key to create the resolver for. + */ + none(key) { + throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`); + }, + /** + * Provides default singleton resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + singleton(key) { + return new ResolverImpl(key, 1, key); + }, + /** + * Provides default transient resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + transient(key) { + return new ResolverImpl(key, 2, key); + } + }); + ContainerConfiguration = Object.freeze({ + /** + * The default configuration used when creating a DOM-disconnected container. + * @remarks + * The default creates a root container, with no parent container. It does not handle + * owner requests and it uses singleton resolution behavior for auto-registration. + */ + default: Object.freeze({ + parentLocator: () => null, + responsibleForOwnerRequests: false, + defaultResolver: DefaultResolver.singleton + }) + }); + dependencyLookup = /* @__PURE__ */ new Map(); + rootDOMContainer = null; + DI = Object.freeze({ + /** + * Creates a new dependency injection container. + * @param config - The configuration for the container. + * @returns A newly created dependency injection container. + */ + createContainer(config) { + return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); + }, + /** + * Finds the dependency injection container responsible for providing dependencies + * to the specified node. + * @param node - The node to find the responsible container for. + * @returns The container responsible for providing dependencies to the node. + * @remarks + * This will be the same as the parent container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findResponsibleContainer(node) { + const owned = node.$$container$$; + if (owned && owned.responsibleForOwnerRequests) { + return owned; + } + return DI.findParentContainer(node); + }, + /** + * Find the dependency injection container up the DOM tree from this node. + * @param node - The node to find the parent container for. + * @returns The parent container of this node. + * @remarks + * This will be the same as the responsible container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findParentContainer(node) { + const event = new CustomEvent(DILocateParentEventType, { + bubbles: true, + composed: true, + cancelable: true, + detail: { container: void 0 } + }); + node.dispatchEvent(event); + return event.detail.container || DI.getOrCreateDOMContainer(); + }, + /** + * Returns a dependency injection container if one is explicitly owned by the specified + * node. If one is not owned, then a new container is created and assigned to the node. + * @param node - The node to find or create the container for. + * @param config - The configuration for the container if one needs to be created. + * @returns The located or created container. + * @remarks + * This API does not search for a responsible or parent container. It looks only for a container + * directly defined on the specified node and creates one at that location if one does not + * already exist. + */ + getOrCreateDOMContainer(node, config) { + if (!node) { + return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: () => null + }))); + } + return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: DI.findParentContainer + })); + }, + /** + * Gets the "design:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getDesignParamtypes: getParamTypes("design:paramtypes"), + /** + * Gets the "di:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getAnnotationParamtypes: getParamTypes("di:paramtypes"), + /** + * + * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, + * an empty metadata array is created and added. + * @returns The metadata array. + */ + getOrCreateAnnotationParamTypes(Type) { + let annotationParamtypes = this.getAnnotationParamtypes(Type); + if (annotationParamtypes === void 0) { + Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); + } + return annotationParamtypes; + }, + /** + * Gets the dependency keys representing what is needed to instantiate the specified type. + * @param Type - The type to get the dependencies for. + * @returns An array of dependency keys. + */ + getDependencies(Type) { + let dependencies = dependencyLookup.get(Type); + if (dependencies === void 0) { + const inject2 = Type.inject; + if (inject2 === void 0) { + const designParamtypes = DI.getDesignParamtypes(Type); + const annotationParamtypes = DI.getAnnotationParamtypes(Type); + if (designParamtypes === void 0) { + if (annotationParamtypes === void 0) { + const Proto = Object.getPrototypeOf(Type); + if (typeof Proto === "function" && Proto !== Function.prototype) { + dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); + } else { + dependencies = []; + } + } else { + dependencies = cloneArrayWithPossibleProps(annotationParamtypes); + } + } else if (annotationParamtypes === void 0) { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + } else { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + let len = annotationParamtypes.length; + let auAnnotationParamtype; + for (let i = 0; i < len; ++i) { + auAnnotationParamtype = annotationParamtypes[i]; + if (auAnnotationParamtype !== void 0) { + dependencies[i] = auAnnotationParamtype; + } + } + const keys = Object.keys(annotationParamtypes); + len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + dependencies[key] = annotationParamtypes[key]; + } + } + } + } else { + dependencies = cloneArrayWithPossibleProps(inject2); + } + dependencyLookup.set(Type, dependencies); + } + return dependencies; + }, + /** + * Defines a property on a web component class. The value of this property will + * be resolved from the dependency injection container responsible for the element + * instance, based on where it is connected in the DOM. + * @param target - The target to define the property on. + * @param propertyName - The name of the property to define. + * @param key - The dependency injection key. + * @param respectConnection - Indicates whether or not to update the property value if the + * hosting component is disconnected and then re-connected at a different location in the DOM. + * @remarks + * The respectConnection option is only applicable to elements that descend from FASTElement. + */ + defineProperty(target, propertyName, key, respectConnection = false) { + const diPropertyKey = `$di_${propertyName}`; + Reflect.defineProperty(target, propertyName, { + get: function() { + let value = this[diPropertyKey]; + if (value === void 0) { + const container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); + value = container.get(key); + this[diPropertyKey] = value; + if (respectConnection && this instanceof FASTElement) { + const notifier = this.$fastController; + const handleChange = () => { + const newContainer = DI.findResponsibleContainer(this); + const newValue = newContainer.get(key); + const oldValue = this[diPropertyKey]; + if (newValue !== oldValue) { + this[diPropertyKey] = value; + notifier.notify(propertyName); + } + }; + notifier.subscribe({ handleChange }, "isConnected"); + } + } + return value; + } + }); + }, + /** + * Creates a dependency injection key. + * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a + * default resolution for the dependency. + * @param configuror - If a friendly name was provided for the first parameter, then an optional + * lambda that configures a default resolution for the dependency can be provided second. + * @returns The created key. + * @remarks + * The created key can be used as a property decorator or constructor parameter decorator, + * in addition to its standard use in an inject array or through direct container APIs. + */ + createInterface(nameConfigOrCallback, configuror) { + const configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; + const friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; + const respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; + const Interface = function(target, property, index) { + if (target == null || new.target !== void 0) { + throw new Error(`No registration for interface: '${Interface.friendlyName}'`); + } + if (property) { + DI.defineProperty(target, property, Interface, respectConnection); + } else { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + annotationParamtypes[index] = Interface; + } + }; + Interface.$isInterface = true; + Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; + if (configure != null) { + Interface.register = function(container, key) { + return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); + }; + } + Interface.toString = function toString() { + return `InterfaceSymbol<${Interface.friendlyName}>`; + }; + return Interface; + }, + /** + * A decorator that specifies what to inject into its target. + * @param dependencies - The dependencies to inject. + * @returns The decorator to be applied to the target class. + * @remarks + * The decorator can be used to decorate a class, listing all of the classes dependencies. + * Or it can be used to decorate a constructor paramter, indicating what to inject for that + * parameter. + * Or it can be used for a web component property, indicating what that property should resolve to. + */ + inject(...dependencies) { + return function(target, key, descriptor) { + if (typeof descriptor === "number") { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + const dep = dependencies[0]; + if (dep !== void 0) { + annotationParamtypes[descriptor] = dep; + } + } else if (key) { + DI.defineProperty(target, key, dependencies[0]); + } else { + const annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); + let dep; + for (let i = 0; i < dependencies.length; ++i) { + dep = dependencies[i]; + if (dep !== void 0) { + annotationParamtypes[i] = dep; + } + } + } + }; + }, + /** + * Registers the `target` class as a transient dependency; each time the dependency is resolved + * a new instance will be created. + * + * @param target - The class / constructor function to register as transient. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.transient(Foo); + * ``` + * + * @example + * Inline declaration + * + * ```ts + * const Foo = DI.transient(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + transient(target) { + target.register = function register(container) { + const registration = Registration.transient(target, target); + return registration.register(container); + }; + target.registerInRequestor = false; + return target; + }, + /** + * Registers the `target` class as a singleton dependency; the class will only be created once. Each + * consecutive time the dependency is resolved, the same instance will be returned. + * + * @param target - The class / constructor function to register as a singleton. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.singleton(Foo); + * ``` + * + * @example + * Inline declaration + * ```ts + * const Foo = DI.singleton(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + singleton(target, options = defaultSingletonOptions) { + target.register = function register(container) { + const registration = Registration.singleton(target, target); + return registration.register(container); + }; + target.registerInRequestor = options.scoped; + return target; + } + }); + Container = DI.createInterface("Container"); + inject = DI.inject; + defaultSingletonOptions = { scoped: false }; + all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors)); + lazy = createResolver((key, handler, requestor) => { + return () => requestor.get(key); + }); + optional = createResolver((key, handler, requestor) => { + if (requestor.has(key, true)) { + return requestor.get(key); + } else { + return void 0; + } + }); + ignore.$isResolver = true; + ignore.resolve = () => void 0; + newInstanceForScope = createResolver((key, handler, requestor) => { + const instance = createNewInstance(key, handler); + const resolver = new ResolverImpl(key, 0, instance); + requestor.registerResolver(key, resolver); + return instance; + }); + newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler)); + ResolverImpl = class { + constructor(key, strategy, state) { + this.key = key; + this.strategy = strategy; + this.state = state; + this.resolving = false; + } + get $isResolver() { + return true; + } + register(container) { + return container.registerResolver(this.key, this); + } + resolve(handler, requestor) { + switch (this.strategy) { + case 0: + return this.state; + case 1: { + if (this.resolving) { + throw new Error(`Cyclic dependency found: ${this.state.name}`); + } + this.resolving = true; + this.state = handler.getFactory(this.state).construct(requestor); + this.strategy = 0; + this.resolving = false; + return this.state; + } + case 2: { + const factory = handler.getFactory(this.state); + if (factory === null) { + throw new Error(`Resolver for ${String(this.key)} returned a null factory`); + } + return factory.construct(requestor); + } + case 3: + return this.state(handler, requestor, this); + case 4: + return this.state[0].resolve(handler, requestor); + case 5: + return requestor.get(this.state); + default: + throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`); + } + } + getFactory(container) { + var _a, _b, _c; + switch (this.strategy) { + case 1: + case 2: + return container.getFactory(this.state); + case 5: + return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; + default: + return null; + } + } + }; + FactoryImpl = class { + constructor(Type, dependencies) { + this.Type = Type; + this.dependencies = dependencies; + this.transformers = null; + } + construct(container, dynamicDependencies) { + let instance; + if (dynamicDependencies === void 0) { + instance = new this.Type(...this.dependencies.map(containerGetKey, container)); + } else { + instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies); + } + if (this.transformers == null) { + return instance; + } + return this.transformers.reduce(transformInstance, instance); + } + registerTransformer(transformer) { + (this.transformers || (this.transformers = [])).push(transformer); + } + }; + containerResolver = { + $isResolver: true, + resolve(handler, requestor) { + return requestor; + } + }; + InstrinsicTypeNames = /* @__PURE__ */ new Set([ + "Array", + "ArrayBuffer", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Number", + "Object", + "Promise", + "RangeError", + "ReferenceError", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "URIError", + "WeakMap", + "WeakSet" + ]); + DILocateParentEventType = "__DI_LOCATE_PARENT__"; + factories = /* @__PURE__ */ new Map(); + ContainerImpl = class _ContainerImpl { + constructor(owner, config) { + this.owner = owner; + this.config = config; + this._parent = void 0; + this.registerDepth = 0; + this.context = null; + if (owner !== null) { + owner.$$container$$ = this; + } + this.resolvers = /* @__PURE__ */ new Map(); + this.resolvers.set(Container, containerResolver); + if (owner instanceof Node) { + owner.addEventListener(DILocateParentEventType, (e) => { + if (e.composedPath()[0] !== this.owner) { + e.detail.container = this; + e.stopImmediatePropagation(); + } + }); + } + } + get parent() { + if (this._parent === void 0) { + this._parent = this.config.parentLocator(this.owner); + } + return this._parent; + } + get depth() { + return this.parent === null ? 0 : this.parent.depth + 1; + } + get responsibleForOwnerRequests() { + return this.config.responsibleForOwnerRequests; + } + registerWithContext(context, ...params) { + this.context = context; + this.register(...params); + this.context = null; + return this; + } + register(...params) { + if (++this.registerDepth === 100) { + throw new Error("Unable to autoregister dependency"); + } + let current; + let keys; + let value; + let j; + let jj; + const context = this.context; + for (let i = 0, ii = params.length; i < ii; ++i) { + current = params[i]; + if (!isObject(current)) { + continue; + } + if (isRegistry(current)) { + current.register(this, context); + } else if (isClass(current)) { + Registration.singleton(current, current).register(this); + } else { + keys = Object.keys(current); + j = 0; + jj = keys.length; + for (; j < jj; ++j) { + value = current[keys[j]]; + if (!isObject(value)) { + continue; + } + if (isRegistry(value)) { + value.register(this, context); + } else { + this.register(value); + } + } + } + } + --this.registerDepth; + return this; + } + registerResolver(key, resolver) { + validateKey(key); + const resolvers = this.resolvers; + const result = resolvers.get(key); + if (result == null) { + resolvers.set(key, resolver); + } else if (result instanceof ResolverImpl && result.strategy === 4) { + result.state.push(resolver); + } else { + resolvers.set(key, new ResolverImpl(key, 4, [result, resolver])); + } + return resolver; + } + registerTransformer(key, transformer) { + const resolver = this.getResolver(key); + if (resolver == null) { + return false; + } + if (resolver.getFactory) { + const factory = resolver.getFactory(this); + if (factory == null) { + return false; + } + factory.registerTransformer(transformer); + return true; + } + return false; + } + getResolver(key, autoRegister = true) { + validateKey(key); + if (key.resolve !== void 0) { + return key; + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + return autoRegister ? this.jitRegister(key, handler) : null; + } + current = current.parent; + } else { + return resolver; + } + } + return null; + } + has(key, searchAncestors = false) { + return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; + } + get(key) { + validateKey(key); + if (key.$isResolver) { + return key.resolve(this, this); + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + resolver = this.jitRegister(key, handler); + return resolver.resolve(current, this); + } + current = current.parent; + } else { + return resolver.resolve(current, this); + } + } + throw new Error(`Unable to resolve key: ${String(key)}`); + } + getAll(key, searchAncestors = false) { + validateKey(key); + const requestor = this; + let current = requestor; + let resolver; + if (searchAncestors) { + let resolutions = emptyArray; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver != null) { + resolutions = resolutions.concat( + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + buildAllResponse(resolver, current, requestor) + ); + } + current = current.parent; + } + return resolutions; + } else { + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + current = current.parent; + if (current == null) { + return emptyArray; + } + } else { + return buildAllResponse(resolver, current, requestor); + } + } + } + return emptyArray; + } + getFactory(Type) { + let factory = factories.get(Type); + if (factory === void 0) { + if (isNativeFunction(Type)) { + throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`); + } + factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); + } + return factory; + } + registerFactory(key, factory) { + factories.set(key, factory); + } + createChild(config) { + return new _ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this })); + } + jitRegister(keyAsValue, handler) { + if (typeof keyAsValue !== "function") { + throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`); + } + if (InstrinsicTypeNames.has(keyAsValue.name)) { + throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`); + } + if (isRegistry(keyAsValue)) { + const registrationResolver = keyAsValue.register(handler); + if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { + const newResolver = handler.resolvers.get(keyAsValue); + if (newResolver != void 0) { + return newResolver; + } + throw new Error("A valid resolver was not returned from the static register method"); + } + return registrationResolver; + } else if (keyAsValue.$isInterface) { + throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`); + } else { + const resolver = this.config.defaultResolver(keyAsValue, handler); + handler.resolvers.set(keyAsValue, resolver); + return resolver; + } + } + }; + cache = /* @__PURE__ */ new WeakMap(); + Registration = Object.freeze({ + /** + * Allows you to pass an instance. + * Every time you request this {@link Key} you will get this instance back. + * + * @example + * ``` + * Registration.instance(Foo, new Foo())); + * ``` + * + * @param key - The key to register the instance under. + * @param value - The instance to return when the key is requested. + */ + instance(key, value) { + return new ResolverImpl(key, 0, value); + }, + /** + * Creates an instance from the class. + * Every time you request this {@link Key} you will get the same one back. + * + * @example + * ``` + * Registration.singleton(Foo, Foo); + * ``` + * + * @param key - The key to register the singleton under. + * @param value - The class to instantiate as a singleton when first requested. + */ + singleton(key, value) { + return new ResolverImpl(key, 1, value); + }, + /** + * Creates an instance from a class. + * Every time you request this {@link Key} you will get a new instance. + * + * @example + * ``` + * Registration.instance(Foo, Foo); + * ``` + * + * @param key - The key to register the instance type under. + * @param value - The class to instantiate each time the key is requested. + */ + transient(key, value) { + return new ResolverImpl(key, 2, value); + }, + /** + * Delegates to a callback function to provide the dependency. + * Every time you request this {@link Key} the callback will be invoked to provide + * the dependency. + * + * @example + * ``` + * Registration.callback(Foo, () => new Foo()); + * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + */ + callback(key, callback) { + return new ResolverImpl(key, 3, callback); + }, + /** + * Delegates to a callback function to provide the dependency and then caches the + * dependency for future requests. + * + * @example + * ``` + * Registration.cachedCallback(Foo, () => new Foo()); + * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + * @remarks + * If you pass the same Registration to another container, the same cached value will be used. + * Should all references to the resolver returned be removed, the cache will expire. + */ + cachedCallback(key, callback) { + return new ResolverImpl(key, 3, cacheCallbackResult(callback)); + }, + /** + * Creates an alternate {@link Key} to retrieve an instance by. + * + * @example + * ``` + * Register.singleton(Foo, Foo) + * Register.aliasTo(Foo, MyFoos); + * + * container.getAll(MyFoos) // contains an instance of Foo + * ``` + * + * @param originalKey - The original key that has been registered. + * @param aliasKey - The alias to the original key. + */ + aliasTo(originalKey, aliasKey) { + return new ResolverImpl(aliasKey, 5, originalKey); + } + }); + defaultFriendlyName = "(anonymous)"; + isNativeFunction = /* @__PURE__ */ (function() { + const lookup = /* @__PURE__ */ new WeakMap(); + let isNative = false; + let sourceText = ""; + let i = 0; + return function(fn) { + isNative = lookup.get(fn); + if (isNative === void 0) { + sourceText = fn.toString(); + i = sourceText.length; + isNative = // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string + i >= 29 && // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. + i <= 100 && // This whole heuristic *could* be tricked by a comment. Do we need to care about that? + sourceText.charCodeAt(i - 1) === 125 && // } + // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. + sourceText.charCodeAt(i - 2) <= 32 && // whitespace + sourceText.charCodeAt(i - 3) === 93 && // ] + sourceText.charCodeAt(i - 4) === 101 && // e + sourceText.charCodeAt(i - 5) === 100 && // d + sourceText.charCodeAt(i - 6) === 111 && // o + sourceText.charCodeAt(i - 7) === 99 && // c + sourceText.charCodeAt(i - 8) === 32 && // + sourceText.charCodeAt(i - 9) === 101 && // e + sourceText.charCodeAt(i - 10) === 118 && // v + sourceText.charCodeAt(i - 11) === 105 && // i + sourceText.charCodeAt(i - 12) === 116 && // t + sourceText.charCodeAt(i - 13) === 97 && // a + sourceText.charCodeAt(i - 14) === 110 && // n + sourceText.charCodeAt(i - 15) === 88; + lookup.set(fn, isNative); + } + return isNative; + }; + })(); + isNumericLookup = {}; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js + function presentationKeyFromTag(tagName) { + return `${tagName.toLowerCase()}:presentation`; + } + var presentationRegistry, ComponentPresentation, DefaultComponentPresentation; + var init_component_presentation = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js"() { + init_esm(); + init_di(); + presentationRegistry = /* @__PURE__ */ new Map(); + ComponentPresentation = Object.freeze({ + /** + * Defines a component presentation for an element. + * @param tagName - The element name to define the presentation for. + * @param presentation - The presentation that will be applied to matching elements. + * @param container - The dependency injection container to register the configuration in. + * @public + */ + define(tagName, presentation, container) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === void 0) { + presentationRegistry.set(key, presentation); + } else { + presentationRegistry.set(key, false); + } + container.register(Registration.instance(key, presentation)); + }, + /** + * Finds a component presentation for the specified element name, + * searching the DOM hierarchy starting from the provided element. + * @param tagName - The name of the element to locate the presentation for. + * @param element - The element to begin the search from. + * @returns The component presentation or null if none is found. + * @public + */ + forTag(tagName, element) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === false) { + const container = DI.findResponsibleContainer(element); + return container.get(key); + } + return existing || null; + } + }); + DefaultComponentPresentation = class { + /** + * Creates an instance of DefaultComponentPresentation. + * @param template - The template to apply to the element. + * @param styles - The styles to apply to the element. + * @public + */ + constructor(template, styles) { + this.template = template || null; + this.styles = styles === void 0 ? null : Array.isArray(styles) ? ElementStyles.create(styles) : styles instanceof ElementStyles ? styles : ElementStyles.create([styles]); + } + /** + * Applies the presentation details to the specified element. + * @param element - The element to apply the presentation details to. + * @public + */ + applyTo(element) { + const controller = element.$fastController; + if (controller.template === null) { + controller.template = this.template; + } + if (controller.styles === null) { + controller.styles = this.styles; + } + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js + function resolveOption(option, context, definition) { + if (typeof option === "function") { + return option(context, definition); + } + return option; + } + var FoundationElement, FoundationElementRegistry; + var init_foundation_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js"() { + init_tslib_es6(); + init_esm(); + init_component_presentation(); + FoundationElement = class _FoundationElement extends FASTElement { + constructor() { + super(...arguments); + this._presentation = void 0; + } + /** + * A property which resolves the ComponentPresentation instance + * for the current component. + * @public + */ + get $presentation() { + if (this._presentation === void 0) { + this._presentation = ComponentPresentation.forTag(this.tagName, this); + } + return this._presentation; + } + templateChanged() { + if (this.template !== void 0) { + this.$fastController.template = this.template; + } + } + stylesChanged() { + if (this.styles !== void 0) { + this.$fastController.styles = this.styles; + } + } + /** + * The connected callback for this FASTElement. + * @remarks + * This method is invoked by the platform whenever this FoundationElement + * becomes connected to the document. + * @public + */ + connectedCallback() { + if (this.$presentation !== null) { + this.$presentation.applyTo(this); + } + super.connectedCallback(); + } + /** + * Defines an element registry function with a set of element definition defaults. + * @param elementDefinition - The definition of the element to create the registry + * function for. + * @public + */ + static compose(elementDefinition) { + return (overrideDefinition = {}) => new FoundationElementRegistry(this === _FoundationElement ? class extends _FoundationElement { + } : this, elementDefinition, overrideDefinition); + } + }; + __decorate([ + observable + ], FoundationElement.prototype, "template", void 0); + __decorate([ + observable + ], FoundationElement.prototype, "styles", void 0); + FoundationElementRegistry = class { + constructor(type, elementDefinition, overrideDefinition) { + this.type = type; + this.elementDefinition = elementDefinition; + this.overrideDefinition = overrideDefinition; + this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); + } + register(container, context) { + const definition = this.definition; + const overrideDefinition = this.overrideDefinition; + const prefix = definition.prefix || context.elementPrefix; + const name = `${prefix}-${definition.baseName}`; + context.tryDefineElement({ + name, + type: this.type, + baseClass: this.elementDefinition.baseClass, + callback: (x) => { + const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); + x.definePresentation(presentation); + let shadowOptions = resolveOption(definition.shadowOptions, x, definition); + if (x.shadowRootMode) { + if (shadowOptions) { + if (!overrideDefinition.shadowOptions) { + shadowOptions.mode = x.shadowRootMode; + } + } else if (shadowOptions !== null) { + shadowOptions = { mode: x.shadowRootMode }; + } + } + x.defineElement({ + elementOptions: resolveOption(definition.elementOptions, x, definition), + shadowOptions, + attributes: resolveOption(definition.attributes, x, definition) + }); + } + }); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js + function applyMixins(derivedCtor, ...baseCtors) { + const derivedAttributes = AttributeConfiguration.locate(derivedCtor); + baseCtors.forEach((baseCtor) => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { + if (name !== "constructor") { + Object.defineProperty( + derivedCtor.prototype, + name, + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + Object.getOwnPropertyDescriptor(baseCtor.prototype, name) + ); + } + }); + const baseAttributes = AttributeConfiguration.locate(baseCtor); + baseAttributes.forEach((x) => derivedAttributes.push(x)); + }); + } + var init_apply_mixins = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js"() { + init_esm(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js + var AccordionItem; + var init_accordion_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_start_end(); + init_apply_mixins(); + AccordionItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.headinglevel = 2; + this.expanded = false; + this.clickHandler = (e) => { + this.expanded = !this.expanded; + this.change(); + }; + this.change = () => { + this.$emit("change"); + }; + } + }; + __decorate([ + attr({ + attribute: "heading-level", + mode: "fromView", + converter: nullableNumberConverter + }) + ], AccordionItem.prototype, "headinglevel", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], AccordionItem.prototype, "expanded", void 0); + __decorate([ + attr + ], AccordionItem.prototype, "id", void 0); + applyMixins(AccordionItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js + var init_accordion_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js"() { + init_accordion_item_template(); + init_accordion_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js + var init_accordion_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/aria.js + var Orientation; + var init_aria = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/aria.js"() { + Orientation = { + horizontal: "horizontal", + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/array.js + function findLastIndex(array, predicate) { + let k = array.length; + while (k--) { + if (predicate(array[k], k, array)) { + return k; + } + } + return -1; + } + var init_array = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/array.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/class-names.js + var init_class_names = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/class-names.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-dom.js + function canUseDOM() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + var init_can_use_dom = __esm({ + "node_modules/exenv-es6/dist/can-use-dom.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-event-listeners.js + var init_can_use_event_listeners = __esm({ + "node_modules/exenv-es6/dist/can-use-event-listeners.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-viewport.js + var init_can_use_viewport = __esm({ + "node_modules/exenv-es6/dist/can-use-viewport.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-workers.js + var init_can_use_workers = __esm({ + "node_modules/exenv-es6/dist/can-use-workers.js"() { + } + }); + + // node_modules/exenv-es6/dist/index.js + var init_dist = __esm({ + "node_modules/exenv-es6/dist/index.js"() { + init_can_use_dom(); + init_can_use_event_listeners(); + init_can_use_viewport(); + init_can_use_workers(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/dom.js + function isHTMLElement(...args) { + return args.every((arg) => arg instanceof HTMLElement); + } + function getDisplayedNodes(rootNode, selector) { + if (!rootNode || !selector || !isHTMLElement(rootNode)) { + return; + } + const nodes = Array.from(rootNode.querySelectorAll(selector)); + return nodes.filter((node) => node.offsetParent !== null); + } + function getNonce() { + const node = document.querySelector('meta[property="csp-nonce"]'); + if (node) { + return node.getAttribute("content"); + } else { + return null; + } + } + function canUseFocusVisible() { + if (typeof _canUseFocusVisible === "boolean") { + return _canUseFocusVisible; + } + if (!canUseDOM()) { + _canUseFocusVisible = false; + return _canUseFocusVisible; + } + const styleElement = document.createElement("style"); + const styleNonce = getNonce(); + if (styleNonce !== null) { + styleElement.setAttribute("nonce", styleNonce); + } + document.head.appendChild(styleElement); + try { + styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); + _canUseFocusVisible = true; + } catch (e) { + _canUseFocusVisible = false; + } finally { + document.head.removeChild(styleElement); + } + return _canUseFocusVisible; + } + var _canUseFocusVisible; + var init_dom2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/dom.js"() { + init_dist(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/events.js + var eventFocus, eventFocusIn, eventFocusOut, eventKeyDown, eventResize, eventScroll; + var init_events = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/events.js"() { + eventFocus = "focus"; + eventFocusIn = "focusin"; + eventFocusOut = "focusout"; + eventKeyDown = "keydown"; + eventResize = "resize"; + eventScroll = "scroll"; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/html.js + var init_html = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/html.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/key-codes.js + var KeyCodes, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, keyEscape, keyHome, keyEnd, keyFunction2, keyPageDown, keyPageUp, keySpace, keyTab, keyBackspace, keyDelete, ArrowKeys; + var init_key_codes = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/key-codes.js"() { + (function(KeyCodes2) { + KeyCodes2[KeyCodes2["alt"] = 18] = "alt"; + KeyCodes2[KeyCodes2["arrowDown"] = 40] = "arrowDown"; + KeyCodes2[KeyCodes2["arrowLeft"] = 37] = "arrowLeft"; + KeyCodes2[KeyCodes2["arrowRight"] = 39] = "arrowRight"; + KeyCodes2[KeyCodes2["arrowUp"] = 38] = "arrowUp"; + KeyCodes2[KeyCodes2["back"] = 8] = "back"; + KeyCodes2[KeyCodes2["backSlash"] = 220] = "backSlash"; + KeyCodes2[KeyCodes2["break"] = 19] = "break"; + KeyCodes2[KeyCodes2["capsLock"] = 20] = "capsLock"; + KeyCodes2[KeyCodes2["closeBracket"] = 221] = "closeBracket"; + KeyCodes2[KeyCodes2["colon"] = 186] = "colon"; + KeyCodes2[KeyCodes2["colon2"] = 59] = "colon2"; + KeyCodes2[KeyCodes2["comma"] = 188] = "comma"; + KeyCodes2[KeyCodes2["ctrl"] = 17] = "ctrl"; + KeyCodes2[KeyCodes2["delete"] = 46] = "delete"; + KeyCodes2[KeyCodes2["end"] = 35] = "end"; + KeyCodes2[KeyCodes2["enter"] = 13] = "enter"; + KeyCodes2[KeyCodes2["equals"] = 187] = "equals"; + KeyCodes2[KeyCodes2["equals2"] = 61] = "equals2"; + KeyCodes2[KeyCodes2["equals3"] = 107] = "equals3"; + KeyCodes2[KeyCodes2["escape"] = 27] = "escape"; + KeyCodes2[KeyCodes2["forwardSlash"] = 191] = "forwardSlash"; + KeyCodes2[KeyCodes2["function1"] = 112] = "function1"; + KeyCodes2[KeyCodes2["function10"] = 121] = "function10"; + KeyCodes2[KeyCodes2["function11"] = 122] = "function11"; + KeyCodes2[KeyCodes2["function12"] = 123] = "function12"; + KeyCodes2[KeyCodes2["function2"] = 113] = "function2"; + KeyCodes2[KeyCodes2["function3"] = 114] = "function3"; + KeyCodes2[KeyCodes2["function4"] = 115] = "function4"; + KeyCodes2[KeyCodes2["function5"] = 116] = "function5"; + KeyCodes2[KeyCodes2["function6"] = 117] = "function6"; + KeyCodes2[KeyCodes2["function7"] = 118] = "function7"; + KeyCodes2[KeyCodes2["function8"] = 119] = "function8"; + KeyCodes2[KeyCodes2["function9"] = 120] = "function9"; + KeyCodes2[KeyCodes2["home"] = 36] = "home"; + KeyCodes2[KeyCodes2["insert"] = 45] = "insert"; + KeyCodes2[KeyCodes2["menu"] = 93] = "menu"; + KeyCodes2[KeyCodes2["minus"] = 189] = "minus"; + KeyCodes2[KeyCodes2["minus2"] = 109] = "minus2"; + KeyCodes2[KeyCodes2["numLock"] = 144] = "numLock"; + KeyCodes2[KeyCodes2["numPad0"] = 96] = "numPad0"; + KeyCodes2[KeyCodes2["numPad1"] = 97] = "numPad1"; + KeyCodes2[KeyCodes2["numPad2"] = 98] = "numPad2"; + KeyCodes2[KeyCodes2["numPad3"] = 99] = "numPad3"; + KeyCodes2[KeyCodes2["numPad4"] = 100] = "numPad4"; + KeyCodes2[KeyCodes2["numPad5"] = 101] = "numPad5"; + KeyCodes2[KeyCodes2["numPad6"] = 102] = "numPad6"; + KeyCodes2[KeyCodes2["numPad7"] = 103] = "numPad7"; + KeyCodes2[KeyCodes2["numPad8"] = 104] = "numPad8"; + KeyCodes2[KeyCodes2["numPad9"] = 105] = "numPad9"; + KeyCodes2[KeyCodes2["numPadDivide"] = 111] = "numPadDivide"; + KeyCodes2[KeyCodes2["numPadDot"] = 110] = "numPadDot"; + KeyCodes2[KeyCodes2["numPadMinus"] = 109] = "numPadMinus"; + KeyCodes2[KeyCodes2["numPadMultiply"] = 106] = "numPadMultiply"; + KeyCodes2[KeyCodes2["numPadPlus"] = 107] = "numPadPlus"; + KeyCodes2[KeyCodes2["openBracket"] = 219] = "openBracket"; + KeyCodes2[KeyCodes2["pageDown"] = 34] = "pageDown"; + KeyCodes2[KeyCodes2["pageUp"] = 33] = "pageUp"; + KeyCodes2[KeyCodes2["period"] = 190] = "period"; + KeyCodes2[KeyCodes2["print"] = 44] = "print"; + KeyCodes2[KeyCodes2["quote"] = 222] = "quote"; + KeyCodes2[KeyCodes2["scrollLock"] = 145] = "scrollLock"; + KeyCodes2[KeyCodes2["shift"] = 16] = "shift"; + KeyCodes2[KeyCodes2["space"] = 32] = "space"; + KeyCodes2[KeyCodes2["tab"] = 9] = "tab"; + KeyCodes2[KeyCodes2["tilde"] = 192] = "tilde"; + KeyCodes2[KeyCodes2["windowsLeft"] = 91] = "windowsLeft"; + KeyCodes2[KeyCodes2["windowsOpera"] = 219] = "windowsOpera"; + KeyCodes2[KeyCodes2["windowsRight"] = 92] = "windowsRight"; + })(KeyCodes || (KeyCodes = {})); + keyArrowDown = "ArrowDown"; + keyArrowLeft = "ArrowLeft"; + keyArrowRight = "ArrowRight"; + keyArrowUp = "ArrowUp"; + keyEnter = "Enter"; + keyEscape = "Escape"; + keyHome = "Home"; + keyEnd = "End"; + keyFunction2 = "F2"; + keyPageDown = "PageDown"; + keyPageUp = "PageUp"; + keySpace = " "; + keyTab = "Tab"; + keyBackspace = "Backspace"; + keyDelete = "Delete"; + ArrowKeys = { + ArrowDown: keyArrowDown, + ArrowLeft: keyArrowLeft, + ArrowRight: keyArrowRight, + ArrowUp: keyArrowUp + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/localization.js + var Direction; + var init_localization = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/localization.js"() { + (function(Direction2) { + Direction2["ltr"] = "ltr"; + Direction2["rtl"] = "rtl"; + })(Direction || (Direction = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/numbers.js + function wrapInBounds(min, max, value) { + if (value < min) { + return max; + } else if (value > max) { + return min; + } + return value; + } + function limit(min, max, value) { + return Math.min(Math.max(value, min), max); + } + function inRange(value, min, max = 0) { + [min, max] = [min, max].sort((a, b) => a - b); + return min <= value && value < max; + } + var init_numbers = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/numbers.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/strings.js + function uniqueId(prefix = "") { + return `${prefix}${uniqueIdCounter++}`; + } + var uniqueIdCounter; + var init_strings = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/strings.js"() { + uniqueIdCounter = 0; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/query.js + var init_query = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/query.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js + var RtlScrollConverter; + var init_rtl_scroll_converter = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js"() { + init_dist(); + init_localization(); + RtlScrollConverter = class _RtlScrollConverter { + /** + * Gets the scrollLeft value of the provided element + */ + static getScrollLeft(scrolledElement, direction) { + if (direction === Direction.rtl) { + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + return scrolledElement.scrollLeft; + } + /** + * Sets the scrollLeft value of the provided element + */ + static setScrollLeft(scrolledElement, scrollValue, direction) { + if (direction === Direction.rtl) { + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, scrollValue); + return; + } + scrolledElement.scrollLeft = scrollValue; + } + /** + * The initial rtl scroll converter getter function, it calls the browser test to set the correct converter + * functions and then invokes the getter + */ + static initialGetRtlScrollConverter(scrolledElement) { + _RtlScrollConverter.initializeRtlScrollConverters(); + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + /** + * The "direct" rtl get scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft; + } + /** + * The "inverted" get scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedGetRtlScrollConverter(scrolledElement) { + return -Math.abs(scrolledElement.scrollLeft); + } + /** + * The "reverse" get scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft - (scrolledElement.scrollWidth - scrolledElement.clientWidth); + } + /** + * The initial rtl scroll converter setter function, it calls the browser test to set the correct converter + * functions and then invokes the setter + */ + static initialSetRtlScrollConverter(scrolledElement, newScrollValue) { + _RtlScrollConverter.initializeRtlScrollConverters(); + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, newScrollValue); + } + /** + * The "direct" rtl set scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = newScrollValue; + } + /** + * The "inverted" set scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = Math.abs(newScrollValue); + } + /** + * The "reverse" set scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseSetRtlScrollConverter(scrolledElement, newScrollValue) { + const maxScroll = scrolledElement.scrollWidth - scrolledElement.clientWidth; + scrolledElement.scrollLeft = maxScroll + newScrollValue; + } + /** + * detects the appropriate rtl scroll converter functions and assigns them + * should only run once + */ + static initializeRtlScrollConverters() { + if (!canUseDOM()) { + _RtlScrollConverter.applyDirectScrollConverters(); + return; + } + const testElement = _RtlScrollConverter.getTestElement(); + document.body.appendChild(testElement); + _RtlScrollConverter.checkForScrollType(testElement); + document.body.removeChild(testElement); + } + /** + * checks the provided test element to determine scroll type + * and apply appropriate converters + */ + static checkForScrollType(testElement) { + if (_RtlScrollConverter.isReverse(testElement)) { + _RtlScrollConverter.applyReverseScrollConverters(); + } else { + if (_RtlScrollConverter.isDirect(testElement)) { + _RtlScrollConverter.applyDirectScrollConverters(); + } else { + _RtlScrollConverter.applyInvertedScrollConverters(); + } + } + } + /** + * checks test element initial state for rtl "reverse" mode + */ + static isReverse(testElement) { + return testElement.scrollLeft > 0; + } + /** + * checks test element for rtl "direct" mode + */ + static isDirect(testElement) { + testElement.scrollLeft = -1; + return testElement.scrollLeft < 0; + } + /** + * apply direct scroll conververters + */ + static applyDirectScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.directSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.directGetRtlScrollConverter; + } + /** + * apply inverted scroll conververters + */ + static applyInvertedScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.invertedSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.invertedGetRtlScrollConverter; + } + /** + * apply reverse scroll conververters + */ + static applyReverseScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.reverseSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.reverseGetRtlScrollConverter; + } + /** + * generate a test element for rtl testing + */ + static getTestElement() { + const testElement = document.createElement("div"); + testElement.appendChild(document.createTextNode("ABCD")); + testElement.dir = "rtl"; + testElement.style.fontSize = "14px"; + testElement.style.width = "4px"; + testElement.style.height = "1px"; + testElement.style.position = "absolute"; + testElement.style.top = "-1000px"; + testElement.style.overflow = "scroll"; + return testElement; + } + }; + RtlScrollConverter.getRtlScrollLeftConverter = RtlScrollConverter.initialGetRtlScrollConverter; + RtlScrollConverter.setRtlScrollLeftConverter = RtlScrollConverter.initialSetRtlScrollConverter; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/system-colors.js + var SystemColors; + var init_system_colors = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/system-colors.js"() { + (function(SystemColors2) { + SystemColors2["Canvas"] = "Canvas"; + SystemColors2["CanvasText"] = "CanvasText"; + SystemColors2["LinkText"] = "LinkText"; + SystemColors2["VisitedText"] = "VisitedText"; + SystemColors2["ActiveText"] = "ActiveText"; + SystemColors2["ButtonFace"] = "ButtonFace"; + SystemColors2["ButtonText"] = "ButtonText"; + SystemColors2["Field"] = "Field"; + SystemColors2["FieldText"] = "FieldText"; + SystemColors2["Highlight"] = "Highlight"; + SystemColors2["HighlightText"] = "HighlightText"; + SystemColors2["GrayText"] = "GrayText"; + })(SystemColors || (SystemColors = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/index.js + var init_dist2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/index.js"() { + init_aria(); + init_array(); + init_class_names(); + init_dom2(); + init_events(); + init_html(); + init_key_codes(); + init_localization(); + init_numbers(); + init_strings(); + init_query(); + init_rtl_scroll_converter(); + init_system_colors(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js + var AccordionExpandMode, Accordion; + var init_accordion = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_accordion_item(); + AccordionExpandMode = { + /** + * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. + */ + single: "single", + /** + * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously. + */ + multi: "multi" + }; + Accordion = class extends FoundationElement { + constructor() { + super(...arguments); + this.expandmode = AccordionExpandMode.multi; + this.activeItemIndex = 0; + this.change = () => { + this.$emit("change", this.activeid); + }; + this.setItems = () => { + var _a; + if (this.accordionItems.length === 0) { + return; + } + this.accordionIds = this.getItemIds(); + this.accordionItems.forEach((item, index) => { + if (item instanceof AccordionItem) { + item.addEventListener("change", this.activeItemChange); + if (this.isSingleExpandMode()) { + this.activeItemIndex !== index ? item.expanded = false : item.expanded = true; + } + } + const itemId = this.accordionIds[index]; + item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId); + this.activeid = this.accordionIds[this.activeItemIndex]; + item.addEventListener("keydown", this.handleItemKeyDown); + item.addEventListener("focus", this.handleItemFocus); + }); + if (this.isSingleExpandMode()) { + const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0]; + expandedItem.setAttribute("aria-disabled", "true"); + } + }; + this.removeItemListeners = (oldValue) => { + oldValue.forEach((item, index) => { + item.removeEventListener("change", this.activeItemChange); + item.removeEventListener("keydown", this.handleItemKeyDown); + item.removeEventListener("focus", this.handleItemFocus); + }); + }; + this.activeItemChange = (event) => { + if (event.defaultPrevented || event.target !== event.currentTarget) { + return; + } + event.preventDefault(); + const selectedItem = event.target; + this.activeid = selectedItem.getAttribute("id"); + if (this.isSingleExpandMode()) { + this.resetItems(); + selectedItem.expanded = true; + selectedItem.setAttribute("aria-disabled", "true"); + this.accordionItems.forEach((item) => { + if (!item.hasAttribute("disabled") && item.id !== this.activeid) { + item.removeAttribute("aria-disabled"); + } + }); + } + this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem); + this.change(); + }; + this.handleItemKeyDown = (event) => { + if (event.target !== event.currentTarget) { + return; + } + this.accordionIds = this.getItemIds(); + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjust(-1); + break; + case keyArrowDown: + event.preventDefault(); + this.adjust(1); + break; + case keyHome: + this.activeItemIndex = 0; + this.focusItem(); + break; + case keyEnd: + this.activeItemIndex = this.accordionItems.length - 1; + this.focusItem(); + break; + } + }; + this.handleItemFocus = (event) => { + if (event.target === event.currentTarget) { + const focusedItem = event.target; + const focusedIndex = this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem); + if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { + this.activeItemIndex = focusedIndex; + this.activeid = this.accordionIds[this.activeItemIndex]; + } + } + }; + } + /** + * @internal + */ + accordionItemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.removeItemListeners(oldValue); + this.setItems(); + } + } + findExpandedItem() { + for (let item = 0; item < this.accordionItems.length; item++) { + if (this.accordionItems[item].getAttribute("expanded") === "true") { + return this.accordionItems[item]; + } + } + return null; + } + resetItems() { + this.accordionItems.forEach((item, index) => { + item.expanded = false; + }); + } + getItemIds() { + return this.accordionItems.map((accordionItem) => { + return accordionItem.getAttribute("id"); + }); + } + isSingleExpandMode() { + return this.expandmode === AccordionExpandMode.single; + } + adjust(adjustment) { + this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment); + this.focusItem(); + } + focusItem() { + const element = this.accordionItems[this.activeItemIndex]; + if (element instanceof AccordionItem) { + element.expandbutton.focus(); + } + } + }; + __decorate([ + attr({ attribute: "expand-mode" }) + ], Accordion.prototype, "expandmode", void 0); + __decorate([ + observable + ], Accordion.prototype, "accordionItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js + var init_accordion2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js"() { + init_accordion_template(); + init_accordion(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js + var anchorTemplate; + var init_anchor_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js"() { + init_esm(); + init_start_end(); + anchorTemplate = (context, definition) => html` + + ${startSlotTemplate(context, definition)} + + + + ${endSlotTemplate(context, definition)} + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js + var ARIAGlobalStatesAndProperties; + var init_aria_global = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js"() { + init_tslib_es6(); + init_esm(); + ARIAGlobalStatesAndProperties = class { + }; + __decorate([ + attr({ attribute: "aria-atomic" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); + __decorate([ + attr({ attribute: "aria-busy" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); + __decorate([ + attr({ attribute: "aria-controls" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); + __decorate([ + attr({ attribute: "aria-current" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-details" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); + __decorate([ + attr({ attribute: "aria-disabled" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); + __decorate([ + attr({ attribute: "aria-errormessage" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); + __decorate([ + attr({ attribute: "aria-flowto" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); + __decorate([ + attr({ attribute: "aria-haspopup" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); + __decorate([ + attr({ attribute: "aria-hidden" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); + __decorate([ + attr({ attribute: "aria-invalid" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); + __decorate([ + attr({ attribute: "aria-keyshortcuts" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-live" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); + __decorate([ + attr({ attribute: "aria-owns" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); + __decorate([ + attr({ attribute: "aria-relevant" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); + __decorate([ + attr({ attribute: "aria-roledescription" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js + var init_patterns = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js"() { + init_aria_global(); + init_start_end(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js + var Anchor, DelegatesARIALink; + var init_anchor = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_patterns(); + init_apply_mixins(); + Anchor = class extends FoundationElement { + constructor() { + super(...arguments); + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + var _a2; + (_a2 = this.control) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + } + }; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.handleUnsupportedDelegatesFocus(); + } + }; + __decorate([ + attr + ], Anchor.prototype, "download", void 0); + __decorate([ + attr + ], Anchor.prototype, "href", void 0); + __decorate([ + attr + ], Anchor.prototype, "hreflang", void 0); + __decorate([ + attr + ], Anchor.prototype, "ping", void 0); + __decorate([ + attr + ], Anchor.prototype, "referrerpolicy", void 0); + __decorate([ + attr + ], Anchor.prototype, "rel", void 0); + __decorate([ + attr + ], Anchor.prototype, "target", void 0); + __decorate([ + attr + ], Anchor.prototype, "type", void 0); + __decorate([ + observable + ], Anchor.prototype, "defaultSlottedContent", void 0); + DelegatesARIALink = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIALink.prototype, "ariaExpanded", void 0); + applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties); + applyMixins(Anchor, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js + var init_anchor2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js"() { + init_anchor_template(); + init_anchor(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js + var init_anchored_region_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js + var getDirection; + var init_direction = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js"() { + init_dist2(); + getDirection = (rootNode) => { + const dirNode = rootNode.closest("[dir]"); + return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js + var IntersectionService; + var init_intersection_service = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js"() { + init_esm(); + IntersectionService = class { + constructor() { + this.intersectionDetector = null; + this.observedElements = /* @__PURE__ */ new Map(); + this.requestPosition = (target, callback) => { + var _a; + if (this.intersectionDetector === null) { + return; + } + if (this.observedElements.has(target)) { + (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback); + return; + } + this.observedElements.set(target, [callback]); + this.intersectionDetector.observe(target); + }; + this.cancelRequestPosition = (target, callback) => { + const callbacks = this.observedElements.get(target); + if (callbacks !== void 0) { + const callBackIndex = callbacks.indexOf(callback); + if (callBackIndex !== -1) { + callbacks.splice(callBackIndex, 1); + } + } + }; + this.initializeIntersectionDetector = () => { + if (!$global.IntersectionObserver) { + return; + } + this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { + root: null, + rootMargin: "0px", + threshold: [0, 1] + }); + }; + this.handleIntersection = (entries) => { + if (this.intersectionDetector === null) { + return; + } + const pendingCallbacks = []; + const pendingCallbackParams = []; + entries.forEach((entry) => { + var _a; + (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); + const thisElementCallbacks = this.observedElements.get(entry.target); + if (thisElementCallbacks !== void 0) { + thisElementCallbacks.forEach((callback) => { + let targetCallbackIndex = pendingCallbacks.indexOf(callback); + if (targetCallbackIndex === -1) { + targetCallbackIndex = pendingCallbacks.length; + pendingCallbacks.push(callback); + pendingCallbackParams.push([]); + } + pendingCallbackParams[targetCallbackIndex].push(entry); + }); + this.observedElements.delete(entry.target); + } + }); + pendingCallbacks.forEach((callback, index) => { + callback(pendingCallbackParams[index]); + }); + }; + this.initializeIntersectionDetector(); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js + var AnchoredRegion; + var init_anchored_region = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_direction(); + init_intersection_service(); + AnchoredRegion = class _AnchoredRegion extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.viewport = ""; + this.horizontalPositioningMode = "uncontrolled"; + this.horizontalDefaultPosition = "unset"; + this.horizontalViewportLock = false; + this.horizontalInset = false; + this.horizontalScaling = "content"; + this.verticalPositioningMode = "uncontrolled"; + this.verticalDefaultPosition = "unset"; + this.verticalViewportLock = false; + this.verticalInset = false; + this.verticalScaling = "content"; + this.fixedPlacement = false; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.initialLayoutComplete = false; + this.resizeDetector = null; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.pendingPositioningUpdate = false; + this.pendingReset = false; + this.currentDirection = Direction.ltr; + this.regionVisible = false; + this.forceUpdate = false; + this.updateThreshold = 0.5; + this.update = () => { + if (!this.pendingPositioningUpdate) { + this.requestPositionUpdates(); + } + }; + this.startObservers = () => { + this.stopObservers(); + if (this.anchorElement === null) { + return; + } + this.requestPositionUpdates(); + if (this.resizeDetector !== null) { + this.resizeDetector.observe(this.anchorElement); + this.resizeDetector.observe(this); + } + }; + this.requestPositionUpdates = () => { + if (this.anchorElement === null || this.pendingPositioningUpdate) { + return; + } + _AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection); + _AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection); + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection); + } + this.pendingPositioningUpdate = true; + }; + this.stopObservers = () => { + if (this.pendingPositioningUpdate) { + this.pendingPositioningUpdate = false; + _AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection); + if (this.anchorElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection); + } + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection); + } + } + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + } + }; + this.getViewport = () => { + if (typeof this.viewport !== "string" || this.viewport === "") { + return document.documentElement; + } + return document.getElementById(this.viewport); + }; + this.getAnchor = () => { + return document.getElementById(this.anchor); + }; + this.handleIntersection = (entries) => { + if (!this.pendingPositioningUpdate) { + return; + } + this.pendingPositioningUpdate = false; + if (!this.applyIntersectionEntries(entries)) { + return; + } + this.updateLayout(); + }; + this.applyIntersectionEntries = (entries) => { + const regionEntry = entries.find((x) => x.target === this); + const anchorEntry = entries.find((x) => x.target === this.anchorElement); + const viewportEntry = entries.find((x) => x.target === this.viewportElement); + if (regionEntry === void 0 || viewportEntry === void 0 || anchorEntry === void 0) { + return false; + } + if (!this.regionVisible || this.forceUpdate || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0 || this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) || this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) || this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) { + this.regionRect = regionEntry.boundingClientRect; + this.anchorRect = anchorEntry.boundingClientRect; + if (this.viewportElement === document.documentElement) { + this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x + document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y + document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height); + } else { + this.viewportRect = viewportEntry.boundingClientRect; + } + this.updateRegionOffset(); + this.forceUpdate = false; + return true; + } + return false; + }; + this.updateRegionOffset = () => { + if (this.anchorRect && this.regionRect) { + this.baseHorizontalOffset = this.baseHorizontalOffset + (this.anchorRect.left - this.regionRect.left) + (this.translateX - this.baseHorizontalOffset); + this.baseVerticalOffset = this.baseVerticalOffset + (this.anchorRect.top - this.regionRect.top) + (this.translateY - this.baseVerticalOffset); + } + }; + this.isRectDifferent = (rectA, rectB) => { + if (Math.abs(rectA.top - rectB.top) > this.updateThreshold || Math.abs(rectA.right - rectB.right) > this.updateThreshold || Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold || Math.abs(rectA.left - rectB.left) > this.updateThreshold) { + return true; + } + return false; + }; + this.handleResize = (entries) => { + this.update(); + }; + this.reset = () => { + if (!this.pendingReset) { + return; + } + this.pendingReset = false; + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + if (this.viewportElement === null) { + this.viewportElement = this.getViewport(); + } + this.currentDirection = getDirection(this); + this.startObservers(); + }; + this.updateLayout = () => { + let desiredVerticalPosition = void 0; + let desiredHorizontalPosition = void 0; + if (this.horizontalPositioningMode !== "uncontrolled") { + const horizontalOptions = this.getPositioningOptions(this.horizontalInset); + if (this.horizontalDefaultPosition === "center") { + desiredHorizontalPosition = "center"; + } else if (this.horizontalDefaultPosition !== "unset") { + let dirCorrectedHorizontalDefaultPosition = this.horizontalDefaultPosition; + if (dirCorrectedHorizontalDefaultPosition === "start" || dirCorrectedHorizontalDefaultPosition === "end") { + const newDirection = getDirection(this); + if (newDirection !== this.currentDirection) { + this.currentDirection = newDirection; + this.initialize(); + return; + } + if (this.currentDirection === Direction.ltr) { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right"; + } else { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left"; + } + } + switch (dirCorrectedHorizontalDefaultPosition) { + case "left": + desiredHorizontalPosition = this.horizontalInset ? "insetStart" : "start"; + break; + case "right": + desiredHorizontalPosition = this.horizontalInset ? "insetEnd" : "end"; + break; + } + } + const horizontalThreshold = this.horizontalThreshold !== void 0 ? this.horizontalThreshold : this.regionRect !== void 0 ? this.regionRect.width : 0; + const anchorLeft = this.anchorRect !== void 0 ? this.anchorRect.left : 0; + const anchorRight = this.anchorRect !== void 0 ? this.anchorRect.right : 0; + const anchorWidth = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + const viewportLeft = this.viewportRect !== void 0 ? this.viewportRect.left : 0; + const viewportRight = this.viewportRect !== void 0 ? this.viewportRect.right : 0; + if (desiredHorizontalPosition === void 0 || !(this.horizontalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold) { + desiredHorizontalPosition = this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) > this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) ? horizontalOptions[0] : horizontalOptions[1]; + } + } + if (this.verticalPositioningMode !== "uncontrolled") { + const verticalOptions = this.getPositioningOptions(this.verticalInset); + if (this.verticalDefaultPosition === "center") { + desiredVerticalPosition = "center"; + } else if (this.verticalDefaultPosition !== "unset") { + switch (this.verticalDefaultPosition) { + case "top": + desiredVerticalPosition = this.verticalInset ? "insetStart" : "start"; + break; + case "bottom": + desiredVerticalPosition = this.verticalInset ? "insetEnd" : "end"; + break; + } + } + const verticalThreshold = this.verticalThreshold !== void 0 ? this.verticalThreshold : this.regionRect !== void 0 ? this.regionRect.height : 0; + const anchorTop = this.anchorRect !== void 0 ? this.anchorRect.top : 0; + const anchorBottom = this.anchorRect !== void 0 ? this.anchorRect.bottom : 0; + const anchorHeight = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + const viewportTop = this.viewportRect !== void 0 ? this.viewportRect.top : 0; + const viewportBottom = this.viewportRect !== void 0 ? this.viewportRect.bottom : 0; + if (desiredVerticalPosition === void 0 || !(this.verticalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold) { + desiredVerticalPosition = this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) > this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) ? verticalOptions[0] : verticalOptions[1]; + } + } + const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition); + const positionChanged = this.horizontalPosition !== desiredHorizontalPosition || this.verticalPosition !== desiredVerticalPosition; + this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension); + this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension); + this.updateRegionStyle(); + if (!this.initialLayoutComplete) { + this.initialLayoutComplete = true; + this.requestPositionUpdates(); + return; + } + if (!this.regionVisible) { + this.regionVisible = true; + this.style.removeProperty("pointer-events"); + this.style.removeProperty("opacity"); + this.classList.toggle("loaded", true); + this.$emit("loaded", this, { bubbles: false }); + } + this.updatePositionClasses(); + if (positionChanged) { + this.$emit("positionchange", this, { bubbles: false }); + } + }; + this.updateRegionStyle = () => { + this.style.width = this.regionWidth; + this.style.height = this.regionHeight; + this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`; + }; + this.updatePositionClasses = () => { + this.classList.toggle("top", this.verticalPosition === "start"); + this.classList.toggle("bottom", this.verticalPosition === "end"); + this.classList.toggle("inset-top", this.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.verticalPosition === "insetEnd"); + this.classList.toggle("vertical-center", this.verticalPosition === "center"); + this.classList.toggle("left", this.horizontalPosition === "start"); + this.classList.toggle("right", this.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.horizontalPosition === "insetEnd"); + this.classList.toggle("horizontal-center", this.horizontalPosition === "center"); + }; + this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => { + if (desiredHorizontalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionWidth = 0; + switch (this.horizontalScaling) { + case "anchor": + case "fill": + nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width; + this.regionWidth = `${nextRegionWidth}px`; + break; + case "content": + nextRegionWidth = this.regionRect.width; + this.regionWidth = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredHorizontalPosition) { + case "start": + this.translateX = this.baseHorizontalOffset - nextRegionWidth; + if (this.horizontalViewportLock && this.anchorRect.left > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.right); + } + break; + case "insetStart": + this.translateX = this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.right); + } + break; + case "insetEnd": + this.translateX = this.baseHorizontalOffset; + if (this.horizontalViewportLock && this.anchorRect.left < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.left); + } + break; + case "end": + this.translateX = this.baseHorizontalOffset + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.left); + } + break; + case "center": + sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2; + this.translateX = this.baseHorizontalOffset + sizeDelta; + if (this.horizontalViewportLock) { + const regionLeft = this.anchorRect.left + sizeDelta; + const regionRight = this.anchorRect.right - sizeDelta; + if (regionLeft < this.viewportRect.left && !(regionRight > this.viewportRect.right)) { + this.translateX = this.translateX - (regionLeft - this.viewportRect.left); + } else if (regionRight > this.viewportRect.right && !(regionLeft < this.viewportRect.left)) { + this.translateX = this.translateX - (regionRight - this.viewportRect.right); + } + } + break; + } + this.horizontalPosition = desiredHorizontalPosition; + }; + this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => { + if (desiredVerticalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionHeight = 0; + switch (this.verticalScaling) { + case "anchor": + case "fill": + nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height; + this.regionHeight = `${nextRegionHeight}px`; + break; + case "content": + nextRegionHeight = this.regionRect.height; + this.regionHeight = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredVerticalPosition) { + case "start": + this.translateY = this.baseVerticalOffset - nextRegionHeight; + if (this.verticalViewportLock && this.anchorRect.top > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.bottom); + } + break; + case "insetStart": + this.translateY = this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.bottom); + } + break; + case "insetEnd": + this.translateY = this.baseVerticalOffset; + if (this.verticalViewportLock && this.anchorRect.top < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.top); + } + break; + case "end": + this.translateY = this.baseVerticalOffset + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.top); + } + break; + case "center": + sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2; + this.translateY = this.baseVerticalOffset + sizeDelta; + if (this.verticalViewportLock) { + const regionTop = this.anchorRect.top + sizeDelta; + const regionBottom = this.anchorRect.bottom - sizeDelta; + if (regionTop < this.viewportRect.top && !(regionBottom > this.viewportRect.bottom)) { + this.translateY = this.translateY - (regionTop - this.viewportRect.top); + } else if (regionBottom > this.viewportRect.bottom && !(regionTop < this.viewportRect.top)) { + this.translateY = this.translateY - (regionBottom - this.viewportRect.bottom); + } + } + } + this.verticalPosition = desiredVerticalPosition; + }; + this.getPositioningOptions = (inset) => { + if (inset) { + return ["insetStart", "insetEnd"]; + } + return ["start", "end"]; + }; + this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => { + const spaceStart = anchorStart - viewportStart; + const spaceEnd = viewportEnd - (anchorStart + anchorSpan); + switch (positionOption) { + case "start": + return spaceStart; + case "insetStart": + return spaceStart + anchorSpan; + case "insetEnd": + return spaceEnd + anchorSpan; + case "end": + return spaceEnd; + case "center": + return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan; + } + }; + this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => { + const newRegionDimension = { + height: this.regionRect !== void 0 ? this.regionRect.height : 0, + width: this.regionRect !== void 0 ? this.regionRect.width : 0 + }; + if (desiredHorizontalPosition !== void 0 && this.horizontalScaling === "fill") { + newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== void 0 ? this.anchorRect.left : 0, this.anchorRect !== void 0 ? this.anchorRect.right : 0, this.anchorRect !== void 0 ? this.anchorRect.width : 0, this.viewportRect !== void 0 ? this.viewportRect.left : 0, this.viewportRect !== void 0 ? this.viewportRect.right : 0); + } else if (this.horizontalScaling === "anchor") { + newRegionDimension.width = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + } + if (desiredVerticalPosition !== void 0 && this.verticalScaling === "fill") { + newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== void 0 ? this.anchorRect.top : 0, this.anchorRect !== void 0 ? this.anchorRect.bottom : 0, this.anchorRect !== void 0 ? this.anchorRect.height : 0, this.viewportRect !== void 0 ? this.viewportRect.top : 0, this.viewportRect !== void 0 ? this.viewportRect.bottom : 0); + } else if (this.verticalScaling === "anchor") { + newRegionDimension.height = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + } + return newRegionDimension; + }; + this.startAutoUpdateEventListeners = () => { + window.addEventListener(eventResize, this.update, { passive: true }); + window.addEventListener(eventScroll, this.update, { + passive: true, + capture: true + }); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.observe(this.viewportElement); + } + }; + this.stopAutoUpdateEventListeners = () => { + window.removeEventListener(eventResize, this.update); + window.removeEventListener(eventScroll, this.update); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.unobserve(this.viewportElement); + } + }; + } + anchorChanged() { + if (this.initialLayoutComplete) { + this.anchorElement = this.getAnchor(); + } + } + viewportChanged() { + if (this.initialLayoutComplete) { + this.viewportElement = this.getViewport(); + } + } + horizontalPositioningModeChanged() { + this.requestReset(); + } + horizontalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + horizontalViewportLockChanged() { + this.updateForAttributeChange(); + } + horizontalInsetChanged() { + this.updateForAttributeChange(); + } + horizontalThresholdChanged() { + this.updateForAttributeChange(); + } + horizontalScalingChanged() { + this.updateForAttributeChange(); + } + verticalPositioningModeChanged() { + this.requestReset(); + } + verticalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + verticalViewportLockChanged() { + this.updateForAttributeChange(); + } + verticalInsetChanged() { + this.updateForAttributeChange(); + } + verticalThresholdChanged() { + this.updateForAttributeChange(); + } + verticalScalingChanged() { + this.updateForAttributeChange(); + } + fixedPlacementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + autoUpdateModeChanged(prevMode, newMode) { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + if (prevMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + if (newMode === "auto") { + this.startAutoUpdateEventListeners(); + } + } + } + anchorElementChanged() { + this.requestReset(); + } + viewportElementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.autoUpdateMode === "auto") { + this.startAutoUpdateEventListeners(); + } + this.initialize(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.autoUpdateMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + this.stopObservers(); + this.disconnectResizeDetector(); + } + /** + * @internal + */ + adoptedCallback() { + this.initialize(); + } + /** + * destroys the instance's resize observer + */ + disconnectResizeDetector() { + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.handleResize); + } + /** + * react to attribute changes that don't require a reset + */ + updateForAttributeChange() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.forceUpdate = true; + this.update(); + } + } + /** + * fully initializes the component + */ + initialize() { + this.initializeResizeDetector(); + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + this.requestReset(); + } + /** + * Request a reset if there are currently no open requests + */ + requestReset() { + if (this.$fastController.isConnected && this.pendingReset === false) { + this.setInitialState(); + DOM.queueUpdate(() => this.reset()); + this.pendingReset = true; + } + } + /** + * sets the starting configuration for component internal values + */ + setInitialState() { + this.initialLayoutComplete = false; + this.regionVisible = false; + this.translateX = 0; + this.translateY = 0; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.viewportRect = void 0; + this.regionRect = void 0; + this.anchorRect = void 0; + this.verticalPosition = void 0; + this.horizontalPosition = void 0; + this.style.opacity = "0"; + this.style.pointerEvents = "none"; + this.forceUpdate = false; + this.style.position = this.fixedPlacement ? "fixed" : "absolute"; + this.updatePositionClasses(); + this.updateRegionStyle(); + } + }; + AnchoredRegion.intersectionService = new IntersectionService(); + __decorate([ + attr + ], AnchoredRegion.prototype, "anchor", void 0); + __decorate([ + attr + ], AnchoredRegion.prototype, "viewport", void 0); + __decorate([ + attr({ attribute: "horizontal-positioning-mode" }) + ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0); + __decorate([ + attr({ attribute: "horizontal-default-position" }) + ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "horizontal-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalInset", void 0); + __decorate([ + attr({ attribute: "horizontal-threshold" }) + ], AnchoredRegion.prototype, "horizontalThreshold", void 0); + __decorate([ + attr({ attribute: "horizontal-scaling" }) + ], AnchoredRegion.prototype, "horizontalScaling", void 0); + __decorate([ + attr({ attribute: "vertical-positioning-mode" }) + ], AnchoredRegion.prototype, "verticalPositioningMode", void 0); + __decorate([ + attr({ attribute: "vertical-default-position" }) + ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalInset", void 0); + __decorate([ + attr({ attribute: "vertical-threshold" }) + ], AnchoredRegion.prototype, "verticalThreshold", void 0); + __decorate([ + attr({ attribute: "vertical-scaling" }) + ], AnchoredRegion.prototype, "verticalScaling", void 0); + __decorate([ + attr({ attribute: "fixed-placement", mode: "boolean" }) + ], AnchoredRegion.prototype, "fixedPlacement", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], AnchoredRegion.prototype, "autoUpdateMode", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "anchorElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "viewportElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "initialLayoutComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js + var horizontalAnchorOverlay, FlyoutPosTop, FlyoutPosBottom, FlyoutPosTallest, FlyoutPosTopFill, FlyoutPosBottomFill, FlyoutPosTallestFill; + var init_anchored_region_config = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js"() { + horizontalAnchorOverlay = { + horizontalDefaultPosition: "center", + horizontalPositioningMode: "locktodefault", + horizontalInset: false, + horizontalScaling: "anchor" + }; + FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "top", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "bottom", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: "dynamic", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: "fill" }); + FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: "fill" }); + FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: "fill" }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js + var init_anchored_region2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js"() { + init_anchored_region_template(); + init_anchored_region(); + init_anchored_region_config(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js + var init_avatar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js + var Avatar; + var init_avatar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Avatar = class extends FoundationElement { + /** + * Internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.shape) { + this.shape = "circle"; + } + } + }; + __decorate([ + attr + ], Avatar.prototype, "fill", void 0); + __decorate([ + attr + ], Avatar.prototype, "color", void 0); + __decorate([ + attr + ], Avatar.prototype, "link", void 0); + __decorate([ + attr + ], Avatar.prototype, "shape", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js + var init_avatar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js"() { + init_avatar_template(); + init_avatar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js + var badgeTemplate; + var init_badge_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js"() { + init_esm(); + badgeTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js + var Badge; + var init_badge = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Badge = class extends FoundationElement { + constructor() { + super(...arguments); + this.generateBadgeStyle = () => { + if (!this.fill && !this.color) { + return; + } + const fill = `background-color: var(--badge-fill-${this.fill});`; + const color = `color: var(--badge-color-${this.color});`; + if (this.fill && !this.color) { + return fill; + } else if (this.color && !this.fill) { + return color; + } else { + return `${color} ${fill}`; + } + }; + } + }; + __decorate([ + attr({ attribute: "fill" }) + ], Badge.prototype, "fill", void 0); + __decorate([ + attr({ attribute: "color" }) + ], Badge.prototype, "color", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Badge.prototype, "circular", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js + var init_badge2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js"() { + init_badge_template(); + init_badge(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js + var init_breadcrumb_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js + var BreadcrumbItem; + var init_breadcrumb_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js"() { + init_tslib_es6(); + init_esm(); + init_anchor(); + init_patterns(); + init_apply_mixins(); + BreadcrumbItem = class extends Anchor { + constructor() { + super(...arguments); + this.separator = true; + } + }; + __decorate([ + observable + ], BreadcrumbItem.prototype, "separator", void 0); + applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js + var init_breadcrumb_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js"() { + init_breadcrumb_item_template(); + init_breadcrumb_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js + var init_breadcrumb_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js + var Breadcrumb; + var init_breadcrumb = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js"() { + init_tslib_es6(); + init_esm(); + init_breadcrumb_item(); + init_foundation_element(); + Breadcrumb = class extends FoundationElement { + slottedBreadcrumbItemsChanged() { + if (this.$fastController.isConnected) { + if (this.slottedBreadcrumbItems === void 0 || this.slottedBreadcrumbItems.length === 0) { + return; + } + const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1]; + this.slottedBreadcrumbItems.forEach((item) => { + const itemIsLastNode = item === lastNode; + this.setItemSeparator(item, itemIsLastNode); + this.setAriaCurrent(item, itemIsLastNode); + }); + } + } + setItemSeparator(item, isLastNode) { + if (item instanceof BreadcrumbItem) { + item.separator = !isLastNode; + } + } + /** + * Finds href on childnodes in the light DOM or shadow DOM. + * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href. + */ + findChildWithHref(node) { + var _a, _b; + if (node.childElementCount > 0) { + return node.querySelector("a[href]"); + } else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) { + return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]"); + } else + return null; + } + /** + * Sets ARIA Current for the current node + * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node, + * otherwise apply aria-current to the host element, with an href + */ + setAriaCurrent(item, isLastNode) { + const childNodeWithHref = this.findChildWithHref(item); + if (childNodeWithHref === null && item.hasAttribute("href") && item instanceof BreadcrumbItem) { + isLastNode ? item.setAttribute("aria-current", "page") : item.removeAttribute("aria-current"); + } else if (childNodeWithHref !== null) { + isLastNode ? childNodeWithHref.setAttribute("aria-current", "page") : childNodeWithHref.removeAttribute("aria-current"); + } + } + }; + __decorate([ + observable + ], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js + var init_breadcrumb2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js"() { + init_breadcrumb_template(); + init_breadcrumb(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js + var buttonTemplate; + var init_button_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js"() { + init_esm(); + init_start_end(); + buttonTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js + function FormAssociated(BaseCtor) { + const C = class extends BaseCtor { + constructor(...args) { + super(...args); + this.dirtyValue = false; + this.disabled = false; + this.proxyEventsToBlock = ["change", "click"]; + this.proxyInitialized = false; + this.required = false; + this.initialValue = this.initialValue || ""; + if (!this.elementInternals) { + this.formResetCallback = this.formResetCallback.bind(this); + } + } + /** + * Must evaluate to true to enable elementInternals. + * Feature detects API support and resolve respectively + * + * @internal + */ + static get formAssociated() { + return supportsElementInternals; + } + /** + * Returns the validity state of the element + * + * @alpha + */ + get validity() { + return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; + } + /** + * Retrieve a reference to the associated form. + * Returns null if not associated to any form. + * + * @alpha + */ + get form() { + return this.elementInternals ? this.elementInternals.form : this.proxy.form; + } + /** + * Retrieve the localized validation message, + * or custom validation message if set. + * + * @alpha + */ + get validationMessage() { + return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; + } + /** + * Whether the element will be validated when the + * form is submitted + */ + get willValidate() { + return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; + } + /** + * A reference to all associated label elements + */ + get labels() { + if (this.elementInternals) { + return Object.freeze(Array.from(this.elementInternals.labels)); + } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { + const parentLabels = this.proxy.labels; + const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)); + const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; + return Object.freeze(labels); + } else { + return emptyArray; + } + } + /** + * Invoked when the `value` property changes + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `valueChanged` method + * They must be sure to invoke `super.valueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + valueChanged(previous, next) { + this.dirtyValue = true; + if (this.proxy instanceof HTMLElement) { + this.proxy.value = this.value; + } + this.currentValue = this.value; + this.setFormValue(this.value); + this.validate(); + } + currentValueChanged() { + this.value = this.currentValue; + } + /** + * Invoked when the `initialValue` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `initialValueChanged` method + * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + /** + * Invoked when the `disabled` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `disabledChanged` method + * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + disabledChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.disabled = this.disabled; + } + DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled)); + } + /** + * Invoked when the `name` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `nameChanged` method + * They must be sure to invoke `super.nameChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + nameChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.name = this.name; + } + } + /** + * Invoked when the `required` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `requiredChanged` method + * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + requiredChanged(prev, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.required = this.required; + } + DOM.queueUpdate(() => this.classList.toggle("required", this.required)); + this.validate(); + } + /** + * The element internals object. Will only exist + * in browsers supporting the attachInternals API + */ + get elementInternals() { + if (!supportsElementInternals) { + return null; + } + let internals = InternalsMap.get(this); + if (!internals) { + internals = this.attachInternals(); + InternalsMap.set(this, internals); + } + return internals; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("keypress", this._keypressHandler); + if (!this.value) { + this.value = this.initialValue; + this.dirtyValue = false; + } + if (!this.elementInternals) { + this.attachProxy(); + if (this.form) { + this.form.addEventListener("reset", this.formResetCallback); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.proxyEventsToBlock.forEach((name) => this.proxy.removeEventListener(name, this.stopPropagation)); + if (!this.elementInternals && this.form) { + this.form.removeEventListener("reset", this.formResetCallback); + } + } + /** + * Return the current validity of the element. + */ + checkValidity() { + return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); + } + /** + * Return the current validity of the element. + * If false, fires an invalid event at the element. + */ + reportValidity() { + return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); + } + /** + * Set the validity of the control. In cases when the elementInternals object is not + * available (and the proxy element is used to report validity), this function will + * do nothing unless a message is provided, at which point the setCustomValidity method + * of the proxy element will be invoked with the provided message. + * @param flags - Validity flags + * @param message - Optional message to supply + * @param anchor - Optional element used by UA to display an interactive validation UI + */ + setValidity(flags, message, anchor) { + if (this.elementInternals) { + this.elementInternals.setValidity(flags, message, anchor); + } else if (typeof message === "string") { + this.proxy.setCustomValidity(message); + } + } + /** + * Invoked when a connected component's form or fieldset has its disabled + * state changed. + * @param disabled - the disabled value of the form / fieldset + */ + formDisabledCallback(disabled) { + this.disabled = disabled; + } + formResetCallback() { + this.value = this.initialValue; + this.dirtyValue = false; + } + /** + * Attach the proxy element to the DOM + */ + attachProxy() { + var _a; + if (!this.proxyInitialized) { + this.proxyInitialized = true; + this.proxy.style.display = "none"; + this.proxyEventsToBlock.forEach((name) => this.proxy.addEventListener(name, this.stopPropagation)); + this.proxy.disabled = this.disabled; + this.proxy.required = this.required; + if (typeof this.name === "string") { + this.proxy.name = this.name; + } + if (typeof this.value === "string") { + this.proxy.value = this.value; + } + this.proxy.setAttribute("slot", proxySlotName); + this.proxySlot = document.createElement("slot"); + this.proxySlot.setAttribute("name", proxySlotName); + } + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); + this.appendChild(this.proxy); + } + /** + * Detach the proxy element from the DOM + */ + detachProxy() { + var _a; + this.removeChild(this.proxy); + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate(anchor) { + if (this.proxy instanceof HTMLElement) { + this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); + } + } + /** + * Associates the provided value (and optional state) with the parent form. + * @param value - The value to set + * @param state - The state object provided to during session restores and when autofilling. + */ + setFormValue(value, state) { + if (this.elementInternals) { + this.elementInternals.setFormValue(value, state || value); + } + } + _keypressHandler(e) { + switch (e.key) { + case keyEnter: + if (this.form instanceof HTMLFormElement) { + const defaultButton = this.form.querySelector("[type=submit]"); + defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); + } + break; + } + } + /** + * Used to stop propagation of proxy element events + * @param e - Event object + */ + stopPropagation(e) { + e.stopPropagation(); + } + }; + attr({ mode: "boolean" })(C.prototype, "disabled"); + attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue"); + attr({ attribute: "current-value" })(C.prototype, "currentValue"); + attr(C.prototype, "name"); + attr({ mode: "boolean" })(C.prototype, "required"); + observable(C.prototype, "value"); + return C; + } + function CheckableFormAssociated(BaseCtor) { + class C extends FormAssociated(BaseCtor) { + } + class D extends C { + constructor(...args) { + super(args); + this.dirtyChecked = false; + this.checkedAttribute = false; + this.checked = false; + this.dirtyChecked = false; + } + checkedAttributeChanged() { + this.defaultChecked = this.checkedAttribute; + } + /** + * @internal + */ + defaultCheckedChanged() { + if (!this.dirtyChecked) { + this.checked = this.defaultChecked; + this.dirtyChecked = false; + } + } + checkedChanged(prev, next) { + if (!this.dirtyChecked) { + this.dirtyChecked = true; + } + this.currentChecked = this.checked; + this.updateForm(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.checked = this.checked; + } + if (prev !== void 0) { + this.$emit("change"); + } + this.validate(); + } + currentCheckedChanged(prev, next) { + this.checked = this.currentChecked; + } + updateForm() { + const value = this.checked ? this.value : null; + this.setFormValue(value, value); + } + connectedCallback() { + super.connectedCallback(); + this.updateForm(); + } + formResetCallback() { + super.formResetCallback(); + this.checked = !!this.checkedAttribute; + this.dirtyChecked = false; + } + } + attr({ attribute: "checked", mode: "boolean" })(D.prototype, "checkedAttribute"); + attr({ attribute: "current-checked", converter: booleanConverter })(D.prototype, "currentChecked"); + observable(D.prototype, "defaultChecked"); + observable(D.prototype, "checked"); + return D; + } + var proxySlotName, ElementInternalsKey, supportsElementInternals, InternalsMap; + var init_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js"() { + init_esm(); + init_dist2(); + proxySlotName = "form-associated-proxy"; + ElementInternalsKey = "ElementInternals"; + supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; + InternalsMap = /* @__PURE__ */ new WeakMap(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js + var _Button, FormAssociatedButton; + var init_button_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Button = class extends FoundationElement { + }; + FormAssociatedButton = class extends FormAssociated(_Button) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.js + var Button, DelegatesARIAButton; + var init_button = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_button_form_associated(); + Button = class extends FormAssociatedButton { + constructor() { + super(...arguments); + this.handleClick = (e) => { + var _a; + if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) { + e.stopPropagation(); + } + }; + this.handleSubmission = () => { + if (!this.form) { + return; + } + const attached = this.proxy.isConnected; + if (!attached) { + this.attachProxy(); + } + typeof this.form.requestSubmit === "function" ? this.form.requestSubmit(this.proxy) : this.proxy.click(); + if (!attached) { + this.detachProxy(); + } + }; + this.handleFormReset = () => { + var _a; + (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset(); + }; + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + this.control.focus(); + }; + } + }; + } + formactionChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formAction = this.formaction; + } + } + formenctypeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formEnctype = this.formenctype; + } + } + formmethodChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formMethod = this.formmethod; + } + } + formnovalidateChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formNoValidate = this.formnovalidate; + } + } + formtargetChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formTarget = this.formtarget; + } + } + typeChanged(previous, next) { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + } + next === "submit" && this.addEventListener("click", this.handleSubmission); + previous === "submit" && this.removeEventListener("click", this.handleSubmission); + next === "reset" && this.addEventListener("click", this.handleFormReset); + previous === "reset" && this.removeEventListener("click", this.handleFormReset); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.handleUnsupportedDelegatesFocus(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.addEventListener("click", this.handleClick); + }); + } + } + /** + * @internal + */ + disconnectedCallback() { + var _a; + super.disconnectedCallback(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.removeEventListener("click", this.handleClick); + }); + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], Button.prototype, "formId", void 0); + __decorate([ + attr + ], Button.prototype, "formaction", void 0); + __decorate([ + attr + ], Button.prototype, "formenctype", void 0); + __decorate([ + attr + ], Button.prototype, "formmethod", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "formnovalidate", void 0); + __decorate([ + attr + ], Button.prototype, "formtarget", void 0); + __decorate([ + attr + ], Button.prototype, "type", void 0); + __decorate([ + observable + ], Button.prototype, "defaultSlottedContent", void 0); + DelegatesARIAButton = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIAButton.prototype, "ariaExpanded", void 0); + __decorate([ + attr({ attribute: "aria-pressed" }) + ], DelegatesARIAButton.prototype, "ariaPressed", void 0); + applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties); + applyMixins(Button, StartEnd, DelegatesARIAButton); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/index.js + var init_button2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/index.js"() { + init_button_template(); + init_button(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js + var DateFormatter; + var init_date_formatter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js"() { + DateFormatter = class { + constructor(config) { + this.dayFormat = "numeric"; + this.weekdayFormat = "long"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.date = /* @__PURE__ */ new Date(); + if (config) { + for (const key in config) { + const value = config[key]; + if (key === "date") { + this.date = this.getDateObject(value); + } else { + this[key] = value; + } + } + } + } + /** + * Helper function to make sure that the DateFormatter is working with an instance of Date + * @param date - The date as an object, string or Date insance + * @returns - A Date instance + * @public + */ + getDateObject(date) { + if (typeof date === "string") { + const dates = date.split(/[/-]/); + if (dates.length < 3) { + return /* @__PURE__ */ new Date(); + } + return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10)); + } else if ("day" in date && "month" in date && "year" in date) { + const { day, month, year } = date; + return new Date(year, month - 1, day); + } + return date; + } + /** + * + * @param date - a valide date as either a Date, string, objec or a DateFormatter + * @param format - The formatting for the string + * @param locale - locale data used for formatting + * @returns A localized string of the date provided + * @public + */ + getDate(date = this.date, format = { + weekday: this.weekdayFormat, + month: this.monthFormat, + day: this.dayFormat, + year: this.yearFormat + }, locale = this.locale) { + const dateObj = this.getDateObject(date); + if (!dateObj.getTime()) { + return ""; + } + const optionsWithTimeZone = Object.assign({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }, format); + return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj); + } + /** + * + * @param day - Day to localize + * @param format - The formatting for the day + * @param locale - The locale data used for formatting + * @returns - A localized number for the day + * @public + */ + getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) { + return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale); + } + /** + * + * @param month - The month to localize + * @param format - The formatting for the month + * @param locale - The locale data used for formatting + * @returns - A localized name of the month + * @public + */ + getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) { + return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale); + } + /** + * + * @param year - The year to localize + * @param format - The formatting for the year + * @param locale - The locale data used for formatting + * @returns - A localized string for the year + * @public + */ + getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) { + return this.getDate({ month: 2, day: 2, year }, { year: format }, locale); + } + /** + * + * @param weekday - The number of the weekday, defaults to Sunday + * @param format - The formatting for the weekday label + * @param locale - The locale data used for formatting + * @returns - A formatted weekday label + * @public + */ + getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) { + const date = `1-${weekday + 1}-2017`; + return this.getDate(date, { weekday: format }, locale); + } + /** + * + * @param format - The formatting for the weekdays + * @param locale - The locale data used for formatting + * @returns - An array of the weekday labels + * @public + */ + getWeekdays(format = this.weekdayFormat, locale = this.locale) { + return Array(7).fill(null).map((_, day) => this.getWeekday(day, format, locale)); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js + var Calendar; + var init_calendar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_date_formatter(); + Calendar = class extends FoundationElement { + constructor() { + super(...arguments); + this.dateFormatter = new DateFormatter(); + this.readonly = false; + this.locale = "en-US"; + this.month = (/* @__PURE__ */ new Date()).getMonth() + 1; + this.year = (/* @__PURE__ */ new Date()).getFullYear(); + this.dayFormat = "numeric"; + this.weekdayFormat = "short"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.minWeeks = 0; + this.disabledDates = ""; + this.selectedDates = ""; + this.oneDayInMs = 864e5; + } + localeChanged() { + this.dateFormatter.locale = this.locale; + } + dayFormatChanged() { + this.dateFormatter.dayFormat = this.dayFormat; + } + weekdayFormatChanged() { + this.dateFormatter.weekdayFormat = this.weekdayFormat; + } + monthFormatChanged() { + this.dateFormatter.monthFormat = this.monthFormat; + } + yearFormatChanged() { + this.dateFormatter.yearFormat = this.yearFormat; + } + /** + * Gets data needed to render about a calendar month as well as the previous and next months + * @param year - year of the calendar + * @param month - month of the calendar + * @returns - an object with data about the current and 2 surrounding months + * @public + */ + getMonthInfo(month = this.month, year = this.year) { + const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay(); + const getLength = (date) => { + const nextMonth2 = new Date(date.getFullYear(), date.getMonth() + 1, 1); + return new Date(nextMonth2.getTime() - this.oneDayInMs).getDate(); + }; + const thisMonth = new Date(year, month - 1); + const nextMonth = new Date(year, month); + const previousMonth = new Date(year, month - 2); + return { + length: getLength(thisMonth), + month, + start: getFirstDay(thisMonth), + year, + previous: { + length: getLength(previousMonth), + month: previousMonth.getMonth() + 1, + start: getFirstDay(previousMonth), + year: previousMonth.getFullYear() + }, + next: { + length: getLength(nextMonth), + month: nextMonth.getMonth() + 1, + start: getFirstDay(nextMonth), + year: nextMonth.getFullYear() + } + }; + } + /** + * A list of calendar days + * @param info - an object containing the information needed to render a calendar month + * @param minWeeks - minimum number of weeks to show + * @returns a list of days in a calendar month + * @public + */ + getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) { + minWeeks = minWeeks > 10 ? 10 : minWeeks; + const { start, length, previous, next } = info; + const days = []; + let dayCount = 1 - start; + while (dayCount < length + 1 || days.length < minWeeks || days[days.length - 1].length % 7 !== 0) { + const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info; + const day = dayCount < 1 ? previous.length + dayCount : dayCount > length ? dayCount - length : dayCount; + const dateString = `${month}-${day}-${year}`; + const disabled = this.dateInString(dateString, this.disabledDates); + const selected = this.dateInString(dateString, this.selectedDates); + const date = { + day, + month, + year, + disabled, + selected + }; + const target = days[days.length - 1]; + if (days.length === 0 || target.length % 7 === 0) { + days.push([date]); + } else { + target.push(date); + } + dayCount++; + } + return days; + } + /** + * A helper function that checks if a date exists in a list of dates + * @param date - A date objec that includes the day, month and year + * @param datesString - a comma separated list of dates + * @returns - Returns true if it found the date in the list of dates + * @public + */ + dateInString(date, datesString) { + const dates = datesString.split(",").map((str) => str.trim()); + date = typeof date === "string" ? date : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; + return dates.some((d) => d === date); + } + /** + * Creates a class string for the day container + * @param date - date of the calendar cell + * @returns - string of class names + * @public + */ + getDayClassNames(date, todayString) { + const { day, month, year, disabled, selected } = date; + const today = todayString === `${month}-${day}-${year}`; + const inactive = this.month !== month; + return [ + "day", + today && "today", + inactive && "inactive", + disabled && "disabled", + selected && "selected" + ].filter(Boolean).join(" "); + } + /** + * Returns a list of weekday labels + * @returns An array of weekday text and full text if abbreviated + * @public + */ + getWeekdayText() { + const weekdayText = this.dateFormatter.getWeekdays().map((text) => ({ text })); + if (this.weekdayFormat !== "long") { + const longText = this.dateFormatter.getWeekdays("long"); + weekdayText.forEach((weekday, index) => { + weekday.abbr = longText[index]; + }); + } + return weekdayText; + } + /** + * Emits the "date-select" event with the day, month and year. + * @param date - Date cell + * @public + */ + handleDateSelect(event, day) { + event.preventDefault; + this.$emit("dateselected", day); + } + /** + * Handles keyboard events on a cell + * @param event - Keyboard event + * @param date - Date of the cell selected + */ + handleKeydown(event, date) { + if (event.key === keyEnter) { + this.handleDateSelect(event, date); + } + return true; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Calendar.prototype, "readonly", void 0); + __decorate([ + attr + ], Calendar.prototype, "locale", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "month", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "year", void 0); + __decorate([ + attr({ attribute: "day-format", mode: "fromView" }) + ], Calendar.prototype, "dayFormat", void 0); + __decorate([ + attr({ attribute: "weekday-format", mode: "fromView" }) + ], Calendar.prototype, "weekdayFormat", void 0); + __decorate([ + attr({ attribute: "month-format", mode: "fromView" }) + ], Calendar.prototype, "monthFormat", void 0); + __decorate([ + attr({ attribute: "year-format", mode: "fromView" }) + ], Calendar.prototype, "yearFormat", void 0); + __decorate([ + attr({ attribute: "min-weeks", converter: nullableNumberConverter }) + ], Calendar.prototype, "minWeeks", void 0); + __decorate([ + attr({ attribute: "disabled-dates" }) + ], Calendar.prototype, "disabledDates", void 0); + __decorate([ + attr({ attribute: "selected-dates" }) + ], Calendar.prototype, "selectedDates", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js + var GenerateHeaderOptions, DataGridCellTypes, DataGridRowTypes; + var init_data_grid_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js"() { + GenerateHeaderOptions = { + none: "none", + default: "default", + sticky: "sticky" + }; + DataGridCellTypes = { + default: "default", + columnHeader: "columnheader", + rowHeader: "rowheader" + }; + DataGridRowTypes = { + default: "default", + header: "header", + stickyHeader: "sticky-header" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js + var DataGridRow; + var init_data_grid_row = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGridRow = class extends FoundationElement { + constructor() { + super(...arguments); + this.rowType = DataGridRowTypes.default; + this.rowData = null; + this.columnDefinitions = null; + this.isActiveRow = false; + this.cellsRepeatBehavior = null; + this.cellsPlaceholder = null; + this.focusColumnIndex = 0; + this.refocusOnLoad = false; + this.updateRowStyle = () => { + this.style.gridTemplateColumns = this.gridTemplateColumns; + }; + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowStyle(); + } + } + rowTypeChanged() { + if (this.$fastController.isConnected) { + this.updateItemTemplate(); + } + } + rowDataChanged() { + if (this.rowData !== null && this.isActiveRow) { + this.refocusOnLoad = true; + return; + } + } + cellItemTemplateChanged() { + this.updateItemTemplate(); + } + headerCellItemTemplateChanged() { + this.updateItemTemplate(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.cellsRepeatBehavior === null) { + this.cellsPlaceholder = document.createComment(""); + this.appendChild(this.cellsPlaceholder); + this.updateItemTemplate(); + this.cellsRepeatBehavior = new RepeatDirective((x) => x.columnDefinitions, (x) => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder); + this.$fastController.addBehaviors([this.cellsRepeatBehavior]); + } + this.addEventListener("cell-focused", this.handleCellFocus); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.updateRowStyle(); + if (this.refocusOnLoad) { + this.refocusOnLoad = false; + if (this.cellElements.length > this.focusColumnIndex) { + this.cellElements[this.focusColumnIndex].focus(); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("cell-focused", this.handleCellFocus); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + } + handleFocusout(e) { + if (!this.contains(e.target)) { + this.isActiveRow = false; + this.focusColumnIndex = 0; + } + } + handleCellFocus(e) { + this.isActiveRow = true; + this.focusColumnIndex = this.cellElements.indexOf(e.target); + this.$emit("row-focused", this); + } + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusColumnIndex = 0; + switch (e.key) { + case keyArrowLeft: + newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyArrowRight: + newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyHome: + if (!e.ctrlKey) { + this.cellElements[0].focus(); + e.preventDefault(); + } + break; + case keyEnd: + if (!e.ctrlKey) { + this.cellElements[this.cellElements.length - 1].focus(); + e.preventDefault(); + } + break; + } + } + updateItemTemplate() { + this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate; + } + }; + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGridRow.prototype, "gridTemplateColumns", void 0); + __decorate([ + attr({ attribute: "row-type" }) + ], DataGridRow.prototype, "rowType", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowIndex", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "isActiveRow", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "activeCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js + function createRowItemTemplate(context) { + const rowTag = context.tagFor(DataGridRow); + return html` + <${rowTag} + :rowData="${(x) => x}" + :cellItemTemplate="${(x, c) => c.parent.cellItemTemplate}" + :headerCellItemTemplate="${(x, c) => c.parent.headerCellItemTemplate}" + > +`; + } + var dataGridTemplate; + var init_data_grid_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js"() { + init_esm(); + init_data_grid_row(); + dataGridTemplate = (context, definition) => { + const rowItemTemplate = createRowItemTemplate(context); + const rowTag = context.tagFor(DataGridRow); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js + var DataGrid; + var init_data_grid = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGrid = class _DataGrid extends FoundationElement { + constructor() { + super(); + this.noTabbing = false; + this.generateHeader = GenerateHeaderOptions.default; + this.rowsData = []; + this.columnDefinitions = null; + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + this.rowsPlaceholder = null; + this.generatedHeader = null; + this.isUpdatingFocus = false; + this.pendingFocusUpdate = false; + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = true; + this.generatedGridTemplateColumns = ""; + this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => { + if (this.rowElements.length === 0) { + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + return; + } + const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex)); + const focusRow = this.rowElements[focusRowIndex]; + const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'); + const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex)); + const focusTarget = cells[focusColumnIndex]; + if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) { + focusTarget.scrollIntoView({ block: "center", inline: "center" }); + } + focusTarget.focus(); + }; + this.onChildListChange = (mutations, observer) => { + if (mutations && mutations.length) { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((newNode) => { + if (newNode.nodeType === 1 && newNode.getAttribute("role") === "row") { + newNode.columnDefinitions = this.columnDefinitions; + } + }); + }); + this.queueRowIndexUpdate(); + } + }; + this.queueRowIndexUpdate = () => { + if (!this.rowindexUpdateQueued) { + this.rowindexUpdateQueued = true; + DOM.queueUpdate(this.updateRowIndexes); + } + }; + this.updateRowIndexes = () => { + let newGridTemplateColumns = this.gridTemplateColumns; + if (newGridTemplateColumns === void 0) { + if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) { + const firstRow = this.rowElements[0]; + this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" "); + } + newGridTemplateColumns = this.generatedGridTemplateColumns; + } + this.rowElements.forEach((element, index) => { + const thisRow = element; + thisRow.rowIndex = index; + thisRow.gridTemplateColumns = newGridTemplateColumns; + if (this.columnDefinitionsStale) { + thisRow.columnDefinitions = this.columnDefinitions; + } + }); + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = false; + }; + } + /** + * generates a gridTemplateColumns based on columndata array + */ + static generateTemplateColumns(columnDefinitions) { + let templateColumns = ""; + columnDefinitions.forEach((column) => { + templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`; + }); + return templateColumns; + } + noTabbingChanged() { + if (this.$fastController.isConnected) { + if (this.noTabbing) { + this.setAttribute("tabIndex", "-1"); + } else { + this.setAttribute("tabIndex", this.contains(document.activeElement) || this === document.activeElement ? "-1" : "0"); + } + } + } + generateHeaderChanged() { + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowIndexes(); + } + } + rowsDataChanged() { + if (this.columnDefinitions === null && this.rowsData.length > 0) { + this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]); + } + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + columnDefinitionsChanged() { + if (this.columnDefinitions === null) { + this.generatedGridTemplateColumns = ""; + return; + } + this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(this.columnDefinitions); + if (this.$fastController.isConnected) { + this.columnDefinitionsStale = true; + this.queueRowIndexUpdate(); + } + } + headerCellItemTemplateChanged() { + if (this.$fastController.isConnected) { + if (this.generatedHeader !== null) { + this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate; + } + } + } + focusRowIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + focusColumnIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.rowItemTemplate === void 0) { + this.rowItemTemplate = this.defaultRowItemTemplate; + } + this.rowsPlaceholder = document.createComment(""); + this.appendChild(this.rowsPlaceholder); + this.toggleGeneratedHeader(); + this.rowsRepeatBehavior = new RepeatDirective((x) => x.rowsData, (x) => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder); + this.$fastController.addBehaviors([this.rowsRepeatBehavior]); + this.addEventListener("row-focused", this.handleRowFocus); + this.addEventListener(eventFocus, this.handleFocus); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.addEventListener(eventFocusOut, this.handleFocusOut); + this.observer = new MutationObserver(this.onChildListChange); + this.observer.observe(this, { childList: true }); + if (this.noTabbing) { + this.setAttribute("tabindex", "-1"); + } + DOM.queueUpdate(this.queueRowIndexUpdate); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("row-focused", this.handleRowFocus); + this.removeEventListener(eventFocus, this.handleFocus); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.removeEventListener(eventFocusOut, this.handleFocusOut); + this.observer.disconnect(); + this.rowsPlaceholder = null; + this.generatedHeader = null; + } + /** + * @internal + */ + handleRowFocus(e) { + this.isUpdatingFocus = true; + const focusRow = e.target; + this.focusRowIndex = this.rowElements.indexOf(focusRow); + this.focusColumnIndex = focusRow.focusColumnIndex; + this.setAttribute("tabIndex", "-1"); + this.isUpdatingFocus = false; + } + /** + * @internal + */ + handleFocus(e) { + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + /** + * @internal + */ + handleFocusOut(e) { + if (e.relatedTarget === null || !this.contains(e.relatedTarget)) { + this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0"); + } + } + /** + * @internal + */ + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusRowIndex; + const maxIndex = this.rowElements.length - 1; + const currentGridBottom = this.offsetHeight + this.scrollTop; + const lastRow = this.rowElements[maxIndex]; + switch (e.key) { + case keyArrowUp: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true); + break; + case keyArrowDown: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true); + break; + case keyPageUp: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex === 0) { + this.focusOnCell(0, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex - 1; + for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop < this.scrollTop) { + this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyPageDown: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) { + this.focusOnCell(maxIndex, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex + 1; + for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) { + let stickyHeaderOffset = 0; + if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) { + stickyHeaderOffset = this.generatedHeader.clientHeight; + } + this.scrollTop = thisRow.offsetTop - stickyHeaderOffset; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyHome: + if (e.ctrlKey) { + e.preventDefault(); + this.focusOnCell(0, 0, true); + } + break; + case keyEnd: + if (e.ctrlKey && this.columnDefinitions !== null) { + e.preventDefault(); + this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true); + } + break; + } + } + queueFocusUpdate() { + if (this.isUpdatingFocus && (this.contains(document.activeElement) || this === document.activeElement)) { + return; + } + if (this.pendingFocusUpdate === false) { + this.pendingFocusUpdate = true; + DOM.queueUpdate(() => this.updateFocus()); + } + } + updateFocus() { + this.pendingFocusUpdate = false; + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + toggleGeneratedHeader() { + if (this.generatedHeader !== null) { + this.removeChild(this.generatedHeader); + this.generatedHeader = null; + } + if (this.generateHeader !== GenerateHeaderOptions.none && this.rowsData.length > 0) { + const generatedHeaderElement = document.createElement(this.rowElementTag); + this.generatedHeader = generatedHeaderElement; + this.generatedHeader.columnDefinitions = this.columnDefinitions; + this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns; + this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header; + if (this.firstChild !== null || this.rowsPlaceholder !== null) { + this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder); + } + return; + } + } + }; + DataGrid.generateColumns = (row) => { + return Object.getOwnPropertyNames(row).map((property, index) => { + return { + columnDataKey: property, + gridColumn: `${index}` + }; + }); + }; + __decorate([ + attr({ attribute: "no-tabbing", mode: "boolean" }) + ], DataGrid.prototype, "noTabbing", void 0); + __decorate([ + attr({ attribute: "generate-header" }) + ], DataGrid.prototype, "generateHeader", void 0); + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGrid.prototype, "gridTemplateColumns", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowsData", void 0); + __decorate([ + observable + ], DataGrid.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusRowIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusColumnIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "defaultRowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElementTag", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js + var defaultCellContentsTemplate, defaultHeaderCellContentsTemplate, DataGridCell; + var init_data_grid_cell = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + defaultCellContentsTemplate = html` + +`; + defaultHeaderCellContentsTemplate = html` + +`; + DataGridCell = class extends FoundationElement { + constructor() { + super(...arguments); + this.cellType = DataGridCellTypes.default; + this.rowData = null; + this.columnDefinition = null; + this.isActiveCell = false; + this.customCellView = null; + this.updateCellStyle = () => { + this.style.gridColumn = this.gridColumn; + }; + } + cellTypeChanged() { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + gridColumnChanged() { + if (this.$fastController.isConnected) { + this.updateCellStyle(); + } + } + columnDefinitionChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.addEventListener(eventFocusIn, this.handleFocusin); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === void 0 ? 0 : this.columnDefinition.gridColumn}`; + this.updateCellView(); + this.updateCellStyle(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener(eventFocusIn, this.handleFocusin); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.disconnectCellView(); + } + handleFocusin(e) { + if (this.isActiveCell) { + return; + } + this.isActiveCell = true; + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + default: + if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + } + this.$emit("cell-focused", this); + } + handleFocusout(e) { + if (this !== document.activeElement && !this.contains(document.activeElement)) { + this.isActiveCell = false; + } + } + handleKeydown(e) { + if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) { + return; + } + switch (e.key) { + case keyEnter: + case keyFunction2: + if (this.contains(document.activeElement) && document.activeElement !== this) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + default: + if (this.columnDefinition.cellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + } + break; + case keyEscape: + if (this.contains(document.activeElement) && document.activeElement !== this) { + this.focus(); + e.preventDefault(); + } + break; + } + } + updateCellView() { + this.disconnectCellView(); + if (this.columnDefinition === null) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellTemplate !== void 0) { + this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this); + } else { + this.customCellView = defaultHeaderCellContentsTemplate.render(this, this); + } + break; + case void 0: + case DataGridCellTypes.rowHeader: + case DataGridCellTypes.default: + if (this.columnDefinition.cellTemplate !== void 0) { + this.customCellView = this.columnDefinition.cellTemplate.render(this, this); + } else { + this.customCellView = defaultCellContentsTemplate.render(this, this); + } + break; + } + } + disconnectCellView() { + if (this.customCellView !== null) { + this.customCellView.dispose(); + this.customCellView = null; + } + } + }; + __decorate([ + attr({ attribute: "cell-type" }) + ], DataGridCell.prototype, "cellType", void 0); + __decorate([ + attr({ attribute: "grid-column" }) + ], DataGridCell.prototype, "gridColumn", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "columnDefinition", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js + function createCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}" + grid-column="${(x, c) => c.index + 1}" + :rowData="${(x, c) => c.parent.rowData}" + :columnDefinition="${(x) => x}" + > +`; + } + function createHeaderCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="columnheader" + grid-column="${(x, c) => c.index + 1}" + :columnDefinition="${(x) => x}" + > +`; + } + var dataGridRowTemplate; + var init_data_grid_row_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js"() { + init_esm(); + init_data_grid_cell(); + dataGridRowTemplate = (context, definition) => { + const cellItemTemplate = createCellItemTemplate(context); + const headerCellItemTemplate = createHeaderCellItemTemplate(context); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js + var dataGridCellTemplate; + var init_data_grid_cell_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js"() { + init_esm(); + dataGridCellTemplate = (context, definition) => { + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js + var init_data_grid2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js"() { + init_data_grid_template(); + init_data_grid(); + init_data_grid_row_template(); + init_data_grid_row(); + init_data_grid_cell_template(); + init_data_grid_cell(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js + var CalendarTitleTemplate; + var init_calendar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js"() { + init_esm(); + CalendarTitleTemplate = html` +
+ + ${(x) => x.dateFormatter.getMonth(x.month)} + + ${(x) => x.dateFormatter.getYear(x.year)} +
+`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js + var init_calendar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js"() { + init_calendar(); + init_calendar_template(); + init_date_formatter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js + var init_card_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.js + var init_card = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/index.js + var init_card2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/index.js"() { + init_card_template(); + init_card(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js + var checkboxTemplate; + var init_checkbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js"() { + init_esm(); + checkboxTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js + var _Checkbox, FormAssociatedCheckbox; + var init_checkbox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Checkbox = class extends FoundationElement { + }; + FormAssociatedCheckbox = class extends CheckableFormAssociated(_Checkbox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js + var Checkbox; + var init_checkbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_checkbox_form_associated(); + Checkbox = class extends FormAssociatedCheckbox { + constructor() { + super(); + this.initialValue = "on"; + this.indeterminate = false; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keySpace: + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Checkbox.prototype, "readOnly", void 0); + __decorate([ + observable + ], Checkbox.prototype, "defaultSlottedNodes", void 0); + __decorate([ + observable + ], Checkbox.prototype, "indeterminate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js + var init_checkbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js"() { + init_checkbox_template(); + init_checkbox(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js + function isListboxOption(el) { + return isHTMLElement(el) && (el.getAttribute("role") === "option" || el instanceof HTMLOptionElement); + } + var ListboxOption, DelegatesARIAListboxOption; + var init_listbox_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + ListboxOption = class extends FoundationElement { + constructor(text, value, defaultSelected, selected) { + super(); + this.defaultSelected = false; + this.dirtySelected = false; + this.selected = this.defaultSelected; + this.dirtyValue = false; + if (text) { + this.textContent = text; + } + if (value) { + this.initialValue = value; + } + if (defaultSelected) { + this.defaultSelected = defaultSelected; + } + if (selected) { + this.selected = selected; + } + this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected); + this.proxy.disabled = this.disabled; + } + /** + * Updates the ariaChecked property when the checked property changes. + * + * @param prev - the previous checked value + * @param next - the current checked value + * + * @public + */ + checkedChanged(prev, next) { + if (typeof next === "boolean") { + this.ariaChecked = next ? "true" : "false"; + return; + } + this.ariaChecked = null; + } + /** + * Updates the proxy's text content when the default slot changes. + * @param prev - the previous content value + * @param next - the current content value + * + * @internal + */ + contentChanged(prev, next) { + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.textContent = this.textContent; + } + this.$emit("contentchange", null, { bubbles: true }); + } + defaultSelectedChanged() { + if (!this.dirtySelected) { + this.selected = this.defaultSelected; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.defaultSelected; + } + } + } + disabledChanged(prev, next) { + this.ariaDisabled = this.disabled ? "true" : "false"; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.disabled = this.disabled; + } + } + selectedAttributeChanged() { + this.defaultSelected = this.selectedAttribute; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.defaultSelected = this.defaultSelected; + } + } + selectedChanged() { + this.ariaSelected = this.selected ? "true" : "false"; + if (!this.dirtySelected) { + this.dirtySelected = true; + } + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.selected; + } + } + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + get label() { + var _a; + return (_a = this.value) !== null && _a !== void 0 ? _a : this.text; + } + get text() { + var _a, _b; + return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : ""; + } + set value(next) { + const newValue = `${next !== null && next !== void 0 ? next : ""}`; + this._value = newValue; + this.dirtyValue = true; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.value = newValue; + } + Observable.notify(this, "value"); + } + get value() { + var _a; + Observable.track(this, "value"); + return (_a = this._value) !== null && _a !== void 0 ? _a : this.text; + } + get form() { + return this.proxy ? this.proxy.form : null; + } + }; + __decorate([ + observable + ], ListboxOption.prototype, "checked", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "content", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "defaultSelected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxOption.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "selected", mode: "boolean" }) + ], ListboxOption.prototype, "selectedAttribute", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "selected", void 0); + __decorate([ + attr({ attribute: "value", mode: "fromView" }) + ], ListboxOption.prototype, "initialValue", void 0); + DelegatesARIAListboxOption = class { + }; + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0); + applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties); + applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js + var Listbox, DelegatesARIAListbox; + var init_listbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_listbox_option(); + init_aria_global(); + init_apply_mixins(); + Listbox = class _Listbox extends FoundationElement { + constructor() { + super(...arguments); + this._options = []; + this.selectedIndex = -1; + this.selectedOptions = []; + this.shouldSkipFocus = false; + this.typeaheadBuffer = ""; + this.typeaheadExpired = true; + this.typeaheadTimeout = -1; + } + /** + * The first selected option. + * + * @internal + */ + get firstSelectedOption() { + var _a; + return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null; + } + /** + * Returns true if there is one or more selectable option. + * + * @internal + */ + get hasSelectableOptions() { + return this.options.length > 0 && !this.options.every((o) => o.disabled); + } + /** + * The number of options. + * + * @public + */ + get length() { + var _a, _b; + return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + } + /** + * The list of options. + * + * @public + */ + get options() { + Observable.track(this, "options"); + return this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Flag for the typeahead timeout expiration. + * + * @deprecated use `Listbox.typeaheadExpired` + * @internal + */ + get typeAheadExpired() { + return this.typeaheadExpired; + } + set typeAheadExpired(value) { + this.typeaheadExpired = value; + } + /** + * Handle click events for listbox options. + * + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && !captured.disabled) { + this.selectedIndex = this.options.indexOf(captured); + return true; + } + } + /** + * Ensures that the provided option is focused and scrolled into view. + * + * @param optionToFocus - The option to focus + * @internal + */ + focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) { + if (this.contains(document.activeElement) && optionToFocus !== null) { + optionToFocus.focus(); + requestAnimationFrame(() => { + optionToFocus.scrollIntoView({ block: "nearest" }); + }); + } + } + /** + * Handles `focusin` actions for the component. When the component receives focus, + * the list of selected options is refreshed and the first selected option is scrolled + * into view. + * + * @internal + */ + focusinHandler(e) { + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Returns the options which match the current typeahead buffer. + * + * @internal + */ + getTypeaheadMatches() { + const pattern = this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp(`^${pattern}`, "gi"); + return this.options.filter((o) => o.text.trim().match(re)); + } + /** + * Determines the index of the next option which is selectable, if any. + * + * @param prev - the previous selected index + * @param next - the next index to select + * + * @internal + */ + getSelectableIndex(prev = this.selectedIndex, next) { + const direction = prev > next ? -1 : prev < next ? 1 : 0; + const potentialDirection = prev + direction; + let nextSelectableOption = null; + switch (direction) { + case -1: { + nextSelectableOption = this.options.reduceRight((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + case 1: { + nextSelectableOption = this.options.reduce((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + } + return this.options.indexOf(nextSelectableOption); + } + /** + * Handles external changes to child options. + * + * @param source - the source object + * @param propertyName - the property + * + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "selected": { + if (_Listbox.slottedOptionFilter(source)) { + this.selectedIndex = this.options.indexOf(source); + } + this.setSelectedOptions(); + break; + } + } + } + /** + * Moves focus to an option whose label matches characters typed by the user. + * Consecutive keystrokes are batched into a buffer of search text used + * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes + * between consecutive keystrokes, the search restarts. + * + * @param key - the key to be evaluated + * + * @internal + */ + handleTypeAhead(key) { + if (this.typeaheadTimeout) { + window.clearTimeout(this.typeaheadTimeout); + } + this.typeaheadTimeout = window.setTimeout(() => this.typeaheadExpired = true, _Listbox.TYPE_AHEAD_TIMEOUT_MS); + if (key.length > 1) { + return; + } + this.typeaheadBuffer = `${this.typeaheadExpired ? "" : this.typeaheadBuffer}${key}`; + } + /** + * Handles `keydown` actions for listbox navigation and typeahead. + * + * @internal + */ + keydownHandler(e) { + if (this.disabled) { + return true; + } + this.shouldSkipFocus = false; + const key = e.key; + switch (key) { + // Select the first available option + case keyHome: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectFirstOption(); + } + break; + } + // Select the next selectable option + case keyArrowDown: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectNextOption(); + } + break; + } + // Select the previous selectable option + case keyArrowUp: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectPreviousOption(); + } + break; + } + // Select the last available option + case keyEnd: { + e.preventDefault(); + this.selectLastOption(); + break; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEnter: + case keyEscape: { + return true; + } + case keySpace: { + if (this.typeaheadExpired) { + return true; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @internal + */ + mousedownHandler(e) { + this.shouldSkipFocus = !this.contains(document.activeElement); + return true; + } + /** + * Switches between single-selection and multi-selection mode. + * + * @param prev - the previous value of the `multiple` attribute + * @param next - the next value of the `multiple` attribute + * + * @internal + */ + multipleChanged(prev, next) { + this.ariaMultiSelectable = next ? "true" : null; + } + /** + * Updates the list of selected options when the `selectedIndex` changes. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + var _a; + if (!this.hasSelectableOptions) { + this.selectedIndex = -1; + return; + } + if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") { + const selectableIndex = this.getSelectableIndex(prev, next); + const newNext = selectableIndex > -1 ? selectableIndex : prev; + this.selectedIndex = newNext; + if (next === newNext) { + this.selectedIndexChanged(next, newNext); + } + return; + } + this.setSelectedOptions(); + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + const filteredNext = next.filter(_Listbox.slottedOptionFilter); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "selected"); + o.selected = filteredNext.includes(o); + notifier.subscribe(this, "selected"); + }); + } + /** + * Moves focus to the first selectable option. + * + * @public + */ + selectFirstOption() { + var _a, _b; + if (!this.disabled) { + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((o) => !o.disabled)) !== null && _b !== void 0 ? _b : -1; + } + } + /** + * Moves focus to the last selectable option. + * + * @internal + */ + selectLastOption() { + if (!this.disabled) { + this.selectedIndex = findLastIndex(this.options, (o) => !o.disabled); + } + } + /** + * Moves focus to the next selectable option. + * + * @internal + */ + selectNextOption() { + if (!this.disabled && this.selectedIndex < this.options.length - 1) { + this.selectedIndex += 1; + } + } + /** + * Moves focus to the previous selectable option. + * + * @internal + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex > 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Updates the selected index to match the first selected option. + * + * @internal + */ + setDefaultSelectedOption() { + var _a, _b; + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((el) => el.defaultSelected)) !== null && _b !== void 0 ? _b : -1; + } + /** + * Sets an option as selected and gives it focus. + * + * @public + */ + setSelectedOptions() { + var _a, _b, _c; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) { + this.selectedOptions = [this.options[this.selectedIndex]]; + this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""; + this.focusAndScrollOptionIntoView(); + } + } + /** + * Updates the list of options and resets the selected option when the slotted option content changes. + * + * @param prev - the previous list of slotted options + * @param next - the current list of slotted options + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options = next.reduce((options, item) => { + if (isListboxOption(item)) { + options.push(item); + } + return options; + }, []); + const setSize = `${this.options.length}`; + this.options.forEach((option, index) => { + if (!option.id) { + option.id = uniqueId("option-"); + } + option.ariaPosInSet = `${index + 1}`; + option.ariaSetSize = setSize; + }); + if (this.$fastController.isConnected) { + this.setSelectedOptions(); + this.setDefaultSelectedOption(); + } + } + /** + * Updates the filtered list of options when the typeahead buffer changes. + * + * @param prev - the previous typeahead buffer value + * @param next - the current typeahead buffer value + * + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + if (typeaheadMatches.length) { + const selectedIndex = this.options.indexOf(typeaheadMatches[0]); + if (selectedIndex > -1) { + this.selectedIndex = selectedIndex; + } + } + this.typeaheadExpired = false; + } + } + }; + Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; + Listbox.TYPE_AHEAD_TIMEOUT_MS = 1e3; + __decorate([ + attr({ mode: "boolean" }) + ], Listbox.prototype, "disabled", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedIndex", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "slottedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "typeaheadBuffer", void 0); + DelegatesARIAListbox = class { + }; + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaDisabled", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaExpanded", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0); + applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties); + applyMixins(Listbox, DelegatesARIAListbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js + var SelectPosition; + var init_select_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js"() { + SelectPosition = { + above: "above", + below: "below" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js + var _Combobox, FormAssociatedCombobox; + var init_combobox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js"() { + init_form_associated(); + init_listbox(); + _Combobox = class extends Listbox { + }; + FormAssociatedCombobox = class extends FormAssociated(_Combobox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js + var ComboboxAutocomplete; + var init_combobox_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js"() { + ComboboxAutocomplete = { + inline: "inline", + list: "list", + both: "both", + none: "none" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js + var Combobox, DelegatesARIACombobox; + var init_combobox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_select_options(); + init_apply_mixins(); + init_combobox_form_associated(); + init_combobox_options(); + Combobox = class extends FormAssociatedCombobox { + constructor() { + super(...arguments); + this._value = ""; + this.filteredOptions = []; + this.filter = ""; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + this.open = false; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + super.formResetCallback(); + this.setDefaultSelectedOption(); + this.updateValue(); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + get isAutocompleteInline() { + return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth; + } + get isAutocompleteList() { + return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth; + } + get isAutocompleteBoth() { + return this.autocomplete === ComboboxAutocomplete.both; + } + /** + * Sets focus and synchronize ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged() { + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The list of options. + * + * @public + * @remarks + * Overrides `Listbox.options`. + */ + get options() { + Observable.track(this, "options"); + return this.filteredOptions.length ? this.filteredOptions : this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Updates the placeholder on the proxy element. + * @internal + */ + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c; + const prev = `${this._value}`; + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el) => el.text.toLowerCase() === next.toLowerCase()); + const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text; + const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text; + this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex; + next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + } + } + /** + * Handle opening and closing the listbox when the combobox is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (this.disabled || (captured === null || captured === void 0 ? void 0 : captured.disabled)) { + return; + } + if (this.open) { + if (e.composedPath()[0] === this.control) { + return; + } + if (captured) { + this.selectedOptions = [captured]; + this.control.value = captured.text; + this.clearSelectionRange(); + this.updateValue(true); + } + } + this.open = !this.open; + if (this.open) { + this.control.focus(); + } + return true; + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + if (this.value) { + this.initialValue = this.value; + } + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Filter available options by text value. + * + * @public + */ + filterOptions() { + if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) { + this.filter = ""; + } + const filter = this.filter.toLowerCase(); + this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase())); + if (this.isAutocompleteList) { + if (!this.filteredOptions.length && !filter) { + this.filteredOptions = this._options; + } + this._options.forEach((o) => { + o.hidden = !this.filteredOptions.includes(o); + }); + } + } + /** + * Focus the control and scroll the first selected option into view. + * + * @internal + * @remarks + * Overrides: `Listbox.focusAndScrollOptionIntoView` + */ + focusAndScrollOptionIntoView() { + if (this.contains(document.activeElement)) { + this.control.focus(); + if (this.firstSelectedOption) { + requestAnimationFrame(() => { + var _a; + (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest" }); + }); + } + } + } + /** + * Handle focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + this.syncValue(); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!this.options || !this.options.includes(focusTarget)) { + this.open = false; + } + } + /** + * Handle content changes on the control input. + * + * @param e - the input event + * @internal + */ + inputHandler(e) { + this.filter = this.control.value; + this.filterOptions(); + if (!this.isAutocompleteInline) { + this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value); + } + if (e.inputType.includes("deleteContent") || !this.filter.length) { + return true; + } + if (this.isAutocompleteList && !this.open) { + this.open = true; + } + if (this.isAutocompleteInline) { + if (this.filteredOptions.length) { + this.selectedOptions = [this.filteredOptions[0]]; + this.selectedIndex = this.options.indexOf(this.firstSelectedOption); + this.setInlineSelection(); + } else { + this.selectedIndex = -1; + } + } + return; + } + /** + * Handle keydown actions for listbox navigation. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (e.ctrlKey || e.shiftKey) { + return true; + } + switch (key) { + case "Enter": { + this.syncValue(); + if (this.isAutocompleteInline) { + this.filter = this.value; + } + this.open = false; + this.clearSelectionRange(); + break; + } + case "Escape": { + if (!this.isAutocompleteInline) { + this.selectedIndex = -1; + } + if (this.open) { + this.open = false; + break; + } + this.value = ""; + this.control.value = ""; + this.filter = ""; + this.filterOptions(); + break; + } + case "Tab": { + this.setInputToSelection(); + if (!this.open) { + return true; + } + e.preventDefault(); + this.open = false; + break; + } + case "ArrowUp": + case "ArrowDown": { + this.filterOptions(); + if (!this.open) { + this.open = true; + break; + } + if (this.filteredOptions.length > 0) { + super.keydownHandler(e); + } + if (this.isAutocompleteInline) { + this.setInlineSelection(); + } + break; + } + default: { + return true; + } + } + } + /** + * Handle keyup actions for value input and text field manipulations. + * + * @param e - the keyboard event + * @internal + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + case "ArrowRight": + case "Backspace": + case "Delete": + case "Home": + case "End": { + this.filter = this.control.value; + this.selectedIndex = -1; + this.filterOptions(); + break; + } + } + } + /** + * Ensure that the selectedIndex is within the current allowable filtered range. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + if (this.$fastController.isConnected) { + next = limit(-1, this.options.length - 1, next); + if (next !== this.selectedIndex) { + this.selectedIndex = next; + return; + } + super.selectedIndexChanged(prev, next); + } + } + /** + * Move focus to the previous selectable option. + * + * @internal + * @remarks + * Overrides `Listbox.selectPreviousOption` + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex >= 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Set the default selected options at initialization or reset. + * + * @internal + * @remarks + * Overrides `Listbox.setDefaultSelectedOption` + */ + setDefaultSelectedOption() { + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el) => el.getAttribute("selected") !== null || el.selected); + this.selectedIndex = selectedIndex; + if (!this.dirtyValue && this.firstSelectedOption) { + this.value = this.firstSelectedOption.text; + } + this.setSelectedOptions(); + } + } + /** + * Focus and set the content of the control based on the first selected option. + * + * @internal + */ + setInputToSelection() { + if (this.firstSelectedOption) { + this.control.value = this.firstSelectedOption.text; + this.control.focus(); + } + } + /** + * Focus, set and select the content of the control based on the first selected option. + * + * @internal + */ + setInlineSelection() { + if (this.firstSelectedOption) { + this.setInputToSelection(); + this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward"); + } + } + /** + * Determines if a value update should involve emitting a change event, then updates the value. + * + * @internal + */ + syncValue() { + var _a; + const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value; + this.updateValue(this.value !== newValue); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @param force - direction to force the listbox to display + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * Ensure that the entire list of options is used when setting the selected property. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + * @remarks + * Overrides: `Listbox.selectedOptionsChanged` + */ + selectedOptionsChanged(prev, next) { + if (this.$fastController.isConnected) { + this._options.forEach((o) => { + o.selected = next.includes(o); + }); + } + } + /** + * Synchronize the form-associated proxy and update the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + super.slottedOptionsChanged(prev, next); + this.updateValue(); + } + /** + * Sets the value and to match the first selected option. + * + * @param shouldEmit - if true, the change event will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a; + if (this.$fastController.isConnected) { + this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value; + this.control.value = this.value; + } + if (shouldEmit) { + this.$emit("change"); + } + } + /** + * @internal + */ + clearSelectionRange() { + const controlValueLength = this.control.value.length; + this.control.setSelectionRange(controlValueLength, controlValueLength); + } + }; + __decorate([ + attr({ attribute: "autocomplete", mode: "fromView" }) + ], Combobox.prototype, "autocomplete", void 0); + __decorate([ + observable + ], Combobox.prototype, "maxHeight", void 0); + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Combobox.prototype, "open", void 0); + __decorate([ + attr + ], Combobox.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Combobox.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Combobox.prototype, "position", void 0); + DelegatesARIACombobox = class { + }; + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0); + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIACombobox, DelegatesARIAListbox); + applyMixins(Combobox, StartEnd, DelegatesARIACombobox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js + var init_combobox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js + var init_combobox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js"() { + init_combobox(); + init_combobox_options(); + init_combobox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js + function composedParent(element) { + const parentNode = element.parentElement; + if (parentNode) { + return parentNode; + } else { + const rootNode = element.getRootNode(); + if (rootNode.host instanceof HTMLElement) { + return rootNode.host; + } + } + return null; + } + var init_composed_parent = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js + function composedContains(reference, test) { + let current = test; + while (current !== null) { + if (current === reference) { + return true; + } + current = composedParent(current); + } + return false; + } + var init_composed_contains = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js"() { + init_composed_parent(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js + function isFastElement(element) { + return element instanceof FASTElement; + } + var defaultElement, QueuedStyleSheetTarget, ConstructableStyleSheetTarget, DocumentStyleSheetTarget, HeadStyleElementStyleSheetTarget, StyleElementStyleSheetTarget, ElementStyleSheetTarget, RootStyleSheetTarget, propertyTargetCache, propertyTargetCtor, PropertyTargetManager; + var init_custom_property_manager = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js"() { + init_tslib_es6(); + init_esm(); + defaultElement = document.createElement("div"); + QueuedStyleSheetTarget = class { + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + ConstructableStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor(source) { + super(); + const sheet = new CSSStyleSheet(); + sheet[prependToAdoptedStyleSheetsSymbol] = true; + this.target = sheet.cssRules[sheet.insertRule(":host{}")].style; + source.$fastController.addStyles(ElementStyles.create([sheet])); + } + }; + DocumentStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + const sheet = new CSSStyleSheet(); + this.target = sheet.cssRules[sheet.insertRule(":root{}")].style; + document.adoptedStyleSheets = [ + ...document.adoptedStyleSheets, + sheet + ]; + } + }; + HeadStyleElementStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + this.style = document.createElement("style"); + document.head.appendChild(this.style); + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":root{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } + } + }; + StyleElementStyleSheetTarget = class { + constructor(target) { + this.store = /* @__PURE__ */ new Map(); + this.target = null; + const controller = target.$fastController; + this.style = document.createElement("style"); + controller.addStyles(this.style); + Observable.getNotifier(controller).subscribe(this, "isConnected"); + this.handleChange(controller, "isConnected"); + } + targetChanged() { + if (this.target !== null) { + for (const [key, value] of this.store.entries()) { + this.target.setProperty(key, value); + } + } + } + setProperty(name, value) { + this.store.set(name, value); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.setProperty(name, value); + } + }); + } + removeProperty(name) { + this.store.delete(name); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.removeProperty(name); + } + }); + } + handleChange(source, key) { + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":host{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } else { + this.target = null; + } + } + }; + __decorate([ + observable + ], StyleElementStyleSheetTarget.prototype, "target", void 0); + ElementStyleSheetTarget = class { + constructor(source) { + this.target = source.style; + } + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + RootStyleSheetTarget = class _RootStyleSheetTarget { + setProperty(name, value) { + _RootStyleSheetTarget.properties[name] = value; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); + } + } + removeProperty(name) { + delete _RootStyleSheetTarget.properties[name]; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); + } + } + static registerRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (!roots.has(root)) { + roots.add(root); + const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.setProperty(key, _RootStyleSheetTarget.properties[key]); + } + } + } + static unregisterRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (roots.has(root)) { + roots.delete(root); + const target = PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.removeProperty(key); + } + } + } + /** + * Returns the document when provided the default element, + * otherwise is a no-op + * @param root - the root to normalize + */ + static normalizeRoot(root) { + return root === defaultElement ? document : root; + } + }; + RootStyleSheetTarget.roots = /* @__PURE__ */ new Set(); + RootStyleSheetTarget.properties = {}; + propertyTargetCache = /* @__PURE__ */ new WeakMap(); + propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; + PropertyTargetManager = Object.freeze({ + getOrCreate(source) { + if (propertyTargetCache.has(source)) { + return propertyTargetCache.get(source); + } + let target; + if (source === defaultElement) { + target = new RootStyleSheetTarget(); + } else if (source instanceof Document) { + target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); + } else if (isFastElement(source)) { + target = new propertyTargetCtor(source); + } else { + target = new ElementStyleSheetTarget(source); + } + propertyTargetCache.set(source, target); + return target; + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js + function create(nameOrConfig) { + return DesignTokenImpl.from(nameOrConfig); + } + var DesignTokenImpl, CustomPropertyReflector, DesignTokenBindingObserver, Store, nodeCache, childToParent, DesignTokenNode, DesignToken; + var init_design_token = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js"() { + init_tslib_es6(); + init_esm(); + init_composed_parent(); + init_composed_contains(); + init_custom_property_manager(); + init_custom_property_manager(); + DesignTokenImpl = class _DesignTokenImpl extends CSSDirective { + constructor(configuration) { + super(); + this.subscribers = /* @__PURE__ */ new WeakMap(); + this._appliedTo = /* @__PURE__ */ new Set(); + this.name = configuration.name; + if (configuration.cssCustomPropertyName !== null) { + this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`; + this.cssVar = `var(${this.cssCustomProperty})`; + } + this.id = _DesignTokenImpl.uniqueId(); + _DesignTokenImpl.tokensById.set(this.id, this); + } + get appliedTo() { + return [...this._appliedTo]; + } + static from(nameOrConfig) { + return new _DesignTokenImpl({ + name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, + cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName + }); + } + static isCSSDesignToken(token) { + return typeof token.cssCustomProperty === "string"; + } + static isDerivedDesignTokenValue(value) { + return typeof value === "function"; + } + /** + * Gets a token by ID. Returns undefined if the token was not found. + * @param id - The ID of the token + * @returns + */ + static getTokenById(id) { + return _DesignTokenImpl.tokensById.get(id); + } + getOrCreateSubscriberSet(target = this) { + return this.subscribers.get(target) || this.subscribers.set(target, /* @__PURE__ */ new Set()) && this.subscribers.get(target); + } + createCSS() { + return this.cssVar || ""; + } + getValueFor(element) { + const value = DesignTokenNode.getOrCreate(element).get(this); + if (value !== void 0) { + return value; + } + throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${element} or an ancestor of ${element}.`); + } + setValueFor(element, value) { + this._appliedTo.add(element); + if (value instanceof _DesignTokenImpl) { + value = this.alias(value); + } + DesignTokenNode.getOrCreate(element).set(this, value); + return this; + } + deleteValueFor(element) { + this._appliedTo.delete(element); + if (DesignTokenNode.existsFor(element)) { + DesignTokenNode.getOrCreate(element).delete(this); + } + return this; + } + withDefault(value) { + this.setValueFor(defaultElement, value); + return this; + } + subscribe(subscriber, target) { + const subscriberSet = this.getOrCreateSubscriberSet(target); + if (target && !DesignTokenNode.existsFor(target)) { + DesignTokenNode.getOrCreate(target); + } + if (!subscriberSet.has(subscriber)) { + subscriberSet.add(subscriber); + } + } + unsubscribe(subscriber, target) { + const list = this.subscribers.get(target || this); + if (list && list.has(subscriber)) { + list.delete(subscriber); + } + } + /** + * Notifies subscribers that the value for an element has changed. + * @param element - The element to emit a notification for + */ + notify(element) { + const record = Object.freeze({ token: this, target: element }); + if (this.subscribers.has(this)) { + this.subscribers.get(this).forEach((sub) => sub.handleChange(record)); + } + if (this.subscribers.has(element)) { + this.subscribers.get(element).forEach((sub) => sub.handleChange(record)); + } + } + /** + * Alias the token to the provided token. + * @param token - the token to alias to + */ + alias(token) { + return ((target) => token.getValueFor(target)); + } + }; + DesignTokenImpl.uniqueId = /* @__PURE__ */ (() => { + let id = 0; + return () => { + id++; + return id.toString(16); + }; + })(); + DesignTokenImpl.tokensById = /* @__PURE__ */ new Map(); + CustomPropertyReflector = class { + startReflection(token, target) { + token.subscribe(this, target); + this.handleChange({ token, target }); + } + stopReflection(token, target) { + token.unsubscribe(this, target); + this.remove(token, target); + } + handleChange(record) { + const { token, target } = record; + this.add(token, target); + } + add(token, target) { + PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); + } + remove(token, target) { + PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); + } + resolveCSSValue(value) { + return value && typeof value.createCSS === "function" ? value.createCSS() : value; + } + }; + DesignTokenBindingObserver = class { + constructor(source, token, node) { + this.source = source; + this.token = token; + this.node = node; + this.dependencies = /* @__PURE__ */ new Set(); + this.observer = Observable.binding(source, this, false); + this.observer.handleChange = this.observer.call; + this.handleChange(); + } + disconnect() { + this.observer.disconnect(); + } + /** + * @internal + */ + handleChange() { + try { + this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); + } catch (e) { + console.error(e); + } + } + }; + Store = class { + constructor() { + this.values = /* @__PURE__ */ new Map(); + } + set(token, value) { + if (this.values.get(token) !== value) { + this.values.set(token, value); + Observable.getNotifier(this).notify(token.id); + } + } + get(token) { + Observable.track(this, token.id); + return this.values.get(token); + } + delete(token) { + this.values.delete(token); + Observable.getNotifier(this).notify(token.id); + } + all() { + return this.values.entries(); + } + }; + nodeCache = /* @__PURE__ */ new WeakMap(); + childToParent = /* @__PURE__ */ new WeakMap(); + DesignTokenNode = class _DesignTokenNode { + constructor(target) { + this.target = target; + this.store = new Store(); + this.children = []; + this.assignedValues = /* @__PURE__ */ new Map(); + this.reflecting = /* @__PURE__ */ new Set(); + this.bindingObservers = /* @__PURE__ */ new Map(); + this.tokenValueChangeHandler = { + handleChange: (source, arg) => { + const token = DesignTokenImpl.getTokenById(arg); + if (token) { + token.notify(this.target); + this.updateCSSTokenReflection(source, token); + } + } + }; + nodeCache.set(target, this); + Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); + if (target instanceof FASTElement) { + target.$fastController.addBehaviors([this]); + } else if (target.isConnected) { + this.bind(); + } + } + /** + * Returns a DesignTokenNode for an element. + * Creates a new instance if one does not already exist for a node, + * otherwise returns the cached instance + * + * @param target - The HTML element to retrieve a DesignTokenNode for + */ + static getOrCreate(target) { + return nodeCache.get(target) || new _DesignTokenNode(target); + } + /** + * Determines if a DesignTokenNode has been created for a target + * @param target - The element to test + */ + static existsFor(target) { + return nodeCache.has(target); + } + /** + * Searches for and return the nearest parent DesignTokenNode. + * Null is returned if no node is found or the node provided is for a default element. + */ + static findParent(node) { + if (!(defaultElement === node.target)) { + let parent = composedParent(node.target); + while (parent !== null) { + if (nodeCache.has(parent)) { + return nodeCache.get(parent); + } + parent = composedParent(parent); + } + return _DesignTokenNode.getOrCreate(defaultElement); + } + return null; + } + /** + * Finds the closest node with a value explicitly assigned for a token, otherwise null. + * @param token - The token to look for + * @param start - The node to start looking for value assignment + * @returns + */ + static findClosestAssignedNode(token, start) { + let current = start; + do { + if (current.has(token)) { + return current; + } + current = current.parent ? current.parent : current.target !== defaultElement ? _DesignTokenNode.getOrCreate(defaultElement) : null; + } while (current !== null); + return null; + } + /** + * The parent DesignTokenNode, or null. + */ + get parent() { + return childToParent.get(this) || null; + } + updateCSSTokenReflection(source, token) { + if (DesignTokenImpl.isCSSDesignToken(token)) { + const parent = this.parent; + const reflecting = this.isReflecting(token); + if (parent) { + const parentValue = parent.get(token); + const sourceValue = source.get(token); + if (parentValue !== sourceValue && !reflecting) { + this.reflectToCSS(token); + } else if (parentValue === sourceValue && reflecting) { + this.stopReflectToCSS(token); + } + } else if (!reflecting) { + this.reflectToCSS(token); + } + } + } + /** + * Checks if a token has been assigned an explicit value the node. + * @param token - the token to check. + */ + has(token) { + return this.assignedValues.has(token); + } + /** + * Gets the value of a token for a node + * @param token - The token to retrieve the value for + * @returns + */ + get(token) { + const value = this.store.get(token); + if (value !== void 0) { + return value; + } + const raw = this.getRaw(token); + if (raw !== void 0) { + this.hydrate(token, raw); + return this.get(token); + } + } + /** + * Retrieves the raw assigned value of a token from the nearest assigned node. + * @param token - The token to retrieve a raw value for + * @returns + */ + getRaw(token) { + var _a; + if (this.assignedValues.has(token)) { + return this.assignedValues.get(token); + } + return (_a = _DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); + } + /** + * Sets a token to a value for a node + * @param token - The token to set + * @param value - The value to set the token to + */ + set(token, value) { + if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { + this.tearDownBindingObserver(token); + } + this.assignedValues.set(token, value); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + this.setupBindingObserver(token, value); + } else { + this.store.set(token, value); + } + } + /** + * Deletes a token value for the node. + * @param token - The token to delete the value for + */ + delete(token) { + this.assignedValues.delete(token); + this.tearDownBindingObserver(token); + const upstream = this.getRaw(token); + if (upstream) { + this.hydrate(token, upstream); + } else { + this.store.delete(token); + } + } + /** + * Invoked when the DesignTokenNode.target is attached to the document + */ + bind() { + const parent = _DesignTokenNode.findParent(this); + if (parent) { + parent.appendChild(this); + } + for (const key of this.assignedValues.keys()) { + key.notify(this.target); + } + } + /** + * Invoked when the DesignTokenNode.target is detached from the document + */ + unbind() { + if (this.parent) { + const parent = childToParent.get(this); + parent.removeChild(this); + } + for (const token of this.bindingObservers.keys()) { + this.tearDownBindingObserver(token); + } + } + /** + * Appends a child to a parent DesignTokenNode. + * @param child - The child to append to the node + */ + appendChild(child) { + if (child.parent) { + childToParent.get(child).removeChild(child); + } + const reParent = this.children.filter((x) => child.contains(x)); + childToParent.set(child, this); + this.children.push(child); + reParent.forEach((x) => child.appendChild(x)); + Observable.getNotifier(this.store).subscribe(child); + for (const [token, value] of this.store.all()) { + child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); + child.updateCSSTokenReflection(child.store, token); + } + } + /** + * Removes a child from a node. + * @param child - The child to remove. + */ + removeChild(child) { + const childIndex = this.children.indexOf(child); + if (childIndex !== -1) { + this.children.splice(childIndex, 1); + } + Observable.getNotifier(this.store).unsubscribe(child); + if (child.parent !== this) { + return false; + } + const deleted = childToParent.delete(child); + for (const [token] of this.store.all()) { + child.hydrate(token, child.getRaw(token)); + child.updateCSSTokenReflection(child.store, token); + } + return deleted; + } + /** + * Tests whether a provided node is contained by + * the calling node. + * @param test - The node to test + */ + contains(test) { + return composedContains(this.target, test.target); + } + /** + * Instructs the node to reflect a design token for the provided token. + * @param token - The design token to reflect + */ + reflectToCSS(token) { + if (!this.isReflecting(token)) { + this.reflecting.add(token); + _DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); + } + } + /** + * Stops reflecting a DesignToken to CSS + * @param token - The design token to stop reflecting + */ + stopReflectToCSS(token) { + if (this.isReflecting(token)) { + this.reflecting.delete(token); + _DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); + } + } + /** + * Determines if a token is being reflected to CSS for a node. + * @param token - The token to check for reflection + * @returns + */ + isReflecting(token) { + return this.reflecting.has(token); + } + /** + * Handle changes to upstream tokens + * @param source - The parent DesignTokenNode + * @param property - The token ID that changed + */ + handleChange(source, property) { + const token = DesignTokenImpl.getTokenById(property); + if (!token) { + return; + } + this.hydrate(token, this.getRaw(token)); + this.updateCSSTokenReflection(this.store, token); + } + /** + * Hydrates a token with a DesignTokenValue, making retrieval available. + * @param token - The token to hydrate + * @param value - The value to hydrate + */ + hydrate(token, value) { + if (!this.has(token)) { + const observer = this.bindingObservers.get(token); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + if (observer) { + if (observer.source !== value) { + this.tearDownBindingObserver(token); + this.setupBindingObserver(token, value); + } + } else { + this.setupBindingObserver(token, value); + } + } else { + if (observer) { + this.tearDownBindingObserver(token); + } + this.store.set(token, value); + } + } + } + /** + * Sets up a binding observer for a derived token value that notifies token + * subscribers on change. + * + * @param token - The token to notify when the binding updates + * @param source - The binding source + */ + setupBindingObserver(token, source) { + const binding = new DesignTokenBindingObserver(source, token, this); + this.bindingObservers.set(token, binding); + return binding; + } + /** + * Tear down a binding observer for a token. + */ + tearDownBindingObserver(token) { + if (this.bindingObservers.has(token)) { + this.bindingObservers.get(token).disconnect(); + this.bindingObservers.delete(token); + return true; + } + return false; + } + }; + DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); + __decorate([ + observable + ], DesignTokenNode.prototype, "children", void 0); + DesignToken = Object.freeze({ + create, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been connected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * 3. The HTMLElement is not connected to the document when token values are set. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyConnection(element) { + if (!element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).bind(); + return true; + }, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been disconnected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyDisconnection(element) { + if (element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).unbind(); + return true; + }, + /** + * Registers and element or document as a DesignToken root. + * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via + * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all + * registered roots. + * @param target - The root to register + */ + registerRoot(target = defaultElement) { + RootStyleSheetTarget.registerRoot(target); + }, + /** + * Unregister an element or document as a DesignToken root. + * @param target - The root to deregister + */ + unregisterRoot(target = defaultElement) { + RootStyleSheetTarget.unregisterRoot(target); + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js + function extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) { + if (typeof params === "string") { + return { + name: params, + type: elementDefinitionType, + callback: elementDefinitionCallback + }; + } else { + return params; + } + } + var ElementDisambiguation, elementTypesByTag, elementTagsByType, rootDesignSystem, designSystemKey, DesignSystem, DefaultDesignSystem, ElementDefinitionEntry; + var init_design_system = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"() { + init_esm(); + init_foundation_element(); + init_di(); + init_design_token(); + init_component_presentation(); + ElementDisambiguation = Object.freeze({ + /** + * Skip defining the element but still call the provided callback passed + * to DesignSystemRegistrationContext.tryDefineElement + */ + definitionCallbackOnly: null, + /** + * Ignore the duplicate element entirely. + */ + ignoreDuplicate: /* @__PURE__ */ Symbol() + }); + elementTypesByTag = /* @__PURE__ */ new Map(); + elementTagsByType = /* @__PURE__ */ new Map(); + rootDesignSystem = null; + designSystemKey = DI.createInterface((x) => x.cachedCallback((handler) => { + if (rootDesignSystem === null) { + rootDesignSystem = new DefaultDesignSystem(null, handler); + } + return rootDesignSystem; + })); + DesignSystem = Object.freeze({ + /** + * Returns the HTML element name that the type is defined as. + * @param type - The type to lookup. + * @public + */ + tagFor(type) { + return elementTagsByType.get(type); + }, + /** + * Searches the DOM hierarchy for the design system that is responsible + * for the provided element. + * @param element - The element to locate the design system for. + * @returns The located design system. + * @public + */ + responsibleFor(element) { + const owned = element.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.findResponsibleContainer(element); + return container.get(designSystemKey); + }, + /** + * Gets the DesignSystem if one is explicitly defined on the provided element; + * otherwise creates a design system defined directly on the element. + * @param element - The element to get or create a design system for. + * @returns The design system. + * @public + */ + getOrCreate(node) { + if (!node) { + if (rootDesignSystem === null) { + rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey); + } + return rootDesignSystem; + } + const owned = node.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.getOrCreateDOMContainer(node); + if (container.has(designSystemKey, false)) { + return container.get(designSystemKey); + } else { + const system = new DefaultDesignSystem(node, container); + container.register(Registration.instance(designSystemKey, system)); + return system; + } + } + }); + DefaultDesignSystem = class { + constructor(owner, container) { + this.owner = owner; + this.container = container; + this.designTokensInitialized = false; + this.prefix = "fast"; + this.shadowRootMode = void 0; + this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly; + if (owner !== null) { + owner.$$designSystem$$ = this; + } + } + withPrefix(prefix) { + this.prefix = prefix; + return this; + } + withShadowRootMode(mode) { + this.shadowRootMode = mode; + return this; + } + withElementDisambiguation(callback) { + this.disambiguate = callback; + return this; + } + withDesignTokenRoot(root) { + this.designTokenRoot = root; + return this; + } + register(...registrations) { + const container = this.container; + const elementDefinitionEntries = []; + const disambiguate = this.disambiguate; + const shadowRootMode = this.shadowRootMode; + const context = { + elementPrefix: this.prefix, + tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) { + const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback); + const { name, callback, baseClass } = extractedParams; + let { type } = extractedParams; + let elementName = name; + let typeFoundByName = elementTypesByTag.get(elementName); + let needsDefine = true; + while (typeFoundByName) { + const result = disambiguate(elementName, type, typeFoundByName); + switch (result) { + case ElementDisambiguation.ignoreDuplicate: + return; + case ElementDisambiguation.definitionCallbackOnly: + needsDefine = false; + typeFoundByName = void 0; + break; + default: + elementName = result; + typeFoundByName = elementTypesByTag.get(elementName); + break; + } + } + if (needsDefine) { + if (elementTagsByType.has(type) || type === FoundationElement) { + type = class extends type { + }; + } + elementTypesByTag.set(elementName, type); + elementTagsByType.set(type, elementName); + if (baseClass) { + elementTagsByType.set(baseClass, elementName); + } + } + elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine)); + } + }; + if (!this.designTokensInitialized) { + this.designTokensInitialized = true; + if (this.designTokenRoot !== null) { + DesignToken.registerRoot(this.designTokenRoot); + } + } + container.registerWithContext(context, ...registrations); + for (const entry of elementDefinitionEntries) { + entry.callback(entry); + if (entry.willDefine && entry.definition !== null) { + entry.definition.define(); + } + } + return this; + } + }; + ElementDefinitionEntry = class { + constructor(container, name, type, shadowRootMode, callback, willDefine) { + this.container = container; + this.name = name; + this.type = type; + this.shadowRootMode = shadowRootMode; + this.callback = callback; + this.willDefine = willDefine; + this.definition = null; + } + definePresentation(presentation) { + ComponentPresentation.define(this.name, presentation, this.container); + } + defineElement(definition) { + this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name })); + } + tagFor(type) { + return DesignSystem.tagFor(type); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js + var init_registration_context = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js + var init_design_system2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js"() { + init_design_system(); + init_component_presentation(); + init_registration_context(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/index.js + var init_di2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/index.js"() { + init_di(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js + var init_dialog_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js"() { + } + }); + + // node_modules/tabbable/dist/index.esm.js + var candidateSelectors, candidateSelector, NoElement, matches, getRootNode, getTabindex, isInput, isHiddenInput, isDetailsWithSummary, getCheckedRadio, isTabbableRadio, isRadio, isNonTabbableRadio, isZeroArea, isHidden, isDisabledFromFieldset, isNodeMatchingSelectorFocusable, isNodeMatchingSelectorTabbable, isTabbable, focusableCandidateSelector, isFocusable; + var init_index_esm = __esm({ + "node_modules/tabbable/dist/index.esm.js"() { + candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + NoElement = typeof Element === "undefined"; + matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; + }; + getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } + }; + isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot2 = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot2 === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot2(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js + var Dialog; + var init_dialog = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + Dialog = class _Dialog extends FoundationElement { + constructor() { + super(...arguments); + this.modal = true; + this.hidden = false; + this.trapFocus = true; + this.trapFocusChanged = () => { + if (this.$fastController.isConnected) { + this.updateTrapFocus(); + } + }; + this.isTrappingFocus = false; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && !this.hidden) { + switch (e.key) { + case keyEscape: + this.dismiss(); + e.preventDefault(); + break; + case keyTab: + this.handleTabKeyDown(e); + break; + } + } + }; + this.handleDocumentFocus = (e) => { + if (!e.defaultPrevented && this.shouldForceFocus(e.target)) { + this.focusFirstElement(); + e.preventDefault(); + } + }; + this.handleTabKeyDown = (e) => { + if (!this.trapFocus || this.hidden) { + return; + } + const bounds = this.getTabQueueBounds(); + if (bounds.length === 0) { + return; + } + if (bounds.length === 1) { + bounds[0].focus(); + e.preventDefault(); + return; + } + if (e.shiftKey && e.target === bounds[0]) { + bounds[bounds.length - 1].focus(); + e.preventDefault(); + } else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) { + bounds[0].focus(); + e.preventDefault(); + } + return; + }; + this.getTabQueueBounds = () => { + const bounds = []; + return _Dialog.reduceTabbableItems(bounds, this); + }; + this.focusFirstElement = () => { + const bounds = this.getTabQueueBounds(); + if (bounds.length > 0) { + bounds[0].focus(); + } else { + if (this.dialog instanceof HTMLElement) { + this.dialog.focus(); + } + } + }; + this.shouldForceFocus = (currentFocusElement) => { + return this.isTrappingFocus && !this.contains(currentFocusElement); + }; + this.shouldTrapFocus = () => { + return this.trapFocus && !this.hidden; + }; + this.updateTrapFocus = (shouldTrapFocusOverride) => { + const shouldTrapFocus = shouldTrapFocusOverride === void 0 ? this.shouldTrapFocus() : shouldTrapFocusOverride; + if (shouldTrapFocus && !this.isTrappingFocus) { + this.isTrappingFocus = true; + document.addEventListener("focusin", this.handleDocumentFocus); + DOM.queueUpdate(() => { + if (this.shouldForceFocus(document.activeElement)) { + this.focusFirstElement(); + } + }); + } else if (!shouldTrapFocus && this.isTrappingFocus) { + this.isTrappingFocus = false; + document.removeEventListener("focusin", this.handleDocumentFocus); + } + }; + } + /** + * @internal + */ + dismiss() { + this.$emit("dismiss"); + this.$emit("cancel"); + } + /** + * The method to show the dialog. + * + * @public + */ + show() { + this.hidden = false; + } + /** + * The method to hide the dialog. + * + * @public + */ + hide() { + this.hidden = true; + this.$emit("close"); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + document.addEventListener("keydown", this.handleDocumentKeydown); + this.notifier = Observable.getNotifier(this); + this.notifier.subscribe(this, "hidden"); + this.updateTrapFocus(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.updateTrapFocus(false); + this.notifier.unsubscribe(this, "hidden"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "hidden": + this.updateTrapFocus(); + break; + default: + break; + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceTabbableItems(elements2, element) { + if (element.getAttribute("tabindex") === "-1") { + return elements2; + } + if (isTabbable(element) || _Dialog.isFocusableFastElement(element) && _Dialog.hasTabbableShadow(element)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Dialog.reduceTabbableItems, [])); + } + return elements2; + } + /** + * Test if element is focusable fast element + * + * @param element - The element to check + * + * @internal + */ + static isFocusableFastElement(element) { + var _a, _b; + return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus); + } + /** + * Test if the element has a focusable shadow + * + * @param element - The element to check + * + * @internal + */ + static hasTabbableShadow(element) { + var _a, _b; + return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("*")) !== null && _b !== void 0 ? _b : []).some((x) => { + return isTabbable(x); + }); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "modal", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "hidden", void 0); + __decorate([ + attr({ attribute: "trap-focus", mode: "boolean" }) + ], Dialog.prototype, "trapFocus", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], Dialog.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], Dialog.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], Dialog.prototype, "ariaLabel", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js + var init_dialog2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js"() { + init_dialog_template(); + init_dialog(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js + var init_disclosure_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js + var Disclosure; + var init_disclosure = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Disclosure = class extends FoundationElement { + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.setup(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.details.removeEventListener("toggle", this.onToggle); + } + /** + * Show extra content. + */ + show() { + this.details.open = true; + } + /** + * Hide extra content. + */ + hide() { + this.details.open = false; + } + /** + * Toggle the current(expanded/collapsed) state. + */ + toggle() { + this.details.open = !this.details.open; + } + /** + * Register listener and set default disclosure mode + */ + setup() { + this.onToggle = this.onToggle.bind(this); + this.details.addEventListener("toggle", this.onToggle); + if (this.expanded) { + this.show(); + } + } + /** + * Update the aria attr and fire `toggle` event + */ + onToggle() { + this.expanded = this.details.open; + this.$emit("toggle"); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Disclosure.prototype, "expanded", void 0); + __decorate([ + attr + ], Disclosure.prototype, "title", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js + var init_disclosure2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js"() { + init_disclosure_template(); + init_disclosure(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js + var dividerTemplate; + var init_divider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js"() { + init_esm(); + dividerTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js + var DividerRole; + var init_divider_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js"() { + DividerRole = { + /** + * The divider semantically separates content + */ + separator: "separator", + /** + * The divider has no semantic value and is for visual presentation only. + */ + presentation: "presentation" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js + var Divider; + var init_divider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_divider_options(); + Divider = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = DividerRole.separator; + this.orientation = Orientation.horizontal; + } + }; + __decorate([ + attr + ], Divider.prototype, "role", void 0); + __decorate([ + attr + ], Divider.prototype, "orientation", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js + var init_divider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js"() { + init_divider_template(); + init_divider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js + var FlipperDirection; + var init_flipper_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js"() { + FlipperDirection = { + next: "next", + previous: "previous" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js + var init_flipper_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js + var Flipper; + var init_flipper = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_flipper_options(); + Flipper = class extends FoundationElement { + constructor() { + super(...arguments); + this.hiddenFromAT = true; + this.direction = FlipperDirection.next; + } + /** + * Simulate a click event when the flipper has focus and the user hits enter or space keys + * Blur focus if the user hits escape key + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + if (!this.hiddenFromAT) { + const key = e.key; + if (key === "Enter" || key === "Space") { + this.$emit("click", e); + } + if (key === "Escape") { + this.blur(); + } + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Flipper.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "aria-hidden", converter: booleanConverter }) + ], Flipper.prototype, "hiddenFromAT", void 0); + __decorate([ + attr + ], Flipper.prototype, "direction", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js + var init_flipper2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js"() { + init_flipper_template(); + init_flipper(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js + var init_form_associated2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js"() { + init_form_associated(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js + var init_foundation_element2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js"() { + init_foundation_element(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js + var listboxOptionTemplate; + var init_listbox_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js"() { + init_esm(); + init_start_end(); + listboxOptionTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js + var init_listbox_option2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js"() { + init_listbox_option(); + init_listbox_option_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js + var ListboxElement; + var init_listbox_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + ListboxElement = class extends Listbox { + constructor() { + super(...arguments); + this.activeIndex = -1; + this.rangeStartIndex = -1; + } + /** + * Returns the last checked option. + * + * @internal + */ + get activeOption() { + return this.options[this.activeIndex]; + } + /** + * Returns the list of checked options. + * + * @internal + */ + get checkedOptions() { + var _a; + return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((o) => o.checked); + } + /** + * Returns the index of the first selected option. + * + * @internal + */ + get firstSelectedOptionIndex() { + return this.options.indexOf(this.firstSelectedOption); + } + /** + * Updates the `ariaActiveDescendant` property when the active index changes. + * + * @param prev - the previous active index + * @param next - the next active index + * + * @internal + */ + activeIndexChanged(prev, next) { + var _a, _b; + this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; + this.focusAndScrollOptionIntoView(); + } + /** + * Toggles the checked state for the currently active option. + * + * @remarks + * Multiple-selection mode only. + * + * @internal + */ + checkActiveIndex() { + if (!this.multiple) { + return; + } + const activeItem = this.activeOption; + if (activeItem) { + activeItem.checked = true; + } + } + /** + * Sets the active index to the first option and marks it as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkFirstOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex + 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and sets the matching option as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkLastOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.options.length); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = this.options.length - 1; + this.checkActiveIndex(); + } + /** + * @override + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("focusout", this.focusoutHandler); + } + /** + * @override + * @internal + */ + disconnectedCallback() { + this.removeEventListener("focusout", this.focusoutHandler); + super.disconnectedCallback(); + } + /** + * Increments the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkNextOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.activeIndex + 1); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkPreviousOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + if (this.checkedOptions.length === 1) { + this.rangeStartIndex += 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.activeIndex, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex -= this.activeIndex > 0 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Handles click events for listbox options. + * + * @param e - the event object + * + * @override + * @internal + */ + clickHandler(e) { + var _a; + if (!this.multiple) { + return super.clickHandler(e); + } + const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`); + if (!captured || captured.disabled) { + return; + } + this.uncheckAllOptions(); + this.activeIndex = this.options.indexOf(captured); + this.checkActiveIndex(); + this.toggleSelectedForAllCheckedOptions(); + return true; + } + /** + * @override + * @internal + */ + focusAndScrollOptionIntoView() { + super.focusAndScrollOptionIntoView(this.activeOption); + } + /** + * In multiple-selection mode: + * If any options are selected, the first selected option is checked when + * the listbox receives focus. If no options are selected, the first + * selectable option is checked. + * + * @override + * @internal + */ + focusinHandler(e) { + if (!this.multiple) { + return super.focusinHandler(e); + } + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.uncheckAllOptions(); + if (this.activeIndex === -1) { + this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0; + } + this.checkActiveIndex(); + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Unchecks all options when the listbox loses focus. + * + * @internal + */ + focusoutHandler(e) { + if (this.multiple) { + this.uncheckAllOptions(); + } + } + /** + * Handles keydown actions for listbox navigation and typeahead + * + * @override + * @internal + */ + keydownHandler(e) { + if (!this.multiple) { + return super.keydownHandler(e); + } + if (this.disabled) { + return true; + } + const { key, shiftKey } = e; + this.shouldSkipFocus = false; + switch (key) { + // Select the first available option + case keyHome: { + this.checkFirstOption(shiftKey); + return; + } + // Select the next selectable option + case keyArrowDown: { + this.checkNextOption(shiftKey); + return; + } + // Select the previous selectable option + case keyArrowUp: { + this.checkPreviousOption(shiftKey); + return; + } + // Select the last available option + case keyEnd: { + this.checkLastOption(shiftKey); + return; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEscape: { + this.uncheckAllOptions(); + this.checkActiveIndex(); + return true; + } + case keySpace: { + e.preventDefault(); + if (this.typeAheadExpired) { + this.toggleSelectedForAllCheckedOptions(); + return; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @override + * @internal + */ + mousedownHandler(e) { + if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) { + return super.mousedownHandler(e); + } + } + /** + * Switches between single-selection and multi-selection mode. + * + * @internal + */ + multipleChanged(prev, next) { + var _a; + this.ariaMultiSelectable = next ? "true" : null; + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + o.checked = next ? false : void 0; + }); + this.setSelectedOptions(); + } + /** + * Sets an option as selected and gives it focus. + * + * @override + * @public + */ + setSelectedOptions() { + if (!this.multiple) { + super.setSelectedOptions(); + return; + } + if (this.$fastController.isConnected && this.options) { + this.selectedOptions = this.options.filter((o) => o.selected); + this.focusAndScrollOptionIntoView(); + } + } + /** + * Ensures the size is a positive integer when the property is updated. + * + * @param prev - the previous size value + * @param next - the current size value + * + * @internal + */ + sizeChanged(prev, next) { + var _a; + const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10)); + if (size !== next) { + DOM.queueUpdate(() => { + this.size = size; + }); + } + } + /** + * Toggles the selected state of the provided options. If any provided items + * are in an unselected state, all items are set to selected. If every + * provided item is selected, they are all unselected. + * + * @internal + */ + toggleSelectedForAllCheckedOptions() { + const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled); + const force = !enabledCheckedOptions.every((o) => o.selected); + enabledCheckedOptions.forEach((o) => o.selected = force); + this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]); + this.setSelectedOptions(); + } + /** + * @override + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (!this.multiple) { + super.typeaheadBufferChanged(prev, next); + return; + } + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + const activeIndex = this.options.indexOf(typeaheadMatches[0]); + if (activeIndex > -1) { + this.activeIndex = activeIndex; + this.uncheckAllOptions(); + this.checkActiveIndex(); + } + this.typeAheadExpired = false; + } + } + /** + * Unchecks all options. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - reset the rangeStartIndex + * + * @internal + */ + uncheckAllOptions(preserveChecked = false) { + this.options.forEach((o) => o.checked = this.multiple ? false : void 0); + if (!preserveChecked) { + this.rangeStartIndex = -1; + } + } + }; + __decorate([ + observable + ], ListboxElement.prototype, "activeIndex", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxElement.prototype, "multiple", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], ListboxElement.prototype, "size", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js + var init_listbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js + var init_listbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js"() { + init_listbox(); + init_listbox_element(); + init_listbox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js + var PickerMenu; + var init_picker_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js"() { + init_tslib_es6(); + init_dist2(); + init_esm(); + init_foundation_element(); + PickerMenu = class extends FoundationElement { + constructor() { + super(...arguments); + this.optionElements = []; + } + menuElementsChanged() { + this.updateOptions(); + } + headerElementsChanged() { + this.updateOptions(); + } + footerElementsChanged() { + this.updateOptions(); + } + updateOptions() { + this.optionElements.splice(0, this.optionElements.length); + this.addSlottedListItems(this.headerElements); + this.addSlottedListItems(this.menuElements); + this.addSlottedListItems(this.footerElements); + this.$emit("optionsupdated", { bubbles: false }); + } + addSlottedListItems(slotChildren) { + if (slotChildren === void 0) { + return; + } + slotChildren.forEach((child) => { + if (child.nodeType === 1 && child.getAttribute("role") === "listitem") { + child.id = child.id || uniqueId("option-"); + this.optionElements.push(child); + } + }); + } + }; + __decorate([ + observable + ], PickerMenu.prototype, "menuElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "headerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "footerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "suggestionsAvailableText", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js + var defaultContentsTemplate, PickerMenuOption; + var init_picker_menu_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + defaultContentsTemplate = html` + +`; + PickerMenuOption = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.disconnectView(); + } + handleClick(e) { + if (e.defaultPrevented) { + return false; + } + this.handleInvoked(); + return false; + } + handleInvoked() { + this.$emit("pickeroptioninvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerMenuOption.prototype, "value", void 0); + __decorate([ + observable + ], PickerMenuOption.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js + var init_picker_list = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js + var defaultContentsTemplate2, PickerListItem; + var init_picker_list_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + defaultContentsTemplate2 = html` + +`; + PickerListItem = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + this.disconnectView(); + super.disconnectedCallback(); + } + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + if (e.key === keyEnter) { + this.handleInvoke(); + return false; + } + return true; + } + handleClick(e) { + if (!e.defaultPrevented) { + this.handleInvoke(); + } + return false; + } + handleInvoke() { + this.$emit("pickeriteminvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate2.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerListItem.prototype, "value", void 0); + __decorate([ + observable + ], PickerListItem.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js + var init_picker_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js + var _Picker, FormAssociatedPicker; + var init_picker_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Picker = class extends FoundationElement { + }; + FormAssociatedPicker = class extends FormAssociated(_Picker) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js + var pickerInputTemplate, Picker; + var init_picker = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_anchored_region2(); + init_picker_menu_option(); + init_picker_list_item(); + init_picker_form_associated(); + pickerInputTemplate = html` + +`; + Picker = class extends FormAssociatedPicker { + constructor() { + super(...arguments); + this.selection = ""; + this.filterSelected = true; + this.filterQuery = true; + this.noSuggestionsText = "No suggestions available"; + this.suggestionsAvailableText = "Suggestions available"; + this.loadingText = "Loading suggestions"; + this.menuPlacement = "bottom-fill"; + this.showLoading = false; + this.optionsList = []; + this.filteredOptionsList = []; + this.flyoutOpen = false; + this.menuFocusIndex = -1; + this.showNoOptions = false; + this.selectedItems = []; + this.inputElementView = null; + this.handleTextInput = (e) => { + this.query = this.inputElement.value; + }; + this.handleInputClick = (e) => { + e.preventDefault(); + this.toggleFlyout(true); + }; + this.setRegionProps = () => { + if (!this.flyoutOpen) { + return; + } + if (this.region === null || this.region === void 0) { + DOM.queueUpdate(this.setRegionProps); + return; + } + this.region.anchorElement = this.inputElement; + }; + this.configLookup = { + top: FlyoutPosTop, + bottom: FlyoutPosBottom, + tallest: FlyoutPosTallest, + "top-fill": FlyoutPosTopFill, + "bottom-fill": FlyoutPosBottomFill, + "tallest-fill": FlyoutPosTallestFill + }; + } + selectionChanged() { + if (this.$fastController.isConnected) { + this.handleSelectionChange(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.value = this.selection; + this.validate(); + } + } + } + optionsChanged() { + this.optionsList = this.options.split(",").map((opt) => opt.trim()).filter((opt) => opt !== ""); + } + menuPlacementChanged() { + if (this.$fastController.isConnected) { + this.updateMenuConfig(); + } + } + showLoadingChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + listItemTemplateChanged() { + this.updateListItemTemplate(); + } + defaultListItemTemplateChanged() { + this.updateListItemTemplate(); + } + menuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + defaultMenuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + optionsListChanged() { + this.updateFilteredOptions(); + } + queryChanged() { + if (this.$fastController.isConnected) { + if (this.inputElement.value !== this.query) { + this.inputElement.value = this.query; + } + this.updateFilteredOptions(); + this.$emit("querychange", { bubbles: false }); + } + } + filteredOptionsListChanged() { + if (this.$fastController.isConnected) { + this.showNoOptions = this.filteredOptionsList.length === 0 && this.menuElement.querySelectorAll('[role="listitem"]').length === 0; + this.setFocusedOption(this.showNoOptions ? -1 : 0); + } + } + flyoutOpenChanged() { + if (this.flyoutOpen) { + DOM.queueUpdate(this.setRegionProps); + this.$emit("menuopening", { bubbles: false }); + } else { + this.$emit("menuclosing", { bubbles: false }); + } + } + showNoOptionsChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.listElement = document.createElement(this.selectedListTag); + this.appendChild(this.listElement); + this.itemsPlaceholderElement = document.createComment(""); + this.listElement.append(this.itemsPlaceholderElement); + this.inputElementView = pickerInputTemplate.render(this, this.listElement); + const match = this.menuTag.toUpperCase(); + this.menuElement = Array.from(this.children).find((element) => { + return element.tagName === match; + }); + if (this.menuElement === void 0) { + this.menuElement = document.createElement(this.menuTag); + this.appendChild(this.menuElement); + } + if (this.menuElement.id === "") { + this.menuElement.id = uniqueId("listbox-"); + } + this.menuId = this.menuElement.id; + this.optionsPlaceholder = document.createComment(""); + this.menuElement.append(this.optionsPlaceholder); + this.updateMenuConfig(); + DOM.queueUpdate(() => this.initialize()); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.toggleFlyout(false); + this.inputElement.removeEventListener("input", this.handleTextInput); + this.inputElement.removeEventListener("click", this.handleInputClick); + if (this.inputElementView !== null) { + this.inputElementView.dispose(); + this.inputElementView = null; + } + } + /** + * Move focus to the input element + * @public + */ + focus() { + this.inputElement.focus(); + } + /** + * Initialize the component. This is delayed a frame to ensure children are connected as well. + */ + initialize() { + this.updateListItemTemplate(); + this.updateOptionTemplate(); + this.itemsRepeatBehavior = new RepeatDirective((x) => x.selectedItems, (x) => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement); + this.inputElement.addEventListener("input", this.handleTextInput); + this.inputElement.addEventListener("click", this.handleInputClick); + this.$fastController.addBehaviors([this.itemsRepeatBehavior]); + this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText; + this.menuElement.addEventListener("optionsupdated", this.handleMenuOptionsUpdated); + this.optionsRepeatBehavior = new RepeatDirective((x) => x.filteredOptionsList, (x) => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder); + this.$fastController.addBehaviors([this.optionsRepeatBehavior]); + this.handleSelectionChange(); + } + /** + * Toggles the menu flyout + */ + toggleFlyout(open) { + if (this.flyoutOpen === open) { + return; + } + if (open && document.activeElement === this.inputElement) { + this.flyoutOpen = open; + DOM.queueUpdate(() => { + if (this.menuElement !== void 0) { + this.setFocusedOption(0); + } else { + this.disableMenu(); + } + }); + return; + } + this.flyoutOpen = false; + this.disableMenu(); + return; + } + /** + * Handle the menu options updated event from the child menu + */ + handleMenuOptionsUpdated(e) { + e.preventDefault(); + if (this.flyoutOpen) { + this.setFocusedOption(0); + } + } + /** + * Handle key down events. + */ + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + // TODO: what should "home" and "end" keys do, exactly? + // + // case keyHome: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.setFocusedOption(0); + // } + // } + // return false; + // } + // case keyEnd: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.toggleFlyout(true); + // this.setFocusedOption(this.menuElement.optionElements.length - 1); + // } + // } + // return false; + // } + case keyArrowDown: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const nextFocusOptionIndex = this.flyoutOpen ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1) : 0; + this.setFocusedOption(nextFocusOptionIndex); + } + return false; + } + case keyArrowUp: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const previousFocusOptionIndex = this.flyoutOpen ? Math.max(this.menuFocusIndex - 1, 0) : 0; + this.setFocusedOption(previousFocusOptionIndex); + } + return false; + } + case keyEscape: { + this.toggleFlyout(false); + return false; + } + case keyEnter: { + if (this.menuFocusIndex !== -1 && this.menuElement.optionElements.length > this.menuFocusIndex) { + this.menuElement.optionElements[this.menuFocusIndex].click(); + } + return false; + } + case keyArrowRight: { + if (document.activeElement !== this.inputElement) { + this.incrementFocusedItem(1); + return false; + } + return true; + } + case keyArrowLeft: { + if (this.inputElement.selectionStart === 0) { + this.incrementFocusedItem(-1); + return false; + } + return true; + } + case keyDelete: + case keyBackspace: { + if (document.activeElement === null) { + return true; + } + if (document.activeElement === this.inputElement) { + if (this.inputElement.selectionStart === 0) { + this.selection = this.selectedItems.slice(0, this.selectedItems.length - 1).toString(); + this.toggleFlyout(false); + return false; + } + return true; + } + const selectedItems = Array.from(this.listElement.children); + const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement); + if (currentFocusedItemIndex > -1) { + this.selection = this.selectedItems.splice(currentFocusedItemIndex, 1).toString(); + DOM.queueUpdate(() => { + selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus(); + }); + return false; + } + return true; + } + } + this.toggleFlyout(true); + return true; + } + /** + * Handle focus in events. + */ + handleFocusIn(e) { + return false; + } + /** + * Handle focus out events. + */ + handleFocusOut(e) { + if (this.menuElement === void 0 || !this.menuElement.contains(e.relatedTarget)) { + this.toggleFlyout(false); + } + return false; + } + /** + * The list of selected items has changed + */ + handleSelectionChange() { + if (this.selectedItems.toString() === this.selection) { + return; + } + this.selectedItems = this.selection === "" ? [] : this.selection.split(","); + this.updateFilteredOptions(); + DOM.queueUpdate(() => { + this.checkMaxItems(); + }); + this.$emit("selectionchange", { bubbles: false }); + } + /** + * Anchored region is loaded, menu and options exist in the DOM. + */ + handleRegionLoaded(e) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + this.$emit("menuloaded", { bubbles: false }); + }); + } + /** + * Checks if the maximum number of items has been chosen and updates the ui. + */ + checkMaxItems() { + if (this.inputElement === void 0) { + return; + } + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + if (document.activeElement === this.inputElement) { + const selectedItemInstances = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + selectedItemInstances[selectedItemInstances.length - 1].focus(); + } + this.inputElement.hidden = true; + } else { + this.inputElement.hidden = false; + } + } + /** + * A list item has been invoked. + */ + handleItemInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerListItem) { + const listItems = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + const itemIndex = listItems.indexOf(e.target); + if (itemIndex !== -1) { + const newSelection = this.selectedItems.slice(); + newSelection.splice(itemIndex, 1); + this.selection = newSelection.toString(); + DOM.queueUpdate(() => this.incrementFocusedItem(0)); + } + return false; + } + return true; + } + /** + * A menu option has been invoked. + */ + handleOptionInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerMenuOption) { + if (e.target.value !== void 0) { + this.selection = `${this.selection}${this.selection === "" ? "" : ","}${e.target.value}`; + } + this.inputElement.value = ""; + this.query = ""; + this.inputElement.focus(); + this.toggleFlyout(false); + return false; + } + return true; + } + /** + * Increments the focused list item by the specified amount + */ + incrementFocusedItem(increment) { + if (this.selectedItems.length === 0) { + this.inputElement.focus(); + return; + } + const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + if (document.activeElement !== null) { + let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement); + if (currentFocusedItemIndex === -1) { + currentFocusedItemIndex = selectedItemsAsElements.length; + } + const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment)); + if (newFocusedItemIndex === selectedItemsAsElements.length) { + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + selectedItemsAsElements[newFocusedItemIndex - 1].focus(); + } else { + this.inputElement.focus(); + } + } else { + selectedItemsAsElements[newFocusedItemIndex].focus(); + } + } + } + /** + * Disables the menu. Note that the menu can be open, just doens't have any valid options on display. + */ + disableMenu() { + var _a, _b, _c; + this.menuFocusIndex = -1; + this.menuFocusOptionId = void 0; + (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant"); + (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns"); + (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded"); + } + /** + * Sets the currently focused menu option by index + */ + setFocusedOption(optionIndex) { + if (!this.flyoutOpen || optionIndex === -1 || this.showNoOptions || this.showLoading) { + this.disableMenu(); + return; + } + if (this.menuElement.optionElements.length === 0) { + return; + } + this.menuElement.optionElements.forEach((element) => { + element.setAttribute("aria-selected", "false"); + }); + this.menuFocusIndex = optionIndex; + if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) { + this.menuFocusIndex = this.menuElement.optionElements.length - 1; + } + this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id; + this.inputElement.setAttribute("aria-owns", this.menuId); + this.inputElement.setAttribute("aria-expanded", "true"); + this.inputElement.setAttribute("aria-activedescendant", this.menuFocusOptionId); + const focusedOption = this.menuElement.optionElements[this.menuFocusIndex]; + focusedOption.setAttribute("aria-selected", "true"); + this.menuElement.scrollTo(0, focusedOption.offsetTop); + } + /** + * Updates the template used for the list item repeat behavior + */ + updateListItemTemplate() { + var _a; + this.activeListItemTemplate = (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate; + } + /** + * Updates the template used for the menu option repeat behavior + */ + updateOptionTemplate() { + var _a; + this.activeMenuOptionTemplate = (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate; + } + /** + * Updates the filtered options array + */ + updateFilteredOptions() { + this.filteredOptionsList = this.optionsList.slice(0); + if (this.filterSelected) { + this.filteredOptionsList = this.filteredOptionsList.filter((el) => this.selectedItems.indexOf(el) === -1); + } + if (this.filterQuery && this.query !== "" && this.query !== void 0) { + this.filteredOptionsList = this.filteredOptionsList.filter((el) => el.indexOf(this.query) !== -1); + } + } + /** + * Updates the menu configuration + */ + updateMenuConfig() { + let newConfig = this.configLookup[this.menuPlacement]; + if (newConfig === null) { + newConfig = FlyoutPosBottomFill; + } + this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false }); + } + }; + __decorate([ + attr({ attribute: "selection" }) + ], Picker.prototype, "selection", void 0); + __decorate([ + attr({ attribute: "options" }) + ], Picker.prototype, "options", void 0); + __decorate([ + attr({ attribute: "filter-selected", mode: "boolean" }) + ], Picker.prototype, "filterSelected", void 0); + __decorate([ + attr({ attribute: "filter-query", mode: "boolean" }) + ], Picker.prototype, "filterQuery", void 0); + __decorate([ + attr({ attribute: "max-selected" }) + ], Picker.prototype, "maxSelected", void 0); + __decorate([ + attr({ attribute: "no-suggestions-text" }) + ], Picker.prototype, "noSuggestionsText", void 0); + __decorate([ + attr({ attribute: "suggestions-available-text" }) + ], Picker.prototype, "suggestionsAvailableText", void 0); + __decorate([ + attr({ attribute: "loading-text" }) + ], Picker.prototype, "loadingText", void 0); + __decorate([ + attr({ attribute: "label" }) + ], Picker.prototype, "label", void 0); + __decorate([ + attr({ attribute: "labelledby" }) + ], Picker.prototype, "labelledBy", void 0); + __decorate([ + attr({ attribute: "placeholder" }) + ], Picker.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "menu-placement" }) + ], Picker.prototype, "menuPlacement", void 0); + __decorate([ + observable + ], Picker.prototype, "showLoading", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "optionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "query", void 0); + __decorate([ + observable + ], Picker.prototype, "filteredOptionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "flyoutOpen", void 0); + __decorate([ + observable + ], Picker.prototype, "menuId", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedListTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusIndex", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusOptionId", void 0); + __decorate([ + observable + ], Picker.prototype, "showNoOptions", void 0); + __decorate([ + observable + ], Picker.prototype, "menuConfig", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js + var init_picker_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js + var init_picker_menu_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js + var init_picker_list_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js + var init_picker_list_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js + var init_picker2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js"() { + init_picker_template(); + init_picker(); + init_picker_menu_template(); + init_picker_menu(); + init_picker_menu_option_template(); + init_picker_menu_option(); + init_picker_list_template(); + init_picker_list(); + init_picker_list_item_template(); + init_picker_list_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js + var MenuItemRole, roleForMenuItem; + var init_menu_item_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js"() { + MenuItemRole = { + /** + * The menu item has a "menuitem" role + */ + menuitem: "menuitem", + /** + * The menu item has a "menuitemcheckbox" role + */ + menuitemcheckbox: "menuitemcheckbox", + /** + * The menu item has a "menuitemradio" role + */ + menuitemradio: "menuitemradio" + }; + roleForMenuItem = { + [MenuItemRole.menuitem]: "menuitem", + [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox", + [MenuItemRole.menuitemradio]: "menuitemradio" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js + var MenuItem; + var init_menu_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_start_end(); + init_direction(); + init_apply_mixins(); + init_menu_item_options(); + MenuItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = MenuItemRole.menuitem; + this.hasSubmenu = false; + this.currentDirection = Direction.ltr; + this.focusSubmenuOnLoad = false; + this.handleMenuItemKeyDown = (e) => { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.invoke(); + return false; + case keyArrowRight: + this.expandAndFocus(); + return false; + case keyArrowLeft: + if (this.expanded) { + this.expanded = false; + this.focus(); + return false; + } + } + return true; + }; + this.handleMenuItemClick = (e) => { + if (e.defaultPrevented || this.disabled) { + return false; + } + this.invoke(); + return false; + }; + this.submenuLoaded = () => { + if (!this.focusSubmenuOnLoad) { + return; + } + this.focusSubmenuOnLoad = false; + if (this.hasSubmenu) { + this.submenu.focus(); + this.setAttribute("tabindex", "-1"); + } + }; + this.handleMouseOver = (e) => { + if (this.disabled || !this.hasSubmenu || this.expanded) { + return false; + } + this.expanded = true; + return false; + }; + this.handleMouseOut = (e) => { + if (!this.expanded || this.contains(document.activeElement)) { + return false; + } + this.expanded = false; + return false; + }; + this.expandAndFocus = () => { + if (!this.hasSubmenu) { + return; + } + this.focusSubmenuOnLoad = true; + this.expanded = true; + }; + this.invoke = () => { + if (this.disabled) { + return; + } + switch (this.role) { + case MenuItemRole.menuitemcheckbox: + this.checked = !this.checked; + break; + case MenuItemRole.menuitem: + this.updateSubmenu(); + if (this.hasSubmenu) { + this.expandAndFocus(); + } else { + this.$emit("change"); + } + break; + case MenuItemRole.menuitemradio: + if (!this.checked) { + this.checked = true; + } + break; + } + }; + this.updateSubmenu = () => { + this.submenu = this.domChildren().find((element) => { + return element.getAttribute("role") === "menu"; + }); + this.hasSubmenu = this.submenu === void 0 ? false : true; + }; + } + expandedChanged(oldValue) { + if (this.$fastController.isConnected) { + if (this.submenu === void 0) { + return; + } + if (this.expanded === false) { + this.submenu.collapseExpandedItem(); + } else { + this.currentDirection = getDirection(this); + } + this.$emit("expanded-change", this, { bubbles: false }); + } + } + checkedChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.$emit("change"); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.updateSubmenu(); + }); + if (!this.startColumnCount) { + this.startColumnCount = 1; + } + this.observer = new MutationObserver(this.updateSubmenu); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.submenu = void 0; + if (this.observer !== void 0) { + this.observer.disconnect(); + this.observer = void 0; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "disabled", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "expanded", void 0); + __decorate([ + observable + ], MenuItem.prototype, "startColumnCount", void 0); + __decorate([ + attr + ], MenuItem.prototype, "role", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "checked", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenuRegion", void 0); + __decorate([ + observable + ], MenuItem.prototype, "hasSubmenu", void 0); + __decorate([ + observable + ], MenuItem.prototype, "currentDirection", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenu", void 0); + applyMixins(MenuItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js + var init_menu_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js + var init_menu_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js"() { + init_menu_item_template(); + init_menu_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js + var init_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js + var Menu; + var init_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_menu_item2(); + init_foundation_element(); + Menu = class _Menu extends FoundationElement { + constructor() { + super(...arguments); + this.expandedItem = null; + this.focusIndex = -1; + this.isNestedMenu = () => { + return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem"; + }; + this.handleFocusOut = (e) => { + if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) { + this.collapseExpandedItem(); + const focusIndex = this.menuItems.findIndex(this.isFocusableElement); + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.menuItems[focusIndex].setAttribute("tabindex", "0"); + this.focusIndex = focusIndex; + } + }; + this.handleItemFocus = (e) => { + const targetItem = e.target; + if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.focusIndex = this.menuItems.indexOf(targetItem); + targetItem.setAttribute("tabindex", "0"); + } + }; + this.handleExpandedChanged = (e) => { + if (e.defaultPrevented || e.target === null || this.menuItems === void 0 || this.menuItems.indexOf(e.target) < 0) { + return; + } + e.preventDefault(); + const changedItem = e.target; + if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) { + this.expandedItem = null; + return; + } + if (changedItem.expanded) { + if (this.expandedItem !== null && this.expandedItem !== changedItem) { + this.expandedItem.expanded = false; + } + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.expandedItem = changedItem; + this.focusIndex = this.menuItems.indexOf(changedItem); + changedItem.setAttribute("tabindex", "0"); + } + }; + this.removeItemListeners = () => { + if (this.menuItems !== void 0) { + this.menuItems.forEach((item) => { + item.removeEventListener("expanded-change", this.handleExpandedChanged); + item.removeEventListener("focus", this.handleItemFocus); + }); + } + }; + this.setItems = () => { + const newItems = this.domChildren(); + this.removeItemListeners(); + this.menuItems = newItems; + const menuItems = this.menuItems.filter(this.isMenuItemElement); + if (menuItems.length) { + this.focusIndex = 0; + } + function elementIndent(el) { + const role = el.getAttribute("role"); + const startSlot = el.querySelector("[slot=start]"); + if (role !== MenuItemRole.menuitem && startSlot === null) { + return 1; + } else if (role === MenuItemRole.menuitem && startSlot !== null) { + return 1; + } else if (role !== MenuItemRole.menuitem && startSlot !== null) { + return 2; + } else { + return 0; + } + } + const indent = menuItems.reduce((accum, current) => { + const elementValue = elementIndent(current); + return accum > elementValue ? accum : elementValue; + }, 0); + menuItems.forEach((item, index) => { + item.setAttribute("tabindex", index === 0 ? "0" : "-1"); + item.addEventListener("expanded-change", this.handleExpandedChanged); + item.addEventListener("focus", this.handleItemFocus); + if (item instanceof MenuItem || "startColumnCount" in item) { + item.startColumnCount = indent; + } + }); + }; + this.changeHandler = (e) => { + if (this.menuItems === void 0) { + return; + } + const changedMenuItem = e.target; + const changeItemIndex = this.menuItems.indexOf(changedMenuItem); + if (changeItemIndex === -1) { + return; + } + if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) { + for (let i = changeItemIndex - 1; i >= 0; --i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + const maxIndex = this.menuItems.length - 1; + for (let i = changeItemIndex + 1; i <= maxIndex; ++i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + } + }; + this.isMenuItemElement = (el) => { + return isHTMLElement(el) && _Menu.focusableElementRoles.hasOwnProperty(el.getAttribute("role")); + }; + this.isFocusableElement = (el) => { + return this.isMenuItemElement(el); + }; + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.menuItems !== void 0) { + this.setItems(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.setItems(); + }); + this.addEventListener("change", this.changeHandler); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeItemListeners(); + this.menuItems = void 0; + this.removeEventListener("change", this.changeHandler); + } + /** + * Focuses the first item in the menu. + * + * @public + */ + focus() { + this.setFocus(0, 1); + } + /** + * Collapses any expanded menu items. + * + * @public + */ + collapseExpandedItem() { + if (this.expandedItem !== null) { + this.expandedItem.expanded = false; + this.expandedItem = null; + } + } + /** + * @internal + */ + handleMenuKeyDown(e) { + if (e.defaultPrevented || this.menuItems === void 0) { + return; + } + switch (e.key) { + case keyArrowDown: + this.setFocus(this.focusIndex + 1, 1); + return; + case keyArrowUp: + this.setFocus(this.focusIndex - 1, -1); + return; + case keyEnd: + this.setFocus(this.menuItems.length - 1, -1); + return; + case keyHome: + this.setFocus(0, 1); + return; + default: + return true; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + setFocus(focusIndex, adjustment) { + if (this.menuItems === void 0) { + return; + } + while (focusIndex >= 0 && focusIndex < this.menuItems.length) { + const child = this.menuItems[focusIndex]; + if (this.isFocusableElement(child)) { + if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + } + this.focusIndex = focusIndex; + child.setAttribute("tabindex", "0"); + child.focus(); + break; + } + focusIndex += adjustment; + } + } + }; + Menu.focusableElementRoles = roleForMenuItem; + __decorate([ + observable + ], Menu.prototype, "items", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js + var init_menu2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js"() { + init_menu_template(); + init_menu(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js + var init_number_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js + var _TextField, FormAssociatedTextField; + var init_text_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextField = class extends FoundationElement { + }; + FormAssociatedTextField = class extends FormAssociated(_TextField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js + var TextFieldType; + var init_text_field_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js"() { + TextFieldType = { + /** + * An email TextField + */ + email: "email", + /** + * A password TextField + */ + password: "password", + /** + * A telephone TextField + */ + tel: "tel", + /** + * A text TextField + */ + text: "text", + /** + * A URL TextField + */ + url: "url" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js + var TextField, DelegatesARIATextbox; + var init_text_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_text_field_form_associated(); + init_text_field_options(); + TextField = class extends FormAssociatedTextField { + constructor() { + super(...arguments); + this.type = TextFieldType.text; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + typeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + this.validate(); + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the text field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], TextField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "autofocus", void 0); + __decorate([ + attr + ], TextField.prototype, "placeholder", void 0); + __decorate([ + attr + ], TextField.prototype, "type", void 0); + __decorate([ + attr + ], TextField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "minlength", void 0); + __decorate([ + attr + ], TextField.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextField.prototype, "defaultSlottedNodes", void 0); + DelegatesARIATextbox = class { + }; + applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties); + applyMixins(TextField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js + var _NumberField, FormAssociatedNumberField; + var init_number_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _NumberField = class extends FoundationElement { + }; + FormAssociatedNumberField = class extends FormAssociated(_NumberField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js + var NumberField; + var init_number_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_text_field(); + init_number_field_form_associated(); + NumberField = class extends FormAssociatedNumberField { + constructor() { + super(...arguments); + this.hideStep = false; + this.step = 1; + this.isUserInput = false; + } + /** + * Ensures that the max is greater than the min and that the value + * is less than the max + * @param previous - the previous max value + * @param next - updated max value + * + * @internal + */ + maxChanged(previous, next) { + var _a; + this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next); + const min = Math.min(this.min, this.max); + if (this.min !== void 0 && this.min !== min) { + this.min = min; + } + this.value = this.getValidValue(this.value); + } + /** + * Ensures that the min is less than the max and that the value + * is greater than the min + * @param previous - previous min value + * @param next - updated min value + * + * @internal + */ + minChanged(previous, next) { + var _a; + this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next); + const max = Math.max(this.min, this.max); + if (this.max !== void 0 && this.max !== max) { + this.max = max; + } + this.value = this.getValidValue(this.value); + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * Validates that the value is a number between the min and max + * @param previous - previous stored value + * @param next - value being updated + * @param updateControl - should the text field be updated with value, defaults to true + * @internal + */ + valueChanged(previous, next) { + this.value = this.getValidValue(next); + if (next !== this.value) { + return; + } + if (this.control && !this.isUserInput) { + this.control.value = this.value; + } + super.valueChanged(previous, this.value); + if (previous !== void 0 && !this.isUserInput) { + this.$emit("input"); + this.$emit("change"); + } + this.isUserInput = false; + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Sets the internal value to a valid number between the min and max properties + * @param value - user input + * + * @internal + */ + getValidValue(value) { + var _a, _b; + let validValue = parseFloat(parseFloat(value).toPrecision(12)); + if (isNaN(validValue)) { + validValue = ""; + } else { + validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue); + validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString(); + } + return validValue; + } + /** + * Increments the value using the step value + * + * @public + */ + stepUp() { + const value = parseFloat(this.value); + const stepUpValue = !isNaN(value) ? value + this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? this.step : 0; + this.value = stepUpValue.toString(); + } + /** + * Decrements the value using the step value + * + * @public + */ + stepDown() { + const value = parseFloat(this.value); + const stepDownValue = !isNaN(value) ? value - this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? 0 - this.step : 0; + this.value = stepDownValue.toString(); + } + /** + * Sets up the initial state of the number field + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "number"); + this.validate(); + this.control.value = this.value; + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the number field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, ""); + this.isUserInput = true; + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** + * Handles the internal control's `keydown` event + * @internal + */ + handleKeyDown(e) { + const key = e.key; + switch (key) { + case keyArrowUp: + this.stepUp(); + return false; + case keyArrowDown: + this.stepDown(); + return false; + } + return true; + } + /** + * Handles populating the input field with a validated value when + * leaving the input field. + * @internal + */ + handleBlur() { + this.control.value = this.value; + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], NumberField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], NumberField.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "hide-step", mode: "boolean" }) + ], NumberField.prototype, "hideStep", void 0); + __decorate([ + attr + ], NumberField.prototype, "placeholder", void 0); + __decorate([ + attr + ], NumberField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "minlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "size", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "step", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "min", void 0); + __decorate([ + observable + ], NumberField.prototype, "defaultSlottedNodes", void 0); + applyMixins(NumberField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js + var init_number_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js"() { + init_number_field_template(); + init_number_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js + var progressSegments, progressRingTemplate; + var init_progress_ring_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js"() { + init_esm(); + progressSegments = 44; + progressRingTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js + var init_progress_ring = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js"() { + init_progress_ring_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js + var BaseProgress; + var init_base_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + BaseProgress = class extends FoundationElement { + constructor() { + super(...arguments); + this.percentComplete = 0; + } + valueChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + minChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + maxChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updatePercentComplete(); + } + updatePercentComplete() { + const min = typeof this.min === "number" ? this.min : 0; + const max = typeof this.max === "number" ? this.max : 100; + const value = typeof this.value === "number" ? this.value : 0; + const range2 = max - min; + this.percentComplete = range2 === 0 ? 0 : Math.fround((value - min) / range2 * 100); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "value", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "max", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], BaseProgress.prototype, "paused", void 0); + __decorate([ + observable + ], BaseProgress.prototype, "percentComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js + var init_progress_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js + var init_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js"() { + init_base_progress(); + init_progress_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js + var radioGroupTemplate; + var init_radio_group_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js"() { + init_esm(); + init_dist2(); + radioGroupTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js + var RadioGroup; + var init_radio_group = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + RadioGroup = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = Orientation.horizontal; + this.radioChangeHandler = (e) => { + const changedRadio = e.target; + if (changedRadio.checked) { + this.slottedRadioButtons.forEach((radio) => { + if (radio !== changedRadio) { + radio.checked = false; + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + } + }); + this.selectedRadio = changedRadio; + this.value = changedRadio.value; + changedRadio.setAttribute("tabindex", "0"); + this.focusedRadio = changedRadio; + } + e.stopPropagation(); + }; + this.moveToRadioByIndex = (group, index) => { + const radio = group[index]; + if (!this.isInsideToolbar) { + radio.setAttribute("tabindex", "0"); + if (radio.readOnly) { + this.slottedRadioButtons.forEach((nextRadio) => { + if (nextRadio !== radio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + radio.checked = true; + this.selectedRadio = radio; + } + } + this.focusedRadio = radio; + radio.focus(); + }; + this.moveRightOffGroup = () => { + var _a; + (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.moveLeftOffGroup = () => { + var _a; + (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.focusOutHandler = (e) => { + const group = this.slottedRadioButtons; + const radio = e.target; + const index = radio !== null ? group.indexOf(radio) : 0; + const focusedIndex = this.focusedRadio ? group.indexOf(this.focusedRadio) : -1; + if (focusedIndex === 0 && index === focusedIndex || focusedIndex === group.length - 1 && focusedIndex === index) { + if (!this.selectedRadio) { + this.focusedRadio = group[0]; + this.focusedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.focusedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + this.focusedRadio = this.selectedRadio; + if (!this.isInsideFoundationToolbar) { + this.selectedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.selectedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } + } + } + return true; + }; + this.clickHandler = (e) => { + const radio = e.target; + if (radio) { + const group = this.slottedRadioButtons; + if (radio.checked || group.indexOf(radio) === 0) { + radio.setAttribute("tabindex", "0"); + this.selectedRadio = radio; + } else { + radio.setAttribute("tabindex", "-1"); + this.selectedRadio = null; + } + this.focusedRadio = radio; + } + e.preventDefault(); + }; + this.shouldMoveOffGroupToTheRight = (index, group, key) => { + return index === group.length && this.isInsideToolbar && key === keyArrowRight; + }; + this.shouldMoveOffGroupToTheLeft = (group, key) => { + const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + return index < 0 && this.isInsideToolbar && key === keyArrowLeft; + }; + this.checkFocusedRadio = () => { + if (this.focusedRadio !== null && !this.focusedRadio.readOnly && !this.focusedRadio.checked) { + this.focusedRadio.checked = true; + this.focusedRadio.setAttribute("tabindex", "0"); + this.focusedRadio.focus(); + this.selectedRadio = this.focusedRadio; + } + }; + this.moveRight = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1; + if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) { + this.moveRightOffGroup(); + return; + } else if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index + 1 >= group.length) { + if (this.isInsideToolbar) { + break; + } else { + index = 0; + } + } else { + index += 1; + } + } + }; + this.moveLeft = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + if (this.shouldMoveOffGroupToTheLeft(group, e.key)) { + this.moveLeftOffGroup(); + return; + } + while (index >= 0 && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.keydownHandler = (e) => { + const key = e.key; + if (key in ArrowKeys && this.isInsideFoundationToolbar) { + return true; + } + switch (key) { + case keyEnter: { + this.checkFocusedRadio(); + break; + } + case keyArrowRight: + case keyArrowDown: { + if (this.direction === Direction.ltr) { + this.moveRight(e); + } else { + this.moveLeft(e); + } + break; + } + case keyArrowLeft: + case keyArrowUp: { + if (this.direction === Direction.ltr) { + this.moveLeft(e); + } else { + this.moveRight(e); + } + break; + } + default: { + return true; + } + } + }; + } + readOnlyChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.readOnly) { + radio.readOnly = true; + } else { + radio.readOnly = false; + } + }); + } + } + disabledChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.disabled) { + radio.disabled = true; + } else { + radio.disabled = false; + } + }); + } + } + nameChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + radio.setAttribute("name", this.name); + }); + } + } + valueChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + if (radio.value === this.value) { + radio.checked = true; + this.selectedRadio = radio; + } + }); + } + this.$emit("change"); + } + slottedRadioButtonsChanged(oldValue, newValue) { + if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) { + this.setupRadioButtons(); + } + } + get parentToolbar() { + return this.closest('[role="toolbar"]'); + } + get isInsideToolbar() { + var _a; + return (_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false; + } + get isInsideFoundationToolbar() { + var _a; + return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + this.setupRadioButtons(); + } + disconnectedCallback() { + this.slottedRadioButtons.forEach((radio) => { + radio.removeEventListener("change", this.radioChangeHandler); + }); + } + setupRadioButtons() { + const checkedRadios = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0; + if (numberOfCheckedRadios > 1) { + const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1]; + lastCheckedRadio.checked = true; + } + let foundMatchingVal = false; + this.slottedRadioButtons.forEach((radio) => { + if (this.name !== void 0) { + radio.setAttribute("name", this.name); + } + if (this.disabled) { + radio.disabled = true; + } + if (this.readOnly) { + radio.readOnly = true; + } + if (this.value && this.value === radio.value) { + this.selectedRadio = radio; + this.focusedRadio = radio; + radio.checked = true; + radio.setAttribute("tabindex", "0"); + foundMatchingVal = true; + } else { + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + radio.checked = false; + } + radio.addEventListener("change", this.radioChangeHandler); + }); + if (this.value === void 0 && this.slottedRadioButtons.length > 0) { + const checkedRadios2 = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios2 = checkedRadios2 !== null ? checkedRadios2.length : 0; + if (numberOfCheckedRadios2 > 0 && !foundMatchingVal) { + const lastCheckedRadio = checkedRadios2[numberOfCheckedRadios2 - 1]; + lastCheckedRadio.checked = true; + this.focusedRadio = lastCheckedRadio; + lastCheckedRadio.setAttribute("tabindex", "0"); + } else { + this.slottedRadioButtons[0].setAttribute("tabindex", "0"); + this.focusedRadio = this.slottedRadioButtons[0]; + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], RadioGroup.prototype, "readOnly", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], RadioGroup.prototype, "disabled", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "name", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "value", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "orientation", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "childItems", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "slottedRadioButtons", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js + var init_radio_group2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js"() { + init_radio_group_template(); + init_radio_group(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js + var radioTemplate; + var init_radio_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js"() { + init_esm(); + radioTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js + var _Radio, FormAssociatedRadio; + var init_radio_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Radio = class extends FoundationElement { + }; + FormAssociatedRadio = class extends CheckableFormAssociated(_Radio) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js + var Radio; + var init_radio = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_radio_form_associated(); + Radio = class extends FormAssociatedRadio { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + switch (e.key) { + case keySpace: + if (!this.checked && !this.readOnly) { + this.checked = true; + } + return; + } + return true; + }; + this.proxy.setAttribute("type", "radio"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * @internal + */ + defaultCheckedChanged() { + var _a; + if (this.$fastController.isConnected && !this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false; + this.dirtyChecked = false; + } + } + } + /** + * @internal + */ + connectedCallback() { + var _a, _b; + super.connectedCallback(); + this.validate(); + if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" && this.getAttribute("tabindex") === null) { + if (!this.disabled) { + this.setAttribute("tabindex", "0"); + } + } + if (this.checkedAttribute) { + if (!this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false; + this.dirtyChecked = false; + } + } + } + } + isInsideRadioGroup() { + const parent = this.closest("[role=radiogroup]"); + return parent !== null; + } + /** + * @internal + */ + clickHandler(e) { + if (!this.disabled && !this.readOnly && !this.checked) { + this.checked = true; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Radio.prototype, "readOnly", void 0); + __decorate([ + observable + ], Radio.prototype, "name", void 0); + __decorate([ + observable + ], Radio.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js + var init_radio2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js"() { + init_radio_template(); + init_radio(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js + var HorizontalScroll; + var init_horizontal_scroll = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + HorizontalScroll = class extends FoundationElement { + constructor() { + super(...arguments); + this.framesPerSecond = 60; + this.updatingItems = false; + this.speed = 600; + this.easing = "ease-in-out"; + this.flippersHiddenFromAT = false; + this.scrolling = false; + this.resizeDetector = null; + } + /** + * The calculated duration for a frame. + * + * @internal + */ + get frameTime() { + return 1e3 / this.framesPerSecond; + } + /** + * Firing scrollstart and scrollend events + * @internal + */ + scrollingChanged(prev, next) { + if (this.scrollContainer) { + const event = this.scrolling == true ? "scrollstart" : "scrollend"; + this.$emit(event, this.scrollContainer.scrollLeft); + } + } + /** + * In RTL mode + * @internal + */ + get isRtl() { + return this.scrollItems.length > 1 && this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft; + } + connectedCallback() { + super.connectedCallback(); + this.initializeResizeDetector(); + } + disconnectedCallback() { + this.disconnectResizeDetector(); + super.disconnectedCallback(); + } + /** + * Updates scroll stops and flippers when scroll items change + * @param previous - current scroll items + * @param next - new updated scroll items + * @public + */ + scrollItemsChanged(previous, next) { + if (next && !this.updatingItems) { + DOM.queueUpdate(() => this.setStops()); + } + } + /** + * destroys the instance's resize observer + * @internal + */ + disconnectResizeDetector() { + if (this.resizeDetector) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + * @internal + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.resized.bind(this)); + this.resizeDetector.observe(this); + } + /** + * Looks for slots and uses child nodes instead + * @internal + */ + updateScrollStops() { + this.updatingItems = true; + const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => { + if (scrollItem instanceof HTMLSlotElement) { + return scrollItems.concat(scrollItem.assignedElements()); + } + scrollItems.push(scrollItem); + return scrollItems; + }, []); + this.scrollItems = updatedItems; + this.updatingItems = false; + } + /** + * Finds all of the scroll stops between elements + * @internal + */ + setStops() { + this.updateScrollStops(); + const { scrollContainer: container } = this; + const { scrollLeft } = container; + const { width: containerWidth, left: containerLeft } = container.getBoundingClientRect(); + this.width = containerWidth; + let lastStop = 0; + let stops = this.scrollItems.map((item, index) => { + const { left, width } = item.getBoundingClientRect(); + const leftPosition = Math.round(left + scrollLeft - containerLeft); + const right = Math.round(leftPosition + width); + if (this.isRtl) { + return -right; + } + lastStop = right; + return index === 0 ? 0 : leftPosition; + }).concat(lastStop); + stops = this.fixScrollMisalign(stops); + stops.sort((a, b) => Math.abs(a) - Math.abs(b)); + this.scrollStops = stops; + this.setFlippers(); + } + /** + * Checks to see if the stops are returning values + * otherwise it will try to reinitialize them + * + * @returns boolean indicating that current scrollStops are valid non-zero values + * @internal + */ + validateStops(reinit = true) { + const hasStops = () => !!this.scrollStops.find((stop) => stop > 0); + if (!hasStops() && reinit) { + this.setStops(); + } + return hasStops(); + } + /** + * + */ + fixScrollMisalign(stops) { + if (this.isRtl && stops.some((stop) => stop > 0)) { + stops.sort((a, b) => b - a); + const offset = stops[0]; + stops = stops.map((stop) => stop - offset); + } + return stops; + } + /** + * Sets the controls view if enabled + * @internal + */ + setFlippers() { + var _a, _b; + const position = this.scrollContainer.scrollLeft; + (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle("disabled", position === 0); + if (this.scrollStops) { + const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]); + (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", this.validateStops(false) && Math.abs(position) + this.width >= lastStop); + } + } + /** + * Function that can scroll an item into view. + * @param item - An item index, a scroll item or a child of one of the scroll items + * @param padding - Padding of the viewport where the active item shouldn't be + * @param rightPadding - Optional right padding. Uses the padding if not defined + * + * @public + */ + scrollInView(item, padding = 0, rightPadding) { + var _a; + if (typeof item !== "number" && item) { + item = this.scrollItems.findIndex((scrollItem) => scrollItem === item || scrollItem.contains(item)); + } + if (item !== void 0) { + rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding; + const { scrollContainer: container, scrollStops, scrollItems: items } = this; + const { scrollLeft } = this.scrollContainer; + const { width: containerWidth } = container.getBoundingClientRect(); + const itemStart = scrollStops[item]; + const { width } = items[item].getBoundingClientRect(); + const itemEnd = itemStart + width; + const isBefore = scrollLeft + padding > itemStart; + if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) { + const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b); + const scrollTo = (_a = stops.find((position) => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0; + this.scrollToPosition(scrollTo); + } + } + } + /** + * Lets the user arrow left and right through the horizontal scroll + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + this.scrollToPrevious(); + break; + case "ArrowRight": + this.scrollToNext(); + break; + } + } + /** + * Scrolls items to the left + * @public + */ + scrollToPrevious() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition && (this.isRtl || index === this.scrollStops.length - 1 || this.scrollStops[index + 1] > scrollPosition)); + const right = Math.abs(this.scrollStops[current + 1]); + let nextIndex = this.scrollStops.findIndex((stop) => Math.abs(stop) + this.width > right); + if (nextIndex >= current || nextIndex === -1) { + nextIndex = current > 0 ? current - 1 : 0; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Scrolls items to the right + * @public + */ + scrollToNext() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop) => Math.abs(stop) >= Math.abs(scrollPosition)); + const outOfView = this.scrollStops.findIndex((stop) => Math.abs(scrollPosition) + this.width <= Math.abs(stop)); + let nextIndex = current; + if (outOfView > current + 2) { + nextIndex = outOfView - 2; + } else if (current < this.scrollStops.length - 2) { + nextIndex = current + 1; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Handles scrolling with easing + * @param position - starting position + * @param newPosition - position to scroll to + * @public + */ + scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) { + var _a; + if (this.scrolling) { + return; + } + this.scrolling = true; + const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`; + this.content.style.setProperty("transition-duration", seconds); + const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue("transition-duration")); + const transitionendHandler = (e) => { + if (e && e.target !== e.currentTarget) { + return; + } + this.content.style.setProperty("transition-duration", "0s"); + this.content.style.removeProperty("transform"); + this.scrollContainer.style.setProperty("scroll-behavior", "auto"); + this.scrollContainer.scrollLeft = newPosition; + this.setFlippers(); + this.content.removeEventListener("transitionend", transitionendHandler); + this.scrolling = false; + }; + if (computedDuration === 0) { + transitionendHandler(); + return; + } + this.content.addEventListener("transitionend", transitionendHandler); + const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth; + let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue); + if (this.isRtl) { + transitionStop = this.scrollContainer.scrollLeft + Math.min(Math.abs(newPosition), maxScrollValue); + } + this.content.style.setProperty("transition-property", "transform"); + this.content.style.setProperty("transition-timing-function", this.easing); + this.content.style.setProperty("transform", `translateX(${transitionStop}px)`); + } + /** + * Monitors resize event on the horizontal-scroll element + * @public + */ + resized() { + if (this.resizeTimeout) { + this.resizeTimeout = clearTimeout(this.resizeTimeout); + } + this.resizeTimeout = setTimeout(() => { + this.width = this.scrollContainer.offsetWidth; + this.setFlippers(); + }, this.frameTime); + } + /** + * Monitors scrolled event on the content container + * @public + */ + scrolled() { + if (this.scrollTimeout) { + this.scrollTimeout = clearTimeout(this.scrollTimeout); + } + this.scrollTimeout = setTimeout(() => { + this.setFlippers(); + }, this.frameTime); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], HorizontalScroll.prototype, "speed", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "duration", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "easing", void 0); + __decorate([ + attr({ attribute: "flippers-hidden-from-at", converter: booleanConverter }) + ], HorizontalScroll.prototype, "flippersHiddenFromAT", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrolling", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrollItems", void 0); + __decorate([ + attr({ attribute: "view" }) + ], HorizontalScroll.prototype, "view", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js + var init_horizontal_scroll_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js + var init_horizontal_scroll2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js"() { + init_horizontal_scroll(); + init_horizontal_scroll_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js + function whitespaceFilter(value, index, array) { + return value.nodeType !== Node.TEXT_NODE ? true : typeof value.nodeValue === "string" && !!value.nodeValue.trim().length; + } + var init_whitespace_filter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js + var init_search_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js + var _Search, FormAssociatedSearch; + var init_search_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Search = class extends FoundationElement { + }; + FormAssociatedSearch = class extends FormAssociated(_Search) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.js + var Search, DelegatesARIASearch; + var init_search = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_search_form_associated(); + Search = class extends FormAssociatedSearch { + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Handles the control's clear value event + * @public + */ + handleClearInput() { + this.value = ""; + this.control.focus(); + this.handleChange(); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Search.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "autofocus", void 0); + __decorate([ + attr + ], Search.prototype, "placeholder", void 0); + __decorate([ + attr + ], Search.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "minlength", void 0); + __decorate([ + attr + ], Search.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "spellcheck", void 0); + __decorate([ + observable + ], Search.prototype, "defaultSlottedNodes", void 0); + DelegatesARIASearch = class { + }; + applyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties); + applyMixins(Search, StartEnd, DelegatesARIASearch); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/index.js + var init_search2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/index.js"() { + init_search_template(); + init_search(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js + var _Select, FormAssociatedSelect; + var init_select_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js"() { + init_listbox_element(); + init_form_associated(); + _Select = class extends ListboxElement { + }; + FormAssociatedSelect = class extends FormAssociated(_Select) { + constructor() { + super(...arguments); + this.proxy = document.createElement("select"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.js + var Select, DelegatesARIASelect; + var init_select = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_apply_mixins(); + init_select_form_associated(); + init_select_options(); + Select = class extends FormAssociatedSelect { + constructor() { + super(...arguments); + this.open = false; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + } + /** + * Sets focus and synchronizes ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged(prev, next) { + if (!this.collapsible) { + return; + } + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + this.indexWhenOpened = this.selectedIndex; + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The component is collapsible when in single-selection mode with no size attribute. + * + * @internal + */ + get collapsible() { + return !(this.multiple || typeof this.size === "number"); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c, _d, _e, _f, _g; + const prev = `${this._value}`; + if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) { + const selectedIndex = this._options.findIndex((el) => el.value === next); + const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; + const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null; + if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) { + next = ""; + this.selectedIndex = selectedIndex; + } + next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + this.updateDisplayValue(); + } + } + /** + * Sets the value and display value to match the first selected option. + * + * @param shouldEmit - if true, the input and change events will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a, _b; + if (this.$fastController.isConnected) { + this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; + } + if (shouldEmit) { + this.$emit("input"); + this.$emit("change", this, { + bubbles: true, + composed: void 0 + }); + } + } + /** + * Updates the proxy value when the selected index changes. + * + * @param prev - the previous selected index + * @param next - the next selected index + * + * @internal + */ + selectedIndexChanged(prev, next) { + super.selectedIndexChanged(prev, next); + this.updateValue(); + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * The value displayed on the button. + * + * @public + */ + get displayValue() { + var _a, _b; + Observable.track(this, "displayValue"); + return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ""; + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + this.setProxyOptions(); + super.setDefaultSelectedOption(); + if (this.selectedIndex === -1) { + this.selectedIndex = 0; + } + } + /** + * Handle opening and closing the listbox when the select is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + if (this.disabled) { + return; + } + if (this.open) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && captured.disabled) { + return; + } + } + super.clickHandler(e); + this.open = this.collapsible && !this.open; + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + return true; + } + /** + * Handles focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + var _a; + super.focusoutHandler(e); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) { + this.open = false; + if (this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + } + } + /** + * Updates the value when an option's value changes. + * + * @param source - the source object + * @param propertyName - the property to evaluate + * + * @internal + * @override + */ + handleChange(source, propertyName) { + super.handleChange(source, propertyName); + if (propertyName === "value") { + this.updateValue(); + } + } + /** + * Synchronize the form-associated proxy and updates the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "value"); + }); + super.slottedOptionsChanged(prev, next); + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.subscribe(this, "value"); + }); + this.setProxyOptions(); + this.updateValue(); + } + /** + * Prevents focus when size is set and a scrollbar is clicked. + * + * @param e - the mouse event object + * + * @override + * @internal + */ + mousedownHandler(e) { + var _a; + if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) { + return super.mousedownHandler(e); + } + return this.collapsible; + } + /** + * Sets the multiple property on the proxy element. + * + * @param prev - the previous multiple value + * @param next - the current multiple value + */ + multipleChanged(prev, next) { + super.multipleChanged(prev, next); + if (this.proxy) { + this.proxy.multiple = next; + } + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @override + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + super.selectedOptionsChanged(prev, next); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => { + var _a2; + const proxyOption = (_a2 = this.proxy) === null || _a2 === void 0 ? void 0 : _a2.options.item(i); + if (proxyOption) { + proxyOption.selected = o.selected; + } + }); + } + /** + * Sets the selected index to match the first option with the selected attribute, or + * the first selectable option. + * + * @override + * @internal + */ + setDefaultSelectedOption() { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter); + const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex((el) => el.hasAttribute("selected") || el.selected || el.value === this.value); + if (selectedIndex !== -1) { + this.selectedIndex = selectedIndex; + return; + } + this.selectedIndex = 0; + } + /** + * Resets and fills the proxy to match the component's options. + * + * @internal + */ + setProxyOptions() { + if (this.proxy instanceof HTMLSelectElement && this.options) { + this.proxy.options.length = 0; + this.options.forEach((option) => { + const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null); + if (proxyOption) { + this.proxy.options.add(proxyOption); + } + }); + } + } + /** + * Handle keyboard interaction for the select. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + super.keydownHandler(e); + const key = e.key || e.key.charCodeAt(0); + switch (key) { + case keySpace: { + e.preventDefault(); + if (this.collapsible && this.typeAheadExpired) { + this.open = !this.open; + } + break; + } + case keyHome: + case keyEnd: { + e.preventDefault(); + break; + } + case keyEnter: { + e.preventDefault(); + this.open = !this.open; + break; + } + case keyEscape: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + break; + } + case keyTab: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + return true; + } + } + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + this.indexWhenOpened = this.selectedIndex; + } + return !(key === keyArrowDown || key === keyArrowUp); + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + this.addEventListener("contentchange", this.updateDisplayValue); + } + disconnectedCallback() { + this.removeEventListener("contentchange", this.updateDisplayValue); + super.disconnectedCallback(); + } + /** + * Updates the proxy's size property when the size attribute changes. + * + * @param prev - the previous size + * @param next - the current size + * + * @override + * @internal + */ + sizeChanged(prev, next) { + super.sizeChanged(prev, next); + if (this.proxy) { + this.proxy.size = next; + } + } + /** + * + * @internal + */ + updateDisplayValue() { + if (this.collapsible) { + Observable.notify(this, "displayValue"); + } + } + }; + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Select.prototype, "open", void 0); + __decorate([ + volatile + ], Select.prototype, "collapsible", null); + __decorate([ + observable + ], Select.prototype, "control", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Select.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Select.prototype, "position", void 0); + __decorate([ + observable + ], Select.prototype, "maxHeight", void 0); + DelegatesARIASelect = class { + }; + __decorate([ + observable + ], DelegatesARIASelect.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIASelect, DelegatesARIAListbox); + applyMixins(Select, StartEnd, DelegatesARIASelect); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js + var selectTemplate; + var init_select_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js"() { + init_esm(); + init_listbox(); + init_start_end(); + selectTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/index.js + var init_select2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/index.js"() { + init_select(); + init_select_options(); + init_select_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js + var init_skeleton_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js + var Skeleton; + var init_skeleton = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Skeleton = class extends FoundationElement { + constructor() { + super(...arguments); + this.shape = "rect"; + } + }; + __decorate([ + attr + ], Skeleton.prototype, "fill", void 0); + __decorate([ + attr + ], Skeleton.prototype, "shape", void 0); + __decorate([ + attr + ], Skeleton.prototype, "pattern", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Skeleton.prototype, "shimmer", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js + var init_skeleton2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js"() { + init_skeleton_template(); + init_skeleton(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js + var init_slider_label_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js + function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) { + let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition)); + if (direction === Direction.rtl) { + pct = 1 - pct; + } + return pct; + } + var init_slider_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js"() { + init_dist2(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js + var defaultConfig, SliderLabel; + var init_slider_label = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_slider_utilities(); + init_foundation_element(); + defaultConfig = { + min: 0, + max: 0, + direction: Direction.ltr, + orientation: Orientation.horizontal, + disabled: false + }; + SliderLabel = class extends FoundationElement { + constructor() { + super(...arguments); + this.hideMark = false; + this.sliderDirection = Direction.ltr; + this.getSliderConfiguration = () => { + if (!this.isSliderConfig(this.parentNode)) { + this.sliderDirection = defaultConfig.direction || Direction.ltr; + this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal; + this.sliderMaxPosition = defaultConfig.max; + this.sliderMinPosition = defaultConfig.min; + } else { + const parentSlider = this.parentNode; + const { min, max, direction, orientation, disabled } = parentSlider; + if (disabled !== void 0) { + this.disabled = disabled; + } + this.sliderDirection = direction || Direction.ltr; + this.sliderOrientation = orientation || Orientation.horizontal; + this.sliderMaxPosition = max; + this.sliderMinPosition = min; + } + }; + this.positionAsStyle = () => { + const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr; + const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition)); + let rightNum = Math.round((1 - pct) * 100); + let leftNum = Math.round(pct * 100); + if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) { + rightNum = 50; + leftNum = 50; + } + if (this.sliderOrientation === Orientation.horizontal) { + return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`; + } else { + return `top: ${leftNum}%; bottom: ${rightNum}%;`; + } + }; + } + positionChanged() { + this.positionStyle = this.positionAsStyle(); + } + /** + * @internal + */ + sliderOrientationChanged() { + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.getSliderConfiguration(); + this.positionStyle = this.positionAsStyle(); + this.notifier = Observable.getNotifier(this.parentNode); + this.notifier.subscribe(this, "orientation"); + this.notifier.subscribe(this, "direction"); + this.notifier.subscribe(this, "max"); + this.notifier.subscribe(this, "min"); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.notifier.unsubscribe(this, "orientation"); + this.notifier.unsubscribe(this, "direction"); + this.notifier.unsubscribe(this, "max"); + this.notifier.unsubscribe(this, "min"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "direction": + this.sliderDirection = source.direction; + break; + case "orientation": + this.sliderOrientation = source.orientation; + break; + case "max": + this.sliderMaxPosition = source.max; + break; + case "min": + this.sliderMinPosition = source.min; + break; + default: + break; + } + this.positionStyle = this.positionAsStyle(); + } + isSliderConfig(node) { + return node.max !== void 0 && node.min !== void 0; + } + }; + __decorate([ + observable + ], SliderLabel.prototype, "positionStyle", void 0); + __decorate([ + attr + ], SliderLabel.prototype, "position", void 0); + __decorate([ + attr({ attribute: "hide-mark", mode: "boolean" }) + ], SliderLabel.prototype, "hideMark", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], SliderLabel.prototype, "disabled", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderOrientation", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMinPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMaxPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js + var init_slider_label2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js"() { + init_slider_label_template(); + init_slider_label(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js + var init_slider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js + var _Slider, FormAssociatedSlider; + var init_slider_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Slider = class extends FoundationElement { + }; + FormAssociatedSlider = class extends FormAssociated(_Slider) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js + var SliderMode, Slider; + var init_slider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_slider_utilities(); + init_slider_form_associated(); + SliderMode = { + singleValue: "single-value" + }; + Slider = class extends FormAssociatedSlider { + constructor() { + super(...arguments); + this.direction = Direction.ltr; + this.isDragging = false; + this.trackWidth = 0; + this.trackMinWidth = 0; + this.trackHeight = 0; + this.trackLeft = 0; + this.trackMinHeight = 0; + this.valueTextFormatter = () => null; + this.min = 0; + this.max = 10; + this.step = 1; + this.orientation = Orientation.horizontal; + this.mode = SliderMode.singleValue; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + if (e.key === keyHome) { + e.preventDefault(); + this.value = `${this.min}`; + } else if (e.key === keyEnd) { + e.preventDefault(); + this.value = `${this.max}`; + } else if (!e.shiftKey) { + switch (e.key) { + case keyArrowRight: + case keyArrowUp: + e.preventDefault(); + this.increment(); + break; + case keyArrowLeft: + case keyArrowDown: + e.preventDefault(); + this.decrement(); + break; + } + } + }; + this.setupTrackConstraints = () => { + const clientRect = this.track.getBoundingClientRect(); + this.trackWidth = this.track.clientWidth; + this.trackMinWidth = this.track.clientLeft; + this.trackHeight = clientRect.bottom; + this.trackMinHeight = clientRect.top; + this.trackLeft = this.getBoundingClientRect().left; + if (this.trackWidth === 0) { + this.trackWidth = 1; + } + }; + this.setupListeners = (remove = false) => { + const eventAction = `${remove ? "remove" : "add"}EventListener`; + this[eventAction]("keydown", this.keypressHandler); + this[eventAction]("mousedown", this.handleMouseDown); + this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { + passive: true + }); + this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { + passive: true + }); + if (remove) { + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + } + }; + this.initialValue = ""; + this.handleThumbMouseDown = (event) => { + if (event) { + if (this.readOnly || this.disabled || event.defaultPrevented) { + return; + } + event.target.focus(); + } + const eventAction = `${event !== null ? "add" : "remove"}EventListener`; + window[eventAction]("mouseup", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchmove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchend", this.handleWindowMouseUp); + this.isDragging = event !== null; + }; + this.handleMouseMove = (e) => { + if (this.readOnly || this.disabled || e.defaultPrevented) { + return; + } + const sourceEvent = window.TouchEvent && e instanceof TouchEvent ? e.touches[0] : e; + const eventValue = this.orientation === Orientation.horizontal ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft : sourceEvent.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(eventValue)}`; + }; + this.calculateNewValue = (rawValue) => { + const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal ? this.trackMinWidth : this.trackMinHeight, this.orientation === Orientation.horizontal ? this.trackWidth : this.trackHeight, this.direction); + const newValue = (this.max - this.min) * newPosition + this.min; + return this.convertToConstrainedValue(newValue); + }; + this.handleWindowMouseUp = (event) => { + this.stopDragging(); + }; + this.stopDragging = () => { + this.isDragging = false; + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + }; + this.handleMouseDown = (e) => { + const eventAction = `${e !== null ? "add" : "remove"}EventListener`; + if (e === null || !this.disabled && !this.readOnly) { + window[eventAction]("mouseup", this.handleWindowMouseUp); + window.document[eventAction]("mouseleave", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove); + if (e) { + e.preventDefault(); + this.setupTrackConstraints(); + e.target.focus(); + const controlValue = this.orientation === Orientation.horizontal ? e.pageX - document.documentElement.scrollLeft - this.trackLeft : e.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(controlValue)}`; + } + } + }; + this.convertToConstrainedValue = (value) => { + if (isNaN(value)) { + value = this.min; + } + let constrainedValue = value - this.min; + const roundedConstrainedValue = Math.round(constrainedValue / this.step); + const remainderValue = constrainedValue - roundedConstrainedValue * (this.stepMultiplier * this.step) / this.stepMultiplier; + constrainedValue = remainderValue >= Number(this.step) / 2 ? constrainedValue - remainderValue + Number(this.step) : constrainedValue - remainderValue; + return constrainedValue + this.min; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * @internal + */ + valueChanged(previous, next) { + super.valueChanged(previous, next); + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + this.$emit("change"); + } + minChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.min = `${this.min}`; + } + this.validate(); + } + maxChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.max = `${this.max}`; + } + this.validate(); + } + stepChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.step = `${this.step}`; + } + this.updateStepMultiplier(); + this.validate(); + } + orientationChanged() { + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "range"); + this.direction = getDirection(this); + this.updateStepMultiplier(); + this.setupTrackConstraints(); + this.setupListeners(); + this.setupDefaultValue(); + this.setThumbPositionForOrientation(this.direction); + } + /** + * @internal + */ + disconnectedCallback() { + this.setupListeners(true); + } + /** + * Increment the value by the step + * + * @public + */ + increment() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step); + const incrementedVal = this.convertToConstrainedValue(newVal); + const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`; + this.value = incrementedValString; + } + /** + * Decrement the value by the step + * + * @public + */ + decrement() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step); + const decrementedVal = this.convertToConstrainedValue(newVal); + const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`; + this.value = decrementedValString; + } + /** + * Places the thumb based on the current value + * + * @public + * @param direction - writing mode + */ + setThumbPositionForOrientation(direction) { + const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction); + const percentage = (1 - newPct) * 100; + if (this.orientation === Orientation.horizontal) { + this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`; + } else { + this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`; + } + } + /** + * Update the step multiplier used to ensure rounding errors from steps that + * are not whole numbers + */ + updateStepMultiplier() { + const stepString = this.step + ""; + const decimalPlacesOfStep = !!(this.step % 1) ? stepString.length - stepString.indexOf(".") - 1 : 0; + this.stepMultiplier = Math.pow(10, decimalPlacesOfStep); + } + get midpoint() { + return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`; + } + setupDefaultValue() { + if (typeof this.value === "string") { + if (this.value.length === 0) { + this.initialValue = this.midpoint; + } else { + const value = parseFloat(this.value); + if (!Number.isNaN(value) && (value < this.min || value > this.max)) { + this.value = this.midpoint; + } + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Slider.prototype, "readOnly", void 0); + __decorate([ + observable + ], Slider.prototype, "direction", void 0); + __decorate([ + observable + ], Slider.prototype, "isDragging", void 0); + __decorate([ + observable + ], Slider.prototype, "position", void 0); + __decorate([ + observable + ], Slider.prototype, "trackWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "trackLeft", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "valueTextFormatter", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "step", void 0); + __decorate([ + attr + ], Slider.prototype, "orientation", void 0); + __decorate([ + attr + ], Slider.prototype, "mode", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js + var init_slider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js"() { + init_slider_template(); + init_slider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js + var init_switch_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js + var _Switch, FormAssociatedSwitch; + var init_switch_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Switch = class extends FoundationElement { + }; + FormAssociatedSwitch = class extends CheckableFormAssociated(_Switch) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js + var Switch; + var init_switch = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_switch_form_associated(); + Switch = class extends FormAssociatedSwitch { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + this.readOnly ? this.classList.add("readonly") : this.classList.remove("readonly"); + } + /** + * @internal + */ + checkedChanged(prev, next) { + super.checkedChanged(prev, next); + this.checked ? this.classList.add("checked") : this.classList.remove("checked"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Switch.prototype, "readOnly", void 0); + __decorate([ + observable + ], Switch.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js + var init_switch2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js"() { + init_switch_template(); + init_switch(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js + var tabPanelTemplate; + var init_tab_panel_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js"() { + init_esm(); + tabPanelTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js + var TabPanel; + var init_tab_panel = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js"() { + init_foundation_element(); + TabPanel = class extends FoundationElement { + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js + var init_tab_panel2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js"() { + init_tab_panel_template(); + init_tab_panel(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js + var tabTemplate; + var init_tab_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js"() { + init_esm(); + tabTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js + var Tab; + var init_tab = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Tab = class extends FoundationElement { + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tab.prototype, "disabled", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js + var init_tab2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js"() { + init_tab_template(); + init_tab(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js + var tabsTemplate; + var init_tabs_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js"() { + init_esm(); + init_start_end(); + tabsTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js + var TabsOrientation, Tabs; + var init_tabs = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TabsOrientation = { + vertical: "vertical", + horizontal: "horizontal" + }; + Tabs = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = TabsOrientation.horizontal; + this.activeindicator = true; + this.showActiveIndicator = true; + this.prevActiveTabIndex = 0; + this.activeTabIndex = 0; + this.ticking = false; + this.change = () => { + this.$emit("change", this.activetab); + }; + this.isDisabledElement = (el) => { + return el.getAttribute("aria-disabled") === "true"; + }; + this.isHiddenElement = (el) => { + return el.hasAttribute("hidden"); + }; + this.isFocusableElement = (el) => { + return !this.isDisabledElement(el) && !this.isHiddenElement(el); + }; + this.setTabs = () => { + const gridHorizontalProperty = "gridColumn"; + const gridVerticalProperty = "gridRow"; + const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty; + this.activeTabIndex = this.getActiveIndex(); + this.showActiveIndicator = false; + this.tabs.forEach((tab, index) => { + if (tab.slot === "tab") { + const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab); + if (this.activeindicator && this.isFocusableElement(tab)) { + this.showActiveIndicator = true; + } + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tab.setAttribute("id", tabId); + tab.setAttribute("aria-selected", isActiveTab ? "true" : "false"); + tab.setAttribute("aria-controls", tabpanelId); + tab.addEventListener("click", this.handleTabClick); + tab.addEventListener("keydown", this.handleTabKeyDown); + tab.setAttribute("tabindex", isActiveTab ? "0" : "-1"); + if (isActiveTab) { + this.activetab = tab; + this.activeid = tabId; + } + } + tab.style[gridHorizontalProperty] = ""; + tab.style[gridVerticalProperty] = ""; + tab.style[gridProperty] = `${index + 1}`; + !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical"); + }); + }; + this.setTabPanels = () => { + this.tabpanels.forEach((tabpanel, index) => { + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tabpanel.setAttribute("id", tabpanelId); + tabpanel.setAttribute("aria-labelledby", tabId); + this.activeTabIndex !== index ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden"); + }); + }; + this.handleTabClick = (event) => { + const selectedTab = event.currentTarget; + if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) { + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = this.tabs.indexOf(selectedTab); + this.setComponent(); + } + }; + this.handleTabKeyDown = (event) => { + if (this.isHorizontal()) { + switch (event.key) { + case keyArrowLeft: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowRight: + event.preventDefault(); + this.adjustForward(event); + break; + } + } else { + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowDown: + event.preventDefault(); + this.adjustForward(event); + break; + } + } + switch (event.key) { + case keyHome: + event.preventDefault(); + this.adjust(-this.activeTabIndex); + break; + case keyEnd: + event.preventDefault(); + this.adjust(this.tabs.length - this.activeTabIndex - 1); + break; + } + }; + this.adjustForward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) + 1 : 1; + if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (this.activetab && index === group.indexOf(this.activetab)) { + break; + } else if (index + 1 >= group.length) { + index = 0; + } else { + index += 1; + } + } + }; + this.adjustBackward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + while (index >= 0 && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.moveToTabByIndex = (group, index) => { + const tab = group[index]; + this.activetab = tab; + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = index; + tab.focus(); + this.setComponent(); + }; + } + /** + * @internal + */ + orientationChanged() { + if (this.$fastController.isConnected) { + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + activeidChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabsChanged() { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabpanelsChanged() { + if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + getActiveIndex() { + const id = this.activeid; + if (id !== void 0) { + return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid); + } else { + return 0; + } + } + getTabIds() { + return this.tabs.map((tab) => { + var _a; + return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`; + }); + } + getTabPanelIds() { + return this.tabpanels.map((tabPanel) => { + var _a; + return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`; + }); + } + setComponent() { + if (this.activeTabIndex !== this.prevActiveTabIndex) { + this.activeid = this.tabIds[this.activeTabIndex]; + this.focusTab(); + this.change(); + } + } + isHorizontal() { + return this.orientation === TabsOrientation.horizontal; + } + handleActiveIndicatorPosition() { + if (this.showActiveIndicator && this.activeindicator && this.activeTabIndex !== this.prevActiveTabIndex) { + if (this.ticking) { + this.ticking = false; + } else { + this.ticking = true; + this.animateActiveIndicator(); + } + } + } + animateActiveIndicator() { + this.ticking = true; + const gridProperty = this.isHorizontal() ? "gridColumn" : "gridRow"; + const translateProperty = this.isHorizontal() ? "translateX" : "translateY"; + const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop"; + const prev = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + const next = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const dif = next - prev; + this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; + this.activeIndicatorRef.classList.add("activeIndicatorTransition"); + this.activeIndicatorRef.addEventListener("transitionend", () => { + this.ticking = false; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`; + this.activeIndicatorRef.classList.remove("activeIndicatorTransition"); + }); + } + /** + * The adjust method for FASTTabs + * @public + * @remarks + * This method allows the active index to be adjusted by numerical increments + */ + adjust(adjustment) { + const focusableTabs = this.tabs.filter((t) => this.isFocusableElement(t)); + const currentActiveTabIndex = focusableTabs.indexOf(this.activetab); + const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment); + const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]); + if (nextIndex > -1) { + this.moveToTabByIndex(this.tabs, nextIndex); + } + } + focusTab() { + this.tabs[this.activeTabIndex].focus(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.activeTabIndex = this.getActiveIndex(); + } + }; + __decorate([ + attr + ], Tabs.prototype, "orientation", void 0); + __decorate([ + attr + ], Tabs.prototype, "activeid", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabs", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabpanels", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Tabs.prototype, "activeindicator", void 0); + __decorate([ + observable + ], Tabs.prototype, "activeIndicatorRef", void 0); + __decorate([ + observable + ], Tabs.prototype, "showActiveIndicator", void 0); + applyMixins(Tabs, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js + var init_tabs2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js"() { + init_tabs_template(); + init_tabs(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js + var _TextArea, FormAssociatedTextArea; + var init_text_area_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextArea = class extends FoundationElement { + }; + FormAssociatedTextArea = class extends FormAssociated(_TextArea) { + constructor() { + super(...arguments); + this.proxy = document.createElement("textarea"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js + var TextAreaResize; + var init_text_area_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js"() { + TextAreaResize = { + /** + * No resize. + */ + none: "none", + /** + * Resize vertically and horizontally. + */ + both: "both", + /** + * Resize horizontally. + */ + horizontal: "horizontal", + /** + * Resize vertically. + */ + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js + var TextArea; + var init_text_area = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js"() { + init_tslib_es6(); + init_esm(); + init_text_field(); + init_apply_mixins(); + init_text_area_form_associated(); + init_text_area_options(); + TextArea = class extends FormAssociatedTextArea { + constructor() { + super(...arguments); + this.resize = TextAreaResize.none; + this.cols = 20; + this.handleTextInput = () => { + this.value = this.control.value; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.readOnly = this.readOnly; + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.autofocus = this.autofocus; + } + } + listChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.setAttribute("list", this.list); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.maxLength = this.maxlength; + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.minLength = this.minlength; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * Selects all the text in the text area + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "readOnly", void 0); + __decorate([ + attr + ], TextArea.prototype, "resize", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], TextArea.prototype, "formId", void 0); + __decorate([ + attr + ], TextArea.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "minlength", void 0); + __decorate([ + attr + ], TextArea.prototype, "name", void 0); + __decorate([ + attr + ], TextArea.prototype, "placeholder", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "cols", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "rows", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextArea.prototype, "defaultSlottedNodes", void 0); + applyMixins(TextArea, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js + var textAreaTemplate; + var init_text_area_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js"() { + init_esm(); + init_text_area(); + textAreaTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js + var init_text_area2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js"() { + init_text_area_template(); + init_text_area(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js + var textFieldTemplate; + var init_text_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js"() { + init_esm(); + init_start_end(); + init_whitespace_filter(); + textFieldTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js + var init_text_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js"() { + init_text_field_template(); + init_text_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js + var init_toolbar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js + function getRootActiveElement(element) { + const rootNode = element.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.activeElement; + } + return document.activeElement; + } + var init_root_active_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js + var ToolbarArrowKeyMap, Toolbar, DelegatesARIAToolbar; + var init_toolbar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + init_direction(); + init_root_active_element(); + ToolbarArrowKeyMap = Object.freeze({ + [ArrowKeys.ArrowUp]: { + [Orientation.vertical]: -1 + }, + [ArrowKeys.ArrowDown]: { + [Orientation.vertical]: 1 + }, + [ArrowKeys.ArrowLeft]: { + [Orientation.horizontal]: { + [Direction.ltr]: -1, + [Direction.rtl]: 1 + } + }, + [ArrowKeys.ArrowRight]: { + [Orientation.horizontal]: { + [Direction.ltr]: 1, + [Direction.rtl]: -1 + } + } + }); + Toolbar = class _Toolbar extends FoundationElement { + constructor() { + super(...arguments); + this._activeIndex = 0; + this.direction = Direction.ltr; + this.orientation = Orientation.horizontal; + } + /** + * The index of the currently focused element, clamped between 0 and the last element. + * + * @internal + */ + get activeIndex() { + Observable.track(this, "activeIndex"); + return this._activeIndex; + } + set activeIndex(value) { + if (this.$fastController.isConnected) { + this._activeIndex = limit(0, this.focusableElements.length - 1, value); + Observable.notify(this, "activeIndex"); + } + } + slottedItemsChanged() { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * Set the activeIndex when a focusable element in the toolbar is clicked. + * + * @internal + */ + mouseDownHandler(e) { + var _a; + const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.findIndex((x) => x.contains(e.target)); + if (activeIndex > -1 && this.activeIndex !== activeIndex) { + this.setFocusedElement(activeIndex); + } + return true; + } + childItemsChanged(prev, next) { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + } + /** + * When the toolbar receives focus, set the currently active element as focused. + * + * @internal + */ + focusinHandler(e) { + const relatedTarget = e.relatedTarget; + if (!relatedTarget || this.contains(relatedTarget)) { + return; + } + this.setFocusedElement(); + } + /** + * Determines a value that can be used to iterate a list with the arrow keys. + * + * @param this - An element with an orientation and direction + * @param key - The event key value + * @internal + */ + getDirectionalIncrementer(key) { + var _a, _b, _c, _d, _e; + return (_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0; + } + /** + * Handle keyboard events for the toolbar. + * + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) { + return true; + } + const incrementer = this.getDirectionalIncrementer(key); + if (!incrementer) { + return !e.target.closest("[role=radiogroup]"); + } + const nextIndex = this.activeIndex + incrementer; + if (this.focusableElements[nextIndex]) { + e.preventDefault(); + } + this.setFocusedElement(nextIndex); + return true; + } + /** + * get all the slotted elements + * @internal + */ + get allSlottedItems() { + return [ + ...this.start.assignedElements(), + ...this.slottedItems, + ...this.end.assignedElements() + ]; + } + /** + * Prepare the slotted elements which can be focusable. + * + * @internal + */ + reduceFocusableElements() { + var _a; + const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex]; + this.focusableElements = this.allSlottedItems.reduce(_Toolbar.reduceFocusableItems, []); + const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement); + this.activeIndex = Math.max(0, adjustedActiveIndex); + this.setFocusableElements(); + } + /** + * Set the activeIndex and focus the corresponding control. + * + * @param activeIndex - The new index to set + * @internal + */ + setFocusedElement(activeIndex = this.activeIndex) { + this.activeIndex = activeIndex; + this.setFocusableElements(); + if (this.focusableElements[this.activeIndex] && // Don't focus the toolbar element if some event handlers moved + // the focus on another element in the page. + this.contains(getRootActiveElement(this))) { + this.focusableElements[this.activeIndex].focus(); + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceFocusableItems(elements2, element) { + var _a, _b, _c, _d; + const isRoleRadio = element.getAttribute("role") === "radio"; + const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus; + const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some((x) => isFocusable(x)); + if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Toolbar.reduceFocusableItems, [])); + } + return elements2; + } + /** + * @internal + */ + setFocusableElements() { + if (this.$fastController.isConnected && this.focusableElements.length > 0) { + this.focusableElements.forEach((element, index) => { + element.tabIndex = this.activeIndex === index ? 0 : -1; + }); + } + } + }; + __decorate([ + observable + ], Toolbar.prototype, "direction", void 0); + __decorate([ + attr + ], Toolbar.prototype, "orientation", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedItems", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedLabel", void 0); + __decorate([ + observable + ], Toolbar.prototype, "childItems", void 0); + DelegatesARIAToolbar = class { + }; + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], DelegatesARIAToolbar.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], DelegatesARIAToolbar.prototype, "ariaLabel", void 0); + applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties); + applyMixins(Toolbar, StartEnd, DelegatesARIAToolbar); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js + var init_toolbar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js"() { + init_toolbar_template(); + init_toolbar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js + var init_tooltip_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js + var TooltipPosition; + var init_tooltip_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js"() { + TooltipPosition = { + /** + * The tooltip is positioned above the element + */ + top: "top", + /** + * The tooltip is positioned to the right of the element + */ + right: "right", + /** + * The tooltip is positioned below the element + */ + bottom: "bottom", + /** + * The tooltip is positioned to the left of the element + */ + left: "left", + /** + * The tooltip is positioned before the element + */ + start: "start", + /** + * The tooltip is positioned after the element + */ + end: "end", + /** + * The tooltip is positioned above the element and to the left + */ + topLeft: "top-left", + /** + * The tooltip is positioned above the element and to the right + */ + topRight: "top-right", + /** + * The tooltip is positioned below the element and to the left + */ + bottomLeft: "bottom-left", + /** + * The tooltip is positioned below the element and to the right + */ + bottomRight: "bottom-right", + /** + * The tooltip is positioned above the element and to the left + */ + topStart: "top-start", + /** + * The tooltip is positioned above the element and to the right + */ + topEnd: "top-end", + /** + * The tooltip is positioned below the element and to the left + */ + bottomStart: "bottom-start", + /** + * The tooltip is positioned below the element and to the right + */ + bottomEnd: "bottom-end" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js + var Tooltip; + var init_tooltip = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + init_tooltip_options(); + Tooltip = class extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.delay = 300; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.horizontalInset = "false"; + this.verticalInset = "false"; + this.horizontalScaling = "content"; + this.verticalScaling = "content"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = void 0; + this.tooltipVisible = false; + this.currentDirection = Direction.ltr; + this.showDelayTimer = null; + this.hideDelayTimer = null; + this.isAnchorHoveredFocused = false; + this.isRegionHovered = false; + this.handlePositionChange = (ev) => { + this.classList.toggle("top", this.region.verticalPosition === "start"); + this.classList.toggle("bottom", this.region.verticalPosition === "end"); + this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd"); + this.classList.toggle("center-vertical", this.region.verticalPosition === "center"); + this.classList.toggle("left", this.region.horizontalPosition === "start"); + this.classList.toggle("right", this.region.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd"); + this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center"); + }; + this.handleRegionMouseOver = (ev) => { + this.isRegionHovered = true; + }; + this.handleRegionMouseOut = (ev) => { + this.isRegionHovered = false; + this.startHideDelayTimer(); + }; + this.handleAnchorMouseOver = (ev) => { + if (this.tooltipVisible) { + this.isAnchorHoveredFocused = true; + return; + } + this.startShowDelayTimer(); + }; + this.handleAnchorMouseOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.handleAnchorFocusIn = (ev) => { + this.startShowDelayTimer(); + }; + this.handleAnchorFocusOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.startHideDelayTimer = () => { + this.clearHideDelayTimer(); + if (!this.tooltipVisible) { + return; + } + this.hideDelayTimer = window.setTimeout(() => { + this.updateTooltipVisibility(); + }, 60); + }; + this.clearHideDelayTimer = () => { + if (this.hideDelayTimer !== null) { + clearTimeout(this.hideDelayTimer); + this.hideDelayTimer = null; + } + }; + this.startShowDelayTimer = () => { + if (this.isAnchorHoveredFocused) { + return; + } + if (this.delay > 1) { + if (this.showDelayTimer === null) + this.showDelayTimer = window.setTimeout(() => { + this.startHover(); + }, this.delay); + return; + } + this.startHover(); + }; + this.startHover = () => { + this.isAnchorHoveredFocused = true; + this.updateTooltipVisibility(); + }; + this.clearShowDelayTimer = () => { + if (this.showDelayTimer !== null) { + clearTimeout(this.showDelayTimer); + this.showDelayTimer = null; + } + }; + this.getAnchor = () => { + const rootNode = this.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.getElementById(this.anchor); + } + return document.getElementById(this.anchor); + }; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && this.tooltipVisible) { + switch (e.key) { + case keyEscape: + this.isAnchorHoveredFocused = false; + this.updateTooltipVisibility(); + this.$emit("dismiss"); + break; + } + } + }; + this.updateTooltipVisibility = () => { + if (this.visible === false) { + this.hideTooltip(); + } else if (this.visible === true) { + this.showTooltip(); + return; + } else { + if (this.isAnchorHoveredFocused || this.isRegionHovered) { + this.showTooltip(); + return; + } + this.hideTooltip(); + } + }; + this.showTooltip = () => { + if (this.tooltipVisible) { + return; + } + this.currentDirection = getDirection(this); + this.tooltipVisible = true; + document.addEventListener("keydown", this.handleDocumentKeydown); + DOM.queueUpdate(this.setRegionProps); + }; + this.hideTooltip = () => { + if (!this.tooltipVisible) { + return; + } + this.clearHideDelayTimer(); + if (this.region !== null && this.region !== void 0) { + this.region.removeEventListener("positionchange", this.handlePositionChange); + this.region.viewportElement = null; + this.region.anchorElement = null; + this.region.removeEventListener("mouseover", this.handleRegionMouseOver); + this.region.removeEventListener("mouseout", this.handleRegionMouseOut); + } + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.tooltipVisible = false; + }; + this.setRegionProps = () => { + if (!this.tooltipVisible) { + return; + } + this.region.viewportElement = this.viewportElement; + this.region.anchorElement = this.anchorElement; + this.region.addEventListener("positionchange", this.handlePositionChange); + this.region.addEventListener("mouseover", this.handleRegionMouseOver, { + passive: true + }); + this.region.addEventListener("mouseout", this.handleRegionMouseOut, { + passive: true + }); + }; + } + visibleChanged() { + if (this.$fastController.isConnected) { + this.updateTooltipVisibility(); + this.updateLayout(); + } + } + anchorChanged() { + if (this.$fastController.isConnected) { + this.anchorElement = this.getAnchor(); + } + } + positionChanged() { + if (this.$fastController.isConnected) { + this.updateLayout(); + } + } + anchorElementChanged(oldValue) { + if (this.$fastController.isConnected) { + if (oldValue !== null && oldValue !== void 0) { + oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver); + oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut); + oldValue.removeEventListener("focusin", this.handleAnchorFocusIn); + oldValue.removeEventListener("focusout", this.handleAnchorFocusOut); + } + if (this.anchorElement !== null && this.anchorElement !== void 0) { + this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true }); + this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true }); + this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, { + passive: true + }); + this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true }); + const anchorId = this.anchorElement.id; + if (this.anchorElement.parentElement !== null) { + this.anchorElement.parentElement.querySelectorAll(":hover").forEach((element) => { + if (element.id === anchorId) { + this.startShowDelayTimer(); + } + }); + } + } + if (this.region !== null && this.region !== void 0 && this.tooltipVisible) { + this.region.anchorElement = this.anchorElement; + } + this.updateLayout(); + } + } + viewportElementChanged() { + if (this.region !== null && this.region !== void 0) { + this.region.viewportElement = this.viewportElement; + } + this.updateLayout(); + } + connectedCallback() { + super.connectedCallback(); + this.anchorElement = this.getAnchor(); + this.updateTooltipVisibility(); + } + disconnectedCallback() { + this.hideTooltip(); + this.clearShowDelayTimer(); + this.clearHideDelayTimer(); + super.disconnectedCallback(); + } + /** + * updated the properties being passed to the anchored region + */ + updateLayout() { + this.verticalPositioningMode = "locktodefault"; + this.horizontalPositioningMode = "locktodefault"; + switch (this.position) { + case TooltipPosition.top: + case TooltipPosition.bottom: + this.verticalDefaultPosition = this.position; + this.horizontalDefaultPosition = "center"; + break; + case TooltipPosition.right: + case TooltipPosition.left: + case TooltipPosition.start: + case TooltipPosition.end: + this.verticalDefaultPosition = "center"; + this.horizontalDefaultPosition = this.position; + break; + case TooltipPosition.topLeft: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.topRight: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.bottomLeft: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.bottomRight: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.topStart: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.topEnd: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "end"; + break; + case TooltipPosition.bottomStart: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.bottomEnd: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "end"; + break; + default: + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = "center"; + break; + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tooltip.prototype, "visible", void 0); + __decorate([ + attr + ], Tooltip.prototype, "anchor", void 0); + __decorate([ + attr + ], Tooltip.prototype, "delay", void 0); + __decorate([ + attr + ], Tooltip.prototype, "position", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], Tooltip.prototype, "autoUpdateMode", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock" }) + ], Tooltip.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock" }) + ], Tooltip.prototype, "verticalViewportLock", void 0); + __decorate([ + observable + ], Tooltip.prototype, "anchorElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "viewportElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "tooltipVisible", void 0); + __decorate([ + observable + ], Tooltip.prototype, "currentDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js + var init_tooltip2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js"() { + init_tooltip_template(); + init_tooltip(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js + var init_tree_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js + function isTreeItemElement(el) { + return isHTMLElement(el) && el.getAttribute("role") === "treeitem"; + } + var TreeItem; + var init_tree_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TreeItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.expanded = false; + this.focusable = false; + this.isNestedItem = () => { + return isTreeItemElement(this.parentElement); + }; + this.handleExpandCollapseButtonClick = (e) => { + if (!this.disabled && !e.defaultPrevented) { + this.expanded = !this.expanded; + } + }; + this.handleFocus = (e) => { + this.setAttribute("tabindex", "0"); + }; + this.handleBlur = (e) => { + this.setAttribute("tabindex", "-1"); + }; + } + expandedChanged() { + if (this.$fastController.isConnected) { + this.$emit("expanded-change", this); + } + } + selectedChanged() { + if (this.$fastController.isConnected) { + this.$emit("selected-change", this); + } + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.items.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = true; + } + }); + } + } + /** + * Places document focus on a tree item + * + * @public + * @param el - the element to focus + */ + static focusItem(el) { + el.focusable = true; + el.focus(); + } + /** + * Gets number of children + * + * @internal + */ + childItemLength() { + const treeChildren = this.childItems.filter((item) => { + return isTreeItemElement(item); + }); + return treeChildren ? treeChildren.length : 0; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "expanded", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "selected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "disabled", void 0); + __decorate([ + observable + ], TreeItem.prototype, "focusable", void 0); + __decorate([ + observable + ], TreeItem.prototype, "childItems", void 0); + __decorate([ + observable + ], TreeItem.prototype, "items", void 0); + __decorate([ + observable + ], TreeItem.prototype, "nested", void 0); + __decorate([ + observable + ], TreeItem.prototype, "renderCollapsedChildren", void 0); + applyMixins(TreeItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js + var init_tree_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js"() { + init_tree_item_template(); + init_tree_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js + var init_tree_view_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js + var TreeView; + var init_tree_view = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_tree_item(); + init_foundation_element(); + TreeView = class extends FoundationElement { + constructor() { + super(...arguments); + this.currentFocused = null; + this.handleFocus = (e) => { + if (this.slottedTreeItems.length < 1) { + return; + } + if (e.target === this) { + if (this.currentFocused === null) { + this.currentFocused = this.getValidFocusableItem(); + } + if (this.currentFocused !== null) { + TreeItem.focusItem(this.currentFocused); + } + return; + } + if (this.contains(e.target)) { + this.setAttribute("tabindex", "-1"); + this.currentFocused = e.target; + } + }; + this.handleBlur = (e) => { + if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) { + this.setAttribute("tabindex", "0"); + } + }; + this.handleKeyDown = (e) => { + if (e.defaultPrevented) { + return; + } + if (this.slottedTreeItems.length < 1) { + return true; + } + const treeItems = this.getVisibleNodes(); + switch (e.key) { + case keyHome: + if (treeItems.length) { + TreeItem.focusItem(treeItems[0]); + } + return; + case keyEnd: + if (treeItems.length) { + TreeItem.focusItem(treeItems[treeItems.length - 1]); + } + return; + case keyArrowLeft: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) { + item.expanded = false; + } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) { + TreeItem.focusItem(item.parentElement); + } + } + return false; + case keyArrowRight: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) { + item.expanded = true; + } else if (item instanceof TreeItem && item.childItemLength() > 0) { + this.focusNextNode(1, e.target); + } + } + return; + case keyArrowDown: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(1, e.target); + } + return; + case keyArrowUp: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(-1, e.target); + } + return; + case keyEnter: + this.handleClick(e); + return; + } + return true; + }; + this.handleSelectedChange = (e) => { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (item.selected) { + if (this.currentSelected && this.currentSelected !== item) { + this.currentSelected.selected = false; + } + this.currentSelected = item; + } else if (!item.selected && this.currentSelected === item) { + this.currentSelected = null; + } + return; + }; + this.setItems = () => { + const selectedItem = this.treeView.querySelector("[aria-selected='true']"); + this.currentSelected = selectedItem; + if (this.currentFocused === null || !this.contains(this.currentFocused)) { + this.currentFocused = this.getValidFocusableItem(); + } + this.nested = this.checkForNestedItems(); + const treeItems = this.getVisibleNodes(); + treeItems.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = this.nested; + } + }); + }; + this.isFocusableElement = (el) => { + return isTreeItemElement(el); + }; + this.isSelectedElement = (el) => { + return el.selected; + }; + } + slottedTreeItemsChanged() { + if (this.$fastController.isConnected) { + this.setItems(); + } + } + connectedCallback() { + super.connectedCallback(); + this.setAttribute("tabindex", "0"); + DOM.queueUpdate(() => { + this.setItems(); + }); + } + /** + * Handles click events bubbling up + * + * @internal + */ + handleClick(e) { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (!item.disabled) { + item.selected = !item.selected; + } + return; + } + /** + * Move focus to a tree item based on its offset from the provided item + */ + focusNextNode(delta, item) { + const visibleNodes = this.getVisibleNodes(); + if (!visibleNodes) { + return; + } + const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta]; + if (isHTMLElement(focusItem)) { + TreeItem.focusItem(focusItem); + } + } + /** + * checks if there are any nested tree items + */ + getValidFocusableItem() { + const treeItems = this.getVisibleNodes(); + let focusIndex = treeItems.findIndex(this.isSelectedElement); + if (focusIndex === -1) { + focusIndex = treeItems.findIndex(this.isFocusableElement); + } + if (focusIndex !== -1) { + return treeItems[focusIndex]; + } + return null; + } + /** + * checks if there are any nested tree items + */ + checkForNestedItems() { + return this.slottedTreeItems.some((node) => { + return isTreeItemElement(node) && node.querySelector("[role='treeitem']"); + }); + } + getVisibleNodes() { + return getDisplayedNodes(this, "[role='treeitem']") || []; + } + }; + __decorate([ + attr({ attribute: "render-collapsed-nodes" }) + ], TreeView.prototype, "renderCollapsedNodes", void 0); + __decorate([ + observable + ], TreeView.prototype, "currentSelected", void 0); + __decorate([ + observable + ], TreeView.prototype, "slottedTreeItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js + var init_tree_view2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js"() { + init_tree_view_template(); + init_tree_view(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js + var MatchMediaBehavior, MatchMediaStyleSheetBehavior, forcedColorsStylesheetBehavior, darkModeStylesheetBehavior, lightModeStylesheetBehavior; + var init_match_media_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js"() { + MatchMediaBehavior = class { + /** + * + * @param query - The media query to operate from. + */ + constructor(query) { + this.listenerCache = /* @__PURE__ */ new WeakMap(); + this.query = query; + } + /** + * Binds the behavior to the element. + * @param source - The element for which the behavior is bound. + */ + bind(source) { + const { query } = this; + const listener = this.constructListener(source); + listener.bind(query)(); + query.addListener(listener); + this.listenerCache.set(source, listener); + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + */ + unbind(source) { + const listener = this.listenerCache.get(source); + if (listener) { + this.query.removeListener(listener); + this.listenerCache.delete(source); + } + } + }; + MatchMediaStyleSheetBehavior = class _MatchMediaStyleSheetBehavior extends MatchMediaBehavior { + /** + * Constructs a {@link MatchMediaStyleSheetBehavior} instance. + * @param query - The media query to operate from. + * @param styles - The styles to coordinate with the query. + */ + constructor(query, styles) { + super(query); + this.styles = styles; + } + /** + * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for + * a provided query. + * @param query - The media query to operate from. + * + * @public + * @example + * + * ```ts + * import { css } from "@microsoft/fast-element"; + * import { MatchMediaStyleSheetBehavior } from "@microsoft/fast-foundation"; + * + * const landscapeBehavior = MatchMediaStyleSheetBehavior.with( + * window.matchMedia("(orientation: landscape)") + * ); + * const styles = css` + * :host { + * width: 200px; + * height: 400px; + * } + * ` + * .withBehaviors(landscapeBehavior(css` + * :host { + * width: 400px; + * height: 200px; + * } + * `)) + * ``` + */ + static with(query) { + return (styles) => { + return new _MatchMediaStyleSheetBehavior(query, styles); + }; + } + /** + * Constructs a match-media listener for a provided element. + * @param source - the element for which to attach or detach styles. + * @internal + */ + constructListener(source) { + let attached = false; + const styles = this.styles; + return function listener() { + const { matches: matches2 } = this; + if (matches2 && !attached) { + source.$fastController.addStyles(styles); + attached = matches2; + } else if (!matches2 && attached) { + source.$fastController.removeStyles(styles); + attached = matches2; + } + }; + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + * @internal + */ + unbind(source) { + super.unbind(source); + source.$fastController.removeStyles(this.styles); + } + }; + forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)")); + darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)")); + lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)")); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js + var init_property_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js + var disabledCursor; + var init_disabled = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js"() { + disabledCursor = "not-allowed"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js + function display(displayValue) { + return `${hidden}:host{display:${displayValue}}`; + } + var hidden; + var init_display = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js"() { + hidden = `:host([hidden]){display:none}`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js + var focusVisible; + var init_focus = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js"() { + init_dist2(); + focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js + var init_style = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js"() { + init_disabled(); + init_display(); + init_focus(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js + var init_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js"() { + init_apply_mixins(); + init_composed_parent(); + init_match_media_stylesheet_behavior(); + init_property_stylesheet_behavior(); + init_style(); + init_direction(); + init_whitespace_filter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/index.js + var init_esm2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/index.js"() { + init_accordion_item2(); + init_accordion2(); + init_anchor2(); + init_anchored_region2(); + init_avatar2(); + init_badge2(); + init_breadcrumb_item2(); + init_breadcrumb2(); + init_button2(); + init_calendar2(); + init_card2(); + init_checkbox2(); + init_combobox2(); + init_data_grid2(); + init_design_system2(); + init_design_token(); + init_di2(); + init_dialog2(); + init_disclosure2(); + init_divider2(); + init_flipper2(); + init_form_associated2(); + init_foundation_element2(); + init_listbox_option2(); + init_listbox2(); + init_picker2(); + init_menu_item2(); + init_menu2(); + init_number_field2(); + init_patterns(); + init_progress_ring(); + init_progress(); + init_radio_group2(); + init_radio2(); + init_horizontal_scroll2(); + init_search2(); + init_select2(); + init_skeleton2(); + init_slider_label2(); + init_slider2(); + init_switch2(); + init_tab_panel2(); + init_tab2(); + init_tabs2(); + init_text_area2(); + init_text_field2(); + init_toolbar2(); + init_tooltip2(); + init_tree_item2(); + init_tree_view2(); + init_utilities(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js + function provideVSCodeDesignSystem(element) { + return DesignSystem.getOrCreate(element).withPrefix("vscode"); + } + var init_vscode_design_system = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js"() { + init_esm2(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js + function initThemeChangeListener(tokenMappings2) { + window.addEventListener("load", () => { + const observer = new MutationObserver(() => { + applyCurrentTheme(tokenMappings2); + }); + observer.observe(document.body, { + attributes: true, + attributeFilter: ["class"] + }); + applyCurrentTheme(tokenMappings2); + }); + } + function applyCurrentTheme(tokenMappings2) { + const styles = getComputedStyle(document.body); + const body = document.querySelector("body"); + if (body) { + const themeKind = body.getAttribute("data-vscode-theme-kind"); + for (const [vscodeTokenName, toolkitToken] of tokenMappings2) { + let value = styles.getPropertyValue(vscodeTokenName).toString(); + if (themeKind === "vscode-high-contrast") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + value = "transparent"; + } + if (toolkitToken.name === "button-icon-hover-background") { + value = "transparent"; + } + } else if (themeKind === "vscode-high-contrast-light") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + switch (toolkitToken.name) { + case "button-primary-hover-background": + value = "#0F4A85"; + break; + case "button-secondary-hover-background": + value = "transparent"; + break; + case "button-icon-hover-background": + value = "transparent"; + break; + } + } + } else { + if (toolkitToken.name === "contrast-active-border") { + value = "transparent"; + } + } + toolkitToken.setValueFor(body, value); + } + } + } + var init_applyTheme = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js + function create2(name, vscodeThemeVar) { + const designToken = DesignToken.create(name); + if (vscodeThemeVar) { + if (vscodeThemeVar.includes("--fake-vscode-token")) { + const uniqueId2 = "id" + Math.random().toString(16).slice(2); + vscodeThemeVar = `${vscodeThemeVar}-${uniqueId2}`; + } + tokenMappings.set(vscodeThemeVar, designToken); + } + if (!isThemeListenerInitialized) { + initThemeChangeListener(tokenMappings); + isThemeListenerInitialized = true; + } + return designToken; + } + var tokenMappings, isThemeListenerInitialized; + var init_create = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js"() { + init_esm2(); + init_applyTheme(); + tokenMappings = /* @__PURE__ */ new Map(); + isThemeListenerInitialized = false; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js + var background, borderWidth, contrastActiveBorder, contrastBorder, cornerRadius, cornerRadiusRound, designUnit, disabledOpacity, focusBorder, fontFamily, fontWeight, foreground, inputHeight, inputMinWidth, typeRampBaseFontSize, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1LineHeight, scrollbarWidth, scrollbarHeight, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, badgeBackground, badgeForeground, buttonBorder, buttonIconBackground, buttonIconCornerRadius, buttonIconFocusBorderOffset, buttonIconHoverBackground, buttonIconPadding, buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonPaddingHorizontal, buttonPaddingVertical, checkboxBackground, checkboxBorder, checkboxCornerRadius, checkboxForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, dividerBackground, dropdownBackground, dropdownBorder, dropdownForeground, dropdownListMaxHeight, inputBackground, inputForeground, inputPlaceholderForeground, linkActiveForeground, linkForeground, progressBackground, panelTabActiveBorder, panelTabActiveForeground, panelTabForeground, panelViewBackground, panelViewBorder, tagCornerRadius; + var init_design_tokens = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js"() { + init_create(); + background = create2("background", "--vscode-editor-background").withDefault("#1e1e1e"); + borderWidth = create2("border-width").withDefault(1); + contrastActiveBorder = create2("contrast-active-border", "--vscode-contrastActiveBorder").withDefault("#f38518"); + contrastBorder = create2("contrast-border", "--vscode-contrastBorder").withDefault("#6fc3df"); + cornerRadius = create2("corner-radius").withDefault(0); + cornerRadiusRound = create2("corner-radius-round").withDefault(2); + designUnit = create2("design-unit").withDefault(4); + disabledOpacity = create2("disabled-opacity").withDefault(0.4); + focusBorder = create2("focus-border", "--vscode-focusBorder").withDefault("#007fd4"); + fontFamily = create2("font-family", "--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"); + fontWeight = create2("font-weight", "--vscode-font-weight").withDefault("400"); + foreground = create2("foreground", "--vscode-foreground").withDefault("#cccccc"); + inputHeight = create2("input-height").withDefault("26"); + inputMinWidth = create2("input-min-width").withDefault("100px"); + typeRampBaseFontSize = create2("type-ramp-base-font-size", "--vscode-font-size").withDefault("13px"); + typeRampBaseLineHeight = create2("type-ramp-base-line-height").withDefault("normal"); + typeRampMinus1FontSize = create2("type-ramp-minus1-font-size").withDefault("11px"); + typeRampMinus1LineHeight = create2("type-ramp-minus1-line-height").withDefault("16px"); + typeRampMinus2FontSize = create2("type-ramp-minus2-font-size").withDefault("9px"); + typeRampMinus2LineHeight = create2("type-ramp-minus2-line-height").withDefault("16px"); + typeRampPlus1FontSize = create2("type-ramp-plus1-font-size").withDefault("16px"); + typeRampPlus1LineHeight = create2("type-ramp-plus1-line-height").withDefault("24px"); + scrollbarWidth = create2("scrollbarWidth").withDefault("10px"); + scrollbarHeight = create2("scrollbarHeight").withDefault("10px"); + scrollbarSliderBackground = create2("scrollbar-slider-background", "--vscode-scrollbarSlider-background").withDefault("#79797966"); + scrollbarSliderHoverBackground = create2("scrollbar-slider-hover-background", "--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"); + scrollbarSliderActiveBackground = create2("scrollbar-slider-active-background", "--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"); + badgeBackground = create2("badge-background", "--vscode-badge-background").withDefault("#4d4d4d"); + badgeForeground = create2("badge-foreground", "--vscode-badge-foreground").withDefault("#ffffff"); + buttonBorder = create2("button-border", "--vscode-button-border").withDefault("transparent"); + buttonIconBackground = create2("button-icon-background").withDefault("transparent"); + buttonIconCornerRadius = create2("button-icon-corner-radius").withDefault("5px"); + buttonIconFocusBorderOffset = create2("button-icon-outline-offset").withDefault(0); + buttonIconHoverBackground = create2("button-icon-hover-background", "--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"); + buttonIconPadding = create2("button-icon-padding").withDefault("3px"); + buttonPrimaryBackground = create2("button-primary-background", "--vscode-button-background").withDefault("#0e639c"); + buttonPrimaryForeground = create2("button-primary-foreground", "--vscode-button-foreground").withDefault("#ffffff"); + buttonPrimaryHoverBackground = create2("button-primary-hover-background", "--vscode-button-hoverBackground").withDefault("#1177bb"); + buttonSecondaryBackground = create2("button-secondary-background", "--vscode-button-secondaryBackground").withDefault("#3a3d41"); + buttonSecondaryForeground = create2("button-secondary-foreground", "--vscode-button-secondaryForeground").withDefault("#ffffff"); + buttonSecondaryHoverBackground = create2("button-secondary-hover-background", "--vscode-button-secondaryHoverBackground").withDefault("#45494e"); + buttonPaddingHorizontal = create2("button-padding-horizontal").withDefault("11px"); + buttonPaddingVertical = create2("button-padding-vertical").withDefault("4px"); + checkboxBackground = create2("checkbox-background", "--vscode-checkbox-background").withDefault("#3c3c3c"); + checkboxBorder = create2("checkbox-border", "--vscode-checkbox-border").withDefault("#3c3c3c"); + checkboxCornerRadius = create2("checkbox-corner-radius").withDefault(3); + checkboxForeground = create2("checkbox-foreground", "--vscode-checkbox-foreground").withDefault("#f0f0f0"); + listActiveSelectionBackground = create2("list-active-selection-background", "--vscode-list-activeSelectionBackground").withDefault("#094771"); + listActiveSelectionForeground = create2("list-active-selection-foreground", "--vscode-list-activeSelectionForeground").withDefault("#ffffff"); + listHoverBackground = create2("list-hover-background", "--vscode-list-hoverBackground").withDefault("#2a2d2e"); + dividerBackground = create2("divider-background", "--vscode-settings-dropdownListBorder").withDefault("#454545"); + dropdownBackground = create2("dropdown-background", "--vscode-dropdown-background").withDefault("#3c3c3c"); + dropdownBorder = create2("dropdown-border", "--vscode-dropdown-border").withDefault("#3c3c3c"); + dropdownForeground = create2("dropdown-foreground", "--vscode-dropdown-foreground").withDefault("#f0f0f0"); + dropdownListMaxHeight = create2("dropdown-list-max-height").withDefault("200px"); + inputBackground = create2("input-background", "--vscode-input-background").withDefault("#3c3c3c"); + inputForeground = create2("input-foreground", "--vscode-input-foreground").withDefault("#cccccc"); + inputPlaceholderForeground = create2("input-placeholder-foreground", "--vscode-input-placeholderForeground").withDefault("#cccccc"); + linkActiveForeground = create2("link-active-foreground", "--vscode-textLink-activeForeground").withDefault("#3794ff"); + linkForeground = create2("link-foreground", "--vscode-textLink-foreground").withDefault("#3794ff"); + progressBackground = create2("progress-background", "--vscode-progressBar-background").withDefault("#0e70c0"); + panelTabActiveBorder = create2("panel-tab-active-border", "--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"); + panelTabActiveForeground = create2("panel-tab-active-foreground", "--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"); + panelTabForeground = create2("panel-tab-foreground", "--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"); + panelViewBackground = create2("panel-view-background", "--vscode-panel-background").withDefault("#1e1e1e"); + panelViewBorder = create2("panel-view-border", "--vscode-panel-border").withDefault("#80808059"); + tagCornerRadius = create2("tag-corner-radius").withDefault("2px"); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js + var badgeStyles; + var init_badge_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + badgeStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + text-align: center; + } + .control { + align-items: center; + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: 11px; + box-sizing: border-box; + color: ${badgeForeground}; + display: flex; + height: calc(${designUnit} * 4px); + justify-content: center; + min-width: calc(${designUnit} * 4px + 2px); + min-height: calc(${designUnit} * 4px + 2px); + padding: 3px 6px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js + var Badge2, vsCodeBadge; + var init_badge3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js"() { + init_esm2(); + init_badge_styles(); + Badge2 = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.circular) { + this.circular = true; + } + } + }; + vsCodeBadge = Badge2.compose({ + baseName: "badge", + template: badgeTemplate, + styles: badgeStyles + }); + } + }); + + // node_modules/tslib/tslib.es6.mjs + function __decorate2(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es62 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js + var BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles, buttonStyles; + var init_button_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + BaseButtonStyles = css` + ${display("inline-flex")} :host { + outline: none; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${buttonPrimaryForeground}; + background: ${buttonPrimaryBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + fill: currentColor; + cursor: pointer; + } + .control { + background: transparent; + height: inherit; + flex-grow: 1; + box-sizing: border-box; + display: inline-flex; + justify-content: center; + align-items: center; + padding: ${buttonPaddingVertical} ${buttonPaddingHorizontal}; + white-space: wrap; + outline: none; + text-decoration: none; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + color: inherit; + border-radius: inherit; + fill: inherit; + cursor: inherit; + font-family: inherit; + } + :host(:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host(:active) { + background: ${buttonPrimaryBackground}; + } + .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + .control::-moz-focus-inner { + border: 0; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + background: ${buttonPrimaryBackground}; + cursor: ${disabledCursor}; + } + .content { + display: flex; + } + .start { + display: flex; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-end: 8px; + } +`; + PrimaryButtonStyles = css` + :host([appearance='primary']) { + background: ${buttonPrimaryBackground}; + color: ${buttonPrimaryForeground}; + } + :host([appearance='primary']:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host([appearance='primary']:active) .control:active { + background: ${buttonPrimaryBackground}; + } + :host([appearance='primary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='primary'][disabled]) { + background: ${buttonPrimaryBackground}; + } +`; + SecondaryButtonStyles = css` + :host([appearance='secondary']) { + background: ${buttonSecondaryBackground}; + color: ${buttonSecondaryForeground}; + } + :host([appearance='secondary']:hover) { + background: ${buttonSecondaryHoverBackground}; + } + :host([appearance='secondary']:active) .control:active { + background: ${buttonSecondaryBackground}; + } + :host([appearance='secondary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='secondary'][disabled]) { + background: ${buttonSecondaryBackground}; + } +`; + IconButtonStyles = css` + :host([appearance='icon']) { + background: ${buttonIconBackground}; + border-radius: ${buttonIconCornerRadius}; + color: ${foreground}; + } + :host([appearance='icon']:hover) { + background: ${buttonIconHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } + :host([appearance='icon']) .control { + padding: ${buttonIconPadding}; + border: none; + } + :host([appearance='icon']:active) .control:active { + background: ${buttonIconHoverBackground}; + } + :host([appearance='icon']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: ${buttonIconFocusBorderOffset}; + } + :host([appearance='icon'][disabled]) { + background: ${buttonIconBackground}; + } +`; + buttonStyles = (context, definition) => css` + ${BaseButtonStyles} + ${PrimaryButtonStyles} + ${SecondaryButtonStyles} + ${IconButtonStyles} +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/index.js + var Button2, vsCodeButton; + var init_button3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/index.js"() { + init_tslib_es62(); + init_esm(); + init_esm2(); + init_button_styles(); + Button2 = class extends Button { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.appearance) { + const appearanceValue = this.getAttribute("appearance"); + this.appearance = appearanceValue; + } + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "appearance" && newVal === "icon") { + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.ariaLabel = "Icon Button"; + } + } + if (attrName === "aria-label") { + this.ariaLabel = newVal; + } + if (attrName === "disabled") { + this.disabled = newVal !== null; + } + } + }; + __decorate2([ + attr + ], Button2.prototype, "appearance", void 0); + vsCodeButton = Button2.compose({ + baseName: "button", + template: buttonTemplate, + styles: buttonStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js + var checkboxStyles; + var init_checkbox_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + checkboxStyles = (context, defintiion) => css` + ${display("inline-flex")} :host { + align-items: center; + outline: none; + margin: calc(${designUnit} * 1px) 0; + user-select: none; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control { + position: relative; + width: calc(${designUnit} * 4px + 2px); + height: calc(${designUnit} * 4px + 2px); + box-sizing: border-box; + border-radius: calc(${checkboxCornerRadius} * 1px); + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + background: ${checkboxBackground}; + outline: none; + cursor: pointer; + } + .label { + font-family: ${fontFamily}; + color: ${foreground}; + padding-inline-start: calc(${designUnit} * 2px + 2px); + margin-inline-end: calc(${designUnit} * 2px + 2px); + cursor: pointer; + } + .label__hidden { + display: none; + visibility: hidden; + } + .checked-indicator { + width: 100%; + height: 100%; + display: block; + fill: ${foreground}; + opacity: 0; + pointer-events: none; + } + .indeterminate-indicator { + border-radius: 2px; + background: ${foreground}; + position: absolute; + top: 50%; + left: 50%; + width: 50%; + height: 50%; + transform: translate(-50%, -50%); + opacity: 0; + } + :host(:enabled) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:enabled) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host(.disabled) .label, + :host(.readonly) .label, + :host(.readonly) .control, + :host(.disabled) .control { + cursor: ${disabledCursor}; + } + :host(.checked:not(.indeterminate)) .checked-indicator, + :host(.indeterminate) .indeterminate-indicator { + opacity: 1; + } + :host(.disabled) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js + var Checkbox2, vsCodeCheckbox; + var init_checkbox3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js"() { + init_esm2(); + init_checkbox_styles(); + Checkbox2 = class extends Checkbox { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Checkbox"); + } + } + }; + vsCodeCheckbox = Checkbox2.compose({ + baseName: "checkbox", + template: checkboxTemplate, + styles: checkboxStyles, + checkedIndicator: ` + + + + `, + indeterminateIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js + var dataGridStyles; + var init_data_grid_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js"() { + init_esm(); + dataGridStyles = (context, definition) => css` + :host { + display: flex; + position: relative; + flex-direction: column; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js + var dataGridRowStyles; + var init_data_grid_row_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js"() { + init_esm(); + init_design_tokens(); + dataGridRowStyles = (context, definition) => css` + :host { + display: grid; + padding: calc((${designUnit} / 4) * 1px) 0; + box-sizing: border-box; + width: 100%; + background: transparent; + } + :host(.header) { + } + :host(.sticky-header) { + background: ${background}; + position: sticky; + top: 0; + } + :host(:hover) { + background: ${listHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js + var dataGridCellStyles; + var init_data_grid_cell_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dataGridCellStyles = (context, definition) => css` + :host { + padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px); + color: ${foreground}; + opacity: 1; + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + font-weight: 400; + border: solid calc(${borderWidth} * 1px) transparent; + border-radius: calc(${cornerRadius} * 1px); + white-space: wrap; + overflow-wrap: anywhere; + } + :host(.column-header) { + font-weight: 600; + } + :host(:${focusVisible}), + :host(:focus), + :host(:active) { + background: ${listActiveSelectionBackground}; + border: solid calc(${borderWidth} * 1px) ${focusBorder}; + color: ${listActiveSelectionForeground}; + outline: none; + } + :host(:${focusVisible}) ::slotted(*), + :host(:focus) ::slotted(*), + :host(:active) ::slotted(*) { + color: ${listActiveSelectionForeground} !important; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js + var DataGrid2, vsCodeDataGrid, DataGridRow2, vsCodeDataGridRow, DataGridCell2, vsCodeDataGridCell; + var init_data_grid3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js"() { + init_esm2(); + init_data_grid_styles(); + init_data_grid_row_styles(); + init_data_grid_cell_styles(); + DataGrid2 = class extends DataGrid { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Data Grid"); + } + } + }; + vsCodeDataGrid = DataGrid2.compose({ + baseName: "data-grid", + baseClass: DataGrid, + template: dataGridTemplate, + styles: dataGridStyles + }); + DataGridRow2 = class extends DataGridRow { + }; + vsCodeDataGridRow = DataGridRow2.compose({ + baseName: "data-grid-row", + baseClass: DataGridRow, + template: dataGridRowTemplate, + styles: dataGridRowStyles + }); + DataGridCell2 = class extends DataGridCell { + }; + vsCodeDataGridCell = DataGridCell2.compose({ + baseName: "data-grid-cell", + baseClass: DataGridCell, + template: dataGridCellTemplate, + styles: dataGridCellStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js + var dividerStyles; + var init_divider_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dividerStyles = (context, definition) => css` + ${display("block")} :host { + border: none; + border-top: calc(${borderWidth} * 1px) solid ${dividerBackground}; + box-sizing: content-box; + height: 0; + margin: calc(${designUnit} * 1px) 0; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js + var Divider2, vsCodeDivider; + var init_divider3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js"() { + init_esm2(); + init_divider_styles(); + Divider2 = class extends Divider { + }; + vsCodeDivider = Divider2.compose({ + baseName: "divider", + template: dividerTemplate, + styles: dividerStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js + var dropdownStyles; + var init_dropdown_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dropdownStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: ${dropdownBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + color: ${foreground}; + contain: contents; + font-family: ${fontFamily}; + height: calc(${inputHeight} * 1px); + position: relative; + user-select: none; + min-width: ${inputMinWidth}; + outline: none; + vertical-align: top; + } + .control { + align-items: center; + box-sizing: border-box; + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + cursor: pointer; + display: flex; + font-family: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + min-height: 100%; + padding: 2px 6px 2px 8px; + width: 100%; + } + .listbox { + background: ${dropdownBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + display: inline-flex; + flex-direction: column; + left: 0; + max-height: ${dropdownListMaxHeight}; + padding: 0; + overflow-y: auto; + position: absolute; + width: 100%; + z-index: 1; + } + .listbox[hidden] { + display: none; + } + :host(:${focusVisible}) .control { + border-color: ${focusBorder}; + } + :host(:not([disabled]):hover) { + background: ${dropdownBackground}; + border-color: ${dropdownBorder}; + } + :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + cursor: ${disabledCursor}; + user-select: none; + } + :host([disabled]:hover) { + background: ${dropdownBackground}; + color: ${foreground}; + fill: currentcolor; + } + :host(:not([disabled])) .control:active { + border-color: ${focusBorder}; + } + :host(:empty) .listbox { + display: none; + } + :host([open]) .control { + border-color: ${focusBorder}; + } + :host([open][position='above']) .listbox { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + :host([open][position='below']) .listbox { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + :host([open][position='above']) .listbox { + bottom: calc(${inputHeight} * 1px); + } + :host([open][position='below']) .listbox { + top: calc(${inputHeight} * 1px); + } + .selected-value { + flex: 1 1 auto; + font-family: inherit; + overflow: hidden; + text-align: start; + text-overflow: ellipsis; + white-space: nowrap; + } + .indicator { + flex: 0 0 auto; + margin-inline-start: 1em; + } + slot[name='listbox'] { + display: none; + width: 100%; + } + :host([open]) slot[name='listbox'] { + display: flex; + position: absolute; + } + .end { + margin-inline-start: auto; + } + .start, + .end, + .indicator, + .select-indicator, + ::slotted(svg), + ::slotted(span) { + fill: currentcolor; + height: 1em; + min-height: calc(${designUnit} * 4px); + min-width: calc(${designUnit} * 4px); + width: 1em; + } + ::slotted([role='option']), + ::slotted(option) { + flex: 0 0 auto; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js + var Dropdown, vsCodeDropdown; + var init_dropdown = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js"() { + init_esm2(); + init_dropdown_styles(); + Dropdown = class extends Select { + }; + vsCodeDropdown = Dropdown.compose({ + baseName: "dropdown", + template: selectTemplate, + styles: dropdownStyles, + indicator: ` + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js + var linkStyles; + var init_link_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + linkStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: transparent; + box-sizing: border-box; + color: ${linkForeground}; + cursor: pointer; + fill: currentcolor; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + outline: none; + } + .control { + background: transparent; + border: calc(${borderWidth} * 1px) solid transparent; + border-radius: calc(${cornerRadius} * 1px); + box-sizing: border-box; + color: inherit; + cursor: inherit; + fill: inherit; + font-family: inherit; + height: inherit; + padding: 0; + outline: none; + text-decoration: none; + word-break: break-word; + } + .control::-moz-focus-inner { + border: 0; + } + :host(:hover) { + color: ${linkActiveForeground}; + } + :host(:hover) .content { + text-decoration: underline; + } + :host(:active) { + background: transparent; + color: ${linkActiveForeground}; + } + :host(:${focusVisible}) .control, + :host(:focus) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/index.js + var Link, vsCodeLink; + var init_link = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/index.js"() { + init_esm2(); + init_link_styles(); + Link = class extends Anchor { + }; + vsCodeLink = Link.compose({ + baseName: "link", + template: anchorTemplate, + styles: linkStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js + var optionStyles; + var init_option_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + optionStyles = (context, definition) => css` + ${display("inline-flex")} :host { + font-family: var(--body-font); + border-radius: ${cornerRadius}; + border: calc(${borderWidth} * 1px) solid transparent; + box-sizing: border-box; + color: ${foreground}; + cursor: pointer; + fill: currentcolor; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: 0; + outline: none; + overflow: hidden; + padding: 0 calc((${designUnit} / 2) * 1px) + calc((${designUnit} / 4) * 1px); + user-select: none; + white-space: nowrap; + } + :host(:${focusVisible}) { + border-color: ${focusBorder}; + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([aria-selected='true']) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:active) { + background: ${listActiveSelectionBackground}; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):hover) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):active) { + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]:hover) { + background-color: inherit; + } + .content { + grid-column-start: 2; + justify-self: start; + overflow: hidden; + text-overflow: ellipsis; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/index.js + var Option2, vsCodeOption; + var init_option = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/index.js"() { + init_esm2(); + init_option_styles(); + Option2 = class extends ListboxOption { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Option"); + } + } + }; + vsCodeOption = Option2.compose({ + baseName: "option", + template: listboxOptionTemplate, + styles: optionStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js + var panelsStyles; + var init_panels_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelsStyles = (context, definition) => css` + ${display("grid")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${foreground}; + grid-template-columns: auto 1fr auto; + grid-template-rows: auto 1fr; + overflow-x: auto; + } + .tablist { + display: grid; + grid-template-rows: auto auto; + grid-template-columns: auto; + column-gap: calc(${designUnit} * 8px); + position: relative; + width: max-content; + align-self: end; + padding: calc(${designUnit} * 1px) calc(${designUnit} * 1px) 0; + box-sizing: border-box; + } + .start, + .end { + align-self: center; + } + .activeIndicator { + grid-row: 2; + grid-column: 1; + width: 100%; + height: calc((${designUnit} / 4) * 1px); + justify-self: center; + background: ${panelTabActiveForeground}; + margin: 0; + border-radius: calc(${cornerRadius} * 1px); + } + .activeIndicatorTransition { + transition: transform 0.01s linear; + } + .tabpanel { + grid-row: 2; + grid-column-start: 1; + grid-column-end: 4; + position: relative; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js + var panelTabStyles; + var init_panel_tab_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelTabStyles = (context, definition) => css` + ${display("inline-flex")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + height: calc(${designUnit} * 7px); + padding: calc(${designUnit} * 1px) 0; + color: ${panelTabForeground}; + fill: currentcolor; + border-radius: calc(${cornerRadius} * 1px); + border: solid calc(${borderWidth} * 1px) transparent; + align-items: center; + justify-content: center; + grid-row: 1; + cursor: pointer; + } + :host(:hover) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:active) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:hover) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:active) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:${focusVisible}) { + outline: none; + border: solid calc(${borderWidth} * 1px) ${panelTabActiveBorder}; + } + :host(:focus) { + outline: none; + } + ::slotted(vscode-badge) { + margin-inline-start: calc(${designUnit} * 2px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js + var panelViewStyles; + var init_panel_view_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelViewStyles = (context, definition) => css` + ${display("flex")} :host { + color: inherit; + background-color: transparent; + border: solid calc(${borderWidth} * 1px) transparent; + box-sizing: border-box; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: 10px calc((${designUnit} + 2) * 1px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js + var Panels, vsCodePanels, PanelTab, vsCodePanelTab, PanelView, vsCodePanelView; + var init_panels = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js"() { + init_esm2(); + init_panels_styles(); + init_panel_tab_styles(); + init_panel_view_styles(); + Panels = class extends Tabs { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.orientation) { + this.orientation = TabsOrientation.horizontal; + } + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Panels"); + } + } + }; + vsCodePanels = Panels.compose({ + baseName: "panels", + template: tabsTemplate, + styles: panelsStyles + }); + PanelTab = class extends Tab { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.disabled) { + this.disabled = false; + } + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } + } + }; + vsCodePanelTab = PanelTab.compose({ + baseName: "panel-tab", + template: tabTemplate, + styles: panelTabStyles + }); + PanelView = class extends TabPanel { + }; + vsCodePanelView = PanelView.compose({ + baseName: "panel-view", + template: tabPanelTemplate, + styles: panelViewStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js + var progressRingStyles; + var init_progress_ring_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + progressRingStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: center; + outline: none; + height: calc(${designUnit} * 7px); + width: calc(${designUnit} * 7px); + margin: 0; + } + .progress { + height: 100%; + width: 100%; + } + .background { + fill: none; + stroke: transparent; + stroke-width: calc(${designUnit} / 2 * 1px); + } + .indeterminate-indicator-1 { + fill: none; + stroke: ${progressBackground}; + stroke-width: calc(${designUnit} / 2 * 1px); + stroke-linecap: square; + transform-origin: 50% 50%; + transform: rotate(-90deg); + transition: all 0.2s ease-in-out; + animation: spin-infinite 2s linear infinite; + } + @keyframes spin-infinite { + 0% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(0deg); + } + 50% { + stroke-dasharray: 21.99px 21.99px; + transform: rotate(450deg); + } + 100% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(1080deg); + } + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js + var ProgressRing, vsCodeProgressRing; + var init_progress_ring2 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js"() { + init_esm2(); + init_progress_ring_styles(); + ProgressRing = class extends BaseProgress { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.paused) { + this.paused = false; + } + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-live", "assertive"); + this.setAttribute("role", "alert"); + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "value") { + this.removeAttribute("value"); + } + } + }; + vsCodeProgressRing = ProgressRing.compose({ + baseName: "progress-ring", + template: progressRingTemplate, + styles: progressRingStyles, + indeterminateIndicator: ` + + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js + var radioGroupStyles; + var init_radio_group_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioGroupStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: flex-start; + margin: calc(${designUnit} * 1px) 0; + flex-direction: column; + } + .positioning-region { + display: flex; + flex-wrap: wrap; + } + :host([orientation='vertical']) .positioning-region { + flex-direction: column; + } + :host([orientation='horizontal']) .positioning-region { + flex-direction: row; + } + ::slotted([slot='label']) { + color: ${foreground}; + font-size: ${typeRampBaseFontSize}; + margin: calc(${designUnit} * 1px) 0; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js + var RadioGroup2, vsCodeRadioGroup; + var init_radio_group3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js"() { + init_dist2(); + init_esm2(); + init_radio_group_styles(); + RadioGroup2 = class extends RadioGroup { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const label = this.querySelector("label"); + if (label) { + const id = "radio-group-" + Math.random().toString(16).slice(2); + label.setAttribute("id", id); + this.setAttribute("aria-labelledby", id); + } + } + }; + vsCodeRadioGroup = RadioGroup2.compose({ + baseName: "radio-group", + template: radioGroupTemplate, + styles: radioGroupStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js + var radioStyles; + var init_radio_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioStyles = (context, definition) => css` + ${display("inline-flex")} :host { + align-items: center; + flex-direction: row; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: calc(${designUnit} * 1px) 0; + outline: none; + position: relative; + transition: all 0.2s ease-in-out; + user-select: none; + } + .control { + background: ${checkboxBackground}; + border-radius: 999px; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + box-sizing: border-box; + cursor: pointer; + height: calc(${designUnit} * 4px); + position: relative; + outline: none; + width: calc(${designUnit} * 4px); + } + .label { + color: ${foreground}; + cursor: pointer; + font-family: ${fontFamily}; + margin-inline-end: calc(${designUnit} * 2px + 2px); + padding-inline-start: calc(${designUnit} * 2px + 2px); + } + .label__hidden { + display: none; + visibility: hidden; + } + .control, + .checked-indicator { + flex-shrink: 0; + } + .checked-indicator { + background: ${foreground}; + border-radius: 999px; + display: inline-block; + inset: calc(${designUnit} * 1px); + opacity: 0; + pointer-events: none; + position: absolute; + } + :host(:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:not([disabled])) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked='true']) .control { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:active { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked="true"]:${focusVisible}:not([disabled])) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([aria-checked='true']) .checked-indicator { + opacity: 1; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js + var Radio2, vsCodeRadio; + var init_radio3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js"() { + init_esm2(); + init_radio_styles(); + Radio2 = class extends Radio { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Radio"); + } + } + }; + vsCodeRadio = Radio2.compose({ + baseName: "radio", + template: radioTemplate, + styles: radioStyles, + checkedIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js + var tagStyles; + var init_tag_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + tagStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + } + .control { + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: ${tagCornerRadius}; + color: ${badgeForeground}; + padding: calc(${designUnit} * 0.5px) calc(${designUnit} * 1px); + text-transform: uppercase; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js + var Tag, vsCodeTag; + var init_tag = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js"() { + init_esm2(); + init_tag_styles(); + Tag = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.circular) { + this.circular = false; + } + } + }; + vsCodeTag = Tag.compose({ + baseName: "tag", + template: badgeTemplate, + styles: tagStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js + var textAreaStyles; + var init_text_area_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textAreaStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .control { + box-sizing: border-box; + position: relative; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + font: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: calc(${designUnit} * 2px + 1px); + width: 100%; + min-width: ${inputMinWidth}; + resize: none; + } + .control:hover:enabled { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + .control:active:enabled { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .control::-webkit-scrollbar { + width: ${scrollbarWidth}; + height: ${scrollbarHeight}; + } + .control::-webkit-scrollbar-corner { + background: ${inputBackground}; + } + .control::-webkit-scrollbar-thumb { + background: ${scrollbarSliderBackground}; + } + .control::-webkit-scrollbar-thumb:hover { + background: ${scrollbarSliderHoverBackground}; + } + .control::-webkit-scrollbar-thumb:active { + background: ${scrollbarSliderActiveBackground}; + } + :host(:focus-within:not([disabled])) .control { + border-color: ${focusBorder}; + } + :host([resize='both']) .control { + resize: both; + } + :host([resize='horizontal']) .control { + resize: horizontal; + } + :host([resize='vertical']) .control { + resize: vertical; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js + var TextArea2, vsCodeTextArea; + var init_text_area3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js"() { + init_esm2(); + init_text_area_styles(); + TextArea2 = class extends TextArea { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text area"); + } + } + }; + vsCodeTextArea = TextArea2.compose({ + baseName: "text-area", + template: textAreaTemplate, + styles: textAreaStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js + var textFieldStyles; + var init_text_field_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textFieldStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .root { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: row; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + height: calc(${inputHeight} * 1px); + min-width: ${inputMinWidth}; + } + .control { + -webkit-appearance: none; + font: inherit; + background: transparent; + border: 0; + color: inherit; + height: calc(100% - (${designUnit} * 1px)); + width: 100%; + margin-top: auto; + margin-bottom: auto; + border: none; + padding: 0 calc(${designUnit} * 2px + 1px); + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + .start, + .end { + display: flex; + margin: auto; + fill: currentcolor; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-start: calc(${designUnit} * 2px); + } + .end { + margin-inline-end: calc(${designUnit} * 2px); + } + :host(:hover:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + :host(:active:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + :host(:focus-within:not([disabled])) .root { + border-color: ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js + var TextField2, vsCodeTextField; + var init_text_field3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js"() { + init_esm2(); + init_text_field_styles(); + TextField2 = class extends TextField { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text field"); + } + } + }; + vsCodeTextField = TextField2.compose({ + baseName: "text-field", + template: textFieldTemplate, + styles: textFieldStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js + var allComponents; + var init_custom_elements = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js"() { + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + allComponents = { + vsCodeBadge, + vsCodeButton, + vsCodeCheckbox, + vsCodeDataGrid, + vsCodeDataGridCell, + vsCodeDataGridRow, + vsCodeDivider, + vsCodeDropdown, + vsCodeLink, + vsCodeOption, + vsCodePanels, + vsCodePanelTab, + vsCodePanelView, + vsCodeProgressRing, + vsCodeRadioGroup, + vsCodeRadio, + vsCodeTag, + vsCodeTextArea, + vsCodeTextField, + register(container, ...rest) { + if (!container) { + return; + } + for (const key in this) { + if (key === "register") { + continue; + } + this[key]().register(container, ...rest); + } + } + }; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/index.js + var dist_exports = {}; + __export(dist_exports, { + Badge: () => Badge2, + Button: () => Button2, + Checkbox: () => Checkbox2, + DataGrid: () => DataGrid2, + DataGridCell: () => DataGridCell2, + DataGridCellTypes: () => DataGridCellTypes, + DataGridRow: () => DataGridRow2, + DataGridRowTypes: () => DataGridRowTypes, + Divider: () => Divider2, + DividerRole: () => DividerRole, + Dropdown: () => Dropdown, + DropdownPosition: () => SelectPosition, + GenerateHeaderOptions: () => GenerateHeaderOptions, + Link: () => Link, + Option: () => Option2, + PanelTab: () => PanelTab, + PanelView: () => PanelView, + Panels: () => Panels, + ProgressRing: () => ProgressRing, + Radio: () => Radio2, + RadioGroup: () => RadioGroup2, + RadioGroupOrientation: () => Orientation, + Tag: () => Tag, + TextArea: () => TextArea2, + TextAreaResize: () => TextAreaResize, + TextField: () => TextField2, + TextFieldType: () => TextFieldType, + allComponents: () => allComponents, + provideVSCodeDesignSystem: () => provideVSCodeDesignSystem, + vsCodeBadge: () => vsCodeBadge, + vsCodeButton: () => vsCodeButton, + vsCodeCheckbox: () => vsCodeCheckbox, + vsCodeDataGrid: () => vsCodeDataGrid, + vsCodeDataGridCell: () => vsCodeDataGridCell, + vsCodeDataGridRow: () => vsCodeDataGridRow, + vsCodeDivider: () => vsCodeDivider, + vsCodeDropdown: () => vsCodeDropdown, + vsCodeLink: () => vsCodeLink, + vsCodeOption: () => vsCodeOption, + vsCodePanelTab: () => vsCodePanelTab, + vsCodePanelView: () => vsCodePanelView, + vsCodePanels: () => vsCodePanels, + vsCodeProgressRing: () => vsCodeProgressRing, + vsCodeRadio: () => vsCodeRadio, + vsCodeRadioGroup: () => vsCodeRadioGroup, + vsCodeTag: () => vsCodeTag, + vsCodeTextArea: () => vsCodeTextArea, + vsCodeTextField: () => vsCodeTextField + }); + var init_dist3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/index.js"() { + init_vscode_design_system(); + init_custom_elements(); + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + } + }); + + // src/webview/shared/buttonConfig.ts + var BUTTONS = { + "btn-refresh": { + id: "btn-refresh", + label: "\u{1F504} Refresh", + appearance: "primary" + }, + "btn-details": { + id: "btn-details", + label: "\u{1F916} Details" + }, + "btn-chart": { + id: "btn-chart", + label: "\u{1F4C8} Chart" + }, + "btn-usage": { + id: "btn-usage", + label: "\u{1F4CA} Usage Analysis" + }, + "btn-diagnostics": { + id: "btn-diagnostics", + label: "\u{1F50D} Diagnostics" + }, + "btn-maturity": { + id: "btn-maturity", + label: "\u{1F3AF} Fluency Score" + }, + "btn-dashboard": { + id: "btn-dashboard", + label: "\u{1F4CA} Team Dashboard" + }, + "btn-level-viewer": { + id: "btn-level-viewer", + label: "\u{1F50D} Level Viewer" + }, + "btn-environmental": { + id: "btn-environmental", + label: "\u{1F33F} Environmental Impact" + } + }; + function buttonHtml(id) { + const config = BUTTONS[id]; + const appearance = config.appearance ? ` appearance="${config.appearance}"` : ""; + return `${config.label}`; + } + + // src/webview/shared/theme.css + var theme_default = '/**\n * Shared theme variables for all webview panels\n * Uses VS Code theme tokens for automatic light/dark theme support\n */\n\n:root {\n /* VS Code base colors */\n --bg-primary: var(--vscode-editor-background);\n --bg-secondary: var(--vscode-sideBar-background);\n --bg-tertiary: var(--vscode-editorWidget-background);\n --text-primary: var(--vscode-editor-foreground);\n --text-secondary: var(--vscode-descriptionForeground);\n --text-muted: var(--vscode-disabledForeground);\n --border-color: var(--vscode-panel-border);\n --border-subtle: var(--vscode-widget-border);\n \n /* Button colors */\n --button-bg: var(--vscode-button-background);\n --button-fg: var(--vscode-button-foreground);\n --button-hover-bg: var(--vscode-button-hoverBackground);\n --button-secondary-bg: var(--vscode-button-secondaryBackground);\n --button-secondary-fg: var(--vscode-button-secondaryForeground);\n --button-secondary-hover-bg: var(--vscode-button-secondaryHoverBackground);\n \n /* Input colors */\n --input-bg: var(--vscode-input-background);\n --input-fg: var(--vscode-input-foreground);\n --input-border: var(--vscode-input-border);\n \n /* List/card colors */\n --list-hover-bg: var(--vscode-list-hoverBackground);\n --list-active-bg: var(--vscode-list-activeSelectionBackground);\n --list-active-fg: var(--vscode-list-activeSelectionForeground);\n --list-inactive-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Alternating row colors for better readability */\n --row-alternate-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Badge colors */\n --badge-bg: var(--vscode-badge-background);\n --badge-fg: var(--vscode-badge-foreground);\n \n /* Focus colors */\n --focus-border: var(--vscode-focusBorder);\n \n /* Link colors */\n --link-color: var(--vscode-textLink-foreground);\n --link-hover-color: var(--vscode-textLink-activeForeground);\n \n /* Status colors */\n --error-fg: var(--vscode-errorForeground);\n --warning-fg: var(--vscode-editorWarning-foreground);\n --success-fg: var(--vscode-terminal-ansiGreen);\n \n /* Shadow for cards */\n --shadow-color: rgb(0, 0, 0, 0.16);\n --shadow-hover-color: rgb(0, 0, 0, 0.24);\n}\n\n/* Light theme adjustments */\nbody[data-vscode-theme-kind="vscode-light"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --shadow-color: rgb(0, 0, 0, 0.08);\n --shadow-hover-color: rgb(0, 0, 0, 0.12);\n}\n\n/* High contrast mode adjustments */\nbody[data-vscode-theme-kind="vscode-high-contrast"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --border-color: var(--vscode-contrastBorder);\n --border-subtle: var(--vscode-contrastBorder);\n}\n'; + + // src/webview/diagnostics/styles.css + var styles_default = "* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n background: var(--bg-primary);\n color: var(--text-primary);\n padding: 16px;\n line-height: 1.5;\n min-width: 320px;\n}\n\n.container {\n background: var(--bg-secondary);\n border: 1px solid var(--border-color);\n border-radius: 10px;\n padding: 16px;\n box-shadow: 0 4px 10px var(--shadow-color);\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n padding-bottom: 4px;\n}\n\n.header-left {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.header-icon {\n font-size: 20px;\n}\n\n\n.button-row {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.section {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-color);\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 16px;\n box-shadow: 0 2px 6px var(--shadow-color);\n}\n\n.section-title {\n font-size: 14px;\n font-weight: 700;\n color: var(--text-primary);\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n gap: 6px;\n letter-spacing: 0.2px;\n}\n\n.section-subtitle {\n font-size: 12px;\n color: var(--text-secondary);\n margin-bottom: 12px;\n}\n\n/* Tab styles */\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border-color);\n margin-bottom: 16px;\n}\n\n.tab {\n padding: 10px 20px;\n cursor: pointer;\n border: none;\n background: transparent;\n color: var(--text-secondary);\n font-size: 13px;\n font-weight: 500;\n border-bottom: 2px solid transparent;\n transition: all 0.2s;\n}\n\n.tab:hover {\n color: var(--text-primary);\n background: var(--list-hover-bg);\n}\n\n.tab.active {\n color: var(--link-color);\n border-bottom-color: var(--link-color);\n}\n\n.tab-content {\n display: none;\n}\n\n.tab-content.active {\n display: block;\n}\n\n/* Editor filter panels */\n.editor-filter-panels {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n margin-bottom: 16px;\n}\n\n.editor-panel {\n background: var(--bg-tertiary);\n border: 2px solid var(--border-color);\n border-radius: 8px;\n padding: 12px 16px;\n cursor: pointer;\n transition: all 0.2s;\n min-width: 140px;\n text-align: center;\n white-space: nowrap;\n}\n\n.editor-panel:hover {\n background: var(--list-hover-bg);\n border-color: var(--border-color);\n}\n\n.editor-panel.active {\n background: var(--list-active-bg);\n border-color: var(--link-color);\n color: var(--list-active-fg);\n}\n\n.editor-panel.active .editor-panel-name {\n color: var(--list-active-fg);\n}\n\n.editor-panel.active .editor-panel-stats {\n color: var(--list-active-fg);\n opacity: 0.85;\n}\n\n.editor-panel-icon {\n font-size: 24px;\n margin-bottom: 4px;\n}\n\n.editor-panel-name {\n font-size: 13px;\n font-weight: 600;\n color: var(--text-primary);\n margin-bottom: 2px;\n}\n\n.editor-panel-stats {\n font-size: 10px;\n color: var(--text-muted);\n}\n\n/* Loading state */\n.loading-state {\n text-align: center;\n padding: 40px 20px;\n color: var(--text-muted);\n}\n\n.loading-spinner {\n font-size: 48px;\n margin-bottom: 16px;\n animation: pulse 1.5s ease-in-out infinite;\n}\n\n@keyframes pulse {\n 0%,\n 100% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0.5;\n }\n}\n\n.loading-text {\n font-size: 16px;\n color: var(--text-primary);\n margin-bottom: 8px;\n}\n\n.loading-subtext {\n font-size: 12px;\n color: var(--text-muted);\n}\n\n/* Summary cards */\n.summary-cards {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));\n gap: 12px;\n margin-bottom: 16px;\n}\n\n.summary-card {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-color);\n border-radius: 4px;\n padding: 12px;\n text-align: center;\n}\n\n.summary-label {\n font-size: 11px;\n color: var(--text-secondary);\n margin-bottom: 4px;\n}\n\n.summary-value {\n font-size: 18px;\n font-weight: 600;\n color: var(--text-primary);\n}\n\n.summary-sub {\n font-size: 10px;\n color: var(--text-secondary);\n text-align: left;\n margin-top: 6px;\n}\n\n.context-ref-filter {\n cursor: pointer;\n padding: 2px 6px;\n border-radius: 3px;\n margin: 2px 0;\n transition: all 0.2s;\n}\n\n.context-ref-filter:hover {\n background: rgb(79, 195, 247, 0.2);\n color: var(--link-color);\n}\n\n.context-ref-filter.active {\n background: rgb(79, 195, 247, 0.3);\n color: var(--link-color);\n font-weight: 600;\n}\n\n/* Table styles */\n.table-container {\n overflow: auto;\n max-height: 500px;\n}\n\n.session-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n}\n\n.session-table th,\n.session-table td {\n padding: 8px 10px;\n text-align: left;\n border-bottom: 1px solid var(--border-color);\n}\n\n.session-table th {\n background: var(--bg-tertiary);\n color: var(--text-primary);\n font-weight: 600;\n position: sticky;\n top: 0;\n}\n\n.session-table th.sortable {\n cursor: pointer;\n user-select: none;\n}\n\n.session-table th.sortable:hover {\n background: var(--list-hover-bg);\n color: var(--link-color);\n}\n\n.session-table tr:hover {\n background: rgb(255, 255, 255, 0.03);\n}\n\n.editor-badge {\n background: var(--list-active-bg);\n padding: 2px 6px;\n border-radius: 3px;\n font-size: 10px;\n color: var(--list-active-fg);\n white-space: nowrap;\n}\n\n.editor-badge-crush {\n background: #3d0a4f;\n color: #ff3dff;\n border: 1px solid #cc00cc;\n}\n\n.editor-badge-vs {\n background: #5c2d91;\n color: #ffffff;\n border: 1px solid #7b3fbe;\n}\n\n.session-folders-table {\n margin-top: 16px;\n margin-bottom: 16px;\n}\n\n.session-folders-table h4 {\n color: var(--text-primary);\n font-size: 14px;\n margin-bottom: 12px;\n}\n\n.report-content {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-color);\n border-radius: 4px;\n padding: 16px;\n white-space: pre-wrap;\n font-size: 13px;\n overflow: auto;\n max-height: 60vh;\n}\n\n.file-subpath {\n font-size: 11px;\n color: var(--text-muted);\n margin-top: 4px;\n}\n\n.session-file-link,\n.reveal-link,\n.view-formatted-link {\n color: var(--link-color);\n text-decoration: underline;\n cursor: pointer;\n}\n\n.session-file-link:hover,\n.reveal-link:hover,\n.view-formatted-link:hover {\n color: var(--link-hover-color);\n}\n\n.empty-session-link {\n color: var(--text-muted);\n}\n\n.empty-session-link:hover {\n color: var(--text-secondary);\n}\n\n.button-group {\n display: flex;\n gap: 12px;\n margin-top: 16px;\n flex-wrap: wrap;\n}\n\n.button {\n background: var(--button-secondary-bg);\n border: 1px solid var(--border-subtle);\n color: var(--text-primary);\n padding: 8px 12px;\n border-radius: 6px;\n cursor: pointer;\n font-size: 13px;\n font-weight: 500;\n transition: background-color 0.15s ease;\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n.button:hover {\n background: var(--bg-tertiary);\n}\n\n.button:active {\n background: var(--button-bg);\n}\n\n.button:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.button.secondary {\n background: var(--bg-tertiary);\n border-color: var(--border-subtle);\n color: var(--text-primary);\n}\n\n.button.secondary:hover {\n background: var(--list-hover-bg);\n}\n\n.info-box {\n background: var(--list-active-bg);\n border: 1px solid var(--border-color);\n border-radius: 4px;\n padding: 12px;\n margin-bottom: 16px;\n font-size: 13px;\n color: var(--list-active-fg);\n}\n\n.info-box-title {\n font-weight: 600;\n color: var(--list-active-fg);\n margin-bottom: 6px;\n}\n\n.cache-details {\n margin-top: 16px;\n}\n\n.cache-location {\n margin-top: 20px;\n}\n\n.cache-location h4 {\n color: var(--text-primary);\n font-size: 14px;\n margin-bottom: 8px;\n}\n\n.location-box {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-color);\n border-radius: 4px;\n padding: 12px;\n overflow-x: auto;\n}\n\n.location-box code {\n color: var(--link-color);\n font-size: 12px;\n}\n\n.cache-actions {\n margin-top: 20px;\n}\n\n.cache-actions h4 {\n color: var(--text-primary);\n font-size: 14px;\n margin-bottom: 8px;\n}\n"; + + // src/webview/shared/contextRefUtils.ts + function getTotalContextRefs(refs) { + return refs.file + refs.selection + refs.implicitSelection + refs.symbol + refs.codebase + refs.workspace + refs.terminal + refs.vscode + refs.copilotInstructions + refs.agentsMd + (refs.terminalLastCommand || 0) + (refs.terminalSelection || 0) + (refs.clipboard || 0) + (refs.changes || 0) + (refs.outputPanel || 0) + (refs.problemsPanel || 0); + } + function getContextRefsSummary(refs, abbreviated = false) { + const parts = []; + if (abbreviated) { + if (refs.file > 0) { + parts.push(`#file: ${refs.file}`); + } + if (refs.selection > 0) { + parts.push(`#sel: ${refs.selection}`); + } + if (refs.implicitSelection > 0) { + parts.push(`impl: ${refs.implicitSelection}`); + } + if (refs.symbol > 0) { + parts.push(`#sym: ${refs.symbol}`); + } + if (refs.codebase > 0) { + parts.push(`#cb: ${refs.codebase}`); + } + if (refs.workspace > 0) { + parts.push(`@ws: ${refs.workspace}`); + } + if (refs.terminal > 0) { + parts.push(`@term: ${refs.terminal}`); + } + if (refs.vscode > 0) { + parts.push(`@vsc: ${refs.vscode}`); + } + if ((refs.terminalLastCommand || 0) > 0) { + parts.push(`#termLC: ${refs.terminalLastCommand}`); + } + if ((refs.terminalSelection || 0) > 0) { + parts.push(`#termSel: ${refs.terminalSelection}`); + } + if ((refs.clipboard || 0) > 0) { + parts.push(`#clip: ${refs.clipboard}`); + } + if ((refs.changes || 0) > 0) { + parts.push(`#chg: ${refs.changes}`); + } + if ((refs.outputPanel || 0) > 0) { + parts.push(`#out: ${refs.outputPanel}`); + } + if ((refs.problemsPanel || 0) > 0) { + parts.push(`#prob: ${refs.problemsPanel}`); + } + if (refs.copilotInstructions > 0) { + parts.push(`\u{1F4CB} inst: ${refs.copilotInstructions}`); + } + if (refs.agentsMd > 0) { + parts.push(`\u{1F916} ag: ${refs.agentsMd}`); + } + } else { + if (refs.file > 0) { + parts.push(`#file: ${refs.file}`); + } + if (refs.selection > 0) { + parts.push(`#selection: ${refs.selection}`); + } + if (refs.implicitSelection > 0) { + parts.push(`implicit: ${refs.implicitSelection}`); + } + if (refs.symbol > 0) { + parts.push(`#symbol: ${refs.symbol}`); + } + if (refs.codebase > 0) { + parts.push(`#codebase: ${refs.codebase}`); + } + if (refs.workspace > 0) { + parts.push(`@workspace: ${refs.workspace}`); + } + if (refs.terminal > 0) { + parts.push(`@terminal: ${refs.terminal}`); + } + if (refs.vscode > 0) { + parts.push(`@vscode: ${refs.vscode}`); + } + if ((refs.terminalLastCommand || 0) > 0) { + parts.push(`#terminalLastCommand: ${refs.terminalLastCommand}`); + } + if ((refs.terminalSelection || 0) > 0) { + parts.push(`#terminalSelection: ${refs.terminalSelection}`); + } + if ((refs.clipboard || 0) > 0) { + parts.push(`#clipboard: ${refs.clipboard}`); + } + if ((refs.changes || 0) > 0) { + parts.push(`#changes: ${refs.changes}`); + } + if ((refs.outputPanel || 0) > 0) { + parts.push(`#outputPanel: ${refs.outputPanel}`); + } + if ((refs.problemsPanel || 0) > 0) { + parts.push(`#problemsPanel: ${refs.problemsPanel}`); + } + if (refs.copilotInstructions > 0) { + parts.push(`\u{1F4CB} instructions: ${refs.copilotInstructions}`); + } + if (refs.agentsMd > 0) { + parts.push(`\u{1F916} agents: ${refs.agentsMd}`); + } + } + return parts.length > 0 ? parts.join(", ") : "None"; + } + + // src/webview/diagnostics/main.ts + var LOADING_PLACEHOLDER = "Loading..."; + var SESSION_FILES_SECTION_REGEX = /Session File Locations \(first 20\):[\s\S]*?(?=\n\s*\n|={70})/; + var LOADING_MESSAGE = `\u23F3 Loading diagnostic data... + +This may take a few moments depending on the number of session files. +The view will automatically update when data is ready.`; + var vscode = acquireVsCodeApi(); + var initialData = window.__INITIAL_DIAGNOSTICS__; + var currentSortColumn = "lastInteraction"; + var currentSortDirection = "desc"; + var currentEditorFilter = null; + var currentContextRefFilter = null; + function escapeHtml(text) { + return text.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); + } + function removeSessionFilesSection(reportText) { + return reportText.replace(SESSION_FILES_SECTION_REGEX, ""); + } + function formatDate(isoString) { + if (!isoString) { + return "N/A"; + } + try { + return escapeHtml(new Date(isoString).toLocaleString()); + } catch { + return escapeHtml(isoString); + } + } + function getTimeSince(isoString) { + try { + const now = Date.now(); + const then = new Date(isoString).getTime(); + const diffMs = now - then; + if (diffMs < 0) { + return "Just now"; + } + const seconds = Math.floor(diffMs / 1e3); + const minutes = Math.floor(seconds / 60); + const hours = Math.floor(minutes / 60); + const days = Math.floor(hours / 24); + if (days > 0) { + return `${days} day${days !== 1 ? "s" : ""} ago`; + } + if (hours > 0) { + return `${hours} hour${hours !== 1 ? "s" : ""} ago`; + } + if (minutes > 0) { + return `${minutes} minute${minutes !== 1 ? "s" : ""} ago`; + } + return `${seconds} second${seconds !== 1 ? "s" : ""} ago`; + } catch { + return "Unknown"; + } + } + function formatFileSize(bytes) { + const numericBytes = Number(bytes); + if (!Number.isFinite(numericBytes) || numericBytes < 0) { + return "N/A"; + } + if (numericBytes < 1024) { + return `${numericBytes} B`; + } + if (numericBytes < 1024 * 1024) { + return `${(numericBytes / 1024).toFixed(1)} KB`; + } + return `${(numericBytes / (1024 * 1024)).toFixed(2)} MB`; + } + function sanitizeNumber(value) { + if (value === void 0 || value === null) { + return "0"; + } + const n = Number(value); + if (!Number.isFinite(n)) { + return "0"; + } + return Math.floor(n).toString(); + } + function buildCandidatePathsElement(candidatePaths) { + const container = document.createElement("div"); + container.className = "candidate-paths-table"; + const heading = document.createElement("h4"); + heading.textContent = "Scanned Paths (all candidate locations):"; + container.appendChild(heading); + const description = document.createElement("p"); + description.style.cssText = "color: #999; font-size: 12px; margin: 4px 0 8px 0;"; + description.textContent = "These are all the paths the extension checks for session files. Paths marked with \u2705 exist on this system."; + container.appendChild(description); + const table = document.createElement("table"); + table.className = "session-table"; + container.appendChild(table); + const thead = document.createElement("thead"); + table.appendChild(thead); + const headerRow = document.createElement("tr"); + thead.appendChild(headerRow); + for (const text of ["Status", "Source", "Path"]) { + const th = document.createElement("th"); + th.textContent = text; + headerRow.appendChild(th); + } + const tbody = document.createElement("tbody"); + table.appendChild(tbody); + const sorted = [...candidatePaths].sort((a, b) => { + if (a.exists !== b.exists) { + return a.exists ? -1 : 1; + } + return a.source.localeCompare(b.source); + }); + const crushEntries = sorted.filter( + (cp) => cp.source.toLowerCase().includes("crush") + ); + const otherEntries = sorted.filter( + (cp) => !cp.source.toLowerCase().includes("crush") + ); + const renderRow = (cp) => { + const row = document.createElement("tr"); + if (!cp.exists) { + row.style.opacity = "0.5"; + } + const statusCell = document.createElement("td"); + statusCell.textContent = cp.exists ? "\u2705" : "\u274C"; + statusCell.style.textAlign = "center"; + row.appendChild(statusCell); + const sourceCell = document.createElement("td"); + const badge = document.createElement("span"); + badge.className = getEditorBadgeClass(cp.source); + badge.textContent = `${getEditorIcon(cp.source)} ${cp.source}`; + sourceCell.appendChild(badge); + row.appendChild(sourceCell); + const pathCell = document.createElement("td"); + pathCell.setAttribute("title", cp.path); + pathCell.style.fontFamily = "var(--vscode-editor-font-family, monospace)"; + pathCell.style.fontSize = "12px"; + pathCell.textContent = cp.path; + row.appendChild(pathCell); + tbody.appendChild(row); + }; + for (const cp of otherEntries) { + renderRow(cp); + } + if (crushEntries.length > 0) { + const anyExist = crushEntries.some((cp) => cp.exists); + const row = document.createElement("tr"); + if (!anyExist) { + row.style.opacity = "0.5"; + } + const statusCell = document.createElement("td"); + statusCell.textContent = anyExist ? "\u2705" : "\u274C"; + statusCell.style.textAlign = "center"; + row.appendChild(statusCell); + const sourceCell = document.createElement("td"); + const badge = document.createElement("span"); + badge.className = getEditorBadgeClass("Crush"); + badge.textContent = `${getEditorIcon("Crush")} Crush`; + sourceCell.appendChild(badge); + row.appendChild(sourceCell); + const pathCell = document.createElement("td"); + pathCell.style.fontFamily = "var(--vscode-editor-font-family, monospace)"; + pathCell.style.fontSize = "12px"; + pathCell.style.lineHeight = "1.6"; + for (const cp of crushEntries) { + const line = document.createElement("div"); + line.style.opacity = cp.exists ? "1" : "0.5"; + line.title = cp.path; + line.textContent = `${cp.exists ? "\u2705" : "\u274C"} ${cp.path}`; + pathCell.appendChild(line); + } + row.appendChild(pathCell); + tbody.appendChild(row); + } + return container; + } + function getRepoDisplayName(repoUrl) { + if (!repoUrl) { + return ""; + } + let url = repoUrl.replace(/\.git$/, ""); + if (url.includes("@") && url.includes(":")) { + const colonIndex = url.lastIndexOf(":"); + const atIndex = url.lastIndexOf("@"); + if (colonIndex > atIndex) { + return url.substring(colonIndex + 1); + } + } + try { + if (url.includes("://")) { + const urlObj = new URL(url); + const pathParts = urlObj.pathname.split("/").filter((p) => p); + if (pathParts.length >= 2) { + return `${pathParts[pathParts.length - 2]}/${pathParts[pathParts.length - 1]}`; + } + return urlObj.pathname.replace(/^\//, ""); + } + } catch { + } + const parts = url.split("/").filter((p) => p); + if (parts.length >= 2) { + return `${parts[parts.length - 2]}/${parts[parts.length - 1]}`; + } + return url; + } + function getEditorBadgeClass(editor) { + const lower = editor.toLowerCase(); + if (lower.includes("visual studio")) { + return "editor-badge editor-badge-vs"; + } + if (lower.includes("visual studio")) { + return "editor-badge editor-badge-vs"; + } + if (lower.includes("crush")) { + return "editor-badge editor-badge-crush"; + } + return "editor-badge"; + } + function getEditorIcon(editor) { + const lower = editor.toLowerCase(); + if (lower.includes("visual studio")) { + return "\u{1FA9F}"; + } + if (lower.includes("visual studio")) { + return "\u{1FA9F}"; + } + if (lower.includes("crush")) { + return "\u{1FA77}"; + } + if (lower.includes("opencode")) { + return "\u{1F7E2}"; + } + if (lower.includes("cursor")) { + return "\u{1F5B1}\uFE0F"; + } + if (lower.includes("insiders")) { + return "\u{1F49A}"; + } + if (lower.includes("vscodium")) { + return "\u{1F535}"; + } + if (lower.includes("windsurf")) { + return "\u{1F3C4}"; + } + if (lower.includes("vs code") || lower.includes("vscode")) { + return "\u{1F499}"; + } + return "\u{1F4DD}"; + } + function sortSessionFiles(files) { + return [...files].sort((a, b) => { + const aVal = a.lastInteraction; + const bVal = b.lastInteraction; + if (!aVal && !bVal) { + return 0; + } + if (!aVal) { + return 1; + } + if (!bVal) { + return -1; + } + const aTime = new Date(aVal).getTime(); + const bTime = new Date(bVal).getTime(); + return currentSortDirection === "desc" ? bTime - aTime : aTime - bTime; + }); + } + function getSortIndicator(column) { + if (currentSortColumn !== column) { + return ""; + } + return currentSortDirection === "desc" ? " \u25BC" : " \u25B2"; + } + function getEditorStats(files) { + const stats = {}; + for (const sf of files) { + const editor = sf.editorSource || "Unknown"; + if (!stats[editor]) { + stats[editor] = { count: 0, interactions: 0 }; + } + stats[editor].count++; + stats[editor].interactions += sf.interactions; + } + return stats; + } + function safeText(value) { + if (value === null || value === void 0) { + return ""; + } + return escapeHtml(String(value)); + } + function renderSessionTable(detailedFiles, isLoading = false) { + if (isLoading) { + return ` +
+
\u23F3
+
Loading session files...
+
Analyzing up to 500 files from the last 14 days
+
+ `; + } + if (detailedFiles.length === 0) { + return '

No session files with activity in the last 14 days.

'; + } + const editorStats = getEditorStats(detailedFiles); + const editors = Object.keys(editorStats).sort(); + let filteredFiles = currentEditorFilter ? detailedFiles.filter((sf) => sf.editorSource === currentEditorFilter) : detailedFiles; + if (currentContextRefFilter) { + filteredFiles = filteredFiles.filter((sf) => { + const refType = currentContextRefFilter; + const value = sf.contextReferences[refType]; + return typeof value === "number" && value > 0; + }); + } + const totalInteractions = filteredFiles.reduce( + (sum, sf) => sum + Number(sf.interactions || 0), + 0 + ); + const totalContextRefs = filteredFiles.reduce( + (sum, sf) => sum + getTotalContextRefs(sf.contextReferences), + 0 + ); + const aggContextRefs = filteredFiles.reduce( + (agg, sf) => { + const r = sf.contextReferences; + agg.file += r.file; + agg.symbol += r.symbol; + agg.selection += r.selection; + agg.implicitSelection += r.implicitSelection; + agg.codebase += r.codebase; + agg.workspace += r.workspace; + agg.terminal += r.terminal; + agg.vscode += r.vscode; + agg.copilotInstructions += r.copilotInstructions; + agg.agentsMd += r.agentsMd; + return agg; + }, + { + file: 0, + symbol: 0, + selection: 0, + implicitSelection: 0, + codebase: 0, + workspace: 0, + terminal: 0, + vscode: 0, + copilotInstructions: 0, + agentsMd: 0 + } + ); + const sortedFiles = sortSessionFiles(filteredFiles); + const editorPanelsHtml = ` +
+
+
\u{1F310}
+
All Editors
+
${detailedFiles.length} sessions
+
+ ${editors.map( + (editor) => ` +
+
${getEditorIcon(editor)}
+
${escapeHtml(editor)}
+
${editorStats[editor].count} sessions \xB7 ${editorStats[editor].interactions} interactions
+
+ ` + ).join("")} +
+ `; + return ` + ${editorPanelsHtml} + +
+
+
\u{1F4C1} ${currentEditorFilter ? "Filtered" : "Total"} Sessions
+
${filteredFiles.length}
+
+
+
\u{1F4AC} Interactions
+
${totalInteractions}
+
+
+
\u{1F517} Context References
+
${safeText(totalContextRefs)}
+
+ ${totalContextRefs === 0 ? "None" : ""} + ${aggContextRefs.file > 0 ? `
#file ${aggContextRefs.file}
` : ""} + ${aggContextRefs.symbol > 0 ? `
#sym ${aggContextRefs.symbol}
` : ""} + ${aggContextRefs.implicitSelection > 0 ? `
implicit ${aggContextRefs.implicitSelection}
` : ""} + ${aggContextRefs.copilotInstructions > 0 ? `
\u{1F4CB} instructions ${aggContextRefs.copilotInstructions}
` : ""} + ${aggContextRefs.agentsMd > 0 ? `
\u{1F916} agents ${aggContextRefs.agentsMd}
` : ""} + ${aggContextRefs.workspace > 0 ? `
@workspace ${aggContextRefs.workspace}
` : ""} + ${aggContextRefs.vscode > 0 ? `
@vscode ${aggContextRefs.vscode}
` : ""} +
+
+
+
\u{1F4C5} Time Range
+
Last 14 days
+
+
+ +
+ + + + + + + + + + + + + + + + ${sortedFiles.map( + (sf, idx) => ` + + + + + + + + + + + + ` + ).join("")} + +
#EditorTitleRepositorySizeInteractionsContext RefsLast Interaction${getSortIndicator("lastInteraction")}Actions
${idx + 1}${getEditorIcon(sf.editorName || sf.editorSource)} ${escapeHtml(sf.editorName || sf.editorSource)} + ${sf.title ? `${escapeHtml(sf.title.length > 40 ? sf.title.substring(0, 40) + "..." : sf.title)}` : `(Empty session)`} + ${sf.repository ? escapeHtml(getRepoDisplayName(sf.repository)) : '\u2014'}${formatFileSize(sf.size)}${sanitizeNumber(sf.interactions)}${sanitizeNumber(getTotalContextRefs(sf.contextReferences))}${formatDate(sf.lastInteraction)} + \u{1F4C4} View +
+
+ `; + } + function counterRow(key, label, value) { + return ` + + ${escapeHtml(label)} + + + + + + + `; + } + function stringRow(key, label, value) { + const display2 = value ? `\u2705 ${escapeHtml(value)}` : "\u274C (not set)"; + return ` + + ${escapeHtml(label)} + + ${display2} + + `; + } + function flagRow(key, label, value) { + return ` + + ${escapeHtml(label)} + + + ${value ? "\u2705 true" : "\u274C false"} + + + + + `; + } + function renderDebugTab(counters) { + const c = counters ?? { openCount: 0, unknownMcpOpenCount: 0, fluencyBannerDismissed: false, unknownMcpDismissedVersion: "" }; + return ` +
+
+
\u{1F41B} Debug \u2014 Global State Counters
+
Visible only when a debugger is attached. Edit counters and dismissed flags stored in VS Code global state, then click Set to apply. Changes take effect immediately.
+
+
+

Notification Counters

+ + ${counterRow("extension.openCount", "extension.openCount (fluency banner threshold: 5)", c.openCount)} + ${counterRow("extension.unknownMcpOpenCount", "extension.unknownMcpOpenCount (unknown MCP threshold: 8)", c.unknownMcpOpenCount)} +
+

Dismissed Flags

+ + ${flagRow("news.fluencyScoreBanner.v1.dismissed", "news.fluencyScoreBanner.v1.dismissed", c.fluencyBannerDismissed)} + ${stringRow("news.unknownMcpTools.dismissedVersion", "news.unknownMcpTools.dismissedVersion", c.unknownMcpDismissedVersion)} +
+
+ +
+
+
`; + } + function renderBackendStoragePanel(backendInfo) { + if (!backendInfo) { + return ` +
+
\u2601\uFE0F Azure Storage Backend
+
+ Backend storage information is not available. This may be a temporary issue. +
+
+ `; + } + const statusColor = backendInfo.isConfigured ? "#2d6a4f" : backendInfo.enabled ? "#d97706" : "#666"; + const statusIcon = backendInfo.isConfigured ? "\u2705" : backendInfo.enabled ? "\u26A0\uFE0F" : "\u26AA"; + const statusText = backendInfo.isConfigured ? "Configured & Enabled" : backendInfo.enabled ? "Enabled but Not Configured" : "Disabled"; + const configButtonText = backendInfo.isConfigured ? "\u2699\uFE0F Manage Backend" : "\u{1F527} Configure Backend"; + const configButtonStyle = backendInfo.isConfigured ? "secondary" : ""; + return ` +
+
\u2601\uFE0F Azure Storage Backend
+
+ Sync your token usage data to Azure Storage Tables for team-wide reporting and multi-device access. + Configure Azure resources and authentication settings to enable cloud synchronization. +
+
+ +
+
+
${statusIcon} Backend Status
+
${statusText}
+
+
+
\u{1F510} Auth Mode
+
${backendInfo.authMode === "entraId" ? "Entra ID" : "Shared Key"}
+
+
+
\u{1F465} Sharing Profile
+
${escapeHtml(backendInfo.sharingProfile)}
+
+
+
\u{1F552} Last Sync
+
${backendInfo.lastSyncTime ? getTimeSince(backendInfo.lastSyncTime) : "Never"}
+
+
+ + ${backendInfo.isConfigured ? ` +
+

\u{1F4CA} Configuration Details

+ + + + + + + + + + + + + + + + + + + + + + + +
Storage Account${escapeHtml(backendInfo.storageAccount)}
Subscription ID${escapeHtml(backendInfo.subscriptionId)}
Resource Group${escapeHtml(backendInfo.resourceGroup)}
Aggregation Table${escapeHtml(backendInfo.aggTable)}
Events Table${escapeHtml(backendInfo.eventsTable)}
+
+ +
+

\u{1F4C8} Local Session Statistics

+
+
+
\u{1F4BB} Unique Devices
+
${escapeHtml(String(backendInfo.deviceCount))}
+
Based on workspace IDs
+
+
+
\u{1F4C1} Total Sessions
+
${escapeHtml(String(backendInfo.sessionCount))}
+
Local session files
+
+
+
\u2601\uFE0F Cloud Records
+
${backendInfo.recordCount !== null ? escapeHtml(String(backendInfo.recordCount)) : "\u2014"}
+
Azure Storage records
+
+
+
\u{1F504} Sync Status
+
${backendInfo.lastSyncTime ? formatDate(backendInfo.lastSyncTime) : "Never"}
+
+
+
+ +
+

\u2139\uFE0F About Azure Storage Backend

+

+ The Azure Storage backend enables: +

+
    +
  • Team-wide token usage reporting and analytics
  • +
  • Multi-device synchronization of your usage data
  • +
  • Long-term storage and historical analysis
  • +
  • Configurable privacy levels (anonymous, pseudonymous, or identified)
  • +
+
+ ` : ` +
+

\u{1F680} Get Started with Azure Storage

+

+ To enable cloud synchronization, you'll need to configure an Azure Storage account. + The setup wizard will guide you through the process. +

+
    +
  • Azure subscription with Storage Account access
  • +
  • Appropriate permissions (Storage Table Data Contributor or Storage Account Key)
  • +
  • VS Code signed in with your Azure account (for Entra ID auth)
  • +
+
+ `} + +
+ + ${backendInfo.isConfigured ? ` + + ` : ""} +
+ `; + } + function renderLayout(data) { + const root = document.getElementById("root"); + if (!root) { + return; + } + let sessionFilesHtml = ""; + const sessionFolders = data.sessionFolders || []; + if (sessionFolders.length > 0) { + const sorted = [...sessionFolders].sort((a, b) => b.count - a.count); + sessionFilesHtml = ` +
+

Main Session Folders (by editor root):

+ + + + + + + + + + `; + const totalSessions = sorted.reduce((sum, sf) => sum + sf.count, 0); + console.log( + "[Diagnostics] Total sessions calculated:", + totalSessions, + "from", + sorted.length, + "folders" + ); + sorted.forEach( + (sf) => { + let display2 = sf.dir; + const home = window.process?.env?.HOME || window.process?.env?.USERPROFILE || ""; + if (home && display2.startsWith(home)) { + display2 = display2.replace(home, "~"); + } + const editorName = sf.editorName || "Unknown"; + sessionFilesHtml += ` + + + + + + `; + } + ); + sessionFilesHtml += ` + + + + + `; + console.log("[Diagnostics] Total row HTML added to sessionFilesHtml"); + sessionFilesHtml += ` + +
FolderEditor# of SessionsOpen
${escapeHtml(display2)}${getEditorIcon(editorName)} ${escapeHtml(editorName)}${sf.count}Open directory
Total:${totalSessions}
+
`; + } + let escapedReport = escapeHtml(data.report); + const reportIsLoading = data.report === LOADING_PLACEHOLDER; + if (!reportIsLoading) { + escapedReport = removeSessionFilesSection(escapedReport); + } else { + escapedReport = LOADING_MESSAGE.trim(); + } + const detailedFiles = data.detailedSessionFiles || []; + root.innerHTML = ` + + +
+
+
+ \u{1F50D} + Diagnostic Report +
+
+ ${buttonHtml("btn-refresh")} + ${buttonHtml("btn-details")} + ${buttonHtml("btn-chart")} + ${buttonHtml("btn-usage")} + ${buttonHtml("btn-environmental")} + ${buttonHtml("btn-maturity")} + ${data?.backendConfigured ? buttonHtml("btn-dashboard") : ""} +
+
+ +
+ + + + + ${data.isDebugMode ? '' : ""} +
+ +
+
+
\u{1F4CB} About This Report
+
+ This diagnostic report contains information about your GitHub Copilot Token Tracker + extension setup and usage statistics.
It does not include any of your + code or conversation content. You can safely share this report when reporting issues. +
+
+
${escapedReport}
+ ${sessionFilesHtml} +
+ + + +
+
+ +
+
+
\u{1F4C1} Session File Analysis
+
+ This tab shows session files with activity in the last 14 days from all detected editors.
+ Click on an editor panel to filter, click column headers to sort, and click a file name to open it. +
+
+
${renderSessionTable(detailedFiles, detailedFiles.length === 0)}
+
+ +
+
+
\u{1F4BE} Cache Information
+
+ The extension caches session file data to improve performance and reduce file system operations. + Cache is stored in VS Code's global state and persists across sessions. +
+
+
+
+
+
\u{1F4E6} Cache Entries
+
${data.cacheInfo?.size || 0}
+
+
+
\u{1F4BE} Cache Size
+
${data.cacheInfo?.sizeInMB ? data.cacheInfo.sizeInMB.toFixed(2) + " MB" : "N/A"}
+
+
+
\u{1F552} Last Updated
+
${data.cacheInfo?.lastUpdated ? formatDate(data.cacheInfo.lastUpdated) : "Never"}
+
+
+
\u23F1\uFE0F Cache Age
+
${data.cacheInfo?.lastUpdated ? getTimeSince(data.cacheInfo.lastUpdated) : "N/A"}
+
+
+
+

Storage Location

+
+ ${escapeHtml(data.cacheInfo?.location || "VS Code Global State")} + ${data.cacheInfo?.storagePath ? ` Open storage location` : ""} +
+

+ Cache is stored in VS Code's global state (extension storage) and includes: +

    +
  • Token counts per session file
  • +
  • Interaction counts
  • +
  • Model usage statistics
  • +
  • File modification timestamps for validation
  • +
  • Usage analysis data (tool calls, modes, context references)
  • +
+

+
+
+

Cache Management

+

+ Clearing the cache will force the extension to re-read and re-analyze all session files on the next update. + This can help resolve issues with stale or incorrect data. +

+ +
+
+
+ +
+ ${renderBackendStoragePanel(data.backendStorageInfo)} +
+ ${data.isDebugMode ? renderDebugTab(data.globalStateCounters) : ""} +
+ `; + let storedDetailedFiles = detailedFiles; + let isLoading = detailedFiles.length === 0; + window.addEventListener("message", (event) => { + const message = event.data; + if (message.command === "diagnosticDataLoaded") { + if (message.report) { + const reportTabContent = document.getElementById("tab-report"); + if (reportTabContent) { + const processedReport = removeSessionFilesSection(message.report); + const reportPre = reportTabContent.querySelector(".report-content"); + if (reportPre) { + reportPre.textContent = processedReport; + } + } + } + if (message.backendStorageInfo) { + const backendTabContent = document.getElementById("tab-backend"); + if (backendTabContent) { + backendTabContent.innerHTML = renderBackendStoragePanel( + message.backendStorageInfo + ); + setupBackendButtonHandlers(); + } + } else { + console.warn("diagnosticDataLoaded received but backendStorageInfo is missing or undefined"); + } + if (message.sessionFolders && message.sessionFolders.length > 0) { + const reportTabContent = document.getElementById("tab-report"); + if (reportTabContent) { + const sorted = [...message.sessionFolders].sort( + (a, b) => b.count - a.count + ); + let container = reportTabContent.querySelector( + ".session-folders-table" + ); + if (!container) { + container = document.createElement("div"); + container.className = "session-folders-table"; + } else { + while (container.firstChild) { + container.removeChild(container.firstChild); + } + } + const heading = document.createElement("h4"); + heading.textContent = "Main Session Folders (by editor root):"; + container.appendChild(heading); + const table = document.createElement("table"); + table.className = "session-table"; + container.appendChild(table); + const thead = document.createElement("thead"); + table.appendChild(thead); + const headerRow = document.createElement("tr"); + thead.appendChild(headerRow); + const headers = ["Folder", "Editor", "# of Sessions", "Open"]; + headers.forEach((text) => { + const th = document.createElement("th"); + th.textContent = text; + headerRow.appendChild(th); + }); + const tbody = document.createElement("tbody"); + table.appendChild(tbody); + sorted.forEach((sf) => { + let display2 = sf.dir; + const home = window.process?.env?.HOME || window.process?.env?.USERPROFILE || ""; + if (home && display2.startsWith(home)) { + display2 = display2.replace(home, "~"); + } + const editorName = sf.editorName || "Unknown"; + const row = document.createElement("tr"); + const folderCell = document.createElement("td"); + folderCell.setAttribute("title", escapeHtml(sf.dir)); + folderCell.textContent = escapeHtml(display2); + row.appendChild(folderCell); + const editorCell = document.createElement("td"); + const editorBadge = document.createElement("span"); + editorBadge.className = getEditorBadgeClass(editorName); + editorBadge.textContent = `${getEditorIcon(editorName)} ${escapeHtml(editorName)}`; + editorCell.appendChild(editorBadge); + row.appendChild(editorCell); + const countCell = document.createElement("td"); + countCell.textContent = String(sf.count); + row.appendChild(countCell); + const openCell = document.createElement("td"); + const openLink = document.createElement("a"); + openLink.href = "#"; + openLink.className = "reveal-link"; + openLink.setAttribute("data-path", encodeURIComponent(sf.dir)); + openLink.textContent = "Open directory"; + openCell.appendChild(openLink); + row.appendChild(openCell); + tbody.appendChild(row); + }); + const totalSessions = sorted.reduce((sum, sf) => sum + sf.count, 0); + const totalRow = document.createElement("tr"); + totalRow.style.borderTop = "2px solid var(--vscode-panel-border)"; + totalRow.style.fontWeight = "bold"; + totalRow.style.background = "rgba(255, 255, 255, 0.05)"; + const totalLabelCell = document.createElement("td"); + totalLabelCell.setAttribute("colspan", "2"); + totalLabelCell.style.textAlign = "right"; + totalLabelCell.style.paddingRight = "16px"; + totalLabelCell.textContent = "Total:"; + totalRow.appendChild(totalLabelCell); + const totalCountCell = document.createElement("td"); + totalCountCell.textContent = totalSessions.toString(); + totalRow.appendChild(totalCountCell); + const totalEmptyCell = document.createElement("td"); + totalRow.appendChild(totalEmptyCell); + tbody.appendChild(totalRow); + const existingTable = reportTabContent.querySelector( + ".session-folders-table" + ); + if (!existingTable) { + const reportContent = reportTabContent.querySelector(".report-content"); + if (reportContent) { + reportContent.insertAdjacentElement("afterend", container); + } else { + reportTabContent.appendChild(container); + } + } + setupStorageLinkHandlers(); + } + } + if (message.candidatePaths && message.candidatePaths.length > 0) { + const reportTabContent = document.getElementById("tab-report"); + if (reportTabContent) { + const existing = reportTabContent.querySelector(".candidate-paths-table"); + if (existing) { + existing.remove(); + } + const candidateEl = buildCandidatePathsElement(message.candidatePaths); + const foldersTable = reportTabContent.querySelector(".session-folders-table"); + if (foldersTable) { + foldersTable.insertAdjacentElement("afterend", candidateEl); + } else { + const reportContent = reportTabContent.querySelector(".report-content"); + if (reportContent) { + reportContent.insertAdjacentElement("afterend", candidateEl); + } else { + reportTabContent.appendChild(candidateEl); + } + } + } + } + } else if (message.command === "diagnosticDataError") { + console.error("Error loading diagnostic data:", message.error); + const root2 = document.getElementById("root"); + if (root2) { + const errorDiv = document.createElement("div"); + errorDiv.style.cssText = "color: #ff6b6b; padding: 20px; text-align: center;"; + errorDiv.innerHTML = ` +

\u26A0\uFE0F Error Loading Diagnostic Data

+

${escapeHtml(message.error || "Unknown error")}

+ `; + root2.insertBefore(errorDiv, root2.firstChild); + } + } else if (message.command === "sessionFilesLoaded" && message.detailedSessionFiles) { + storedDetailedFiles = message.detailedSessionFiles; + isLoading = false; + const sessionsTab = document.querySelector('.tab[data-tab="sessions"]'); + if (sessionsTab) { + sessionsTab.textContent = `\u{1F4C1} Session Files (${storedDetailedFiles.length})`; + } + reRenderTable(); + } else if (message.command === "cacheCleared") { + const btnReport = document.getElementById( + "btn-clear-cache" + ); + const btnTab = document.getElementById( + "btn-clear-cache-tab" + ); + if (btnReport) { + btnReport.style.background = "#2d6a4f"; + btnReport.innerHTML = "\u2705Cache Cleared"; + btnReport.disabled = false; + } + if (btnTab) { + btnTab.style.background = "#2d6a4f"; + btnTab.innerHTML = "\u2705Cache Cleared"; + btnTab.disabled = false; + } + setTimeout(() => { + if (btnReport) { + btnReport.style.background = ""; + btnReport.innerHTML = "\u{1F5D1}\uFE0FClear Cache"; + } + if (btnTab) { + btnTab.style.background = ""; + btnTab.innerHTML = "\u{1F5D1}\uFE0FClear Cache"; + } + }, 2e3); + } else if (message.command === "cacheRefreshed") { + if (message.cacheInfo) { + const cacheInfo = message.cacheInfo; + const cacheTabContent = document.getElementById("tab-cache"); + if (cacheTabContent) { + const summaryCards = cacheTabContent.querySelectorAll(".summary-card"); + if (summaryCards.length >= 4) { + const entriesValue = summaryCards[0]?.querySelector(".summary-value"); + if (entriesValue) { + entriesValue.textContent = String(cacheInfo.size); + } + const sizeValue = summaryCards[1]?.querySelector(".summary-value"); + if (sizeValue) { + sizeValue.textContent = `${cacheInfo.sizeInMB.toFixed(2)} MB`; + } + const lastUpdatedValue = summaryCards[2]?.querySelector(".summary-value"); + if (lastUpdatedValue) { + const date = new Date(cacheInfo.lastUpdated); + lastUpdatedValue.textContent = date.toLocaleString(); + } + const ageValue = summaryCards[3]?.querySelector(".summary-value"); + if (ageValue) { + ageValue.textContent = "0 seconds ago"; + } + } + } + } + } + }); + function setupStorageLinkHandlers() { + document.querySelectorAll(".open-storage-link").forEach((link) => { + link.addEventListener("click", (e) => { + e.preventDefault(); + const path = decodeURIComponent( + link.getAttribute("data-path") || "" + ); + if (path) { + vscode.postMessage({ command: "revealPath", path }); + } + }); + }); + } + function activateTab(tabId) { + const tabButton = document.querySelector(`.tab[data-tab="${tabId}"]`); + const tabContent = document.getElementById(`tab-${tabId}`); + if (tabButton && tabContent) { + document.querySelectorAll(".tab").forEach((t) => t.classList.remove("active")); + document.querySelectorAll(".tab-content").forEach((c) => c.classList.remove("active")); + tabButton.classList.add("active"); + tabContent.classList.add("active"); + return true; + } + return false; + } + document.querySelectorAll(".tab").forEach((tab) => { + tab.addEventListener("click", () => { + const tabId = tab.getAttribute("data-tab"); + if (tabId && activateTab(tabId)) { + vscode.setState({ activeTab: tabId }); + } + }); + }); + function setupSortHandlers() { + document.querySelectorAll(".sortable").forEach((header) => { + header.addEventListener("click", () => { + const sortColumn = header.getAttribute( + "data-sort" + ); + if (sortColumn) { + if (currentSortColumn === sortColumn) { + currentSortDirection = currentSortDirection === "desc" ? "asc" : "desc"; + } else { + currentSortColumn = sortColumn; + currentSortDirection = "desc"; + } + reRenderTable(); + } + }); + }); + } + function setupEditorFilterHandlers() { + document.querySelectorAll(".editor-panel").forEach((panel) => { + panel.addEventListener("click", () => { + const editor = panel.getAttribute("data-editor"); + currentEditorFilter = editor === "" ? null : editor; + reRenderTable(); + }); + }); + } + function setupContextRefFilterHandlers() { + document.querySelectorAll(".context-ref-filter").forEach((filter) => { + filter.addEventListener("click", () => { + const refType = filter.getAttribute( + "data-ref-type" + ); + if (currentContextRefFilter === refType) { + currentContextRefFilter = null; + } else { + currentContextRefFilter = refType; + } + reRenderTable(); + }); + }); + } + function setupBackendButtonHandlers() { + document.getElementById("btn-configure-backend")?.addEventListener("click", () => { + vscode.postMessage({ command: "configureBackend" }); + }); + document.getElementById("btn-open-settings")?.addEventListener("click", () => { + vscode.postMessage({ command: "openSettings" }); + }); + } + function reRenderTable() { + const container = document.getElementById("session-table-container"); + if (container) { + container.innerHTML = renderSessionTable(storedDetailedFiles, isLoading); + if (!isLoading) { + setupSortHandlers(); + setupEditorFilterHandlers(); + setupContextRefFilterHandlers(); + setupFileLinks(); + } + } + } + function setupFileLinks() { + document.querySelectorAll(".session-file-link").forEach((link) => { + link.addEventListener("click", (e) => { + e.preventDefault(); + const file = decodeURIComponent( + link.getAttribute("data-file") || "" + ); + vscode.postMessage({ command: "openSessionFile", file }); + }); + }); + document.querySelectorAll(".view-formatted-link").forEach((link) => { + link.addEventListener("click", (e) => { + e.preventDefault(); + const file = decodeURIComponent( + link.getAttribute("data-file") || "" + ); + vscode.postMessage({ command: "openFormattedJsonlFile", file }); + }); + }); + document.querySelectorAll(".reveal-link").forEach((link) => { + link.addEventListener("click", (e) => { + e.preventDefault(); + const path = decodeURIComponent( + link.getAttribute("data-path") || "" + ); + vscode.postMessage({ command: "revealPath", path }); + }); + }); + } + document.getElementById("btn-copy")?.addEventListener("click", () => { + vscode.postMessage({ command: "copyReport" }); + }); + document.getElementById("btn-issue")?.addEventListener("click", () => { + vscode.postMessage({ command: "openIssue" }); + }); + function updateCacheNumbers() { + const cacheTabContent = document.getElementById("tab-cache"); + if (cacheTabContent) { + const summaryCards = cacheTabContent.querySelectorAll(".summary-card"); + if (summaryCards.length >= 4) { + const entriesValue = summaryCards[0]?.querySelector(".summary-value"); + if (entriesValue) { + entriesValue.textContent = "0"; + } + const sizeValue = summaryCards[1]?.querySelector(".summary-value"); + if (sizeValue) { + sizeValue.textContent = "0 MB"; + } + const lastUpdatedValue = summaryCards[2]?.querySelector(".summary-value"); + if (lastUpdatedValue) { + lastUpdatedValue.textContent = "Never"; + } + const ageValue = summaryCards[3]?.querySelector(".summary-value"); + if (ageValue) { + ageValue.textContent = "N/A"; + } + } + } + } + document.getElementById("btn-clear-cache")?.addEventListener("click", () => { + const btn = document.getElementById( + "btn-clear-cache" + ); + if (btn) { + btn.style.background = "#d97706"; + btn.innerHTML = "\u23F3Clearing..."; + btn.disabled = true; + } + updateCacheNumbers(); + vscode.postMessage({ command: "clearCache" }); + }); + document.getElementById("btn-clear-cache-tab")?.addEventListener("click", () => { + const btn = document.getElementById( + "btn-clear-cache-tab" + ); + if (btn) { + btn.style.background = "#d97706"; + btn.innerHTML = "\u23F3Clearing..."; + btn.disabled = true; + } + updateCacheNumbers(); + vscode.postMessage({ command: "clearCache" }); + }); + document.addEventListener("click", (event) => { + const target = event.target; + if (!target) { + return; + } + if (target.id === "btn-clear-cache" || target.id === "btn-clear-cache-tab") { + target.style.background = "#d97706"; + target.innerHTML = "\u23F3Clearing..."; + if (target instanceof HTMLButtonElement) { + target.disabled = true; + } + updateCacheNumbers(); + vscode.postMessage({ command: "clearCache" }); + } + if (target.id === "btn-reset-debug-counters") { + vscode.postMessage({ command: "resetDebugCounters" }); + } + if (target.classList.contains("debug-counter-set")) { + const key = target.getAttribute("data-key"); + const row = target.closest("tr"); + const input = row?.querySelector(".debug-counter-input"); + if (key && input) { + const value = parseInt(input.value, 10); + if (!isNaN(value)) { + vscode.postMessage({ command: "setDebugCounter", key, value }); + } + } + } + if (target.classList.contains("debug-flag-set")) { + const key = target.getAttribute("data-key"); + const row = target.closest("tr"); + const input = row?.querySelector(".debug-flag-input"); + if (key && input) { + vscode.postMessage({ command: "setDebugFlag", key, value: input.checked }); + } + } + }); + document.getElementById("btn-refresh")?.addEventListener( + "click", + () => vscode.postMessage({ command: "refresh" }) + ); + document.getElementById("btn-chart")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showChart" }) + ); + document.getElementById("btn-usage")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showUsageAnalysis" }) + ); + document.getElementById("btn-details")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showDetails" }) + ); + document.getElementById("btn-diagnostics")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showDiagnostics" }) + ); + document.getElementById("btn-maturity")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showMaturity" }) + ); + document.getElementById("btn-dashboard")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showDashboard" }) + ); + document.getElementById("btn-environmental")?.addEventListener( + "click", + () => vscode.postMessage({ command: "showEnvironmental" }) + ); + setupSortHandlers(); + setupEditorFilterHandlers(); + setupContextRefFilterHandlers(); + setupBackendButtonHandlers(); + setupFileLinks(); + setupStorageLinkHandlers(); + const savedState = vscode.getState(); + if (savedState?.activeTab && !activateTab(savedState.activeTab)) { + activateTab("report"); + } + } + async function bootstrap() { + const { provideVSCodeDesignSystem: provideVSCodeDesignSystem2, vsCodeButton: vsCodeButton2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports)); + provideVSCodeDesignSystem2().register(vsCodeButton2()); + if (!initialData) { + const root = document.getElementById("root"); + if (root) { + root.textContent = "No data available."; + } + return; + } + renderLayout(initialData); + } + void bootstrap(); +})(); +/*! Bundled license information: + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tabbable/dist/index.esm.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=diagnostics.js.map diff --git a/visualstudio-extension/src/CopilotTokenTracker/webview/environmental.js b/visualstudio-extension/src/CopilotTokenTracker/webview/environmental.js new file mode 100644 index 00000000..0ced3e65 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/webview/environmental.js @@ -0,0 +1,20527 @@ +"use strict"; +(() => { + var __defProp = Object.defineProperty; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); + }; + + // node_modules/@microsoft/fast-element/dist/esm/platform.js + function createMetadataLocator() { + const metadataLookup = /* @__PURE__ */ new WeakMap(); + return function(target) { + let metadata = metadataLookup.get(target); + if (metadata === void 0) { + let currentTarget = Reflect.getPrototypeOf(target); + while (metadata === void 0 && currentTarget !== null) { + metadata = metadataLookup.get(currentTarget); + currentTarget = Reflect.getPrototypeOf(currentTarget); + } + metadata = metadata === void 0 ? [] : metadata.slice(0); + metadataLookup.set(target, metadata); + } + return metadata; + }; + } + var $global, propConfig, FAST, emptyArray; + var init_platform = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/platform.js"() { + $global = (function() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + try { + return new Function("return this")(); + } catch (_a) { + return {}; + } + })(); + if ($global.trustedTypes === void 0) { + $global.trustedTypes = { createPolicy: (n, r) => r }; + } + propConfig = { + configurable: false, + enumerable: false, + writable: false + }; + if ($global.FAST === void 0) { + Reflect.defineProperty($global, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, propConfig)); + } + FAST = $global.FAST; + if (FAST.getById === void 0) { + const storage = /* @__PURE__ */ Object.create(null); + Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) { + let found = storage[id]; + if (found === void 0) { + found = initialize ? storage[id] = initialize() : null; + } + return found; + } }, propConfig)); + } + emptyArray = Object.freeze([]); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/dom.js + var updateQueue, fastHTMLPolicy, htmlPolicy, marker, _interpolationStart, _interpolationEnd, DOM; + var init_dom = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/dom.js"() { + init_platform(); + updateQueue = $global.FAST.getById(1, () => { + const tasks = []; + const pendingErrors = []; + function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } + } + function tryRunTask(task) { + try { + task.call(); + } catch (error) { + pendingErrors.push(error); + setTimeout(throwFirstError, 0); + } + } + function process() { + const capacity = 1024; + let index = 0; + while (index < tasks.length) { + tryRunTask(tasks[index]); + index++; + if (index > capacity) { + for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) { + tasks[scan] = tasks[scan + index]; + } + tasks.length -= index; + index = 0; + } + } + tasks.length = 0; + } + function enqueue(callable) { + if (tasks.length < 1) { + $global.requestAnimationFrame(process); + } + tasks.push(callable); + } + return Object.freeze({ + enqueue, + process + }); + }); + fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { + createHTML: (html2) => html2 + }); + htmlPolicy = fastHTMLPolicy; + marker = `fast-${Math.random().toString(36).substring(2, 8)}`; + _interpolationStart = `${marker}{`; + _interpolationEnd = `}${marker}`; + DOM = Object.freeze({ + /** + * Indicates whether the DOM supports the adoptedStyleSheets feature. + */ + supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, + /** + * Sets the HTML trusted types policy used by the templating engine. + * @param policy - The policy to set for HTML. + * @remarks + * This API can only be called once, for security reasons. It should be + * called by the application developer at the start of their program. + */ + setHTMLPolicy(policy) { + if (htmlPolicy !== fastHTMLPolicy) { + throw new Error("The HTML policy can only be set once."); + } + htmlPolicy = policy; + }, + /** + * Turns a string into trusted HTML using the configured trusted types policy. + * @param html - The string to turn into trusted HTML. + * @remarks + * Used internally by the template engine when creating templates + * and setting innerHTML. + */ + createHTML(html2) { + return htmlPolicy.createHTML(html2); + }, + /** + * Determines if the provided node is a template marker used by the runtime. + * @param node - The node to test. + */ + isMarker(node) { + return node && node.nodeType === 8 && node.data.startsWith(marker); + }, + /** + * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. + * @param node - The marker node to extract the index from. + */ + extractDirectiveIndexFromMarker(node) { + return parseInt(node.data.replace(`${marker}:`, "")); + }, + /** + * Creates a placeholder string suitable for marking out a location *within* + * an attribute value or HTML content. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by binding directives. + */ + createInterpolationPlaceholder(index) { + return `${_interpolationStart}${index}${_interpolationEnd}`; + }, + /** + * Creates a placeholder that manifests itself as an attribute on an + * element. + * @param attributeName - The name of the custom attribute. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by attribute directives such as `ref`, `slotted`, and `children`. + */ + createCustomAttributePlaceholder(attributeName, index) { + return `${attributeName}="${this.createInterpolationPlaceholder(index)}"`; + }, + /** + * Creates a placeholder that manifests itself as a marker within the DOM structure. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by structural directives such as `repeat`. + */ + createBlockPlaceholder(index) { + return ``; + }, + /** + * Schedules DOM update work in the next async batch. + * @param callable - The callable function or object to queue. + */ + queueUpdate: updateQueue.enqueue, + /** + * Immediately processes all work previously scheduled + * through queueUpdate. + * @remarks + * This also forces nextUpdate promises + * to resolve. + */ + processUpdates: updateQueue.process, + /** + * Resolves with the next DOM update. + */ + nextUpdate() { + return new Promise(updateQueue.enqueue); + }, + /** + * Sets an attribute value on an element. + * @param element - The element to set the attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is `null` or `undefined`, the attribute is removed, otherwise + * it is set to the provided value using the standard `setAttribute` API. + */ + setAttribute(element, attributeName, value) { + if (value === null || value === void 0) { + element.removeAttribute(attributeName); + } else { + element.setAttribute(attributeName, value); + } + }, + /** + * Sets a boolean attribute value. + * @param element - The element to set the boolean attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is true, the attribute is added; otherwise it is removed. + */ + setBooleanAttribute(element, attributeName, value) { + value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); + }, + /** + * Removes all the child nodes of the provided parent node. + * @param parent - The node to remove the children from. + */ + removeChildNodes(parent) { + for (let child = parent.firstChild; child !== null; child = parent.firstChild) { + parent.removeChild(child); + } + }, + /** + * Creates a TreeWalker configured to walk a template fragment. + * @param fragment - The fragment to walk. + */ + createTemplateWalker(fragment) { + return document.createTreeWalker( + fragment, + 133, + // element, text, comment + null, + false + ); + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js + var SubscriberSet, PropertyChangeNotifier; + var init_notifier = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js"() { + SubscriberSet = class { + /** + * Creates an instance of SubscriberSet for the specified source. + * @param source - The object source that subscribers will receive notifications from. + * @param initialSubscriber - An initial subscriber to changes. + */ + constructor(source, initialSubscriber) { + this.sub1 = void 0; + this.sub2 = void 0; + this.spillover = void 0; + this.source = source; + this.sub1 = initialSubscriber; + } + /** + * Checks whether the provided subscriber has been added to this set. + * @param subscriber - The subscriber to test for inclusion in this set. + */ + has(subscriber) { + return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + */ + subscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.has(subscriber)) { + return; + } + if (this.sub1 === void 0) { + this.sub1 = subscriber; + return; + } + if (this.sub2 === void 0) { + this.sub2 = subscriber; + return; + } + this.spillover = [this.sub1, this.sub2, subscriber]; + this.sub1 = void 0; + this.sub2 = void 0; + } else { + const index = spillover.indexOf(subscriber); + if (index === -1) { + spillover.push(subscriber); + } + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + */ + unsubscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.sub1 === subscriber) { + this.sub1 = void 0; + } else if (this.sub2 === subscriber) { + this.sub2 = void 0; + } + } else { + const index = spillover.indexOf(subscriber); + if (index !== -1) { + spillover.splice(index, 1); + } + } + } + /** + * Notifies all subscribers. + * @param args - Data passed along to subscribers during notification. + */ + notify(args) { + const spillover = this.spillover; + const source = this.source; + if (spillover === void 0) { + const sub1 = this.sub1; + const sub2 = this.sub2; + if (sub1 !== void 0) { + sub1.handleChange(source, args); + } + if (sub2 !== void 0) { + sub2.handleChange(source, args); + } + } else { + for (let i = 0, ii = spillover.length; i < ii; ++i) { + spillover[i].handleChange(source, args); + } + } + } + }; + PropertyChangeNotifier = class { + /** + * Creates an instance of PropertyChangeNotifier for the specified source. + * @param source - The object source that subscribers will receive notifications from. + */ + constructor(source) { + this.subscribers = {}; + this.sourceSubscribers = null; + this.source = source; + } + /** + * Notifies all subscribers, based on the specified property. + * @param propertyName - The property name, passed along to subscribers during notification. + */ + notify(propertyName) { + var _a; + const subscribers = this.subscribers[propertyName]; + if (subscribers !== void 0) { + subscribers.notify(propertyName); + } + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. + */ + subscribe(subscriber, propertyToWatch) { + var _a; + if (propertyToWatch) { + let subscribers = this.subscribers[propertyToWatch]; + if (subscribers === void 0) { + this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); + } + subscribers.subscribe(subscriber); + } else { + this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); + this.sourceSubscribers.subscribe(subscriber); + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. + */ + unsubscribe(subscriber, propertyToUnwatch) { + var _a; + if (propertyToUnwatch) { + const subscribers = this.subscribers[propertyToUnwatch]; + if (subscribers !== void 0) { + subscribers.unsubscribe(subscriber); + } + } else { + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/observable.js + function observable(target, nameOrAccessor) { + Observable.defineProperty(target, nameOrAccessor); + } + function volatile(target, name, descriptor) { + return Object.assign({}, descriptor, { + get: function() { + Observable.trackVolatile(); + return descriptor.get.apply(this); + } + }); + } + var Observable, contextEvent, ExecutionContext, defaultExecutionContext; + var init_observable = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/observable.js"() { + init_dom(); + init_platform(); + init_notifier(); + Observable = FAST.getById(2, () => { + const volatileRegex = /(:|&&|\|\||if)/; + const notifierLookup = /* @__PURE__ */ new WeakMap(); + const queueUpdate = DOM.queueUpdate; + let watcher = void 0; + let createArrayObserver = (array) => { + throw new Error("Must call enableArrayObservation before observing arrays."); + }; + function getNotifier(source) { + let found = source.$fastController || notifierLookup.get(source); + if (found === void 0) { + if (Array.isArray(source)) { + found = createArrayObserver(source); + } else { + notifierLookup.set(source, found = new PropertyChangeNotifier(source)); + } + } + return found; + } + const getAccessors = createMetadataLocator(); + class DefaultObservableAccessor { + constructor(name) { + this.name = name; + this.field = `_${name}`; + this.callback = `${name}Changed`; + } + getValue(source) { + if (watcher !== void 0) { + watcher.watch(source, this.name); + } + return source[this.field]; + } + setValue(source, newValue) { + const field = this.field; + const oldValue = source[field]; + if (oldValue !== newValue) { + source[field] = newValue; + const callback = source[this.callback]; + if (typeof callback === "function") { + callback.call(source, oldValue, newValue); + } + getNotifier(source).notify(this.name); + } + } + } + class BindingObserverImplementation extends SubscriberSet { + constructor(binding, initialSubscriber, isVolatileBinding = false) { + super(binding, initialSubscriber); + this.binding = binding; + this.isVolatileBinding = isVolatileBinding; + this.needsRefresh = true; + this.needsQueue = true; + this.first = this; + this.last = null; + this.propertySource = void 0; + this.propertyName = void 0; + this.notifier = void 0; + this.next = void 0; + } + observe(source, context) { + if (this.needsRefresh && this.last !== null) { + this.disconnect(); + } + const previousWatcher = watcher; + watcher = this.needsRefresh ? this : void 0; + this.needsRefresh = this.isVolatileBinding; + const result = this.binding(source, context); + watcher = previousWatcher; + return result; + } + disconnect() { + if (this.last !== null) { + let current = this.first; + while (current !== void 0) { + current.notifier.unsubscribe(this, current.propertyName); + current = current.next; + } + this.last = null; + this.needsRefresh = this.needsQueue = true; + } + } + watch(propertySource, propertyName) { + const prev = this.last; + const notifier = getNotifier(propertySource); + const current = prev === null ? this.first : {}; + current.propertySource = propertySource; + current.propertyName = propertyName; + current.notifier = notifier; + notifier.subscribe(this, propertyName); + if (prev !== null) { + if (!this.needsRefresh) { + let prevValue; + watcher = void 0; + prevValue = prev.propertySource[prev.propertyName]; + watcher = this; + if (propertySource === prevValue) { + this.needsRefresh = true; + } + } + prev.next = current; + } + this.last = current; + } + handleChange() { + if (this.needsQueue) { + this.needsQueue = false; + queueUpdate(this); + } + } + call() { + if (this.last !== null) { + this.needsQueue = true; + this.notify(this); + } + } + records() { + let next = this.first; + return { + next: () => { + const current = next; + if (current === void 0) { + return { value: void 0, done: true }; + } else { + next = next.next; + return { + value: current, + done: false + }; + } + }, + [Symbol.iterator]: function() { + return this; + } + }; + } + } + return Object.freeze({ + /** + * @internal + * @param factory - The factory used to create array observers. + */ + setArrayObserverFactory(factory) { + createArrayObserver = factory; + }, + /** + * Gets a notifier for an object or Array. + * @param source - The object or Array to get the notifier for. + */ + getNotifier, + /** + * Records a property change for a source object. + * @param source - The object to record the change against. + * @param propertyName - The property to track as changed. + */ + track(source, propertyName) { + if (watcher !== void 0) { + watcher.watch(source, propertyName); + } + }, + /** + * Notifies watchers that the currently executing property getter or function is volatile + * with respect to its observable dependencies. + */ + trackVolatile() { + if (watcher !== void 0) { + watcher.needsRefresh = true; + } + }, + /** + * Notifies subscribers of a source object of changes. + * @param source - the object to notify of changes. + * @param args - The change args to pass to subscribers. + */ + notify(source, args) { + getNotifier(source).notify(args); + }, + /** + * Defines an observable property on an object or prototype. + * @param target - The target object to define the observable on. + * @param nameOrAccessor - The name of the property to define as observable; + * or a custom accessor that specifies the property name and accessor implementation. + */ + defineProperty(target, nameOrAccessor) { + if (typeof nameOrAccessor === "string") { + nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); + } + getAccessors(target).push(nameOrAccessor); + Reflect.defineProperty(target, nameOrAccessor.name, { + enumerable: true, + get: function() { + return nameOrAccessor.getValue(this); + }, + set: function(newValue) { + nameOrAccessor.setValue(this, newValue); + } + }); + }, + /** + * Finds all the observable accessors defined on the target, + * including its prototype chain. + * @param target - The target object to search for accessor on. + */ + getAccessors, + /** + * Creates a {@link BindingObserver} that can watch the + * provided {@link Binding} for changes. + * @param binding - The binding to observe. + * @param initialSubscriber - An initial subscriber to changes in the binding value. + * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. + */ + binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) { + return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding); + }, + /** + * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated + * on every evaluation of the value. + * @param binding - The binding to inspect. + */ + isVolatileBinding(binding) { + return volatileRegex.test(binding.toString()); + } + }); + }); + contextEvent = FAST.getById(3, () => { + let current = null; + return { + get() { + return current; + }, + set(event) { + current = event; + } + }; + }); + ExecutionContext = class { + constructor() { + this.index = 0; + this.length = 0; + this.parent = null; + this.parentContext = null; + } + /** + * The current event within an event handler. + */ + get event() { + return contextEvent.get(); + } + /** + * Indicates whether the current item within a repeat context + * has an even index. + */ + get isEven() { + return this.index % 2 === 0; + } + /** + * Indicates whether the current item within a repeat context + * has an odd index. + */ + get isOdd() { + return this.index % 2 !== 0; + } + /** + * Indicates whether the current item within a repeat context + * is the first item in the collection. + */ + get isFirst() { + return this.index === 0; + } + /** + * Indicates whether the current item within a repeat context + * is somewhere in the middle of the collection. + */ + get isInMiddle() { + return !this.isFirst && !this.isLast; + } + /** + * Indicates whether the current item within a repeat context + * is the last item in the collection. + */ + get isLast() { + return this.index === this.length - 1; + } + /** + * Sets the event for the current execution context. + * @param event - The event to set. + * @internal + */ + static setEvent(event) { + contextEvent.set(event); + } + }; + Observable.defineProperty(ExecutionContext.prototype, "index"); + Observable.defineProperty(ExecutionContext.prototype, "length"); + defaultExecutionContext = Object.seal(new ExecutionContext()); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js + var HTMLDirective, TargetedHTMLDirective, AttachedBehaviorHTMLDirective; + var init_html_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js"() { + init_dom(); + HTMLDirective = class { + constructor() { + this.targetIndex = 0; + } + }; + TargetedHTMLDirective = class extends HTMLDirective { + constructor() { + super(...arguments); + this.createPlaceholder = DOM.createInterpolationPlaceholder; + } + }; + AttachedBehaviorHTMLDirective = class extends HTMLDirective { + /** + * + * @param name - The name of the behavior; used as a custom attribute on the element. + * @param behavior - The behavior to instantiate and attach to the element. + * @param options - Options to pass to the behavior during creation. + */ + constructor(name, behavior, options) { + super(); + this.name = name; + this.behavior = behavior; + this.options = options; + } + /** + * Creates a placeholder string based on the directive's index within the template. + * @param index - The index of the directive within the template. + * @remarks + * Creates a custom attribute placeholder. + */ + createPlaceholder(index) { + return DOM.createCustomAttributePlaceholder(this.name, index); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + * @remarks + * Creates an instance of the `behavior` type this directive was constructed with + * and passes the target and options to that `behavior`'s constructor. + */ + createBehavior(target) { + return new this.behavior(target, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/binding.js + function normalBind(source, context) { + this.source = source; + this.context = context; + if (this.bindingObserver === null) { + this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); + } + this.updateTarget(this.bindingObserver.observe(source, context)); + } + function triggerBind(source, context) { + this.source = source; + this.context = context; + this.target.addEventListener(this.targetName, this); + } + function normalUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + } + function contentUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.unbind(); + view.needsBindOnly = true; + } + } + function triggerUnbind() { + this.target.removeEventListener(this.targetName, this); + this.source = null; + this.context = null; + } + function updateAttributeTarget(value) { + DOM.setAttribute(this.target, this.targetName, value); + } + function updateBooleanAttributeTarget(value) { + DOM.setBooleanAttribute(this.target, this.targetName, value); + } + function updateContentTarget(value) { + if (value === null || value === void 0) { + value = ""; + } + if (value.create) { + this.target.textContent = ""; + let view = this.target.$fastView; + if (view === void 0) { + view = value.create(); + } else { + if (this.target.$fastTemplate !== value) { + if (view.isComposed) { + view.remove(); + view.unbind(); + } + view = value.create(); + } + } + if (!view.isComposed) { + view.isComposed = true; + view.bind(this.source, this.context); + view.insertBefore(this.target); + this.target.$fastView = view; + this.target.$fastTemplate = value; + } else if (view.needsBindOnly) { + view.needsBindOnly = false; + view.bind(this.source, this.context); + } + } else { + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.isComposed = false; + view.remove(); + if (view.needsBindOnly) { + view.needsBindOnly = false; + } else { + view.unbind(); + } + } + this.target.textContent = value; + } + } + function updatePropertyTarget(value) { + this.target[this.targetName] = value; + } + function updateClassTarget(value) { + const classVersions = this.classVersions || /* @__PURE__ */ Object.create(null); + const target = this.target; + let version = this.version || 0; + if (value !== null && value !== void 0 && value.length) { + const names = value.split(/\s+/); + for (let i = 0, ii = names.length; i < ii; ++i) { + const currentName = names[i]; + if (currentName === "") { + continue; + } + classVersions[currentName] = version; + target.classList.add(currentName); + } + } + this.classVersions = classVersions; + this.version = version + 1; + if (version === 0) { + return; + } + version -= 1; + for (const name in classVersions) { + if (classVersions[name] === version) { + target.classList.remove(name); + } + } + } + var HTMLBindingDirective, BindingBehavior; + var init_binding = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/binding.js"() { + init_dom(); + init_observable(); + init_html_directive(); + HTMLBindingDirective = class extends TargetedHTMLDirective { + /** + * Creates an instance of BindingDirective. + * @param binding - A binding that returns the data used to update the DOM. + */ + constructor(binding) { + super(); + this.binding = binding; + this.bind = normalBind; + this.unbind = normalUnbind; + this.updateTarget = updateAttributeTarget; + this.isBindingVolatile = Observable.isVolatileBinding(this.binding); + } + /** + * Gets/sets the name of the attribute or property that this + * binding is targeting. + */ + get targetName() { + return this.originalTargetName; + } + set targetName(value) { + this.originalTargetName = value; + if (value === void 0) { + return; + } + switch (value[0]) { + case ":": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updatePropertyTarget; + if (this.cleanedTargetName === "innerHTML") { + const binding = this.binding; + this.binding = (s, c) => DOM.createHTML(binding(s, c)); + } + break; + case "?": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updateBooleanAttributeTarget; + break; + case "@": + this.cleanedTargetName = value.substr(1); + this.bind = triggerBind; + this.unbind = triggerUnbind; + break; + default: + this.cleanedTargetName = value; + if (value === "class") { + this.updateTarget = updateClassTarget; + } + break; + } + } + /** + * Makes this binding target the content of an element rather than + * a particular attribute or property. + */ + targetAtContent() { + this.updateTarget = updateContentTarget; + this.unbind = contentUnbind; + } + /** + * Creates the runtime BindingBehavior instance based on the configuration + * information stored in the BindingDirective. + * @param target - The target node that the binding behavior should attach to. + */ + createBehavior(target) { + return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); + } + }; + BindingBehavior = class { + /** + * Creates an instance of BindingBehavior. + * @param target - The target of the data updates. + * @param binding - The binding that returns the latest value for an update. + * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. + * @param bind - The operation to perform during binding. + * @param unbind - The operation to perform during unbinding. + * @param updateTarget - The operation to perform when updating. + * @param targetName - The name of the target attribute or property to update. + */ + constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { + this.source = null; + this.context = null; + this.bindingObserver = null; + this.target = target; + this.binding = binding; + this.isBindingVolatile = isBindingVolatile; + this.bind = bind; + this.unbind = unbind; + this.updateTarget = updateTarget; + this.targetName = targetName; + } + /** @internal */ + handleChange() { + this.updateTarget(this.bindingObserver.observe(this.source, this.context)); + } + /** @internal */ + handleEvent(event) { + ExecutionContext.setEvent(event); + const result = this.binding(this.source, this.context); + ExecutionContext.setEvent(null); + if (result !== true) { + event.preventDefault(); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js + function createAggregateBinding(parts) { + if (parts.length === 1) { + return parts[0]; + } + let targetName; + const partCount = parts.length; + const finalParts = parts.map((x) => { + if (typeof x === "string") { + return () => x; + } + targetName = x.targetName || targetName; + return x.binding; + }); + const binding = (scope, context) => { + let output = ""; + for (let i = 0; i < partCount; ++i) { + output += finalParts[i](scope, context); + } + return output; + }; + const directive = new HTMLBindingDirective(binding); + directive.targetName = targetName; + return directive; + } + function parseContent(context, value) { + const valueParts = value.split(_interpolationStart); + if (valueParts.length === 1) { + return null; + } + const bindingParts = []; + for (let i = 0, ii = valueParts.length; i < ii; ++i) { + const current = valueParts[i]; + const index = current.indexOf(_interpolationEnd); + let literal; + if (index === -1) { + literal = current; + } else { + const directiveIndex = parseInt(current.substring(0, index)); + bindingParts.push(context.directives[directiveIndex]); + literal = current.substring(index + interpolationEndLength); + } + if (literal !== "") { + bindingParts.push(literal); + } + } + return bindingParts; + } + function compileAttributes(context, node, includeBasicValues = false) { + const attributes = node.attributes; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const attr2 = attributes[i]; + const attrValue = attr2.value; + const parseResult = parseContent(context, attrValue); + let result = null; + if (parseResult === null) { + if (includeBasicValues) { + result = new HTMLBindingDirective(() => attrValue); + result.targetName = attr2.name; + } + } else { + result = createAggregateBinding(parseResult); + } + if (result !== null) { + node.removeAttributeNode(attr2); + i--; + ii--; + context.addFactory(result); + } + } + } + function compileContent(context, node, walker) { + const parseResult = parseContent(context, node.textContent); + if (parseResult !== null) { + let lastNode = node; + for (let i = 0, ii = parseResult.length; i < ii; ++i) { + const currentPart = parseResult[i]; + const currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); + if (typeof currentPart === "string") { + currentNode.textContent = currentPart; + } else { + currentNode.textContent = " "; + context.captureContentBinding(currentPart); + } + lastNode = currentNode; + context.targetIndex++; + if (currentNode !== node) { + walker.nextNode(); + } + } + context.targetIndex--; + } + } + function compileTemplate(template, directives) { + const fragment = template.content; + document.adoptNode(fragment); + const context = CompilationContext.borrow(directives); + compileAttributes(context, template, true); + const hostBehaviorFactories = context.behaviorFactories; + context.reset(); + const walker = DOM.createTemplateWalker(fragment); + let node; + while (node = walker.nextNode()) { + context.targetIndex++; + switch (node.nodeType) { + case 1: + compileAttributes(context, node); + break; + case 3: + compileContent(context, node, walker); + break; + case 8: + if (DOM.isMarker(node)) { + context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); + } + } + } + let targetOffset = 0; + if ( + // If the first node in a fragment is a marker, that means it's an unstable first node, + // because something like a when, repeat, etc. could add nodes before the marker. + // To mitigate this, we insert a stable first node. However, if we insert a node, + // that will alter the result of the TreeWalker. So, we also need to offset the target index. + DOM.isMarker(fragment.firstChild) || // Or if there is only one node and a directive, it means the template's content + // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by + // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. + fragment.childNodes.length === 1 && directives.length + ) { + fragment.insertBefore(document.createComment(""), fragment.firstChild); + targetOffset = -1; + } + const viewBehaviorFactories = context.behaviorFactories; + context.release(); + return { + fragment, + viewBehaviorFactories, + hostBehaviorFactories, + targetOffset + }; + } + var sharedContext, CompilationContext, interpolationEndLength; + var init_compiler = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js"() { + init_dom(); + init_binding(); + sharedContext = null; + CompilationContext = class _CompilationContext { + addFactory(factory) { + factory.targetIndex = this.targetIndex; + this.behaviorFactories.push(factory); + } + captureContentBinding(directive) { + directive.targetAtContent(); + this.addFactory(directive); + } + reset() { + this.behaviorFactories = []; + this.targetIndex = -1; + } + release() { + sharedContext = this; + } + static borrow(directives) { + const shareable = sharedContext || new _CompilationContext(); + shareable.directives = directives; + shareable.reset(); + sharedContext = null; + return shareable; + } + }; + interpolationEndLength = _interpolationEnd.length; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/view.js + var range, HTMLView; + var init_view = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/view.js"() { + range = document.createRange(); + HTMLView = class { + /** + * Constructs an instance of HTMLView. + * @param fragment - The html fragment that contains the nodes for this view. + * @param behaviors - The behaviors to be applied to this view. + */ + constructor(fragment, behaviors) { + this.fragment = fragment; + this.behaviors = behaviors; + this.source = null; + this.context = null; + this.firstChild = fragment.firstChild; + this.lastChild = fragment.lastChild; + } + /** + * Appends the view's DOM nodes to the referenced node. + * @param node - The parent node to append the view's DOM nodes to. + */ + appendTo(node) { + node.appendChild(this.fragment); + } + /** + * Inserts the view's DOM nodes before the referenced node. + * @param node - The node to insert the view's DOM before. + */ + insertBefore(node) { + if (this.fragment.hasChildNodes()) { + node.parentNode.insertBefore(this.fragment, node); + } else { + const end = this.lastChild; + if (node.previousSibling === end) + return; + const parentNode = node.parentNode; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parentNode.insertBefore(current, node); + current = next; + } + parentNode.insertBefore(end, node); + } + } + /** + * Removes the view's DOM nodes. + * The nodes are not disposed and the view can later be re-inserted. + */ + remove() { + const fragment = this.fragment; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + fragment.appendChild(current); + current = next; + } + fragment.appendChild(end); + } + /** + * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. + * Once a view has been disposed, it cannot be inserted or bound again. + */ + dispose() { + const parent = this.firstChild.parentNode; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parent.removeChild(current); + current = next; + } + parent.removeChild(end); + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + } + /** + * Binds a view's behaviors to its binding source. + * @param source - The binding source for the view's binding behaviors. + * @param context - The execution context to run the behaviors within. + */ + bind(source, context) { + const behaviors = this.behaviors; + if (this.source === source) { + return; + } else if (this.source !== null) { + const oldSource = this.source; + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + const current = behaviors[i]; + current.unbind(oldSource); + current.bind(source, context); + } + } else { + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].bind(source, context); + } + } + } + /** + * Unbinds a view's behaviors from its binding source. + */ + unbind() { + if (this.source === null) { + return; + } + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + this.source = null; + } + /** + * Efficiently disposes of a contiguous range of synthetic view instances. + * @param views - A contiguous range of views to be disposed. + */ + static disposeContiguousBatch(views) { + if (views.length === 0) { + return; + } + range.setStartBefore(views[0].firstChild); + range.setEndAfter(views[views.length - 1].lastChild); + range.deleteContents(); + for (let i = 0, ii = views.length; i < ii; ++i) { + const view = views[i]; + const behaviors = view.behaviors; + const oldSource = view.source; + for (let j = 0, jj = behaviors.length; j < jj; ++j) { + behaviors[j].unbind(oldSource); + } + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/template.js + function html(strings, ...values) { + const directives = []; + let html2 = ""; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + const currentString = strings[i]; + let value = values[i]; + html2 += currentString; + if (value instanceof ViewTemplate) { + const template = value; + value = () => template; + } + if (typeof value === "function") { + value = new HTMLBindingDirective(value); + } + if (value instanceof TargetedHTMLDirective) { + const match = lastAttributeNameRegex.exec(currentString); + if (match !== null) { + value.targetName = match[2]; + } + } + if (value instanceof HTMLDirective) { + html2 += value.createPlaceholder(directives.length); + directives.push(value); + } else { + html2 += value; + } + } + html2 += strings[strings.length - 1]; + return new ViewTemplate(html2, directives); + } + var ViewTemplate, lastAttributeNameRegex; + var init_template = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/template.js"() { + init_dom(); + init_observable(); + init_compiler(); + init_view(); + init_html_directive(); + init_binding(); + ViewTemplate = class { + /** + * Creates an instance of ViewTemplate. + * @param html - The html representing what this template will instantiate, including placeholders for directives. + * @param directives - The directives that will be connected to placeholders in the html. + */ + constructor(html2, directives) { + this.behaviorCount = 0; + this.hasHostBehaviors = false; + this.fragment = null; + this.targetOffset = 0; + this.viewBehaviorFactories = null; + this.hostBehaviorFactories = null; + this.html = html2; + this.directives = directives; + } + /** + * Creates an HTMLView instance based on this template definition. + * @param hostBindingTarget - The element that host behaviors will be bound to. + */ + create(hostBindingTarget) { + if (this.fragment === null) { + let template; + const html2 = this.html; + if (typeof html2 === "string") { + template = document.createElement("template"); + template.innerHTML = DOM.createHTML(html2); + const fec = template.content.firstElementChild; + if (fec !== null && fec.tagName === "TEMPLATE") { + template = fec; + } + } else { + template = html2; + } + const result = compileTemplate(template, this.directives); + this.fragment = result.fragment; + this.viewBehaviorFactories = result.viewBehaviorFactories; + this.hostBehaviorFactories = result.hostBehaviorFactories; + this.targetOffset = result.targetOffset; + this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; + this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; + } + const fragment = this.fragment.cloneNode(true); + const viewFactories = this.viewBehaviorFactories; + const behaviors = new Array(this.behaviorCount); + const walker = DOM.createTemplateWalker(fragment); + let behaviorIndex = 0; + let targetIndex = this.targetOffset; + let node = walker.nextNode(); + for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { + const factory = viewFactories[behaviorIndex]; + const factoryIndex = factory.targetIndex; + while (node !== null) { + if (targetIndex === factoryIndex) { + behaviors[behaviorIndex] = factory.createBehavior(node); + break; + } else { + node = walker.nextNode(); + targetIndex++; + } + } + } + if (this.hasHostBehaviors) { + const hostFactories = this.hostBehaviorFactories; + for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) { + behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); + } + } + return new HTMLView(fragment, behaviors); + } + /** + * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. + * @param source - The data source to bind the template to. + * @param host - The Element where the template will be rendered. + * @param hostBindingTarget - An HTML element to target the host bindings at if different from the + * host that the template is being attached to. + */ + render(source, host, hostBindingTarget) { + if (typeof host === "string") { + host = document.getElementById(host); + } + if (hostBindingTarget === void 0) { + hostBindingTarget = host; + } + const view = this.create(hostBindingTarget); + view.bind(source, defaultExecutionContext); + view.appendTo(host); + return view; + } + }; + lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ + /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js + function reduceStyles(styles) { + return styles.map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x]).reduce((prev, curr) => prev.concat(curr), []); + } + function reduceBehaviors(styles) { + return styles.map((x) => x instanceof ElementStyles ? x.behaviors : null).reduce((prev, curr) => { + if (curr === null) { + return prev; + } + if (prev === null) { + prev = []; + } + return prev.concat(curr); + }, null); + } + function separateSheetsToPrepend(sheets) { + const prepend = []; + const append = []; + sheets.forEach((x) => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x)); + return { prepend, append }; + } + function getNextStyleClass() { + return `fast-style-class-${++styleClassId}`; + } + var ElementStyles, prependToAdoptedStyleSheetsSymbol, addAdoptedStyleSheets, removeAdoptedStyleSheets, AdoptedStyleSheetsStyles, styleClassId, StyleElementStyles; + var init_element_styles = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js"() { + init_dom(); + ElementStyles = class { + constructor() { + this.targets = /* @__PURE__ */ new WeakSet(); + } + /** @internal */ + addStylesTo(target) { + this.targets.add(target); + } + /** @internal */ + removeStylesFrom(target) { + this.targets.delete(target); + } + /** @internal */ + isAttachedTo(target) { + return this.targets.has(target); + } + /** + * Associates behaviors with this set of styles. + * @param behaviors - The behaviors to associate. + */ + withBehaviors(...behaviors) { + this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); + return this; + } + }; + ElementStyles.create = (() => { + if (DOM.supportsAdoptedStyleSheets) { + const styleSheetCache = /* @__PURE__ */ new Map(); + return (styles) => ( + // eslint-disable-next-line @typescript-eslint/no-use-before-define + new AdoptedStyleSheetsStyles(styles, styleSheetCache) + ); + } + return (styles) => new StyleElementStyles(styles); + })(); + prependToAdoptedStyleSheetsSymbol = /* @__PURE__ */ Symbol("prependToAdoptedStyleSheets"); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append]; + }; + removeAdoptedStyleSheets = (target, sheets) => { + target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1); + }; + if (DOM.supportsAdoptedStyleSheets) { + try { + document.adoptedStyleSheets.push(); + document.adoptedStyleSheets.splice(); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets.splice(0, 0, ...prepend); + target.adoptedStyleSheets.push(...append); + }; + removeAdoptedStyleSheets = (target, sheets) => { + for (const sheet of sheets) { + const index = target.adoptedStyleSheets.indexOf(sheet); + if (index !== -1) { + target.adoptedStyleSheets.splice(index, 1); + } + } + }; + } catch (e) { + } + } + AdoptedStyleSheetsStyles = class extends ElementStyles { + constructor(styles, styleSheetCache) { + super(); + this.styles = styles; + this.styleSheetCache = styleSheetCache; + this._styleSheets = void 0; + this.behaviors = reduceBehaviors(styles); + } + get styleSheets() { + if (this._styleSheets === void 0) { + const styles = this.styles; + const styleSheetCache = this.styleSheetCache; + this._styleSheets = reduceStyles(styles).map((x) => { + if (x instanceof CSSStyleSheet) { + return x; + } + let sheet = styleSheetCache.get(x); + if (sheet === void 0) { + sheet = new CSSStyleSheet(); + sheet.replaceSync(x); + styleSheetCache.set(x, sheet); + } + return sheet; + }); + } + return this._styleSheets; + } + addStylesTo(target) { + addAdoptedStyleSheets(target, this.styleSheets); + super.addStylesTo(target); + } + removeStylesFrom(target) { + removeAdoptedStyleSheets(target, this.styleSheets); + super.removeStylesFrom(target); + } + }; + styleClassId = 0; + StyleElementStyles = class extends ElementStyles { + constructor(styles) { + super(); + this.styles = styles; + this.behaviors = null; + this.behaviors = reduceBehaviors(styles); + this.styleSheets = reduceStyles(styles); + this.styleClass = getNextStyleClass(); + } + addStylesTo(target) { + const styleSheets = this.styleSheets; + const styleClass = this.styleClass; + target = this.normalizeTarget(target); + for (let i = 0; i < styleSheets.length; i++) { + const element = document.createElement("style"); + element.innerHTML = styleSheets[i]; + element.className = styleClass; + target.append(element); + } + super.addStylesTo(target); + } + removeStylesFrom(target) { + target = this.normalizeTarget(target); + const styles = target.querySelectorAll(`.${this.styleClass}`); + for (let i = 0, ii = styles.length; i < ii; ++i) { + target.removeChild(styles[i]); + } + super.removeStylesFrom(target); + } + isAttachedTo(target) { + return super.isAttachedTo(this.normalizeTarget(target)); + } + normalizeTarget(target) { + return target === document ? document.body : target; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/attributes.js + function attr(configOrTarget, prop) { + let config; + function decorator($target, $prop) { + if (arguments.length > 1) { + config.property = $prop; + } + AttributeConfiguration.locate($target.constructor).push(config); + } + if (arguments.length > 1) { + config = {}; + decorator(configOrTarget, prop); + return; + } + config = configOrTarget === void 0 ? {} : configOrTarget; + return decorator; + } + var AttributeConfiguration, booleanConverter, nullableNumberConverter, AttributeDefinition; + var init_attributes = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/attributes.js"() { + init_observable(); + init_dom(); + init_platform(); + AttributeConfiguration = Object.freeze({ + /** + * Locates all attribute configurations associated with a type. + */ + locate: createMetadataLocator() + }); + booleanConverter = { + toView(value) { + return value ? "true" : "false"; + }, + fromView(value) { + if (value === null || value === void 0 || value === "false" || value === false || value === 0) { + return false; + } + return true; + } + }; + nullableNumberConverter = { + toView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number.toString(); + }, + fromView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number; + } + }; + AttributeDefinition = class _AttributeDefinition { + /** + * Creates an instance of AttributeDefinition. + * @param Owner - The class constructor that owns this attribute. + * @param name - The name of the property associated with the attribute. + * @param attribute - The name of the attribute in HTML. + * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. + * @param converter - A {@link ValueConverter} that integrates with the property getter/setter + * to convert values to and from a DOM string. + */ + constructor(Owner, name, attribute = name.toLowerCase(), mode = "reflect", converter) { + this.guards = /* @__PURE__ */ new Set(); + this.Owner = Owner; + this.name = name; + this.attribute = attribute; + this.mode = mode; + this.converter = converter; + this.fieldName = `_${name}`; + this.callbackName = `${name}Changed`; + this.hasCallback = this.callbackName in Owner.prototype; + if (mode === "boolean" && converter === void 0) { + this.converter = booleanConverter; + } + } + /** + * Sets the value of the attribute/property on the source element. + * @param source - The source element to access. + * @param value - The value to set the attribute/property to. + */ + setValue(source, newValue) { + const oldValue = source[this.fieldName]; + const converter = this.converter; + if (converter !== void 0) { + newValue = converter.fromView(newValue); + } + if (oldValue !== newValue) { + source[this.fieldName] = newValue; + this.tryReflectToAttribute(source); + if (this.hasCallback) { + source[this.callbackName](oldValue, newValue); + } + source.$fastController.notify(this.name); + } + } + /** + * Gets the value of the attribute/property on the source element. + * @param source - The source element to access. + */ + getValue(source) { + Observable.track(source, this.name); + return source[this.fieldName]; + } + /** @internal */ + onAttributeChangedCallback(element, value) { + if (this.guards.has(element)) { + return; + } + this.guards.add(element); + this.setValue(element, value); + this.guards.delete(element); + } + tryReflectToAttribute(element) { + const mode = this.mode; + const guards = this.guards; + if (guards.has(element) || mode === "fromView") { + return; + } + DOM.queueUpdate(() => { + guards.add(element); + const latestValue = element[this.fieldName]; + switch (mode) { + case "reflect": + const converter = this.converter; + DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); + break; + case "boolean": + DOM.setBooleanAttribute(element, this.attribute, latestValue); + break; + } + guards.delete(element); + }); + } + /** + * Collects all attribute definitions associated with the owner. + * @param Owner - The class constructor to collect attribute for. + * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. + * @internal + */ + static collect(Owner, ...attributeLists) { + const attributes = []; + attributeLists.push(AttributeConfiguration.locate(Owner)); + for (let i = 0, ii = attributeLists.length; i < ii; ++i) { + const list = attributeLists[i]; + if (list === void 0) { + continue; + } + for (let j = 0, jj = list.length; j < jj; ++j) { + const config = list[j]; + if (typeof config === "string") { + attributes.push(new _AttributeDefinition(Owner, config)); + } else { + attributes.push(new _AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); + } + } + } + return attributes; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js + var defaultShadowOptions, defaultElementOptions, fastRegistry, FASTElementDefinition; + var init_fast_definitions = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js"() { + init_platform(); + init_observable(); + init_element_styles(); + init_attributes(); + defaultShadowOptions = { mode: "open" }; + defaultElementOptions = {}; + fastRegistry = FAST.getById(4, () => { + const typeToDefinition = /* @__PURE__ */ new Map(); + return Object.freeze({ + register(definition) { + if (typeToDefinition.has(definition.type)) { + return false; + } + typeToDefinition.set(definition.type, definition); + return true; + }, + getByType(key) { + return typeToDefinition.get(key); + } + }); + }); + FASTElementDefinition = class { + /** + * Creates an instance of FASTElementDefinition. + * @param type - The type this definition is being created for. + * @param nameOrConfig - The name of the element to define or a config object + * that describes the element to define. + */ + constructor(type, nameOrConfig = type.definition) { + if (typeof nameOrConfig === "string") { + nameOrConfig = { name: nameOrConfig }; + } + this.type = type; + this.name = nameOrConfig.name; + this.template = nameOrConfig.template; + const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); + const observedAttributes = new Array(attributes.length); + const propertyLookup = {}; + const attributeLookup = {}; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const current = attributes[i]; + observedAttributes[i] = current.attribute; + propertyLookup[current.name] = current; + attributeLookup[current.attribute] = current; + } + this.attributes = attributes; + this.observedAttributes = observedAttributes; + this.propertyLookup = propertyLookup; + this.attributeLookup = attributeLookup; + this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); + this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); + this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof ElementStyles ? nameOrConfig.styles : ElementStyles.create([nameOrConfig.styles]); + } + /** + * Indicates if this element has been defined in at least one registry. + */ + get isDefined() { + return !!fastRegistry.getByType(this.type); + } + /** + * Defines a custom element based on this definition. + * @param registry - The element registry to define the element in. + */ + define(registry = customElements) { + const type = this.type; + if (fastRegistry.register(this)) { + const attributes = this.attributes; + const proto = type.prototype; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + Observable.defineProperty(proto, attributes[i]); + } + Reflect.defineProperty(type, "observedAttributes", { + value: this.observedAttributes, + enumerable: true + }); + } + if (!registry.get(this.name)) { + registry.define(this.name, type, this.elementOptions); + } + return this; + } + }; + FASTElementDefinition.forType = fastRegistry.getByType; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/controller.js + function getShadowRoot(element) { + return element.shadowRoot || shadowRoots.get(element) || null; + } + var shadowRoots, defaultEventOptions, Controller; + var init_controller = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/controller.js"() { + init_dom(); + init_notifier(); + init_observable(); + init_fast_definitions(); + shadowRoots = /* @__PURE__ */ new WeakMap(); + defaultEventOptions = { + bubbles: true, + composed: true, + cancelable: true + }; + Controller = class _Controller extends PropertyChangeNotifier { + /** + * Creates a Controller to control the specified element. + * @param element - The element to be controlled by this controller. + * @param definition - The element definition metadata that instructs this + * controller in how to handle rendering and other platform integrations. + * @internal + */ + constructor(element, definition) { + super(element); + this.boundObservables = null; + this.behaviors = null; + this.needsInitialization = true; + this._template = null; + this._styles = null; + this._isConnected = false; + this.$fastController = this; + this.view = null; + this.element = element; + this.definition = definition; + const shadowOptions = definition.shadowOptions; + if (shadowOptions !== void 0) { + const shadowRoot = element.attachShadow(shadowOptions); + if (shadowOptions.mode === "closed") { + shadowRoots.set(element, shadowRoot); + } + } + const accessors = Observable.getAccessors(element); + if (accessors.length > 0) { + const boundObservables = this.boundObservables = /* @__PURE__ */ Object.create(null); + for (let i = 0, ii = accessors.length; i < ii; ++i) { + const propertyName = accessors[i].name; + const value = element[propertyName]; + if (value !== void 0) { + delete element[propertyName]; + boundObservables[propertyName] = value; + } + } + } + } + /** + * Indicates whether or not the custom element has been + * connected to the document. + */ + get isConnected() { + Observable.track(this, "isConnected"); + return this._isConnected; + } + setIsConnected(value) { + this._isConnected = value; + Observable.notify(this, "isConnected"); + } + /** + * Gets/sets the template used to render the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get template() { + return this._template; + } + set template(value) { + if (this._template === value) { + return; + } + this._template = value; + if (!this.needsInitialization) { + this.renderTemplate(value); + } + } + /** + * Gets/sets the primary styles used for the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get styles() { + return this._styles; + } + set styles(value) { + if (this._styles === value) { + return; + } + if (this._styles !== null) { + this.removeStyles(this._styles); + } + this._styles = value; + if (!this.needsInitialization && value !== null) { + this.addStyles(value); + } + } + /** + * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. + * @param styles - The styles to add. + */ + addStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.append(styles); + } else if (!styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.addStylesTo(target); + if (sourceBehaviors !== null) { + this.addBehaviors(sourceBehaviors); + } + } + } + /** + * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. + * @param styles - the styles to remove. + */ + removeStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.removeChild(styles); + } else if (styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.removeStylesFrom(target); + if (sourceBehaviors !== null) { + this.removeBehaviors(sourceBehaviors); + } + } + } + /** + * Adds behaviors to this element. + * @param behaviors - The behaviors to add. + */ + addBehaviors(behaviors) { + const targetBehaviors = this.behaviors || (this.behaviors = /* @__PURE__ */ new Map()); + const length = behaviors.length; + const behaviorsToBind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); + } else { + targetBehaviors.set(behavior, 1); + behaviorsToBind.push(behavior); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToBind.length; ++i) { + behaviorsToBind[i].bind(element, defaultExecutionContext); + } + } + } + /** + * Removes behaviors from this element. + * @param behaviors - The behaviors to remove. + * @param force - Forces unbinding of behaviors. + */ + removeBehaviors(behaviors, force = false) { + const targetBehaviors = this.behaviors; + if (targetBehaviors === null) { + return; + } + const length = behaviors.length; + const behaviorsToUnbind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + const count = targetBehaviors.get(behavior) - 1; + count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToUnbind.length; ++i) { + behaviorsToUnbind[i].unbind(element); + } + } + } + /** + * Runs connected lifecycle behavior on the associated element. + */ + onConnectedCallback() { + if (this._isConnected) { + return; + } + const element = this.element; + if (this.needsInitialization) { + this.finishInitialization(); + } else if (this.view !== null) { + this.view.bind(element, defaultExecutionContext); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + for (const [behavior] of behaviors) { + behavior.bind(element, defaultExecutionContext); + } + } + this.setIsConnected(true); + } + /** + * Runs disconnected lifecycle behavior on the associated element. + */ + onDisconnectedCallback() { + if (!this._isConnected) { + return; + } + this.setIsConnected(false); + const view = this.view; + if (view !== null) { + view.unbind(); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + const element = this.element; + for (const [behavior] of behaviors) { + behavior.unbind(element); + } + } + } + /** + * Runs the attribute changed callback for the associated element. + * @param name - The name of the attribute that changed. + * @param oldValue - The previous value of the attribute. + * @param newValue - The new value of the attribute. + */ + onAttributeChangedCallback(name, oldValue, newValue) { + const attrDef = this.definition.attributeLookup[name]; + if (attrDef !== void 0) { + attrDef.onAttributeChangedCallback(this.element, newValue); + } + } + /** + * Emits a custom HTML event. + * @param type - The type name of the event. + * @param detail - The event detail object to send with the event. + * @param options - The event options. By default bubbles and composed. + * @remarks + * Only emits events if connected. + */ + emit(type, detail, options) { + if (this._isConnected) { + return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options))); + } + return false; + } + finishInitialization() { + const element = this.element; + const boundObservables = this.boundObservables; + if (boundObservables !== null) { + const propertyNames = Object.keys(boundObservables); + for (let i = 0, ii = propertyNames.length; i < ii; ++i) { + const propertyName = propertyNames[i]; + element[propertyName] = boundObservables[propertyName]; + } + this.boundObservables = null; + } + const definition = this.definition; + if (this._template === null) { + if (this.element.resolveTemplate) { + this._template = this.element.resolveTemplate(); + } else if (definition.template) { + this._template = definition.template || null; + } + } + if (this._template !== null) { + this.renderTemplate(this._template); + } + if (this._styles === null) { + if (this.element.resolveStyles) { + this._styles = this.element.resolveStyles(); + } else if (definition.styles) { + this._styles = definition.styles || null; + } + } + if (this._styles !== null) { + this.addStyles(this._styles); + } + this.needsInitialization = false; + } + renderTemplate(template) { + const element = this.element; + const host = getShadowRoot(element) || element; + if (this.view !== null) { + this.view.dispose(); + this.view = null; + } else if (!this.needsInitialization) { + DOM.removeChildNodes(host); + } + if (template) { + this.view = template.render(element, host, element); + } + } + /** + * Locates or creates a controller for the specified element. + * @param element - The element to return the controller for. + * @remarks + * The specified element must have a {@link FASTElementDefinition} + * registered either through the use of the {@link customElement} + * decorator or a call to `FASTElement.define`. + */ + static forCustomElement(element) { + const controller = element.$fastController; + if (controller !== void 0) { + return controller; + } + const definition = FASTElementDefinition.forType(element.constructor); + if (definition === void 0) { + throw new Error("Missing FASTElement definition."); + } + return element.$fastController = new _Controller(element, definition); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js + function createFASTElement(BaseType) { + return class extends BaseType { + constructor() { + super(); + Controller.forCustomElement(this); + } + $emit(type, detail, options) { + return this.$fastController.emit(type, detail, options); + } + connectedCallback() { + this.$fastController.onConnectedCallback(); + } + disconnectedCallback() { + this.$fastController.onDisconnectedCallback(); + } + attributeChangedCallback(name, oldValue, newValue) { + this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); + } + }; + } + var FASTElement; + var init_fast_element = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js"() { + init_controller(); + init_fast_definitions(); + FASTElement = Object.assign(createFASTElement(HTMLElement), { + /** + * Creates a new FASTElement base class inherited from the + * provided base type. + * @param BaseType - The base element type to inherit from. + */ + from(BaseType) { + return createFASTElement(BaseType); + }, + /** + * Defines a platform custom element based on the provided type and definition. + * @param type - The custom element type to define. + * @param nameOrDef - The name of the element to define or a definition object + * that describes the element to define. + */ + define(type, nameOrDef) { + return new FASTElementDefinition(type, nameOrDef).define().type; + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js + var CSSDirective; + var init_css_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js"() { + CSSDirective = class { + /** + * Creates a CSS fragment to interpolate into the CSS document. + * @returns - the string to interpolate into CSS + */ + createCSS() { + return ""; + } + /** + * Creates a behavior to bind to the host element. + * @returns - the behavior to bind to the host element, or undefined. + */ + createBehavior() { + return void 0; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css.js + function collectStyles(strings, values) { + const styles = []; + let cssString = ""; + const behaviors = []; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + cssString += strings[i]; + let value = values[i]; + if (value instanceof CSSDirective) { + const behavior = value.createBehavior(); + value = value.createCSS(); + if (behavior) { + behaviors.push(behavior); + } + } + if (value instanceof ElementStyles || value instanceof CSSStyleSheet) { + if (cssString.trim() !== "") { + styles.push(cssString); + cssString = ""; + } + styles.push(value); + } else { + cssString += value; + } + } + cssString += strings[strings.length - 1]; + if (cssString.trim() !== "") { + styles.push(cssString); + } + return { + styles, + behaviors + }; + } + function css(strings, ...values) { + const { styles, behaviors } = collectStyles(strings, values); + const elementStyles = ElementStyles.create(styles); + if (behaviors.length) { + elementStyles.withBehaviors(...behaviors); + } + return elementStyles; + } + var init_css = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css.js"() { + init_css_directive(); + init_element_styles(); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js + function newSplice(index, removed, addedCount) { + return { + index, + removed, + addedCount + }; + } + function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { + const rowCount = oldEnd - oldStart + 1; + const columnCount = currentEnd - currentStart + 1; + const distances = new Array(rowCount); + let north; + let west; + for (let i = 0; i < rowCount; ++i) { + distances[i] = new Array(columnCount); + distances[i][0] = i; + } + for (let j = 0; j < columnCount; ++j) { + distances[0][j] = j; + } + for (let i = 1; i < rowCount; ++i) { + for (let j = 1; j < columnCount; ++j) { + if (current[currentStart + j - 1] === old[oldStart + i - 1]) { + distances[i][j] = distances[i - 1][j - 1]; + } else { + north = distances[i - 1][j] + 1; + west = distances[i][j - 1] + 1; + distances[i][j] = north < west ? north : west; + } + } + } + return distances; + } + function spliceOperationsFromEditDistances(distances) { + let i = distances.length - 1; + let j = distances[0].length - 1; + let current = distances[i][j]; + const edits = []; + while (i > 0 || j > 0) { + if (i === 0) { + edits.push(EDIT_ADD); + j--; + continue; + } + if (j === 0) { + edits.push(EDIT_DELETE); + i--; + continue; + } + const northWest = distances[i - 1][j - 1]; + const west = distances[i - 1][j]; + const north = distances[i][j - 1]; + let min; + if (west < north) { + min = west < northWest ? west : northWest; + } else { + min = north < northWest ? north : northWest; + } + if (min === northWest) { + if (northWest === current) { + edits.push(EDIT_LEAVE); + } else { + edits.push(EDIT_UPDATE); + current = northWest; + } + i--; + j--; + } else if (min === west) { + edits.push(EDIT_DELETE); + i--; + current = west; + } else { + edits.push(EDIT_ADD); + j--; + current = north; + } + } + edits.reverse(); + return edits; + } + function sharedPrefix(current, old, searchLength) { + for (let i = 0; i < searchLength; ++i) { + if (current[i] !== old[i]) { + return i; + } + } + return searchLength; + } + function sharedSuffix(current, old, searchLength) { + let index1 = current.length; + let index2 = old.length; + let count = 0; + while (count < searchLength && current[--index1] === old[--index2]) { + count++; + } + return count; + } + function intersect(start1, end1, start2, end2) { + if (end1 < start2 || end2 < start1) { + return -1; + } + if (end1 === start2 || end2 === start1) { + return 0; + } + if (start1 < start2) { + if (end1 < end2) { + return end1 - start2; + } + return end2 - start2; + } + if (end2 < end1) { + return end2 - start1; + } + return end1 - start1; + } + function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { + let prefixCount = 0; + let suffixCount = 0; + const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); + if (currentStart === 0 && oldStart === 0) { + prefixCount = sharedPrefix(current, old, minLength); + } + if (currentEnd === current.length && oldEnd === old.length) { + suffixCount = sharedSuffix(current, old, minLength - prefixCount); + } + currentStart += prefixCount; + oldStart += prefixCount; + currentEnd -= suffixCount; + oldEnd -= suffixCount; + if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) { + return emptyArray; + } + if (currentStart === currentEnd) { + const splice2 = newSplice(currentStart, [], 0); + while (oldStart < oldEnd) { + splice2.removed.push(old[oldStart++]); + } + return [splice2]; + } else if (oldStart === oldEnd) { + return [newSplice(currentStart, [], currentEnd - currentStart)]; + } + const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); + const splices = []; + let splice = void 0; + let index = currentStart; + let oldIndex = oldStart; + for (let i = 0; i < ops.length; ++i) { + switch (ops[i]) { + case EDIT_LEAVE: + if (splice !== void 0) { + splices.push(splice); + splice = void 0; + } + index++; + oldIndex++; + break; + case EDIT_UPDATE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + case EDIT_ADD: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + break; + case EDIT_DELETE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + } + } + if (splice !== void 0) { + splices.push(splice); + } + return splices; + } + function mergeSplice(splices, index, removed, addedCount) { + const splice = newSplice(index, removed, addedCount); + let inserted = false; + let insertionOffset = 0; + for (let i = 0; i < splices.length; i++) { + const current = splices[i]; + current.index += insertionOffset; + if (inserted) { + continue; + } + const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount); + if (intersectCount >= 0) { + splices.splice(i, 1); + i--; + insertionOffset -= current.addedCount - current.removed.length; + splice.addedCount += current.addedCount - intersectCount; + const deleteCount = splice.removed.length + current.removed.length - intersectCount; + if (!splice.addedCount && !deleteCount) { + inserted = true; + } else { + let currentRemoved = current.removed; + if (splice.index < current.index) { + const prepend = splice.removed.slice(0, current.index - splice.index); + $push.apply(prepend, currentRemoved); + currentRemoved = prepend; + } + if (splice.index + splice.removed.length > current.index + current.addedCount) { + const append = splice.removed.slice(current.index + current.addedCount - splice.index); + $push.apply(currentRemoved, append); + } + splice.removed = currentRemoved; + if (current.index < splice.index) { + splice.index = current.index; + } + } + } else if (splice.index < current.index) { + inserted = true; + splices.splice(i, 0, splice); + i++; + const offset = splice.addedCount - splice.removed.length; + current.index += offset; + insertionOffset += offset; + } + } + if (!inserted) { + splices.push(splice); + } + } + function createInitialSplices(changeRecords) { + const splices = []; + for (let i = 0, ii = changeRecords.length; i < ii; i++) { + const record = changeRecords[i]; + mergeSplice(splices, record.index, record.removed, record.addedCount); + } + return splices; + } + function projectArraySplices(array, changeRecords) { + let splices = []; + const initialSplices = createInitialSplices(changeRecords); + for (let i = 0, ii = initialSplices.length; i < ii; ++i) { + const splice = initialSplices[i]; + if (splice.addedCount === 1 && splice.removed.length === 1) { + if (splice.removed[0] !== array[splice.index]) { + splices.push(splice); + } + continue; + } + splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length)); + } + return splices; + } + var EDIT_LEAVE, EDIT_UPDATE, EDIT_ADD, EDIT_DELETE, $push; + var init_array_change_records = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js"() { + init_platform(); + EDIT_LEAVE = 0; + EDIT_UPDATE = 1; + EDIT_ADD = 2; + EDIT_DELETE = 3; + $push = Array.prototype.push; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js + function adjustIndex(changeRecord, array) { + let index = changeRecord.index; + const arrayLength = array.length; + if (index > arrayLength) { + index = arrayLength - changeRecord.addedCount; + } else if (index < 0) { + index = arrayLength + changeRecord.removed.length + index - changeRecord.addedCount; + } + if (index < 0) { + index = 0; + } + changeRecord.index = index; + return changeRecord; + } + function enableArrayObservation() { + if (arrayObservationEnabled) { + return; + } + arrayObservationEnabled = true; + Observable.setArrayObserverFactory((collection) => { + return new ArrayObserver(collection); + }); + const proto = Array.prototype; + if (proto.$fastPatch) { + return; + } + Reflect.defineProperty(proto, "$fastPatch", { + value: 1, + enumerable: false + }); + const pop = proto.pop; + const push = proto.push; + const reverse = proto.reverse; + const shift = proto.shift; + const sort = proto.sort; + const splice = proto.splice; + const unshift = proto.unshift; + proto.pop = function() { + const notEmpty = this.length > 0; + const methodCallResult = pop.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(this.length, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.push = function() { + const methodCallResult = push.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this)); + } + return methodCallResult; + }; + proto.reverse = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = reverse.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.shift = function() { + const notEmpty = this.length > 0; + const methodCallResult = shift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(0, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.sort = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = sort.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.splice = function() { + const methodCallResult = splice.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this)); + } + return methodCallResult; + }; + proto.unshift = function() { + const methodCallResult = unshift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this)); + } + return methodCallResult; + }; + } + var arrayObservationEnabled, ArrayObserver; + var init_array_observer = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js"() { + init_dom(); + init_array_change_records(); + init_notifier(); + init_observable(); + arrayObservationEnabled = false; + ArrayObserver = class extends SubscriberSet { + constructor(source) { + super(source); + this.oldCollection = void 0; + this.splices = void 0; + this.needsQueue = true; + this.call = this.flush; + Reflect.defineProperty(source, "$fastController", { + value: this, + enumerable: false + }); + } + subscribe(subscriber) { + this.flush(); + super.subscribe(subscriber); + } + addSplice(splice) { + if (this.splices === void 0) { + this.splices = [splice]; + } else { + this.splices.push(splice); + } + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + reset(oldCollection) { + this.oldCollection = oldCollection; + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + flush() { + const splices = this.splices; + const oldCollection = this.oldCollection; + if (splices === void 0 && oldCollection === void 0) { + return; + } + this.needsQueue = true; + this.splices = void 0; + this.oldCollection = void 0; + const finalSplices = oldCollection === void 0 ? projectArraySplices(this.source, splices) : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length); + this.notify(finalSplices); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/ref.js + function ref(propertyName) { + return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); + } + var RefBehavior; + var init_ref = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/ref.js"() { + init_html_directive(); + RefBehavior = class { + /** + * Creates an instance of RefBehavior. + * @param target - The element to reference. + * @param propertyName - The name of the property to assign the reference to. + */ + constructor(target, propertyName) { + this.target = target; + this.propertyName = propertyName; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + source[this.propertyName] = this.target; + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ + unbind() { + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/interfaces.js + var isFunction; + var init_interfaces = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/interfaces.js"() { + isFunction = (object) => typeof object === "function"; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/when.js + function normalizeBinding(value) { + return value === void 0 ? noTemplate : isFunction(value) ? value : () => value; + } + function when(binding, templateOrTemplateBinding, elseTemplateOrTemplateBinding) { + const dataBinding = isFunction(binding) ? binding : () => binding; + const templateBinding = normalizeBinding(templateOrTemplateBinding); + const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding); + return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context); + } + var noTemplate; + var init_when = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/when.js"() { + init_interfaces(); + noTemplate = () => null; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js + function bindWithoutPositioning(view, items, index, context) { + view.bind(items[index], context); + } + function bindWithPositioning(view, items, index, context) { + const childContext = Object.create(context); + childContext.index = index; + childContext.length = items.length; + view.bind(items[index], childContext); + } + var defaultRepeatOptions, RepeatBehavior, RepeatDirective; + var init_repeat = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js"() { + init_dom(); + init_observable(); + init_array_observer(); + init_platform(); + init_html_directive(); + init_view(); + defaultRepeatOptions = Object.freeze({ + positioning: false, + recycle: true + }); + RepeatBehavior = class { + /** + * Creates an instance of RepeatBehavior. + * @param location - The location in the DOM to render the repeat. + * @param itemsBinding - The array to render. + * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies. + * @param templateBinding - The template to render for each item. + * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies. + * @param options - Options used to turn on special repeat features. + */ + constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) { + this.location = location; + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.source = null; + this.views = []; + this.items = null; + this.itemsObserver = null; + this.originalContext = void 0; + this.childContext = void 0; + this.bindView = bindWithoutPositioning; + this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile); + this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile); + if (options.positioning) { + this.bindView = bindWithPositioning; + } + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source, context) { + this.source = source; + this.originalContext = context; + this.childContext = Object.create(context); + this.childContext.parent = source; + this.childContext.parentContext = this.originalContext; + this.items = this.itemsBindingObserver.observe(source, this.originalContext); + this.template = this.templateBindingObserver.observe(source, this.originalContext); + this.observeItems(true); + this.refreshAllViews(); + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.source = null; + this.items = null; + if (this.itemsObserver !== null) { + this.itemsObserver.unsubscribe(this); + } + this.unbindAllViews(); + this.itemsBindingObserver.disconnect(); + this.templateBindingObserver.disconnect(); + } + /** @internal */ + handleChange(source, args) { + if (source === this.itemsBinding) { + this.items = this.itemsBindingObserver.observe(this.source, this.originalContext); + this.observeItems(); + this.refreshAllViews(); + } else if (source === this.templateBinding) { + this.template = this.templateBindingObserver.observe(this.source, this.originalContext); + this.refreshAllViews(true); + } else { + this.updateViews(args); + } + } + observeItems(force = false) { + if (!this.items) { + this.items = emptyArray; + return; + } + const oldObserver = this.itemsObserver; + const newObserver = this.itemsObserver = Observable.getNotifier(this.items); + const hasNewObserver = oldObserver !== newObserver; + if (hasNewObserver && oldObserver !== null) { + oldObserver.unsubscribe(this); + } + if (hasNewObserver || force) { + newObserver.subscribe(this); + } + } + updateViews(splices) { + const childContext = this.childContext; + const views = this.views; + const bindView = this.bindView; + const items = this.items; + const template = this.template; + const recycle = this.options.recycle; + const leftoverViews = []; + let leftoverIndex = 0; + let availableViews = 0; + for (let i = 0, ii = splices.length; i < ii; ++i) { + const splice = splices[i]; + const removed = splice.removed; + let removeIndex = 0; + let addIndex = splice.index; + const end = addIndex + splice.addedCount; + const removedViews = views.splice(splice.index, removed.length); + const totalAvailableViews = availableViews = leftoverViews.length + removedViews.length; + for (; addIndex < end; ++addIndex) { + const neighbor = views[addIndex]; + const location = neighbor ? neighbor.firstChild : this.location; + let view; + if (recycle && availableViews > 0) { + if (removeIndex <= totalAvailableViews && removedViews.length > 0) { + view = removedViews[removeIndex]; + removeIndex++; + } else { + view = leftoverViews[leftoverIndex]; + leftoverIndex++; + } + availableViews--; + } else { + view = template.create(); + } + views.splice(addIndex, 0, view); + bindView(view, items, addIndex, childContext); + view.insertBefore(location); + } + if (removedViews[removeIndex]) { + leftoverViews.push(...removedViews.slice(removeIndex)); + } + } + for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) { + leftoverViews[i].dispose(); + } + if (this.options.positioning) { + for (let i = 0, ii = views.length; i < ii; ++i) { + const currentContext = views[i].context; + currentContext.length = ii; + currentContext.index = i; + } + } + } + refreshAllViews(templateChanged = false) { + const items = this.items; + const childContext = this.childContext; + const template = this.template; + const location = this.location; + const bindView = this.bindView; + let itemsLength = items.length; + let views = this.views; + let viewsLength = views.length; + if (itemsLength === 0 || templateChanged || !this.options.recycle) { + HTMLView.disposeContiguousBatch(views); + viewsLength = 0; + } + if (viewsLength === 0) { + this.views = views = new Array(itemsLength); + for (let i = 0; i < itemsLength; ++i) { + const view = template.create(); + bindView(view, items, i, childContext); + views[i] = view; + view.insertBefore(location); + } + } else { + let i = 0; + for (; i < itemsLength; ++i) { + if (i < viewsLength) { + const view = views[i]; + bindView(view, items, i, childContext); + } else { + const view = template.create(); + bindView(view, items, i, childContext); + views.push(view); + view.insertBefore(location); + } + } + const removed = views.splice(i, viewsLength - i); + for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) { + removed[i].dispose(); + } + } + } + unbindAllViews() { + const views = this.views; + for (let i = 0, ii = views.length; i < ii; ++i) { + views[i].unbind(); + } + } + }; + RepeatDirective = class extends HTMLDirective { + /** + * Creates an instance of RepeatDirective. + * @param itemsBinding - The binding that provides the array to render. + * @param templateBinding - The template binding used to obtain a template to render for each item in the array. + * @param options - Options used to turn on special repeat features. + */ + constructor(itemsBinding, templateBinding, options) { + super(); + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.createPlaceholder = DOM.createBlockPlaceholder; + enableArrayObservation(); + this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding); + this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + */ + createBehavior(target) { + return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js + function elements(selector) { + if (selector) { + return function(value, index, array) { + return value.nodeType === 1 && value.matches(selector); + }; + } + return function(value, index, array) { + return value.nodeType === 1; + }; + } + var NodeObservationBehavior; + var init_node_observation = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js"() { + init_observable(); + init_platform(); + NodeObservationBehavior = class { + /** + * Creates an instance of NodeObservationBehavior. + * @param target - The target to assign the nodes property on. + * @param options - The options to use in configuring node observation. + */ + constructor(target, options) { + this.target = target; + this.options = options; + this.source = null; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + const name = this.options.property; + this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name); + this.source = source; + this.updateTarget(this.computeNodes()); + if (this.shouldUpdate) { + this.observe(); + } + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.updateTarget(emptyArray); + this.source = null; + if (this.shouldUpdate) { + this.disconnect(); + } + } + /** @internal */ + handleEvent() { + this.updateTarget(this.computeNodes()); + } + computeNodes() { + let nodes = this.getNodes(); + if (this.options.filter !== void 0) { + nodes = nodes.filter(this.options.filter); + } + return nodes; + } + updateTarget(value) { + this.source[this.options.property] = value; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js + function slotted(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { property: propertyOrOptions }; + } + return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions); + } + var SlottedBehavior; + var init_slotted = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js"() { + init_html_directive(); + init_node_observation(); + SlottedBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of SlottedBehavior. + * @param target - The slot element target to observe. + * @param options - The options to use when observing the slot. + */ + constructor(target, options) { + super(target, options); + } + /** + * Begins observation of the nodes. + */ + observe() { + this.target.addEventListener("slotchange", this); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.target.removeEventListener("slotchange", this); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + return this.target.assignedNodes(this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/children.js + function children(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { + property: propertyOrOptions + }; + } + return new AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions); + } + var ChildrenBehavior; + var init_children = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/children.js"() { + init_html_directive(); + init_node_observation(); + ChildrenBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of ChildrenBehavior. + * @param target - The element target to observe children on. + * @param options - The options to use when observing the element children. + */ + constructor(target, options) { + super(target, options); + this.observer = null; + options.childList = true; + } + /** + * Begins observation of the nodes. + */ + observe() { + if (this.observer === null) { + this.observer = new MutationObserver(this.handleEvent.bind(this)); + } + this.observer.observe(this.target, this.options); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.observer.disconnect(); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + if ("subtree" in this.options) { + return Array.from(this.target.querySelectorAll(this.options.selector)); + } + return Array.from(this.target.childNodes); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/index.js + var init_esm = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/index.js"() { + init_platform(); + init_template(); + init_fast_element(); + init_fast_definitions(); + init_attributes(); + init_controller(); + init_compiler(); + init_element_styles(); + init_css(); + init_css_directive(); + init_view(); + init_observable(); + init_notifier(); + init_dom(); + init_binding(); + init_html_directive(); + init_ref(); + init_when(); + init_repeat(); + init_slotted(); + init_children(); + init_node_observation(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js + var StartEnd, endSlotTemplate, startSlotTemplate, endTemplate, startTemplate; + var init_start_end = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js"() { + init_esm(); + StartEnd = class { + handleStartContentChange() { + this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); + } + handleEndContentChange() { + this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); + } + }; + endSlotTemplate = (context, definition) => html` + definition.end ? "end" : void 0} + > + + ${definition.end || ""} + + +`; + startSlotTemplate = (context, definition) => html` + + + ${definition.start || ""} + + +`; + endTemplate = html` + + + +`; + startTemplate = html` + + + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js + var init_accordion_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es6 = __esm({ + "node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/di.js + function cloneArrayWithPossibleProps(source) { + const clone = source.slice(); + const keys = Object.keys(source); + const len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + clone[key] = source[key]; + } + } + return clone; + } + function getParamTypes(key) { + return (Type) => { + return Reflect.getOwnMetadata(key, Type); + }; + } + function createResolver(getter) { + return function(key) { + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor); + }; + return resolver; + }; + } + function createAllResolver(getter) { + return function(key, searchAncestors) { + searchAncestors = !!searchAncestors; + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor, searchAncestors); + }; + return resolver; + }; + } + function ignore(target, property, descriptor) { + DI.inject(ignore)(target, property, descriptor); + } + function createNewInstance(key, handler) { + return handler.getFactory(key).construct(handler); + } + function containerGetKey(d) { + return this.get(d); + } + function transformInstance(inst, transform) { + return transform(inst); + } + function isRegistry(obj) { + return typeof obj.register === "function"; + } + function isSelfRegistry(obj) { + return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; + } + function isRegisterInRequester(obj) { + return isSelfRegistry(obj) && obj.registerInRequestor; + } + function isClass(obj) { + return obj.prototype !== void 0; + } + function cacheCallbackResult(fun) { + return function(handler, requestor, resolver) { + if (cache.has(resolver)) { + return cache.get(resolver); + } + const t = fun(handler, requestor, resolver); + cache.set(resolver, t); + return t; + }; + } + function validateKey(key) { + if (key === null || key === void 0) { + throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); + } + } + function buildAllResponse(resolver, handler, requestor) { + if (resolver instanceof ResolverImpl && resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].resolve(handler, requestor); + } + return results; + } + return [resolver.resolve(handler, requestor)]; + } + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + function isArrayIndex(value) { + switch (typeof value) { + case "number": + return value >= 0 && (value | 0) === value; + case "string": { + const result = isNumericLookup[value]; + if (result !== void 0) { + return result; + } + const length = value.length; + if (length === 0) { + return isNumericLookup[value] = false; + } + let ch = 0; + for (let i = 0; i < length; ++i) { + ch = value.charCodeAt(i); + if (i === 0 && ch === 48 && length > 1 || ch < 48 || ch > 57) { + return isNumericLookup[value] = false; + } + } + return isNumericLookup[value] = true; + } + default: + return false; + } + } + var metadataByTarget, ResolverBuilder, DefaultResolver, ContainerConfiguration, dependencyLookup, rootDOMContainer, DI, Container, inject, defaultSingletonOptions, all, lazy, optional, newInstanceForScope, newInstanceOf, ResolverImpl, FactoryImpl, containerResolver, InstrinsicTypeNames, DILocateParentEventType, factories, ContainerImpl, cache, Registration, defaultFriendlyName, isNativeFunction, isNumericLookup; + var init_di = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"() { + init_esm(); + metadataByTarget = /* @__PURE__ */ new Map(); + if (!("metadata" in Reflect)) { + Reflect.metadata = function(key, value) { + return function(target) { + Reflect.defineMetadata(key, value, target); + }; + }; + Reflect.defineMetadata = function(key, value, target) { + let metadata = metadataByTarget.get(target); + if (metadata === void 0) { + metadataByTarget.set(target, metadata = /* @__PURE__ */ new Map()); + } + metadata.set(key, value); + }; + Reflect.getOwnMetadata = function(key, target) { + const metadata = metadataByTarget.get(target); + if (metadata !== void 0) { + return metadata.get(key); + } + return void 0; + }; + } + ResolverBuilder = class { + /** + * + * @param container - The container to create resolvers for. + * @param key - The key to register resolvers under. + */ + constructor(container, key) { + this.container = container; + this.key = key; + } + /** + * Creates a resolver for an existing object instance. + * @param value - The instance to resolve. + * @returns The resolver. + */ + instance(value) { + return this.registerResolver(0, value); + } + /** + * Creates a resolver that enforces a singleton lifetime. + * @param value - The type to create and cache the singleton for. + * @returns The resolver. + */ + singleton(value) { + return this.registerResolver(1, value); + } + /** + * Creates a resolver that creates a new instance for every dependency request. + * @param value - The type to create instances of. + * @returns - The resolver. + */ + transient(value) { + return this.registerResolver(2, value); + } + /** + * Creates a resolver that invokes a callback function for every dependency resolution + * request, allowing custom logic to return the dependency. + * @param value - The callback to call during resolution. + * @returns The resolver. + */ + callback(value) { + return this.registerResolver(3, value); + } + /** + * Creates a resolver that invokes a callback function the first time that a dependency + * resolution is requested. The returned value is then cached and provided for all + * subsequent requests. + * @param value - The callback to call during the first resolution. + * @returns The resolver. + */ + cachedCallback(value) { + return this.registerResolver(3, cacheCallbackResult(value)); + } + /** + * Aliases the current key to a different key. + * @param destinationKey - The key to point the alias to. + * @returns The resolver. + */ + aliasTo(destinationKey) { + return this.registerResolver(5, destinationKey); + } + registerResolver(strategy, state) { + const { container, key } = this; + this.container = this.key = void 0; + return container.registerResolver(key, new ResolverImpl(key, strategy, state)); + } + }; + DefaultResolver = Object.freeze({ + /** + * Disables auto-registration and throws for all un-registered dependencies. + * @param key - The key to create the resolver for. + */ + none(key) { + throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`); + }, + /** + * Provides default singleton resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + singleton(key) { + return new ResolverImpl(key, 1, key); + }, + /** + * Provides default transient resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + transient(key) { + return new ResolverImpl(key, 2, key); + } + }); + ContainerConfiguration = Object.freeze({ + /** + * The default configuration used when creating a DOM-disconnected container. + * @remarks + * The default creates a root container, with no parent container. It does not handle + * owner requests and it uses singleton resolution behavior for auto-registration. + */ + default: Object.freeze({ + parentLocator: () => null, + responsibleForOwnerRequests: false, + defaultResolver: DefaultResolver.singleton + }) + }); + dependencyLookup = /* @__PURE__ */ new Map(); + rootDOMContainer = null; + DI = Object.freeze({ + /** + * Creates a new dependency injection container. + * @param config - The configuration for the container. + * @returns A newly created dependency injection container. + */ + createContainer(config) { + return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); + }, + /** + * Finds the dependency injection container responsible for providing dependencies + * to the specified node. + * @param node - The node to find the responsible container for. + * @returns The container responsible for providing dependencies to the node. + * @remarks + * This will be the same as the parent container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findResponsibleContainer(node) { + const owned = node.$$container$$; + if (owned && owned.responsibleForOwnerRequests) { + return owned; + } + return DI.findParentContainer(node); + }, + /** + * Find the dependency injection container up the DOM tree from this node. + * @param node - The node to find the parent container for. + * @returns The parent container of this node. + * @remarks + * This will be the same as the responsible container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findParentContainer(node) { + const event = new CustomEvent(DILocateParentEventType, { + bubbles: true, + composed: true, + cancelable: true, + detail: { container: void 0 } + }); + node.dispatchEvent(event); + return event.detail.container || DI.getOrCreateDOMContainer(); + }, + /** + * Returns a dependency injection container if one is explicitly owned by the specified + * node. If one is not owned, then a new container is created and assigned to the node. + * @param node - The node to find or create the container for. + * @param config - The configuration for the container if one needs to be created. + * @returns The located or created container. + * @remarks + * This API does not search for a responsible or parent container. It looks only for a container + * directly defined on the specified node and creates one at that location if one does not + * already exist. + */ + getOrCreateDOMContainer(node, config) { + if (!node) { + return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: () => null + }))); + } + return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: DI.findParentContainer + })); + }, + /** + * Gets the "design:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getDesignParamtypes: getParamTypes("design:paramtypes"), + /** + * Gets the "di:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getAnnotationParamtypes: getParamTypes("di:paramtypes"), + /** + * + * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, + * an empty metadata array is created and added. + * @returns The metadata array. + */ + getOrCreateAnnotationParamTypes(Type) { + let annotationParamtypes = this.getAnnotationParamtypes(Type); + if (annotationParamtypes === void 0) { + Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); + } + return annotationParamtypes; + }, + /** + * Gets the dependency keys representing what is needed to instantiate the specified type. + * @param Type - The type to get the dependencies for. + * @returns An array of dependency keys. + */ + getDependencies(Type) { + let dependencies = dependencyLookup.get(Type); + if (dependencies === void 0) { + const inject2 = Type.inject; + if (inject2 === void 0) { + const designParamtypes = DI.getDesignParamtypes(Type); + const annotationParamtypes = DI.getAnnotationParamtypes(Type); + if (designParamtypes === void 0) { + if (annotationParamtypes === void 0) { + const Proto = Object.getPrototypeOf(Type); + if (typeof Proto === "function" && Proto !== Function.prototype) { + dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); + } else { + dependencies = []; + } + } else { + dependencies = cloneArrayWithPossibleProps(annotationParamtypes); + } + } else if (annotationParamtypes === void 0) { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + } else { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + let len = annotationParamtypes.length; + let auAnnotationParamtype; + for (let i = 0; i < len; ++i) { + auAnnotationParamtype = annotationParamtypes[i]; + if (auAnnotationParamtype !== void 0) { + dependencies[i] = auAnnotationParamtype; + } + } + const keys = Object.keys(annotationParamtypes); + len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + dependencies[key] = annotationParamtypes[key]; + } + } + } + } else { + dependencies = cloneArrayWithPossibleProps(inject2); + } + dependencyLookup.set(Type, dependencies); + } + return dependencies; + }, + /** + * Defines a property on a web component class. The value of this property will + * be resolved from the dependency injection container responsible for the element + * instance, based on where it is connected in the DOM. + * @param target - The target to define the property on. + * @param propertyName - The name of the property to define. + * @param key - The dependency injection key. + * @param respectConnection - Indicates whether or not to update the property value if the + * hosting component is disconnected and then re-connected at a different location in the DOM. + * @remarks + * The respectConnection option is only applicable to elements that descend from FASTElement. + */ + defineProperty(target, propertyName, key, respectConnection = false) { + const diPropertyKey = `$di_${propertyName}`; + Reflect.defineProperty(target, propertyName, { + get: function() { + let value = this[diPropertyKey]; + if (value === void 0) { + const container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); + value = container.get(key); + this[diPropertyKey] = value; + if (respectConnection && this instanceof FASTElement) { + const notifier = this.$fastController; + const handleChange = () => { + const newContainer = DI.findResponsibleContainer(this); + const newValue = newContainer.get(key); + const oldValue = this[diPropertyKey]; + if (newValue !== oldValue) { + this[diPropertyKey] = value; + notifier.notify(propertyName); + } + }; + notifier.subscribe({ handleChange }, "isConnected"); + } + } + return value; + } + }); + }, + /** + * Creates a dependency injection key. + * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a + * default resolution for the dependency. + * @param configuror - If a friendly name was provided for the first parameter, then an optional + * lambda that configures a default resolution for the dependency can be provided second. + * @returns The created key. + * @remarks + * The created key can be used as a property decorator or constructor parameter decorator, + * in addition to its standard use in an inject array or through direct container APIs. + */ + createInterface(nameConfigOrCallback, configuror) { + const configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; + const friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; + const respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; + const Interface = function(target, property, index) { + if (target == null || new.target !== void 0) { + throw new Error(`No registration for interface: '${Interface.friendlyName}'`); + } + if (property) { + DI.defineProperty(target, property, Interface, respectConnection); + } else { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + annotationParamtypes[index] = Interface; + } + }; + Interface.$isInterface = true; + Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; + if (configure != null) { + Interface.register = function(container, key) { + return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); + }; + } + Interface.toString = function toString() { + return `InterfaceSymbol<${Interface.friendlyName}>`; + }; + return Interface; + }, + /** + * A decorator that specifies what to inject into its target. + * @param dependencies - The dependencies to inject. + * @returns The decorator to be applied to the target class. + * @remarks + * The decorator can be used to decorate a class, listing all of the classes dependencies. + * Or it can be used to decorate a constructor paramter, indicating what to inject for that + * parameter. + * Or it can be used for a web component property, indicating what that property should resolve to. + */ + inject(...dependencies) { + return function(target, key, descriptor) { + if (typeof descriptor === "number") { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + const dep = dependencies[0]; + if (dep !== void 0) { + annotationParamtypes[descriptor] = dep; + } + } else if (key) { + DI.defineProperty(target, key, dependencies[0]); + } else { + const annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); + let dep; + for (let i = 0; i < dependencies.length; ++i) { + dep = dependencies[i]; + if (dep !== void 0) { + annotationParamtypes[i] = dep; + } + } + } + }; + }, + /** + * Registers the `target` class as a transient dependency; each time the dependency is resolved + * a new instance will be created. + * + * @param target - The class / constructor function to register as transient. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.transient(Foo); + * ``` + * + * @example + * Inline declaration + * + * ```ts + * const Foo = DI.transient(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + transient(target) { + target.register = function register(container) { + const registration = Registration.transient(target, target); + return registration.register(container); + }; + target.registerInRequestor = false; + return target; + }, + /** + * Registers the `target` class as a singleton dependency; the class will only be created once. Each + * consecutive time the dependency is resolved, the same instance will be returned. + * + * @param target - The class / constructor function to register as a singleton. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.singleton(Foo); + * ``` + * + * @example + * Inline declaration + * ```ts + * const Foo = DI.singleton(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + singleton(target, options = defaultSingletonOptions) { + target.register = function register(container) { + const registration = Registration.singleton(target, target); + return registration.register(container); + }; + target.registerInRequestor = options.scoped; + return target; + } + }); + Container = DI.createInterface("Container"); + inject = DI.inject; + defaultSingletonOptions = { scoped: false }; + all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors)); + lazy = createResolver((key, handler, requestor) => { + return () => requestor.get(key); + }); + optional = createResolver((key, handler, requestor) => { + if (requestor.has(key, true)) { + return requestor.get(key); + } else { + return void 0; + } + }); + ignore.$isResolver = true; + ignore.resolve = () => void 0; + newInstanceForScope = createResolver((key, handler, requestor) => { + const instance = createNewInstance(key, handler); + const resolver = new ResolverImpl(key, 0, instance); + requestor.registerResolver(key, resolver); + return instance; + }); + newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler)); + ResolverImpl = class { + constructor(key, strategy, state) { + this.key = key; + this.strategy = strategy; + this.state = state; + this.resolving = false; + } + get $isResolver() { + return true; + } + register(container) { + return container.registerResolver(this.key, this); + } + resolve(handler, requestor) { + switch (this.strategy) { + case 0: + return this.state; + case 1: { + if (this.resolving) { + throw new Error(`Cyclic dependency found: ${this.state.name}`); + } + this.resolving = true; + this.state = handler.getFactory(this.state).construct(requestor); + this.strategy = 0; + this.resolving = false; + return this.state; + } + case 2: { + const factory = handler.getFactory(this.state); + if (factory === null) { + throw new Error(`Resolver for ${String(this.key)} returned a null factory`); + } + return factory.construct(requestor); + } + case 3: + return this.state(handler, requestor, this); + case 4: + return this.state[0].resolve(handler, requestor); + case 5: + return requestor.get(this.state); + default: + throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`); + } + } + getFactory(container) { + var _a, _b, _c; + switch (this.strategy) { + case 1: + case 2: + return container.getFactory(this.state); + case 5: + return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; + default: + return null; + } + } + }; + FactoryImpl = class { + constructor(Type, dependencies) { + this.Type = Type; + this.dependencies = dependencies; + this.transformers = null; + } + construct(container, dynamicDependencies) { + let instance; + if (dynamicDependencies === void 0) { + instance = new this.Type(...this.dependencies.map(containerGetKey, container)); + } else { + instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies); + } + if (this.transformers == null) { + return instance; + } + return this.transformers.reduce(transformInstance, instance); + } + registerTransformer(transformer) { + (this.transformers || (this.transformers = [])).push(transformer); + } + }; + containerResolver = { + $isResolver: true, + resolve(handler, requestor) { + return requestor; + } + }; + InstrinsicTypeNames = /* @__PURE__ */ new Set([ + "Array", + "ArrayBuffer", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Number", + "Object", + "Promise", + "RangeError", + "ReferenceError", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "URIError", + "WeakMap", + "WeakSet" + ]); + DILocateParentEventType = "__DI_LOCATE_PARENT__"; + factories = /* @__PURE__ */ new Map(); + ContainerImpl = class _ContainerImpl { + constructor(owner, config) { + this.owner = owner; + this.config = config; + this._parent = void 0; + this.registerDepth = 0; + this.context = null; + if (owner !== null) { + owner.$$container$$ = this; + } + this.resolvers = /* @__PURE__ */ new Map(); + this.resolvers.set(Container, containerResolver); + if (owner instanceof Node) { + owner.addEventListener(DILocateParentEventType, (e) => { + if (e.composedPath()[0] !== this.owner) { + e.detail.container = this; + e.stopImmediatePropagation(); + } + }); + } + } + get parent() { + if (this._parent === void 0) { + this._parent = this.config.parentLocator(this.owner); + } + return this._parent; + } + get depth() { + return this.parent === null ? 0 : this.parent.depth + 1; + } + get responsibleForOwnerRequests() { + return this.config.responsibleForOwnerRequests; + } + registerWithContext(context, ...params) { + this.context = context; + this.register(...params); + this.context = null; + return this; + } + register(...params) { + if (++this.registerDepth === 100) { + throw new Error("Unable to autoregister dependency"); + } + let current; + let keys; + let value; + let j; + let jj; + const context = this.context; + for (let i = 0, ii = params.length; i < ii; ++i) { + current = params[i]; + if (!isObject(current)) { + continue; + } + if (isRegistry(current)) { + current.register(this, context); + } else if (isClass(current)) { + Registration.singleton(current, current).register(this); + } else { + keys = Object.keys(current); + j = 0; + jj = keys.length; + for (; j < jj; ++j) { + value = current[keys[j]]; + if (!isObject(value)) { + continue; + } + if (isRegistry(value)) { + value.register(this, context); + } else { + this.register(value); + } + } + } + } + --this.registerDepth; + return this; + } + registerResolver(key, resolver) { + validateKey(key); + const resolvers = this.resolvers; + const result = resolvers.get(key); + if (result == null) { + resolvers.set(key, resolver); + } else if (result instanceof ResolverImpl && result.strategy === 4) { + result.state.push(resolver); + } else { + resolvers.set(key, new ResolverImpl(key, 4, [result, resolver])); + } + return resolver; + } + registerTransformer(key, transformer) { + const resolver = this.getResolver(key); + if (resolver == null) { + return false; + } + if (resolver.getFactory) { + const factory = resolver.getFactory(this); + if (factory == null) { + return false; + } + factory.registerTransformer(transformer); + return true; + } + return false; + } + getResolver(key, autoRegister = true) { + validateKey(key); + if (key.resolve !== void 0) { + return key; + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + return autoRegister ? this.jitRegister(key, handler) : null; + } + current = current.parent; + } else { + return resolver; + } + } + return null; + } + has(key, searchAncestors = false) { + return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; + } + get(key) { + validateKey(key); + if (key.$isResolver) { + return key.resolve(this, this); + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + resolver = this.jitRegister(key, handler); + return resolver.resolve(current, this); + } + current = current.parent; + } else { + return resolver.resolve(current, this); + } + } + throw new Error(`Unable to resolve key: ${String(key)}`); + } + getAll(key, searchAncestors = false) { + validateKey(key); + const requestor = this; + let current = requestor; + let resolver; + if (searchAncestors) { + let resolutions = emptyArray; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver != null) { + resolutions = resolutions.concat( + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + buildAllResponse(resolver, current, requestor) + ); + } + current = current.parent; + } + return resolutions; + } else { + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + current = current.parent; + if (current == null) { + return emptyArray; + } + } else { + return buildAllResponse(resolver, current, requestor); + } + } + } + return emptyArray; + } + getFactory(Type) { + let factory = factories.get(Type); + if (factory === void 0) { + if (isNativeFunction(Type)) { + throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`); + } + factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); + } + return factory; + } + registerFactory(key, factory) { + factories.set(key, factory); + } + createChild(config) { + return new _ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this })); + } + jitRegister(keyAsValue, handler) { + if (typeof keyAsValue !== "function") { + throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`); + } + if (InstrinsicTypeNames.has(keyAsValue.name)) { + throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`); + } + if (isRegistry(keyAsValue)) { + const registrationResolver = keyAsValue.register(handler); + if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { + const newResolver = handler.resolvers.get(keyAsValue); + if (newResolver != void 0) { + return newResolver; + } + throw new Error("A valid resolver was not returned from the static register method"); + } + return registrationResolver; + } else if (keyAsValue.$isInterface) { + throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`); + } else { + const resolver = this.config.defaultResolver(keyAsValue, handler); + handler.resolvers.set(keyAsValue, resolver); + return resolver; + } + } + }; + cache = /* @__PURE__ */ new WeakMap(); + Registration = Object.freeze({ + /** + * Allows you to pass an instance. + * Every time you request this {@link Key} you will get this instance back. + * + * @example + * ``` + * Registration.instance(Foo, new Foo())); + * ``` + * + * @param key - The key to register the instance under. + * @param value - The instance to return when the key is requested. + */ + instance(key, value) { + return new ResolverImpl(key, 0, value); + }, + /** + * Creates an instance from the class. + * Every time you request this {@link Key} you will get the same one back. + * + * @example + * ``` + * Registration.singleton(Foo, Foo); + * ``` + * + * @param key - The key to register the singleton under. + * @param value - The class to instantiate as a singleton when first requested. + */ + singleton(key, value) { + return new ResolverImpl(key, 1, value); + }, + /** + * Creates an instance from a class. + * Every time you request this {@link Key} you will get a new instance. + * + * @example + * ``` + * Registration.instance(Foo, Foo); + * ``` + * + * @param key - The key to register the instance type under. + * @param value - The class to instantiate each time the key is requested. + */ + transient(key, value) { + return new ResolverImpl(key, 2, value); + }, + /** + * Delegates to a callback function to provide the dependency. + * Every time you request this {@link Key} the callback will be invoked to provide + * the dependency. + * + * @example + * ``` + * Registration.callback(Foo, () => new Foo()); + * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + */ + callback(key, callback) { + return new ResolverImpl(key, 3, callback); + }, + /** + * Delegates to a callback function to provide the dependency and then caches the + * dependency for future requests. + * + * @example + * ``` + * Registration.cachedCallback(Foo, () => new Foo()); + * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + * @remarks + * If you pass the same Registration to another container, the same cached value will be used. + * Should all references to the resolver returned be removed, the cache will expire. + */ + cachedCallback(key, callback) { + return new ResolverImpl(key, 3, cacheCallbackResult(callback)); + }, + /** + * Creates an alternate {@link Key} to retrieve an instance by. + * + * @example + * ``` + * Register.singleton(Foo, Foo) + * Register.aliasTo(Foo, MyFoos); + * + * container.getAll(MyFoos) // contains an instance of Foo + * ``` + * + * @param originalKey - The original key that has been registered. + * @param aliasKey - The alias to the original key. + */ + aliasTo(originalKey, aliasKey) { + return new ResolverImpl(aliasKey, 5, originalKey); + } + }); + defaultFriendlyName = "(anonymous)"; + isNativeFunction = /* @__PURE__ */ (function() { + const lookup = /* @__PURE__ */ new WeakMap(); + let isNative = false; + let sourceText = ""; + let i = 0; + return function(fn) { + isNative = lookup.get(fn); + if (isNative === void 0) { + sourceText = fn.toString(); + i = sourceText.length; + isNative = // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string + i >= 29 && // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. + i <= 100 && // This whole heuristic *could* be tricked by a comment. Do we need to care about that? + sourceText.charCodeAt(i - 1) === 125 && // } + // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. + sourceText.charCodeAt(i - 2) <= 32 && // whitespace + sourceText.charCodeAt(i - 3) === 93 && // ] + sourceText.charCodeAt(i - 4) === 101 && // e + sourceText.charCodeAt(i - 5) === 100 && // d + sourceText.charCodeAt(i - 6) === 111 && // o + sourceText.charCodeAt(i - 7) === 99 && // c + sourceText.charCodeAt(i - 8) === 32 && // + sourceText.charCodeAt(i - 9) === 101 && // e + sourceText.charCodeAt(i - 10) === 118 && // v + sourceText.charCodeAt(i - 11) === 105 && // i + sourceText.charCodeAt(i - 12) === 116 && // t + sourceText.charCodeAt(i - 13) === 97 && // a + sourceText.charCodeAt(i - 14) === 110 && // n + sourceText.charCodeAt(i - 15) === 88; + lookup.set(fn, isNative); + } + return isNative; + }; + })(); + isNumericLookup = {}; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js + function presentationKeyFromTag(tagName) { + return `${tagName.toLowerCase()}:presentation`; + } + var presentationRegistry, ComponentPresentation, DefaultComponentPresentation; + var init_component_presentation = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js"() { + init_esm(); + init_di(); + presentationRegistry = /* @__PURE__ */ new Map(); + ComponentPresentation = Object.freeze({ + /** + * Defines a component presentation for an element. + * @param tagName - The element name to define the presentation for. + * @param presentation - The presentation that will be applied to matching elements. + * @param container - The dependency injection container to register the configuration in. + * @public + */ + define(tagName, presentation, container) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === void 0) { + presentationRegistry.set(key, presentation); + } else { + presentationRegistry.set(key, false); + } + container.register(Registration.instance(key, presentation)); + }, + /** + * Finds a component presentation for the specified element name, + * searching the DOM hierarchy starting from the provided element. + * @param tagName - The name of the element to locate the presentation for. + * @param element - The element to begin the search from. + * @returns The component presentation or null if none is found. + * @public + */ + forTag(tagName, element) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === false) { + const container = DI.findResponsibleContainer(element); + return container.get(key); + } + return existing || null; + } + }); + DefaultComponentPresentation = class { + /** + * Creates an instance of DefaultComponentPresentation. + * @param template - The template to apply to the element. + * @param styles - The styles to apply to the element. + * @public + */ + constructor(template, styles) { + this.template = template || null; + this.styles = styles === void 0 ? null : Array.isArray(styles) ? ElementStyles.create(styles) : styles instanceof ElementStyles ? styles : ElementStyles.create([styles]); + } + /** + * Applies the presentation details to the specified element. + * @param element - The element to apply the presentation details to. + * @public + */ + applyTo(element) { + const controller = element.$fastController; + if (controller.template === null) { + controller.template = this.template; + } + if (controller.styles === null) { + controller.styles = this.styles; + } + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js + function resolveOption(option, context, definition) { + if (typeof option === "function") { + return option(context, definition); + } + return option; + } + var FoundationElement, FoundationElementRegistry; + var init_foundation_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js"() { + init_tslib_es6(); + init_esm(); + init_component_presentation(); + FoundationElement = class _FoundationElement extends FASTElement { + constructor() { + super(...arguments); + this._presentation = void 0; + } + /** + * A property which resolves the ComponentPresentation instance + * for the current component. + * @public + */ + get $presentation() { + if (this._presentation === void 0) { + this._presentation = ComponentPresentation.forTag(this.tagName, this); + } + return this._presentation; + } + templateChanged() { + if (this.template !== void 0) { + this.$fastController.template = this.template; + } + } + stylesChanged() { + if (this.styles !== void 0) { + this.$fastController.styles = this.styles; + } + } + /** + * The connected callback for this FASTElement. + * @remarks + * This method is invoked by the platform whenever this FoundationElement + * becomes connected to the document. + * @public + */ + connectedCallback() { + if (this.$presentation !== null) { + this.$presentation.applyTo(this); + } + super.connectedCallback(); + } + /** + * Defines an element registry function with a set of element definition defaults. + * @param elementDefinition - The definition of the element to create the registry + * function for. + * @public + */ + static compose(elementDefinition) { + return (overrideDefinition = {}) => new FoundationElementRegistry(this === _FoundationElement ? class extends _FoundationElement { + } : this, elementDefinition, overrideDefinition); + } + }; + __decorate([ + observable + ], FoundationElement.prototype, "template", void 0); + __decorate([ + observable + ], FoundationElement.prototype, "styles", void 0); + FoundationElementRegistry = class { + constructor(type, elementDefinition, overrideDefinition) { + this.type = type; + this.elementDefinition = elementDefinition; + this.overrideDefinition = overrideDefinition; + this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); + } + register(container, context) { + const definition = this.definition; + const overrideDefinition = this.overrideDefinition; + const prefix = definition.prefix || context.elementPrefix; + const name = `${prefix}-${definition.baseName}`; + context.tryDefineElement({ + name, + type: this.type, + baseClass: this.elementDefinition.baseClass, + callback: (x) => { + const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); + x.definePresentation(presentation); + let shadowOptions = resolveOption(definition.shadowOptions, x, definition); + if (x.shadowRootMode) { + if (shadowOptions) { + if (!overrideDefinition.shadowOptions) { + shadowOptions.mode = x.shadowRootMode; + } + } else if (shadowOptions !== null) { + shadowOptions = { mode: x.shadowRootMode }; + } + } + x.defineElement({ + elementOptions: resolveOption(definition.elementOptions, x, definition), + shadowOptions, + attributes: resolveOption(definition.attributes, x, definition) + }); + } + }); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js + function applyMixins(derivedCtor, ...baseCtors) { + const derivedAttributes = AttributeConfiguration.locate(derivedCtor); + baseCtors.forEach((baseCtor) => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { + if (name !== "constructor") { + Object.defineProperty( + derivedCtor.prototype, + name, + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + Object.getOwnPropertyDescriptor(baseCtor.prototype, name) + ); + } + }); + const baseAttributes = AttributeConfiguration.locate(baseCtor); + baseAttributes.forEach((x) => derivedAttributes.push(x)); + }); + } + var init_apply_mixins = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js"() { + init_esm(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js + var AccordionItem; + var init_accordion_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_start_end(); + init_apply_mixins(); + AccordionItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.headinglevel = 2; + this.expanded = false; + this.clickHandler = (e) => { + this.expanded = !this.expanded; + this.change(); + }; + this.change = () => { + this.$emit("change"); + }; + } + }; + __decorate([ + attr({ + attribute: "heading-level", + mode: "fromView", + converter: nullableNumberConverter + }) + ], AccordionItem.prototype, "headinglevel", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], AccordionItem.prototype, "expanded", void 0); + __decorate([ + attr + ], AccordionItem.prototype, "id", void 0); + applyMixins(AccordionItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js + var init_accordion_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js"() { + init_accordion_item_template(); + init_accordion_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js + var init_accordion_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/aria.js + var Orientation; + var init_aria = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/aria.js"() { + Orientation = { + horizontal: "horizontal", + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/array.js + function findLastIndex(array, predicate) { + let k = array.length; + while (k--) { + if (predicate(array[k], k, array)) { + return k; + } + } + return -1; + } + var init_array = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/array.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/class-names.js + var init_class_names = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/class-names.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-dom.js + function canUseDOM() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + var init_can_use_dom = __esm({ + "node_modules/exenv-es6/dist/can-use-dom.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-event-listeners.js + var init_can_use_event_listeners = __esm({ + "node_modules/exenv-es6/dist/can-use-event-listeners.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-viewport.js + var init_can_use_viewport = __esm({ + "node_modules/exenv-es6/dist/can-use-viewport.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-workers.js + var init_can_use_workers = __esm({ + "node_modules/exenv-es6/dist/can-use-workers.js"() { + } + }); + + // node_modules/exenv-es6/dist/index.js + var init_dist = __esm({ + "node_modules/exenv-es6/dist/index.js"() { + init_can_use_dom(); + init_can_use_event_listeners(); + init_can_use_viewport(); + init_can_use_workers(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/dom.js + function isHTMLElement(...args) { + return args.every((arg) => arg instanceof HTMLElement); + } + function getDisplayedNodes(rootNode, selector) { + if (!rootNode || !selector || !isHTMLElement(rootNode)) { + return; + } + const nodes = Array.from(rootNode.querySelectorAll(selector)); + return nodes.filter((node) => node.offsetParent !== null); + } + function getNonce() { + const node = document.querySelector('meta[property="csp-nonce"]'); + if (node) { + return node.getAttribute("content"); + } else { + return null; + } + } + function canUseFocusVisible() { + if (typeof _canUseFocusVisible === "boolean") { + return _canUseFocusVisible; + } + if (!canUseDOM()) { + _canUseFocusVisible = false; + return _canUseFocusVisible; + } + const styleElement = document.createElement("style"); + const styleNonce = getNonce(); + if (styleNonce !== null) { + styleElement.setAttribute("nonce", styleNonce); + } + document.head.appendChild(styleElement); + try { + styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); + _canUseFocusVisible = true; + } catch (e) { + _canUseFocusVisible = false; + } finally { + document.head.removeChild(styleElement); + } + return _canUseFocusVisible; + } + var _canUseFocusVisible; + var init_dom2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/dom.js"() { + init_dist(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/events.js + var eventFocus, eventFocusIn, eventFocusOut, eventKeyDown, eventResize, eventScroll; + var init_events = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/events.js"() { + eventFocus = "focus"; + eventFocusIn = "focusin"; + eventFocusOut = "focusout"; + eventKeyDown = "keydown"; + eventResize = "resize"; + eventScroll = "scroll"; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/html.js + var init_html = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/html.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/key-codes.js + var KeyCodes, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, keyEscape, keyHome, keyEnd, keyFunction2, keyPageDown, keyPageUp, keySpace, keyTab, keyBackspace, keyDelete, ArrowKeys; + var init_key_codes = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/key-codes.js"() { + (function(KeyCodes2) { + KeyCodes2[KeyCodes2["alt"] = 18] = "alt"; + KeyCodes2[KeyCodes2["arrowDown"] = 40] = "arrowDown"; + KeyCodes2[KeyCodes2["arrowLeft"] = 37] = "arrowLeft"; + KeyCodes2[KeyCodes2["arrowRight"] = 39] = "arrowRight"; + KeyCodes2[KeyCodes2["arrowUp"] = 38] = "arrowUp"; + KeyCodes2[KeyCodes2["back"] = 8] = "back"; + KeyCodes2[KeyCodes2["backSlash"] = 220] = "backSlash"; + KeyCodes2[KeyCodes2["break"] = 19] = "break"; + KeyCodes2[KeyCodes2["capsLock"] = 20] = "capsLock"; + KeyCodes2[KeyCodes2["closeBracket"] = 221] = "closeBracket"; + KeyCodes2[KeyCodes2["colon"] = 186] = "colon"; + KeyCodes2[KeyCodes2["colon2"] = 59] = "colon2"; + KeyCodes2[KeyCodes2["comma"] = 188] = "comma"; + KeyCodes2[KeyCodes2["ctrl"] = 17] = "ctrl"; + KeyCodes2[KeyCodes2["delete"] = 46] = "delete"; + KeyCodes2[KeyCodes2["end"] = 35] = "end"; + KeyCodes2[KeyCodes2["enter"] = 13] = "enter"; + KeyCodes2[KeyCodes2["equals"] = 187] = "equals"; + KeyCodes2[KeyCodes2["equals2"] = 61] = "equals2"; + KeyCodes2[KeyCodes2["equals3"] = 107] = "equals3"; + KeyCodes2[KeyCodes2["escape"] = 27] = "escape"; + KeyCodes2[KeyCodes2["forwardSlash"] = 191] = "forwardSlash"; + KeyCodes2[KeyCodes2["function1"] = 112] = "function1"; + KeyCodes2[KeyCodes2["function10"] = 121] = "function10"; + KeyCodes2[KeyCodes2["function11"] = 122] = "function11"; + KeyCodes2[KeyCodes2["function12"] = 123] = "function12"; + KeyCodes2[KeyCodes2["function2"] = 113] = "function2"; + KeyCodes2[KeyCodes2["function3"] = 114] = "function3"; + KeyCodes2[KeyCodes2["function4"] = 115] = "function4"; + KeyCodes2[KeyCodes2["function5"] = 116] = "function5"; + KeyCodes2[KeyCodes2["function6"] = 117] = "function6"; + KeyCodes2[KeyCodes2["function7"] = 118] = "function7"; + KeyCodes2[KeyCodes2["function8"] = 119] = "function8"; + KeyCodes2[KeyCodes2["function9"] = 120] = "function9"; + KeyCodes2[KeyCodes2["home"] = 36] = "home"; + KeyCodes2[KeyCodes2["insert"] = 45] = "insert"; + KeyCodes2[KeyCodes2["menu"] = 93] = "menu"; + KeyCodes2[KeyCodes2["minus"] = 189] = "minus"; + KeyCodes2[KeyCodes2["minus2"] = 109] = "minus2"; + KeyCodes2[KeyCodes2["numLock"] = 144] = "numLock"; + KeyCodes2[KeyCodes2["numPad0"] = 96] = "numPad0"; + KeyCodes2[KeyCodes2["numPad1"] = 97] = "numPad1"; + KeyCodes2[KeyCodes2["numPad2"] = 98] = "numPad2"; + KeyCodes2[KeyCodes2["numPad3"] = 99] = "numPad3"; + KeyCodes2[KeyCodes2["numPad4"] = 100] = "numPad4"; + KeyCodes2[KeyCodes2["numPad5"] = 101] = "numPad5"; + KeyCodes2[KeyCodes2["numPad6"] = 102] = "numPad6"; + KeyCodes2[KeyCodes2["numPad7"] = 103] = "numPad7"; + KeyCodes2[KeyCodes2["numPad8"] = 104] = "numPad8"; + KeyCodes2[KeyCodes2["numPad9"] = 105] = "numPad9"; + KeyCodes2[KeyCodes2["numPadDivide"] = 111] = "numPadDivide"; + KeyCodes2[KeyCodes2["numPadDot"] = 110] = "numPadDot"; + KeyCodes2[KeyCodes2["numPadMinus"] = 109] = "numPadMinus"; + KeyCodes2[KeyCodes2["numPadMultiply"] = 106] = "numPadMultiply"; + KeyCodes2[KeyCodes2["numPadPlus"] = 107] = "numPadPlus"; + KeyCodes2[KeyCodes2["openBracket"] = 219] = "openBracket"; + KeyCodes2[KeyCodes2["pageDown"] = 34] = "pageDown"; + KeyCodes2[KeyCodes2["pageUp"] = 33] = "pageUp"; + KeyCodes2[KeyCodes2["period"] = 190] = "period"; + KeyCodes2[KeyCodes2["print"] = 44] = "print"; + KeyCodes2[KeyCodes2["quote"] = 222] = "quote"; + KeyCodes2[KeyCodes2["scrollLock"] = 145] = "scrollLock"; + KeyCodes2[KeyCodes2["shift"] = 16] = "shift"; + KeyCodes2[KeyCodes2["space"] = 32] = "space"; + KeyCodes2[KeyCodes2["tab"] = 9] = "tab"; + KeyCodes2[KeyCodes2["tilde"] = 192] = "tilde"; + KeyCodes2[KeyCodes2["windowsLeft"] = 91] = "windowsLeft"; + KeyCodes2[KeyCodes2["windowsOpera"] = 219] = "windowsOpera"; + KeyCodes2[KeyCodes2["windowsRight"] = 92] = "windowsRight"; + })(KeyCodes || (KeyCodes = {})); + keyArrowDown = "ArrowDown"; + keyArrowLeft = "ArrowLeft"; + keyArrowRight = "ArrowRight"; + keyArrowUp = "ArrowUp"; + keyEnter = "Enter"; + keyEscape = "Escape"; + keyHome = "Home"; + keyEnd = "End"; + keyFunction2 = "F2"; + keyPageDown = "PageDown"; + keyPageUp = "PageUp"; + keySpace = " "; + keyTab = "Tab"; + keyBackspace = "Backspace"; + keyDelete = "Delete"; + ArrowKeys = { + ArrowDown: keyArrowDown, + ArrowLeft: keyArrowLeft, + ArrowRight: keyArrowRight, + ArrowUp: keyArrowUp + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/localization.js + var Direction; + var init_localization = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/localization.js"() { + (function(Direction2) { + Direction2["ltr"] = "ltr"; + Direction2["rtl"] = "rtl"; + })(Direction || (Direction = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/numbers.js + function wrapInBounds(min, max, value) { + if (value < min) { + return max; + } else if (value > max) { + return min; + } + return value; + } + function limit(min, max, value) { + return Math.min(Math.max(value, min), max); + } + function inRange(value, min, max = 0) { + [min, max] = [min, max].sort((a, b) => a - b); + return min <= value && value < max; + } + var init_numbers = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/numbers.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/strings.js + function uniqueId(prefix = "") { + return `${prefix}${uniqueIdCounter++}`; + } + var uniqueIdCounter; + var init_strings = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/strings.js"() { + uniqueIdCounter = 0; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/query.js + var init_query = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/query.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js + var RtlScrollConverter; + var init_rtl_scroll_converter = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js"() { + init_dist(); + init_localization(); + RtlScrollConverter = class _RtlScrollConverter { + /** + * Gets the scrollLeft value of the provided element + */ + static getScrollLeft(scrolledElement, direction) { + if (direction === Direction.rtl) { + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + return scrolledElement.scrollLeft; + } + /** + * Sets the scrollLeft value of the provided element + */ + static setScrollLeft(scrolledElement, scrollValue, direction) { + if (direction === Direction.rtl) { + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, scrollValue); + return; + } + scrolledElement.scrollLeft = scrollValue; + } + /** + * The initial rtl scroll converter getter function, it calls the browser test to set the correct converter + * functions and then invokes the getter + */ + static initialGetRtlScrollConverter(scrolledElement) { + _RtlScrollConverter.initializeRtlScrollConverters(); + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + /** + * The "direct" rtl get scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft; + } + /** + * The "inverted" get scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedGetRtlScrollConverter(scrolledElement) { + return -Math.abs(scrolledElement.scrollLeft); + } + /** + * The "reverse" get scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft - (scrolledElement.scrollWidth - scrolledElement.clientWidth); + } + /** + * The initial rtl scroll converter setter function, it calls the browser test to set the correct converter + * functions and then invokes the setter + */ + static initialSetRtlScrollConverter(scrolledElement, newScrollValue) { + _RtlScrollConverter.initializeRtlScrollConverters(); + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, newScrollValue); + } + /** + * The "direct" rtl set scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = newScrollValue; + } + /** + * The "inverted" set scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = Math.abs(newScrollValue); + } + /** + * The "reverse" set scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseSetRtlScrollConverter(scrolledElement, newScrollValue) { + const maxScroll = scrolledElement.scrollWidth - scrolledElement.clientWidth; + scrolledElement.scrollLeft = maxScroll + newScrollValue; + } + /** + * detects the appropriate rtl scroll converter functions and assigns them + * should only run once + */ + static initializeRtlScrollConverters() { + if (!canUseDOM()) { + _RtlScrollConverter.applyDirectScrollConverters(); + return; + } + const testElement = _RtlScrollConverter.getTestElement(); + document.body.appendChild(testElement); + _RtlScrollConverter.checkForScrollType(testElement); + document.body.removeChild(testElement); + } + /** + * checks the provided test element to determine scroll type + * and apply appropriate converters + */ + static checkForScrollType(testElement) { + if (_RtlScrollConverter.isReverse(testElement)) { + _RtlScrollConverter.applyReverseScrollConverters(); + } else { + if (_RtlScrollConverter.isDirect(testElement)) { + _RtlScrollConverter.applyDirectScrollConverters(); + } else { + _RtlScrollConverter.applyInvertedScrollConverters(); + } + } + } + /** + * checks test element initial state for rtl "reverse" mode + */ + static isReverse(testElement) { + return testElement.scrollLeft > 0; + } + /** + * checks test element for rtl "direct" mode + */ + static isDirect(testElement) { + testElement.scrollLeft = -1; + return testElement.scrollLeft < 0; + } + /** + * apply direct scroll conververters + */ + static applyDirectScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.directSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.directGetRtlScrollConverter; + } + /** + * apply inverted scroll conververters + */ + static applyInvertedScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.invertedSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.invertedGetRtlScrollConverter; + } + /** + * apply reverse scroll conververters + */ + static applyReverseScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.reverseSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.reverseGetRtlScrollConverter; + } + /** + * generate a test element for rtl testing + */ + static getTestElement() { + const testElement = document.createElement("div"); + testElement.appendChild(document.createTextNode("ABCD")); + testElement.dir = "rtl"; + testElement.style.fontSize = "14px"; + testElement.style.width = "4px"; + testElement.style.height = "1px"; + testElement.style.position = "absolute"; + testElement.style.top = "-1000px"; + testElement.style.overflow = "scroll"; + return testElement; + } + }; + RtlScrollConverter.getRtlScrollLeftConverter = RtlScrollConverter.initialGetRtlScrollConverter; + RtlScrollConverter.setRtlScrollLeftConverter = RtlScrollConverter.initialSetRtlScrollConverter; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/system-colors.js + var SystemColors; + var init_system_colors = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/system-colors.js"() { + (function(SystemColors2) { + SystemColors2["Canvas"] = "Canvas"; + SystemColors2["CanvasText"] = "CanvasText"; + SystemColors2["LinkText"] = "LinkText"; + SystemColors2["VisitedText"] = "VisitedText"; + SystemColors2["ActiveText"] = "ActiveText"; + SystemColors2["ButtonFace"] = "ButtonFace"; + SystemColors2["ButtonText"] = "ButtonText"; + SystemColors2["Field"] = "Field"; + SystemColors2["FieldText"] = "FieldText"; + SystemColors2["Highlight"] = "Highlight"; + SystemColors2["HighlightText"] = "HighlightText"; + SystemColors2["GrayText"] = "GrayText"; + })(SystemColors || (SystemColors = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/index.js + var init_dist2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/index.js"() { + init_aria(); + init_array(); + init_class_names(); + init_dom2(); + init_events(); + init_html(); + init_key_codes(); + init_localization(); + init_numbers(); + init_strings(); + init_query(); + init_rtl_scroll_converter(); + init_system_colors(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js + var AccordionExpandMode, Accordion; + var init_accordion = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_accordion_item(); + AccordionExpandMode = { + /** + * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. + */ + single: "single", + /** + * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously. + */ + multi: "multi" + }; + Accordion = class extends FoundationElement { + constructor() { + super(...arguments); + this.expandmode = AccordionExpandMode.multi; + this.activeItemIndex = 0; + this.change = () => { + this.$emit("change", this.activeid); + }; + this.setItems = () => { + var _a; + if (this.accordionItems.length === 0) { + return; + } + this.accordionIds = this.getItemIds(); + this.accordionItems.forEach((item, index) => { + if (item instanceof AccordionItem) { + item.addEventListener("change", this.activeItemChange); + if (this.isSingleExpandMode()) { + this.activeItemIndex !== index ? item.expanded = false : item.expanded = true; + } + } + const itemId = this.accordionIds[index]; + item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId); + this.activeid = this.accordionIds[this.activeItemIndex]; + item.addEventListener("keydown", this.handleItemKeyDown); + item.addEventListener("focus", this.handleItemFocus); + }); + if (this.isSingleExpandMode()) { + const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0]; + expandedItem.setAttribute("aria-disabled", "true"); + } + }; + this.removeItemListeners = (oldValue) => { + oldValue.forEach((item, index) => { + item.removeEventListener("change", this.activeItemChange); + item.removeEventListener("keydown", this.handleItemKeyDown); + item.removeEventListener("focus", this.handleItemFocus); + }); + }; + this.activeItemChange = (event) => { + if (event.defaultPrevented || event.target !== event.currentTarget) { + return; + } + event.preventDefault(); + const selectedItem = event.target; + this.activeid = selectedItem.getAttribute("id"); + if (this.isSingleExpandMode()) { + this.resetItems(); + selectedItem.expanded = true; + selectedItem.setAttribute("aria-disabled", "true"); + this.accordionItems.forEach((item) => { + if (!item.hasAttribute("disabled") && item.id !== this.activeid) { + item.removeAttribute("aria-disabled"); + } + }); + } + this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem); + this.change(); + }; + this.handleItemKeyDown = (event) => { + if (event.target !== event.currentTarget) { + return; + } + this.accordionIds = this.getItemIds(); + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjust(-1); + break; + case keyArrowDown: + event.preventDefault(); + this.adjust(1); + break; + case keyHome: + this.activeItemIndex = 0; + this.focusItem(); + break; + case keyEnd: + this.activeItemIndex = this.accordionItems.length - 1; + this.focusItem(); + break; + } + }; + this.handleItemFocus = (event) => { + if (event.target === event.currentTarget) { + const focusedItem = event.target; + const focusedIndex = this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem); + if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { + this.activeItemIndex = focusedIndex; + this.activeid = this.accordionIds[this.activeItemIndex]; + } + } + }; + } + /** + * @internal + */ + accordionItemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.removeItemListeners(oldValue); + this.setItems(); + } + } + findExpandedItem() { + for (let item = 0; item < this.accordionItems.length; item++) { + if (this.accordionItems[item].getAttribute("expanded") === "true") { + return this.accordionItems[item]; + } + } + return null; + } + resetItems() { + this.accordionItems.forEach((item, index) => { + item.expanded = false; + }); + } + getItemIds() { + return this.accordionItems.map((accordionItem) => { + return accordionItem.getAttribute("id"); + }); + } + isSingleExpandMode() { + return this.expandmode === AccordionExpandMode.single; + } + adjust(adjustment) { + this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment); + this.focusItem(); + } + focusItem() { + const element = this.accordionItems[this.activeItemIndex]; + if (element instanceof AccordionItem) { + element.expandbutton.focus(); + } + } + }; + __decorate([ + attr({ attribute: "expand-mode" }) + ], Accordion.prototype, "expandmode", void 0); + __decorate([ + observable + ], Accordion.prototype, "accordionItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js + var init_accordion2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js"() { + init_accordion_template(); + init_accordion(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js + var anchorTemplate; + var init_anchor_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js"() { + init_esm(); + init_start_end(); + anchorTemplate = (context, definition) => html` + + ${startSlotTemplate(context, definition)} + + + + ${endSlotTemplate(context, definition)} + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js + var ARIAGlobalStatesAndProperties; + var init_aria_global = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js"() { + init_tslib_es6(); + init_esm(); + ARIAGlobalStatesAndProperties = class { + }; + __decorate([ + attr({ attribute: "aria-atomic" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); + __decorate([ + attr({ attribute: "aria-busy" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); + __decorate([ + attr({ attribute: "aria-controls" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); + __decorate([ + attr({ attribute: "aria-current" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-details" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); + __decorate([ + attr({ attribute: "aria-disabled" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); + __decorate([ + attr({ attribute: "aria-errormessage" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); + __decorate([ + attr({ attribute: "aria-flowto" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); + __decorate([ + attr({ attribute: "aria-haspopup" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); + __decorate([ + attr({ attribute: "aria-hidden" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); + __decorate([ + attr({ attribute: "aria-invalid" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); + __decorate([ + attr({ attribute: "aria-keyshortcuts" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-live" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); + __decorate([ + attr({ attribute: "aria-owns" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); + __decorate([ + attr({ attribute: "aria-relevant" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); + __decorate([ + attr({ attribute: "aria-roledescription" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js + var init_patterns = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js"() { + init_aria_global(); + init_start_end(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js + var Anchor, DelegatesARIALink; + var init_anchor = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_patterns(); + init_apply_mixins(); + Anchor = class extends FoundationElement { + constructor() { + super(...arguments); + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + var _a2; + (_a2 = this.control) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + } + }; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.handleUnsupportedDelegatesFocus(); + } + }; + __decorate([ + attr + ], Anchor.prototype, "download", void 0); + __decorate([ + attr + ], Anchor.prototype, "href", void 0); + __decorate([ + attr + ], Anchor.prototype, "hreflang", void 0); + __decorate([ + attr + ], Anchor.prototype, "ping", void 0); + __decorate([ + attr + ], Anchor.prototype, "referrerpolicy", void 0); + __decorate([ + attr + ], Anchor.prototype, "rel", void 0); + __decorate([ + attr + ], Anchor.prototype, "target", void 0); + __decorate([ + attr + ], Anchor.prototype, "type", void 0); + __decorate([ + observable + ], Anchor.prototype, "defaultSlottedContent", void 0); + DelegatesARIALink = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIALink.prototype, "ariaExpanded", void 0); + applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties); + applyMixins(Anchor, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js + var init_anchor2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js"() { + init_anchor_template(); + init_anchor(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js + var init_anchored_region_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js + var getDirection; + var init_direction = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js"() { + init_dist2(); + getDirection = (rootNode) => { + const dirNode = rootNode.closest("[dir]"); + return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js + var IntersectionService; + var init_intersection_service = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js"() { + init_esm(); + IntersectionService = class { + constructor() { + this.intersectionDetector = null; + this.observedElements = /* @__PURE__ */ new Map(); + this.requestPosition = (target, callback) => { + var _a; + if (this.intersectionDetector === null) { + return; + } + if (this.observedElements.has(target)) { + (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback); + return; + } + this.observedElements.set(target, [callback]); + this.intersectionDetector.observe(target); + }; + this.cancelRequestPosition = (target, callback) => { + const callbacks = this.observedElements.get(target); + if (callbacks !== void 0) { + const callBackIndex = callbacks.indexOf(callback); + if (callBackIndex !== -1) { + callbacks.splice(callBackIndex, 1); + } + } + }; + this.initializeIntersectionDetector = () => { + if (!$global.IntersectionObserver) { + return; + } + this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { + root: null, + rootMargin: "0px", + threshold: [0, 1] + }); + }; + this.handleIntersection = (entries) => { + if (this.intersectionDetector === null) { + return; + } + const pendingCallbacks = []; + const pendingCallbackParams = []; + entries.forEach((entry) => { + var _a; + (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); + const thisElementCallbacks = this.observedElements.get(entry.target); + if (thisElementCallbacks !== void 0) { + thisElementCallbacks.forEach((callback) => { + let targetCallbackIndex = pendingCallbacks.indexOf(callback); + if (targetCallbackIndex === -1) { + targetCallbackIndex = pendingCallbacks.length; + pendingCallbacks.push(callback); + pendingCallbackParams.push([]); + } + pendingCallbackParams[targetCallbackIndex].push(entry); + }); + this.observedElements.delete(entry.target); + } + }); + pendingCallbacks.forEach((callback, index) => { + callback(pendingCallbackParams[index]); + }); + }; + this.initializeIntersectionDetector(); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js + var AnchoredRegion; + var init_anchored_region = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_direction(); + init_intersection_service(); + AnchoredRegion = class _AnchoredRegion extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.viewport = ""; + this.horizontalPositioningMode = "uncontrolled"; + this.horizontalDefaultPosition = "unset"; + this.horizontalViewportLock = false; + this.horizontalInset = false; + this.horizontalScaling = "content"; + this.verticalPositioningMode = "uncontrolled"; + this.verticalDefaultPosition = "unset"; + this.verticalViewportLock = false; + this.verticalInset = false; + this.verticalScaling = "content"; + this.fixedPlacement = false; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.initialLayoutComplete = false; + this.resizeDetector = null; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.pendingPositioningUpdate = false; + this.pendingReset = false; + this.currentDirection = Direction.ltr; + this.regionVisible = false; + this.forceUpdate = false; + this.updateThreshold = 0.5; + this.update = () => { + if (!this.pendingPositioningUpdate) { + this.requestPositionUpdates(); + } + }; + this.startObservers = () => { + this.stopObservers(); + if (this.anchorElement === null) { + return; + } + this.requestPositionUpdates(); + if (this.resizeDetector !== null) { + this.resizeDetector.observe(this.anchorElement); + this.resizeDetector.observe(this); + } + }; + this.requestPositionUpdates = () => { + if (this.anchorElement === null || this.pendingPositioningUpdate) { + return; + } + _AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection); + _AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection); + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection); + } + this.pendingPositioningUpdate = true; + }; + this.stopObservers = () => { + if (this.pendingPositioningUpdate) { + this.pendingPositioningUpdate = false; + _AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection); + if (this.anchorElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection); + } + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection); + } + } + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + } + }; + this.getViewport = () => { + if (typeof this.viewport !== "string" || this.viewport === "") { + return document.documentElement; + } + return document.getElementById(this.viewport); + }; + this.getAnchor = () => { + return document.getElementById(this.anchor); + }; + this.handleIntersection = (entries) => { + if (!this.pendingPositioningUpdate) { + return; + } + this.pendingPositioningUpdate = false; + if (!this.applyIntersectionEntries(entries)) { + return; + } + this.updateLayout(); + }; + this.applyIntersectionEntries = (entries) => { + const regionEntry = entries.find((x) => x.target === this); + const anchorEntry = entries.find((x) => x.target === this.anchorElement); + const viewportEntry = entries.find((x) => x.target === this.viewportElement); + if (regionEntry === void 0 || viewportEntry === void 0 || anchorEntry === void 0) { + return false; + } + if (!this.regionVisible || this.forceUpdate || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0 || this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) || this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) || this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) { + this.regionRect = regionEntry.boundingClientRect; + this.anchorRect = anchorEntry.boundingClientRect; + if (this.viewportElement === document.documentElement) { + this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x + document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y + document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height); + } else { + this.viewportRect = viewportEntry.boundingClientRect; + } + this.updateRegionOffset(); + this.forceUpdate = false; + return true; + } + return false; + }; + this.updateRegionOffset = () => { + if (this.anchorRect && this.regionRect) { + this.baseHorizontalOffset = this.baseHorizontalOffset + (this.anchorRect.left - this.regionRect.left) + (this.translateX - this.baseHorizontalOffset); + this.baseVerticalOffset = this.baseVerticalOffset + (this.anchorRect.top - this.regionRect.top) + (this.translateY - this.baseVerticalOffset); + } + }; + this.isRectDifferent = (rectA, rectB) => { + if (Math.abs(rectA.top - rectB.top) > this.updateThreshold || Math.abs(rectA.right - rectB.right) > this.updateThreshold || Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold || Math.abs(rectA.left - rectB.left) > this.updateThreshold) { + return true; + } + return false; + }; + this.handleResize = (entries) => { + this.update(); + }; + this.reset = () => { + if (!this.pendingReset) { + return; + } + this.pendingReset = false; + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + if (this.viewportElement === null) { + this.viewportElement = this.getViewport(); + } + this.currentDirection = getDirection(this); + this.startObservers(); + }; + this.updateLayout = () => { + let desiredVerticalPosition = void 0; + let desiredHorizontalPosition = void 0; + if (this.horizontalPositioningMode !== "uncontrolled") { + const horizontalOptions = this.getPositioningOptions(this.horizontalInset); + if (this.horizontalDefaultPosition === "center") { + desiredHorizontalPosition = "center"; + } else if (this.horizontalDefaultPosition !== "unset") { + let dirCorrectedHorizontalDefaultPosition = this.horizontalDefaultPosition; + if (dirCorrectedHorizontalDefaultPosition === "start" || dirCorrectedHorizontalDefaultPosition === "end") { + const newDirection = getDirection(this); + if (newDirection !== this.currentDirection) { + this.currentDirection = newDirection; + this.initialize(); + return; + } + if (this.currentDirection === Direction.ltr) { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right"; + } else { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left"; + } + } + switch (dirCorrectedHorizontalDefaultPosition) { + case "left": + desiredHorizontalPosition = this.horizontalInset ? "insetStart" : "start"; + break; + case "right": + desiredHorizontalPosition = this.horizontalInset ? "insetEnd" : "end"; + break; + } + } + const horizontalThreshold = this.horizontalThreshold !== void 0 ? this.horizontalThreshold : this.regionRect !== void 0 ? this.regionRect.width : 0; + const anchorLeft = this.anchorRect !== void 0 ? this.anchorRect.left : 0; + const anchorRight = this.anchorRect !== void 0 ? this.anchorRect.right : 0; + const anchorWidth = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + const viewportLeft = this.viewportRect !== void 0 ? this.viewportRect.left : 0; + const viewportRight = this.viewportRect !== void 0 ? this.viewportRect.right : 0; + if (desiredHorizontalPosition === void 0 || !(this.horizontalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold) { + desiredHorizontalPosition = this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) > this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) ? horizontalOptions[0] : horizontalOptions[1]; + } + } + if (this.verticalPositioningMode !== "uncontrolled") { + const verticalOptions = this.getPositioningOptions(this.verticalInset); + if (this.verticalDefaultPosition === "center") { + desiredVerticalPosition = "center"; + } else if (this.verticalDefaultPosition !== "unset") { + switch (this.verticalDefaultPosition) { + case "top": + desiredVerticalPosition = this.verticalInset ? "insetStart" : "start"; + break; + case "bottom": + desiredVerticalPosition = this.verticalInset ? "insetEnd" : "end"; + break; + } + } + const verticalThreshold = this.verticalThreshold !== void 0 ? this.verticalThreshold : this.regionRect !== void 0 ? this.regionRect.height : 0; + const anchorTop = this.anchorRect !== void 0 ? this.anchorRect.top : 0; + const anchorBottom = this.anchorRect !== void 0 ? this.anchorRect.bottom : 0; + const anchorHeight = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + const viewportTop = this.viewportRect !== void 0 ? this.viewportRect.top : 0; + const viewportBottom = this.viewportRect !== void 0 ? this.viewportRect.bottom : 0; + if (desiredVerticalPosition === void 0 || !(this.verticalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold) { + desiredVerticalPosition = this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) > this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) ? verticalOptions[0] : verticalOptions[1]; + } + } + const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition); + const positionChanged = this.horizontalPosition !== desiredHorizontalPosition || this.verticalPosition !== desiredVerticalPosition; + this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension); + this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension); + this.updateRegionStyle(); + if (!this.initialLayoutComplete) { + this.initialLayoutComplete = true; + this.requestPositionUpdates(); + return; + } + if (!this.regionVisible) { + this.regionVisible = true; + this.style.removeProperty("pointer-events"); + this.style.removeProperty("opacity"); + this.classList.toggle("loaded", true); + this.$emit("loaded", this, { bubbles: false }); + } + this.updatePositionClasses(); + if (positionChanged) { + this.$emit("positionchange", this, { bubbles: false }); + } + }; + this.updateRegionStyle = () => { + this.style.width = this.regionWidth; + this.style.height = this.regionHeight; + this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`; + }; + this.updatePositionClasses = () => { + this.classList.toggle("top", this.verticalPosition === "start"); + this.classList.toggle("bottom", this.verticalPosition === "end"); + this.classList.toggle("inset-top", this.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.verticalPosition === "insetEnd"); + this.classList.toggle("vertical-center", this.verticalPosition === "center"); + this.classList.toggle("left", this.horizontalPosition === "start"); + this.classList.toggle("right", this.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.horizontalPosition === "insetEnd"); + this.classList.toggle("horizontal-center", this.horizontalPosition === "center"); + }; + this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => { + if (desiredHorizontalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionWidth = 0; + switch (this.horizontalScaling) { + case "anchor": + case "fill": + nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width; + this.regionWidth = `${nextRegionWidth}px`; + break; + case "content": + nextRegionWidth = this.regionRect.width; + this.regionWidth = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredHorizontalPosition) { + case "start": + this.translateX = this.baseHorizontalOffset - nextRegionWidth; + if (this.horizontalViewportLock && this.anchorRect.left > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.right); + } + break; + case "insetStart": + this.translateX = this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.right); + } + break; + case "insetEnd": + this.translateX = this.baseHorizontalOffset; + if (this.horizontalViewportLock && this.anchorRect.left < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.left); + } + break; + case "end": + this.translateX = this.baseHorizontalOffset + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.left); + } + break; + case "center": + sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2; + this.translateX = this.baseHorizontalOffset + sizeDelta; + if (this.horizontalViewportLock) { + const regionLeft = this.anchorRect.left + sizeDelta; + const regionRight = this.anchorRect.right - sizeDelta; + if (regionLeft < this.viewportRect.left && !(regionRight > this.viewportRect.right)) { + this.translateX = this.translateX - (regionLeft - this.viewportRect.left); + } else if (regionRight > this.viewportRect.right && !(regionLeft < this.viewportRect.left)) { + this.translateX = this.translateX - (regionRight - this.viewportRect.right); + } + } + break; + } + this.horizontalPosition = desiredHorizontalPosition; + }; + this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => { + if (desiredVerticalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionHeight = 0; + switch (this.verticalScaling) { + case "anchor": + case "fill": + nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height; + this.regionHeight = `${nextRegionHeight}px`; + break; + case "content": + nextRegionHeight = this.regionRect.height; + this.regionHeight = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredVerticalPosition) { + case "start": + this.translateY = this.baseVerticalOffset - nextRegionHeight; + if (this.verticalViewportLock && this.anchorRect.top > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.bottom); + } + break; + case "insetStart": + this.translateY = this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.bottom); + } + break; + case "insetEnd": + this.translateY = this.baseVerticalOffset; + if (this.verticalViewportLock && this.anchorRect.top < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.top); + } + break; + case "end": + this.translateY = this.baseVerticalOffset + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.top); + } + break; + case "center": + sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2; + this.translateY = this.baseVerticalOffset + sizeDelta; + if (this.verticalViewportLock) { + const regionTop = this.anchorRect.top + sizeDelta; + const regionBottom = this.anchorRect.bottom - sizeDelta; + if (regionTop < this.viewportRect.top && !(regionBottom > this.viewportRect.bottom)) { + this.translateY = this.translateY - (regionTop - this.viewportRect.top); + } else if (regionBottom > this.viewportRect.bottom && !(regionTop < this.viewportRect.top)) { + this.translateY = this.translateY - (regionBottom - this.viewportRect.bottom); + } + } + } + this.verticalPosition = desiredVerticalPosition; + }; + this.getPositioningOptions = (inset) => { + if (inset) { + return ["insetStart", "insetEnd"]; + } + return ["start", "end"]; + }; + this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => { + const spaceStart = anchorStart - viewportStart; + const spaceEnd = viewportEnd - (anchorStart + anchorSpan); + switch (positionOption) { + case "start": + return spaceStart; + case "insetStart": + return spaceStart + anchorSpan; + case "insetEnd": + return spaceEnd + anchorSpan; + case "end": + return spaceEnd; + case "center": + return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan; + } + }; + this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => { + const newRegionDimension = { + height: this.regionRect !== void 0 ? this.regionRect.height : 0, + width: this.regionRect !== void 0 ? this.regionRect.width : 0 + }; + if (desiredHorizontalPosition !== void 0 && this.horizontalScaling === "fill") { + newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== void 0 ? this.anchorRect.left : 0, this.anchorRect !== void 0 ? this.anchorRect.right : 0, this.anchorRect !== void 0 ? this.anchorRect.width : 0, this.viewportRect !== void 0 ? this.viewportRect.left : 0, this.viewportRect !== void 0 ? this.viewportRect.right : 0); + } else if (this.horizontalScaling === "anchor") { + newRegionDimension.width = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + } + if (desiredVerticalPosition !== void 0 && this.verticalScaling === "fill") { + newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== void 0 ? this.anchorRect.top : 0, this.anchorRect !== void 0 ? this.anchorRect.bottom : 0, this.anchorRect !== void 0 ? this.anchorRect.height : 0, this.viewportRect !== void 0 ? this.viewportRect.top : 0, this.viewportRect !== void 0 ? this.viewportRect.bottom : 0); + } else if (this.verticalScaling === "anchor") { + newRegionDimension.height = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + } + return newRegionDimension; + }; + this.startAutoUpdateEventListeners = () => { + window.addEventListener(eventResize, this.update, { passive: true }); + window.addEventListener(eventScroll, this.update, { + passive: true, + capture: true + }); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.observe(this.viewportElement); + } + }; + this.stopAutoUpdateEventListeners = () => { + window.removeEventListener(eventResize, this.update); + window.removeEventListener(eventScroll, this.update); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.unobserve(this.viewportElement); + } + }; + } + anchorChanged() { + if (this.initialLayoutComplete) { + this.anchorElement = this.getAnchor(); + } + } + viewportChanged() { + if (this.initialLayoutComplete) { + this.viewportElement = this.getViewport(); + } + } + horizontalPositioningModeChanged() { + this.requestReset(); + } + horizontalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + horizontalViewportLockChanged() { + this.updateForAttributeChange(); + } + horizontalInsetChanged() { + this.updateForAttributeChange(); + } + horizontalThresholdChanged() { + this.updateForAttributeChange(); + } + horizontalScalingChanged() { + this.updateForAttributeChange(); + } + verticalPositioningModeChanged() { + this.requestReset(); + } + verticalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + verticalViewportLockChanged() { + this.updateForAttributeChange(); + } + verticalInsetChanged() { + this.updateForAttributeChange(); + } + verticalThresholdChanged() { + this.updateForAttributeChange(); + } + verticalScalingChanged() { + this.updateForAttributeChange(); + } + fixedPlacementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + autoUpdateModeChanged(prevMode, newMode) { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + if (prevMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + if (newMode === "auto") { + this.startAutoUpdateEventListeners(); + } + } + } + anchorElementChanged() { + this.requestReset(); + } + viewportElementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.autoUpdateMode === "auto") { + this.startAutoUpdateEventListeners(); + } + this.initialize(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.autoUpdateMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + this.stopObservers(); + this.disconnectResizeDetector(); + } + /** + * @internal + */ + adoptedCallback() { + this.initialize(); + } + /** + * destroys the instance's resize observer + */ + disconnectResizeDetector() { + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.handleResize); + } + /** + * react to attribute changes that don't require a reset + */ + updateForAttributeChange() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.forceUpdate = true; + this.update(); + } + } + /** + * fully initializes the component + */ + initialize() { + this.initializeResizeDetector(); + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + this.requestReset(); + } + /** + * Request a reset if there are currently no open requests + */ + requestReset() { + if (this.$fastController.isConnected && this.pendingReset === false) { + this.setInitialState(); + DOM.queueUpdate(() => this.reset()); + this.pendingReset = true; + } + } + /** + * sets the starting configuration for component internal values + */ + setInitialState() { + this.initialLayoutComplete = false; + this.regionVisible = false; + this.translateX = 0; + this.translateY = 0; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.viewportRect = void 0; + this.regionRect = void 0; + this.anchorRect = void 0; + this.verticalPosition = void 0; + this.horizontalPosition = void 0; + this.style.opacity = "0"; + this.style.pointerEvents = "none"; + this.forceUpdate = false; + this.style.position = this.fixedPlacement ? "fixed" : "absolute"; + this.updatePositionClasses(); + this.updateRegionStyle(); + } + }; + AnchoredRegion.intersectionService = new IntersectionService(); + __decorate([ + attr + ], AnchoredRegion.prototype, "anchor", void 0); + __decorate([ + attr + ], AnchoredRegion.prototype, "viewport", void 0); + __decorate([ + attr({ attribute: "horizontal-positioning-mode" }) + ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0); + __decorate([ + attr({ attribute: "horizontal-default-position" }) + ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "horizontal-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalInset", void 0); + __decorate([ + attr({ attribute: "horizontal-threshold" }) + ], AnchoredRegion.prototype, "horizontalThreshold", void 0); + __decorate([ + attr({ attribute: "horizontal-scaling" }) + ], AnchoredRegion.prototype, "horizontalScaling", void 0); + __decorate([ + attr({ attribute: "vertical-positioning-mode" }) + ], AnchoredRegion.prototype, "verticalPositioningMode", void 0); + __decorate([ + attr({ attribute: "vertical-default-position" }) + ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalInset", void 0); + __decorate([ + attr({ attribute: "vertical-threshold" }) + ], AnchoredRegion.prototype, "verticalThreshold", void 0); + __decorate([ + attr({ attribute: "vertical-scaling" }) + ], AnchoredRegion.prototype, "verticalScaling", void 0); + __decorate([ + attr({ attribute: "fixed-placement", mode: "boolean" }) + ], AnchoredRegion.prototype, "fixedPlacement", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], AnchoredRegion.prototype, "autoUpdateMode", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "anchorElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "viewportElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "initialLayoutComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js + var horizontalAnchorOverlay, FlyoutPosTop, FlyoutPosBottom, FlyoutPosTallest, FlyoutPosTopFill, FlyoutPosBottomFill, FlyoutPosTallestFill; + var init_anchored_region_config = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js"() { + horizontalAnchorOverlay = { + horizontalDefaultPosition: "center", + horizontalPositioningMode: "locktodefault", + horizontalInset: false, + horizontalScaling: "anchor" + }; + FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "top", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "bottom", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: "dynamic", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: "fill" }); + FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: "fill" }); + FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: "fill" }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js + var init_anchored_region2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js"() { + init_anchored_region_template(); + init_anchored_region(); + init_anchored_region_config(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js + var init_avatar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js + var Avatar; + var init_avatar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Avatar = class extends FoundationElement { + /** + * Internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.shape) { + this.shape = "circle"; + } + } + }; + __decorate([ + attr + ], Avatar.prototype, "fill", void 0); + __decorate([ + attr + ], Avatar.prototype, "color", void 0); + __decorate([ + attr + ], Avatar.prototype, "link", void 0); + __decorate([ + attr + ], Avatar.prototype, "shape", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js + var init_avatar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js"() { + init_avatar_template(); + init_avatar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js + var badgeTemplate; + var init_badge_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js"() { + init_esm(); + badgeTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js + var Badge; + var init_badge = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Badge = class extends FoundationElement { + constructor() { + super(...arguments); + this.generateBadgeStyle = () => { + if (!this.fill && !this.color) { + return; + } + const fill = `background-color: var(--badge-fill-${this.fill});`; + const color = `color: var(--badge-color-${this.color});`; + if (this.fill && !this.color) { + return fill; + } else if (this.color && !this.fill) { + return color; + } else { + return `${color} ${fill}`; + } + }; + } + }; + __decorate([ + attr({ attribute: "fill" }) + ], Badge.prototype, "fill", void 0); + __decorate([ + attr({ attribute: "color" }) + ], Badge.prototype, "color", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Badge.prototype, "circular", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js + var init_badge2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js"() { + init_badge_template(); + init_badge(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js + var init_breadcrumb_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js + var BreadcrumbItem; + var init_breadcrumb_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js"() { + init_tslib_es6(); + init_esm(); + init_anchor(); + init_patterns(); + init_apply_mixins(); + BreadcrumbItem = class extends Anchor { + constructor() { + super(...arguments); + this.separator = true; + } + }; + __decorate([ + observable + ], BreadcrumbItem.prototype, "separator", void 0); + applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js + var init_breadcrumb_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js"() { + init_breadcrumb_item_template(); + init_breadcrumb_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js + var init_breadcrumb_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js + var Breadcrumb; + var init_breadcrumb = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js"() { + init_tslib_es6(); + init_esm(); + init_breadcrumb_item(); + init_foundation_element(); + Breadcrumb = class extends FoundationElement { + slottedBreadcrumbItemsChanged() { + if (this.$fastController.isConnected) { + if (this.slottedBreadcrumbItems === void 0 || this.slottedBreadcrumbItems.length === 0) { + return; + } + const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1]; + this.slottedBreadcrumbItems.forEach((item) => { + const itemIsLastNode = item === lastNode; + this.setItemSeparator(item, itemIsLastNode); + this.setAriaCurrent(item, itemIsLastNode); + }); + } + } + setItemSeparator(item, isLastNode) { + if (item instanceof BreadcrumbItem) { + item.separator = !isLastNode; + } + } + /** + * Finds href on childnodes in the light DOM or shadow DOM. + * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href. + */ + findChildWithHref(node) { + var _a, _b; + if (node.childElementCount > 0) { + return node.querySelector("a[href]"); + } else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) { + return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]"); + } else + return null; + } + /** + * Sets ARIA Current for the current node + * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node, + * otherwise apply aria-current to the host element, with an href + */ + setAriaCurrent(item, isLastNode) { + const childNodeWithHref = this.findChildWithHref(item); + if (childNodeWithHref === null && item.hasAttribute("href") && item instanceof BreadcrumbItem) { + isLastNode ? item.setAttribute("aria-current", "page") : item.removeAttribute("aria-current"); + } else if (childNodeWithHref !== null) { + isLastNode ? childNodeWithHref.setAttribute("aria-current", "page") : childNodeWithHref.removeAttribute("aria-current"); + } + } + }; + __decorate([ + observable + ], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js + var init_breadcrumb2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js"() { + init_breadcrumb_template(); + init_breadcrumb(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js + var buttonTemplate; + var init_button_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js"() { + init_esm(); + init_start_end(); + buttonTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js + function FormAssociated(BaseCtor) { + const C = class extends BaseCtor { + constructor(...args) { + super(...args); + this.dirtyValue = false; + this.disabled = false; + this.proxyEventsToBlock = ["change", "click"]; + this.proxyInitialized = false; + this.required = false; + this.initialValue = this.initialValue || ""; + if (!this.elementInternals) { + this.formResetCallback = this.formResetCallback.bind(this); + } + } + /** + * Must evaluate to true to enable elementInternals. + * Feature detects API support and resolve respectively + * + * @internal + */ + static get formAssociated() { + return supportsElementInternals; + } + /** + * Returns the validity state of the element + * + * @alpha + */ + get validity() { + return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; + } + /** + * Retrieve a reference to the associated form. + * Returns null if not associated to any form. + * + * @alpha + */ + get form() { + return this.elementInternals ? this.elementInternals.form : this.proxy.form; + } + /** + * Retrieve the localized validation message, + * or custom validation message if set. + * + * @alpha + */ + get validationMessage() { + return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; + } + /** + * Whether the element will be validated when the + * form is submitted + */ + get willValidate() { + return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; + } + /** + * A reference to all associated label elements + */ + get labels() { + if (this.elementInternals) { + return Object.freeze(Array.from(this.elementInternals.labels)); + } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { + const parentLabels = this.proxy.labels; + const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)); + const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; + return Object.freeze(labels); + } else { + return emptyArray; + } + } + /** + * Invoked when the `value` property changes + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `valueChanged` method + * They must be sure to invoke `super.valueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + valueChanged(previous, next) { + this.dirtyValue = true; + if (this.proxy instanceof HTMLElement) { + this.proxy.value = this.value; + } + this.currentValue = this.value; + this.setFormValue(this.value); + this.validate(); + } + currentValueChanged() { + this.value = this.currentValue; + } + /** + * Invoked when the `initialValue` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `initialValueChanged` method + * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + /** + * Invoked when the `disabled` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `disabledChanged` method + * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + disabledChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.disabled = this.disabled; + } + DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled)); + } + /** + * Invoked when the `name` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `nameChanged` method + * They must be sure to invoke `super.nameChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + nameChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.name = this.name; + } + } + /** + * Invoked when the `required` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `requiredChanged` method + * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + requiredChanged(prev, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.required = this.required; + } + DOM.queueUpdate(() => this.classList.toggle("required", this.required)); + this.validate(); + } + /** + * The element internals object. Will only exist + * in browsers supporting the attachInternals API + */ + get elementInternals() { + if (!supportsElementInternals) { + return null; + } + let internals = InternalsMap.get(this); + if (!internals) { + internals = this.attachInternals(); + InternalsMap.set(this, internals); + } + return internals; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("keypress", this._keypressHandler); + if (!this.value) { + this.value = this.initialValue; + this.dirtyValue = false; + } + if (!this.elementInternals) { + this.attachProxy(); + if (this.form) { + this.form.addEventListener("reset", this.formResetCallback); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.proxyEventsToBlock.forEach((name) => this.proxy.removeEventListener(name, this.stopPropagation)); + if (!this.elementInternals && this.form) { + this.form.removeEventListener("reset", this.formResetCallback); + } + } + /** + * Return the current validity of the element. + */ + checkValidity() { + return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); + } + /** + * Return the current validity of the element. + * If false, fires an invalid event at the element. + */ + reportValidity() { + return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); + } + /** + * Set the validity of the control. In cases when the elementInternals object is not + * available (and the proxy element is used to report validity), this function will + * do nothing unless a message is provided, at which point the setCustomValidity method + * of the proxy element will be invoked with the provided message. + * @param flags - Validity flags + * @param message - Optional message to supply + * @param anchor - Optional element used by UA to display an interactive validation UI + */ + setValidity(flags, message, anchor) { + if (this.elementInternals) { + this.elementInternals.setValidity(flags, message, anchor); + } else if (typeof message === "string") { + this.proxy.setCustomValidity(message); + } + } + /** + * Invoked when a connected component's form or fieldset has its disabled + * state changed. + * @param disabled - the disabled value of the form / fieldset + */ + formDisabledCallback(disabled) { + this.disabled = disabled; + } + formResetCallback() { + this.value = this.initialValue; + this.dirtyValue = false; + } + /** + * Attach the proxy element to the DOM + */ + attachProxy() { + var _a; + if (!this.proxyInitialized) { + this.proxyInitialized = true; + this.proxy.style.display = "none"; + this.proxyEventsToBlock.forEach((name) => this.proxy.addEventListener(name, this.stopPropagation)); + this.proxy.disabled = this.disabled; + this.proxy.required = this.required; + if (typeof this.name === "string") { + this.proxy.name = this.name; + } + if (typeof this.value === "string") { + this.proxy.value = this.value; + } + this.proxy.setAttribute("slot", proxySlotName); + this.proxySlot = document.createElement("slot"); + this.proxySlot.setAttribute("name", proxySlotName); + } + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); + this.appendChild(this.proxy); + } + /** + * Detach the proxy element from the DOM + */ + detachProxy() { + var _a; + this.removeChild(this.proxy); + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate(anchor) { + if (this.proxy instanceof HTMLElement) { + this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); + } + } + /** + * Associates the provided value (and optional state) with the parent form. + * @param value - The value to set + * @param state - The state object provided to during session restores and when autofilling. + */ + setFormValue(value, state) { + if (this.elementInternals) { + this.elementInternals.setFormValue(value, state || value); + } + } + _keypressHandler(e) { + switch (e.key) { + case keyEnter: + if (this.form instanceof HTMLFormElement) { + const defaultButton = this.form.querySelector("[type=submit]"); + defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); + } + break; + } + } + /** + * Used to stop propagation of proxy element events + * @param e - Event object + */ + stopPropagation(e) { + e.stopPropagation(); + } + }; + attr({ mode: "boolean" })(C.prototype, "disabled"); + attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue"); + attr({ attribute: "current-value" })(C.prototype, "currentValue"); + attr(C.prototype, "name"); + attr({ mode: "boolean" })(C.prototype, "required"); + observable(C.prototype, "value"); + return C; + } + function CheckableFormAssociated(BaseCtor) { + class C extends FormAssociated(BaseCtor) { + } + class D extends C { + constructor(...args) { + super(args); + this.dirtyChecked = false; + this.checkedAttribute = false; + this.checked = false; + this.dirtyChecked = false; + } + checkedAttributeChanged() { + this.defaultChecked = this.checkedAttribute; + } + /** + * @internal + */ + defaultCheckedChanged() { + if (!this.dirtyChecked) { + this.checked = this.defaultChecked; + this.dirtyChecked = false; + } + } + checkedChanged(prev, next) { + if (!this.dirtyChecked) { + this.dirtyChecked = true; + } + this.currentChecked = this.checked; + this.updateForm(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.checked = this.checked; + } + if (prev !== void 0) { + this.$emit("change"); + } + this.validate(); + } + currentCheckedChanged(prev, next) { + this.checked = this.currentChecked; + } + updateForm() { + const value = this.checked ? this.value : null; + this.setFormValue(value, value); + } + connectedCallback() { + super.connectedCallback(); + this.updateForm(); + } + formResetCallback() { + super.formResetCallback(); + this.checked = !!this.checkedAttribute; + this.dirtyChecked = false; + } + } + attr({ attribute: "checked", mode: "boolean" })(D.prototype, "checkedAttribute"); + attr({ attribute: "current-checked", converter: booleanConverter })(D.prototype, "currentChecked"); + observable(D.prototype, "defaultChecked"); + observable(D.prototype, "checked"); + return D; + } + var proxySlotName, ElementInternalsKey, supportsElementInternals, InternalsMap; + var init_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js"() { + init_esm(); + init_dist2(); + proxySlotName = "form-associated-proxy"; + ElementInternalsKey = "ElementInternals"; + supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; + InternalsMap = /* @__PURE__ */ new WeakMap(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js + var _Button, FormAssociatedButton; + var init_button_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Button = class extends FoundationElement { + }; + FormAssociatedButton = class extends FormAssociated(_Button) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.js + var Button, DelegatesARIAButton; + var init_button = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_button_form_associated(); + Button = class extends FormAssociatedButton { + constructor() { + super(...arguments); + this.handleClick = (e) => { + var _a; + if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) { + e.stopPropagation(); + } + }; + this.handleSubmission = () => { + if (!this.form) { + return; + } + const attached = this.proxy.isConnected; + if (!attached) { + this.attachProxy(); + } + typeof this.form.requestSubmit === "function" ? this.form.requestSubmit(this.proxy) : this.proxy.click(); + if (!attached) { + this.detachProxy(); + } + }; + this.handleFormReset = () => { + var _a; + (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset(); + }; + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + this.control.focus(); + }; + } + }; + } + formactionChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formAction = this.formaction; + } + } + formenctypeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formEnctype = this.formenctype; + } + } + formmethodChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formMethod = this.formmethod; + } + } + formnovalidateChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formNoValidate = this.formnovalidate; + } + } + formtargetChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formTarget = this.formtarget; + } + } + typeChanged(previous, next) { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + } + next === "submit" && this.addEventListener("click", this.handleSubmission); + previous === "submit" && this.removeEventListener("click", this.handleSubmission); + next === "reset" && this.addEventListener("click", this.handleFormReset); + previous === "reset" && this.removeEventListener("click", this.handleFormReset); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.handleUnsupportedDelegatesFocus(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.addEventListener("click", this.handleClick); + }); + } + } + /** + * @internal + */ + disconnectedCallback() { + var _a; + super.disconnectedCallback(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.removeEventListener("click", this.handleClick); + }); + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], Button.prototype, "formId", void 0); + __decorate([ + attr + ], Button.prototype, "formaction", void 0); + __decorate([ + attr + ], Button.prototype, "formenctype", void 0); + __decorate([ + attr + ], Button.prototype, "formmethod", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "formnovalidate", void 0); + __decorate([ + attr + ], Button.prototype, "formtarget", void 0); + __decorate([ + attr + ], Button.prototype, "type", void 0); + __decorate([ + observable + ], Button.prototype, "defaultSlottedContent", void 0); + DelegatesARIAButton = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIAButton.prototype, "ariaExpanded", void 0); + __decorate([ + attr({ attribute: "aria-pressed" }) + ], DelegatesARIAButton.prototype, "ariaPressed", void 0); + applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties); + applyMixins(Button, StartEnd, DelegatesARIAButton); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/index.js + var init_button2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/index.js"() { + init_button_template(); + init_button(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js + var DateFormatter; + var init_date_formatter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js"() { + DateFormatter = class { + constructor(config) { + this.dayFormat = "numeric"; + this.weekdayFormat = "long"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.date = /* @__PURE__ */ new Date(); + if (config) { + for (const key in config) { + const value = config[key]; + if (key === "date") { + this.date = this.getDateObject(value); + } else { + this[key] = value; + } + } + } + } + /** + * Helper function to make sure that the DateFormatter is working with an instance of Date + * @param date - The date as an object, string or Date insance + * @returns - A Date instance + * @public + */ + getDateObject(date) { + if (typeof date === "string") { + const dates = date.split(/[/-]/); + if (dates.length < 3) { + return /* @__PURE__ */ new Date(); + } + return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10)); + } else if ("day" in date && "month" in date && "year" in date) { + const { day, month, year } = date; + return new Date(year, month - 1, day); + } + return date; + } + /** + * + * @param date - a valide date as either a Date, string, objec or a DateFormatter + * @param format - The formatting for the string + * @param locale - locale data used for formatting + * @returns A localized string of the date provided + * @public + */ + getDate(date = this.date, format = { + weekday: this.weekdayFormat, + month: this.monthFormat, + day: this.dayFormat, + year: this.yearFormat + }, locale = this.locale) { + const dateObj = this.getDateObject(date); + if (!dateObj.getTime()) { + return ""; + } + const optionsWithTimeZone = Object.assign({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }, format); + return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj); + } + /** + * + * @param day - Day to localize + * @param format - The formatting for the day + * @param locale - The locale data used for formatting + * @returns - A localized number for the day + * @public + */ + getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) { + return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale); + } + /** + * + * @param month - The month to localize + * @param format - The formatting for the month + * @param locale - The locale data used for formatting + * @returns - A localized name of the month + * @public + */ + getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) { + return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale); + } + /** + * + * @param year - The year to localize + * @param format - The formatting for the year + * @param locale - The locale data used for formatting + * @returns - A localized string for the year + * @public + */ + getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) { + return this.getDate({ month: 2, day: 2, year }, { year: format }, locale); + } + /** + * + * @param weekday - The number of the weekday, defaults to Sunday + * @param format - The formatting for the weekday label + * @param locale - The locale data used for formatting + * @returns - A formatted weekday label + * @public + */ + getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) { + const date = `1-${weekday + 1}-2017`; + return this.getDate(date, { weekday: format }, locale); + } + /** + * + * @param format - The formatting for the weekdays + * @param locale - The locale data used for formatting + * @returns - An array of the weekday labels + * @public + */ + getWeekdays(format = this.weekdayFormat, locale = this.locale) { + return Array(7).fill(null).map((_, day) => this.getWeekday(day, format, locale)); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js + var Calendar; + var init_calendar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_date_formatter(); + Calendar = class extends FoundationElement { + constructor() { + super(...arguments); + this.dateFormatter = new DateFormatter(); + this.readonly = false; + this.locale = "en-US"; + this.month = (/* @__PURE__ */ new Date()).getMonth() + 1; + this.year = (/* @__PURE__ */ new Date()).getFullYear(); + this.dayFormat = "numeric"; + this.weekdayFormat = "short"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.minWeeks = 0; + this.disabledDates = ""; + this.selectedDates = ""; + this.oneDayInMs = 864e5; + } + localeChanged() { + this.dateFormatter.locale = this.locale; + } + dayFormatChanged() { + this.dateFormatter.dayFormat = this.dayFormat; + } + weekdayFormatChanged() { + this.dateFormatter.weekdayFormat = this.weekdayFormat; + } + monthFormatChanged() { + this.dateFormatter.monthFormat = this.monthFormat; + } + yearFormatChanged() { + this.dateFormatter.yearFormat = this.yearFormat; + } + /** + * Gets data needed to render about a calendar month as well as the previous and next months + * @param year - year of the calendar + * @param month - month of the calendar + * @returns - an object with data about the current and 2 surrounding months + * @public + */ + getMonthInfo(month = this.month, year = this.year) { + const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay(); + const getLength = (date) => { + const nextMonth2 = new Date(date.getFullYear(), date.getMonth() + 1, 1); + return new Date(nextMonth2.getTime() - this.oneDayInMs).getDate(); + }; + const thisMonth = new Date(year, month - 1); + const nextMonth = new Date(year, month); + const previousMonth = new Date(year, month - 2); + return { + length: getLength(thisMonth), + month, + start: getFirstDay(thisMonth), + year, + previous: { + length: getLength(previousMonth), + month: previousMonth.getMonth() + 1, + start: getFirstDay(previousMonth), + year: previousMonth.getFullYear() + }, + next: { + length: getLength(nextMonth), + month: nextMonth.getMonth() + 1, + start: getFirstDay(nextMonth), + year: nextMonth.getFullYear() + } + }; + } + /** + * A list of calendar days + * @param info - an object containing the information needed to render a calendar month + * @param minWeeks - minimum number of weeks to show + * @returns a list of days in a calendar month + * @public + */ + getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) { + minWeeks = minWeeks > 10 ? 10 : minWeeks; + const { start, length, previous, next } = info; + const days = []; + let dayCount = 1 - start; + while (dayCount < length + 1 || days.length < minWeeks || days[days.length - 1].length % 7 !== 0) { + const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info; + const day = dayCount < 1 ? previous.length + dayCount : dayCount > length ? dayCount - length : dayCount; + const dateString = `${month}-${day}-${year}`; + const disabled = this.dateInString(dateString, this.disabledDates); + const selected = this.dateInString(dateString, this.selectedDates); + const date = { + day, + month, + year, + disabled, + selected + }; + const target = days[days.length - 1]; + if (days.length === 0 || target.length % 7 === 0) { + days.push([date]); + } else { + target.push(date); + } + dayCount++; + } + return days; + } + /** + * A helper function that checks if a date exists in a list of dates + * @param date - A date objec that includes the day, month and year + * @param datesString - a comma separated list of dates + * @returns - Returns true if it found the date in the list of dates + * @public + */ + dateInString(date, datesString) { + const dates = datesString.split(",").map((str) => str.trim()); + date = typeof date === "string" ? date : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; + return dates.some((d) => d === date); + } + /** + * Creates a class string for the day container + * @param date - date of the calendar cell + * @returns - string of class names + * @public + */ + getDayClassNames(date, todayString) { + const { day, month, year, disabled, selected } = date; + const today = todayString === `${month}-${day}-${year}`; + const inactive = this.month !== month; + return [ + "day", + today && "today", + inactive && "inactive", + disabled && "disabled", + selected && "selected" + ].filter(Boolean).join(" "); + } + /** + * Returns a list of weekday labels + * @returns An array of weekday text and full text if abbreviated + * @public + */ + getWeekdayText() { + const weekdayText = this.dateFormatter.getWeekdays().map((text) => ({ text })); + if (this.weekdayFormat !== "long") { + const longText = this.dateFormatter.getWeekdays("long"); + weekdayText.forEach((weekday, index) => { + weekday.abbr = longText[index]; + }); + } + return weekdayText; + } + /** + * Emits the "date-select" event with the day, month and year. + * @param date - Date cell + * @public + */ + handleDateSelect(event, day) { + event.preventDefault; + this.$emit("dateselected", day); + } + /** + * Handles keyboard events on a cell + * @param event - Keyboard event + * @param date - Date of the cell selected + */ + handleKeydown(event, date) { + if (event.key === keyEnter) { + this.handleDateSelect(event, date); + } + return true; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Calendar.prototype, "readonly", void 0); + __decorate([ + attr + ], Calendar.prototype, "locale", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "month", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "year", void 0); + __decorate([ + attr({ attribute: "day-format", mode: "fromView" }) + ], Calendar.prototype, "dayFormat", void 0); + __decorate([ + attr({ attribute: "weekday-format", mode: "fromView" }) + ], Calendar.prototype, "weekdayFormat", void 0); + __decorate([ + attr({ attribute: "month-format", mode: "fromView" }) + ], Calendar.prototype, "monthFormat", void 0); + __decorate([ + attr({ attribute: "year-format", mode: "fromView" }) + ], Calendar.prototype, "yearFormat", void 0); + __decorate([ + attr({ attribute: "min-weeks", converter: nullableNumberConverter }) + ], Calendar.prototype, "minWeeks", void 0); + __decorate([ + attr({ attribute: "disabled-dates" }) + ], Calendar.prototype, "disabledDates", void 0); + __decorate([ + attr({ attribute: "selected-dates" }) + ], Calendar.prototype, "selectedDates", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js + var GenerateHeaderOptions, DataGridCellTypes, DataGridRowTypes; + var init_data_grid_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js"() { + GenerateHeaderOptions = { + none: "none", + default: "default", + sticky: "sticky" + }; + DataGridCellTypes = { + default: "default", + columnHeader: "columnheader", + rowHeader: "rowheader" + }; + DataGridRowTypes = { + default: "default", + header: "header", + stickyHeader: "sticky-header" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js + var DataGridRow; + var init_data_grid_row = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGridRow = class extends FoundationElement { + constructor() { + super(...arguments); + this.rowType = DataGridRowTypes.default; + this.rowData = null; + this.columnDefinitions = null; + this.isActiveRow = false; + this.cellsRepeatBehavior = null; + this.cellsPlaceholder = null; + this.focusColumnIndex = 0; + this.refocusOnLoad = false; + this.updateRowStyle = () => { + this.style.gridTemplateColumns = this.gridTemplateColumns; + }; + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowStyle(); + } + } + rowTypeChanged() { + if (this.$fastController.isConnected) { + this.updateItemTemplate(); + } + } + rowDataChanged() { + if (this.rowData !== null && this.isActiveRow) { + this.refocusOnLoad = true; + return; + } + } + cellItemTemplateChanged() { + this.updateItemTemplate(); + } + headerCellItemTemplateChanged() { + this.updateItemTemplate(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.cellsRepeatBehavior === null) { + this.cellsPlaceholder = document.createComment(""); + this.appendChild(this.cellsPlaceholder); + this.updateItemTemplate(); + this.cellsRepeatBehavior = new RepeatDirective((x) => x.columnDefinitions, (x) => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder); + this.$fastController.addBehaviors([this.cellsRepeatBehavior]); + } + this.addEventListener("cell-focused", this.handleCellFocus); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.updateRowStyle(); + if (this.refocusOnLoad) { + this.refocusOnLoad = false; + if (this.cellElements.length > this.focusColumnIndex) { + this.cellElements[this.focusColumnIndex].focus(); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("cell-focused", this.handleCellFocus); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + } + handleFocusout(e) { + if (!this.contains(e.target)) { + this.isActiveRow = false; + this.focusColumnIndex = 0; + } + } + handleCellFocus(e) { + this.isActiveRow = true; + this.focusColumnIndex = this.cellElements.indexOf(e.target); + this.$emit("row-focused", this); + } + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusColumnIndex = 0; + switch (e.key) { + case keyArrowLeft: + newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyArrowRight: + newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyHome: + if (!e.ctrlKey) { + this.cellElements[0].focus(); + e.preventDefault(); + } + break; + case keyEnd: + if (!e.ctrlKey) { + this.cellElements[this.cellElements.length - 1].focus(); + e.preventDefault(); + } + break; + } + } + updateItemTemplate() { + this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate; + } + }; + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGridRow.prototype, "gridTemplateColumns", void 0); + __decorate([ + attr({ attribute: "row-type" }) + ], DataGridRow.prototype, "rowType", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowIndex", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "isActiveRow", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "activeCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js + function createRowItemTemplate(context) { + const rowTag = context.tagFor(DataGridRow); + return html` + <${rowTag} + :rowData="${(x) => x}" + :cellItemTemplate="${(x, c) => c.parent.cellItemTemplate}" + :headerCellItemTemplate="${(x, c) => c.parent.headerCellItemTemplate}" + > +`; + } + var dataGridTemplate; + var init_data_grid_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js"() { + init_esm(); + init_data_grid_row(); + dataGridTemplate = (context, definition) => { + const rowItemTemplate = createRowItemTemplate(context); + const rowTag = context.tagFor(DataGridRow); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js + var DataGrid; + var init_data_grid = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGrid = class _DataGrid extends FoundationElement { + constructor() { + super(); + this.noTabbing = false; + this.generateHeader = GenerateHeaderOptions.default; + this.rowsData = []; + this.columnDefinitions = null; + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + this.rowsPlaceholder = null; + this.generatedHeader = null; + this.isUpdatingFocus = false; + this.pendingFocusUpdate = false; + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = true; + this.generatedGridTemplateColumns = ""; + this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => { + if (this.rowElements.length === 0) { + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + return; + } + const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex)); + const focusRow = this.rowElements[focusRowIndex]; + const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'); + const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex)); + const focusTarget = cells[focusColumnIndex]; + if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) { + focusTarget.scrollIntoView({ block: "center", inline: "center" }); + } + focusTarget.focus(); + }; + this.onChildListChange = (mutations, observer) => { + if (mutations && mutations.length) { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((newNode) => { + if (newNode.nodeType === 1 && newNode.getAttribute("role") === "row") { + newNode.columnDefinitions = this.columnDefinitions; + } + }); + }); + this.queueRowIndexUpdate(); + } + }; + this.queueRowIndexUpdate = () => { + if (!this.rowindexUpdateQueued) { + this.rowindexUpdateQueued = true; + DOM.queueUpdate(this.updateRowIndexes); + } + }; + this.updateRowIndexes = () => { + let newGridTemplateColumns = this.gridTemplateColumns; + if (newGridTemplateColumns === void 0) { + if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) { + const firstRow = this.rowElements[0]; + this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" "); + } + newGridTemplateColumns = this.generatedGridTemplateColumns; + } + this.rowElements.forEach((element, index) => { + const thisRow = element; + thisRow.rowIndex = index; + thisRow.gridTemplateColumns = newGridTemplateColumns; + if (this.columnDefinitionsStale) { + thisRow.columnDefinitions = this.columnDefinitions; + } + }); + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = false; + }; + } + /** + * generates a gridTemplateColumns based on columndata array + */ + static generateTemplateColumns(columnDefinitions) { + let templateColumns = ""; + columnDefinitions.forEach((column) => { + templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`; + }); + return templateColumns; + } + noTabbingChanged() { + if (this.$fastController.isConnected) { + if (this.noTabbing) { + this.setAttribute("tabIndex", "-1"); + } else { + this.setAttribute("tabIndex", this.contains(document.activeElement) || this === document.activeElement ? "-1" : "0"); + } + } + } + generateHeaderChanged() { + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowIndexes(); + } + } + rowsDataChanged() { + if (this.columnDefinitions === null && this.rowsData.length > 0) { + this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]); + } + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + columnDefinitionsChanged() { + if (this.columnDefinitions === null) { + this.generatedGridTemplateColumns = ""; + return; + } + this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(this.columnDefinitions); + if (this.$fastController.isConnected) { + this.columnDefinitionsStale = true; + this.queueRowIndexUpdate(); + } + } + headerCellItemTemplateChanged() { + if (this.$fastController.isConnected) { + if (this.generatedHeader !== null) { + this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate; + } + } + } + focusRowIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + focusColumnIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.rowItemTemplate === void 0) { + this.rowItemTemplate = this.defaultRowItemTemplate; + } + this.rowsPlaceholder = document.createComment(""); + this.appendChild(this.rowsPlaceholder); + this.toggleGeneratedHeader(); + this.rowsRepeatBehavior = new RepeatDirective((x) => x.rowsData, (x) => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder); + this.$fastController.addBehaviors([this.rowsRepeatBehavior]); + this.addEventListener("row-focused", this.handleRowFocus); + this.addEventListener(eventFocus, this.handleFocus); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.addEventListener(eventFocusOut, this.handleFocusOut); + this.observer = new MutationObserver(this.onChildListChange); + this.observer.observe(this, { childList: true }); + if (this.noTabbing) { + this.setAttribute("tabindex", "-1"); + } + DOM.queueUpdate(this.queueRowIndexUpdate); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("row-focused", this.handleRowFocus); + this.removeEventListener(eventFocus, this.handleFocus); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.removeEventListener(eventFocusOut, this.handleFocusOut); + this.observer.disconnect(); + this.rowsPlaceholder = null; + this.generatedHeader = null; + } + /** + * @internal + */ + handleRowFocus(e) { + this.isUpdatingFocus = true; + const focusRow = e.target; + this.focusRowIndex = this.rowElements.indexOf(focusRow); + this.focusColumnIndex = focusRow.focusColumnIndex; + this.setAttribute("tabIndex", "-1"); + this.isUpdatingFocus = false; + } + /** + * @internal + */ + handleFocus(e) { + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + /** + * @internal + */ + handleFocusOut(e) { + if (e.relatedTarget === null || !this.contains(e.relatedTarget)) { + this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0"); + } + } + /** + * @internal + */ + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusRowIndex; + const maxIndex = this.rowElements.length - 1; + const currentGridBottom = this.offsetHeight + this.scrollTop; + const lastRow = this.rowElements[maxIndex]; + switch (e.key) { + case keyArrowUp: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true); + break; + case keyArrowDown: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true); + break; + case keyPageUp: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex === 0) { + this.focusOnCell(0, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex - 1; + for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop < this.scrollTop) { + this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyPageDown: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) { + this.focusOnCell(maxIndex, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex + 1; + for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) { + let stickyHeaderOffset = 0; + if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) { + stickyHeaderOffset = this.generatedHeader.clientHeight; + } + this.scrollTop = thisRow.offsetTop - stickyHeaderOffset; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyHome: + if (e.ctrlKey) { + e.preventDefault(); + this.focusOnCell(0, 0, true); + } + break; + case keyEnd: + if (e.ctrlKey && this.columnDefinitions !== null) { + e.preventDefault(); + this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true); + } + break; + } + } + queueFocusUpdate() { + if (this.isUpdatingFocus && (this.contains(document.activeElement) || this === document.activeElement)) { + return; + } + if (this.pendingFocusUpdate === false) { + this.pendingFocusUpdate = true; + DOM.queueUpdate(() => this.updateFocus()); + } + } + updateFocus() { + this.pendingFocusUpdate = false; + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + toggleGeneratedHeader() { + if (this.generatedHeader !== null) { + this.removeChild(this.generatedHeader); + this.generatedHeader = null; + } + if (this.generateHeader !== GenerateHeaderOptions.none && this.rowsData.length > 0) { + const generatedHeaderElement = document.createElement(this.rowElementTag); + this.generatedHeader = generatedHeaderElement; + this.generatedHeader.columnDefinitions = this.columnDefinitions; + this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns; + this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header; + if (this.firstChild !== null || this.rowsPlaceholder !== null) { + this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder); + } + return; + } + } + }; + DataGrid.generateColumns = (row) => { + return Object.getOwnPropertyNames(row).map((property, index) => { + return { + columnDataKey: property, + gridColumn: `${index}` + }; + }); + }; + __decorate([ + attr({ attribute: "no-tabbing", mode: "boolean" }) + ], DataGrid.prototype, "noTabbing", void 0); + __decorate([ + attr({ attribute: "generate-header" }) + ], DataGrid.prototype, "generateHeader", void 0); + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGrid.prototype, "gridTemplateColumns", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowsData", void 0); + __decorate([ + observable + ], DataGrid.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusRowIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusColumnIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "defaultRowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElementTag", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js + var defaultCellContentsTemplate, defaultHeaderCellContentsTemplate, DataGridCell; + var init_data_grid_cell = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + defaultCellContentsTemplate = html` + +`; + defaultHeaderCellContentsTemplate = html` + +`; + DataGridCell = class extends FoundationElement { + constructor() { + super(...arguments); + this.cellType = DataGridCellTypes.default; + this.rowData = null; + this.columnDefinition = null; + this.isActiveCell = false; + this.customCellView = null; + this.updateCellStyle = () => { + this.style.gridColumn = this.gridColumn; + }; + } + cellTypeChanged() { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + gridColumnChanged() { + if (this.$fastController.isConnected) { + this.updateCellStyle(); + } + } + columnDefinitionChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.addEventListener(eventFocusIn, this.handleFocusin); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === void 0 ? 0 : this.columnDefinition.gridColumn}`; + this.updateCellView(); + this.updateCellStyle(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener(eventFocusIn, this.handleFocusin); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.disconnectCellView(); + } + handleFocusin(e) { + if (this.isActiveCell) { + return; + } + this.isActiveCell = true; + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + default: + if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + } + this.$emit("cell-focused", this); + } + handleFocusout(e) { + if (this !== document.activeElement && !this.contains(document.activeElement)) { + this.isActiveCell = false; + } + } + handleKeydown(e) { + if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) { + return; + } + switch (e.key) { + case keyEnter: + case keyFunction2: + if (this.contains(document.activeElement) && document.activeElement !== this) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + default: + if (this.columnDefinition.cellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + } + break; + case keyEscape: + if (this.contains(document.activeElement) && document.activeElement !== this) { + this.focus(); + e.preventDefault(); + } + break; + } + } + updateCellView() { + this.disconnectCellView(); + if (this.columnDefinition === null) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellTemplate !== void 0) { + this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this); + } else { + this.customCellView = defaultHeaderCellContentsTemplate.render(this, this); + } + break; + case void 0: + case DataGridCellTypes.rowHeader: + case DataGridCellTypes.default: + if (this.columnDefinition.cellTemplate !== void 0) { + this.customCellView = this.columnDefinition.cellTemplate.render(this, this); + } else { + this.customCellView = defaultCellContentsTemplate.render(this, this); + } + break; + } + } + disconnectCellView() { + if (this.customCellView !== null) { + this.customCellView.dispose(); + this.customCellView = null; + } + } + }; + __decorate([ + attr({ attribute: "cell-type" }) + ], DataGridCell.prototype, "cellType", void 0); + __decorate([ + attr({ attribute: "grid-column" }) + ], DataGridCell.prototype, "gridColumn", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "columnDefinition", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js + function createCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}" + grid-column="${(x, c) => c.index + 1}" + :rowData="${(x, c) => c.parent.rowData}" + :columnDefinition="${(x) => x}" + > +`; + } + function createHeaderCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="columnheader" + grid-column="${(x, c) => c.index + 1}" + :columnDefinition="${(x) => x}" + > +`; + } + var dataGridRowTemplate; + var init_data_grid_row_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js"() { + init_esm(); + init_data_grid_cell(); + dataGridRowTemplate = (context, definition) => { + const cellItemTemplate = createCellItemTemplate(context); + const headerCellItemTemplate = createHeaderCellItemTemplate(context); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js + var dataGridCellTemplate; + var init_data_grid_cell_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js"() { + init_esm(); + dataGridCellTemplate = (context, definition) => { + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js + var init_data_grid2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js"() { + init_data_grid_template(); + init_data_grid(); + init_data_grid_row_template(); + init_data_grid_row(); + init_data_grid_cell_template(); + init_data_grid_cell(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js + var CalendarTitleTemplate; + var init_calendar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js"() { + init_esm(); + CalendarTitleTemplate = html` +
+ + ${(x) => x.dateFormatter.getMonth(x.month)} + + ${(x) => x.dateFormatter.getYear(x.year)} +
+`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js + var init_calendar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js"() { + init_calendar(); + init_calendar_template(); + init_date_formatter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js + var init_card_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.js + var init_card = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/index.js + var init_card2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/index.js"() { + init_card_template(); + init_card(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js + var checkboxTemplate; + var init_checkbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js"() { + init_esm(); + checkboxTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js + var _Checkbox, FormAssociatedCheckbox; + var init_checkbox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Checkbox = class extends FoundationElement { + }; + FormAssociatedCheckbox = class extends CheckableFormAssociated(_Checkbox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js + var Checkbox; + var init_checkbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_checkbox_form_associated(); + Checkbox = class extends FormAssociatedCheckbox { + constructor() { + super(); + this.initialValue = "on"; + this.indeterminate = false; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keySpace: + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Checkbox.prototype, "readOnly", void 0); + __decorate([ + observable + ], Checkbox.prototype, "defaultSlottedNodes", void 0); + __decorate([ + observable + ], Checkbox.prototype, "indeterminate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js + var init_checkbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js"() { + init_checkbox_template(); + init_checkbox(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js + function isListboxOption(el2) { + return isHTMLElement(el2) && (el2.getAttribute("role") === "option" || el2 instanceof HTMLOptionElement); + } + var ListboxOption, DelegatesARIAListboxOption; + var init_listbox_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + ListboxOption = class extends FoundationElement { + constructor(text, value, defaultSelected, selected) { + super(); + this.defaultSelected = false; + this.dirtySelected = false; + this.selected = this.defaultSelected; + this.dirtyValue = false; + if (text) { + this.textContent = text; + } + if (value) { + this.initialValue = value; + } + if (defaultSelected) { + this.defaultSelected = defaultSelected; + } + if (selected) { + this.selected = selected; + } + this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected); + this.proxy.disabled = this.disabled; + } + /** + * Updates the ariaChecked property when the checked property changes. + * + * @param prev - the previous checked value + * @param next - the current checked value + * + * @public + */ + checkedChanged(prev, next) { + if (typeof next === "boolean") { + this.ariaChecked = next ? "true" : "false"; + return; + } + this.ariaChecked = null; + } + /** + * Updates the proxy's text content when the default slot changes. + * @param prev - the previous content value + * @param next - the current content value + * + * @internal + */ + contentChanged(prev, next) { + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.textContent = this.textContent; + } + this.$emit("contentchange", null, { bubbles: true }); + } + defaultSelectedChanged() { + if (!this.dirtySelected) { + this.selected = this.defaultSelected; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.defaultSelected; + } + } + } + disabledChanged(prev, next) { + this.ariaDisabled = this.disabled ? "true" : "false"; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.disabled = this.disabled; + } + } + selectedAttributeChanged() { + this.defaultSelected = this.selectedAttribute; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.defaultSelected = this.defaultSelected; + } + } + selectedChanged() { + this.ariaSelected = this.selected ? "true" : "false"; + if (!this.dirtySelected) { + this.dirtySelected = true; + } + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.selected; + } + } + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + get label() { + var _a; + return (_a = this.value) !== null && _a !== void 0 ? _a : this.text; + } + get text() { + var _a, _b; + return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : ""; + } + set value(next) { + const newValue = `${next !== null && next !== void 0 ? next : ""}`; + this._value = newValue; + this.dirtyValue = true; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.value = newValue; + } + Observable.notify(this, "value"); + } + get value() { + var _a; + Observable.track(this, "value"); + return (_a = this._value) !== null && _a !== void 0 ? _a : this.text; + } + get form() { + return this.proxy ? this.proxy.form : null; + } + }; + __decorate([ + observable + ], ListboxOption.prototype, "checked", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "content", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "defaultSelected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxOption.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "selected", mode: "boolean" }) + ], ListboxOption.prototype, "selectedAttribute", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "selected", void 0); + __decorate([ + attr({ attribute: "value", mode: "fromView" }) + ], ListboxOption.prototype, "initialValue", void 0); + DelegatesARIAListboxOption = class { + }; + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0); + applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties); + applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js + var Listbox, DelegatesARIAListbox; + var init_listbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_listbox_option(); + init_aria_global(); + init_apply_mixins(); + Listbox = class _Listbox extends FoundationElement { + constructor() { + super(...arguments); + this._options = []; + this.selectedIndex = -1; + this.selectedOptions = []; + this.shouldSkipFocus = false; + this.typeaheadBuffer = ""; + this.typeaheadExpired = true; + this.typeaheadTimeout = -1; + } + /** + * The first selected option. + * + * @internal + */ + get firstSelectedOption() { + var _a; + return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null; + } + /** + * Returns true if there is one or more selectable option. + * + * @internal + */ + get hasSelectableOptions() { + return this.options.length > 0 && !this.options.every((o) => o.disabled); + } + /** + * The number of options. + * + * @public + */ + get length() { + var _a, _b; + return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + } + /** + * The list of options. + * + * @public + */ + get options() { + Observable.track(this, "options"); + return this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Flag for the typeahead timeout expiration. + * + * @deprecated use `Listbox.typeaheadExpired` + * @internal + */ + get typeAheadExpired() { + return this.typeaheadExpired; + } + set typeAheadExpired(value) { + this.typeaheadExpired = value; + } + /** + * Handle click events for listbox options. + * + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && !captured.disabled) { + this.selectedIndex = this.options.indexOf(captured); + return true; + } + } + /** + * Ensures that the provided option is focused and scrolled into view. + * + * @param optionToFocus - The option to focus + * @internal + */ + focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) { + if (this.contains(document.activeElement) && optionToFocus !== null) { + optionToFocus.focus(); + requestAnimationFrame(() => { + optionToFocus.scrollIntoView({ block: "nearest" }); + }); + } + } + /** + * Handles `focusin` actions for the component. When the component receives focus, + * the list of selected options is refreshed and the first selected option is scrolled + * into view. + * + * @internal + */ + focusinHandler(e) { + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Returns the options which match the current typeahead buffer. + * + * @internal + */ + getTypeaheadMatches() { + const pattern = this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp(`^${pattern}`, "gi"); + return this.options.filter((o) => o.text.trim().match(re)); + } + /** + * Determines the index of the next option which is selectable, if any. + * + * @param prev - the previous selected index + * @param next - the next index to select + * + * @internal + */ + getSelectableIndex(prev = this.selectedIndex, next) { + const direction = prev > next ? -1 : prev < next ? 1 : 0; + const potentialDirection = prev + direction; + let nextSelectableOption = null; + switch (direction) { + case -1: { + nextSelectableOption = this.options.reduceRight((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + case 1: { + nextSelectableOption = this.options.reduce((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + } + return this.options.indexOf(nextSelectableOption); + } + /** + * Handles external changes to child options. + * + * @param source - the source object + * @param propertyName - the property + * + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "selected": { + if (_Listbox.slottedOptionFilter(source)) { + this.selectedIndex = this.options.indexOf(source); + } + this.setSelectedOptions(); + break; + } + } + } + /** + * Moves focus to an option whose label matches characters typed by the user. + * Consecutive keystrokes are batched into a buffer of search text used + * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes + * between consecutive keystrokes, the search restarts. + * + * @param key - the key to be evaluated + * + * @internal + */ + handleTypeAhead(key) { + if (this.typeaheadTimeout) { + window.clearTimeout(this.typeaheadTimeout); + } + this.typeaheadTimeout = window.setTimeout(() => this.typeaheadExpired = true, _Listbox.TYPE_AHEAD_TIMEOUT_MS); + if (key.length > 1) { + return; + } + this.typeaheadBuffer = `${this.typeaheadExpired ? "" : this.typeaheadBuffer}${key}`; + } + /** + * Handles `keydown` actions for listbox navigation and typeahead. + * + * @internal + */ + keydownHandler(e) { + if (this.disabled) { + return true; + } + this.shouldSkipFocus = false; + const key = e.key; + switch (key) { + // Select the first available option + case keyHome: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectFirstOption(); + } + break; + } + // Select the next selectable option + case keyArrowDown: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectNextOption(); + } + break; + } + // Select the previous selectable option + case keyArrowUp: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectPreviousOption(); + } + break; + } + // Select the last available option + case keyEnd: { + e.preventDefault(); + this.selectLastOption(); + break; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEnter: + case keyEscape: { + return true; + } + case keySpace: { + if (this.typeaheadExpired) { + return true; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @internal + */ + mousedownHandler(e) { + this.shouldSkipFocus = !this.contains(document.activeElement); + return true; + } + /** + * Switches between single-selection and multi-selection mode. + * + * @param prev - the previous value of the `multiple` attribute + * @param next - the next value of the `multiple` attribute + * + * @internal + */ + multipleChanged(prev, next) { + this.ariaMultiSelectable = next ? "true" : null; + } + /** + * Updates the list of selected options when the `selectedIndex` changes. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + var _a; + if (!this.hasSelectableOptions) { + this.selectedIndex = -1; + return; + } + if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") { + const selectableIndex = this.getSelectableIndex(prev, next); + const newNext = selectableIndex > -1 ? selectableIndex : prev; + this.selectedIndex = newNext; + if (next === newNext) { + this.selectedIndexChanged(next, newNext); + } + return; + } + this.setSelectedOptions(); + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + const filteredNext = next.filter(_Listbox.slottedOptionFilter); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "selected"); + o.selected = filteredNext.includes(o); + notifier.subscribe(this, "selected"); + }); + } + /** + * Moves focus to the first selectable option. + * + * @public + */ + selectFirstOption() { + var _a, _b; + if (!this.disabled) { + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((o) => !o.disabled)) !== null && _b !== void 0 ? _b : -1; + } + } + /** + * Moves focus to the last selectable option. + * + * @internal + */ + selectLastOption() { + if (!this.disabled) { + this.selectedIndex = findLastIndex(this.options, (o) => !o.disabled); + } + } + /** + * Moves focus to the next selectable option. + * + * @internal + */ + selectNextOption() { + if (!this.disabled && this.selectedIndex < this.options.length - 1) { + this.selectedIndex += 1; + } + } + /** + * Moves focus to the previous selectable option. + * + * @internal + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex > 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Updates the selected index to match the first selected option. + * + * @internal + */ + setDefaultSelectedOption() { + var _a, _b; + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((el2) => el2.defaultSelected)) !== null && _b !== void 0 ? _b : -1; + } + /** + * Sets an option as selected and gives it focus. + * + * @public + */ + setSelectedOptions() { + var _a, _b, _c; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) { + this.selectedOptions = [this.options[this.selectedIndex]]; + this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""; + this.focusAndScrollOptionIntoView(); + } + } + /** + * Updates the list of options and resets the selected option when the slotted option content changes. + * + * @param prev - the previous list of slotted options + * @param next - the current list of slotted options + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options = next.reduce((options, item) => { + if (isListboxOption(item)) { + options.push(item); + } + return options; + }, []); + const setSize = `${this.options.length}`; + this.options.forEach((option, index) => { + if (!option.id) { + option.id = uniqueId("option-"); + } + option.ariaPosInSet = `${index + 1}`; + option.ariaSetSize = setSize; + }); + if (this.$fastController.isConnected) { + this.setSelectedOptions(); + this.setDefaultSelectedOption(); + } + } + /** + * Updates the filtered list of options when the typeahead buffer changes. + * + * @param prev - the previous typeahead buffer value + * @param next - the current typeahead buffer value + * + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + if (typeaheadMatches.length) { + const selectedIndex = this.options.indexOf(typeaheadMatches[0]); + if (selectedIndex > -1) { + this.selectedIndex = selectedIndex; + } + } + this.typeaheadExpired = false; + } + } + }; + Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; + Listbox.TYPE_AHEAD_TIMEOUT_MS = 1e3; + __decorate([ + attr({ mode: "boolean" }) + ], Listbox.prototype, "disabled", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedIndex", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "slottedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "typeaheadBuffer", void 0); + DelegatesARIAListbox = class { + }; + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaDisabled", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaExpanded", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0); + applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties); + applyMixins(Listbox, DelegatesARIAListbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js + var SelectPosition; + var init_select_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js"() { + SelectPosition = { + above: "above", + below: "below" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js + var _Combobox, FormAssociatedCombobox; + var init_combobox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js"() { + init_form_associated(); + init_listbox(); + _Combobox = class extends Listbox { + }; + FormAssociatedCombobox = class extends FormAssociated(_Combobox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js + var ComboboxAutocomplete; + var init_combobox_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js"() { + ComboboxAutocomplete = { + inline: "inline", + list: "list", + both: "both", + none: "none" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js + var Combobox, DelegatesARIACombobox; + var init_combobox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_select_options(); + init_apply_mixins(); + init_combobox_form_associated(); + init_combobox_options(); + Combobox = class extends FormAssociatedCombobox { + constructor() { + super(...arguments); + this._value = ""; + this.filteredOptions = []; + this.filter = ""; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + this.open = false; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + super.formResetCallback(); + this.setDefaultSelectedOption(); + this.updateValue(); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + get isAutocompleteInline() { + return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth; + } + get isAutocompleteList() { + return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth; + } + get isAutocompleteBoth() { + return this.autocomplete === ComboboxAutocomplete.both; + } + /** + * Sets focus and synchronize ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged() { + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The list of options. + * + * @public + * @remarks + * Overrides `Listbox.options`. + */ + get options() { + Observable.track(this, "options"); + return this.filteredOptions.length ? this.filteredOptions : this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Updates the placeholder on the proxy element. + * @internal + */ + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c; + const prev = `${this._value}`; + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.text.toLowerCase() === next.toLowerCase()); + const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text; + const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text; + this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex; + next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + } + } + /** + * Handle opening and closing the listbox when the combobox is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (this.disabled || (captured === null || captured === void 0 ? void 0 : captured.disabled)) { + return; + } + if (this.open) { + if (e.composedPath()[0] === this.control) { + return; + } + if (captured) { + this.selectedOptions = [captured]; + this.control.value = captured.text; + this.clearSelectionRange(); + this.updateValue(true); + } + } + this.open = !this.open; + if (this.open) { + this.control.focus(); + } + return true; + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + if (this.value) { + this.initialValue = this.value; + } + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Filter available options by text value. + * + * @public + */ + filterOptions() { + if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) { + this.filter = ""; + } + const filter = this.filter.toLowerCase(); + this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase())); + if (this.isAutocompleteList) { + if (!this.filteredOptions.length && !filter) { + this.filteredOptions = this._options; + } + this._options.forEach((o) => { + o.hidden = !this.filteredOptions.includes(o); + }); + } + } + /** + * Focus the control and scroll the first selected option into view. + * + * @internal + * @remarks + * Overrides: `Listbox.focusAndScrollOptionIntoView` + */ + focusAndScrollOptionIntoView() { + if (this.contains(document.activeElement)) { + this.control.focus(); + if (this.firstSelectedOption) { + requestAnimationFrame(() => { + var _a; + (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest" }); + }); + } + } + } + /** + * Handle focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + this.syncValue(); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!this.options || !this.options.includes(focusTarget)) { + this.open = false; + } + } + /** + * Handle content changes on the control input. + * + * @param e - the input event + * @internal + */ + inputHandler(e) { + this.filter = this.control.value; + this.filterOptions(); + if (!this.isAutocompleteInline) { + this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value); + } + if (e.inputType.includes("deleteContent") || !this.filter.length) { + return true; + } + if (this.isAutocompleteList && !this.open) { + this.open = true; + } + if (this.isAutocompleteInline) { + if (this.filteredOptions.length) { + this.selectedOptions = [this.filteredOptions[0]]; + this.selectedIndex = this.options.indexOf(this.firstSelectedOption); + this.setInlineSelection(); + } else { + this.selectedIndex = -1; + } + } + return; + } + /** + * Handle keydown actions for listbox navigation. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (e.ctrlKey || e.shiftKey) { + return true; + } + switch (key) { + case "Enter": { + this.syncValue(); + if (this.isAutocompleteInline) { + this.filter = this.value; + } + this.open = false; + this.clearSelectionRange(); + break; + } + case "Escape": { + if (!this.isAutocompleteInline) { + this.selectedIndex = -1; + } + if (this.open) { + this.open = false; + break; + } + this.value = ""; + this.control.value = ""; + this.filter = ""; + this.filterOptions(); + break; + } + case "Tab": { + this.setInputToSelection(); + if (!this.open) { + return true; + } + e.preventDefault(); + this.open = false; + break; + } + case "ArrowUp": + case "ArrowDown": { + this.filterOptions(); + if (!this.open) { + this.open = true; + break; + } + if (this.filteredOptions.length > 0) { + super.keydownHandler(e); + } + if (this.isAutocompleteInline) { + this.setInlineSelection(); + } + break; + } + default: { + return true; + } + } + } + /** + * Handle keyup actions for value input and text field manipulations. + * + * @param e - the keyboard event + * @internal + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + case "ArrowRight": + case "Backspace": + case "Delete": + case "Home": + case "End": { + this.filter = this.control.value; + this.selectedIndex = -1; + this.filterOptions(); + break; + } + } + } + /** + * Ensure that the selectedIndex is within the current allowable filtered range. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + if (this.$fastController.isConnected) { + next = limit(-1, this.options.length - 1, next); + if (next !== this.selectedIndex) { + this.selectedIndex = next; + return; + } + super.selectedIndexChanged(prev, next); + } + } + /** + * Move focus to the previous selectable option. + * + * @internal + * @remarks + * Overrides `Listbox.selectPreviousOption` + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex >= 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Set the default selected options at initialization or reset. + * + * @internal + * @remarks + * Overrides `Listbox.setDefaultSelectedOption` + */ + setDefaultSelectedOption() { + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.getAttribute("selected") !== null || el2.selected); + this.selectedIndex = selectedIndex; + if (!this.dirtyValue && this.firstSelectedOption) { + this.value = this.firstSelectedOption.text; + } + this.setSelectedOptions(); + } + } + /** + * Focus and set the content of the control based on the first selected option. + * + * @internal + */ + setInputToSelection() { + if (this.firstSelectedOption) { + this.control.value = this.firstSelectedOption.text; + this.control.focus(); + } + } + /** + * Focus, set and select the content of the control based on the first selected option. + * + * @internal + */ + setInlineSelection() { + if (this.firstSelectedOption) { + this.setInputToSelection(); + this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward"); + } + } + /** + * Determines if a value update should involve emitting a change event, then updates the value. + * + * @internal + */ + syncValue() { + var _a; + const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value; + this.updateValue(this.value !== newValue); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @param force - direction to force the listbox to display + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * Ensure that the entire list of options is used when setting the selected property. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + * @remarks + * Overrides: `Listbox.selectedOptionsChanged` + */ + selectedOptionsChanged(prev, next) { + if (this.$fastController.isConnected) { + this._options.forEach((o) => { + o.selected = next.includes(o); + }); + } + } + /** + * Synchronize the form-associated proxy and update the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + super.slottedOptionsChanged(prev, next); + this.updateValue(); + } + /** + * Sets the value and to match the first selected option. + * + * @param shouldEmit - if true, the change event will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a; + if (this.$fastController.isConnected) { + this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value; + this.control.value = this.value; + } + if (shouldEmit) { + this.$emit("change"); + } + } + /** + * @internal + */ + clearSelectionRange() { + const controlValueLength = this.control.value.length; + this.control.setSelectionRange(controlValueLength, controlValueLength); + } + }; + __decorate([ + attr({ attribute: "autocomplete", mode: "fromView" }) + ], Combobox.prototype, "autocomplete", void 0); + __decorate([ + observable + ], Combobox.prototype, "maxHeight", void 0); + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Combobox.prototype, "open", void 0); + __decorate([ + attr + ], Combobox.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Combobox.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Combobox.prototype, "position", void 0); + DelegatesARIACombobox = class { + }; + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0); + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIACombobox, DelegatesARIAListbox); + applyMixins(Combobox, StartEnd, DelegatesARIACombobox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js + var init_combobox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js + var init_combobox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js"() { + init_combobox(); + init_combobox_options(); + init_combobox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js + function composedParent(element) { + const parentNode = element.parentElement; + if (parentNode) { + return parentNode; + } else { + const rootNode = element.getRootNode(); + if (rootNode.host instanceof HTMLElement) { + return rootNode.host; + } + } + return null; + } + var init_composed_parent = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js + function composedContains(reference, test) { + let current = test; + while (current !== null) { + if (current === reference) { + return true; + } + current = composedParent(current); + } + return false; + } + var init_composed_contains = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js"() { + init_composed_parent(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js + function isFastElement(element) { + return element instanceof FASTElement; + } + var defaultElement, QueuedStyleSheetTarget, ConstructableStyleSheetTarget, DocumentStyleSheetTarget, HeadStyleElementStyleSheetTarget, StyleElementStyleSheetTarget, ElementStyleSheetTarget, RootStyleSheetTarget, propertyTargetCache, propertyTargetCtor, PropertyTargetManager; + var init_custom_property_manager = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js"() { + init_tslib_es6(); + init_esm(); + defaultElement = document.createElement("div"); + QueuedStyleSheetTarget = class { + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + ConstructableStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor(source) { + super(); + const sheet = new CSSStyleSheet(); + sheet[prependToAdoptedStyleSheetsSymbol] = true; + this.target = sheet.cssRules[sheet.insertRule(":host{}")].style; + source.$fastController.addStyles(ElementStyles.create([sheet])); + } + }; + DocumentStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + const sheet = new CSSStyleSheet(); + this.target = sheet.cssRules[sheet.insertRule(":root{}")].style; + document.adoptedStyleSheets = [ + ...document.adoptedStyleSheets, + sheet + ]; + } + }; + HeadStyleElementStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + this.style = document.createElement("style"); + document.head.appendChild(this.style); + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":root{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } + } + }; + StyleElementStyleSheetTarget = class { + constructor(target) { + this.store = /* @__PURE__ */ new Map(); + this.target = null; + const controller = target.$fastController; + this.style = document.createElement("style"); + controller.addStyles(this.style); + Observable.getNotifier(controller).subscribe(this, "isConnected"); + this.handleChange(controller, "isConnected"); + } + targetChanged() { + if (this.target !== null) { + for (const [key, value] of this.store.entries()) { + this.target.setProperty(key, value); + } + } + } + setProperty(name, value) { + this.store.set(name, value); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.setProperty(name, value); + } + }); + } + removeProperty(name) { + this.store.delete(name); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.removeProperty(name); + } + }); + } + handleChange(source, key) { + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":host{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } else { + this.target = null; + } + } + }; + __decorate([ + observable + ], StyleElementStyleSheetTarget.prototype, "target", void 0); + ElementStyleSheetTarget = class { + constructor(source) { + this.target = source.style; + } + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + RootStyleSheetTarget = class _RootStyleSheetTarget { + setProperty(name, value) { + _RootStyleSheetTarget.properties[name] = value; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); + } + } + removeProperty(name) { + delete _RootStyleSheetTarget.properties[name]; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); + } + } + static registerRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (!roots.has(root)) { + roots.add(root); + const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.setProperty(key, _RootStyleSheetTarget.properties[key]); + } + } + } + static unregisterRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (roots.has(root)) { + roots.delete(root); + const target = PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.removeProperty(key); + } + } + } + /** + * Returns the document when provided the default element, + * otherwise is a no-op + * @param root - the root to normalize + */ + static normalizeRoot(root) { + return root === defaultElement ? document : root; + } + }; + RootStyleSheetTarget.roots = /* @__PURE__ */ new Set(); + RootStyleSheetTarget.properties = {}; + propertyTargetCache = /* @__PURE__ */ new WeakMap(); + propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; + PropertyTargetManager = Object.freeze({ + getOrCreate(source) { + if (propertyTargetCache.has(source)) { + return propertyTargetCache.get(source); + } + let target; + if (source === defaultElement) { + target = new RootStyleSheetTarget(); + } else if (source instanceof Document) { + target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); + } else if (isFastElement(source)) { + target = new propertyTargetCtor(source); + } else { + target = new ElementStyleSheetTarget(source); + } + propertyTargetCache.set(source, target); + return target; + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js + function create(nameOrConfig) { + return DesignTokenImpl.from(nameOrConfig); + } + var DesignTokenImpl, CustomPropertyReflector, DesignTokenBindingObserver, Store, nodeCache, childToParent, DesignTokenNode, DesignToken; + var init_design_token = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js"() { + init_tslib_es6(); + init_esm(); + init_composed_parent(); + init_composed_contains(); + init_custom_property_manager(); + init_custom_property_manager(); + DesignTokenImpl = class _DesignTokenImpl extends CSSDirective { + constructor(configuration) { + super(); + this.subscribers = /* @__PURE__ */ new WeakMap(); + this._appliedTo = /* @__PURE__ */ new Set(); + this.name = configuration.name; + if (configuration.cssCustomPropertyName !== null) { + this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`; + this.cssVar = `var(${this.cssCustomProperty})`; + } + this.id = _DesignTokenImpl.uniqueId(); + _DesignTokenImpl.tokensById.set(this.id, this); + } + get appliedTo() { + return [...this._appliedTo]; + } + static from(nameOrConfig) { + return new _DesignTokenImpl({ + name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, + cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName + }); + } + static isCSSDesignToken(token) { + return typeof token.cssCustomProperty === "string"; + } + static isDerivedDesignTokenValue(value) { + return typeof value === "function"; + } + /** + * Gets a token by ID. Returns undefined if the token was not found. + * @param id - The ID of the token + * @returns + */ + static getTokenById(id) { + return _DesignTokenImpl.tokensById.get(id); + } + getOrCreateSubscriberSet(target = this) { + return this.subscribers.get(target) || this.subscribers.set(target, /* @__PURE__ */ new Set()) && this.subscribers.get(target); + } + createCSS() { + return this.cssVar || ""; + } + getValueFor(element) { + const value = DesignTokenNode.getOrCreate(element).get(this); + if (value !== void 0) { + return value; + } + throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${element} or an ancestor of ${element}.`); + } + setValueFor(element, value) { + this._appliedTo.add(element); + if (value instanceof _DesignTokenImpl) { + value = this.alias(value); + } + DesignTokenNode.getOrCreate(element).set(this, value); + return this; + } + deleteValueFor(element) { + this._appliedTo.delete(element); + if (DesignTokenNode.existsFor(element)) { + DesignTokenNode.getOrCreate(element).delete(this); + } + return this; + } + withDefault(value) { + this.setValueFor(defaultElement, value); + return this; + } + subscribe(subscriber, target) { + const subscriberSet = this.getOrCreateSubscriberSet(target); + if (target && !DesignTokenNode.existsFor(target)) { + DesignTokenNode.getOrCreate(target); + } + if (!subscriberSet.has(subscriber)) { + subscriberSet.add(subscriber); + } + } + unsubscribe(subscriber, target) { + const list = this.subscribers.get(target || this); + if (list && list.has(subscriber)) { + list.delete(subscriber); + } + } + /** + * Notifies subscribers that the value for an element has changed. + * @param element - The element to emit a notification for + */ + notify(element) { + const record = Object.freeze({ token: this, target: element }); + if (this.subscribers.has(this)) { + this.subscribers.get(this).forEach((sub) => sub.handleChange(record)); + } + if (this.subscribers.has(element)) { + this.subscribers.get(element).forEach((sub) => sub.handleChange(record)); + } + } + /** + * Alias the token to the provided token. + * @param token - the token to alias to + */ + alias(token) { + return ((target) => token.getValueFor(target)); + } + }; + DesignTokenImpl.uniqueId = /* @__PURE__ */ (() => { + let id = 0; + return () => { + id++; + return id.toString(16); + }; + })(); + DesignTokenImpl.tokensById = /* @__PURE__ */ new Map(); + CustomPropertyReflector = class { + startReflection(token, target) { + token.subscribe(this, target); + this.handleChange({ token, target }); + } + stopReflection(token, target) { + token.unsubscribe(this, target); + this.remove(token, target); + } + handleChange(record) { + const { token, target } = record; + this.add(token, target); + } + add(token, target) { + PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); + } + remove(token, target) { + PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); + } + resolveCSSValue(value) { + return value && typeof value.createCSS === "function" ? value.createCSS() : value; + } + }; + DesignTokenBindingObserver = class { + constructor(source, token, node) { + this.source = source; + this.token = token; + this.node = node; + this.dependencies = /* @__PURE__ */ new Set(); + this.observer = Observable.binding(source, this, false); + this.observer.handleChange = this.observer.call; + this.handleChange(); + } + disconnect() { + this.observer.disconnect(); + } + /** + * @internal + */ + handleChange() { + try { + this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); + } catch (e) { + console.error(e); + } + } + }; + Store = class { + constructor() { + this.values = /* @__PURE__ */ new Map(); + } + set(token, value) { + if (this.values.get(token) !== value) { + this.values.set(token, value); + Observable.getNotifier(this).notify(token.id); + } + } + get(token) { + Observable.track(this, token.id); + return this.values.get(token); + } + delete(token) { + this.values.delete(token); + Observable.getNotifier(this).notify(token.id); + } + all() { + return this.values.entries(); + } + }; + nodeCache = /* @__PURE__ */ new WeakMap(); + childToParent = /* @__PURE__ */ new WeakMap(); + DesignTokenNode = class _DesignTokenNode { + constructor(target) { + this.target = target; + this.store = new Store(); + this.children = []; + this.assignedValues = /* @__PURE__ */ new Map(); + this.reflecting = /* @__PURE__ */ new Set(); + this.bindingObservers = /* @__PURE__ */ new Map(); + this.tokenValueChangeHandler = { + handleChange: (source, arg) => { + const token = DesignTokenImpl.getTokenById(arg); + if (token) { + token.notify(this.target); + this.updateCSSTokenReflection(source, token); + } + } + }; + nodeCache.set(target, this); + Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); + if (target instanceof FASTElement) { + target.$fastController.addBehaviors([this]); + } else if (target.isConnected) { + this.bind(); + } + } + /** + * Returns a DesignTokenNode for an element. + * Creates a new instance if one does not already exist for a node, + * otherwise returns the cached instance + * + * @param target - The HTML element to retrieve a DesignTokenNode for + */ + static getOrCreate(target) { + return nodeCache.get(target) || new _DesignTokenNode(target); + } + /** + * Determines if a DesignTokenNode has been created for a target + * @param target - The element to test + */ + static existsFor(target) { + return nodeCache.has(target); + } + /** + * Searches for and return the nearest parent DesignTokenNode. + * Null is returned if no node is found or the node provided is for a default element. + */ + static findParent(node) { + if (!(defaultElement === node.target)) { + let parent = composedParent(node.target); + while (parent !== null) { + if (nodeCache.has(parent)) { + return nodeCache.get(parent); + } + parent = composedParent(parent); + } + return _DesignTokenNode.getOrCreate(defaultElement); + } + return null; + } + /** + * Finds the closest node with a value explicitly assigned for a token, otherwise null. + * @param token - The token to look for + * @param start - The node to start looking for value assignment + * @returns + */ + static findClosestAssignedNode(token, start) { + let current = start; + do { + if (current.has(token)) { + return current; + } + current = current.parent ? current.parent : current.target !== defaultElement ? _DesignTokenNode.getOrCreate(defaultElement) : null; + } while (current !== null); + return null; + } + /** + * The parent DesignTokenNode, or null. + */ + get parent() { + return childToParent.get(this) || null; + } + updateCSSTokenReflection(source, token) { + if (DesignTokenImpl.isCSSDesignToken(token)) { + const parent = this.parent; + const reflecting = this.isReflecting(token); + if (parent) { + const parentValue = parent.get(token); + const sourceValue = source.get(token); + if (parentValue !== sourceValue && !reflecting) { + this.reflectToCSS(token); + } else if (parentValue === sourceValue && reflecting) { + this.stopReflectToCSS(token); + } + } else if (!reflecting) { + this.reflectToCSS(token); + } + } + } + /** + * Checks if a token has been assigned an explicit value the node. + * @param token - the token to check. + */ + has(token) { + return this.assignedValues.has(token); + } + /** + * Gets the value of a token for a node + * @param token - The token to retrieve the value for + * @returns + */ + get(token) { + const value = this.store.get(token); + if (value !== void 0) { + return value; + } + const raw = this.getRaw(token); + if (raw !== void 0) { + this.hydrate(token, raw); + return this.get(token); + } + } + /** + * Retrieves the raw assigned value of a token from the nearest assigned node. + * @param token - The token to retrieve a raw value for + * @returns + */ + getRaw(token) { + var _a; + if (this.assignedValues.has(token)) { + return this.assignedValues.get(token); + } + return (_a = _DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); + } + /** + * Sets a token to a value for a node + * @param token - The token to set + * @param value - The value to set the token to + */ + set(token, value) { + if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { + this.tearDownBindingObserver(token); + } + this.assignedValues.set(token, value); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + this.setupBindingObserver(token, value); + } else { + this.store.set(token, value); + } + } + /** + * Deletes a token value for the node. + * @param token - The token to delete the value for + */ + delete(token) { + this.assignedValues.delete(token); + this.tearDownBindingObserver(token); + const upstream = this.getRaw(token); + if (upstream) { + this.hydrate(token, upstream); + } else { + this.store.delete(token); + } + } + /** + * Invoked when the DesignTokenNode.target is attached to the document + */ + bind() { + const parent = _DesignTokenNode.findParent(this); + if (parent) { + parent.appendChild(this); + } + for (const key of this.assignedValues.keys()) { + key.notify(this.target); + } + } + /** + * Invoked when the DesignTokenNode.target is detached from the document + */ + unbind() { + if (this.parent) { + const parent = childToParent.get(this); + parent.removeChild(this); + } + for (const token of this.bindingObservers.keys()) { + this.tearDownBindingObserver(token); + } + } + /** + * Appends a child to a parent DesignTokenNode. + * @param child - The child to append to the node + */ + appendChild(child) { + if (child.parent) { + childToParent.get(child).removeChild(child); + } + const reParent = this.children.filter((x) => child.contains(x)); + childToParent.set(child, this); + this.children.push(child); + reParent.forEach((x) => child.appendChild(x)); + Observable.getNotifier(this.store).subscribe(child); + for (const [token, value] of this.store.all()) { + child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); + child.updateCSSTokenReflection(child.store, token); + } + } + /** + * Removes a child from a node. + * @param child - The child to remove. + */ + removeChild(child) { + const childIndex = this.children.indexOf(child); + if (childIndex !== -1) { + this.children.splice(childIndex, 1); + } + Observable.getNotifier(this.store).unsubscribe(child); + if (child.parent !== this) { + return false; + } + const deleted = childToParent.delete(child); + for (const [token] of this.store.all()) { + child.hydrate(token, child.getRaw(token)); + child.updateCSSTokenReflection(child.store, token); + } + return deleted; + } + /** + * Tests whether a provided node is contained by + * the calling node. + * @param test - The node to test + */ + contains(test) { + return composedContains(this.target, test.target); + } + /** + * Instructs the node to reflect a design token for the provided token. + * @param token - The design token to reflect + */ + reflectToCSS(token) { + if (!this.isReflecting(token)) { + this.reflecting.add(token); + _DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); + } + } + /** + * Stops reflecting a DesignToken to CSS + * @param token - The design token to stop reflecting + */ + stopReflectToCSS(token) { + if (this.isReflecting(token)) { + this.reflecting.delete(token); + _DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); + } + } + /** + * Determines if a token is being reflected to CSS for a node. + * @param token - The token to check for reflection + * @returns + */ + isReflecting(token) { + return this.reflecting.has(token); + } + /** + * Handle changes to upstream tokens + * @param source - The parent DesignTokenNode + * @param property - The token ID that changed + */ + handleChange(source, property) { + const token = DesignTokenImpl.getTokenById(property); + if (!token) { + return; + } + this.hydrate(token, this.getRaw(token)); + this.updateCSSTokenReflection(this.store, token); + } + /** + * Hydrates a token with a DesignTokenValue, making retrieval available. + * @param token - The token to hydrate + * @param value - The value to hydrate + */ + hydrate(token, value) { + if (!this.has(token)) { + const observer = this.bindingObservers.get(token); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + if (observer) { + if (observer.source !== value) { + this.tearDownBindingObserver(token); + this.setupBindingObserver(token, value); + } + } else { + this.setupBindingObserver(token, value); + } + } else { + if (observer) { + this.tearDownBindingObserver(token); + } + this.store.set(token, value); + } + } + } + /** + * Sets up a binding observer for a derived token value that notifies token + * subscribers on change. + * + * @param token - The token to notify when the binding updates + * @param source - The binding source + */ + setupBindingObserver(token, source) { + const binding = new DesignTokenBindingObserver(source, token, this); + this.bindingObservers.set(token, binding); + return binding; + } + /** + * Tear down a binding observer for a token. + */ + tearDownBindingObserver(token) { + if (this.bindingObservers.has(token)) { + this.bindingObservers.get(token).disconnect(); + this.bindingObservers.delete(token); + return true; + } + return false; + } + }; + DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); + __decorate([ + observable + ], DesignTokenNode.prototype, "children", void 0); + DesignToken = Object.freeze({ + create, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been connected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * 3. The HTMLElement is not connected to the document when token values are set. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyConnection(element) { + if (!element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).bind(); + return true; + }, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been disconnected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyDisconnection(element) { + if (element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).unbind(); + return true; + }, + /** + * Registers and element or document as a DesignToken root. + * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via + * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all + * registered roots. + * @param target - The root to register + */ + registerRoot(target = defaultElement) { + RootStyleSheetTarget.registerRoot(target); + }, + /** + * Unregister an element or document as a DesignToken root. + * @param target - The root to deregister + */ + unregisterRoot(target = defaultElement) { + RootStyleSheetTarget.unregisterRoot(target); + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js + function extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) { + if (typeof params === "string") { + return { + name: params, + type: elementDefinitionType, + callback: elementDefinitionCallback + }; + } else { + return params; + } + } + var ElementDisambiguation, elementTypesByTag, elementTagsByType, rootDesignSystem, designSystemKey, DesignSystem, DefaultDesignSystem, ElementDefinitionEntry; + var init_design_system = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"() { + init_esm(); + init_foundation_element(); + init_di(); + init_design_token(); + init_component_presentation(); + ElementDisambiguation = Object.freeze({ + /** + * Skip defining the element but still call the provided callback passed + * to DesignSystemRegistrationContext.tryDefineElement + */ + definitionCallbackOnly: null, + /** + * Ignore the duplicate element entirely. + */ + ignoreDuplicate: /* @__PURE__ */ Symbol() + }); + elementTypesByTag = /* @__PURE__ */ new Map(); + elementTagsByType = /* @__PURE__ */ new Map(); + rootDesignSystem = null; + designSystemKey = DI.createInterface((x) => x.cachedCallback((handler) => { + if (rootDesignSystem === null) { + rootDesignSystem = new DefaultDesignSystem(null, handler); + } + return rootDesignSystem; + })); + DesignSystem = Object.freeze({ + /** + * Returns the HTML element name that the type is defined as. + * @param type - The type to lookup. + * @public + */ + tagFor(type) { + return elementTagsByType.get(type); + }, + /** + * Searches the DOM hierarchy for the design system that is responsible + * for the provided element. + * @param element - The element to locate the design system for. + * @returns The located design system. + * @public + */ + responsibleFor(element) { + const owned = element.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.findResponsibleContainer(element); + return container.get(designSystemKey); + }, + /** + * Gets the DesignSystem if one is explicitly defined on the provided element; + * otherwise creates a design system defined directly on the element. + * @param element - The element to get or create a design system for. + * @returns The design system. + * @public + */ + getOrCreate(node) { + if (!node) { + if (rootDesignSystem === null) { + rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey); + } + return rootDesignSystem; + } + const owned = node.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.getOrCreateDOMContainer(node); + if (container.has(designSystemKey, false)) { + return container.get(designSystemKey); + } else { + const system = new DefaultDesignSystem(node, container); + container.register(Registration.instance(designSystemKey, system)); + return system; + } + } + }); + DefaultDesignSystem = class { + constructor(owner, container) { + this.owner = owner; + this.container = container; + this.designTokensInitialized = false; + this.prefix = "fast"; + this.shadowRootMode = void 0; + this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly; + if (owner !== null) { + owner.$$designSystem$$ = this; + } + } + withPrefix(prefix) { + this.prefix = prefix; + return this; + } + withShadowRootMode(mode) { + this.shadowRootMode = mode; + return this; + } + withElementDisambiguation(callback) { + this.disambiguate = callback; + return this; + } + withDesignTokenRoot(root) { + this.designTokenRoot = root; + return this; + } + register(...registrations) { + const container = this.container; + const elementDefinitionEntries = []; + const disambiguate = this.disambiguate; + const shadowRootMode = this.shadowRootMode; + const context = { + elementPrefix: this.prefix, + tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) { + const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback); + const { name, callback, baseClass } = extractedParams; + let { type } = extractedParams; + let elementName = name; + let typeFoundByName = elementTypesByTag.get(elementName); + let needsDefine = true; + while (typeFoundByName) { + const result = disambiguate(elementName, type, typeFoundByName); + switch (result) { + case ElementDisambiguation.ignoreDuplicate: + return; + case ElementDisambiguation.definitionCallbackOnly: + needsDefine = false; + typeFoundByName = void 0; + break; + default: + elementName = result; + typeFoundByName = elementTypesByTag.get(elementName); + break; + } + } + if (needsDefine) { + if (elementTagsByType.has(type) || type === FoundationElement) { + type = class extends type { + }; + } + elementTypesByTag.set(elementName, type); + elementTagsByType.set(type, elementName); + if (baseClass) { + elementTagsByType.set(baseClass, elementName); + } + } + elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine)); + } + }; + if (!this.designTokensInitialized) { + this.designTokensInitialized = true; + if (this.designTokenRoot !== null) { + DesignToken.registerRoot(this.designTokenRoot); + } + } + container.registerWithContext(context, ...registrations); + for (const entry of elementDefinitionEntries) { + entry.callback(entry); + if (entry.willDefine && entry.definition !== null) { + entry.definition.define(); + } + } + return this; + } + }; + ElementDefinitionEntry = class { + constructor(container, name, type, shadowRootMode, callback, willDefine) { + this.container = container; + this.name = name; + this.type = type; + this.shadowRootMode = shadowRootMode; + this.callback = callback; + this.willDefine = willDefine; + this.definition = null; + } + definePresentation(presentation) { + ComponentPresentation.define(this.name, presentation, this.container); + } + defineElement(definition) { + this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name })); + } + tagFor(type) { + return DesignSystem.tagFor(type); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js + var init_registration_context = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js + var init_design_system2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js"() { + init_design_system(); + init_component_presentation(); + init_registration_context(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/index.js + var init_di2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/index.js"() { + init_di(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js + var init_dialog_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js"() { + } + }); + + // node_modules/tabbable/dist/index.esm.js + var candidateSelectors, candidateSelector, NoElement, matches, getRootNode, getTabindex, isInput, isHiddenInput, isDetailsWithSummary, getCheckedRadio, isTabbableRadio, isRadio, isNonTabbableRadio, isZeroArea, isHidden, isDisabledFromFieldset, isNodeMatchingSelectorFocusable, isNodeMatchingSelectorTabbable, isTabbable, focusableCandidateSelector, isFocusable; + var init_index_esm = __esm({ + "node_modules/tabbable/dist/index.esm.js"() { + candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + NoElement = typeof Element === "undefined"; + matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; + }; + getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } + }; + isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot2 = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot2 === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot2(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js + var Dialog; + var init_dialog = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + Dialog = class _Dialog extends FoundationElement { + constructor() { + super(...arguments); + this.modal = true; + this.hidden = false; + this.trapFocus = true; + this.trapFocusChanged = () => { + if (this.$fastController.isConnected) { + this.updateTrapFocus(); + } + }; + this.isTrappingFocus = false; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && !this.hidden) { + switch (e.key) { + case keyEscape: + this.dismiss(); + e.preventDefault(); + break; + case keyTab: + this.handleTabKeyDown(e); + break; + } + } + }; + this.handleDocumentFocus = (e) => { + if (!e.defaultPrevented && this.shouldForceFocus(e.target)) { + this.focusFirstElement(); + e.preventDefault(); + } + }; + this.handleTabKeyDown = (e) => { + if (!this.trapFocus || this.hidden) { + return; + } + const bounds = this.getTabQueueBounds(); + if (bounds.length === 0) { + return; + } + if (bounds.length === 1) { + bounds[0].focus(); + e.preventDefault(); + return; + } + if (e.shiftKey && e.target === bounds[0]) { + bounds[bounds.length - 1].focus(); + e.preventDefault(); + } else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) { + bounds[0].focus(); + e.preventDefault(); + } + return; + }; + this.getTabQueueBounds = () => { + const bounds = []; + return _Dialog.reduceTabbableItems(bounds, this); + }; + this.focusFirstElement = () => { + const bounds = this.getTabQueueBounds(); + if (bounds.length > 0) { + bounds[0].focus(); + } else { + if (this.dialog instanceof HTMLElement) { + this.dialog.focus(); + } + } + }; + this.shouldForceFocus = (currentFocusElement) => { + return this.isTrappingFocus && !this.contains(currentFocusElement); + }; + this.shouldTrapFocus = () => { + return this.trapFocus && !this.hidden; + }; + this.updateTrapFocus = (shouldTrapFocusOverride) => { + const shouldTrapFocus = shouldTrapFocusOverride === void 0 ? this.shouldTrapFocus() : shouldTrapFocusOverride; + if (shouldTrapFocus && !this.isTrappingFocus) { + this.isTrappingFocus = true; + document.addEventListener("focusin", this.handleDocumentFocus); + DOM.queueUpdate(() => { + if (this.shouldForceFocus(document.activeElement)) { + this.focusFirstElement(); + } + }); + } else if (!shouldTrapFocus && this.isTrappingFocus) { + this.isTrappingFocus = false; + document.removeEventListener("focusin", this.handleDocumentFocus); + } + }; + } + /** + * @internal + */ + dismiss() { + this.$emit("dismiss"); + this.$emit("cancel"); + } + /** + * The method to show the dialog. + * + * @public + */ + show() { + this.hidden = false; + } + /** + * The method to hide the dialog. + * + * @public + */ + hide() { + this.hidden = true; + this.$emit("close"); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + document.addEventListener("keydown", this.handleDocumentKeydown); + this.notifier = Observable.getNotifier(this); + this.notifier.subscribe(this, "hidden"); + this.updateTrapFocus(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.updateTrapFocus(false); + this.notifier.unsubscribe(this, "hidden"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "hidden": + this.updateTrapFocus(); + break; + default: + break; + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceTabbableItems(elements2, element) { + if (element.getAttribute("tabindex") === "-1") { + return elements2; + } + if (isTabbable(element) || _Dialog.isFocusableFastElement(element) && _Dialog.hasTabbableShadow(element)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Dialog.reduceTabbableItems, [])); + } + return elements2; + } + /** + * Test if element is focusable fast element + * + * @param element - The element to check + * + * @internal + */ + static isFocusableFastElement(element) { + var _a, _b; + return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus); + } + /** + * Test if the element has a focusable shadow + * + * @param element - The element to check + * + * @internal + */ + static hasTabbableShadow(element) { + var _a, _b; + return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("*")) !== null && _b !== void 0 ? _b : []).some((x) => { + return isTabbable(x); + }); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "modal", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "hidden", void 0); + __decorate([ + attr({ attribute: "trap-focus", mode: "boolean" }) + ], Dialog.prototype, "trapFocus", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], Dialog.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], Dialog.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], Dialog.prototype, "ariaLabel", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js + var init_dialog2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js"() { + init_dialog_template(); + init_dialog(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js + var init_disclosure_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js + var Disclosure; + var init_disclosure = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Disclosure = class extends FoundationElement { + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.setup(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.details.removeEventListener("toggle", this.onToggle); + } + /** + * Show extra content. + */ + show() { + this.details.open = true; + } + /** + * Hide extra content. + */ + hide() { + this.details.open = false; + } + /** + * Toggle the current(expanded/collapsed) state. + */ + toggle() { + this.details.open = !this.details.open; + } + /** + * Register listener and set default disclosure mode + */ + setup() { + this.onToggle = this.onToggle.bind(this); + this.details.addEventListener("toggle", this.onToggle); + if (this.expanded) { + this.show(); + } + } + /** + * Update the aria attr and fire `toggle` event + */ + onToggle() { + this.expanded = this.details.open; + this.$emit("toggle"); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Disclosure.prototype, "expanded", void 0); + __decorate([ + attr + ], Disclosure.prototype, "title", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js + var init_disclosure2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js"() { + init_disclosure_template(); + init_disclosure(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js + var dividerTemplate; + var init_divider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js"() { + init_esm(); + dividerTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js + var DividerRole; + var init_divider_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js"() { + DividerRole = { + /** + * The divider semantically separates content + */ + separator: "separator", + /** + * The divider has no semantic value and is for visual presentation only. + */ + presentation: "presentation" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js + var Divider; + var init_divider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_divider_options(); + Divider = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = DividerRole.separator; + this.orientation = Orientation.horizontal; + } + }; + __decorate([ + attr + ], Divider.prototype, "role", void 0); + __decorate([ + attr + ], Divider.prototype, "orientation", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js + var init_divider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js"() { + init_divider_template(); + init_divider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js + var FlipperDirection; + var init_flipper_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js"() { + FlipperDirection = { + next: "next", + previous: "previous" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js + var init_flipper_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js + var Flipper; + var init_flipper = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_flipper_options(); + Flipper = class extends FoundationElement { + constructor() { + super(...arguments); + this.hiddenFromAT = true; + this.direction = FlipperDirection.next; + } + /** + * Simulate a click event when the flipper has focus and the user hits enter or space keys + * Blur focus if the user hits escape key + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + if (!this.hiddenFromAT) { + const key = e.key; + if (key === "Enter" || key === "Space") { + this.$emit("click", e); + } + if (key === "Escape") { + this.blur(); + } + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Flipper.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "aria-hidden", converter: booleanConverter }) + ], Flipper.prototype, "hiddenFromAT", void 0); + __decorate([ + attr + ], Flipper.prototype, "direction", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js + var init_flipper2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js"() { + init_flipper_template(); + init_flipper(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js + var init_form_associated2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js"() { + init_form_associated(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js + var init_foundation_element2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js"() { + init_foundation_element(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js + var listboxOptionTemplate; + var init_listbox_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js"() { + init_esm(); + init_start_end(); + listboxOptionTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js + var init_listbox_option2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js"() { + init_listbox_option(); + init_listbox_option_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js + var ListboxElement; + var init_listbox_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + ListboxElement = class extends Listbox { + constructor() { + super(...arguments); + this.activeIndex = -1; + this.rangeStartIndex = -1; + } + /** + * Returns the last checked option. + * + * @internal + */ + get activeOption() { + return this.options[this.activeIndex]; + } + /** + * Returns the list of checked options. + * + * @internal + */ + get checkedOptions() { + var _a; + return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((o) => o.checked); + } + /** + * Returns the index of the first selected option. + * + * @internal + */ + get firstSelectedOptionIndex() { + return this.options.indexOf(this.firstSelectedOption); + } + /** + * Updates the `ariaActiveDescendant` property when the active index changes. + * + * @param prev - the previous active index + * @param next - the next active index + * + * @internal + */ + activeIndexChanged(prev, next) { + var _a, _b; + this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; + this.focusAndScrollOptionIntoView(); + } + /** + * Toggles the checked state for the currently active option. + * + * @remarks + * Multiple-selection mode only. + * + * @internal + */ + checkActiveIndex() { + if (!this.multiple) { + return; + } + const activeItem = this.activeOption; + if (activeItem) { + activeItem.checked = true; + } + } + /** + * Sets the active index to the first option and marks it as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkFirstOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex + 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and sets the matching option as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkLastOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.options.length); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = this.options.length - 1; + this.checkActiveIndex(); + } + /** + * @override + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("focusout", this.focusoutHandler); + } + /** + * @override + * @internal + */ + disconnectedCallback() { + this.removeEventListener("focusout", this.focusoutHandler); + super.disconnectedCallback(); + } + /** + * Increments the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkNextOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.activeIndex + 1); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkPreviousOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + if (this.checkedOptions.length === 1) { + this.rangeStartIndex += 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.activeIndex, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex -= this.activeIndex > 0 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Handles click events for listbox options. + * + * @param e - the event object + * + * @override + * @internal + */ + clickHandler(e) { + var _a; + if (!this.multiple) { + return super.clickHandler(e); + } + const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`); + if (!captured || captured.disabled) { + return; + } + this.uncheckAllOptions(); + this.activeIndex = this.options.indexOf(captured); + this.checkActiveIndex(); + this.toggleSelectedForAllCheckedOptions(); + return true; + } + /** + * @override + * @internal + */ + focusAndScrollOptionIntoView() { + super.focusAndScrollOptionIntoView(this.activeOption); + } + /** + * In multiple-selection mode: + * If any options are selected, the first selected option is checked when + * the listbox receives focus. If no options are selected, the first + * selectable option is checked. + * + * @override + * @internal + */ + focusinHandler(e) { + if (!this.multiple) { + return super.focusinHandler(e); + } + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.uncheckAllOptions(); + if (this.activeIndex === -1) { + this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0; + } + this.checkActiveIndex(); + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Unchecks all options when the listbox loses focus. + * + * @internal + */ + focusoutHandler(e) { + if (this.multiple) { + this.uncheckAllOptions(); + } + } + /** + * Handles keydown actions for listbox navigation and typeahead + * + * @override + * @internal + */ + keydownHandler(e) { + if (!this.multiple) { + return super.keydownHandler(e); + } + if (this.disabled) { + return true; + } + const { key, shiftKey } = e; + this.shouldSkipFocus = false; + switch (key) { + // Select the first available option + case keyHome: { + this.checkFirstOption(shiftKey); + return; + } + // Select the next selectable option + case keyArrowDown: { + this.checkNextOption(shiftKey); + return; + } + // Select the previous selectable option + case keyArrowUp: { + this.checkPreviousOption(shiftKey); + return; + } + // Select the last available option + case keyEnd: { + this.checkLastOption(shiftKey); + return; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEscape: { + this.uncheckAllOptions(); + this.checkActiveIndex(); + return true; + } + case keySpace: { + e.preventDefault(); + if (this.typeAheadExpired) { + this.toggleSelectedForAllCheckedOptions(); + return; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @override + * @internal + */ + mousedownHandler(e) { + if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) { + return super.mousedownHandler(e); + } + } + /** + * Switches between single-selection and multi-selection mode. + * + * @internal + */ + multipleChanged(prev, next) { + var _a; + this.ariaMultiSelectable = next ? "true" : null; + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + o.checked = next ? false : void 0; + }); + this.setSelectedOptions(); + } + /** + * Sets an option as selected and gives it focus. + * + * @override + * @public + */ + setSelectedOptions() { + if (!this.multiple) { + super.setSelectedOptions(); + return; + } + if (this.$fastController.isConnected && this.options) { + this.selectedOptions = this.options.filter((o) => o.selected); + this.focusAndScrollOptionIntoView(); + } + } + /** + * Ensures the size is a positive integer when the property is updated. + * + * @param prev - the previous size value + * @param next - the current size value + * + * @internal + */ + sizeChanged(prev, next) { + var _a; + const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10)); + if (size !== next) { + DOM.queueUpdate(() => { + this.size = size; + }); + } + } + /** + * Toggles the selected state of the provided options. If any provided items + * are in an unselected state, all items are set to selected. If every + * provided item is selected, they are all unselected. + * + * @internal + */ + toggleSelectedForAllCheckedOptions() { + const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled); + const force = !enabledCheckedOptions.every((o) => o.selected); + enabledCheckedOptions.forEach((o) => o.selected = force); + this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]); + this.setSelectedOptions(); + } + /** + * @override + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (!this.multiple) { + super.typeaheadBufferChanged(prev, next); + return; + } + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + const activeIndex = this.options.indexOf(typeaheadMatches[0]); + if (activeIndex > -1) { + this.activeIndex = activeIndex; + this.uncheckAllOptions(); + this.checkActiveIndex(); + } + this.typeAheadExpired = false; + } + } + /** + * Unchecks all options. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - reset the rangeStartIndex + * + * @internal + */ + uncheckAllOptions(preserveChecked = false) { + this.options.forEach((o) => o.checked = this.multiple ? false : void 0); + if (!preserveChecked) { + this.rangeStartIndex = -1; + } + } + }; + __decorate([ + observable + ], ListboxElement.prototype, "activeIndex", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxElement.prototype, "multiple", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], ListboxElement.prototype, "size", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js + var init_listbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js + var init_listbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js"() { + init_listbox(); + init_listbox_element(); + init_listbox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js + var PickerMenu; + var init_picker_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js"() { + init_tslib_es6(); + init_dist2(); + init_esm(); + init_foundation_element(); + PickerMenu = class extends FoundationElement { + constructor() { + super(...arguments); + this.optionElements = []; + } + menuElementsChanged() { + this.updateOptions(); + } + headerElementsChanged() { + this.updateOptions(); + } + footerElementsChanged() { + this.updateOptions(); + } + updateOptions() { + this.optionElements.splice(0, this.optionElements.length); + this.addSlottedListItems(this.headerElements); + this.addSlottedListItems(this.menuElements); + this.addSlottedListItems(this.footerElements); + this.$emit("optionsupdated", { bubbles: false }); + } + addSlottedListItems(slotChildren) { + if (slotChildren === void 0) { + return; + } + slotChildren.forEach((child) => { + if (child.nodeType === 1 && child.getAttribute("role") === "listitem") { + child.id = child.id || uniqueId("option-"); + this.optionElements.push(child); + } + }); + } + }; + __decorate([ + observable + ], PickerMenu.prototype, "menuElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "headerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "footerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "suggestionsAvailableText", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js + var defaultContentsTemplate, PickerMenuOption; + var init_picker_menu_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + defaultContentsTemplate = html` + +`; + PickerMenuOption = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.disconnectView(); + } + handleClick(e) { + if (e.defaultPrevented) { + return false; + } + this.handleInvoked(); + return false; + } + handleInvoked() { + this.$emit("pickeroptioninvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerMenuOption.prototype, "value", void 0); + __decorate([ + observable + ], PickerMenuOption.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js + var init_picker_list = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js + var defaultContentsTemplate2, PickerListItem; + var init_picker_list_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + defaultContentsTemplate2 = html` + +`; + PickerListItem = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + this.disconnectView(); + super.disconnectedCallback(); + } + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + if (e.key === keyEnter) { + this.handleInvoke(); + return false; + } + return true; + } + handleClick(e) { + if (!e.defaultPrevented) { + this.handleInvoke(); + } + return false; + } + handleInvoke() { + this.$emit("pickeriteminvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate2.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerListItem.prototype, "value", void 0); + __decorate([ + observable + ], PickerListItem.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js + var init_picker_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js + var _Picker, FormAssociatedPicker; + var init_picker_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Picker = class extends FoundationElement { + }; + FormAssociatedPicker = class extends FormAssociated(_Picker) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js + var pickerInputTemplate, Picker; + var init_picker = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_anchored_region2(); + init_picker_menu_option(); + init_picker_list_item(); + init_picker_form_associated(); + pickerInputTemplate = html` + +`; + Picker = class extends FormAssociatedPicker { + constructor() { + super(...arguments); + this.selection = ""; + this.filterSelected = true; + this.filterQuery = true; + this.noSuggestionsText = "No suggestions available"; + this.suggestionsAvailableText = "Suggestions available"; + this.loadingText = "Loading suggestions"; + this.menuPlacement = "bottom-fill"; + this.showLoading = false; + this.optionsList = []; + this.filteredOptionsList = []; + this.flyoutOpen = false; + this.menuFocusIndex = -1; + this.showNoOptions = false; + this.selectedItems = []; + this.inputElementView = null; + this.handleTextInput = (e) => { + this.query = this.inputElement.value; + }; + this.handleInputClick = (e) => { + e.preventDefault(); + this.toggleFlyout(true); + }; + this.setRegionProps = () => { + if (!this.flyoutOpen) { + return; + } + if (this.region === null || this.region === void 0) { + DOM.queueUpdate(this.setRegionProps); + return; + } + this.region.anchorElement = this.inputElement; + }; + this.configLookup = { + top: FlyoutPosTop, + bottom: FlyoutPosBottom, + tallest: FlyoutPosTallest, + "top-fill": FlyoutPosTopFill, + "bottom-fill": FlyoutPosBottomFill, + "tallest-fill": FlyoutPosTallestFill + }; + } + selectionChanged() { + if (this.$fastController.isConnected) { + this.handleSelectionChange(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.value = this.selection; + this.validate(); + } + } + } + optionsChanged() { + this.optionsList = this.options.split(",").map((opt) => opt.trim()).filter((opt) => opt !== ""); + } + menuPlacementChanged() { + if (this.$fastController.isConnected) { + this.updateMenuConfig(); + } + } + showLoadingChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + listItemTemplateChanged() { + this.updateListItemTemplate(); + } + defaultListItemTemplateChanged() { + this.updateListItemTemplate(); + } + menuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + defaultMenuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + optionsListChanged() { + this.updateFilteredOptions(); + } + queryChanged() { + if (this.$fastController.isConnected) { + if (this.inputElement.value !== this.query) { + this.inputElement.value = this.query; + } + this.updateFilteredOptions(); + this.$emit("querychange", { bubbles: false }); + } + } + filteredOptionsListChanged() { + if (this.$fastController.isConnected) { + this.showNoOptions = this.filteredOptionsList.length === 0 && this.menuElement.querySelectorAll('[role="listitem"]').length === 0; + this.setFocusedOption(this.showNoOptions ? -1 : 0); + } + } + flyoutOpenChanged() { + if (this.flyoutOpen) { + DOM.queueUpdate(this.setRegionProps); + this.$emit("menuopening", { bubbles: false }); + } else { + this.$emit("menuclosing", { bubbles: false }); + } + } + showNoOptionsChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.listElement = document.createElement(this.selectedListTag); + this.appendChild(this.listElement); + this.itemsPlaceholderElement = document.createComment(""); + this.listElement.append(this.itemsPlaceholderElement); + this.inputElementView = pickerInputTemplate.render(this, this.listElement); + const match = this.menuTag.toUpperCase(); + this.menuElement = Array.from(this.children).find((element) => { + return element.tagName === match; + }); + if (this.menuElement === void 0) { + this.menuElement = document.createElement(this.menuTag); + this.appendChild(this.menuElement); + } + if (this.menuElement.id === "") { + this.menuElement.id = uniqueId("listbox-"); + } + this.menuId = this.menuElement.id; + this.optionsPlaceholder = document.createComment(""); + this.menuElement.append(this.optionsPlaceholder); + this.updateMenuConfig(); + DOM.queueUpdate(() => this.initialize()); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.toggleFlyout(false); + this.inputElement.removeEventListener("input", this.handleTextInput); + this.inputElement.removeEventListener("click", this.handleInputClick); + if (this.inputElementView !== null) { + this.inputElementView.dispose(); + this.inputElementView = null; + } + } + /** + * Move focus to the input element + * @public + */ + focus() { + this.inputElement.focus(); + } + /** + * Initialize the component. This is delayed a frame to ensure children are connected as well. + */ + initialize() { + this.updateListItemTemplate(); + this.updateOptionTemplate(); + this.itemsRepeatBehavior = new RepeatDirective((x) => x.selectedItems, (x) => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement); + this.inputElement.addEventListener("input", this.handleTextInput); + this.inputElement.addEventListener("click", this.handleInputClick); + this.$fastController.addBehaviors([this.itemsRepeatBehavior]); + this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText; + this.menuElement.addEventListener("optionsupdated", this.handleMenuOptionsUpdated); + this.optionsRepeatBehavior = new RepeatDirective((x) => x.filteredOptionsList, (x) => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder); + this.$fastController.addBehaviors([this.optionsRepeatBehavior]); + this.handleSelectionChange(); + } + /** + * Toggles the menu flyout + */ + toggleFlyout(open) { + if (this.flyoutOpen === open) { + return; + } + if (open && document.activeElement === this.inputElement) { + this.flyoutOpen = open; + DOM.queueUpdate(() => { + if (this.menuElement !== void 0) { + this.setFocusedOption(0); + } else { + this.disableMenu(); + } + }); + return; + } + this.flyoutOpen = false; + this.disableMenu(); + return; + } + /** + * Handle the menu options updated event from the child menu + */ + handleMenuOptionsUpdated(e) { + e.preventDefault(); + if (this.flyoutOpen) { + this.setFocusedOption(0); + } + } + /** + * Handle key down events. + */ + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + // TODO: what should "home" and "end" keys do, exactly? + // + // case keyHome: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.setFocusedOption(0); + // } + // } + // return false; + // } + // case keyEnd: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.toggleFlyout(true); + // this.setFocusedOption(this.menuElement.optionElements.length - 1); + // } + // } + // return false; + // } + case keyArrowDown: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const nextFocusOptionIndex = this.flyoutOpen ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1) : 0; + this.setFocusedOption(nextFocusOptionIndex); + } + return false; + } + case keyArrowUp: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const previousFocusOptionIndex = this.flyoutOpen ? Math.max(this.menuFocusIndex - 1, 0) : 0; + this.setFocusedOption(previousFocusOptionIndex); + } + return false; + } + case keyEscape: { + this.toggleFlyout(false); + return false; + } + case keyEnter: { + if (this.menuFocusIndex !== -1 && this.menuElement.optionElements.length > this.menuFocusIndex) { + this.menuElement.optionElements[this.menuFocusIndex].click(); + } + return false; + } + case keyArrowRight: { + if (document.activeElement !== this.inputElement) { + this.incrementFocusedItem(1); + return false; + } + return true; + } + case keyArrowLeft: { + if (this.inputElement.selectionStart === 0) { + this.incrementFocusedItem(-1); + return false; + } + return true; + } + case keyDelete: + case keyBackspace: { + if (document.activeElement === null) { + return true; + } + if (document.activeElement === this.inputElement) { + if (this.inputElement.selectionStart === 0) { + this.selection = this.selectedItems.slice(0, this.selectedItems.length - 1).toString(); + this.toggleFlyout(false); + return false; + } + return true; + } + const selectedItems = Array.from(this.listElement.children); + const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement); + if (currentFocusedItemIndex > -1) { + this.selection = this.selectedItems.splice(currentFocusedItemIndex, 1).toString(); + DOM.queueUpdate(() => { + selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus(); + }); + return false; + } + return true; + } + } + this.toggleFlyout(true); + return true; + } + /** + * Handle focus in events. + */ + handleFocusIn(e) { + return false; + } + /** + * Handle focus out events. + */ + handleFocusOut(e) { + if (this.menuElement === void 0 || !this.menuElement.contains(e.relatedTarget)) { + this.toggleFlyout(false); + } + return false; + } + /** + * The list of selected items has changed + */ + handleSelectionChange() { + if (this.selectedItems.toString() === this.selection) { + return; + } + this.selectedItems = this.selection === "" ? [] : this.selection.split(","); + this.updateFilteredOptions(); + DOM.queueUpdate(() => { + this.checkMaxItems(); + }); + this.$emit("selectionchange", { bubbles: false }); + } + /** + * Anchored region is loaded, menu and options exist in the DOM. + */ + handleRegionLoaded(e) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + this.$emit("menuloaded", { bubbles: false }); + }); + } + /** + * Checks if the maximum number of items has been chosen and updates the ui. + */ + checkMaxItems() { + if (this.inputElement === void 0) { + return; + } + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + if (document.activeElement === this.inputElement) { + const selectedItemInstances = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + selectedItemInstances[selectedItemInstances.length - 1].focus(); + } + this.inputElement.hidden = true; + } else { + this.inputElement.hidden = false; + } + } + /** + * A list item has been invoked. + */ + handleItemInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerListItem) { + const listItems = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + const itemIndex = listItems.indexOf(e.target); + if (itemIndex !== -1) { + const newSelection = this.selectedItems.slice(); + newSelection.splice(itemIndex, 1); + this.selection = newSelection.toString(); + DOM.queueUpdate(() => this.incrementFocusedItem(0)); + } + return false; + } + return true; + } + /** + * A menu option has been invoked. + */ + handleOptionInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerMenuOption) { + if (e.target.value !== void 0) { + this.selection = `${this.selection}${this.selection === "" ? "" : ","}${e.target.value}`; + } + this.inputElement.value = ""; + this.query = ""; + this.inputElement.focus(); + this.toggleFlyout(false); + return false; + } + return true; + } + /** + * Increments the focused list item by the specified amount + */ + incrementFocusedItem(increment) { + if (this.selectedItems.length === 0) { + this.inputElement.focus(); + return; + } + const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + if (document.activeElement !== null) { + let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement); + if (currentFocusedItemIndex === -1) { + currentFocusedItemIndex = selectedItemsAsElements.length; + } + const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment)); + if (newFocusedItemIndex === selectedItemsAsElements.length) { + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + selectedItemsAsElements[newFocusedItemIndex - 1].focus(); + } else { + this.inputElement.focus(); + } + } else { + selectedItemsAsElements[newFocusedItemIndex].focus(); + } + } + } + /** + * Disables the menu. Note that the menu can be open, just doens't have any valid options on display. + */ + disableMenu() { + var _a, _b, _c; + this.menuFocusIndex = -1; + this.menuFocusOptionId = void 0; + (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant"); + (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns"); + (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded"); + } + /** + * Sets the currently focused menu option by index + */ + setFocusedOption(optionIndex) { + if (!this.flyoutOpen || optionIndex === -1 || this.showNoOptions || this.showLoading) { + this.disableMenu(); + return; + } + if (this.menuElement.optionElements.length === 0) { + return; + } + this.menuElement.optionElements.forEach((element) => { + element.setAttribute("aria-selected", "false"); + }); + this.menuFocusIndex = optionIndex; + if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) { + this.menuFocusIndex = this.menuElement.optionElements.length - 1; + } + this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id; + this.inputElement.setAttribute("aria-owns", this.menuId); + this.inputElement.setAttribute("aria-expanded", "true"); + this.inputElement.setAttribute("aria-activedescendant", this.menuFocusOptionId); + const focusedOption = this.menuElement.optionElements[this.menuFocusIndex]; + focusedOption.setAttribute("aria-selected", "true"); + this.menuElement.scrollTo(0, focusedOption.offsetTop); + } + /** + * Updates the template used for the list item repeat behavior + */ + updateListItemTemplate() { + var _a; + this.activeListItemTemplate = (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate; + } + /** + * Updates the template used for the menu option repeat behavior + */ + updateOptionTemplate() { + var _a; + this.activeMenuOptionTemplate = (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate; + } + /** + * Updates the filtered options array + */ + updateFilteredOptions() { + this.filteredOptionsList = this.optionsList.slice(0); + if (this.filterSelected) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => this.selectedItems.indexOf(el2) === -1); + } + if (this.filterQuery && this.query !== "" && this.query !== void 0) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => el2.indexOf(this.query) !== -1); + } + } + /** + * Updates the menu configuration + */ + updateMenuConfig() { + let newConfig = this.configLookup[this.menuPlacement]; + if (newConfig === null) { + newConfig = FlyoutPosBottomFill; + } + this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false }); + } + }; + __decorate([ + attr({ attribute: "selection" }) + ], Picker.prototype, "selection", void 0); + __decorate([ + attr({ attribute: "options" }) + ], Picker.prototype, "options", void 0); + __decorate([ + attr({ attribute: "filter-selected", mode: "boolean" }) + ], Picker.prototype, "filterSelected", void 0); + __decorate([ + attr({ attribute: "filter-query", mode: "boolean" }) + ], Picker.prototype, "filterQuery", void 0); + __decorate([ + attr({ attribute: "max-selected" }) + ], Picker.prototype, "maxSelected", void 0); + __decorate([ + attr({ attribute: "no-suggestions-text" }) + ], Picker.prototype, "noSuggestionsText", void 0); + __decorate([ + attr({ attribute: "suggestions-available-text" }) + ], Picker.prototype, "suggestionsAvailableText", void 0); + __decorate([ + attr({ attribute: "loading-text" }) + ], Picker.prototype, "loadingText", void 0); + __decorate([ + attr({ attribute: "label" }) + ], Picker.prototype, "label", void 0); + __decorate([ + attr({ attribute: "labelledby" }) + ], Picker.prototype, "labelledBy", void 0); + __decorate([ + attr({ attribute: "placeholder" }) + ], Picker.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "menu-placement" }) + ], Picker.prototype, "menuPlacement", void 0); + __decorate([ + observable + ], Picker.prototype, "showLoading", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "optionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "query", void 0); + __decorate([ + observable + ], Picker.prototype, "filteredOptionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "flyoutOpen", void 0); + __decorate([ + observable + ], Picker.prototype, "menuId", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedListTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusIndex", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusOptionId", void 0); + __decorate([ + observable + ], Picker.prototype, "showNoOptions", void 0); + __decorate([ + observable + ], Picker.prototype, "menuConfig", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js + var init_picker_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js + var init_picker_menu_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js + var init_picker_list_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js + var init_picker_list_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js + var init_picker2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js"() { + init_picker_template(); + init_picker(); + init_picker_menu_template(); + init_picker_menu(); + init_picker_menu_option_template(); + init_picker_menu_option(); + init_picker_list_template(); + init_picker_list(); + init_picker_list_item_template(); + init_picker_list_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js + var MenuItemRole, roleForMenuItem; + var init_menu_item_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js"() { + MenuItemRole = { + /** + * The menu item has a "menuitem" role + */ + menuitem: "menuitem", + /** + * The menu item has a "menuitemcheckbox" role + */ + menuitemcheckbox: "menuitemcheckbox", + /** + * The menu item has a "menuitemradio" role + */ + menuitemradio: "menuitemradio" + }; + roleForMenuItem = { + [MenuItemRole.menuitem]: "menuitem", + [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox", + [MenuItemRole.menuitemradio]: "menuitemradio" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js + var MenuItem; + var init_menu_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_start_end(); + init_direction(); + init_apply_mixins(); + init_menu_item_options(); + MenuItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = MenuItemRole.menuitem; + this.hasSubmenu = false; + this.currentDirection = Direction.ltr; + this.focusSubmenuOnLoad = false; + this.handleMenuItemKeyDown = (e) => { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.invoke(); + return false; + case keyArrowRight: + this.expandAndFocus(); + return false; + case keyArrowLeft: + if (this.expanded) { + this.expanded = false; + this.focus(); + return false; + } + } + return true; + }; + this.handleMenuItemClick = (e) => { + if (e.defaultPrevented || this.disabled) { + return false; + } + this.invoke(); + return false; + }; + this.submenuLoaded = () => { + if (!this.focusSubmenuOnLoad) { + return; + } + this.focusSubmenuOnLoad = false; + if (this.hasSubmenu) { + this.submenu.focus(); + this.setAttribute("tabindex", "-1"); + } + }; + this.handleMouseOver = (e) => { + if (this.disabled || !this.hasSubmenu || this.expanded) { + return false; + } + this.expanded = true; + return false; + }; + this.handleMouseOut = (e) => { + if (!this.expanded || this.contains(document.activeElement)) { + return false; + } + this.expanded = false; + return false; + }; + this.expandAndFocus = () => { + if (!this.hasSubmenu) { + return; + } + this.focusSubmenuOnLoad = true; + this.expanded = true; + }; + this.invoke = () => { + if (this.disabled) { + return; + } + switch (this.role) { + case MenuItemRole.menuitemcheckbox: + this.checked = !this.checked; + break; + case MenuItemRole.menuitem: + this.updateSubmenu(); + if (this.hasSubmenu) { + this.expandAndFocus(); + } else { + this.$emit("change"); + } + break; + case MenuItemRole.menuitemradio: + if (!this.checked) { + this.checked = true; + } + break; + } + }; + this.updateSubmenu = () => { + this.submenu = this.domChildren().find((element) => { + return element.getAttribute("role") === "menu"; + }); + this.hasSubmenu = this.submenu === void 0 ? false : true; + }; + } + expandedChanged(oldValue) { + if (this.$fastController.isConnected) { + if (this.submenu === void 0) { + return; + } + if (this.expanded === false) { + this.submenu.collapseExpandedItem(); + } else { + this.currentDirection = getDirection(this); + } + this.$emit("expanded-change", this, { bubbles: false }); + } + } + checkedChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.$emit("change"); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.updateSubmenu(); + }); + if (!this.startColumnCount) { + this.startColumnCount = 1; + } + this.observer = new MutationObserver(this.updateSubmenu); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.submenu = void 0; + if (this.observer !== void 0) { + this.observer.disconnect(); + this.observer = void 0; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "disabled", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "expanded", void 0); + __decorate([ + observable + ], MenuItem.prototype, "startColumnCount", void 0); + __decorate([ + attr + ], MenuItem.prototype, "role", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "checked", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenuRegion", void 0); + __decorate([ + observable + ], MenuItem.prototype, "hasSubmenu", void 0); + __decorate([ + observable + ], MenuItem.prototype, "currentDirection", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenu", void 0); + applyMixins(MenuItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js + var init_menu_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js + var init_menu_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js"() { + init_menu_item_template(); + init_menu_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js + var init_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js + var Menu; + var init_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_menu_item2(); + init_foundation_element(); + Menu = class _Menu extends FoundationElement { + constructor() { + super(...arguments); + this.expandedItem = null; + this.focusIndex = -1; + this.isNestedMenu = () => { + return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem"; + }; + this.handleFocusOut = (e) => { + if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) { + this.collapseExpandedItem(); + const focusIndex = this.menuItems.findIndex(this.isFocusableElement); + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.menuItems[focusIndex].setAttribute("tabindex", "0"); + this.focusIndex = focusIndex; + } + }; + this.handleItemFocus = (e) => { + const targetItem = e.target; + if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.focusIndex = this.menuItems.indexOf(targetItem); + targetItem.setAttribute("tabindex", "0"); + } + }; + this.handleExpandedChanged = (e) => { + if (e.defaultPrevented || e.target === null || this.menuItems === void 0 || this.menuItems.indexOf(e.target) < 0) { + return; + } + e.preventDefault(); + const changedItem = e.target; + if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) { + this.expandedItem = null; + return; + } + if (changedItem.expanded) { + if (this.expandedItem !== null && this.expandedItem !== changedItem) { + this.expandedItem.expanded = false; + } + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.expandedItem = changedItem; + this.focusIndex = this.menuItems.indexOf(changedItem); + changedItem.setAttribute("tabindex", "0"); + } + }; + this.removeItemListeners = () => { + if (this.menuItems !== void 0) { + this.menuItems.forEach((item) => { + item.removeEventListener("expanded-change", this.handleExpandedChanged); + item.removeEventListener("focus", this.handleItemFocus); + }); + } + }; + this.setItems = () => { + const newItems = this.domChildren(); + this.removeItemListeners(); + this.menuItems = newItems; + const menuItems = this.menuItems.filter(this.isMenuItemElement); + if (menuItems.length) { + this.focusIndex = 0; + } + function elementIndent(el2) { + const role = el2.getAttribute("role"); + const startSlot = el2.querySelector("[slot=start]"); + if (role !== MenuItemRole.menuitem && startSlot === null) { + return 1; + } else if (role === MenuItemRole.menuitem && startSlot !== null) { + return 1; + } else if (role !== MenuItemRole.menuitem && startSlot !== null) { + return 2; + } else { + return 0; + } + } + const indent = menuItems.reduce((accum, current) => { + const elementValue = elementIndent(current); + return accum > elementValue ? accum : elementValue; + }, 0); + menuItems.forEach((item, index) => { + item.setAttribute("tabindex", index === 0 ? "0" : "-1"); + item.addEventListener("expanded-change", this.handleExpandedChanged); + item.addEventListener("focus", this.handleItemFocus); + if (item instanceof MenuItem || "startColumnCount" in item) { + item.startColumnCount = indent; + } + }); + }; + this.changeHandler = (e) => { + if (this.menuItems === void 0) { + return; + } + const changedMenuItem = e.target; + const changeItemIndex = this.menuItems.indexOf(changedMenuItem); + if (changeItemIndex === -1) { + return; + } + if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) { + for (let i = changeItemIndex - 1; i >= 0; --i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + const maxIndex = this.menuItems.length - 1; + for (let i = changeItemIndex + 1; i <= maxIndex; ++i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + } + }; + this.isMenuItemElement = (el2) => { + return isHTMLElement(el2) && _Menu.focusableElementRoles.hasOwnProperty(el2.getAttribute("role")); + }; + this.isFocusableElement = (el2) => { + return this.isMenuItemElement(el2); + }; + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.menuItems !== void 0) { + this.setItems(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.setItems(); + }); + this.addEventListener("change", this.changeHandler); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeItemListeners(); + this.menuItems = void 0; + this.removeEventListener("change", this.changeHandler); + } + /** + * Focuses the first item in the menu. + * + * @public + */ + focus() { + this.setFocus(0, 1); + } + /** + * Collapses any expanded menu items. + * + * @public + */ + collapseExpandedItem() { + if (this.expandedItem !== null) { + this.expandedItem.expanded = false; + this.expandedItem = null; + } + } + /** + * @internal + */ + handleMenuKeyDown(e) { + if (e.defaultPrevented || this.menuItems === void 0) { + return; + } + switch (e.key) { + case keyArrowDown: + this.setFocus(this.focusIndex + 1, 1); + return; + case keyArrowUp: + this.setFocus(this.focusIndex - 1, -1); + return; + case keyEnd: + this.setFocus(this.menuItems.length - 1, -1); + return; + case keyHome: + this.setFocus(0, 1); + return; + default: + return true; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + setFocus(focusIndex, adjustment) { + if (this.menuItems === void 0) { + return; + } + while (focusIndex >= 0 && focusIndex < this.menuItems.length) { + const child = this.menuItems[focusIndex]; + if (this.isFocusableElement(child)) { + if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + } + this.focusIndex = focusIndex; + child.setAttribute("tabindex", "0"); + child.focus(); + break; + } + focusIndex += adjustment; + } + } + }; + Menu.focusableElementRoles = roleForMenuItem; + __decorate([ + observable + ], Menu.prototype, "items", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js + var init_menu2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js"() { + init_menu_template(); + init_menu(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js + var init_number_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js + var _TextField, FormAssociatedTextField; + var init_text_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextField = class extends FoundationElement { + }; + FormAssociatedTextField = class extends FormAssociated(_TextField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js + var TextFieldType; + var init_text_field_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js"() { + TextFieldType = { + /** + * An email TextField + */ + email: "email", + /** + * A password TextField + */ + password: "password", + /** + * A telephone TextField + */ + tel: "tel", + /** + * A text TextField + */ + text: "text", + /** + * A URL TextField + */ + url: "url" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js + var TextField, DelegatesARIATextbox; + var init_text_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_text_field_form_associated(); + init_text_field_options(); + TextField = class extends FormAssociatedTextField { + constructor() { + super(...arguments); + this.type = TextFieldType.text; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + typeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + this.validate(); + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the text field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], TextField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "autofocus", void 0); + __decorate([ + attr + ], TextField.prototype, "placeholder", void 0); + __decorate([ + attr + ], TextField.prototype, "type", void 0); + __decorate([ + attr + ], TextField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "minlength", void 0); + __decorate([ + attr + ], TextField.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextField.prototype, "defaultSlottedNodes", void 0); + DelegatesARIATextbox = class { + }; + applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties); + applyMixins(TextField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js + var _NumberField, FormAssociatedNumberField; + var init_number_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _NumberField = class extends FoundationElement { + }; + FormAssociatedNumberField = class extends FormAssociated(_NumberField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js + var NumberField; + var init_number_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_text_field(); + init_number_field_form_associated(); + NumberField = class extends FormAssociatedNumberField { + constructor() { + super(...arguments); + this.hideStep = false; + this.step = 1; + this.isUserInput = false; + } + /** + * Ensures that the max is greater than the min and that the value + * is less than the max + * @param previous - the previous max value + * @param next - updated max value + * + * @internal + */ + maxChanged(previous, next) { + var _a; + this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next); + const min = Math.min(this.min, this.max); + if (this.min !== void 0 && this.min !== min) { + this.min = min; + } + this.value = this.getValidValue(this.value); + } + /** + * Ensures that the min is less than the max and that the value + * is greater than the min + * @param previous - previous min value + * @param next - updated min value + * + * @internal + */ + minChanged(previous, next) { + var _a; + this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next); + const max = Math.max(this.min, this.max); + if (this.max !== void 0 && this.max !== max) { + this.max = max; + } + this.value = this.getValidValue(this.value); + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * Validates that the value is a number between the min and max + * @param previous - previous stored value + * @param next - value being updated + * @param updateControl - should the text field be updated with value, defaults to true + * @internal + */ + valueChanged(previous, next) { + this.value = this.getValidValue(next); + if (next !== this.value) { + return; + } + if (this.control && !this.isUserInput) { + this.control.value = this.value; + } + super.valueChanged(previous, this.value); + if (previous !== void 0 && !this.isUserInput) { + this.$emit("input"); + this.$emit("change"); + } + this.isUserInput = false; + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Sets the internal value to a valid number between the min and max properties + * @param value - user input + * + * @internal + */ + getValidValue(value) { + var _a, _b; + let validValue = parseFloat(parseFloat(value).toPrecision(12)); + if (isNaN(validValue)) { + validValue = ""; + } else { + validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue); + validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString(); + } + return validValue; + } + /** + * Increments the value using the step value + * + * @public + */ + stepUp() { + const value = parseFloat(this.value); + const stepUpValue = !isNaN(value) ? value + this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? this.step : 0; + this.value = stepUpValue.toString(); + } + /** + * Decrements the value using the step value + * + * @public + */ + stepDown() { + const value = parseFloat(this.value); + const stepDownValue = !isNaN(value) ? value - this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? 0 - this.step : 0; + this.value = stepDownValue.toString(); + } + /** + * Sets up the initial state of the number field + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "number"); + this.validate(); + this.control.value = this.value; + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the number field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, ""); + this.isUserInput = true; + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** + * Handles the internal control's `keydown` event + * @internal + */ + handleKeyDown(e) { + const key = e.key; + switch (key) { + case keyArrowUp: + this.stepUp(); + return false; + case keyArrowDown: + this.stepDown(); + return false; + } + return true; + } + /** + * Handles populating the input field with a validated value when + * leaving the input field. + * @internal + */ + handleBlur() { + this.control.value = this.value; + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], NumberField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], NumberField.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "hide-step", mode: "boolean" }) + ], NumberField.prototype, "hideStep", void 0); + __decorate([ + attr + ], NumberField.prototype, "placeholder", void 0); + __decorate([ + attr + ], NumberField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "minlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "size", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "step", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "min", void 0); + __decorate([ + observable + ], NumberField.prototype, "defaultSlottedNodes", void 0); + applyMixins(NumberField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js + var init_number_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js"() { + init_number_field_template(); + init_number_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js + var progressSegments, progressRingTemplate; + var init_progress_ring_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js"() { + init_esm(); + progressSegments = 44; + progressRingTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js + var init_progress_ring = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js"() { + init_progress_ring_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js + var BaseProgress; + var init_base_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + BaseProgress = class extends FoundationElement { + constructor() { + super(...arguments); + this.percentComplete = 0; + } + valueChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + minChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + maxChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updatePercentComplete(); + } + updatePercentComplete() { + const min = typeof this.min === "number" ? this.min : 0; + const max = typeof this.max === "number" ? this.max : 100; + const value = typeof this.value === "number" ? this.value : 0; + const range2 = max - min; + this.percentComplete = range2 === 0 ? 0 : Math.fround((value - min) / range2 * 100); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "value", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "max", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], BaseProgress.prototype, "paused", void 0); + __decorate([ + observable + ], BaseProgress.prototype, "percentComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js + var init_progress_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js + var init_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js"() { + init_base_progress(); + init_progress_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js + var radioGroupTemplate; + var init_radio_group_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js"() { + init_esm(); + init_dist2(); + radioGroupTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js + var RadioGroup; + var init_radio_group = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + RadioGroup = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = Orientation.horizontal; + this.radioChangeHandler = (e) => { + const changedRadio = e.target; + if (changedRadio.checked) { + this.slottedRadioButtons.forEach((radio) => { + if (radio !== changedRadio) { + radio.checked = false; + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + } + }); + this.selectedRadio = changedRadio; + this.value = changedRadio.value; + changedRadio.setAttribute("tabindex", "0"); + this.focusedRadio = changedRadio; + } + e.stopPropagation(); + }; + this.moveToRadioByIndex = (group, index) => { + const radio = group[index]; + if (!this.isInsideToolbar) { + radio.setAttribute("tabindex", "0"); + if (radio.readOnly) { + this.slottedRadioButtons.forEach((nextRadio) => { + if (nextRadio !== radio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + radio.checked = true; + this.selectedRadio = radio; + } + } + this.focusedRadio = radio; + radio.focus(); + }; + this.moveRightOffGroup = () => { + var _a; + (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.moveLeftOffGroup = () => { + var _a; + (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.focusOutHandler = (e) => { + const group = this.slottedRadioButtons; + const radio = e.target; + const index = radio !== null ? group.indexOf(radio) : 0; + const focusedIndex = this.focusedRadio ? group.indexOf(this.focusedRadio) : -1; + if (focusedIndex === 0 && index === focusedIndex || focusedIndex === group.length - 1 && focusedIndex === index) { + if (!this.selectedRadio) { + this.focusedRadio = group[0]; + this.focusedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.focusedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + this.focusedRadio = this.selectedRadio; + if (!this.isInsideFoundationToolbar) { + this.selectedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.selectedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } + } + } + return true; + }; + this.clickHandler = (e) => { + const radio = e.target; + if (radio) { + const group = this.slottedRadioButtons; + if (radio.checked || group.indexOf(radio) === 0) { + radio.setAttribute("tabindex", "0"); + this.selectedRadio = radio; + } else { + radio.setAttribute("tabindex", "-1"); + this.selectedRadio = null; + } + this.focusedRadio = radio; + } + e.preventDefault(); + }; + this.shouldMoveOffGroupToTheRight = (index, group, key) => { + return index === group.length && this.isInsideToolbar && key === keyArrowRight; + }; + this.shouldMoveOffGroupToTheLeft = (group, key) => { + const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + return index < 0 && this.isInsideToolbar && key === keyArrowLeft; + }; + this.checkFocusedRadio = () => { + if (this.focusedRadio !== null && !this.focusedRadio.readOnly && !this.focusedRadio.checked) { + this.focusedRadio.checked = true; + this.focusedRadio.setAttribute("tabindex", "0"); + this.focusedRadio.focus(); + this.selectedRadio = this.focusedRadio; + } + }; + this.moveRight = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1; + if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) { + this.moveRightOffGroup(); + return; + } else if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index + 1 >= group.length) { + if (this.isInsideToolbar) { + break; + } else { + index = 0; + } + } else { + index += 1; + } + } + }; + this.moveLeft = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + if (this.shouldMoveOffGroupToTheLeft(group, e.key)) { + this.moveLeftOffGroup(); + return; + } + while (index >= 0 && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.keydownHandler = (e) => { + const key = e.key; + if (key in ArrowKeys && this.isInsideFoundationToolbar) { + return true; + } + switch (key) { + case keyEnter: { + this.checkFocusedRadio(); + break; + } + case keyArrowRight: + case keyArrowDown: { + if (this.direction === Direction.ltr) { + this.moveRight(e); + } else { + this.moveLeft(e); + } + break; + } + case keyArrowLeft: + case keyArrowUp: { + if (this.direction === Direction.ltr) { + this.moveLeft(e); + } else { + this.moveRight(e); + } + break; + } + default: { + return true; + } + } + }; + } + readOnlyChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.readOnly) { + radio.readOnly = true; + } else { + radio.readOnly = false; + } + }); + } + } + disabledChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.disabled) { + radio.disabled = true; + } else { + radio.disabled = false; + } + }); + } + } + nameChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + radio.setAttribute("name", this.name); + }); + } + } + valueChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + if (radio.value === this.value) { + radio.checked = true; + this.selectedRadio = radio; + } + }); + } + this.$emit("change"); + } + slottedRadioButtonsChanged(oldValue, newValue) { + if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) { + this.setupRadioButtons(); + } + } + get parentToolbar() { + return this.closest('[role="toolbar"]'); + } + get isInsideToolbar() { + var _a; + return (_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false; + } + get isInsideFoundationToolbar() { + var _a; + return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + this.setupRadioButtons(); + } + disconnectedCallback() { + this.slottedRadioButtons.forEach((radio) => { + radio.removeEventListener("change", this.radioChangeHandler); + }); + } + setupRadioButtons() { + const checkedRadios = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0; + if (numberOfCheckedRadios > 1) { + const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1]; + lastCheckedRadio.checked = true; + } + let foundMatchingVal = false; + this.slottedRadioButtons.forEach((radio) => { + if (this.name !== void 0) { + radio.setAttribute("name", this.name); + } + if (this.disabled) { + radio.disabled = true; + } + if (this.readOnly) { + radio.readOnly = true; + } + if (this.value && this.value === radio.value) { + this.selectedRadio = radio; + this.focusedRadio = radio; + radio.checked = true; + radio.setAttribute("tabindex", "0"); + foundMatchingVal = true; + } else { + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + radio.checked = false; + } + radio.addEventListener("change", this.radioChangeHandler); + }); + if (this.value === void 0 && this.slottedRadioButtons.length > 0) { + const checkedRadios2 = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios2 = checkedRadios2 !== null ? checkedRadios2.length : 0; + if (numberOfCheckedRadios2 > 0 && !foundMatchingVal) { + const lastCheckedRadio = checkedRadios2[numberOfCheckedRadios2 - 1]; + lastCheckedRadio.checked = true; + this.focusedRadio = lastCheckedRadio; + lastCheckedRadio.setAttribute("tabindex", "0"); + } else { + this.slottedRadioButtons[0].setAttribute("tabindex", "0"); + this.focusedRadio = this.slottedRadioButtons[0]; + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], RadioGroup.prototype, "readOnly", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], RadioGroup.prototype, "disabled", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "name", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "value", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "orientation", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "childItems", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "slottedRadioButtons", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js + var init_radio_group2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js"() { + init_radio_group_template(); + init_radio_group(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js + var radioTemplate; + var init_radio_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js"() { + init_esm(); + radioTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js + var _Radio, FormAssociatedRadio; + var init_radio_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Radio = class extends FoundationElement { + }; + FormAssociatedRadio = class extends CheckableFormAssociated(_Radio) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js + var Radio; + var init_radio = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_radio_form_associated(); + Radio = class extends FormAssociatedRadio { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + switch (e.key) { + case keySpace: + if (!this.checked && !this.readOnly) { + this.checked = true; + } + return; + } + return true; + }; + this.proxy.setAttribute("type", "radio"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * @internal + */ + defaultCheckedChanged() { + var _a; + if (this.$fastController.isConnected && !this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false; + this.dirtyChecked = false; + } + } + } + /** + * @internal + */ + connectedCallback() { + var _a, _b; + super.connectedCallback(); + this.validate(); + if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" && this.getAttribute("tabindex") === null) { + if (!this.disabled) { + this.setAttribute("tabindex", "0"); + } + } + if (this.checkedAttribute) { + if (!this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false; + this.dirtyChecked = false; + } + } + } + } + isInsideRadioGroup() { + const parent = this.closest("[role=radiogroup]"); + return parent !== null; + } + /** + * @internal + */ + clickHandler(e) { + if (!this.disabled && !this.readOnly && !this.checked) { + this.checked = true; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Radio.prototype, "readOnly", void 0); + __decorate([ + observable + ], Radio.prototype, "name", void 0); + __decorate([ + observable + ], Radio.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js + var init_radio2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js"() { + init_radio_template(); + init_radio(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js + var HorizontalScroll; + var init_horizontal_scroll = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + HorizontalScroll = class extends FoundationElement { + constructor() { + super(...arguments); + this.framesPerSecond = 60; + this.updatingItems = false; + this.speed = 600; + this.easing = "ease-in-out"; + this.flippersHiddenFromAT = false; + this.scrolling = false; + this.resizeDetector = null; + } + /** + * The calculated duration for a frame. + * + * @internal + */ + get frameTime() { + return 1e3 / this.framesPerSecond; + } + /** + * Firing scrollstart and scrollend events + * @internal + */ + scrollingChanged(prev, next) { + if (this.scrollContainer) { + const event = this.scrolling == true ? "scrollstart" : "scrollend"; + this.$emit(event, this.scrollContainer.scrollLeft); + } + } + /** + * In RTL mode + * @internal + */ + get isRtl() { + return this.scrollItems.length > 1 && this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft; + } + connectedCallback() { + super.connectedCallback(); + this.initializeResizeDetector(); + } + disconnectedCallback() { + this.disconnectResizeDetector(); + super.disconnectedCallback(); + } + /** + * Updates scroll stops and flippers when scroll items change + * @param previous - current scroll items + * @param next - new updated scroll items + * @public + */ + scrollItemsChanged(previous, next) { + if (next && !this.updatingItems) { + DOM.queueUpdate(() => this.setStops()); + } + } + /** + * destroys the instance's resize observer + * @internal + */ + disconnectResizeDetector() { + if (this.resizeDetector) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + * @internal + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.resized.bind(this)); + this.resizeDetector.observe(this); + } + /** + * Looks for slots and uses child nodes instead + * @internal + */ + updateScrollStops() { + this.updatingItems = true; + const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => { + if (scrollItem instanceof HTMLSlotElement) { + return scrollItems.concat(scrollItem.assignedElements()); + } + scrollItems.push(scrollItem); + return scrollItems; + }, []); + this.scrollItems = updatedItems; + this.updatingItems = false; + } + /** + * Finds all of the scroll stops between elements + * @internal + */ + setStops() { + this.updateScrollStops(); + const { scrollContainer: container } = this; + const { scrollLeft } = container; + const { width: containerWidth, left: containerLeft } = container.getBoundingClientRect(); + this.width = containerWidth; + let lastStop = 0; + let stops = this.scrollItems.map((item, index) => { + const { left, width } = item.getBoundingClientRect(); + const leftPosition = Math.round(left + scrollLeft - containerLeft); + const right = Math.round(leftPosition + width); + if (this.isRtl) { + return -right; + } + lastStop = right; + return index === 0 ? 0 : leftPosition; + }).concat(lastStop); + stops = this.fixScrollMisalign(stops); + stops.sort((a, b) => Math.abs(a) - Math.abs(b)); + this.scrollStops = stops; + this.setFlippers(); + } + /** + * Checks to see if the stops are returning values + * otherwise it will try to reinitialize them + * + * @returns boolean indicating that current scrollStops are valid non-zero values + * @internal + */ + validateStops(reinit = true) { + const hasStops = () => !!this.scrollStops.find((stop) => stop > 0); + if (!hasStops() && reinit) { + this.setStops(); + } + return hasStops(); + } + /** + * + */ + fixScrollMisalign(stops) { + if (this.isRtl && stops.some((stop) => stop > 0)) { + stops.sort((a, b) => b - a); + const offset = stops[0]; + stops = stops.map((stop) => stop - offset); + } + return stops; + } + /** + * Sets the controls view if enabled + * @internal + */ + setFlippers() { + var _a, _b; + const position = this.scrollContainer.scrollLeft; + (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle("disabled", position === 0); + if (this.scrollStops) { + const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]); + (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", this.validateStops(false) && Math.abs(position) + this.width >= lastStop); + } + } + /** + * Function that can scroll an item into view. + * @param item - An item index, a scroll item or a child of one of the scroll items + * @param padding - Padding of the viewport where the active item shouldn't be + * @param rightPadding - Optional right padding. Uses the padding if not defined + * + * @public + */ + scrollInView(item, padding = 0, rightPadding) { + var _a; + if (typeof item !== "number" && item) { + item = this.scrollItems.findIndex((scrollItem) => scrollItem === item || scrollItem.contains(item)); + } + if (item !== void 0) { + rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding; + const { scrollContainer: container, scrollStops, scrollItems: items } = this; + const { scrollLeft } = this.scrollContainer; + const { width: containerWidth } = container.getBoundingClientRect(); + const itemStart = scrollStops[item]; + const { width } = items[item].getBoundingClientRect(); + const itemEnd = itemStart + width; + const isBefore = scrollLeft + padding > itemStart; + if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) { + const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b); + const scrollTo = (_a = stops.find((position) => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0; + this.scrollToPosition(scrollTo); + } + } + } + /** + * Lets the user arrow left and right through the horizontal scroll + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + this.scrollToPrevious(); + break; + case "ArrowRight": + this.scrollToNext(); + break; + } + } + /** + * Scrolls items to the left + * @public + */ + scrollToPrevious() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition && (this.isRtl || index === this.scrollStops.length - 1 || this.scrollStops[index + 1] > scrollPosition)); + const right = Math.abs(this.scrollStops[current + 1]); + let nextIndex = this.scrollStops.findIndex((stop) => Math.abs(stop) + this.width > right); + if (nextIndex >= current || nextIndex === -1) { + nextIndex = current > 0 ? current - 1 : 0; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Scrolls items to the right + * @public + */ + scrollToNext() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop) => Math.abs(stop) >= Math.abs(scrollPosition)); + const outOfView = this.scrollStops.findIndex((stop) => Math.abs(scrollPosition) + this.width <= Math.abs(stop)); + let nextIndex = current; + if (outOfView > current + 2) { + nextIndex = outOfView - 2; + } else if (current < this.scrollStops.length - 2) { + nextIndex = current + 1; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Handles scrolling with easing + * @param position - starting position + * @param newPosition - position to scroll to + * @public + */ + scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) { + var _a; + if (this.scrolling) { + return; + } + this.scrolling = true; + const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`; + this.content.style.setProperty("transition-duration", seconds); + const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue("transition-duration")); + const transitionendHandler = (e) => { + if (e && e.target !== e.currentTarget) { + return; + } + this.content.style.setProperty("transition-duration", "0s"); + this.content.style.removeProperty("transform"); + this.scrollContainer.style.setProperty("scroll-behavior", "auto"); + this.scrollContainer.scrollLeft = newPosition; + this.setFlippers(); + this.content.removeEventListener("transitionend", transitionendHandler); + this.scrolling = false; + }; + if (computedDuration === 0) { + transitionendHandler(); + return; + } + this.content.addEventListener("transitionend", transitionendHandler); + const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth; + let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue); + if (this.isRtl) { + transitionStop = this.scrollContainer.scrollLeft + Math.min(Math.abs(newPosition), maxScrollValue); + } + this.content.style.setProperty("transition-property", "transform"); + this.content.style.setProperty("transition-timing-function", this.easing); + this.content.style.setProperty("transform", `translateX(${transitionStop}px)`); + } + /** + * Monitors resize event on the horizontal-scroll element + * @public + */ + resized() { + if (this.resizeTimeout) { + this.resizeTimeout = clearTimeout(this.resizeTimeout); + } + this.resizeTimeout = setTimeout(() => { + this.width = this.scrollContainer.offsetWidth; + this.setFlippers(); + }, this.frameTime); + } + /** + * Monitors scrolled event on the content container + * @public + */ + scrolled() { + if (this.scrollTimeout) { + this.scrollTimeout = clearTimeout(this.scrollTimeout); + } + this.scrollTimeout = setTimeout(() => { + this.setFlippers(); + }, this.frameTime); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], HorizontalScroll.prototype, "speed", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "duration", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "easing", void 0); + __decorate([ + attr({ attribute: "flippers-hidden-from-at", converter: booleanConverter }) + ], HorizontalScroll.prototype, "flippersHiddenFromAT", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrolling", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrollItems", void 0); + __decorate([ + attr({ attribute: "view" }) + ], HorizontalScroll.prototype, "view", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js + var init_horizontal_scroll_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js + var init_horizontal_scroll2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js"() { + init_horizontal_scroll(); + init_horizontal_scroll_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js + function whitespaceFilter(value, index, array) { + return value.nodeType !== Node.TEXT_NODE ? true : typeof value.nodeValue === "string" && !!value.nodeValue.trim().length; + } + var init_whitespace_filter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js + var init_search_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js + var _Search, FormAssociatedSearch; + var init_search_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Search = class extends FoundationElement { + }; + FormAssociatedSearch = class extends FormAssociated(_Search) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.js + var Search, DelegatesARIASearch; + var init_search = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_search_form_associated(); + Search = class extends FormAssociatedSearch { + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Handles the control's clear value event + * @public + */ + handleClearInput() { + this.value = ""; + this.control.focus(); + this.handleChange(); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Search.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "autofocus", void 0); + __decorate([ + attr + ], Search.prototype, "placeholder", void 0); + __decorate([ + attr + ], Search.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "minlength", void 0); + __decorate([ + attr + ], Search.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "spellcheck", void 0); + __decorate([ + observable + ], Search.prototype, "defaultSlottedNodes", void 0); + DelegatesARIASearch = class { + }; + applyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties); + applyMixins(Search, StartEnd, DelegatesARIASearch); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/index.js + var init_search2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/index.js"() { + init_search_template(); + init_search(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js + var _Select, FormAssociatedSelect; + var init_select_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js"() { + init_listbox_element(); + init_form_associated(); + _Select = class extends ListboxElement { + }; + FormAssociatedSelect = class extends FormAssociated(_Select) { + constructor() { + super(...arguments); + this.proxy = document.createElement("select"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.js + var Select, DelegatesARIASelect; + var init_select = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_apply_mixins(); + init_select_form_associated(); + init_select_options(); + Select = class extends FormAssociatedSelect { + constructor() { + super(...arguments); + this.open = false; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + } + /** + * Sets focus and synchronizes ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged(prev, next) { + if (!this.collapsible) { + return; + } + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + this.indexWhenOpened = this.selectedIndex; + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The component is collapsible when in single-selection mode with no size attribute. + * + * @internal + */ + get collapsible() { + return !(this.multiple || typeof this.size === "number"); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c, _d, _e, _f, _g; + const prev = `${this._value}`; + if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) { + const selectedIndex = this._options.findIndex((el2) => el2.value === next); + const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; + const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null; + if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) { + next = ""; + this.selectedIndex = selectedIndex; + } + next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + this.updateDisplayValue(); + } + } + /** + * Sets the value and display value to match the first selected option. + * + * @param shouldEmit - if true, the input and change events will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a, _b; + if (this.$fastController.isConnected) { + this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; + } + if (shouldEmit) { + this.$emit("input"); + this.$emit("change", this, { + bubbles: true, + composed: void 0 + }); + } + } + /** + * Updates the proxy value when the selected index changes. + * + * @param prev - the previous selected index + * @param next - the next selected index + * + * @internal + */ + selectedIndexChanged(prev, next) { + super.selectedIndexChanged(prev, next); + this.updateValue(); + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * The value displayed on the button. + * + * @public + */ + get displayValue() { + var _a, _b; + Observable.track(this, "displayValue"); + return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ""; + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + this.setProxyOptions(); + super.setDefaultSelectedOption(); + if (this.selectedIndex === -1) { + this.selectedIndex = 0; + } + } + /** + * Handle opening and closing the listbox when the select is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + if (this.disabled) { + return; + } + if (this.open) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && captured.disabled) { + return; + } + } + super.clickHandler(e); + this.open = this.collapsible && !this.open; + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + return true; + } + /** + * Handles focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + var _a; + super.focusoutHandler(e); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) { + this.open = false; + if (this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + } + } + /** + * Updates the value when an option's value changes. + * + * @param source - the source object + * @param propertyName - the property to evaluate + * + * @internal + * @override + */ + handleChange(source, propertyName) { + super.handleChange(source, propertyName); + if (propertyName === "value") { + this.updateValue(); + } + } + /** + * Synchronize the form-associated proxy and updates the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "value"); + }); + super.slottedOptionsChanged(prev, next); + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.subscribe(this, "value"); + }); + this.setProxyOptions(); + this.updateValue(); + } + /** + * Prevents focus when size is set and a scrollbar is clicked. + * + * @param e - the mouse event object + * + * @override + * @internal + */ + mousedownHandler(e) { + var _a; + if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) { + return super.mousedownHandler(e); + } + return this.collapsible; + } + /** + * Sets the multiple property on the proxy element. + * + * @param prev - the previous multiple value + * @param next - the current multiple value + */ + multipleChanged(prev, next) { + super.multipleChanged(prev, next); + if (this.proxy) { + this.proxy.multiple = next; + } + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @override + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + super.selectedOptionsChanged(prev, next); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => { + var _a2; + const proxyOption = (_a2 = this.proxy) === null || _a2 === void 0 ? void 0 : _a2.options.item(i); + if (proxyOption) { + proxyOption.selected = o.selected; + } + }); + } + /** + * Sets the selected index to match the first option with the selected attribute, or + * the first selectable option. + * + * @override + * @internal + */ + setDefaultSelectedOption() { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter); + const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex((el2) => el2.hasAttribute("selected") || el2.selected || el2.value === this.value); + if (selectedIndex !== -1) { + this.selectedIndex = selectedIndex; + return; + } + this.selectedIndex = 0; + } + /** + * Resets and fills the proxy to match the component's options. + * + * @internal + */ + setProxyOptions() { + if (this.proxy instanceof HTMLSelectElement && this.options) { + this.proxy.options.length = 0; + this.options.forEach((option) => { + const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null); + if (proxyOption) { + this.proxy.options.add(proxyOption); + } + }); + } + } + /** + * Handle keyboard interaction for the select. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + super.keydownHandler(e); + const key = e.key || e.key.charCodeAt(0); + switch (key) { + case keySpace: { + e.preventDefault(); + if (this.collapsible && this.typeAheadExpired) { + this.open = !this.open; + } + break; + } + case keyHome: + case keyEnd: { + e.preventDefault(); + break; + } + case keyEnter: { + e.preventDefault(); + this.open = !this.open; + break; + } + case keyEscape: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + break; + } + case keyTab: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + return true; + } + } + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + this.indexWhenOpened = this.selectedIndex; + } + return !(key === keyArrowDown || key === keyArrowUp); + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + this.addEventListener("contentchange", this.updateDisplayValue); + } + disconnectedCallback() { + this.removeEventListener("contentchange", this.updateDisplayValue); + super.disconnectedCallback(); + } + /** + * Updates the proxy's size property when the size attribute changes. + * + * @param prev - the previous size + * @param next - the current size + * + * @override + * @internal + */ + sizeChanged(prev, next) { + super.sizeChanged(prev, next); + if (this.proxy) { + this.proxy.size = next; + } + } + /** + * + * @internal + */ + updateDisplayValue() { + if (this.collapsible) { + Observable.notify(this, "displayValue"); + } + } + }; + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Select.prototype, "open", void 0); + __decorate([ + volatile + ], Select.prototype, "collapsible", null); + __decorate([ + observable + ], Select.prototype, "control", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Select.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Select.prototype, "position", void 0); + __decorate([ + observable + ], Select.prototype, "maxHeight", void 0); + DelegatesARIASelect = class { + }; + __decorate([ + observable + ], DelegatesARIASelect.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIASelect, DelegatesARIAListbox); + applyMixins(Select, StartEnd, DelegatesARIASelect); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js + var selectTemplate; + var init_select_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js"() { + init_esm(); + init_listbox(); + init_start_end(); + selectTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/index.js + var init_select2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/index.js"() { + init_select(); + init_select_options(); + init_select_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js + var init_skeleton_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js + var Skeleton; + var init_skeleton = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Skeleton = class extends FoundationElement { + constructor() { + super(...arguments); + this.shape = "rect"; + } + }; + __decorate([ + attr + ], Skeleton.prototype, "fill", void 0); + __decorate([ + attr + ], Skeleton.prototype, "shape", void 0); + __decorate([ + attr + ], Skeleton.prototype, "pattern", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Skeleton.prototype, "shimmer", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js + var init_skeleton2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js"() { + init_skeleton_template(); + init_skeleton(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js + var init_slider_label_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js + function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) { + let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition)); + if (direction === Direction.rtl) { + pct = 1 - pct; + } + return pct; + } + var init_slider_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js"() { + init_dist2(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js + var defaultConfig, SliderLabel; + var init_slider_label = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_slider_utilities(); + init_foundation_element(); + defaultConfig = { + min: 0, + max: 0, + direction: Direction.ltr, + orientation: Orientation.horizontal, + disabled: false + }; + SliderLabel = class extends FoundationElement { + constructor() { + super(...arguments); + this.hideMark = false; + this.sliderDirection = Direction.ltr; + this.getSliderConfiguration = () => { + if (!this.isSliderConfig(this.parentNode)) { + this.sliderDirection = defaultConfig.direction || Direction.ltr; + this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal; + this.sliderMaxPosition = defaultConfig.max; + this.sliderMinPosition = defaultConfig.min; + } else { + const parentSlider = this.parentNode; + const { min, max, direction, orientation, disabled } = parentSlider; + if (disabled !== void 0) { + this.disabled = disabled; + } + this.sliderDirection = direction || Direction.ltr; + this.sliderOrientation = orientation || Orientation.horizontal; + this.sliderMaxPosition = max; + this.sliderMinPosition = min; + } + }; + this.positionAsStyle = () => { + const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr; + const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition)); + let rightNum = Math.round((1 - pct) * 100); + let leftNum = Math.round(pct * 100); + if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) { + rightNum = 50; + leftNum = 50; + } + if (this.sliderOrientation === Orientation.horizontal) { + return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`; + } else { + return `top: ${leftNum}%; bottom: ${rightNum}%;`; + } + }; + } + positionChanged() { + this.positionStyle = this.positionAsStyle(); + } + /** + * @internal + */ + sliderOrientationChanged() { + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.getSliderConfiguration(); + this.positionStyle = this.positionAsStyle(); + this.notifier = Observable.getNotifier(this.parentNode); + this.notifier.subscribe(this, "orientation"); + this.notifier.subscribe(this, "direction"); + this.notifier.subscribe(this, "max"); + this.notifier.subscribe(this, "min"); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.notifier.unsubscribe(this, "orientation"); + this.notifier.unsubscribe(this, "direction"); + this.notifier.unsubscribe(this, "max"); + this.notifier.unsubscribe(this, "min"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "direction": + this.sliderDirection = source.direction; + break; + case "orientation": + this.sliderOrientation = source.orientation; + break; + case "max": + this.sliderMaxPosition = source.max; + break; + case "min": + this.sliderMinPosition = source.min; + break; + default: + break; + } + this.positionStyle = this.positionAsStyle(); + } + isSliderConfig(node) { + return node.max !== void 0 && node.min !== void 0; + } + }; + __decorate([ + observable + ], SliderLabel.prototype, "positionStyle", void 0); + __decorate([ + attr + ], SliderLabel.prototype, "position", void 0); + __decorate([ + attr({ attribute: "hide-mark", mode: "boolean" }) + ], SliderLabel.prototype, "hideMark", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], SliderLabel.prototype, "disabled", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderOrientation", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMinPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMaxPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js + var init_slider_label2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js"() { + init_slider_label_template(); + init_slider_label(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js + var init_slider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js + var _Slider, FormAssociatedSlider; + var init_slider_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Slider = class extends FoundationElement { + }; + FormAssociatedSlider = class extends FormAssociated(_Slider) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js + var SliderMode, Slider; + var init_slider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_slider_utilities(); + init_slider_form_associated(); + SliderMode = { + singleValue: "single-value" + }; + Slider = class extends FormAssociatedSlider { + constructor() { + super(...arguments); + this.direction = Direction.ltr; + this.isDragging = false; + this.trackWidth = 0; + this.trackMinWidth = 0; + this.trackHeight = 0; + this.trackLeft = 0; + this.trackMinHeight = 0; + this.valueTextFormatter = () => null; + this.min = 0; + this.max = 10; + this.step = 1; + this.orientation = Orientation.horizontal; + this.mode = SliderMode.singleValue; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + if (e.key === keyHome) { + e.preventDefault(); + this.value = `${this.min}`; + } else if (e.key === keyEnd) { + e.preventDefault(); + this.value = `${this.max}`; + } else if (!e.shiftKey) { + switch (e.key) { + case keyArrowRight: + case keyArrowUp: + e.preventDefault(); + this.increment(); + break; + case keyArrowLeft: + case keyArrowDown: + e.preventDefault(); + this.decrement(); + break; + } + } + }; + this.setupTrackConstraints = () => { + const clientRect = this.track.getBoundingClientRect(); + this.trackWidth = this.track.clientWidth; + this.trackMinWidth = this.track.clientLeft; + this.trackHeight = clientRect.bottom; + this.trackMinHeight = clientRect.top; + this.trackLeft = this.getBoundingClientRect().left; + if (this.trackWidth === 0) { + this.trackWidth = 1; + } + }; + this.setupListeners = (remove = false) => { + const eventAction = `${remove ? "remove" : "add"}EventListener`; + this[eventAction]("keydown", this.keypressHandler); + this[eventAction]("mousedown", this.handleMouseDown); + this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { + passive: true + }); + this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { + passive: true + }); + if (remove) { + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + } + }; + this.initialValue = ""; + this.handleThumbMouseDown = (event) => { + if (event) { + if (this.readOnly || this.disabled || event.defaultPrevented) { + return; + } + event.target.focus(); + } + const eventAction = `${event !== null ? "add" : "remove"}EventListener`; + window[eventAction]("mouseup", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchmove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchend", this.handleWindowMouseUp); + this.isDragging = event !== null; + }; + this.handleMouseMove = (e) => { + if (this.readOnly || this.disabled || e.defaultPrevented) { + return; + } + const sourceEvent = window.TouchEvent && e instanceof TouchEvent ? e.touches[0] : e; + const eventValue = this.orientation === Orientation.horizontal ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft : sourceEvent.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(eventValue)}`; + }; + this.calculateNewValue = (rawValue) => { + const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal ? this.trackMinWidth : this.trackMinHeight, this.orientation === Orientation.horizontal ? this.trackWidth : this.trackHeight, this.direction); + const newValue = (this.max - this.min) * newPosition + this.min; + return this.convertToConstrainedValue(newValue); + }; + this.handleWindowMouseUp = (event) => { + this.stopDragging(); + }; + this.stopDragging = () => { + this.isDragging = false; + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + }; + this.handleMouseDown = (e) => { + const eventAction = `${e !== null ? "add" : "remove"}EventListener`; + if (e === null || !this.disabled && !this.readOnly) { + window[eventAction]("mouseup", this.handleWindowMouseUp); + window.document[eventAction]("mouseleave", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove); + if (e) { + e.preventDefault(); + this.setupTrackConstraints(); + e.target.focus(); + const controlValue = this.orientation === Orientation.horizontal ? e.pageX - document.documentElement.scrollLeft - this.trackLeft : e.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(controlValue)}`; + } + } + }; + this.convertToConstrainedValue = (value) => { + if (isNaN(value)) { + value = this.min; + } + let constrainedValue = value - this.min; + const roundedConstrainedValue = Math.round(constrainedValue / this.step); + const remainderValue = constrainedValue - roundedConstrainedValue * (this.stepMultiplier * this.step) / this.stepMultiplier; + constrainedValue = remainderValue >= Number(this.step) / 2 ? constrainedValue - remainderValue + Number(this.step) : constrainedValue - remainderValue; + return constrainedValue + this.min; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * @internal + */ + valueChanged(previous, next) { + super.valueChanged(previous, next); + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + this.$emit("change"); + } + minChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.min = `${this.min}`; + } + this.validate(); + } + maxChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.max = `${this.max}`; + } + this.validate(); + } + stepChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.step = `${this.step}`; + } + this.updateStepMultiplier(); + this.validate(); + } + orientationChanged() { + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "range"); + this.direction = getDirection(this); + this.updateStepMultiplier(); + this.setupTrackConstraints(); + this.setupListeners(); + this.setupDefaultValue(); + this.setThumbPositionForOrientation(this.direction); + } + /** + * @internal + */ + disconnectedCallback() { + this.setupListeners(true); + } + /** + * Increment the value by the step + * + * @public + */ + increment() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step); + const incrementedVal = this.convertToConstrainedValue(newVal); + const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`; + this.value = incrementedValString; + } + /** + * Decrement the value by the step + * + * @public + */ + decrement() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step); + const decrementedVal = this.convertToConstrainedValue(newVal); + const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`; + this.value = decrementedValString; + } + /** + * Places the thumb based on the current value + * + * @public + * @param direction - writing mode + */ + setThumbPositionForOrientation(direction) { + const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction); + const percentage = (1 - newPct) * 100; + if (this.orientation === Orientation.horizontal) { + this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`; + } else { + this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`; + } + } + /** + * Update the step multiplier used to ensure rounding errors from steps that + * are not whole numbers + */ + updateStepMultiplier() { + const stepString = this.step + ""; + const decimalPlacesOfStep = !!(this.step % 1) ? stepString.length - stepString.indexOf(".") - 1 : 0; + this.stepMultiplier = Math.pow(10, decimalPlacesOfStep); + } + get midpoint() { + return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`; + } + setupDefaultValue() { + if (typeof this.value === "string") { + if (this.value.length === 0) { + this.initialValue = this.midpoint; + } else { + const value = parseFloat(this.value); + if (!Number.isNaN(value) && (value < this.min || value > this.max)) { + this.value = this.midpoint; + } + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Slider.prototype, "readOnly", void 0); + __decorate([ + observable + ], Slider.prototype, "direction", void 0); + __decorate([ + observable + ], Slider.prototype, "isDragging", void 0); + __decorate([ + observable + ], Slider.prototype, "position", void 0); + __decorate([ + observable + ], Slider.prototype, "trackWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "trackLeft", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "valueTextFormatter", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "step", void 0); + __decorate([ + attr + ], Slider.prototype, "orientation", void 0); + __decorate([ + attr + ], Slider.prototype, "mode", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js + var init_slider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js"() { + init_slider_template(); + init_slider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js + var init_switch_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js + var _Switch, FormAssociatedSwitch; + var init_switch_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Switch = class extends FoundationElement { + }; + FormAssociatedSwitch = class extends CheckableFormAssociated(_Switch) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js + var Switch; + var init_switch = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_switch_form_associated(); + Switch = class extends FormAssociatedSwitch { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + this.readOnly ? this.classList.add("readonly") : this.classList.remove("readonly"); + } + /** + * @internal + */ + checkedChanged(prev, next) { + super.checkedChanged(prev, next); + this.checked ? this.classList.add("checked") : this.classList.remove("checked"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Switch.prototype, "readOnly", void 0); + __decorate([ + observable + ], Switch.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js + var init_switch2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js"() { + init_switch_template(); + init_switch(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js + var tabPanelTemplate; + var init_tab_panel_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js"() { + init_esm(); + tabPanelTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js + var TabPanel; + var init_tab_panel = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js"() { + init_foundation_element(); + TabPanel = class extends FoundationElement { + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js + var init_tab_panel2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js"() { + init_tab_panel_template(); + init_tab_panel(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js + var tabTemplate; + var init_tab_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js"() { + init_esm(); + tabTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js + var Tab; + var init_tab = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Tab = class extends FoundationElement { + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tab.prototype, "disabled", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js + var init_tab2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js"() { + init_tab_template(); + init_tab(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js + var tabsTemplate; + var init_tabs_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js"() { + init_esm(); + init_start_end(); + tabsTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js + var TabsOrientation, Tabs; + var init_tabs = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TabsOrientation = { + vertical: "vertical", + horizontal: "horizontal" + }; + Tabs = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = TabsOrientation.horizontal; + this.activeindicator = true; + this.showActiveIndicator = true; + this.prevActiveTabIndex = 0; + this.activeTabIndex = 0; + this.ticking = false; + this.change = () => { + this.$emit("change", this.activetab); + }; + this.isDisabledElement = (el2) => { + return el2.getAttribute("aria-disabled") === "true"; + }; + this.isHiddenElement = (el2) => { + return el2.hasAttribute("hidden"); + }; + this.isFocusableElement = (el2) => { + return !this.isDisabledElement(el2) && !this.isHiddenElement(el2); + }; + this.setTabs = () => { + const gridHorizontalProperty = "gridColumn"; + const gridVerticalProperty = "gridRow"; + const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty; + this.activeTabIndex = this.getActiveIndex(); + this.showActiveIndicator = false; + this.tabs.forEach((tab, index) => { + if (tab.slot === "tab") { + const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab); + if (this.activeindicator && this.isFocusableElement(tab)) { + this.showActiveIndicator = true; + } + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tab.setAttribute("id", tabId); + tab.setAttribute("aria-selected", isActiveTab ? "true" : "false"); + tab.setAttribute("aria-controls", tabpanelId); + tab.addEventListener("click", this.handleTabClick); + tab.addEventListener("keydown", this.handleTabKeyDown); + tab.setAttribute("tabindex", isActiveTab ? "0" : "-1"); + if (isActiveTab) { + this.activetab = tab; + this.activeid = tabId; + } + } + tab.style[gridHorizontalProperty] = ""; + tab.style[gridVerticalProperty] = ""; + tab.style[gridProperty] = `${index + 1}`; + !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical"); + }); + }; + this.setTabPanels = () => { + this.tabpanels.forEach((tabpanel, index) => { + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tabpanel.setAttribute("id", tabpanelId); + tabpanel.setAttribute("aria-labelledby", tabId); + this.activeTabIndex !== index ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden"); + }); + }; + this.handleTabClick = (event) => { + const selectedTab = event.currentTarget; + if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) { + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = this.tabs.indexOf(selectedTab); + this.setComponent(); + } + }; + this.handleTabKeyDown = (event) => { + if (this.isHorizontal()) { + switch (event.key) { + case keyArrowLeft: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowRight: + event.preventDefault(); + this.adjustForward(event); + break; + } + } else { + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowDown: + event.preventDefault(); + this.adjustForward(event); + break; + } + } + switch (event.key) { + case keyHome: + event.preventDefault(); + this.adjust(-this.activeTabIndex); + break; + case keyEnd: + event.preventDefault(); + this.adjust(this.tabs.length - this.activeTabIndex - 1); + break; + } + }; + this.adjustForward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) + 1 : 1; + if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (this.activetab && index === group.indexOf(this.activetab)) { + break; + } else if (index + 1 >= group.length) { + index = 0; + } else { + index += 1; + } + } + }; + this.adjustBackward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + while (index >= 0 && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.moveToTabByIndex = (group, index) => { + const tab = group[index]; + this.activetab = tab; + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = index; + tab.focus(); + this.setComponent(); + }; + } + /** + * @internal + */ + orientationChanged() { + if (this.$fastController.isConnected) { + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + activeidChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabsChanged() { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabpanelsChanged() { + if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + getActiveIndex() { + const id = this.activeid; + if (id !== void 0) { + return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid); + } else { + return 0; + } + } + getTabIds() { + return this.tabs.map((tab) => { + var _a; + return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`; + }); + } + getTabPanelIds() { + return this.tabpanels.map((tabPanel) => { + var _a; + return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`; + }); + } + setComponent() { + if (this.activeTabIndex !== this.prevActiveTabIndex) { + this.activeid = this.tabIds[this.activeTabIndex]; + this.focusTab(); + this.change(); + } + } + isHorizontal() { + return this.orientation === TabsOrientation.horizontal; + } + handleActiveIndicatorPosition() { + if (this.showActiveIndicator && this.activeindicator && this.activeTabIndex !== this.prevActiveTabIndex) { + if (this.ticking) { + this.ticking = false; + } else { + this.ticking = true; + this.animateActiveIndicator(); + } + } + } + animateActiveIndicator() { + this.ticking = true; + const gridProperty = this.isHorizontal() ? "gridColumn" : "gridRow"; + const translateProperty = this.isHorizontal() ? "translateX" : "translateY"; + const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop"; + const prev = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + const next = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const dif = next - prev; + this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; + this.activeIndicatorRef.classList.add("activeIndicatorTransition"); + this.activeIndicatorRef.addEventListener("transitionend", () => { + this.ticking = false; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`; + this.activeIndicatorRef.classList.remove("activeIndicatorTransition"); + }); + } + /** + * The adjust method for FASTTabs + * @public + * @remarks + * This method allows the active index to be adjusted by numerical increments + */ + adjust(adjustment) { + const focusableTabs = this.tabs.filter((t) => this.isFocusableElement(t)); + const currentActiveTabIndex = focusableTabs.indexOf(this.activetab); + const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment); + const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]); + if (nextIndex > -1) { + this.moveToTabByIndex(this.tabs, nextIndex); + } + } + focusTab() { + this.tabs[this.activeTabIndex].focus(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.activeTabIndex = this.getActiveIndex(); + } + }; + __decorate([ + attr + ], Tabs.prototype, "orientation", void 0); + __decorate([ + attr + ], Tabs.prototype, "activeid", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabs", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabpanels", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Tabs.prototype, "activeindicator", void 0); + __decorate([ + observable + ], Tabs.prototype, "activeIndicatorRef", void 0); + __decorate([ + observable + ], Tabs.prototype, "showActiveIndicator", void 0); + applyMixins(Tabs, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js + var init_tabs2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js"() { + init_tabs_template(); + init_tabs(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js + var _TextArea, FormAssociatedTextArea; + var init_text_area_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextArea = class extends FoundationElement { + }; + FormAssociatedTextArea = class extends FormAssociated(_TextArea) { + constructor() { + super(...arguments); + this.proxy = document.createElement("textarea"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js + var TextAreaResize; + var init_text_area_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js"() { + TextAreaResize = { + /** + * No resize. + */ + none: "none", + /** + * Resize vertically and horizontally. + */ + both: "both", + /** + * Resize horizontally. + */ + horizontal: "horizontal", + /** + * Resize vertically. + */ + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js + var TextArea; + var init_text_area = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js"() { + init_tslib_es6(); + init_esm(); + init_text_field(); + init_apply_mixins(); + init_text_area_form_associated(); + init_text_area_options(); + TextArea = class extends FormAssociatedTextArea { + constructor() { + super(...arguments); + this.resize = TextAreaResize.none; + this.cols = 20; + this.handleTextInput = () => { + this.value = this.control.value; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.readOnly = this.readOnly; + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.autofocus = this.autofocus; + } + } + listChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.setAttribute("list", this.list); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.maxLength = this.maxlength; + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.minLength = this.minlength; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * Selects all the text in the text area + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "readOnly", void 0); + __decorate([ + attr + ], TextArea.prototype, "resize", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], TextArea.prototype, "formId", void 0); + __decorate([ + attr + ], TextArea.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "minlength", void 0); + __decorate([ + attr + ], TextArea.prototype, "name", void 0); + __decorate([ + attr + ], TextArea.prototype, "placeholder", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "cols", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "rows", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextArea.prototype, "defaultSlottedNodes", void 0); + applyMixins(TextArea, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js + var textAreaTemplate; + var init_text_area_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js"() { + init_esm(); + init_text_area(); + textAreaTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js + var init_text_area2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js"() { + init_text_area_template(); + init_text_area(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js + var textFieldTemplate; + var init_text_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js"() { + init_esm(); + init_start_end(); + init_whitespace_filter(); + textFieldTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js + var init_text_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js"() { + init_text_field_template(); + init_text_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js + var init_toolbar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js + function getRootActiveElement(element) { + const rootNode = element.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.activeElement; + } + return document.activeElement; + } + var init_root_active_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js + var ToolbarArrowKeyMap, Toolbar, DelegatesARIAToolbar; + var init_toolbar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + init_direction(); + init_root_active_element(); + ToolbarArrowKeyMap = Object.freeze({ + [ArrowKeys.ArrowUp]: { + [Orientation.vertical]: -1 + }, + [ArrowKeys.ArrowDown]: { + [Orientation.vertical]: 1 + }, + [ArrowKeys.ArrowLeft]: { + [Orientation.horizontal]: { + [Direction.ltr]: -1, + [Direction.rtl]: 1 + } + }, + [ArrowKeys.ArrowRight]: { + [Orientation.horizontal]: { + [Direction.ltr]: 1, + [Direction.rtl]: -1 + } + } + }); + Toolbar = class _Toolbar extends FoundationElement { + constructor() { + super(...arguments); + this._activeIndex = 0; + this.direction = Direction.ltr; + this.orientation = Orientation.horizontal; + } + /** + * The index of the currently focused element, clamped between 0 and the last element. + * + * @internal + */ + get activeIndex() { + Observable.track(this, "activeIndex"); + return this._activeIndex; + } + set activeIndex(value) { + if (this.$fastController.isConnected) { + this._activeIndex = limit(0, this.focusableElements.length - 1, value); + Observable.notify(this, "activeIndex"); + } + } + slottedItemsChanged() { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * Set the activeIndex when a focusable element in the toolbar is clicked. + * + * @internal + */ + mouseDownHandler(e) { + var _a; + const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.findIndex((x) => x.contains(e.target)); + if (activeIndex > -1 && this.activeIndex !== activeIndex) { + this.setFocusedElement(activeIndex); + } + return true; + } + childItemsChanged(prev, next) { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + } + /** + * When the toolbar receives focus, set the currently active element as focused. + * + * @internal + */ + focusinHandler(e) { + const relatedTarget = e.relatedTarget; + if (!relatedTarget || this.contains(relatedTarget)) { + return; + } + this.setFocusedElement(); + } + /** + * Determines a value that can be used to iterate a list with the arrow keys. + * + * @param this - An element with an orientation and direction + * @param key - The event key value + * @internal + */ + getDirectionalIncrementer(key) { + var _a, _b, _c, _d, _e; + return (_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0; + } + /** + * Handle keyboard events for the toolbar. + * + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) { + return true; + } + const incrementer = this.getDirectionalIncrementer(key); + if (!incrementer) { + return !e.target.closest("[role=radiogroup]"); + } + const nextIndex = this.activeIndex + incrementer; + if (this.focusableElements[nextIndex]) { + e.preventDefault(); + } + this.setFocusedElement(nextIndex); + return true; + } + /** + * get all the slotted elements + * @internal + */ + get allSlottedItems() { + return [ + ...this.start.assignedElements(), + ...this.slottedItems, + ...this.end.assignedElements() + ]; + } + /** + * Prepare the slotted elements which can be focusable. + * + * @internal + */ + reduceFocusableElements() { + var _a; + const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex]; + this.focusableElements = this.allSlottedItems.reduce(_Toolbar.reduceFocusableItems, []); + const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement); + this.activeIndex = Math.max(0, adjustedActiveIndex); + this.setFocusableElements(); + } + /** + * Set the activeIndex and focus the corresponding control. + * + * @param activeIndex - The new index to set + * @internal + */ + setFocusedElement(activeIndex = this.activeIndex) { + this.activeIndex = activeIndex; + this.setFocusableElements(); + if (this.focusableElements[this.activeIndex] && // Don't focus the toolbar element if some event handlers moved + // the focus on another element in the page. + this.contains(getRootActiveElement(this))) { + this.focusableElements[this.activeIndex].focus(); + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceFocusableItems(elements2, element) { + var _a, _b, _c, _d; + const isRoleRadio = element.getAttribute("role") === "radio"; + const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus; + const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some((x) => isFocusable(x)); + if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Toolbar.reduceFocusableItems, [])); + } + return elements2; + } + /** + * @internal + */ + setFocusableElements() { + if (this.$fastController.isConnected && this.focusableElements.length > 0) { + this.focusableElements.forEach((element, index) => { + element.tabIndex = this.activeIndex === index ? 0 : -1; + }); + } + } + }; + __decorate([ + observable + ], Toolbar.prototype, "direction", void 0); + __decorate([ + attr + ], Toolbar.prototype, "orientation", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedItems", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedLabel", void 0); + __decorate([ + observable + ], Toolbar.prototype, "childItems", void 0); + DelegatesARIAToolbar = class { + }; + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], DelegatesARIAToolbar.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], DelegatesARIAToolbar.prototype, "ariaLabel", void 0); + applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties); + applyMixins(Toolbar, StartEnd, DelegatesARIAToolbar); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js + var init_toolbar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js"() { + init_toolbar_template(); + init_toolbar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js + var init_tooltip_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js + var TooltipPosition; + var init_tooltip_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js"() { + TooltipPosition = { + /** + * The tooltip is positioned above the element + */ + top: "top", + /** + * The tooltip is positioned to the right of the element + */ + right: "right", + /** + * The tooltip is positioned below the element + */ + bottom: "bottom", + /** + * The tooltip is positioned to the left of the element + */ + left: "left", + /** + * The tooltip is positioned before the element + */ + start: "start", + /** + * The tooltip is positioned after the element + */ + end: "end", + /** + * The tooltip is positioned above the element and to the left + */ + topLeft: "top-left", + /** + * The tooltip is positioned above the element and to the right + */ + topRight: "top-right", + /** + * The tooltip is positioned below the element and to the left + */ + bottomLeft: "bottom-left", + /** + * The tooltip is positioned below the element and to the right + */ + bottomRight: "bottom-right", + /** + * The tooltip is positioned above the element and to the left + */ + topStart: "top-start", + /** + * The tooltip is positioned above the element and to the right + */ + topEnd: "top-end", + /** + * The tooltip is positioned below the element and to the left + */ + bottomStart: "bottom-start", + /** + * The tooltip is positioned below the element and to the right + */ + bottomEnd: "bottom-end" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js + var Tooltip; + var init_tooltip = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + init_tooltip_options(); + Tooltip = class extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.delay = 300; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.horizontalInset = "false"; + this.verticalInset = "false"; + this.horizontalScaling = "content"; + this.verticalScaling = "content"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = void 0; + this.tooltipVisible = false; + this.currentDirection = Direction.ltr; + this.showDelayTimer = null; + this.hideDelayTimer = null; + this.isAnchorHoveredFocused = false; + this.isRegionHovered = false; + this.handlePositionChange = (ev) => { + this.classList.toggle("top", this.region.verticalPosition === "start"); + this.classList.toggle("bottom", this.region.verticalPosition === "end"); + this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd"); + this.classList.toggle("center-vertical", this.region.verticalPosition === "center"); + this.classList.toggle("left", this.region.horizontalPosition === "start"); + this.classList.toggle("right", this.region.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd"); + this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center"); + }; + this.handleRegionMouseOver = (ev) => { + this.isRegionHovered = true; + }; + this.handleRegionMouseOut = (ev) => { + this.isRegionHovered = false; + this.startHideDelayTimer(); + }; + this.handleAnchorMouseOver = (ev) => { + if (this.tooltipVisible) { + this.isAnchorHoveredFocused = true; + return; + } + this.startShowDelayTimer(); + }; + this.handleAnchorMouseOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.handleAnchorFocusIn = (ev) => { + this.startShowDelayTimer(); + }; + this.handleAnchorFocusOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.startHideDelayTimer = () => { + this.clearHideDelayTimer(); + if (!this.tooltipVisible) { + return; + } + this.hideDelayTimer = window.setTimeout(() => { + this.updateTooltipVisibility(); + }, 60); + }; + this.clearHideDelayTimer = () => { + if (this.hideDelayTimer !== null) { + clearTimeout(this.hideDelayTimer); + this.hideDelayTimer = null; + } + }; + this.startShowDelayTimer = () => { + if (this.isAnchorHoveredFocused) { + return; + } + if (this.delay > 1) { + if (this.showDelayTimer === null) + this.showDelayTimer = window.setTimeout(() => { + this.startHover(); + }, this.delay); + return; + } + this.startHover(); + }; + this.startHover = () => { + this.isAnchorHoveredFocused = true; + this.updateTooltipVisibility(); + }; + this.clearShowDelayTimer = () => { + if (this.showDelayTimer !== null) { + clearTimeout(this.showDelayTimer); + this.showDelayTimer = null; + } + }; + this.getAnchor = () => { + const rootNode = this.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.getElementById(this.anchor); + } + return document.getElementById(this.anchor); + }; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && this.tooltipVisible) { + switch (e.key) { + case keyEscape: + this.isAnchorHoveredFocused = false; + this.updateTooltipVisibility(); + this.$emit("dismiss"); + break; + } + } + }; + this.updateTooltipVisibility = () => { + if (this.visible === false) { + this.hideTooltip(); + } else if (this.visible === true) { + this.showTooltip(); + return; + } else { + if (this.isAnchorHoveredFocused || this.isRegionHovered) { + this.showTooltip(); + return; + } + this.hideTooltip(); + } + }; + this.showTooltip = () => { + if (this.tooltipVisible) { + return; + } + this.currentDirection = getDirection(this); + this.tooltipVisible = true; + document.addEventListener("keydown", this.handleDocumentKeydown); + DOM.queueUpdate(this.setRegionProps); + }; + this.hideTooltip = () => { + if (!this.tooltipVisible) { + return; + } + this.clearHideDelayTimer(); + if (this.region !== null && this.region !== void 0) { + this.region.removeEventListener("positionchange", this.handlePositionChange); + this.region.viewportElement = null; + this.region.anchorElement = null; + this.region.removeEventListener("mouseover", this.handleRegionMouseOver); + this.region.removeEventListener("mouseout", this.handleRegionMouseOut); + } + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.tooltipVisible = false; + }; + this.setRegionProps = () => { + if (!this.tooltipVisible) { + return; + } + this.region.viewportElement = this.viewportElement; + this.region.anchorElement = this.anchorElement; + this.region.addEventListener("positionchange", this.handlePositionChange); + this.region.addEventListener("mouseover", this.handleRegionMouseOver, { + passive: true + }); + this.region.addEventListener("mouseout", this.handleRegionMouseOut, { + passive: true + }); + }; + } + visibleChanged() { + if (this.$fastController.isConnected) { + this.updateTooltipVisibility(); + this.updateLayout(); + } + } + anchorChanged() { + if (this.$fastController.isConnected) { + this.anchorElement = this.getAnchor(); + } + } + positionChanged() { + if (this.$fastController.isConnected) { + this.updateLayout(); + } + } + anchorElementChanged(oldValue) { + if (this.$fastController.isConnected) { + if (oldValue !== null && oldValue !== void 0) { + oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver); + oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut); + oldValue.removeEventListener("focusin", this.handleAnchorFocusIn); + oldValue.removeEventListener("focusout", this.handleAnchorFocusOut); + } + if (this.anchorElement !== null && this.anchorElement !== void 0) { + this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true }); + this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true }); + this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, { + passive: true + }); + this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true }); + const anchorId = this.anchorElement.id; + if (this.anchorElement.parentElement !== null) { + this.anchorElement.parentElement.querySelectorAll(":hover").forEach((element) => { + if (element.id === anchorId) { + this.startShowDelayTimer(); + } + }); + } + } + if (this.region !== null && this.region !== void 0 && this.tooltipVisible) { + this.region.anchorElement = this.anchorElement; + } + this.updateLayout(); + } + } + viewportElementChanged() { + if (this.region !== null && this.region !== void 0) { + this.region.viewportElement = this.viewportElement; + } + this.updateLayout(); + } + connectedCallback() { + super.connectedCallback(); + this.anchorElement = this.getAnchor(); + this.updateTooltipVisibility(); + } + disconnectedCallback() { + this.hideTooltip(); + this.clearShowDelayTimer(); + this.clearHideDelayTimer(); + super.disconnectedCallback(); + } + /** + * updated the properties being passed to the anchored region + */ + updateLayout() { + this.verticalPositioningMode = "locktodefault"; + this.horizontalPositioningMode = "locktodefault"; + switch (this.position) { + case TooltipPosition.top: + case TooltipPosition.bottom: + this.verticalDefaultPosition = this.position; + this.horizontalDefaultPosition = "center"; + break; + case TooltipPosition.right: + case TooltipPosition.left: + case TooltipPosition.start: + case TooltipPosition.end: + this.verticalDefaultPosition = "center"; + this.horizontalDefaultPosition = this.position; + break; + case TooltipPosition.topLeft: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.topRight: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.bottomLeft: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.bottomRight: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.topStart: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.topEnd: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "end"; + break; + case TooltipPosition.bottomStart: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.bottomEnd: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "end"; + break; + default: + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = "center"; + break; + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tooltip.prototype, "visible", void 0); + __decorate([ + attr + ], Tooltip.prototype, "anchor", void 0); + __decorate([ + attr + ], Tooltip.prototype, "delay", void 0); + __decorate([ + attr + ], Tooltip.prototype, "position", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], Tooltip.prototype, "autoUpdateMode", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock" }) + ], Tooltip.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock" }) + ], Tooltip.prototype, "verticalViewportLock", void 0); + __decorate([ + observable + ], Tooltip.prototype, "anchorElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "viewportElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "tooltipVisible", void 0); + __decorate([ + observable + ], Tooltip.prototype, "currentDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js + var init_tooltip2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js"() { + init_tooltip_template(); + init_tooltip(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js + var init_tree_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js + function isTreeItemElement(el2) { + return isHTMLElement(el2) && el2.getAttribute("role") === "treeitem"; + } + var TreeItem; + var init_tree_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TreeItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.expanded = false; + this.focusable = false; + this.isNestedItem = () => { + return isTreeItemElement(this.parentElement); + }; + this.handleExpandCollapseButtonClick = (e) => { + if (!this.disabled && !e.defaultPrevented) { + this.expanded = !this.expanded; + } + }; + this.handleFocus = (e) => { + this.setAttribute("tabindex", "0"); + }; + this.handleBlur = (e) => { + this.setAttribute("tabindex", "-1"); + }; + } + expandedChanged() { + if (this.$fastController.isConnected) { + this.$emit("expanded-change", this); + } + } + selectedChanged() { + if (this.$fastController.isConnected) { + this.$emit("selected-change", this); + } + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.items.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = true; + } + }); + } + } + /** + * Places document focus on a tree item + * + * @public + * @param el - the element to focus + */ + static focusItem(el2) { + el2.focusable = true; + el2.focus(); + } + /** + * Gets number of children + * + * @internal + */ + childItemLength() { + const treeChildren = this.childItems.filter((item) => { + return isTreeItemElement(item); + }); + return treeChildren ? treeChildren.length : 0; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "expanded", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "selected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "disabled", void 0); + __decorate([ + observable + ], TreeItem.prototype, "focusable", void 0); + __decorate([ + observable + ], TreeItem.prototype, "childItems", void 0); + __decorate([ + observable + ], TreeItem.prototype, "items", void 0); + __decorate([ + observable + ], TreeItem.prototype, "nested", void 0); + __decorate([ + observable + ], TreeItem.prototype, "renderCollapsedChildren", void 0); + applyMixins(TreeItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js + var init_tree_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js"() { + init_tree_item_template(); + init_tree_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js + var init_tree_view_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js + var TreeView; + var init_tree_view = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_tree_item(); + init_foundation_element(); + TreeView = class extends FoundationElement { + constructor() { + super(...arguments); + this.currentFocused = null; + this.handleFocus = (e) => { + if (this.slottedTreeItems.length < 1) { + return; + } + if (e.target === this) { + if (this.currentFocused === null) { + this.currentFocused = this.getValidFocusableItem(); + } + if (this.currentFocused !== null) { + TreeItem.focusItem(this.currentFocused); + } + return; + } + if (this.contains(e.target)) { + this.setAttribute("tabindex", "-1"); + this.currentFocused = e.target; + } + }; + this.handleBlur = (e) => { + if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) { + this.setAttribute("tabindex", "0"); + } + }; + this.handleKeyDown = (e) => { + if (e.defaultPrevented) { + return; + } + if (this.slottedTreeItems.length < 1) { + return true; + } + const treeItems = this.getVisibleNodes(); + switch (e.key) { + case keyHome: + if (treeItems.length) { + TreeItem.focusItem(treeItems[0]); + } + return; + case keyEnd: + if (treeItems.length) { + TreeItem.focusItem(treeItems[treeItems.length - 1]); + } + return; + case keyArrowLeft: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) { + item.expanded = false; + } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) { + TreeItem.focusItem(item.parentElement); + } + } + return false; + case keyArrowRight: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) { + item.expanded = true; + } else if (item instanceof TreeItem && item.childItemLength() > 0) { + this.focusNextNode(1, e.target); + } + } + return; + case keyArrowDown: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(1, e.target); + } + return; + case keyArrowUp: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(-1, e.target); + } + return; + case keyEnter: + this.handleClick(e); + return; + } + return true; + }; + this.handleSelectedChange = (e) => { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (item.selected) { + if (this.currentSelected && this.currentSelected !== item) { + this.currentSelected.selected = false; + } + this.currentSelected = item; + } else if (!item.selected && this.currentSelected === item) { + this.currentSelected = null; + } + return; + }; + this.setItems = () => { + const selectedItem = this.treeView.querySelector("[aria-selected='true']"); + this.currentSelected = selectedItem; + if (this.currentFocused === null || !this.contains(this.currentFocused)) { + this.currentFocused = this.getValidFocusableItem(); + } + this.nested = this.checkForNestedItems(); + const treeItems = this.getVisibleNodes(); + treeItems.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = this.nested; + } + }); + }; + this.isFocusableElement = (el2) => { + return isTreeItemElement(el2); + }; + this.isSelectedElement = (el2) => { + return el2.selected; + }; + } + slottedTreeItemsChanged() { + if (this.$fastController.isConnected) { + this.setItems(); + } + } + connectedCallback() { + super.connectedCallback(); + this.setAttribute("tabindex", "0"); + DOM.queueUpdate(() => { + this.setItems(); + }); + } + /** + * Handles click events bubbling up + * + * @internal + */ + handleClick(e) { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (!item.disabled) { + item.selected = !item.selected; + } + return; + } + /** + * Move focus to a tree item based on its offset from the provided item + */ + focusNextNode(delta, item) { + const visibleNodes = this.getVisibleNodes(); + if (!visibleNodes) { + return; + } + const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta]; + if (isHTMLElement(focusItem)) { + TreeItem.focusItem(focusItem); + } + } + /** + * checks if there are any nested tree items + */ + getValidFocusableItem() { + const treeItems = this.getVisibleNodes(); + let focusIndex = treeItems.findIndex(this.isSelectedElement); + if (focusIndex === -1) { + focusIndex = treeItems.findIndex(this.isFocusableElement); + } + if (focusIndex !== -1) { + return treeItems[focusIndex]; + } + return null; + } + /** + * checks if there are any nested tree items + */ + checkForNestedItems() { + return this.slottedTreeItems.some((node) => { + return isTreeItemElement(node) && node.querySelector("[role='treeitem']"); + }); + } + getVisibleNodes() { + return getDisplayedNodes(this, "[role='treeitem']") || []; + } + }; + __decorate([ + attr({ attribute: "render-collapsed-nodes" }) + ], TreeView.prototype, "renderCollapsedNodes", void 0); + __decorate([ + observable + ], TreeView.prototype, "currentSelected", void 0); + __decorate([ + observable + ], TreeView.prototype, "slottedTreeItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js + var init_tree_view2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js"() { + init_tree_view_template(); + init_tree_view(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js + var MatchMediaBehavior, MatchMediaStyleSheetBehavior, forcedColorsStylesheetBehavior, darkModeStylesheetBehavior, lightModeStylesheetBehavior; + var init_match_media_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js"() { + MatchMediaBehavior = class { + /** + * + * @param query - The media query to operate from. + */ + constructor(query) { + this.listenerCache = /* @__PURE__ */ new WeakMap(); + this.query = query; + } + /** + * Binds the behavior to the element. + * @param source - The element for which the behavior is bound. + */ + bind(source) { + const { query } = this; + const listener = this.constructListener(source); + listener.bind(query)(); + query.addListener(listener); + this.listenerCache.set(source, listener); + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + */ + unbind(source) { + const listener = this.listenerCache.get(source); + if (listener) { + this.query.removeListener(listener); + this.listenerCache.delete(source); + } + } + }; + MatchMediaStyleSheetBehavior = class _MatchMediaStyleSheetBehavior extends MatchMediaBehavior { + /** + * Constructs a {@link MatchMediaStyleSheetBehavior} instance. + * @param query - The media query to operate from. + * @param styles - The styles to coordinate with the query. + */ + constructor(query, styles) { + super(query); + this.styles = styles; + } + /** + * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for + * a provided query. + * @param query - The media query to operate from. + * + * @public + * @example + * + * ```ts + * import { css } from "@microsoft/fast-element"; + * import { MatchMediaStyleSheetBehavior } from "@microsoft/fast-foundation"; + * + * const landscapeBehavior = MatchMediaStyleSheetBehavior.with( + * window.matchMedia("(orientation: landscape)") + * ); + * const styles = css` + * :host { + * width: 200px; + * height: 400px; + * } + * ` + * .withBehaviors(landscapeBehavior(css` + * :host { + * width: 400px; + * height: 200px; + * } + * `)) + * ``` + */ + static with(query) { + return (styles) => { + return new _MatchMediaStyleSheetBehavior(query, styles); + }; + } + /** + * Constructs a match-media listener for a provided element. + * @param source - the element for which to attach or detach styles. + * @internal + */ + constructListener(source) { + let attached = false; + const styles = this.styles; + return function listener() { + const { matches: matches2 } = this; + if (matches2 && !attached) { + source.$fastController.addStyles(styles); + attached = matches2; + } else if (!matches2 && attached) { + source.$fastController.removeStyles(styles); + attached = matches2; + } + }; + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + * @internal + */ + unbind(source) { + super.unbind(source); + source.$fastController.removeStyles(this.styles); + } + }; + forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)")); + darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)")); + lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)")); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js + var init_property_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js + var disabledCursor; + var init_disabled = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js"() { + disabledCursor = "not-allowed"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js + function display(displayValue) { + return `${hidden}:host{display:${displayValue}}`; + } + var hidden; + var init_display = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js"() { + hidden = `:host([hidden]){display:none}`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js + var focusVisible; + var init_focus = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js"() { + init_dist2(); + focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js + var init_style = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js"() { + init_disabled(); + init_display(); + init_focus(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js + var init_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js"() { + init_apply_mixins(); + init_composed_parent(); + init_match_media_stylesheet_behavior(); + init_property_stylesheet_behavior(); + init_style(); + init_direction(); + init_whitespace_filter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/index.js + var init_esm2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/index.js"() { + init_accordion_item2(); + init_accordion2(); + init_anchor2(); + init_anchored_region2(); + init_avatar2(); + init_badge2(); + init_breadcrumb_item2(); + init_breadcrumb2(); + init_button2(); + init_calendar2(); + init_card2(); + init_checkbox2(); + init_combobox2(); + init_data_grid2(); + init_design_system2(); + init_design_token(); + init_di2(); + init_dialog2(); + init_disclosure2(); + init_divider2(); + init_flipper2(); + init_form_associated2(); + init_foundation_element2(); + init_listbox_option2(); + init_listbox2(); + init_picker2(); + init_menu_item2(); + init_menu2(); + init_number_field2(); + init_patterns(); + init_progress_ring(); + init_progress(); + init_radio_group2(); + init_radio2(); + init_horizontal_scroll2(); + init_search2(); + init_select2(); + init_skeleton2(); + init_slider_label2(); + init_slider2(); + init_switch2(); + init_tab_panel2(); + init_tab2(); + init_tabs2(); + init_text_area2(); + init_text_field2(); + init_toolbar2(); + init_tooltip2(); + init_tree_item2(); + init_tree_view2(); + init_utilities(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js + function provideVSCodeDesignSystem(element) { + return DesignSystem.getOrCreate(element).withPrefix("vscode"); + } + var init_vscode_design_system = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js"() { + init_esm2(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js + function initThemeChangeListener(tokenMappings2) { + window.addEventListener("load", () => { + const observer = new MutationObserver(() => { + applyCurrentTheme(tokenMappings2); + }); + observer.observe(document.body, { + attributes: true, + attributeFilter: ["class"] + }); + applyCurrentTheme(tokenMappings2); + }); + } + function applyCurrentTheme(tokenMappings2) { + const styles = getComputedStyle(document.body); + const body = document.querySelector("body"); + if (body) { + const themeKind = body.getAttribute("data-vscode-theme-kind"); + for (const [vscodeTokenName, toolkitToken] of tokenMappings2) { + let value = styles.getPropertyValue(vscodeTokenName).toString(); + if (themeKind === "vscode-high-contrast") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + value = "transparent"; + } + if (toolkitToken.name === "button-icon-hover-background") { + value = "transparent"; + } + } else if (themeKind === "vscode-high-contrast-light") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + switch (toolkitToken.name) { + case "button-primary-hover-background": + value = "#0F4A85"; + break; + case "button-secondary-hover-background": + value = "transparent"; + break; + case "button-icon-hover-background": + value = "transparent"; + break; + } + } + } else { + if (toolkitToken.name === "contrast-active-border") { + value = "transparent"; + } + } + toolkitToken.setValueFor(body, value); + } + } + } + var init_applyTheme = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js + function create2(name, vscodeThemeVar) { + const designToken = DesignToken.create(name); + if (vscodeThemeVar) { + if (vscodeThemeVar.includes("--fake-vscode-token")) { + const uniqueId2 = "id" + Math.random().toString(16).slice(2); + vscodeThemeVar = `${vscodeThemeVar}-${uniqueId2}`; + } + tokenMappings.set(vscodeThemeVar, designToken); + } + if (!isThemeListenerInitialized) { + initThemeChangeListener(tokenMappings); + isThemeListenerInitialized = true; + } + return designToken; + } + var tokenMappings, isThemeListenerInitialized; + var init_create = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js"() { + init_esm2(); + init_applyTheme(); + tokenMappings = /* @__PURE__ */ new Map(); + isThemeListenerInitialized = false; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js + var background, borderWidth, contrastActiveBorder, contrastBorder, cornerRadius, cornerRadiusRound, designUnit, disabledOpacity, focusBorder, fontFamily, fontWeight, foreground, inputHeight, inputMinWidth, typeRampBaseFontSize, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1LineHeight, scrollbarWidth, scrollbarHeight, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, badgeBackground, badgeForeground, buttonBorder, buttonIconBackground, buttonIconCornerRadius, buttonIconFocusBorderOffset, buttonIconHoverBackground, buttonIconPadding, buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonPaddingHorizontal, buttonPaddingVertical, checkboxBackground, checkboxBorder, checkboxCornerRadius, checkboxForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, dividerBackground, dropdownBackground, dropdownBorder, dropdownForeground, dropdownListMaxHeight, inputBackground, inputForeground, inputPlaceholderForeground, linkActiveForeground, linkForeground, progressBackground, panelTabActiveBorder, panelTabActiveForeground, panelTabForeground, panelViewBackground, panelViewBorder, tagCornerRadius; + var init_design_tokens = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js"() { + init_create(); + background = create2("background", "--vscode-editor-background").withDefault("#1e1e1e"); + borderWidth = create2("border-width").withDefault(1); + contrastActiveBorder = create2("contrast-active-border", "--vscode-contrastActiveBorder").withDefault("#f38518"); + contrastBorder = create2("contrast-border", "--vscode-contrastBorder").withDefault("#6fc3df"); + cornerRadius = create2("corner-radius").withDefault(0); + cornerRadiusRound = create2("corner-radius-round").withDefault(2); + designUnit = create2("design-unit").withDefault(4); + disabledOpacity = create2("disabled-opacity").withDefault(0.4); + focusBorder = create2("focus-border", "--vscode-focusBorder").withDefault("#007fd4"); + fontFamily = create2("font-family", "--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"); + fontWeight = create2("font-weight", "--vscode-font-weight").withDefault("400"); + foreground = create2("foreground", "--vscode-foreground").withDefault("#cccccc"); + inputHeight = create2("input-height").withDefault("26"); + inputMinWidth = create2("input-min-width").withDefault("100px"); + typeRampBaseFontSize = create2("type-ramp-base-font-size", "--vscode-font-size").withDefault("13px"); + typeRampBaseLineHeight = create2("type-ramp-base-line-height").withDefault("normal"); + typeRampMinus1FontSize = create2("type-ramp-minus1-font-size").withDefault("11px"); + typeRampMinus1LineHeight = create2("type-ramp-minus1-line-height").withDefault("16px"); + typeRampMinus2FontSize = create2("type-ramp-minus2-font-size").withDefault("9px"); + typeRampMinus2LineHeight = create2("type-ramp-minus2-line-height").withDefault("16px"); + typeRampPlus1FontSize = create2("type-ramp-plus1-font-size").withDefault("16px"); + typeRampPlus1LineHeight = create2("type-ramp-plus1-line-height").withDefault("24px"); + scrollbarWidth = create2("scrollbarWidth").withDefault("10px"); + scrollbarHeight = create2("scrollbarHeight").withDefault("10px"); + scrollbarSliderBackground = create2("scrollbar-slider-background", "--vscode-scrollbarSlider-background").withDefault("#79797966"); + scrollbarSliderHoverBackground = create2("scrollbar-slider-hover-background", "--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"); + scrollbarSliderActiveBackground = create2("scrollbar-slider-active-background", "--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"); + badgeBackground = create2("badge-background", "--vscode-badge-background").withDefault("#4d4d4d"); + badgeForeground = create2("badge-foreground", "--vscode-badge-foreground").withDefault("#ffffff"); + buttonBorder = create2("button-border", "--vscode-button-border").withDefault("transparent"); + buttonIconBackground = create2("button-icon-background").withDefault("transparent"); + buttonIconCornerRadius = create2("button-icon-corner-radius").withDefault("5px"); + buttonIconFocusBorderOffset = create2("button-icon-outline-offset").withDefault(0); + buttonIconHoverBackground = create2("button-icon-hover-background", "--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"); + buttonIconPadding = create2("button-icon-padding").withDefault("3px"); + buttonPrimaryBackground = create2("button-primary-background", "--vscode-button-background").withDefault("#0e639c"); + buttonPrimaryForeground = create2("button-primary-foreground", "--vscode-button-foreground").withDefault("#ffffff"); + buttonPrimaryHoverBackground = create2("button-primary-hover-background", "--vscode-button-hoverBackground").withDefault("#1177bb"); + buttonSecondaryBackground = create2("button-secondary-background", "--vscode-button-secondaryBackground").withDefault("#3a3d41"); + buttonSecondaryForeground = create2("button-secondary-foreground", "--vscode-button-secondaryForeground").withDefault("#ffffff"); + buttonSecondaryHoverBackground = create2("button-secondary-hover-background", "--vscode-button-secondaryHoverBackground").withDefault("#45494e"); + buttonPaddingHorizontal = create2("button-padding-horizontal").withDefault("11px"); + buttonPaddingVertical = create2("button-padding-vertical").withDefault("4px"); + checkboxBackground = create2("checkbox-background", "--vscode-checkbox-background").withDefault("#3c3c3c"); + checkboxBorder = create2("checkbox-border", "--vscode-checkbox-border").withDefault("#3c3c3c"); + checkboxCornerRadius = create2("checkbox-corner-radius").withDefault(3); + checkboxForeground = create2("checkbox-foreground", "--vscode-checkbox-foreground").withDefault("#f0f0f0"); + listActiveSelectionBackground = create2("list-active-selection-background", "--vscode-list-activeSelectionBackground").withDefault("#094771"); + listActiveSelectionForeground = create2("list-active-selection-foreground", "--vscode-list-activeSelectionForeground").withDefault("#ffffff"); + listHoverBackground = create2("list-hover-background", "--vscode-list-hoverBackground").withDefault("#2a2d2e"); + dividerBackground = create2("divider-background", "--vscode-settings-dropdownListBorder").withDefault("#454545"); + dropdownBackground = create2("dropdown-background", "--vscode-dropdown-background").withDefault("#3c3c3c"); + dropdownBorder = create2("dropdown-border", "--vscode-dropdown-border").withDefault("#3c3c3c"); + dropdownForeground = create2("dropdown-foreground", "--vscode-dropdown-foreground").withDefault("#f0f0f0"); + dropdownListMaxHeight = create2("dropdown-list-max-height").withDefault("200px"); + inputBackground = create2("input-background", "--vscode-input-background").withDefault("#3c3c3c"); + inputForeground = create2("input-foreground", "--vscode-input-foreground").withDefault("#cccccc"); + inputPlaceholderForeground = create2("input-placeholder-foreground", "--vscode-input-placeholderForeground").withDefault("#cccccc"); + linkActiveForeground = create2("link-active-foreground", "--vscode-textLink-activeForeground").withDefault("#3794ff"); + linkForeground = create2("link-foreground", "--vscode-textLink-foreground").withDefault("#3794ff"); + progressBackground = create2("progress-background", "--vscode-progressBar-background").withDefault("#0e70c0"); + panelTabActiveBorder = create2("panel-tab-active-border", "--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"); + panelTabActiveForeground = create2("panel-tab-active-foreground", "--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"); + panelTabForeground = create2("panel-tab-foreground", "--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"); + panelViewBackground = create2("panel-view-background", "--vscode-panel-background").withDefault("#1e1e1e"); + panelViewBorder = create2("panel-view-border", "--vscode-panel-border").withDefault("#80808059"); + tagCornerRadius = create2("tag-corner-radius").withDefault("2px"); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js + var badgeStyles; + var init_badge_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + badgeStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + text-align: center; + } + .control { + align-items: center; + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: 11px; + box-sizing: border-box; + color: ${badgeForeground}; + display: flex; + height: calc(${designUnit} * 4px); + justify-content: center; + min-width: calc(${designUnit} * 4px + 2px); + min-height: calc(${designUnit} * 4px + 2px); + padding: 3px 6px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js + var Badge2, vsCodeBadge; + var init_badge3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js"() { + init_esm2(); + init_badge_styles(); + Badge2 = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.circular) { + this.circular = true; + } + } + }; + vsCodeBadge = Badge2.compose({ + baseName: "badge", + template: badgeTemplate, + styles: badgeStyles + }); + } + }); + + // node_modules/tslib/tslib.es6.mjs + function __decorate2(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es62 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js + var BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles, buttonStyles; + var init_button_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + BaseButtonStyles = css` + ${display("inline-flex")} :host { + outline: none; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${buttonPrimaryForeground}; + background: ${buttonPrimaryBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + fill: currentColor; + cursor: pointer; + } + .control { + background: transparent; + height: inherit; + flex-grow: 1; + box-sizing: border-box; + display: inline-flex; + justify-content: center; + align-items: center; + padding: ${buttonPaddingVertical} ${buttonPaddingHorizontal}; + white-space: wrap; + outline: none; + text-decoration: none; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + color: inherit; + border-radius: inherit; + fill: inherit; + cursor: inherit; + font-family: inherit; + } + :host(:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host(:active) { + background: ${buttonPrimaryBackground}; + } + .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + .control::-moz-focus-inner { + border: 0; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + background: ${buttonPrimaryBackground}; + cursor: ${disabledCursor}; + } + .content { + display: flex; + } + .start { + display: flex; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-end: 8px; + } +`; + PrimaryButtonStyles = css` + :host([appearance='primary']) { + background: ${buttonPrimaryBackground}; + color: ${buttonPrimaryForeground}; + } + :host([appearance='primary']:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host([appearance='primary']:active) .control:active { + background: ${buttonPrimaryBackground}; + } + :host([appearance='primary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='primary'][disabled]) { + background: ${buttonPrimaryBackground}; + } +`; + SecondaryButtonStyles = css` + :host([appearance='secondary']) { + background: ${buttonSecondaryBackground}; + color: ${buttonSecondaryForeground}; + } + :host([appearance='secondary']:hover) { + background: ${buttonSecondaryHoverBackground}; + } + :host([appearance='secondary']:active) .control:active { + background: ${buttonSecondaryBackground}; + } + :host([appearance='secondary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='secondary'][disabled]) { + background: ${buttonSecondaryBackground}; + } +`; + IconButtonStyles = css` + :host([appearance='icon']) { + background: ${buttonIconBackground}; + border-radius: ${buttonIconCornerRadius}; + color: ${foreground}; + } + :host([appearance='icon']:hover) { + background: ${buttonIconHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } + :host([appearance='icon']) .control { + padding: ${buttonIconPadding}; + border: none; + } + :host([appearance='icon']:active) .control:active { + background: ${buttonIconHoverBackground}; + } + :host([appearance='icon']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: ${buttonIconFocusBorderOffset}; + } + :host([appearance='icon'][disabled]) { + background: ${buttonIconBackground}; + } +`; + buttonStyles = (context, definition) => css` + ${BaseButtonStyles} + ${PrimaryButtonStyles} + ${SecondaryButtonStyles} + ${IconButtonStyles} +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/index.js + var Button2, vsCodeButton; + var init_button3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/index.js"() { + init_tslib_es62(); + init_esm(); + init_esm2(); + init_button_styles(); + Button2 = class extends Button { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.appearance) { + const appearanceValue = this.getAttribute("appearance"); + this.appearance = appearanceValue; + } + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "appearance" && newVal === "icon") { + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.ariaLabel = "Icon Button"; + } + } + if (attrName === "aria-label") { + this.ariaLabel = newVal; + } + if (attrName === "disabled") { + this.disabled = newVal !== null; + } + } + }; + __decorate2([ + attr + ], Button2.prototype, "appearance", void 0); + vsCodeButton = Button2.compose({ + baseName: "button", + template: buttonTemplate, + styles: buttonStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js + var checkboxStyles; + var init_checkbox_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + checkboxStyles = (context, defintiion) => css` + ${display("inline-flex")} :host { + align-items: center; + outline: none; + margin: calc(${designUnit} * 1px) 0; + user-select: none; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control { + position: relative; + width: calc(${designUnit} * 4px + 2px); + height: calc(${designUnit} * 4px + 2px); + box-sizing: border-box; + border-radius: calc(${checkboxCornerRadius} * 1px); + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + background: ${checkboxBackground}; + outline: none; + cursor: pointer; + } + .label { + font-family: ${fontFamily}; + color: ${foreground}; + padding-inline-start: calc(${designUnit} * 2px + 2px); + margin-inline-end: calc(${designUnit} * 2px + 2px); + cursor: pointer; + } + .label__hidden { + display: none; + visibility: hidden; + } + .checked-indicator { + width: 100%; + height: 100%; + display: block; + fill: ${foreground}; + opacity: 0; + pointer-events: none; + } + .indeterminate-indicator { + border-radius: 2px; + background: ${foreground}; + position: absolute; + top: 50%; + left: 50%; + width: 50%; + height: 50%; + transform: translate(-50%, -50%); + opacity: 0; + } + :host(:enabled) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:enabled) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host(.disabled) .label, + :host(.readonly) .label, + :host(.readonly) .control, + :host(.disabled) .control { + cursor: ${disabledCursor}; + } + :host(.checked:not(.indeterminate)) .checked-indicator, + :host(.indeterminate) .indeterminate-indicator { + opacity: 1; + } + :host(.disabled) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js + var Checkbox2, vsCodeCheckbox; + var init_checkbox3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js"() { + init_esm2(); + init_checkbox_styles(); + Checkbox2 = class extends Checkbox { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Checkbox"); + } + } + }; + vsCodeCheckbox = Checkbox2.compose({ + baseName: "checkbox", + template: checkboxTemplate, + styles: checkboxStyles, + checkedIndicator: ` + + + + `, + indeterminateIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js + var dataGridStyles; + var init_data_grid_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js"() { + init_esm(); + dataGridStyles = (context, definition) => css` + :host { + display: flex; + position: relative; + flex-direction: column; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js + var dataGridRowStyles; + var init_data_grid_row_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js"() { + init_esm(); + init_design_tokens(); + dataGridRowStyles = (context, definition) => css` + :host { + display: grid; + padding: calc((${designUnit} / 4) * 1px) 0; + box-sizing: border-box; + width: 100%; + background: transparent; + } + :host(.header) { + } + :host(.sticky-header) { + background: ${background}; + position: sticky; + top: 0; + } + :host(:hover) { + background: ${listHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js + var dataGridCellStyles; + var init_data_grid_cell_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dataGridCellStyles = (context, definition) => css` + :host { + padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px); + color: ${foreground}; + opacity: 1; + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + font-weight: 400; + border: solid calc(${borderWidth} * 1px) transparent; + border-radius: calc(${cornerRadius} * 1px); + white-space: wrap; + overflow-wrap: anywhere; + } + :host(.column-header) { + font-weight: 600; + } + :host(:${focusVisible}), + :host(:focus), + :host(:active) { + background: ${listActiveSelectionBackground}; + border: solid calc(${borderWidth} * 1px) ${focusBorder}; + color: ${listActiveSelectionForeground}; + outline: none; + } + :host(:${focusVisible}) ::slotted(*), + :host(:focus) ::slotted(*), + :host(:active) ::slotted(*) { + color: ${listActiveSelectionForeground} !important; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js + var DataGrid2, vsCodeDataGrid, DataGridRow2, vsCodeDataGridRow, DataGridCell2, vsCodeDataGridCell; + var init_data_grid3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js"() { + init_esm2(); + init_data_grid_styles(); + init_data_grid_row_styles(); + init_data_grid_cell_styles(); + DataGrid2 = class extends DataGrid { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Data Grid"); + } + } + }; + vsCodeDataGrid = DataGrid2.compose({ + baseName: "data-grid", + baseClass: DataGrid, + template: dataGridTemplate, + styles: dataGridStyles + }); + DataGridRow2 = class extends DataGridRow { + }; + vsCodeDataGridRow = DataGridRow2.compose({ + baseName: "data-grid-row", + baseClass: DataGridRow, + template: dataGridRowTemplate, + styles: dataGridRowStyles + }); + DataGridCell2 = class extends DataGridCell { + }; + vsCodeDataGridCell = DataGridCell2.compose({ + baseName: "data-grid-cell", + baseClass: DataGridCell, + template: dataGridCellTemplate, + styles: dataGridCellStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js + var dividerStyles; + var init_divider_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dividerStyles = (context, definition) => css` + ${display("block")} :host { + border: none; + border-top: calc(${borderWidth} * 1px) solid ${dividerBackground}; + box-sizing: content-box; + height: 0; + margin: calc(${designUnit} * 1px) 0; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js + var Divider2, vsCodeDivider; + var init_divider3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js"() { + init_esm2(); + init_divider_styles(); + Divider2 = class extends Divider { + }; + vsCodeDivider = Divider2.compose({ + baseName: "divider", + template: dividerTemplate, + styles: dividerStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js + var dropdownStyles; + var init_dropdown_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dropdownStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: ${dropdownBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + color: ${foreground}; + contain: contents; + font-family: ${fontFamily}; + height: calc(${inputHeight} * 1px); + position: relative; + user-select: none; + min-width: ${inputMinWidth}; + outline: none; + vertical-align: top; + } + .control { + align-items: center; + box-sizing: border-box; + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + cursor: pointer; + display: flex; + font-family: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + min-height: 100%; + padding: 2px 6px 2px 8px; + width: 100%; + } + .listbox { + background: ${dropdownBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + display: inline-flex; + flex-direction: column; + left: 0; + max-height: ${dropdownListMaxHeight}; + padding: 0; + overflow-y: auto; + position: absolute; + width: 100%; + z-index: 1; + } + .listbox[hidden] { + display: none; + } + :host(:${focusVisible}) .control { + border-color: ${focusBorder}; + } + :host(:not([disabled]):hover) { + background: ${dropdownBackground}; + border-color: ${dropdownBorder}; + } + :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + cursor: ${disabledCursor}; + user-select: none; + } + :host([disabled]:hover) { + background: ${dropdownBackground}; + color: ${foreground}; + fill: currentcolor; + } + :host(:not([disabled])) .control:active { + border-color: ${focusBorder}; + } + :host(:empty) .listbox { + display: none; + } + :host([open]) .control { + border-color: ${focusBorder}; + } + :host([open][position='above']) .listbox { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + :host([open][position='below']) .listbox { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + :host([open][position='above']) .listbox { + bottom: calc(${inputHeight} * 1px); + } + :host([open][position='below']) .listbox { + top: calc(${inputHeight} * 1px); + } + .selected-value { + flex: 1 1 auto; + font-family: inherit; + overflow: hidden; + text-align: start; + text-overflow: ellipsis; + white-space: nowrap; + } + .indicator { + flex: 0 0 auto; + margin-inline-start: 1em; + } + slot[name='listbox'] { + display: none; + width: 100%; + } + :host([open]) slot[name='listbox'] { + display: flex; + position: absolute; + } + .end { + margin-inline-start: auto; + } + .start, + .end, + .indicator, + .select-indicator, + ::slotted(svg), + ::slotted(span) { + fill: currentcolor; + height: 1em; + min-height: calc(${designUnit} * 4px); + min-width: calc(${designUnit} * 4px); + width: 1em; + } + ::slotted([role='option']), + ::slotted(option) { + flex: 0 0 auto; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js + var Dropdown, vsCodeDropdown; + var init_dropdown = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js"() { + init_esm2(); + init_dropdown_styles(); + Dropdown = class extends Select { + }; + vsCodeDropdown = Dropdown.compose({ + baseName: "dropdown", + template: selectTemplate, + styles: dropdownStyles, + indicator: ` + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js + var linkStyles; + var init_link_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + linkStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: transparent; + box-sizing: border-box; + color: ${linkForeground}; + cursor: pointer; + fill: currentcolor; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + outline: none; + } + .control { + background: transparent; + border: calc(${borderWidth} * 1px) solid transparent; + border-radius: calc(${cornerRadius} * 1px); + box-sizing: border-box; + color: inherit; + cursor: inherit; + fill: inherit; + font-family: inherit; + height: inherit; + padding: 0; + outline: none; + text-decoration: none; + word-break: break-word; + } + .control::-moz-focus-inner { + border: 0; + } + :host(:hover) { + color: ${linkActiveForeground}; + } + :host(:hover) .content { + text-decoration: underline; + } + :host(:active) { + background: transparent; + color: ${linkActiveForeground}; + } + :host(:${focusVisible}) .control, + :host(:focus) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/index.js + var Link, vsCodeLink; + var init_link = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/index.js"() { + init_esm2(); + init_link_styles(); + Link = class extends Anchor { + }; + vsCodeLink = Link.compose({ + baseName: "link", + template: anchorTemplate, + styles: linkStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js + var optionStyles; + var init_option_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + optionStyles = (context, definition) => css` + ${display("inline-flex")} :host { + font-family: var(--body-font); + border-radius: ${cornerRadius}; + border: calc(${borderWidth} * 1px) solid transparent; + box-sizing: border-box; + color: ${foreground}; + cursor: pointer; + fill: currentcolor; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: 0; + outline: none; + overflow: hidden; + padding: 0 calc((${designUnit} / 2) * 1px) + calc((${designUnit} / 4) * 1px); + user-select: none; + white-space: nowrap; + } + :host(:${focusVisible}) { + border-color: ${focusBorder}; + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([aria-selected='true']) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:active) { + background: ${listActiveSelectionBackground}; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):hover) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):active) { + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]:hover) { + background-color: inherit; + } + .content { + grid-column-start: 2; + justify-self: start; + overflow: hidden; + text-overflow: ellipsis; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/index.js + var Option2, vsCodeOption; + var init_option = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/index.js"() { + init_esm2(); + init_option_styles(); + Option2 = class extends ListboxOption { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Option"); + } + } + }; + vsCodeOption = Option2.compose({ + baseName: "option", + template: listboxOptionTemplate, + styles: optionStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js + var panelsStyles; + var init_panels_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelsStyles = (context, definition) => css` + ${display("grid")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${foreground}; + grid-template-columns: auto 1fr auto; + grid-template-rows: auto 1fr; + overflow-x: auto; + } + .tablist { + display: grid; + grid-template-rows: auto auto; + grid-template-columns: auto; + column-gap: calc(${designUnit} * 8px); + position: relative; + width: max-content; + align-self: end; + padding: calc(${designUnit} * 1px) calc(${designUnit} * 1px) 0; + box-sizing: border-box; + } + .start, + .end { + align-self: center; + } + .activeIndicator { + grid-row: 2; + grid-column: 1; + width: 100%; + height: calc((${designUnit} / 4) * 1px); + justify-self: center; + background: ${panelTabActiveForeground}; + margin: 0; + border-radius: calc(${cornerRadius} * 1px); + } + .activeIndicatorTransition { + transition: transform 0.01s linear; + } + .tabpanel { + grid-row: 2; + grid-column-start: 1; + grid-column-end: 4; + position: relative; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js + var panelTabStyles; + var init_panel_tab_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelTabStyles = (context, definition) => css` + ${display("inline-flex")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + height: calc(${designUnit} * 7px); + padding: calc(${designUnit} * 1px) 0; + color: ${panelTabForeground}; + fill: currentcolor; + border-radius: calc(${cornerRadius} * 1px); + border: solid calc(${borderWidth} * 1px) transparent; + align-items: center; + justify-content: center; + grid-row: 1; + cursor: pointer; + } + :host(:hover) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:active) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:hover) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:active) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:${focusVisible}) { + outline: none; + border: solid calc(${borderWidth} * 1px) ${panelTabActiveBorder}; + } + :host(:focus) { + outline: none; + } + ::slotted(vscode-badge) { + margin-inline-start: calc(${designUnit} * 2px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js + var panelViewStyles; + var init_panel_view_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelViewStyles = (context, definition) => css` + ${display("flex")} :host { + color: inherit; + background-color: transparent; + border: solid calc(${borderWidth} * 1px) transparent; + box-sizing: border-box; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: 10px calc((${designUnit} + 2) * 1px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js + var Panels, vsCodePanels, PanelTab, vsCodePanelTab, PanelView, vsCodePanelView; + var init_panels = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js"() { + init_esm2(); + init_panels_styles(); + init_panel_tab_styles(); + init_panel_view_styles(); + Panels = class extends Tabs { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.orientation) { + this.orientation = TabsOrientation.horizontal; + } + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Panels"); + } + } + }; + vsCodePanels = Panels.compose({ + baseName: "panels", + template: tabsTemplate, + styles: panelsStyles + }); + PanelTab = class extends Tab { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.disabled) { + this.disabled = false; + } + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } + } + }; + vsCodePanelTab = PanelTab.compose({ + baseName: "panel-tab", + template: tabTemplate, + styles: panelTabStyles + }); + PanelView = class extends TabPanel { + }; + vsCodePanelView = PanelView.compose({ + baseName: "panel-view", + template: tabPanelTemplate, + styles: panelViewStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js + var progressRingStyles; + var init_progress_ring_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + progressRingStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: center; + outline: none; + height: calc(${designUnit} * 7px); + width: calc(${designUnit} * 7px); + margin: 0; + } + .progress { + height: 100%; + width: 100%; + } + .background { + fill: none; + stroke: transparent; + stroke-width: calc(${designUnit} / 2 * 1px); + } + .indeterminate-indicator-1 { + fill: none; + stroke: ${progressBackground}; + stroke-width: calc(${designUnit} / 2 * 1px); + stroke-linecap: square; + transform-origin: 50% 50%; + transform: rotate(-90deg); + transition: all 0.2s ease-in-out; + animation: spin-infinite 2s linear infinite; + } + @keyframes spin-infinite { + 0% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(0deg); + } + 50% { + stroke-dasharray: 21.99px 21.99px; + transform: rotate(450deg); + } + 100% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(1080deg); + } + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js + var ProgressRing, vsCodeProgressRing; + var init_progress_ring2 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js"() { + init_esm2(); + init_progress_ring_styles(); + ProgressRing = class extends BaseProgress { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.paused) { + this.paused = false; + } + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-live", "assertive"); + this.setAttribute("role", "alert"); + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "value") { + this.removeAttribute("value"); + } + } + }; + vsCodeProgressRing = ProgressRing.compose({ + baseName: "progress-ring", + template: progressRingTemplate, + styles: progressRingStyles, + indeterminateIndicator: ` + + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js + var radioGroupStyles; + var init_radio_group_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioGroupStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: flex-start; + margin: calc(${designUnit} * 1px) 0; + flex-direction: column; + } + .positioning-region { + display: flex; + flex-wrap: wrap; + } + :host([orientation='vertical']) .positioning-region { + flex-direction: column; + } + :host([orientation='horizontal']) .positioning-region { + flex-direction: row; + } + ::slotted([slot='label']) { + color: ${foreground}; + font-size: ${typeRampBaseFontSize}; + margin: calc(${designUnit} * 1px) 0; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js + var RadioGroup2, vsCodeRadioGroup; + var init_radio_group3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js"() { + init_dist2(); + init_esm2(); + init_radio_group_styles(); + RadioGroup2 = class extends RadioGroup { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const label = this.querySelector("label"); + if (label) { + const id = "radio-group-" + Math.random().toString(16).slice(2); + label.setAttribute("id", id); + this.setAttribute("aria-labelledby", id); + } + } + }; + vsCodeRadioGroup = RadioGroup2.compose({ + baseName: "radio-group", + template: radioGroupTemplate, + styles: radioGroupStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js + var radioStyles; + var init_radio_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioStyles = (context, definition) => css` + ${display("inline-flex")} :host { + align-items: center; + flex-direction: row; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: calc(${designUnit} * 1px) 0; + outline: none; + position: relative; + transition: all 0.2s ease-in-out; + user-select: none; + } + .control { + background: ${checkboxBackground}; + border-radius: 999px; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + box-sizing: border-box; + cursor: pointer; + height: calc(${designUnit} * 4px); + position: relative; + outline: none; + width: calc(${designUnit} * 4px); + } + .label { + color: ${foreground}; + cursor: pointer; + font-family: ${fontFamily}; + margin-inline-end: calc(${designUnit} * 2px + 2px); + padding-inline-start: calc(${designUnit} * 2px + 2px); + } + .label__hidden { + display: none; + visibility: hidden; + } + .control, + .checked-indicator { + flex-shrink: 0; + } + .checked-indicator { + background: ${foreground}; + border-radius: 999px; + display: inline-block; + inset: calc(${designUnit} * 1px); + opacity: 0; + pointer-events: none; + position: absolute; + } + :host(:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:not([disabled])) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked='true']) .control { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:active { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked="true"]:${focusVisible}:not([disabled])) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([aria-checked='true']) .checked-indicator { + opacity: 1; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js + var Radio2, vsCodeRadio; + var init_radio3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js"() { + init_esm2(); + init_radio_styles(); + Radio2 = class extends Radio { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Radio"); + } + } + }; + vsCodeRadio = Radio2.compose({ + baseName: "radio", + template: radioTemplate, + styles: radioStyles, + checkedIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js + var tagStyles; + var init_tag_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + tagStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + } + .control { + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: ${tagCornerRadius}; + color: ${badgeForeground}; + padding: calc(${designUnit} * 0.5px) calc(${designUnit} * 1px); + text-transform: uppercase; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js + var Tag, vsCodeTag; + var init_tag = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js"() { + init_esm2(); + init_tag_styles(); + Tag = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.circular) { + this.circular = false; + } + } + }; + vsCodeTag = Tag.compose({ + baseName: "tag", + template: badgeTemplate, + styles: tagStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js + var textAreaStyles; + var init_text_area_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textAreaStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .control { + box-sizing: border-box; + position: relative; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + font: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: calc(${designUnit} * 2px + 1px); + width: 100%; + min-width: ${inputMinWidth}; + resize: none; + } + .control:hover:enabled { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + .control:active:enabled { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .control::-webkit-scrollbar { + width: ${scrollbarWidth}; + height: ${scrollbarHeight}; + } + .control::-webkit-scrollbar-corner { + background: ${inputBackground}; + } + .control::-webkit-scrollbar-thumb { + background: ${scrollbarSliderBackground}; + } + .control::-webkit-scrollbar-thumb:hover { + background: ${scrollbarSliderHoverBackground}; + } + .control::-webkit-scrollbar-thumb:active { + background: ${scrollbarSliderActiveBackground}; + } + :host(:focus-within:not([disabled])) .control { + border-color: ${focusBorder}; + } + :host([resize='both']) .control { + resize: both; + } + :host([resize='horizontal']) .control { + resize: horizontal; + } + :host([resize='vertical']) .control { + resize: vertical; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js + var TextArea2, vsCodeTextArea; + var init_text_area3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js"() { + init_esm2(); + init_text_area_styles(); + TextArea2 = class extends TextArea { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text area"); + } + } + }; + vsCodeTextArea = TextArea2.compose({ + baseName: "text-area", + template: textAreaTemplate, + styles: textAreaStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js + var textFieldStyles; + var init_text_field_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textFieldStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .root { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: row; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + height: calc(${inputHeight} * 1px); + min-width: ${inputMinWidth}; + } + .control { + -webkit-appearance: none; + font: inherit; + background: transparent; + border: 0; + color: inherit; + height: calc(100% - (${designUnit} * 1px)); + width: 100%; + margin-top: auto; + margin-bottom: auto; + border: none; + padding: 0 calc(${designUnit} * 2px + 1px); + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + .start, + .end { + display: flex; + margin: auto; + fill: currentcolor; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-start: calc(${designUnit} * 2px); + } + .end { + margin-inline-end: calc(${designUnit} * 2px); + } + :host(:hover:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + :host(:active:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + :host(:focus-within:not([disabled])) .root { + border-color: ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js + var TextField2, vsCodeTextField; + var init_text_field3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js"() { + init_esm2(); + init_text_field_styles(); + TextField2 = class extends TextField { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text field"); + } + } + }; + vsCodeTextField = TextField2.compose({ + baseName: "text-field", + template: textFieldTemplate, + styles: textFieldStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js + var allComponents; + var init_custom_elements = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js"() { + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + allComponents = { + vsCodeBadge, + vsCodeButton, + vsCodeCheckbox, + vsCodeDataGrid, + vsCodeDataGridCell, + vsCodeDataGridRow, + vsCodeDivider, + vsCodeDropdown, + vsCodeLink, + vsCodeOption, + vsCodePanels, + vsCodePanelTab, + vsCodePanelView, + vsCodeProgressRing, + vsCodeRadioGroup, + vsCodeRadio, + vsCodeTag, + vsCodeTextArea, + vsCodeTextField, + register(container, ...rest) { + if (!container) { + return; + } + for (const key in this) { + if (key === "register") { + continue; + } + this[key]().register(container, ...rest); + } + } + }; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/index.js + var dist_exports = {}; + __export(dist_exports, { + Badge: () => Badge2, + Button: () => Button2, + Checkbox: () => Checkbox2, + DataGrid: () => DataGrid2, + DataGridCell: () => DataGridCell2, + DataGridCellTypes: () => DataGridCellTypes, + DataGridRow: () => DataGridRow2, + DataGridRowTypes: () => DataGridRowTypes, + Divider: () => Divider2, + DividerRole: () => DividerRole, + Dropdown: () => Dropdown, + DropdownPosition: () => SelectPosition, + GenerateHeaderOptions: () => GenerateHeaderOptions, + Link: () => Link, + Option: () => Option2, + PanelTab: () => PanelTab, + PanelView: () => PanelView, + Panels: () => Panels, + ProgressRing: () => ProgressRing, + Radio: () => Radio2, + RadioGroup: () => RadioGroup2, + RadioGroupOrientation: () => Orientation, + Tag: () => Tag, + TextArea: () => TextArea2, + TextAreaResize: () => TextAreaResize, + TextField: () => TextField2, + TextFieldType: () => TextFieldType, + allComponents: () => allComponents, + provideVSCodeDesignSystem: () => provideVSCodeDesignSystem, + vsCodeBadge: () => vsCodeBadge, + vsCodeButton: () => vsCodeButton, + vsCodeCheckbox: () => vsCodeCheckbox, + vsCodeDataGrid: () => vsCodeDataGrid, + vsCodeDataGridCell: () => vsCodeDataGridCell, + vsCodeDataGridRow: () => vsCodeDataGridRow, + vsCodeDivider: () => vsCodeDivider, + vsCodeDropdown: () => vsCodeDropdown, + vsCodeLink: () => vsCodeLink, + vsCodeOption: () => vsCodeOption, + vsCodePanelTab: () => vsCodePanelTab, + vsCodePanelView: () => vsCodePanelView, + vsCodePanels: () => vsCodePanels, + vsCodeProgressRing: () => vsCodeProgressRing, + vsCodeRadio: () => vsCodeRadio, + vsCodeRadioGroup: () => vsCodeRadioGroup, + vsCodeTag: () => vsCodeTag, + vsCodeTextArea: () => vsCodeTextArea, + vsCodeTextField: () => vsCodeTextField + }); + var init_dist3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/index.js"() { + init_vscode_design_system(); + init_custom_elements(); + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + } + }); + + // src/webview/shared/domUtils.ts + function el(tag, className, text) { + const node = document.createElement(tag); + if (className) { + node.className = className; + } + if (text !== void 0) { + node.textContent = text; + } + return node; + } + function createButton(configOrId, label, appearance) { + const button = document.createElement("vscode-button"); + if (typeof configOrId === "string") { + button.id = configOrId; + button.textContent = label || ""; + if (appearance) { + button.setAttribute("appearance", appearance); + } + } else { + const config = configOrId; + button.id = config.id; + button.textContent = config.label; + if (config.appearance) { + button.setAttribute("appearance", config.appearance); + } + } + return button; + } + + // src/webview/shared/buttonConfig.ts + var BUTTONS = { + "btn-refresh": { + id: "btn-refresh", + label: "\u{1F504} Refresh", + appearance: "primary" + }, + "btn-details": { + id: "btn-details", + label: "\u{1F916} Details" + }, + "btn-chart": { + id: "btn-chart", + label: "\u{1F4C8} Chart" + }, + "btn-usage": { + id: "btn-usage", + label: "\u{1F4CA} Usage Analysis" + }, + "btn-diagnostics": { + id: "btn-diagnostics", + label: "\u{1F50D} Diagnostics" + }, + "btn-maturity": { + id: "btn-maturity", + label: "\u{1F3AF} Fluency Score" + }, + "btn-dashboard": { + id: "btn-dashboard", + label: "\u{1F4CA} Team Dashboard" + }, + "btn-level-viewer": { + id: "btn-level-viewer", + label: "\u{1F50D} Level Viewer" + }, + "btn-environmental": { + id: "btn-environmental", + label: "\u{1F33F} Environmental Impact" + } + }; + + // src/tokenEstimators.json + var tokenEstimators_default = { + $schema: "http://json-schema.org/draft-07/schema#", + description: "Character-to-token ratio estimators for different AI models. Used to estimate token counts from text length.", + estimators: { + "gpt-4": 0.25, + "gpt-4.1": 0.25, + "gpt-4.1-mini": 0.25, + "gpt-4o": 0.25, + "gpt-4o-mini": 0.25, + "gpt-4-turbo": 0.25, + "gpt-3.5-turbo": 0.25, + "gpt-5": 0.25, + "gpt-5-codex": 0.25, + "gpt-5-mini": 0.25, + "gpt-5.1": 0.25, + "gpt-5.1-codex": 0.25, + "gpt-5.1-codex-max": 0.25, + "gpt-5.1-codex-mini": 0.25, + "gpt-5.2": 0.25, + "gpt-5.2-codex": 0.25, + "gpt-5.2-pro": 0.25, + "gpt-5.3-codex": 0.25, + "gpt-5.4": 0.25, + "gpt-4.1-nano": 0.25, + "gemini-2.0-flash": 0.25, + "gemini-2.0-flash-lite": 0.25, + "gemini-2.5-flash": 0.25, + "gemini-2.5-flash-lite": 0.25, + "claude-sonnet-3.5": 0.24, + "claude-sonnet-3.7": 0.24, + "claude-sonnet-4": 0.24, + "claude-sonnet-4.5": 0.24, + "claude-sonnet-4.6": 0.24, + "claude-haiku": 0.24, + "claude-haiku-4.5": 0.24, + "claude-opus-4.1": 0.24, + "claude-opus-4.5": 0.24, + "claude-opus-4.6": 0.24, + "claude-opus-4.6-(fast-mode)-(preview)": 0.24, + "claude-opus-4.6-fast": 0.24, + "gemini-2.5-pro": 0.25, + "gemini-3-flash": 0.25, + "gemini-3-pro": 0.25, + "gemini-3-pro-preview": 0.25, + "gemini-3.1-pro": 0.25, + "grok-code-fast-1": 0.25, + "raptor-mini": 0.25, + goldeneye: 0.25, + "o1-preview": 0.25, + "o1-mini": 0.25, + "o3-mini": 0.25, + "o4-mini": 0.25 + } + }; + + // src/webview/shared/formatUtils.ts + var tokenEstimators = tokenEstimators_default.estimators; + var currentLocale; + function formatFixed(value, digits) { + return new Intl.NumberFormat(currentLocale, { + minimumFractionDigits: digits, + maximumFractionDigits: digits + }).format(value); + } + function formatNumber(value) { + return value.toLocaleString(currentLocale); + } + + // src/webview/shared/theme.css + var theme_default = '/**\n * Shared theme variables for all webview panels\n * Uses VS Code theme tokens for automatic light/dark theme support\n */\n\n:root {\n /* VS Code base colors */\n --bg-primary: var(--vscode-editor-background);\n --bg-secondary: var(--vscode-sideBar-background);\n --bg-tertiary: var(--vscode-editorWidget-background);\n --text-primary: var(--vscode-editor-foreground);\n --text-secondary: var(--vscode-descriptionForeground);\n --text-muted: var(--vscode-disabledForeground);\n --border-color: var(--vscode-panel-border);\n --border-subtle: var(--vscode-widget-border);\n \n /* Button colors */\n --button-bg: var(--vscode-button-background);\n --button-fg: var(--vscode-button-foreground);\n --button-hover-bg: var(--vscode-button-hoverBackground);\n --button-secondary-bg: var(--vscode-button-secondaryBackground);\n --button-secondary-fg: var(--vscode-button-secondaryForeground);\n --button-secondary-hover-bg: var(--vscode-button-secondaryHoverBackground);\n \n /* Input colors */\n --input-bg: var(--vscode-input-background);\n --input-fg: var(--vscode-input-foreground);\n --input-border: var(--vscode-input-border);\n \n /* List/card colors */\n --list-hover-bg: var(--vscode-list-hoverBackground);\n --list-active-bg: var(--vscode-list-activeSelectionBackground);\n --list-active-fg: var(--vscode-list-activeSelectionForeground);\n --list-inactive-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Alternating row colors for better readability */\n --row-alternate-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Badge colors */\n --badge-bg: var(--vscode-badge-background);\n --badge-fg: var(--vscode-badge-foreground);\n \n /* Focus colors */\n --focus-border: var(--vscode-focusBorder);\n \n /* Link colors */\n --link-color: var(--vscode-textLink-foreground);\n --link-hover-color: var(--vscode-textLink-activeForeground);\n \n /* Status colors */\n --error-fg: var(--vscode-errorForeground);\n --warning-fg: var(--vscode-editorWarning-foreground);\n --success-fg: var(--vscode-terminal-ansiGreen);\n \n /* Shadow for cards */\n --shadow-color: rgb(0, 0, 0, 0.16);\n --shadow-hover-color: rgb(0, 0, 0, 0.24);\n}\n\n/* Light theme adjustments */\nbody[data-vscode-theme-kind="vscode-light"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --shadow-color: rgb(0, 0, 0, 0.08);\n --shadow-hover-color: rgb(0, 0, 0, 0.12);\n}\n\n/* High contrast mode adjustments */\nbody[data-vscode-theme-kind="vscode-high-contrast"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --border-color: var(--vscode-contrastBorder);\n --border-subtle: var(--vscode-contrastBorder);\n}\n'; + + // src/webview/environmental/styles.css + var styles_default = "body {\n margin: 0;\n background: var(--bg-primary);\n color: var(--text-primary);\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n}\n\n.container {\n padding: 16px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n padding-bottom: 4px;\n}\n\n.title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-size: 16px;\n font-weight: 700;\n color: var(--text-primary);\n}\n\n.button-row {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.sections {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.section {\n background: var(--bg-secondary);\n border: 1px solid var(--border-color);\n border-radius: 10px;\n padding: 12px;\n box-shadow: 0 4px 10px var(--shadow-color);\n}\n\n.section h3 {\n margin: 0 0 10px;\n font-size: 14px;\n display: flex;\n align-items: center;\n gap: 6px;\n color: var(--text-primary);\n letter-spacing: 0.2px;\n}\n\n/* --- Metric cards --- */\n.metric-cards {\n display: flex;\n flex-direction: column;\n gap: 16px;\n}\n\n.metric-card {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-subtle);\n border-radius: 8px;\n padding: 14px 16px;\n}\n\n.metric-card-header {\n display: flex;\n align-items: center;\n gap: 7px;\n margin-bottom: 12px;\n}\n\n.metric-card-icon {\n font-size: 16px;\n line-height: 1;\n}\n\n.metric-card-label {\n font-size: 13px;\n font-weight: 700;\n color: var(--text-primary);\n text-transform: uppercase;\n letter-spacing: 0.4px;\n}\n\n.metric-primary-value {\n font-size: 16px;\n font-weight: 700;\n color: var(--text-primary);\n padding: 6px 0 10px;\n border-bottom: 1px solid var(--border-subtle);\n margin-bottom: 8px;\n}\n\n.analogy-grid {\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n gap: 16px;\n}\n\n.analogy-col {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.analogy-col-header {\n font-size: 11px;\n font-weight: 700;\n color: var(--text-secondary);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n padding-bottom: 5px;\n border-bottom: 1px solid var(--border-subtle);\n margin-bottom: 2px;\n}\n\n.analogy-item {\n display: flex;\n align-items: baseline;\n gap: 6px;\n font-size: 12px;\n color: var(--text-primary);\n line-height: 1.5;\n}\n\n.analogy-icon {\n flex-shrink: 0;\n width: 20px;\n text-align: center;\n font-size: 13px;\n}\n\n.notes {\n margin: 4px 0 0;\n padding-left: 16px;\n color: var(--text-secondary);\n}\n\n.notes li {\n margin: 4px 0;\n line-height: 1.4;\n}\n\n.footer {\n color: var(--text-muted);\n font-size: 11px;\n margin-top: 6px;\n}\n\n.section-intro {\n color: var(--text-secondary);\n font-size: 12px;\n margin: 0 0 10px;\n line-height: 1.5;\n}\n"; + + // src/webview/environmental/main.ts + var CO2_GRAMS_PER_CAR_KM = 120; + var CO2_GRAMS_PER_KETTLE_BOIL = 20; + var CO2_GRAMS_PER_TRAIN_KM = 41; + var CO2_GRAMS_PER_FLIGHT_KM = 180; + var CO2_GRAMS_PER_PHONE_CHARGE = 8; + var CO2_GRAMS_PER_LED_HOUR = 3; + var WATER_LITERS_PER_SHOWER_MINUTE = 8; + var WATER_LITERS_PER_WASHER_LOAD = 50; + var WATER_LITERS_PER_MUG = 0.25; + var WATER_LITERS_PER_BATHTUB = 150; + var WATER_LITERS_PER_DISHWASHER = 12; + var WATER_LITERS_DAILY_DRINKING = 2; + var vscode = acquireVsCodeApi(); + var initialData = window.__INITIAL_ENVIRONMENTAL__; + function calculateProjection(last30DaysValue) { + return last30DaysValue / 30 * 365.25; + } + function smartFixed(value) { + if (value < 1e-3) { + return formatFixed(value, 6); + } + if (value < 1) { + return formatFixed(value, 4); + } + if (value <= 100) { + return formatFixed(value, 2); + } + if (value <= 1e3) { + return formatFixed(value, 1); + } + return formatFixed(Math.round(value), 0); + } + var co2AnalogyItems = (grams) => [ + { icon: "\u{1F697}", text: `${smartFixed(grams / CO2_GRAMS_PER_CAR_KM)} km driving (EU petrol car)` }, + { icon: "\u{1F682}", text: `${smartFixed(grams / CO2_GRAMS_PER_TRAIN_KM)} km by train (EU intercity)` }, + { icon: "\u2708\uFE0F", text: `${smartFixed(grams / CO2_GRAMS_PER_FLIGHT_KM)} km flying (economy, short-haul)` }, + { icon: "\u{1FAD6}", text: `${smartFixed(grams / CO2_GRAMS_PER_KETTLE_BOIL)} kettle boils` }, + { icon: "\u{1F4F1}", text: `${smartFixed(grams / CO2_GRAMS_PER_PHONE_CHARGE)} smartphone charges` }, + { icon: "\u{1F4A1}", text: `${smartFixed(grams / CO2_GRAMS_PER_LED_HOUR)} hours of LED lighting (10 W)` } + ]; + var waterAnalogyItems = (liters) => [ + { icon: "\u2615", text: `${smartFixed(liters / WATER_LITERS_PER_MUG)} mugs of tea/coffee` }, + { icon: "\u{1F6BF}", text: `${smartFixed(liters / WATER_LITERS_PER_SHOWER_MINUTE)} shower minutes` }, + { icon: "\u{1F455}", text: `${smartFixed(liters / WATER_LITERS_PER_WASHER_LOAD)} washing machine loads` }, + { icon: "\u{1F6C1}", text: `${smartFixed(liters / WATER_LITERS_PER_BATHTUB)} standard bathtubs` }, + { icon: "\u{1F37D}\uFE0F", text: `${smartFixed(liters / WATER_LITERS_PER_DISHWASHER)} dishwasher cycles` }, + { icon: "\u{1F4A7}", text: `${smartFixed(liters / WATER_LITERS_DAILY_DRINKING)} days of drinking water` } + ]; + var treeAnalogyItems = (fraction) => { + const daysAbsorbed = fraction * 365.25; + if (fraction >= 1) { + return [ + { icon: "\u{1F333}", text: `${smartFixed(fraction)} \xD7 a tree's full annual CO\u2082 absorption` }, + { icon: "\u{1F332}", text: `Plant ${Math.ceil(fraction)} trees to fully offset this per year` } + ]; + } + return [ + { icon: "\u{1F333}", text: `${smartFixed(fraction * 100)} % of one tree's annual absorption` }, + { icon: "\u{1F4C5}", text: `1 tree absorbs this CO\u2082 in about ${smartFixed(daysAbsorbed)} days` } + ]; + }; + function render(stats) { + const root = document.getElementById("root"); + if (!root) { + return; + } + const projectedCo2 = calculateProjection(stats.last30Days.co2); + const projectedWater = calculateProjection(stats.last30Days.waterUsage); + const projectedTrees = calculateProjection(stats.last30Days.treesEquivalent); + const projectedTokens = Math.round(calculateProjection(stats.last30Days.tokens)); + const lastUpdated = new Date(stats.lastUpdated); + root.replaceChildren(); + const themeStyle = document.createElement("style"); + themeStyle.textContent = theme_default; + const style = document.createElement("style"); + style.textContent = styles_default; + const container = el("div", "container"); + const header = el("div", "header"); + const title = el("div", "title", "\u{1F33F} Environmental Impact"); + const buttonRow = el("div", "button-row"); + buttonRow.append( + createButton(BUTTONS["btn-refresh"]), + createButton(BUTTONS["btn-details"]), + createButton(BUTTONS["btn-chart"]), + createButton(BUTTONS["btn-usage"]), + createButton(BUTTONS["btn-diagnostics"]), + createButton(BUTTONS["btn-maturity"]) + ); + if (stats.backendConfigured) { + buttonRow.append(createButton(BUTTONS["btn-dashboard"])); + } + header.append(title, buttonRow); + const footer = el("div", "footer", `Last updated: ${lastUpdated.toLocaleString()} \xB7 Updates every 5 minutes`); + const sections = el("div", "sections"); + sections.append(buildImpactCards(stats, projectedTokens, projectedCo2, projectedWater, projectedTrees)); + sections.append(buildEstimatesSection()); + container.append(header, sections, footer); + root.append(themeStyle, style, container); + wireButtons(); + } + function buildImpactCards(stats, projectedTokens, projectedCo2, projectedWater, projectedTrees) { + const section = el("div", "section"); + const heading = el("h3"); + heading.textContent = "\u{1F30D} Impact at a Glance"; + section.append(heading); + const intro = el("p", "section-intro"); + intro.textContent = "All figures are estimates based on average data center energy and water consumption figures. Analogies use European averages. Treat these as order-of-magnitude indicators, not precise measurements."; + section.append(intro); + const periods = [ + // Tokens card: 4 periods, no analogies + [ + ["\u{1F4C5} Today", formatNumber(stats.today.tokens), null], + ["\u{1F4C8} Last 30 Days", formatNumber(stats.last30Days.tokens), null], + ["\u{1F4C6} Previous Month", formatNumber(stats.lastMonth.tokens), null], + ["\u{1F30D} Projected Year", formatNumber(projectedTokens), null] + ], + // CO₂ card + [ + ["\u{1F4C5} Today", `${smartFixed(stats.today.co2)} g`, co2AnalogyItems(stats.today.co2)], + ["\u{1F4C8} Last 30 Days", `${smartFixed(stats.last30Days.co2)} g`, co2AnalogyItems(stats.last30Days.co2)], + ["\u{1F4C6} Previous Month", `${smartFixed(stats.lastMonth.co2)} g`, co2AnalogyItems(stats.lastMonth.co2)], + ["\u{1F30D} Projected Year", `${smartFixed(projectedCo2)} g`, co2AnalogyItems(projectedCo2)] + ], + // Water card + [ + ["\u{1F4C5} Today", `${smartFixed(stats.today.waterUsage)} L`, waterAnalogyItems(stats.today.waterUsage)], + ["\u{1F4C8} Last 30 Days", `${smartFixed(stats.last30Days.waterUsage)} L`, waterAnalogyItems(stats.last30Days.waterUsage)], + ["\u{1F4C6} Previous Month", `${smartFixed(stats.lastMonth.waterUsage)} L`, waterAnalogyItems(stats.lastMonth.waterUsage)], + ["\u{1F30D} Projected Year", `${smartFixed(projectedWater)} L`, waterAnalogyItems(projectedWater)] + ], + // Trees card + [ + ["\u{1F4C5} Today", `${smartFixed(stats.today.treesEquivalent)} \u{1F333}`, treeAnalogyItems(stats.today.treesEquivalent)], + ["\u{1F4C8} Last 30 Days", `${smartFixed(stats.last30Days.treesEquivalent)} \u{1F333}`, treeAnalogyItems(stats.last30Days.treesEquivalent)], + ["\u{1F4C6} Previous Month", `${smartFixed(stats.lastMonth.treesEquivalent)} \u{1F333}`, treeAnalogyItems(stats.lastMonth.treesEquivalent)], + ["\u{1F30D} Projected Year", `${smartFixed(projectedTrees)} \u{1F333}`, treeAnalogyItems(projectedTrees)] + ] + ]; + const metricHeaders = [ + { icon: "\u{1F7E3}", label: "Tokens (total)", color: "#c37bff" }, + { icon: "\u{1F331}", label: "Estimated CO\u2082", color: "#7fe36f" }, + { icon: "\u{1F4A7}", label: "Estimated Water", color: "#6fc3ff" }, + { icon: "\u{1F333}", label: "Tree equivalent", color: "#9de67f" } + ]; + const cards = el("div", "metric-cards"); + periods.forEach((periodCols, i) => { + const card = el("div", "metric-card"); + const cardHeader = el("div", "metric-card-header"); + const iconEl = el("span", "metric-card-icon", metricHeaders[i].icon); + iconEl.style.color = metricHeaders[i].color; + const labelEl = el("span", "metric-card-label", metricHeaders[i].label); + cardHeader.append(iconEl, labelEl); + card.append(cardHeader); + const grid = el("div", "analogy-grid"); + periodCols.forEach(([periodLabel, primaryValue, analogies]) => { + const col = el("div", "analogy-col"); + col.append(el("div", "analogy-col-header", periodLabel)); + col.append(el("div", "metric-primary-value", primaryValue)); + if (analogies) { + analogies.forEach((item) => { + const itemEl = el("div", "analogy-item"); + const itemIcon = el("span", "analogy-icon", item.icon); + const itemText = document.createElement("span"); + itemText.textContent = item.text; + itemEl.append(itemIcon, itemText); + col.append(itemEl); + }); + } + grid.append(col); + }); + card.append(grid); + cards.append(card); + }); + section.append(cards); + return section; + } + function buildEstimatesSection() { + const section = el("div", "section"); + const heading = el("h3"); + heading.textContent = "\u{1F4A1} Calculation & Estimates"; + section.append(heading); + const notes = document.createElement("ul"); + notes.className = "notes"; + const items = [ + "Cost estimate uses public API pricing with input/output token counts; GitHub Copilot billing may differ from direct API usage.", + "Estimated CO\u2082 is based on ~0.2 g CO\u2082e per 1,000 tokens (average data center energy mix and PUE).", + "Estimated water usage is based on ~0.3 L per 1,000 tokens (data center cooling estimates).", + "Tree equivalent represents the fraction of a single mature tree's annual CO\u2082 absorption (~21 kg/year).", + "CO\u2082 analogies: petrol car \u2248 120 g/km \xB7 intercity train \u2248 41 g/km \xB7 economy flight \u2248 180 g/km (ICAO avg.) \xB7 smartphone charge \u2248 8 g \xB7 LED bulb \u2248 3 g/hr (10 W, EU grid) \xB7 kettle boil \u2248 20 g.", + "Water analogies: shower \u2248 8 L/min \xB7 washing machine \u2248 50 L \xB7 standard bathtub \u2248 150 L \xB7 dishwasher \u2248 12 L \xB7 mug of tea \u2248 250 mL \xB7 daily drinking water \u2248 2 L/person.", + "All analogies are order-of-magnitude estimates. Actual values depend on your region's energy mix and device efficiency." + ]; + items.forEach((text) => { + const li = document.createElement("li"); + li.textContent = text; + notes.append(li); + }); + section.append(notes); + return section; + } + function wireButtons() { + document.getElementById("btn-refresh")?.addEventListener("click", () => vscode.postMessage({ command: "refresh" })); + document.getElementById("btn-details")?.addEventListener("click", () => vscode.postMessage({ command: "showDetails" })); + document.getElementById("btn-chart")?.addEventListener("click", () => vscode.postMessage({ command: "showChart" })); + document.getElementById("btn-usage")?.addEventListener("click", () => vscode.postMessage({ command: "showUsageAnalysis" })); + document.getElementById("btn-diagnostics")?.addEventListener("click", () => vscode.postMessage({ command: "showDiagnostics" })); + document.getElementById("btn-maturity")?.addEventListener("click", () => vscode.postMessage({ command: "showMaturity" })); + document.getElementById("btn-dashboard")?.addEventListener("click", () => vscode.postMessage({ command: "showDashboard" })); + } + window.addEventListener("message", (event) => { + const message = event.data; + if (message.command === "updateStats") { + render(message.data); + } + }); + async function bootstrap() { + const { provideVSCodeDesignSystem: provideVSCodeDesignSystem2, vsCodeButton: vsCodeButton2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports)); + provideVSCodeDesignSystem2().register(vsCodeButton2()); + if (initialData) { + render(initialData); + } else { + const root = document.getElementById("root"); + if (root) { + root.textContent = ""; + const fallback = document.createElement("div"); + fallback.style.padding = "16px"; + fallback.style.color = "#e7e7e7"; + fallback.textContent = "No data available."; + root.append(fallback); + } + } + } + bootstrap(); +})(); +/*! Bundled license information: + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tabbable/dist/index.esm.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=environmental.js.map diff --git a/visualstudio-extension/src/CopilotTokenTracker/webview/maturity.js b/visualstudio-extension/src/CopilotTokenTracker/webview/maturity.js new file mode 100644 index 00000000..6d906013 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/webview/maturity.js @@ -0,0 +1,29532 @@ +"use strict"; +(() => { + var __create = Object.create; + var __defProp = Object.defineProperty; + var __getOwnPropDesc = Object.getOwnPropertyDescriptor; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __getProtoOf = Object.getPrototypeOf; + var __hasOwnProp = Object.prototype.hasOwnProperty; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); + }; + var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + + // node_modules/html2canvas/dist/html2canvas.js + var require_html2canvas = __commonJS({ + "node_modules/html2canvas/dist/html2canvas.js"(exports, module) { + (function(global2, factory) { + typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.html2canvas = factory()); + })(exports, (function() { + "use strict"; + var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) { + d2.__proto__ = b2; + } || function(d2, b2) { + for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p]; + }; + return extendStatics(d, b); + }; + function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + } + var __assign = function() { + __assign = Object.assign || function __assign2(t) { + for (var s, i2 = 1, n = arguments.length; i2 < n; i2++) { + s = arguments[i2]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function(resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e2) { + reject(e2); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e2) { + reject(e2); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + } + function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { + if (t[0] & 1) throw t[1]; + return t[1]; + }, trys: [], ops: [] }, f2, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { + return this; + }), g; + function verb(n) { + return function(v) { + return step([n, v]); + }; + } + function step(op) { + if (f2) throw new TypeError("Generator is already executing."); + while (_) try { + if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e2) { + op = [6, e2]; + y = 0; + } finally { + f2 = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; + } + } + function __spreadArray(to, from, pack2) { + if (pack2 || arguments.length === 2) for (var i2 = 0, l = from.length, ar; i2 < l; i2++) { + if (ar || !(i2 in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i2); + ar[i2] = from[i2]; + } + } + return to.concat(ar || from); + } + var Bounds = ( + /** @class */ + (function() { + function Bounds2(left, top, width, height) { + this.left = left; + this.top = top; + this.width = width; + this.height = height; + } + Bounds2.prototype.add = function(x, y, w, h) { + return new Bounds2(this.left + x, this.top + y, this.width + w, this.height + h); + }; + Bounds2.fromClientRect = function(context, clientRect) { + return new Bounds2(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height); + }; + Bounds2.fromDOMRectList = function(context, domRectList) { + var domRect = Array.from(domRectList).find(function(rect) { + return rect.width !== 0; + }); + return domRect ? new Bounds2(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height) : Bounds2.EMPTY; + }; + Bounds2.EMPTY = new Bounds2(0, 0, 0, 0); + return Bounds2; + })() + ); + var parseBounds = function(context, node) { + return Bounds.fromClientRect(context, node.getBoundingClientRect()); + }; + var parseDocumentSize = function(document2) { + var body = document2.body; + var documentElement = document2.documentElement; + if (!body || !documentElement) { + throw new Error("Unable to get document size"); + } + var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth)); + var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight)); + return new Bounds(0, 0, width, height); + }; + var toCodePoints$1 = function(str) { + var codePoints = []; + var i2 = 0; + var length = str.length; + while (i2 < length) { + var value = str.charCodeAt(i2++); + if (value >= 55296 && value <= 56319 && i2 < length) { + var extra = str.charCodeAt(i2++); + if ((extra & 64512) === 56320) { + codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536); + } else { + codePoints.push(value); + i2--; + } + } else { + codePoints.push(value); + } + } + return codePoints; + }; + var fromCodePoint$1 = function() { + var codePoints = []; + for (var _i = 0; _i < arguments.length; _i++) { + codePoints[_i] = arguments[_i]; + } + if (String.fromCodePoint) { + return String.fromCodePoint.apply(String, codePoints); + } + var length = codePoints.length; + if (!length) { + return ""; + } + var codeUnits = []; + var index = -1; + var result = ""; + while (++index < length) { + var codePoint = codePoints[index]; + if (codePoint <= 65535) { + codeUnits.push(codePoint); + } else { + codePoint -= 65536; + codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320); + } + if (index + 1 === length || codeUnits.length > 16384) { + result += String.fromCharCode.apply(String, codeUnits); + codeUnits.length = 0; + } + } + return result; + }; + var chars$2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var lookup$2 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); + for (var i$2 = 0; i$2 < chars$2.length; i$2++) { + lookup$2[chars$2.charCodeAt(i$2)] = i$2; + } + var chars$1$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var lookup$1$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); + for (var i$1$1 = 0; i$1$1 < chars$1$1.length; i$1$1++) { + lookup$1$1[chars$1$1.charCodeAt(i$1$1)] = i$1$1; + } + var decode$1 = function(base642) { + var bufferLength = base642.length * 0.75, len = base642.length, i2, p = 0, encoded1, encoded2, encoded3, encoded4; + if (base642[base642.length - 1] === "=") { + bufferLength--; + if (base642[base642.length - 2] === "=") { + bufferLength--; + } + } + var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength); + var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer); + for (i2 = 0; i2 < len; i2 += 4) { + encoded1 = lookup$1$1[base642.charCodeAt(i2)]; + encoded2 = lookup$1$1[base642.charCodeAt(i2 + 1)]; + encoded3 = lookup$1$1[base642.charCodeAt(i2 + 2)]; + encoded4 = lookup$1$1[base642.charCodeAt(i2 + 3)]; + bytes[p++] = encoded1 << 2 | encoded2 >> 4; + bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; + } + return buffer; + }; + var polyUint16Array$1 = function(buffer) { + var length = buffer.length; + var bytes = []; + for (var i2 = 0; i2 < length; i2 += 2) { + bytes.push(buffer[i2 + 1] << 8 | buffer[i2]); + } + return bytes; + }; + var polyUint32Array$1 = function(buffer) { + var length = buffer.length; + var bytes = []; + for (var i2 = 0; i2 < length; i2 += 4) { + bytes.push(buffer[i2 + 3] << 24 | buffer[i2 + 2] << 16 | buffer[i2 + 1] << 8 | buffer[i2]); + } + return bytes; + }; + var UTRIE2_SHIFT_2$1 = 5; + var UTRIE2_SHIFT_1$1 = 6 + 5; + var UTRIE2_INDEX_SHIFT$1 = 2; + var UTRIE2_SHIFT_1_2$1 = UTRIE2_SHIFT_1$1 - UTRIE2_SHIFT_2$1; + var UTRIE2_LSCP_INDEX_2_OFFSET$1 = 65536 >> UTRIE2_SHIFT_2$1; + var UTRIE2_DATA_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_2$1; + var UTRIE2_DATA_MASK$1 = UTRIE2_DATA_BLOCK_LENGTH$1 - 1; + var UTRIE2_LSCP_INDEX_2_LENGTH$1 = 1024 >> UTRIE2_SHIFT_2$1; + var UTRIE2_INDEX_2_BMP_LENGTH$1 = UTRIE2_LSCP_INDEX_2_OFFSET$1 + UTRIE2_LSCP_INDEX_2_LENGTH$1; + var UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 = UTRIE2_INDEX_2_BMP_LENGTH$1; + var UTRIE2_UTF8_2B_INDEX_2_LENGTH$1 = 2048 >> 6; + var UTRIE2_INDEX_1_OFFSET$1 = UTRIE2_UTF8_2B_INDEX_2_OFFSET$1 + UTRIE2_UTF8_2B_INDEX_2_LENGTH$1; + var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 = 65536 >> UTRIE2_SHIFT_1$1; + var UTRIE2_INDEX_2_BLOCK_LENGTH$1 = 1 << UTRIE2_SHIFT_1_2$1; + var UTRIE2_INDEX_2_MASK$1 = UTRIE2_INDEX_2_BLOCK_LENGTH$1 - 1; + var slice16$1 = function(view, start, end) { + if (view.slice) { + return view.slice(start, end); + } + return new Uint16Array(Array.prototype.slice.call(view, start, end)); + }; + var slice32$1 = function(view, start, end) { + if (view.slice) { + return view.slice(start, end); + } + return new Uint32Array(Array.prototype.slice.call(view, start, end)); + }; + var createTrieFromBase64$1 = function(base642, _byteLength) { + var buffer = decode$1(base642); + var view32 = Array.isArray(buffer) ? polyUint32Array$1(buffer) : new Uint32Array(buffer); + var view16 = Array.isArray(buffer) ? polyUint16Array$1(buffer) : new Uint16Array(buffer); + var headerLength = 24; + var index = slice16$1(view16, headerLength / 2, view32[4] / 2); + var data = view32[5] === 2 ? slice16$1(view16, (headerLength + view32[4]) / 2) : slice32$1(view32, Math.ceil((headerLength + view32[4]) / 4)); + return new Trie$1(view32[0], view32[1], view32[2], view32[3], index, data); + }; + var Trie$1 = ( + /** @class */ + (function() { + function Trie2(initialValue, errorValue, highStart, highValueIndex, index, data) { + this.initialValue = initialValue; + this.errorValue = errorValue; + this.highStart = highStart; + this.highValueIndex = highValueIndex; + this.index = index; + this.data = data; + } + Trie2.prototype.get = function(codePoint) { + var ix; + if (codePoint >= 0) { + if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) { + ix = this.index[codePoint >> UTRIE2_SHIFT_2$1]; + ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1); + return this.data[ix]; + } + if (codePoint <= 65535) { + ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET$1 + (codePoint - 55296 >> UTRIE2_SHIFT_2$1)]; + ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1); + return this.data[ix]; + } + if (codePoint < this.highStart) { + ix = UTRIE2_INDEX_1_OFFSET$1 - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH$1 + (codePoint >> UTRIE2_SHIFT_1$1); + ix = this.index[ix]; + ix += codePoint >> UTRIE2_SHIFT_2$1 & UTRIE2_INDEX_2_MASK$1; + ix = this.index[ix]; + ix = (ix << UTRIE2_INDEX_SHIFT$1) + (codePoint & UTRIE2_DATA_MASK$1); + return this.data[ix]; + } + if (codePoint <= 1114111) { + return this.data[this.highValueIndex]; + } + } + return this.errorValue; + }; + return Trie2; + })() + ); + var chars$3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var lookup$3 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); + for (var i$3 = 0; i$3 < chars$3.length; i$3++) { + lookup$3[chars$3.charCodeAt(i$3)] = i$3; + } + var base64$1 = "KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="; + var LETTER_NUMBER_MODIFIER = 50; + var BK = 1; + var CR$1 = 2; + var LF$1 = 3; + var CM = 4; + var NL = 5; + var WJ = 7; + var ZW = 8; + var GL = 9; + var SP = 10; + var ZWJ$1 = 11; + var B2 = 12; + var BA = 13; + var BB = 14; + var HY = 15; + var CB = 16; + var CL = 17; + var CP = 18; + var EX = 19; + var IN = 20; + var NS = 21; + var OP = 22; + var QU = 23; + var IS = 24; + var NU = 25; + var PO = 26; + var PR = 27; + var SY = 28; + var AI = 29; + var AL = 30; + var CJ = 31; + var EB = 32; + var EM = 33; + var H2 = 34; + var H3 = 35; + var HL = 36; + var ID = 37; + var JL = 38; + var JV = 39; + var JT = 40; + var RI$1 = 41; + var SA = 42; + var XX = 43; + var ea_OP = [9001, 65288]; + var BREAK_MANDATORY = "!"; + var BREAK_NOT_ALLOWED$1 = "\xD7"; + var BREAK_ALLOWED$1 = "\xF7"; + var UnicodeTrie$1 = createTrieFromBase64$1(base64$1); + var ALPHABETICS = [AL, HL]; + var HARD_LINE_BREAKS = [BK, CR$1, LF$1, NL]; + var SPACE$1 = [SP, ZW]; + var PREFIX_POSTFIX = [PR, PO]; + var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1); + var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3]; + var HYPHEN = [HY, BA]; + var codePointsToCharacterClasses = function(codePoints, lineBreak2) { + if (lineBreak2 === void 0) { + lineBreak2 = "strict"; + } + var types = []; + var indices = []; + var categories = []; + codePoints.forEach(function(codePoint, index) { + var classType = UnicodeTrie$1.get(codePoint); + if (classType > LETTER_NUMBER_MODIFIER) { + categories.push(true); + classType -= LETTER_NUMBER_MODIFIER; + } else { + categories.push(false); + } + if (["normal", "auto", "loose"].indexOf(lineBreak2) !== -1) { + if ([8208, 8211, 12316, 12448].indexOf(codePoint) !== -1) { + indices.push(index); + return types.push(CB); + } + } + if (classType === CM || classType === ZWJ$1) { + if (index === 0) { + indices.push(index); + return types.push(AL); + } + var prev = types[index - 1]; + if (LINE_BREAKS.indexOf(prev) === -1) { + indices.push(indices[index - 1]); + return types.push(prev); + } + indices.push(index); + return types.push(AL); + } + indices.push(index); + if (classType === CJ) { + return types.push(lineBreak2 === "strict" ? NS : ID); + } + if (classType === SA) { + return types.push(AL); + } + if (classType === AI) { + return types.push(AL); + } + if (classType === XX) { + if (codePoint >= 131072 && codePoint <= 196605 || codePoint >= 196608 && codePoint <= 262141) { + return types.push(ID); + } else { + return types.push(AL); + } + } + types.push(classType); + }); + return [indices, types, categories]; + }; + var isAdjacentWithSpaceIgnored = function(a2, b, currentIndex, classTypes) { + var current = classTypes[currentIndex]; + if (Array.isArray(a2) ? a2.indexOf(current) !== -1 : a2 === current) { + var i2 = currentIndex; + while (i2 <= classTypes.length) { + i2++; + var next = classTypes[i2]; + if (next === b) { + return true; + } + if (next !== SP) { + break; + } + } + } + if (current === SP) { + var i2 = currentIndex; + while (i2 > 0) { + i2--; + var prev = classTypes[i2]; + if (Array.isArray(a2) ? a2.indexOf(prev) !== -1 : a2 === prev) { + var n = currentIndex; + while (n <= classTypes.length) { + n++; + var next = classTypes[n]; + if (next === b) { + return true; + } + if (next !== SP) { + break; + } + } + } + if (prev !== SP) { + break; + } + } + } + return false; + }; + var previousNonSpaceClassType = function(currentIndex, classTypes) { + var i2 = currentIndex; + while (i2 >= 0) { + var type = classTypes[i2]; + if (type === SP) { + i2--; + } else { + return type; + } + } + return 0; + }; + var _lineBreakAtIndex = function(codePoints, classTypes, indicies, index, forbiddenBreaks) { + if (indicies[index] === 0) { + return BREAK_NOT_ALLOWED$1; + } + var currentIndex = index - 1; + if (Array.isArray(forbiddenBreaks) && forbiddenBreaks[currentIndex] === true) { + return BREAK_NOT_ALLOWED$1; + } + var beforeIndex = currentIndex - 1; + var afterIndex = currentIndex + 1; + var current = classTypes[currentIndex]; + var before = beforeIndex >= 0 ? classTypes[beforeIndex] : 0; + var next = classTypes[afterIndex]; + if (current === CR$1 && next === LF$1) { + return BREAK_NOT_ALLOWED$1; + } + if (HARD_LINE_BREAKS.indexOf(current) !== -1) { + return BREAK_MANDATORY; + } + if (HARD_LINE_BREAKS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if (SPACE$1.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if (previousNonSpaceClassType(currentIndex, classTypes) === ZW) { + return BREAK_ALLOWED$1; + } + if (UnicodeTrie$1.get(codePoints[currentIndex]) === ZWJ$1) { + return BREAK_NOT_ALLOWED$1; + } + if ((current === EB || current === EM) && UnicodeTrie$1.get(codePoints[afterIndex]) === ZWJ$1) { + return BREAK_NOT_ALLOWED$1; + } + if (current === WJ || next === WJ) { + return BREAK_NOT_ALLOWED$1; + } + if (current === GL) { + return BREAK_NOT_ALLOWED$1; + } + if ([SP, BA, HY].indexOf(current) === -1 && next === GL) { + return BREAK_NOT_ALLOWED$1; + } + if ([CL, CP, EX, IS, SY].indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if (previousNonSpaceClassType(currentIndex, classTypes) === OP) { + return BREAK_NOT_ALLOWED$1; + } + if (isAdjacentWithSpaceIgnored(QU, OP, currentIndex, classTypes)) { + return BREAK_NOT_ALLOWED$1; + } + if (isAdjacentWithSpaceIgnored([CL, CP], NS, currentIndex, classTypes)) { + return BREAK_NOT_ALLOWED$1; + } + if (isAdjacentWithSpaceIgnored(B2, B2, currentIndex, classTypes)) { + return BREAK_NOT_ALLOWED$1; + } + if (current === SP) { + return BREAK_ALLOWED$1; + } + if (current === QU || next === QU) { + return BREAK_NOT_ALLOWED$1; + } + if (next === CB || current === CB) { + return BREAK_ALLOWED$1; + } + if ([BA, HY, NS].indexOf(next) !== -1 || current === BB) { + return BREAK_NOT_ALLOWED$1; + } + if (before === HL && HYPHEN.indexOf(current) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if (current === SY && next === HL) { + return BREAK_NOT_ALLOWED$1; + } + if (next === IN) { + return BREAK_NOT_ALLOWED$1; + } + if (ALPHABETICS.indexOf(next) !== -1 && current === NU || ALPHABETICS.indexOf(current) !== -1 && next === NU) { + return BREAK_NOT_ALLOWED$1; + } + if (current === PR && [ID, EB, EM].indexOf(next) !== -1 || [ID, EB, EM].indexOf(current) !== -1 && next === PO) { + return BREAK_NOT_ALLOWED$1; + } + if (ALPHABETICS.indexOf(current) !== -1 && PREFIX_POSTFIX.indexOf(next) !== -1 || PREFIX_POSTFIX.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if ( + // (PR | PO) × ( OP | HY )? NU + [PR, PO].indexOf(current) !== -1 && (next === NU || [OP, HY].indexOf(next) !== -1 && classTypes[afterIndex + 1] === NU) || // ( OP | HY ) × NU + [OP, HY].indexOf(current) !== -1 && next === NU || // NU × (NU | SY | IS) + current === NU && [NU, SY, IS].indexOf(next) !== -1 + ) { + return BREAK_NOT_ALLOWED$1; + } + if ([NU, SY, IS, CL, CP].indexOf(next) !== -1) { + var prevIndex = currentIndex; + while (prevIndex >= 0) { + var type = classTypes[prevIndex]; + if (type === NU) { + return BREAK_NOT_ALLOWED$1; + } else if ([SY, IS].indexOf(type) !== -1) { + prevIndex--; + } else { + break; + } + } + } + if ([PR, PO].indexOf(next) !== -1) { + var prevIndex = [CL, CP].indexOf(current) !== -1 ? beforeIndex : currentIndex; + while (prevIndex >= 0) { + var type = classTypes[prevIndex]; + if (type === NU) { + return BREAK_NOT_ALLOWED$1; + } else if ([SY, IS].indexOf(type) !== -1) { + prevIndex--; + } else { + break; + } + } + } + if (JL === current && [JL, JV, H2, H3].indexOf(next) !== -1 || [JV, H2].indexOf(current) !== -1 && [JV, JT].indexOf(next) !== -1 || [JT, H3].indexOf(current) !== -1 && next === JT) { + return BREAK_NOT_ALLOWED$1; + } + if (KOREAN_SYLLABLE_BLOCK.indexOf(current) !== -1 && [IN, PO].indexOf(next) !== -1 || KOREAN_SYLLABLE_BLOCK.indexOf(next) !== -1 && current === PR) { + return BREAK_NOT_ALLOWED$1; + } + if (ALPHABETICS.indexOf(current) !== -1 && ALPHABETICS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if (current === IS && ALPHABETICS.indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED$1; + } + if (ALPHABETICS.concat(NU).indexOf(current) !== -1 && next === OP && ea_OP.indexOf(codePoints[afterIndex]) === -1 || ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP) { + return BREAK_NOT_ALLOWED$1; + } + if (current === RI$1 && next === RI$1) { + var i2 = indicies[currentIndex]; + var count = 1; + while (i2 > 0) { + i2--; + if (classTypes[i2] === RI$1) { + count++; + } else { + break; + } + } + if (count % 2 !== 0) { + return BREAK_NOT_ALLOWED$1; + } + } + if (current === EB && next === EM) { + return BREAK_NOT_ALLOWED$1; + } + return BREAK_ALLOWED$1; + }; + var cssFormattedClasses = function(codePoints, options) { + if (!options) { + options = { lineBreak: "normal", wordBreak: "normal" }; + } + var _a = codePointsToCharacterClasses(codePoints, options.lineBreak), indicies = _a[0], classTypes = _a[1], isLetterNumber = _a[2]; + if (options.wordBreak === "break-all" || options.wordBreak === "break-word") { + classTypes = classTypes.map(function(type) { + return [NU, AL, SA].indexOf(type) !== -1 ? ID : type; + }); + } + var forbiddenBreakpoints = options.wordBreak === "keep-all" ? isLetterNumber.map(function(letterNumber, i2) { + return letterNumber && codePoints[i2] >= 19968 && codePoints[i2] <= 40959; + }) : void 0; + return [indicies, classTypes, forbiddenBreakpoints]; + }; + var Break = ( + /** @class */ + (function() { + function Break2(codePoints, lineBreak2, start, end) { + this.codePoints = codePoints; + this.required = lineBreak2 === BREAK_MANDATORY; + this.start = start; + this.end = end; + } + Break2.prototype.slice = function() { + return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end)); + }; + return Break2; + })() + ); + var LineBreaker = function(str, options) { + var codePoints = toCodePoints$1(str); + var _a = cssFormattedClasses(codePoints, options), indicies = _a[0], classTypes = _a[1], forbiddenBreakpoints = _a[2]; + var length = codePoints.length; + var lastEnd = 0; + var nextIndex = 0; + return { + next: function() { + if (nextIndex >= length) { + return { done: true, value: null }; + } + var lineBreak2 = BREAK_NOT_ALLOWED$1; + while (nextIndex < length && (lineBreak2 = _lineBreakAtIndex(codePoints, classTypes, indicies, ++nextIndex, forbiddenBreakpoints)) === BREAK_NOT_ALLOWED$1) { + } + if (lineBreak2 !== BREAK_NOT_ALLOWED$1 || nextIndex === length) { + var value = new Break(codePoints, lineBreak2, lastEnd, nextIndex); + lastEnd = nextIndex; + return { value, done: false }; + } + return { done: true, value: null }; + } + }; + }; + var FLAG_UNRESTRICTED = 1 << 0; + var FLAG_ID = 1 << 1; + var FLAG_INTEGER = 1 << 2; + var FLAG_NUMBER = 1 << 3; + var LINE_FEED = 10; + var SOLIDUS = 47; + var REVERSE_SOLIDUS = 92; + var CHARACTER_TABULATION = 9; + var SPACE = 32; + var QUOTATION_MARK = 34; + var EQUALS_SIGN = 61; + var NUMBER_SIGN = 35; + var DOLLAR_SIGN = 36; + var PERCENTAGE_SIGN = 37; + var APOSTROPHE = 39; + var LEFT_PARENTHESIS = 40; + var RIGHT_PARENTHESIS = 41; + var LOW_LINE = 95; + var HYPHEN_MINUS = 45; + var EXCLAMATION_MARK = 33; + var LESS_THAN_SIGN = 60; + var GREATER_THAN_SIGN = 62; + var COMMERCIAL_AT = 64; + var LEFT_SQUARE_BRACKET = 91; + var RIGHT_SQUARE_BRACKET = 93; + var CIRCUMFLEX_ACCENT = 61; + var LEFT_CURLY_BRACKET = 123; + var QUESTION_MARK = 63; + var RIGHT_CURLY_BRACKET = 125; + var VERTICAL_LINE = 124; + var TILDE = 126; + var CONTROL = 128; + var REPLACEMENT_CHARACTER = 65533; + var ASTERISK = 42; + var PLUS_SIGN = 43; + var COMMA = 44; + var COLON = 58; + var SEMICOLON = 59; + var FULL_STOP = 46; + var NULL = 0; + var BACKSPACE = 8; + var LINE_TABULATION = 11; + var SHIFT_OUT = 14; + var INFORMATION_SEPARATOR_ONE = 31; + var DELETE = 127; + var EOF = -1; + var ZERO = 48; + var a = 97; + var e = 101; + var f = 102; + var u = 117; + var z = 122; + var A = 65; + var E = 69; + var F = 70; + var U = 85; + var Z = 90; + var isDigit = function(codePoint) { + return codePoint >= ZERO && codePoint <= 57; + }; + var isSurrogateCodePoint = function(codePoint) { + return codePoint >= 55296 && codePoint <= 57343; + }; + var isHex = function(codePoint) { + return isDigit(codePoint) || codePoint >= A && codePoint <= F || codePoint >= a && codePoint <= f; + }; + var isLowerCaseLetter = function(codePoint) { + return codePoint >= a && codePoint <= z; + }; + var isUpperCaseLetter = function(codePoint) { + return codePoint >= A && codePoint <= Z; + }; + var isLetter = function(codePoint) { + return isLowerCaseLetter(codePoint) || isUpperCaseLetter(codePoint); + }; + var isNonASCIICodePoint = function(codePoint) { + return codePoint >= CONTROL; + }; + var isWhiteSpace = function(codePoint) { + return codePoint === LINE_FEED || codePoint === CHARACTER_TABULATION || codePoint === SPACE; + }; + var isNameStartCodePoint = function(codePoint) { + return isLetter(codePoint) || isNonASCIICodePoint(codePoint) || codePoint === LOW_LINE; + }; + var isNameCodePoint = function(codePoint) { + return isNameStartCodePoint(codePoint) || isDigit(codePoint) || codePoint === HYPHEN_MINUS; + }; + var isNonPrintableCodePoint = function(codePoint) { + return codePoint >= NULL && codePoint <= BACKSPACE || codePoint === LINE_TABULATION || codePoint >= SHIFT_OUT && codePoint <= INFORMATION_SEPARATOR_ONE || codePoint === DELETE; + }; + var isValidEscape = function(c1, c2) { + if (c1 !== REVERSE_SOLIDUS) { + return false; + } + return c2 !== LINE_FEED; + }; + var isIdentifierStart = function(c1, c2, c3) { + if (c1 === HYPHEN_MINUS) { + return isNameStartCodePoint(c2) || isValidEscape(c2, c3); + } else if (isNameStartCodePoint(c1)) { + return true; + } else if (c1 === REVERSE_SOLIDUS && isValidEscape(c1, c2)) { + return true; + } + return false; + }; + var isNumberStart = function(c1, c2, c3) { + if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) { + if (isDigit(c2)) { + return true; + } + return c2 === FULL_STOP && isDigit(c3); + } + if (c1 === FULL_STOP) { + return isDigit(c2); + } + return isDigit(c1); + }; + var stringToNumber = function(codePoints) { + var c = 0; + var sign = 1; + if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) { + if (codePoints[c] === HYPHEN_MINUS) { + sign = -1; + } + c++; + } + var integers = []; + while (isDigit(codePoints[c])) { + integers.push(codePoints[c++]); + } + var int = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0; + if (codePoints[c] === FULL_STOP) { + c++; + } + var fraction = []; + while (isDigit(codePoints[c])) { + fraction.push(codePoints[c++]); + } + var fracd = fraction.length; + var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0; + if (codePoints[c] === E || codePoints[c] === e) { + c++; + } + var expsign = 1; + if (codePoints[c] === PLUS_SIGN || codePoints[c] === HYPHEN_MINUS) { + if (codePoints[c] === HYPHEN_MINUS) { + expsign = -1; + } + c++; + } + var exponent = []; + while (isDigit(codePoints[c])) { + exponent.push(codePoints[c++]); + } + var exp = exponent.length ? parseInt(fromCodePoint$1.apply(void 0, exponent), 10) : 0; + return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp); + }; + var LEFT_PARENTHESIS_TOKEN = { + type: 2 + /* LEFT_PARENTHESIS_TOKEN */ + }; + var RIGHT_PARENTHESIS_TOKEN = { + type: 3 + /* RIGHT_PARENTHESIS_TOKEN */ + }; + var COMMA_TOKEN = { + type: 4 + /* COMMA_TOKEN */ + }; + var SUFFIX_MATCH_TOKEN = { + type: 13 + /* SUFFIX_MATCH_TOKEN */ + }; + var PREFIX_MATCH_TOKEN = { + type: 8 + /* PREFIX_MATCH_TOKEN */ + }; + var COLUMN_TOKEN = { + type: 21 + /* COLUMN_TOKEN */ + }; + var DASH_MATCH_TOKEN = { + type: 9 + /* DASH_MATCH_TOKEN */ + }; + var INCLUDE_MATCH_TOKEN = { + type: 10 + /* INCLUDE_MATCH_TOKEN */ + }; + var LEFT_CURLY_BRACKET_TOKEN = { + type: 11 + /* LEFT_CURLY_BRACKET_TOKEN */ + }; + var RIGHT_CURLY_BRACKET_TOKEN = { + type: 12 + /* RIGHT_CURLY_BRACKET_TOKEN */ + }; + var SUBSTRING_MATCH_TOKEN = { + type: 14 + /* SUBSTRING_MATCH_TOKEN */ + }; + var BAD_URL_TOKEN = { + type: 23 + /* BAD_URL_TOKEN */ + }; + var BAD_STRING_TOKEN = { + type: 1 + /* BAD_STRING_TOKEN */ + }; + var CDO_TOKEN = { + type: 25 + /* CDO_TOKEN */ + }; + var CDC_TOKEN = { + type: 24 + /* CDC_TOKEN */ + }; + var COLON_TOKEN = { + type: 26 + /* COLON_TOKEN */ + }; + var SEMICOLON_TOKEN = { + type: 27 + /* SEMICOLON_TOKEN */ + }; + var LEFT_SQUARE_BRACKET_TOKEN = { + type: 28 + /* LEFT_SQUARE_BRACKET_TOKEN */ + }; + var RIGHT_SQUARE_BRACKET_TOKEN = { + type: 29 + /* RIGHT_SQUARE_BRACKET_TOKEN */ + }; + var WHITESPACE_TOKEN = { + type: 31 + /* WHITESPACE_TOKEN */ + }; + var EOF_TOKEN = { + type: 32 + /* EOF_TOKEN */ + }; + var Tokenizer = ( + /** @class */ + (function() { + function Tokenizer2() { + this._value = []; + } + Tokenizer2.prototype.write = function(chunk) { + this._value = this._value.concat(toCodePoints$1(chunk)); + }; + Tokenizer2.prototype.read = function() { + var tokens = []; + var token = this.consumeToken(); + while (token !== EOF_TOKEN) { + tokens.push(token); + token = this.consumeToken(); + } + return tokens; + }; + Tokenizer2.prototype.consumeToken = function() { + var codePoint = this.consumeCodePoint(); + switch (codePoint) { + case QUOTATION_MARK: + return this.consumeStringToken(QUOTATION_MARK); + case NUMBER_SIGN: + var c1 = this.peekCodePoint(0); + var c2 = this.peekCodePoint(1); + var c3 = this.peekCodePoint(2); + if (isNameCodePoint(c1) || isValidEscape(c2, c3)) { + var flags = isIdentifierStart(c1, c2, c3) ? FLAG_ID : FLAG_UNRESTRICTED; + var value = this.consumeName(); + return { type: 5, value, flags }; + } + break; + case DOLLAR_SIGN: + if (this.peekCodePoint(0) === EQUALS_SIGN) { + this.consumeCodePoint(); + return SUFFIX_MATCH_TOKEN; + } + break; + case APOSTROPHE: + return this.consumeStringToken(APOSTROPHE); + case LEFT_PARENTHESIS: + return LEFT_PARENTHESIS_TOKEN; + case RIGHT_PARENTHESIS: + return RIGHT_PARENTHESIS_TOKEN; + case ASTERISK: + if (this.peekCodePoint(0) === EQUALS_SIGN) { + this.consumeCodePoint(); + return SUBSTRING_MATCH_TOKEN; + } + break; + case PLUS_SIGN: + if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) { + this.reconsumeCodePoint(codePoint); + return this.consumeNumericToken(); + } + break; + case COMMA: + return COMMA_TOKEN; + case HYPHEN_MINUS: + var e1 = codePoint; + var e2 = this.peekCodePoint(0); + var e3 = this.peekCodePoint(1); + if (isNumberStart(e1, e2, e3)) { + this.reconsumeCodePoint(codePoint); + return this.consumeNumericToken(); + } + if (isIdentifierStart(e1, e2, e3)) { + this.reconsumeCodePoint(codePoint); + return this.consumeIdentLikeToken(); + } + if (e2 === HYPHEN_MINUS && e3 === GREATER_THAN_SIGN) { + this.consumeCodePoint(); + this.consumeCodePoint(); + return CDC_TOKEN; + } + break; + case FULL_STOP: + if (isNumberStart(codePoint, this.peekCodePoint(0), this.peekCodePoint(1))) { + this.reconsumeCodePoint(codePoint); + return this.consumeNumericToken(); + } + break; + case SOLIDUS: + if (this.peekCodePoint(0) === ASTERISK) { + this.consumeCodePoint(); + while (true) { + var c = this.consumeCodePoint(); + if (c === ASTERISK) { + c = this.consumeCodePoint(); + if (c === SOLIDUS) { + return this.consumeToken(); + } + } + if (c === EOF) { + return this.consumeToken(); + } + } + } + break; + case COLON: + return COLON_TOKEN; + case SEMICOLON: + return SEMICOLON_TOKEN; + case LESS_THAN_SIGN: + if (this.peekCodePoint(0) === EXCLAMATION_MARK && this.peekCodePoint(1) === HYPHEN_MINUS && this.peekCodePoint(2) === HYPHEN_MINUS) { + this.consumeCodePoint(); + this.consumeCodePoint(); + return CDO_TOKEN; + } + break; + case COMMERCIAL_AT: + var a1 = this.peekCodePoint(0); + var a2 = this.peekCodePoint(1); + var a3 = this.peekCodePoint(2); + if (isIdentifierStart(a1, a2, a3)) { + var value = this.consumeName(); + return { type: 7, value }; + } + break; + case LEFT_SQUARE_BRACKET: + return LEFT_SQUARE_BRACKET_TOKEN; + case REVERSE_SOLIDUS: + if (isValidEscape(codePoint, this.peekCodePoint(0))) { + this.reconsumeCodePoint(codePoint); + return this.consumeIdentLikeToken(); + } + break; + case RIGHT_SQUARE_BRACKET: + return RIGHT_SQUARE_BRACKET_TOKEN; + case CIRCUMFLEX_ACCENT: + if (this.peekCodePoint(0) === EQUALS_SIGN) { + this.consumeCodePoint(); + return PREFIX_MATCH_TOKEN; + } + break; + case LEFT_CURLY_BRACKET: + return LEFT_CURLY_BRACKET_TOKEN; + case RIGHT_CURLY_BRACKET: + return RIGHT_CURLY_BRACKET_TOKEN; + case u: + case U: + var u1 = this.peekCodePoint(0); + var u2 = this.peekCodePoint(1); + if (u1 === PLUS_SIGN && (isHex(u2) || u2 === QUESTION_MARK)) { + this.consumeCodePoint(); + this.consumeUnicodeRangeToken(); + } + this.reconsumeCodePoint(codePoint); + return this.consumeIdentLikeToken(); + case VERTICAL_LINE: + if (this.peekCodePoint(0) === EQUALS_SIGN) { + this.consumeCodePoint(); + return DASH_MATCH_TOKEN; + } + if (this.peekCodePoint(0) === VERTICAL_LINE) { + this.consumeCodePoint(); + return COLUMN_TOKEN; + } + break; + case TILDE: + if (this.peekCodePoint(0) === EQUALS_SIGN) { + this.consumeCodePoint(); + return INCLUDE_MATCH_TOKEN; + } + break; + case EOF: + return EOF_TOKEN; + } + if (isWhiteSpace(codePoint)) { + this.consumeWhiteSpace(); + return WHITESPACE_TOKEN; + } + if (isDigit(codePoint)) { + this.reconsumeCodePoint(codePoint); + return this.consumeNumericToken(); + } + if (isNameStartCodePoint(codePoint)) { + this.reconsumeCodePoint(codePoint); + return this.consumeIdentLikeToken(); + } + return { type: 6, value: fromCodePoint$1(codePoint) }; + }; + Tokenizer2.prototype.consumeCodePoint = function() { + var value = this._value.shift(); + return typeof value === "undefined" ? -1 : value; + }; + Tokenizer2.prototype.reconsumeCodePoint = function(codePoint) { + this._value.unshift(codePoint); + }; + Tokenizer2.prototype.peekCodePoint = function(delta) { + if (delta >= this._value.length) { + return -1; + } + return this._value[delta]; + }; + Tokenizer2.prototype.consumeUnicodeRangeToken = function() { + var digits = []; + var codePoint = this.consumeCodePoint(); + while (isHex(codePoint) && digits.length < 6) { + digits.push(codePoint); + codePoint = this.consumeCodePoint(); + } + var questionMarks = false; + while (codePoint === QUESTION_MARK && digits.length < 6) { + digits.push(codePoint); + codePoint = this.consumeCodePoint(); + questionMarks = true; + } + if (questionMarks) { + var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) { + return digit === QUESTION_MARK ? ZERO : digit; + })), 16); + var end = parseInt(fromCodePoint$1.apply(void 0, digits.map(function(digit) { + return digit === QUESTION_MARK ? F : digit; + })), 16); + return { type: 30, start: start_1, end }; + } + var start = parseInt(fromCodePoint$1.apply(void 0, digits), 16); + if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) { + this.consumeCodePoint(); + codePoint = this.consumeCodePoint(); + var endDigits = []; + while (isHex(codePoint) && endDigits.length < 6) { + endDigits.push(codePoint); + codePoint = this.consumeCodePoint(); + } + var end = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16); + return { type: 30, start, end }; + } else { + return { type: 30, start, end: start }; + } + }; + Tokenizer2.prototype.consumeIdentLikeToken = function() { + var value = this.consumeName(); + if (value.toLowerCase() === "url" && this.peekCodePoint(0) === LEFT_PARENTHESIS) { + this.consumeCodePoint(); + return this.consumeUrlToken(); + } else if (this.peekCodePoint(0) === LEFT_PARENTHESIS) { + this.consumeCodePoint(); + return { type: 19, value }; + } + return { type: 20, value }; + }; + Tokenizer2.prototype.consumeUrlToken = function() { + var value = []; + this.consumeWhiteSpace(); + if (this.peekCodePoint(0) === EOF) { + return { type: 22, value: "" }; + } + var next = this.peekCodePoint(0); + if (next === APOSTROPHE || next === QUOTATION_MARK) { + var stringToken = this.consumeStringToken(this.consumeCodePoint()); + if (stringToken.type === 0) { + this.consumeWhiteSpace(); + if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) { + this.consumeCodePoint(); + return { type: 22, value: stringToken.value }; + } + } + this.consumeBadUrlRemnants(); + return BAD_URL_TOKEN; + } + while (true) { + var codePoint = this.consumeCodePoint(); + if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) { + return { type: 22, value: fromCodePoint$1.apply(void 0, value) }; + } else if (isWhiteSpace(codePoint)) { + this.consumeWhiteSpace(); + if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) { + this.consumeCodePoint(); + return { type: 22, value: fromCodePoint$1.apply(void 0, value) }; + } + this.consumeBadUrlRemnants(); + return BAD_URL_TOKEN; + } else if (codePoint === QUOTATION_MARK || codePoint === APOSTROPHE || codePoint === LEFT_PARENTHESIS || isNonPrintableCodePoint(codePoint)) { + this.consumeBadUrlRemnants(); + return BAD_URL_TOKEN; + } else if (codePoint === REVERSE_SOLIDUS) { + if (isValidEscape(codePoint, this.peekCodePoint(0))) { + value.push(this.consumeEscapedCodePoint()); + } else { + this.consumeBadUrlRemnants(); + return BAD_URL_TOKEN; + } + } else { + value.push(codePoint); + } + } + }; + Tokenizer2.prototype.consumeWhiteSpace = function() { + while (isWhiteSpace(this.peekCodePoint(0))) { + this.consumeCodePoint(); + } + }; + Tokenizer2.prototype.consumeBadUrlRemnants = function() { + while (true) { + var codePoint = this.consumeCodePoint(); + if (codePoint === RIGHT_PARENTHESIS || codePoint === EOF) { + return; + } + if (isValidEscape(codePoint, this.peekCodePoint(0))) { + this.consumeEscapedCodePoint(); + } + } + }; + Tokenizer2.prototype.consumeStringSlice = function(count) { + var SLICE_STACK_SIZE = 5e4; + var value = ""; + while (count > 0) { + var amount = Math.min(SLICE_STACK_SIZE, count); + value += fromCodePoint$1.apply(void 0, this._value.splice(0, amount)); + count -= amount; + } + this._value.shift(); + return value; + }; + Tokenizer2.prototype.consumeStringToken = function(endingCodePoint) { + var value = ""; + var i2 = 0; + do { + var codePoint = this._value[i2]; + if (codePoint === EOF || codePoint === void 0 || codePoint === endingCodePoint) { + value += this.consumeStringSlice(i2); + return { type: 0, value }; + } + if (codePoint === LINE_FEED) { + this._value.splice(0, i2); + return BAD_STRING_TOKEN; + } + if (codePoint === REVERSE_SOLIDUS) { + var next = this._value[i2 + 1]; + if (next !== EOF && next !== void 0) { + if (next === LINE_FEED) { + value += this.consumeStringSlice(i2); + i2 = -1; + this._value.shift(); + } else if (isValidEscape(codePoint, next)) { + value += this.consumeStringSlice(i2); + value += fromCodePoint$1(this.consumeEscapedCodePoint()); + i2 = -1; + } + } + } + i2++; + } while (true); + }; + Tokenizer2.prototype.consumeNumber = function() { + var repr = []; + var type = FLAG_INTEGER; + var c1 = this.peekCodePoint(0); + if (c1 === PLUS_SIGN || c1 === HYPHEN_MINUS) { + repr.push(this.consumeCodePoint()); + } + while (isDigit(this.peekCodePoint(0))) { + repr.push(this.consumeCodePoint()); + } + c1 = this.peekCodePoint(0); + var c2 = this.peekCodePoint(1); + if (c1 === FULL_STOP && isDigit(c2)) { + repr.push(this.consumeCodePoint(), this.consumeCodePoint()); + type = FLAG_NUMBER; + while (isDigit(this.peekCodePoint(0))) { + repr.push(this.consumeCodePoint()); + } + } + c1 = this.peekCodePoint(0); + c2 = this.peekCodePoint(1); + var c3 = this.peekCodePoint(2); + if ((c1 === E || c1 === e) && ((c2 === PLUS_SIGN || c2 === HYPHEN_MINUS) && isDigit(c3) || isDigit(c2))) { + repr.push(this.consumeCodePoint(), this.consumeCodePoint()); + type = FLAG_NUMBER; + while (isDigit(this.peekCodePoint(0))) { + repr.push(this.consumeCodePoint()); + } + } + return [stringToNumber(repr), type]; + }; + Tokenizer2.prototype.consumeNumericToken = function() { + var _a = this.consumeNumber(), number = _a[0], flags = _a[1]; + var c1 = this.peekCodePoint(0); + var c2 = this.peekCodePoint(1); + var c3 = this.peekCodePoint(2); + if (isIdentifierStart(c1, c2, c3)) { + var unit = this.consumeName(); + return { type: 15, number, flags, unit }; + } + if (c1 === PERCENTAGE_SIGN) { + this.consumeCodePoint(); + return { type: 16, number, flags }; + } + return { type: 17, number, flags }; + }; + Tokenizer2.prototype.consumeEscapedCodePoint = function() { + var codePoint = this.consumeCodePoint(); + if (isHex(codePoint)) { + var hex = fromCodePoint$1(codePoint); + while (isHex(this.peekCodePoint(0)) && hex.length < 6) { + hex += fromCodePoint$1(this.consumeCodePoint()); + } + if (isWhiteSpace(this.peekCodePoint(0))) { + this.consumeCodePoint(); + } + var hexCodePoint = parseInt(hex, 16); + if (hexCodePoint === 0 || isSurrogateCodePoint(hexCodePoint) || hexCodePoint > 1114111) { + return REPLACEMENT_CHARACTER; + } + return hexCodePoint; + } + if (codePoint === EOF) { + return REPLACEMENT_CHARACTER; + } + return codePoint; + }; + Tokenizer2.prototype.consumeName = function() { + var result = ""; + while (true) { + var codePoint = this.consumeCodePoint(); + if (isNameCodePoint(codePoint)) { + result += fromCodePoint$1(codePoint); + } else if (isValidEscape(codePoint, this.peekCodePoint(0))) { + result += fromCodePoint$1(this.consumeEscapedCodePoint()); + } else { + this.reconsumeCodePoint(codePoint); + return result; + } + } + }; + return Tokenizer2; + })() + ); + var Parser = ( + /** @class */ + (function() { + function Parser2(tokens) { + this._tokens = tokens; + } + Parser2.create = function(value) { + var tokenizer = new Tokenizer(); + tokenizer.write(value); + return new Parser2(tokenizer.read()); + }; + Parser2.parseValue = function(value) { + return Parser2.create(value).parseComponentValue(); + }; + Parser2.parseValues = function(value) { + return Parser2.create(value).parseComponentValues(); + }; + Parser2.prototype.parseComponentValue = function() { + var token = this.consumeToken(); + while (token.type === 31) { + token = this.consumeToken(); + } + if (token.type === 32) { + throw new SyntaxError("Error parsing CSS component value, unexpected EOF"); + } + this.reconsumeToken(token); + var value = this.consumeComponentValue(); + do { + token = this.consumeToken(); + } while (token.type === 31); + if (token.type === 32) { + return value; + } + throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one"); + }; + Parser2.prototype.parseComponentValues = function() { + var values = []; + while (true) { + var value = this.consumeComponentValue(); + if (value.type === 32) { + return values; + } + values.push(value); + values.push(); + } + }; + Parser2.prototype.consumeComponentValue = function() { + var token = this.consumeToken(); + switch (token.type) { + case 11: + case 28: + case 2: + return this.consumeSimpleBlock(token.type); + case 19: + return this.consumeFunction(token); + } + return token; + }; + Parser2.prototype.consumeSimpleBlock = function(type) { + var block = { type, values: [] }; + var token = this.consumeToken(); + while (true) { + if (token.type === 32 || isEndingTokenFor(token, type)) { + return block; + } + this.reconsumeToken(token); + block.values.push(this.consumeComponentValue()); + token = this.consumeToken(); + } + }; + Parser2.prototype.consumeFunction = function(functionToken) { + var cssFunction = { + name: functionToken.value, + values: [], + type: 18 + /* FUNCTION */ + }; + while (true) { + var token = this.consumeToken(); + if (token.type === 32 || token.type === 3) { + return cssFunction; + } + this.reconsumeToken(token); + cssFunction.values.push(this.consumeComponentValue()); + } + }; + Parser2.prototype.consumeToken = function() { + var token = this._tokens.shift(); + return typeof token === "undefined" ? EOF_TOKEN : token; + }; + Parser2.prototype.reconsumeToken = function(token) { + this._tokens.unshift(token); + }; + return Parser2; + })() + ); + var isDimensionToken = function(token) { + return token.type === 15; + }; + var isNumberToken = function(token) { + return token.type === 17; + }; + var isIdentToken = function(token) { + return token.type === 20; + }; + var isStringToken = function(token) { + return token.type === 0; + }; + var isIdentWithValue = function(token, value) { + return isIdentToken(token) && token.value === value; + }; + var nonWhiteSpace = function(token) { + return token.type !== 31; + }; + var nonFunctionArgSeparator = function(token) { + return token.type !== 31 && token.type !== 4; + }; + var parseFunctionArgs = function(tokens) { + var args = []; + var arg = []; + tokens.forEach(function(token) { + if (token.type === 4) { + if (arg.length === 0) { + throw new Error("Error parsing function args, zero tokens for arg"); + } + args.push(arg); + arg = []; + return; + } + if (token.type !== 31) { + arg.push(token); + } + }); + if (arg.length) { + args.push(arg); + } + return args; + }; + var isEndingTokenFor = function(token, type) { + if (type === 11 && token.type === 12) { + return true; + } + if (type === 28 && token.type === 29) { + return true; + } + return type === 2 && token.type === 3; + }; + var isLength = function(token) { + return token.type === 17 || token.type === 15; + }; + var isLengthPercentage = function(token) { + return token.type === 16 || isLength(token); + }; + var parseLengthPercentageTuple = function(tokens) { + return tokens.length > 1 ? [tokens[0], tokens[1]] : [tokens[0]]; + }; + var ZERO_LENGTH = { + type: 17, + number: 0, + flags: FLAG_INTEGER + }; + var FIFTY_PERCENT = { + type: 16, + number: 50, + flags: FLAG_INTEGER + }; + var HUNDRED_PERCENT = { + type: 16, + number: 100, + flags: FLAG_INTEGER + }; + var getAbsoluteValueForTuple = function(tuple, width, height) { + var x = tuple[0], y = tuple[1]; + return [getAbsoluteValue(x, width), getAbsoluteValue(typeof y !== "undefined" ? y : x, height)]; + }; + var getAbsoluteValue = function(token, parent) { + if (token.type === 16) { + return token.number / 100 * parent; + } + if (isDimensionToken(token)) { + switch (token.unit) { + case "rem": + case "em": + return 16 * token.number; + // TODO use correct font-size + case "px": + default: + return token.number; + } + } + return token.number; + }; + var DEG = "deg"; + var GRAD = "grad"; + var RAD = "rad"; + var TURN = "turn"; + var angle = { + name: "angle", + parse: function(_context, value) { + if (value.type === 15) { + switch (value.unit) { + case DEG: + return Math.PI * value.number / 180; + case GRAD: + return Math.PI / 200 * value.number; + case RAD: + return value.number; + case TURN: + return Math.PI * 2 * value.number; + } + } + throw new Error("Unsupported angle type"); + } + }; + var isAngle = function(value) { + if (value.type === 15) { + if (value.unit === DEG || value.unit === GRAD || value.unit === RAD || value.unit === TURN) { + return true; + } + } + return false; + }; + var parseNamedSide = function(tokens) { + var sideOrCorner = tokens.filter(isIdentToken).map(function(ident) { + return ident.value; + }).join(" "); + switch (sideOrCorner) { + case "to bottom right": + case "to right bottom": + case "left top": + case "top left": + return [ZERO_LENGTH, ZERO_LENGTH]; + case "to top": + case "bottom": + return deg(0); + case "to bottom left": + case "to left bottom": + case "right top": + case "top right": + return [ZERO_LENGTH, HUNDRED_PERCENT]; + case "to right": + case "left": + return deg(90); + case "to top left": + case "to left top": + case "right bottom": + case "bottom right": + return [HUNDRED_PERCENT, HUNDRED_PERCENT]; + case "to bottom": + case "top": + return deg(180); + case "to top right": + case "to right top": + case "left bottom": + case "bottom left": + return [HUNDRED_PERCENT, ZERO_LENGTH]; + case "to left": + case "right": + return deg(270); + } + return 0; + }; + var deg = function(deg2) { + return Math.PI * deg2 / 180; + }; + var color$1 = { + name: "color", + parse: function(context, value) { + if (value.type === 18) { + var colorFunction = SUPPORTED_COLOR_FUNCTIONS[value.name]; + if (typeof colorFunction === "undefined") { + throw new Error('Attempting to parse an unsupported color function "' + value.name + '"'); + } + return colorFunction(context, value.values); + } + if (value.type === 5) { + if (value.value.length === 3) { + var r = value.value.substring(0, 1); + var g = value.value.substring(1, 2); + var b = value.value.substring(2, 3); + return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), 1); + } + if (value.value.length === 4) { + var r = value.value.substring(0, 1); + var g = value.value.substring(1, 2); + var b = value.value.substring(2, 3); + var a2 = value.value.substring(3, 4); + return pack(parseInt(r + r, 16), parseInt(g + g, 16), parseInt(b + b, 16), parseInt(a2 + a2, 16) / 255); + } + if (value.value.length === 6) { + var r = value.value.substring(0, 2); + var g = value.value.substring(2, 4); + var b = value.value.substring(4, 6); + return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), 1); + } + if (value.value.length === 8) { + var r = value.value.substring(0, 2); + var g = value.value.substring(2, 4); + var b = value.value.substring(4, 6); + var a2 = value.value.substring(6, 8); + return pack(parseInt(r, 16), parseInt(g, 16), parseInt(b, 16), parseInt(a2, 16) / 255); + } + } + if (value.type === 20) { + var namedColor = COLORS[value.value.toUpperCase()]; + if (typeof namedColor !== "undefined") { + return namedColor; + } + } + return COLORS.TRANSPARENT; + } + }; + var isTransparent = function(color2) { + return (255 & color2) === 0; + }; + var asString = function(color2) { + var alpha = 255 & color2; + var blue = 255 & color2 >> 8; + var green = 255 & color2 >> 16; + var red = 255 & color2 >> 24; + return alpha < 255 ? "rgba(" + red + "," + green + "," + blue + "," + alpha / 255 + ")" : "rgb(" + red + "," + green + "," + blue + ")"; + }; + var pack = function(r, g, b, a2) { + return (r << 24 | g << 16 | b << 8 | Math.round(a2 * 255) << 0) >>> 0; + }; + var getTokenColorValue = function(token, i2) { + if (token.type === 17) { + return token.number; + } + if (token.type === 16) { + var max = i2 === 3 ? 1 : 255; + return i2 === 3 ? token.number / 100 * max : Math.round(token.number / 100 * max); + } + return 0; + }; + var rgb = function(_context, args) { + var tokens = args.filter(nonFunctionArgSeparator); + if (tokens.length === 3) { + var _a = tokens.map(getTokenColorValue), r = _a[0], g = _a[1], b = _a[2]; + return pack(r, g, b, 1); + } + if (tokens.length === 4) { + var _b = tokens.map(getTokenColorValue), r = _b[0], g = _b[1], b = _b[2], a2 = _b[3]; + return pack(r, g, b, a2); + } + return 0; + }; + function hue2rgb(t1, t2, hue) { + if (hue < 0) { + hue += 1; + } + if (hue >= 1) { + hue -= 1; + } + if (hue < 1 / 6) { + return (t2 - t1) * hue * 6 + t1; + } else if (hue < 1 / 2) { + return t2; + } else if (hue < 2 / 3) { + return (t2 - t1) * 6 * (2 / 3 - hue) + t1; + } else { + return t1; + } + } + var hsl = function(context, args) { + var tokens = args.filter(nonFunctionArgSeparator); + var hue = tokens[0], saturation = tokens[1], lightness = tokens[2], alpha = tokens[3]; + var h = (hue.type === 17 ? deg(hue.number) : angle.parse(context, hue)) / (Math.PI * 2); + var s = isLengthPercentage(saturation) ? saturation.number / 100 : 0; + var l = isLengthPercentage(lightness) ? lightness.number / 100 : 0; + var a2 = typeof alpha !== "undefined" && isLengthPercentage(alpha) ? getAbsoluteValue(alpha, 1) : 1; + if (s === 0) { + return pack(l * 255, l * 255, l * 255, 1); + } + var t2 = l <= 0.5 ? l * (s + 1) : l + s - l * s; + var t1 = l * 2 - t2; + var r = hue2rgb(t1, t2, h + 1 / 3); + var g = hue2rgb(t1, t2, h); + var b = hue2rgb(t1, t2, h - 1 / 3); + return pack(r * 255, g * 255, b * 255, a2); + }; + var SUPPORTED_COLOR_FUNCTIONS = { + hsl, + hsla: hsl, + rgb, + rgba: rgb + }; + var parseColor = function(context, value) { + return color$1.parse(context, Parser.create(value).parseComponentValue()); + }; + var COLORS = { + ALICEBLUE: 4042850303, + ANTIQUEWHITE: 4209760255, + AQUA: 16777215, + AQUAMARINE: 2147472639, + AZURE: 4043309055, + BEIGE: 4126530815, + BISQUE: 4293182719, + BLACK: 255, + BLANCHEDALMOND: 4293643775, + BLUE: 65535, + BLUEVIOLET: 2318131967, + BROWN: 2771004159, + BURLYWOOD: 3736635391, + CADETBLUE: 1604231423, + CHARTREUSE: 2147418367, + CHOCOLATE: 3530104575, + CORAL: 4286533887, + CORNFLOWERBLUE: 1687547391, + CORNSILK: 4294499583, + CRIMSON: 3692313855, + CYAN: 16777215, + DARKBLUE: 35839, + DARKCYAN: 9145343, + DARKGOLDENROD: 3095837695, + DARKGRAY: 2846468607, + DARKGREEN: 6553855, + DARKGREY: 2846468607, + DARKKHAKI: 3182914559, + DARKMAGENTA: 2332068863, + DARKOLIVEGREEN: 1433087999, + DARKORANGE: 4287365375, + DARKORCHID: 2570243327, + DARKRED: 2332033279, + DARKSALMON: 3918953215, + DARKSEAGREEN: 2411499519, + DARKSLATEBLUE: 1211993087, + DARKSLATEGRAY: 793726975, + DARKSLATEGREY: 793726975, + DARKTURQUOISE: 13554175, + DARKVIOLET: 2483082239, + DEEPPINK: 4279538687, + DEEPSKYBLUE: 12582911, + DIMGRAY: 1768516095, + DIMGREY: 1768516095, + DODGERBLUE: 512819199, + FIREBRICK: 2988581631, + FLORALWHITE: 4294635775, + FORESTGREEN: 579543807, + FUCHSIA: 4278255615, + GAINSBORO: 3705462015, + GHOSTWHITE: 4177068031, + GOLD: 4292280575, + GOLDENROD: 3668254975, + GRAY: 2155905279, + GREEN: 8388863, + GREENYELLOW: 2919182335, + GREY: 2155905279, + HONEYDEW: 4043305215, + HOTPINK: 4285117695, + INDIANRED: 3445382399, + INDIGO: 1258324735, + IVORY: 4294963455, + KHAKI: 4041641215, + LAVENDER: 3873897215, + LAVENDERBLUSH: 4293981695, + LAWNGREEN: 2096890111, + LEMONCHIFFON: 4294626815, + LIGHTBLUE: 2916673279, + LIGHTCORAL: 4034953471, + LIGHTCYAN: 3774873599, + LIGHTGOLDENRODYELLOW: 4210742015, + LIGHTGRAY: 3553874943, + LIGHTGREEN: 2431553791, + LIGHTGREY: 3553874943, + LIGHTPINK: 4290167295, + LIGHTSALMON: 4288707327, + LIGHTSEAGREEN: 548580095, + LIGHTSKYBLUE: 2278488831, + LIGHTSLATEGRAY: 2005441023, + LIGHTSLATEGREY: 2005441023, + LIGHTSTEELBLUE: 2965692159, + LIGHTYELLOW: 4294959359, + LIME: 16711935, + LIMEGREEN: 852308735, + LINEN: 4210091775, + MAGENTA: 4278255615, + MAROON: 2147483903, + MEDIUMAQUAMARINE: 1724754687, + MEDIUMBLUE: 52735, + MEDIUMORCHID: 3126187007, + MEDIUMPURPLE: 2473647103, + MEDIUMSEAGREEN: 1018393087, + MEDIUMSLATEBLUE: 2070474495, + MEDIUMSPRINGGREEN: 16423679, + MEDIUMTURQUOISE: 1221709055, + MEDIUMVIOLETRED: 3340076543, + MIDNIGHTBLUE: 421097727, + MINTCREAM: 4127193855, + MISTYROSE: 4293190143, + MOCCASIN: 4293178879, + NAVAJOWHITE: 4292783615, + NAVY: 33023, + OLDLACE: 4260751103, + OLIVE: 2155872511, + OLIVEDRAB: 1804477439, + ORANGE: 4289003775, + ORANGERED: 4282712319, + ORCHID: 3664828159, + PALEGOLDENROD: 4008225535, + PALEGREEN: 2566625535, + PALETURQUOISE: 2951671551, + PALEVIOLETRED: 3681588223, + PAPAYAWHIP: 4293907967, + PEACHPUFF: 4292524543, + PERU: 3448061951, + PINK: 4290825215, + PLUM: 3718307327, + POWDERBLUE: 2967529215, + PURPLE: 2147516671, + REBECCAPURPLE: 1714657791, + RED: 4278190335, + ROSYBROWN: 3163525119, + ROYALBLUE: 1097458175, + SADDLEBROWN: 2336560127, + SALMON: 4202722047, + SANDYBROWN: 4104413439, + SEAGREEN: 780883967, + SEASHELL: 4294307583, + SIENNA: 2689740287, + SILVER: 3233857791, + SKYBLUE: 2278484991, + SLATEBLUE: 1784335871, + SLATEGRAY: 1887473919, + SLATEGREY: 1887473919, + SNOW: 4294638335, + SPRINGGREEN: 16744447, + STEELBLUE: 1182971135, + TAN: 3535047935, + TEAL: 8421631, + THISTLE: 3636451583, + TOMATO: 4284696575, + TRANSPARENT: 0, + TURQUOISE: 1088475391, + VIOLET: 4001558271, + WHEAT: 4125012991, + WHITE: 4294967295, + WHITESMOKE: 4126537215, + YELLOW: 4294902015, + YELLOWGREEN: 2597139199 + }; + var backgroundClip = { + name: "background-clip", + initialValue: "border-box", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return tokens.map(function(token) { + if (isIdentToken(token)) { + switch (token.value) { + case "padding-box": + return 1; + case "content-box": + return 2; + } + } + return 0; + }); + } + }; + var backgroundColor = { + name: "background-color", + initialValue: "transparent", + prefix: false, + type: 3, + format: "color" + }; + var parseColorStop = function(context, args) { + var color2 = color$1.parse(context, args[0]); + var stop = args[1]; + return stop && isLengthPercentage(stop) ? { color: color2, stop } : { color: color2, stop: null }; + }; + var processColorStops = function(stops, lineLength) { + var first = stops[0]; + var last = stops[stops.length - 1]; + if (first.stop === null) { + first.stop = ZERO_LENGTH; + } + if (last.stop === null) { + last.stop = HUNDRED_PERCENT; + } + var processStops = []; + var previous = 0; + for (var i2 = 0; i2 < stops.length; i2++) { + var stop_1 = stops[i2].stop; + if (stop_1 !== null) { + var absoluteValue = getAbsoluteValue(stop_1, lineLength); + if (absoluteValue > previous) { + processStops.push(absoluteValue); + } else { + processStops.push(previous); + } + previous = absoluteValue; + } else { + processStops.push(null); + } + } + var gapBegin = null; + for (var i2 = 0; i2 < processStops.length; i2++) { + var stop_2 = processStops[i2]; + if (stop_2 === null) { + if (gapBegin === null) { + gapBegin = i2; + } + } else if (gapBegin !== null) { + var gapLength = i2 - gapBegin; + var beforeGap = processStops[gapBegin - 1]; + var gapValue = (stop_2 - beforeGap) / (gapLength + 1); + for (var g = 1; g <= gapLength; g++) { + processStops[gapBegin + g - 1] = gapValue * g; + } + gapBegin = null; + } + } + return stops.map(function(_a, i3) { + var color2 = _a.color; + return { color: color2, stop: Math.max(Math.min(1, processStops[i3] / lineLength), 0) }; + }); + }; + var getAngleFromCorner = function(corner, width, height) { + var centerX = width / 2; + var centerY = height / 2; + var x = getAbsoluteValue(corner[0], width) - centerX; + var y = centerY - getAbsoluteValue(corner[1], height); + return (Math.atan2(y, x) + Math.PI * 2) % (Math.PI * 2); + }; + var calculateGradientDirection = function(angle2, width, height) { + var radian = typeof angle2 === "number" ? angle2 : getAngleFromCorner(angle2, width, height); + var lineLength = Math.abs(width * Math.sin(radian)) + Math.abs(height * Math.cos(radian)); + var halfWidth = width / 2; + var halfHeight = height / 2; + var halfLineLength = lineLength / 2; + var yDiff = Math.sin(radian - Math.PI / 2) * halfLineLength; + var xDiff = Math.cos(radian - Math.PI / 2) * halfLineLength; + return [lineLength, halfWidth - xDiff, halfWidth + xDiff, halfHeight - yDiff, halfHeight + yDiff]; + }; + var distance = function(a2, b) { + return Math.sqrt(a2 * a2 + b * b); + }; + var findCorner = function(width, height, x, y, closest) { + var corners = [ + [0, 0], + [0, height], + [width, 0], + [width, height] + ]; + return corners.reduce(function(stat, corner) { + var cx = corner[0], cy = corner[1]; + var d = distance(x - cx, y - cy); + if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) { + return { + optimumCorner: corner, + optimumDistance: d + }; + } + return stat; + }, { + optimumDistance: closest ? Infinity : -Infinity, + optimumCorner: null + }).optimumCorner; + }; + var calculateRadius = function(gradient, x, y, width, height) { + var rx = 0; + var ry = 0; + switch (gradient.size) { + case 0: + if (gradient.shape === 0) { + rx = ry = Math.min(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height)); + } else if (gradient.shape === 1) { + rx = Math.min(Math.abs(x), Math.abs(x - width)); + ry = Math.min(Math.abs(y), Math.abs(y - height)); + } + break; + case 2: + if (gradient.shape === 0) { + rx = ry = Math.min(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height)); + } else if (gradient.shape === 1) { + var c = Math.min(Math.abs(y), Math.abs(y - height)) / Math.min(Math.abs(x), Math.abs(x - width)); + var _a = findCorner(width, height, x, y, true), cx = _a[0], cy = _a[1]; + rx = distance(cx - x, (cy - y) / c); + ry = c * rx; + } + break; + case 1: + if (gradient.shape === 0) { + rx = ry = Math.max(Math.abs(x), Math.abs(x - width), Math.abs(y), Math.abs(y - height)); + } else if (gradient.shape === 1) { + rx = Math.max(Math.abs(x), Math.abs(x - width)); + ry = Math.max(Math.abs(y), Math.abs(y - height)); + } + break; + case 3: + if (gradient.shape === 0) { + rx = ry = Math.max(distance(x, y), distance(x, y - height), distance(x - width, y), distance(x - width, y - height)); + } else if (gradient.shape === 1) { + var c = Math.max(Math.abs(y), Math.abs(y - height)) / Math.max(Math.abs(x), Math.abs(x - width)); + var _b = findCorner(width, height, x, y, false), cx = _b[0], cy = _b[1]; + rx = distance(cx - x, (cy - y) / c); + ry = c * rx; + } + break; + } + if (Array.isArray(gradient.size)) { + rx = getAbsoluteValue(gradient.size[0], width); + ry = gradient.size.length === 2 ? getAbsoluteValue(gradient.size[1], height) : rx; + } + return [rx, ry]; + }; + var linearGradient = function(context, tokens) { + var angle$1 = deg(180); + var stops = []; + parseFunctionArgs(tokens).forEach(function(arg, i2) { + if (i2 === 0) { + var firstToken = arg[0]; + if (firstToken.type === 20 && firstToken.value === "to") { + angle$1 = parseNamedSide(arg); + return; + } else if (isAngle(firstToken)) { + angle$1 = angle.parse(context, firstToken); + return; + } + } + var colorStop = parseColorStop(context, arg); + stops.push(colorStop); + }); + return { + angle: angle$1, + stops, + type: 1 + /* LINEAR_GRADIENT */ + }; + }; + var prefixLinearGradient = function(context, tokens) { + var angle$1 = deg(180); + var stops = []; + parseFunctionArgs(tokens).forEach(function(arg, i2) { + if (i2 === 0) { + var firstToken = arg[0]; + if (firstToken.type === 20 && ["top", "left", "right", "bottom"].indexOf(firstToken.value) !== -1) { + angle$1 = parseNamedSide(arg); + return; + } else if (isAngle(firstToken)) { + angle$1 = (angle.parse(context, firstToken) + deg(270)) % deg(360); + return; + } + } + var colorStop = parseColorStop(context, arg); + stops.push(colorStop); + }); + return { + angle: angle$1, + stops, + type: 1 + /* LINEAR_GRADIENT */ + }; + }; + var webkitGradient = function(context, tokens) { + var angle2 = deg(180); + var stops = []; + var type = 1; + var shape = 0; + var size = 3; + var position2 = []; + parseFunctionArgs(tokens).forEach(function(arg, i2) { + var firstToken = arg[0]; + if (i2 === 0) { + if (isIdentToken(firstToken) && firstToken.value === "linear") { + type = 1; + return; + } else if (isIdentToken(firstToken) && firstToken.value === "radial") { + type = 2; + return; + } + } + if (firstToken.type === 18) { + if (firstToken.name === "from") { + var color2 = color$1.parse(context, firstToken.values[0]); + stops.push({ stop: ZERO_LENGTH, color: color2 }); + } else if (firstToken.name === "to") { + var color2 = color$1.parse(context, firstToken.values[0]); + stops.push({ stop: HUNDRED_PERCENT, color: color2 }); + } else if (firstToken.name === "color-stop") { + var values = firstToken.values.filter(nonFunctionArgSeparator); + if (values.length === 2) { + var color2 = color$1.parse(context, values[1]); + var stop_1 = values[0]; + if (isNumberToken(stop_1)) { + stops.push({ + stop: { type: 16, number: stop_1.number * 100, flags: stop_1.flags }, + color: color2 + }); + } + } + } + } + }); + return type === 1 ? { + angle: (angle2 + deg(180)) % deg(360), + stops, + type + } : { size, shape, stops, position: position2, type }; + }; + var CLOSEST_SIDE = "closest-side"; + var FARTHEST_SIDE = "farthest-side"; + var CLOSEST_CORNER = "closest-corner"; + var FARTHEST_CORNER = "farthest-corner"; + var CIRCLE = "circle"; + var ELLIPSE = "ellipse"; + var COVER = "cover"; + var CONTAIN = "contain"; + var radialGradient = function(context, tokens) { + var shape = 0; + var size = 3; + var stops = []; + var position2 = []; + parseFunctionArgs(tokens).forEach(function(arg, i2) { + var isColorStop = true; + if (i2 === 0) { + var isAtPosition_1 = false; + isColorStop = arg.reduce(function(acc, token) { + if (isAtPosition_1) { + if (isIdentToken(token)) { + switch (token.value) { + case "center": + position2.push(FIFTY_PERCENT); + return acc; + case "top": + case "left": + position2.push(ZERO_LENGTH); + return acc; + case "right": + case "bottom": + position2.push(HUNDRED_PERCENT); + return acc; + } + } else if (isLengthPercentage(token) || isLength(token)) { + position2.push(token); + } + } else if (isIdentToken(token)) { + switch (token.value) { + case CIRCLE: + shape = 0; + return false; + case ELLIPSE: + shape = 1; + return false; + case "at": + isAtPosition_1 = true; + return false; + case CLOSEST_SIDE: + size = 0; + return false; + case COVER: + case FARTHEST_SIDE: + size = 1; + return false; + case CONTAIN: + case CLOSEST_CORNER: + size = 2; + return false; + case FARTHEST_CORNER: + size = 3; + return false; + } + } else if (isLength(token) || isLengthPercentage(token)) { + if (!Array.isArray(size)) { + size = []; + } + size.push(token); + return false; + } + return acc; + }, isColorStop); + } + if (isColorStop) { + var colorStop = parseColorStop(context, arg); + stops.push(colorStop); + } + }); + return { + size, + shape, + stops, + position: position2, + type: 2 + /* RADIAL_GRADIENT */ + }; + }; + var prefixRadialGradient = function(context, tokens) { + var shape = 0; + var size = 3; + var stops = []; + var position2 = []; + parseFunctionArgs(tokens).forEach(function(arg, i2) { + var isColorStop = true; + if (i2 === 0) { + isColorStop = arg.reduce(function(acc, token) { + if (isIdentToken(token)) { + switch (token.value) { + case "center": + position2.push(FIFTY_PERCENT); + return false; + case "top": + case "left": + position2.push(ZERO_LENGTH); + return false; + case "right": + case "bottom": + position2.push(HUNDRED_PERCENT); + return false; + } + } else if (isLengthPercentage(token) || isLength(token)) { + position2.push(token); + return false; + } + return acc; + }, isColorStop); + } else if (i2 === 1) { + isColorStop = arg.reduce(function(acc, token) { + if (isIdentToken(token)) { + switch (token.value) { + case CIRCLE: + shape = 0; + return false; + case ELLIPSE: + shape = 1; + return false; + case CONTAIN: + case CLOSEST_SIDE: + size = 0; + return false; + case FARTHEST_SIDE: + size = 1; + return false; + case CLOSEST_CORNER: + size = 2; + return false; + case COVER: + case FARTHEST_CORNER: + size = 3; + return false; + } + } else if (isLength(token) || isLengthPercentage(token)) { + if (!Array.isArray(size)) { + size = []; + } + size.push(token); + return false; + } + return acc; + }, isColorStop); + } + if (isColorStop) { + var colorStop = parseColorStop(context, arg); + stops.push(colorStop); + } + }); + return { + size, + shape, + stops, + position: position2, + type: 2 + /* RADIAL_GRADIENT */ + }; + }; + var isLinearGradient = function(background2) { + return background2.type === 1; + }; + var isRadialGradient = function(background2) { + return background2.type === 2; + }; + var image = { + name: "image", + parse: function(context, value) { + if (value.type === 22) { + var image_1 = { + url: value.value, + type: 0 + /* URL */ + }; + context.cache.addImage(value.value); + return image_1; + } + if (value.type === 18) { + var imageFunction = SUPPORTED_IMAGE_FUNCTIONS[value.name]; + if (typeof imageFunction === "undefined") { + throw new Error('Attempting to parse an unsupported image function "' + value.name + '"'); + } + return imageFunction(context, value.values); + } + throw new Error("Unsupported image type " + value.type); + } + }; + function isSupportedImage(value) { + return !(value.type === 20 && value.value === "none") && (value.type !== 18 || !!SUPPORTED_IMAGE_FUNCTIONS[value.name]); + } + var SUPPORTED_IMAGE_FUNCTIONS = { + "linear-gradient": linearGradient, + "-moz-linear-gradient": prefixLinearGradient, + "-ms-linear-gradient": prefixLinearGradient, + "-o-linear-gradient": prefixLinearGradient, + "-webkit-linear-gradient": prefixLinearGradient, + "radial-gradient": radialGradient, + "-moz-radial-gradient": prefixRadialGradient, + "-ms-radial-gradient": prefixRadialGradient, + "-o-radial-gradient": prefixRadialGradient, + "-webkit-radial-gradient": prefixRadialGradient, + "-webkit-gradient": webkitGradient + }; + var backgroundImage = { + name: "background-image", + initialValue: "none", + type: 1, + prefix: false, + parse: function(context, tokens) { + if (tokens.length === 0) { + return []; + } + var first = tokens[0]; + if (first.type === 20 && first.value === "none") { + return []; + } + return tokens.filter(function(value) { + return nonFunctionArgSeparator(value) && isSupportedImage(value); + }).map(function(value) { + return image.parse(context, value); + }); + } + }; + var backgroundOrigin = { + name: "background-origin", + initialValue: "border-box", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return tokens.map(function(token) { + if (isIdentToken(token)) { + switch (token.value) { + case "padding-box": + return 1; + case "content-box": + return 2; + } + } + return 0; + }); + } + }; + var backgroundPosition = { + name: "background-position", + initialValue: "0% 0%", + type: 1, + prefix: false, + parse: function(_context, tokens) { + return parseFunctionArgs(tokens).map(function(values) { + return values.filter(isLengthPercentage); + }).map(parseLengthPercentageTuple); + } + }; + var backgroundRepeat = { + name: "background-repeat", + initialValue: "repeat", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return parseFunctionArgs(tokens).map(function(values) { + return values.filter(isIdentToken).map(function(token) { + return token.value; + }).join(" "); + }).map(parseBackgroundRepeat); + } + }; + var parseBackgroundRepeat = function(value) { + switch (value) { + case "no-repeat": + return 1; + case "repeat-x": + case "repeat no-repeat": + return 2; + case "repeat-y": + case "no-repeat repeat": + return 3; + case "repeat": + default: + return 0; + } + }; + var BACKGROUND_SIZE; + (function(BACKGROUND_SIZE2) { + BACKGROUND_SIZE2["AUTO"] = "auto"; + BACKGROUND_SIZE2["CONTAIN"] = "contain"; + BACKGROUND_SIZE2["COVER"] = "cover"; + })(BACKGROUND_SIZE || (BACKGROUND_SIZE = {})); + var backgroundSize = { + name: "background-size", + initialValue: "0", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return parseFunctionArgs(tokens).map(function(values) { + return values.filter(isBackgroundSizeInfoToken); + }); + } + }; + var isBackgroundSizeInfoToken = function(value) { + return isIdentToken(value) || isLengthPercentage(value); + }; + var borderColorForSide = function(side) { + return { + name: "border-" + side + "-color", + initialValue: "transparent", + prefix: false, + type: 3, + format: "color" + }; + }; + var borderTopColor = borderColorForSide("top"); + var borderRightColor = borderColorForSide("right"); + var borderBottomColor = borderColorForSide("bottom"); + var borderLeftColor = borderColorForSide("left"); + var borderRadiusForSide = function(side) { + return { + name: "border-radius-" + side, + initialValue: "0 0", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return parseLengthPercentageTuple(tokens.filter(isLengthPercentage)); + } + }; + }; + var borderTopLeftRadius = borderRadiusForSide("top-left"); + var borderTopRightRadius = borderRadiusForSide("top-right"); + var borderBottomRightRadius = borderRadiusForSide("bottom-right"); + var borderBottomLeftRadius = borderRadiusForSide("bottom-left"); + var borderStyleForSide = function(side) { + return { + name: "border-" + side + "-style", + initialValue: "solid", + prefix: false, + type: 2, + parse: function(_context, style) { + switch (style) { + case "none": + return 0; + case "dashed": + return 2; + case "dotted": + return 3; + case "double": + return 4; + } + return 1; + } + }; + }; + var borderTopStyle = borderStyleForSide("top"); + var borderRightStyle = borderStyleForSide("right"); + var borderBottomStyle = borderStyleForSide("bottom"); + var borderLeftStyle = borderStyleForSide("left"); + var borderWidthForSide = function(side) { + return { + name: "border-" + side + "-width", + initialValue: "0", + type: 0, + prefix: false, + parse: function(_context, token) { + if (isDimensionToken(token)) { + return token.number; + } + return 0; + } + }; + }; + var borderTopWidth = borderWidthForSide("top"); + var borderRightWidth = borderWidthForSide("right"); + var borderBottomWidth = borderWidthForSide("bottom"); + var borderLeftWidth = borderWidthForSide("left"); + var color = { + name: "color", + initialValue: "transparent", + prefix: false, + type: 3, + format: "color" + }; + var direction = { + name: "direction", + initialValue: "ltr", + prefix: false, + type: 2, + parse: function(_context, direction2) { + switch (direction2) { + case "rtl": + return 1; + case "ltr": + default: + return 0; + } + } + }; + var display2 = { + name: "display", + initialValue: "inline-block", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return tokens.filter(isIdentToken).reduce( + function(bit, token) { + return bit | parseDisplayValue(token.value); + }, + 0 + /* NONE */ + ); + } + }; + var parseDisplayValue = function(display3) { + switch (display3) { + case "block": + case "-webkit-box": + return 2; + case "inline": + return 4; + case "run-in": + return 8; + case "flow": + return 16; + case "flow-root": + return 32; + case "table": + return 64; + case "flex": + case "-webkit-flex": + return 128; + case "grid": + case "-ms-grid": + return 256; + case "ruby": + return 512; + case "subgrid": + return 1024; + case "list-item": + return 2048; + case "table-row-group": + return 4096; + case "table-header-group": + return 8192; + case "table-footer-group": + return 16384; + case "table-row": + return 32768; + case "table-cell": + return 65536; + case "table-column-group": + return 131072; + case "table-column": + return 262144; + case "table-caption": + return 524288; + case "ruby-base": + return 1048576; + case "ruby-text": + return 2097152; + case "ruby-base-container": + return 4194304; + case "ruby-text-container": + return 8388608; + case "contents": + return 16777216; + case "inline-block": + return 33554432; + case "inline-list-item": + return 67108864; + case "inline-table": + return 134217728; + case "inline-flex": + return 268435456; + case "inline-grid": + return 536870912; + } + return 0; + }; + var float = { + name: "float", + initialValue: "none", + prefix: false, + type: 2, + parse: function(_context, float2) { + switch (float2) { + case "left": + return 1; + case "right": + return 2; + case "inline-start": + return 3; + case "inline-end": + return 4; + } + return 0; + } + }; + var letterSpacing = { + name: "letter-spacing", + initialValue: "0", + prefix: false, + type: 0, + parse: function(_context, token) { + if (token.type === 20 && token.value === "normal") { + return 0; + } + if (token.type === 17) { + return token.number; + } + if (token.type === 15) { + return token.number; + } + return 0; + } + }; + var LINE_BREAK; + (function(LINE_BREAK2) { + LINE_BREAK2["NORMAL"] = "normal"; + LINE_BREAK2["STRICT"] = "strict"; + })(LINE_BREAK || (LINE_BREAK = {})); + var lineBreak = { + name: "line-break", + initialValue: "normal", + prefix: false, + type: 2, + parse: function(_context, lineBreak2) { + switch (lineBreak2) { + case "strict": + return LINE_BREAK.STRICT; + case "normal": + default: + return LINE_BREAK.NORMAL; + } + } + }; + var lineHeight = { + name: "line-height", + initialValue: "normal", + prefix: false, + type: 4 + /* TOKEN_VALUE */ + }; + var computeLineHeight = function(token, fontSize2) { + if (isIdentToken(token) && token.value === "normal") { + return 1.2 * fontSize2; + } else if (token.type === 17) { + return fontSize2 * token.number; + } else if (isLengthPercentage(token)) { + return getAbsoluteValue(token, fontSize2); + } + return fontSize2; + }; + var listStyleImage = { + name: "list-style-image", + initialValue: "none", + type: 0, + prefix: false, + parse: function(context, token) { + if (token.type === 20 && token.value === "none") { + return null; + } + return image.parse(context, token); + } + }; + var listStylePosition = { + name: "list-style-position", + initialValue: "outside", + prefix: false, + type: 2, + parse: function(_context, position2) { + switch (position2) { + case "inside": + return 0; + case "outside": + default: + return 1; + } + } + }; + var listStyleType = { + name: "list-style-type", + initialValue: "none", + prefix: false, + type: 2, + parse: function(_context, type) { + switch (type) { + case "disc": + return 0; + case "circle": + return 1; + case "square": + return 2; + case "decimal": + return 3; + case "cjk-decimal": + return 4; + case "decimal-leading-zero": + return 5; + case "lower-roman": + return 6; + case "upper-roman": + return 7; + case "lower-greek": + return 8; + case "lower-alpha": + return 9; + case "upper-alpha": + return 10; + case "arabic-indic": + return 11; + case "armenian": + return 12; + case "bengali": + return 13; + case "cambodian": + return 14; + case "cjk-earthly-branch": + return 15; + case "cjk-heavenly-stem": + return 16; + case "cjk-ideographic": + return 17; + case "devanagari": + return 18; + case "ethiopic-numeric": + return 19; + case "georgian": + return 20; + case "gujarati": + return 21; + case "gurmukhi": + return 22; + case "hebrew": + return 22; + case "hiragana": + return 23; + case "hiragana-iroha": + return 24; + case "japanese-formal": + return 25; + case "japanese-informal": + return 26; + case "kannada": + return 27; + case "katakana": + return 28; + case "katakana-iroha": + return 29; + case "khmer": + return 30; + case "korean-hangul-formal": + return 31; + case "korean-hanja-formal": + return 32; + case "korean-hanja-informal": + return 33; + case "lao": + return 34; + case "lower-armenian": + return 35; + case "malayalam": + return 36; + case "mongolian": + return 37; + case "myanmar": + return 38; + case "oriya": + return 39; + case "persian": + return 40; + case "simp-chinese-formal": + return 41; + case "simp-chinese-informal": + return 42; + case "tamil": + return 43; + case "telugu": + return 44; + case "thai": + return 45; + case "tibetan": + return 46; + case "trad-chinese-formal": + return 47; + case "trad-chinese-informal": + return 48; + case "upper-armenian": + return 49; + case "disclosure-open": + return 50; + case "disclosure-closed": + return 51; + case "none": + default: + return -1; + } + } + }; + var marginForSide = function(side) { + return { + name: "margin-" + side, + initialValue: "0", + prefix: false, + type: 4 + /* TOKEN_VALUE */ + }; + }; + var marginTop = marginForSide("top"); + var marginRight = marginForSide("right"); + var marginBottom = marginForSide("bottom"); + var marginLeft = marginForSide("left"); + var overflow = { + name: "overflow", + initialValue: "visible", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return tokens.filter(isIdentToken).map(function(overflow2) { + switch (overflow2.value) { + case "hidden": + return 1; + case "scroll": + return 2; + case "clip": + return 3; + case "auto": + return 4; + case "visible": + default: + return 0; + } + }); + } + }; + var overflowWrap = { + name: "overflow-wrap", + initialValue: "normal", + prefix: false, + type: 2, + parse: function(_context, overflow2) { + switch (overflow2) { + case "break-word": + return "break-word"; + case "normal": + default: + return "normal"; + } + } + }; + var paddingForSide = function(side) { + return { + name: "padding-" + side, + initialValue: "0", + prefix: false, + type: 3, + format: "length-percentage" + }; + }; + var paddingTop = paddingForSide("top"); + var paddingRight = paddingForSide("right"); + var paddingBottom = paddingForSide("bottom"); + var paddingLeft = paddingForSide("left"); + var textAlign = { + name: "text-align", + initialValue: "left", + prefix: false, + type: 2, + parse: function(_context, textAlign2) { + switch (textAlign2) { + case "right": + return 2; + case "center": + case "justify": + return 1; + case "left": + default: + return 0; + } + } + }; + var position = { + name: "position", + initialValue: "static", + prefix: false, + type: 2, + parse: function(_context, position2) { + switch (position2) { + case "relative": + return 1; + case "absolute": + return 2; + case "fixed": + return 3; + case "sticky": + return 4; + } + return 0; + } + }; + var textShadow = { + name: "text-shadow", + initialValue: "none", + type: 1, + prefix: false, + parse: function(context, tokens) { + if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) { + return []; + } + return parseFunctionArgs(tokens).map(function(values) { + var shadow = { + color: COLORS.TRANSPARENT, + offsetX: ZERO_LENGTH, + offsetY: ZERO_LENGTH, + blur: ZERO_LENGTH + }; + var c = 0; + for (var i2 = 0; i2 < values.length; i2++) { + var token = values[i2]; + if (isLength(token)) { + if (c === 0) { + shadow.offsetX = token; + } else if (c === 1) { + shadow.offsetY = token; + } else { + shadow.blur = token; + } + c++; + } else { + shadow.color = color$1.parse(context, token); + } + } + return shadow; + }); + } + }; + var textTransform = { + name: "text-transform", + initialValue: "none", + prefix: false, + type: 2, + parse: function(_context, textTransform2) { + switch (textTransform2) { + case "uppercase": + return 2; + case "lowercase": + return 1; + case "capitalize": + return 3; + } + return 0; + } + }; + var transform$1 = { + name: "transform", + initialValue: "none", + prefix: true, + type: 0, + parse: function(_context, token) { + if (token.type === 20 && token.value === "none") { + return null; + } + if (token.type === 18) { + var transformFunction = SUPPORTED_TRANSFORM_FUNCTIONS[token.name]; + if (typeof transformFunction === "undefined") { + throw new Error('Attempting to parse an unsupported transform function "' + token.name + '"'); + } + return transformFunction(token.values); + } + return null; + } + }; + var matrix = function(args) { + var values = args.filter(function(arg) { + return arg.type === 17; + }).map(function(arg) { + return arg.number; + }); + return values.length === 6 ? values : null; + }; + var matrix3d = function(args) { + var values = args.filter(function(arg) { + return arg.type === 17; + }).map(function(arg) { + return arg.number; + }); + var a1 = values[0], b1 = values[1]; + values[2]; + values[3]; + var a2 = values[4], b2 = values[5]; + values[6]; + values[7]; + values[8]; + values[9]; + values[10]; + values[11]; + var a4 = values[12], b4 = values[13]; + values[14]; + values[15]; + return values.length === 16 ? [a1, b1, a2, b2, a4, b4] : null; + }; + var SUPPORTED_TRANSFORM_FUNCTIONS = { + matrix, + matrix3d + }; + var DEFAULT_VALUE = { + type: 16, + number: 50, + flags: FLAG_INTEGER + }; + var DEFAULT = [DEFAULT_VALUE, DEFAULT_VALUE]; + var transformOrigin = { + name: "transform-origin", + initialValue: "50% 50%", + prefix: true, + type: 1, + parse: function(_context, tokens) { + var origins = tokens.filter(isLengthPercentage); + if (origins.length !== 2) { + return DEFAULT; + } + return [origins[0], origins[1]]; + } + }; + var visibility = { + name: "visible", + initialValue: "none", + prefix: false, + type: 2, + parse: function(_context, visibility2) { + switch (visibility2) { + case "hidden": + return 1; + case "collapse": + return 2; + case "visible": + default: + return 0; + } + } + }; + var WORD_BREAK; + (function(WORD_BREAK2) { + WORD_BREAK2["NORMAL"] = "normal"; + WORD_BREAK2["BREAK_ALL"] = "break-all"; + WORD_BREAK2["KEEP_ALL"] = "keep-all"; + })(WORD_BREAK || (WORD_BREAK = {})); + var wordBreak = { + name: "word-break", + initialValue: "normal", + prefix: false, + type: 2, + parse: function(_context, wordBreak2) { + switch (wordBreak2) { + case "break-all": + return WORD_BREAK.BREAK_ALL; + case "keep-all": + return WORD_BREAK.KEEP_ALL; + case "normal": + default: + return WORD_BREAK.NORMAL; + } + } + }; + var zIndex = { + name: "z-index", + initialValue: "auto", + prefix: false, + type: 0, + parse: function(_context, token) { + if (token.type === 20) { + return { auto: true, order: 0 }; + } + if (isNumberToken(token)) { + return { auto: false, order: token.number }; + } + throw new Error("Invalid z-index number parsed"); + } + }; + var time = { + name: "time", + parse: function(_context, value) { + if (value.type === 15) { + switch (value.unit.toLowerCase()) { + case "s": + return 1e3 * value.number; + case "ms": + return value.number; + } + } + throw new Error("Unsupported time type"); + } + }; + var opacity = { + name: "opacity", + initialValue: "1", + type: 0, + prefix: false, + parse: function(_context, token) { + if (isNumberToken(token)) { + return token.number; + } + return 1; + } + }; + var textDecorationColor = { + name: "text-decoration-color", + initialValue: "transparent", + prefix: false, + type: 3, + format: "color" + }; + var textDecorationLine = { + name: "text-decoration-line", + initialValue: "none", + prefix: false, + type: 1, + parse: function(_context, tokens) { + return tokens.filter(isIdentToken).map(function(token) { + switch (token.value) { + case "underline": + return 1; + case "overline": + return 2; + case "line-through": + return 3; + case "none": + return 4; + } + return 0; + }).filter(function(line) { + return line !== 0; + }); + } + }; + var fontFamily2 = { + name: "font-family", + initialValue: "", + prefix: false, + type: 1, + parse: function(_context, tokens) { + var accumulator = []; + var results = []; + tokens.forEach(function(token) { + switch (token.type) { + case 20: + case 0: + accumulator.push(token.value); + break; + case 17: + accumulator.push(token.number.toString()); + break; + case 4: + results.push(accumulator.join(" ")); + accumulator.length = 0; + break; + } + }); + if (accumulator.length) { + results.push(accumulator.join(" ")); + } + return results.map(function(result) { + return result.indexOf(" ") === -1 ? result : "'" + result + "'"; + }); + } + }; + var fontSize = { + name: "font-size", + initialValue: "0", + prefix: false, + type: 3, + format: "length" + }; + var fontWeight2 = { + name: "font-weight", + initialValue: "normal", + type: 0, + prefix: false, + parse: function(_context, token) { + if (isNumberToken(token)) { + return token.number; + } + if (isIdentToken(token)) { + switch (token.value) { + case "bold": + return 700; + case "normal": + default: + return 400; + } + } + return 400; + } + }; + var fontVariant = { + name: "font-variant", + initialValue: "none", + type: 1, + prefix: false, + parse: function(_context, tokens) { + return tokens.filter(isIdentToken).map(function(token) { + return token.value; + }); + } + }; + var fontStyle = { + name: "font-style", + initialValue: "normal", + prefix: false, + type: 2, + parse: function(_context, overflow2) { + switch (overflow2) { + case "oblique": + return "oblique"; + case "italic": + return "italic"; + case "normal": + default: + return "normal"; + } + } + }; + var contains = function(bit, value) { + return (bit & value) !== 0; + }; + var content = { + name: "content", + initialValue: "none", + type: 1, + prefix: false, + parse: function(_context, tokens) { + if (tokens.length === 0) { + return []; + } + var first = tokens[0]; + if (first.type === 20 && first.value === "none") { + return []; + } + return tokens; + } + }; + var counterIncrement = { + name: "counter-increment", + initialValue: "none", + prefix: true, + type: 1, + parse: function(_context, tokens) { + if (tokens.length === 0) { + return null; + } + var first = tokens[0]; + if (first.type === 20 && first.value === "none") { + return null; + } + var increments = []; + var filtered = tokens.filter(nonWhiteSpace); + for (var i2 = 0; i2 < filtered.length; i2++) { + var counter = filtered[i2]; + var next = filtered[i2 + 1]; + if (counter.type === 20) { + var increment = next && isNumberToken(next) ? next.number : 1; + increments.push({ counter: counter.value, increment }); + } + } + return increments; + } + }; + var counterReset = { + name: "counter-reset", + initialValue: "none", + prefix: true, + type: 1, + parse: function(_context, tokens) { + if (tokens.length === 0) { + return []; + } + var resets = []; + var filtered = tokens.filter(nonWhiteSpace); + for (var i2 = 0; i2 < filtered.length; i2++) { + var counter = filtered[i2]; + var next = filtered[i2 + 1]; + if (isIdentToken(counter) && counter.value !== "none") { + var reset = next && isNumberToken(next) ? next.number : 0; + resets.push({ counter: counter.value, reset }); + } + } + return resets; + } + }; + var duration = { + name: "duration", + initialValue: "0s", + prefix: false, + type: 1, + parse: function(context, tokens) { + return tokens.filter(isDimensionToken).map(function(token) { + return time.parse(context, token); + }); + } + }; + var quotes = { + name: "quotes", + initialValue: "none", + prefix: true, + type: 1, + parse: function(_context, tokens) { + if (tokens.length === 0) { + return null; + } + var first = tokens[0]; + if (first.type === 20 && first.value === "none") { + return null; + } + var quotes2 = []; + var filtered = tokens.filter(isStringToken); + if (filtered.length % 2 !== 0) { + return null; + } + for (var i2 = 0; i2 < filtered.length; i2 += 2) { + var open_1 = filtered[i2].value; + var close_1 = filtered[i2 + 1].value; + quotes2.push({ open: open_1, close: close_1 }); + } + return quotes2; + } + }; + var getQuote = function(quotes2, depth, open) { + if (!quotes2) { + return ""; + } + var quote = quotes2[Math.min(depth, quotes2.length - 1)]; + if (!quote) { + return ""; + } + return open ? quote.open : quote.close; + }; + var boxShadow = { + name: "box-shadow", + initialValue: "none", + type: 1, + prefix: false, + parse: function(context, tokens) { + if (tokens.length === 1 && isIdentWithValue(tokens[0], "none")) { + return []; + } + return parseFunctionArgs(tokens).map(function(values) { + var shadow = { + color: 255, + offsetX: ZERO_LENGTH, + offsetY: ZERO_LENGTH, + blur: ZERO_LENGTH, + spread: ZERO_LENGTH, + inset: false + }; + var c = 0; + for (var i2 = 0; i2 < values.length; i2++) { + var token = values[i2]; + if (isIdentWithValue(token, "inset")) { + shadow.inset = true; + } else if (isLength(token)) { + if (c === 0) { + shadow.offsetX = token; + } else if (c === 1) { + shadow.offsetY = token; + } else if (c === 2) { + shadow.blur = token; + } else { + shadow.spread = token; + } + c++; + } else { + shadow.color = color$1.parse(context, token); + } + } + return shadow; + }); + } + }; + var paintOrder = { + name: "paint-order", + initialValue: "normal", + prefix: false, + type: 1, + parse: function(_context, tokens) { + var DEFAULT_VALUE2 = [ + 0, + 1, + 2 + /* MARKERS */ + ]; + var layers = []; + tokens.filter(isIdentToken).forEach(function(token) { + switch (token.value) { + case "stroke": + layers.push( + 1 + /* STROKE */ + ); + break; + case "fill": + layers.push( + 0 + /* FILL */ + ); + break; + case "markers": + layers.push( + 2 + /* MARKERS */ + ); + break; + } + }); + DEFAULT_VALUE2.forEach(function(value) { + if (layers.indexOf(value) === -1) { + layers.push(value); + } + }); + return layers; + } + }; + var webkitTextStrokeColor = { + name: "-webkit-text-stroke-color", + initialValue: "currentcolor", + prefix: false, + type: 3, + format: "color" + }; + var webkitTextStrokeWidth = { + name: "-webkit-text-stroke-width", + initialValue: "0", + type: 0, + prefix: false, + parse: function(_context, token) { + if (isDimensionToken(token)) { + return token.number; + } + return 0; + } + }; + var CSSParsedDeclaration = ( + /** @class */ + (function() { + function CSSParsedDeclaration2(context, declaration) { + var _a, _b; + this.animationDuration = parse(context, duration, declaration.animationDuration); + this.backgroundClip = parse(context, backgroundClip, declaration.backgroundClip); + this.backgroundColor = parse(context, backgroundColor, declaration.backgroundColor); + this.backgroundImage = parse(context, backgroundImage, declaration.backgroundImage); + this.backgroundOrigin = parse(context, backgroundOrigin, declaration.backgroundOrigin); + this.backgroundPosition = parse(context, backgroundPosition, declaration.backgroundPosition); + this.backgroundRepeat = parse(context, backgroundRepeat, declaration.backgroundRepeat); + this.backgroundSize = parse(context, backgroundSize, declaration.backgroundSize); + this.borderTopColor = parse(context, borderTopColor, declaration.borderTopColor); + this.borderRightColor = parse(context, borderRightColor, declaration.borderRightColor); + this.borderBottomColor = parse(context, borderBottomColor, declaration.borderBottomColor); + this.borderLeftColor = parse(context, borderLeftColor, declaration.borderLeftColor); + this.borderTopLeftRadius = parse(context, borderTopLeftRadius, declaration.borderTopLeftRadius); + this.borderTopRightRadius = parse(context, borderTopRightRadius, declaration.borderTopRightRadius); + this.borderBottomRightRadius = parse(context, borderBottomRightRadius, declaration.borderBottomRightRadius); + this.borderBottomLeftRadius = parse(context, borderBottomLeftRadius, declaration.borderBottomLeftRadius); + this.borderTopStyle = parse(context, borderTopStyle, declaration.borderTopStyle); + this.borderRightStyle = parse(context, borderRightStyle, declaration.borderRightStyle); + this.borderBottomStyle = parse(context, borderBottomStyle, declaration.borderBottomStyle); + this.borderLeftStyle = parse(context, borderLeftStyle, declaration.borderLeftStyle); + this.borderTopWidth = parse(context, borderTopWidth, declaration.borderTopWidth); + this.borderRightWidth = parse(context, borderRightWidth, declaration.borderRightWidth); + this.borderBottomWidth = parse(context, borderBottomWidth, declaration.borderBottomWidth); + this.borderLeftWidth = parse(context, borderLeftWidth, declaration.borderLeftWidth); + this.boxShadow = parse(context, boxShadow, declaration.boxShadow); + this.color = parse(context, color, declaration.color); + this.direction = parse(context, direction, declaration.direction); + this.display = parse(context, display2, declaration.display); + this.float = parse(context, float, declaration.cssFloat); + this.fontFamily = parse(context, fontFamily2, declaration.fontFamily); + this.fontSize = parse(context, fontSize, declaration.fontSize); + this.fontStyle = parse(context, fontStyle, declaration.fontStyle); + this.fontVariant = parse(context, fontVariant, declaration.fontVariant); + this.fontWeight = parse(context, fontWeight2, declaration.fontWeight); + this.letterSpacing = parse(context, letterSpacing, declaration.letterSpacing); + this.lineBreak = parse(context, lineBreak, declaration.lineBreak); + this.lineHeight = parse(context, lineHeight, declaration.lineHeight); + this.listStyleImage = parse(context, listStyleImage, declaration.listStyleImage); + this.listStylePosition = parse(context, listStylePosition, declaration.listStylePosition); + this.listStyleType = parse(context, listStyleType, declaration.listStyleType); + this.marginTop = parse(context, marginTop, declaration.marginTop); + this.marginRight = parse(context, marginRight, declaration.marginRight); + this.marginBottom = parse(context, marginBottom, declaration.marginBottom); + this.marginLeft = parse(context, marginLeft, declaration.marginLeft); + this.opacity = parse(context, opacity, declaration.opacity); + var overflowTuple = parse(context, overflow, declaration.overflow); + this.overflowX = overflowTuple[0]; + this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0]; + this.overflowWrap = parse(context, overflowWrap, declaration.overflowWrap); + this.paddingTop = parse(context, paddingTop, declaration.paddingTop); + this.paddingRight = parse(context, paddingRight, declaration.paddingRight); + this.paddingBottom = parse(context, paddingBottom, declaration.paddingBottom); + this.paddingLeft = parse(context, paddingLeft, declaration.paddingLeft); + this.paintOrder = parse(context, paintOrder, declaration.paintOrder); + this.position = parse(context, position, declaration.position); + this.textAlign = parse(context, textAlign, declaration.textAlign); + this.textDecorationColor = parse(context, textDecorationColor, (_a = declaration.textDecorationColor) !== null && _a !== void 0 ? _a : declaration.color); + this.textDecorationLine = parse(context, textDecorationLine, (_b = declaration.textDecorationLine) !== null && _b !== void 0 ? _b : declaration.textDecoration); + this.textShadow = parse(context, textShadow, declaration.textShadow); + this.textTransform = parse(context, textTransform, declaration.textTransform); + this.transform = parse(context, transform$1, declaration.transform); + this.transformOrigin = parse(context, transformOrigin, declaration.transformOrigin); + this.visibility = parse(context, visibility, declaration.visibility); + this.webkitTextStrokeColor = parse(context, webkitTextStrokeColor, declaration.webkitTextStrokeColor); + this.webkitTextStrokeWidth = parse(context, webkitTextStrokeWidth, declaration.webkitTextStrokeWidth); + this.wordBreak = parse(context, wordBreak, declaration.wordBreak); + this.zIndex = parse(context, zIndex, declaration.zIndex); + } + CSSParsedDeclaration2.prototype.isVisible = function() { + return this.display > 0 && this.opacity > 0 && this.visibility === 0; + }; + CSSParsedDeclaration2.prototype.isTransparent = function() { + return isTransparent(this.backgroundColor); + }; + CSSParsedDeclaration2.prototype.isTransformed = function() { + return this.transform !== null; + }; + CSSParsedDeclaration2.prototype.isPositioned = function() { + return this.position !== 0; + }; + CSSParsedDeclaration2.prototype.isPositionedWithZIndex = function() { + return this.isPositioned() && !this.zIndex.auto; + }; + CSSParsedDeclaration2.prototype.isFloating = function() { + return this.float !== 0; + }; + CSSParsedDeclaration2.prototype.isInlineLevel = function() { + return contains( + this.display, + 4 + /* INLINE */ + ) || contains( + this.display, + 33554432 + /* INLINE_BLOCK */ + ) || contains( + this.display, + 268435456 + /* INLINE_FLEX */ + ) || contains( + this.display, + 536870912 + /* INLINE_GRID */ + ) || contains( + this.display, + 67108864 + /* INLINE_LIST_ITEM */ + ) || contains( + this.display, + 134217728 + /* INLINE_TABLE */ + ); + }; + return CSSParsedDeclaration2; + })() + ); + var CSSParsedPseudoDeclaration = ( + /** @class */ + /* @__PURE__ */ (function() { + function CSSParsedPseudoDeclaration2(context, declaration) { + this.content = parse(context, content, declaration.content); + this.quotes = parse(context, quotes, declaration.quotes); + } + return CSSParsedPseudoDeclaration2; + })() + ); + var CSSParsedCounterDeclaration = ( + /** @class */ + /* @__PURE__ */ (function() { + function CSSParsedCounterDeclaration2(context, declaration) { + this.counterIncrement = parse(context, counterIncrement, declaration.counterIncrement); + this.counterReset = parse(context, counterReset, declaration.counterReset); + } + return CSSParsedCounterDeclaration2; + })() + ); + var parse = function(context, descriptor, style) { + var tokenizer = new Tokenizer(); + var value = style !== null && typeof style !== "undefined" ? style.toString() : descriptor.initialValue; + tokenizer.write(value); + var parser = new Parser(tokenizer.read()); + switch (descriptor.type) { + case 2: + var token = parser.parseComponentValue(); + return descriptor.parse(context, isIdentToken(token) ? token.value : descriptor.initialValue); + case 0: + return descriptor.parse(context, parser.parseComponentValue()); + case 1: + return descriptor.parse(context, parser.parseComponentValues()); + case 4: + return parser.parseComponentValue(); + case 3: + switch (descriptor.format) { + case "angle": + return angle.parse(context, parser.parseComponentValue()); + case "color": + return color$1.parse(context, parser.parseComponentValue()); + case "image": + return image.parse(context, parser.parseComponentValue()); + case "length": + var length_1 = parser.parseComponentValue(); + return isLength(length_1) ? length_1 : ZERO_LENGTH; + case "length-percentage": + var value_1 = parser.parseComponentValue(); + return isLengthPercentage(value_1) ? value_1 : ZERO_LENGTH; + case "time": + return time.parse(context, parser.parseComponentValue()); + } + break; + } + }; + var elementDebuggerAttribute = "data-html2canvas-debug"; + var getElementDebugType = function(element) { + var attribute = element.getAttribute(elementDebuggerAttribute); + switch (attribute) { + case "all": + return 1; + case "clone": + return 2; + case "parse": + return 3; + case "render": + return 4; + default: + return 0; + } + }; + var isDebugging = function(element, type) { + var elementType = getElementDebugType(element); + return elementType === 1 || type === elementType; + }; + var ElementContainer = ( + /** @class */ + /* @__PURE__ */ (function() { + function ElementContainer2(context, element) { + this.context = context; + this.textNodes = []; + this.elements = []; + this.flags = 0; + if (isDebugging( + element, + 3 + /* PARSE */ + )) { + debugger; + } + this.styles = new CSSParsedDeclaration(context, window.getComputedStyle(element, null)); + if (isHTMLElementNode(element)) { + if (this.styles.animationDuration.some(function(duration2) { + return duration2 > 0; + })) { + element.style.animationDuration = "0s"; + } + if (this.styles.transform !== null) { + element.style.transform = "none"; + } + } + this.bounds = parseBounds(this.context, element); + if (isDebugging( + element, + 4 + /* RENDER */ + )) { + this.flags |= 16; + } + } + return ElementContainer2; + })() + ); + var base64 = "AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="; + var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var lookup$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); + for (var i$1 = 0; i$1 < chars$1.length; i$1++) { + lookup$1[chars$1.charCodeAt(i$1)] = i$1; + } + var decode = function(base642) { + var bufferLength = base642.length * 0.75, len = base642.length, i2, p = 0, encoded1, encoded2, encoded3, encoded4; + if (base642[base642.length - 1] === "=") { + bufferLength--; + if (base642[base642.length - 2] === "=") { + bufferLength--; + } + } + var buffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && typeof Uint8Array.prototype.slice !== "undefined" ? new ArrayBuffer(bufferLength) : new Array(bufferLength); + var bytes = Array.isArray(buffer) ? buffer : new Uint8Array(buffer); + for (i2 = 0; i2 < len; i2 += 4) { + encoded1 = lookup$1[base642.charCodeAt(i2)]; + encoded2 = lookup$1[base642.charCodeAt(i2 + 1)]; + encoded3 = lookup$1[base642.charCodeAt(i2 + 2)]; + encoded4 = lookup$1[base642.charCodeAt(i2 + 3)]; + bytes[p++] = encoded1 << 2 | encoded2 >> 4; + bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2; + bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63; + } + return buffer; + }; + var polyUint16Array = function(buffer) { + var length = buffer.length; + var bytes = []; + for (var i2 = 0; i2 < length; i2 += 2) { + bytes.push(buffer[i2 + 1] << 8 | buffer[i2]); + } + return bytes; + }; + var polyUint32Array = function(buffer) { + var length = buffer.length; + var bytes = []; + for (var i2 = 0; i2 < length; i2 += 4) { + bytes.push(buffer[i2 + 3] << 24 | buffer[i2 + 2] << 16 | buffer[i2 + 1] << 8 | buffer[i2]); + } + return bytes; + }; + var UTRIE2_SHIFT_2 = 5; + var UTRIE2_SHIFT_1 = 6 + 5; + var UTRIE2_INDEX_SHIFT = 2; + var UTRIE2_SHIFT_1_2 = UTRIE2_SHIFT_1 - UTRIE2_SHIFT_2; + var UTRIE2_LSCP_INDEX_2_OFFSET = 65536 >> UTRIE2_SHIFT_2; + var UTRIE2_DATA_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_2; + var UTRIE2_DATA_MASK = UTRIE2_DATA_BLOCK_LENGTH - 1; + var UTRIE2_LSCP_INDEX_2_LENGTH = 1024 >> UTRIE2_SHIFT_2; + var UTRIE2_INDEX_2_BMP_LENGTH = UTRIE2_LSCP_INDEX_2_OFFSET + UTRIE2_LSCP_INDEX_2_LENGTH; + var UTRIE2_UTF8_2B_INDEX_2_OFFSET = UTRIE2_INDEX_2_BMP_LENGTH; + var UTRIE2_UTF8_2B_INDEX_2_LENGTH = 2048 >> 6; + var UTRIE2_INDEX_1_OFFSET = UTRIE2_UTF8_2B_INDEX_2_OFFSET + UTRIE2_UTF8_2B_INDEX_2_LENGTH; + var UTRIE2_OMITTED_BMP_INDEX_1_LENGTH = 65536 >> UTRIE2_SHIFT_1; + var UTRIE2_INDEX_2_BLOCK_LENGTH = 1 << UTRIE2_SHIFT_1_2; + var UTRIE2_INDEX_2_MASK = UTRIE2_INDEX_2_BLOCK_LENGTH - 1; + var slice16 = function(view, start, end) { + if (view.slice) { + return view.slice(start, end); + } + return new Uint16Array(Array.prototype.slice.call(view, start, end)); + }; + var slice32 = function(view, start, end) { + if (view.slice) { + return view.slice(start, end); + } + return new Uint32Array(Array.prototype.slice.call(view, start, end)); + }; + var createTrieFromBase64 = function(base642, _byteLength) { + var buffer = decode(base642); + var view32 = Array.isArray(buffer) ? polyUint32Array(buffer) : new Uint32Array(buffer); + var view16 = Array.isArray(buffer) ? polyUint16Array(buffer) : new Uint16Array(buffer); + var headerLength = 24; + var index = slice16(view16, headerLength / 2, view32[4] / 2); + var data = view32[5] === 2 ? slice16(view16, (headerLength + view32[4]) / 2) : slice32(view32, Math.ceil((headerLength + view32[4]) / 4)); + return new Trie(view32[0], view32[1], view32[2], view32[3], index, data); + }; + var Trie = ( + /** @class */ + (function() { + function Trie2(initialValue, errorValue, highStart, highValueIndex, index, data) { + this.initialValue = initialValue; + this.errorValue = errorValue; + this.highStart = highStart; + this.highValueIndex = highValueIndex; + this.index = index; + this.data = data; + } + Trie2.prototype.get = function(codePoint) { + var ix; + if (codePoint >= 0) { + if (codePoint < 55296 || codePoint > 56319 && codePoint <= 65535) { + ix = this.index[codePoint >> UTRIE2_SHIFT_2]; + ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); + return this.data[ix]; + } + if (codePoint <= 65535) { + ix = this.index[UTRIE2_LSCP_INDEX_2_OFFSET + (codePoint - 55296 >> UTRIE2_SHIFT_2)]; + ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); + return this.data[ix]; + } + if (codePoint < this.highStart) { + ix = UTRIE2_INDEX_1_OFFSET - UTRIE2_OMITTED_BMP_INDEX_1_LENGTH + (codePoint >> UTRIE2_SHIFT_1); + ix = this.index[ix]; + ix += codePoint >> UTRIE2_SHIFT_2 & UTRIE2_INDEX_2_MASK; + ix = this.index[ix]; + ix = (ix << UTRIE2_INDEX_SHIFT) + (codePoint & UTRIE2_DATA_MASK); + return this.data[ix]; + } + if (codePoint <= 1114111) { + return this.data[this.highValueIndex]; + } + } + return this.errorValue; + }; + return Trie2; + })() + ); + var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256); + for (var i = 0; i < chars.length; i++) { + lookup[chars.charCodeAt(i)] = i; + } + var Prepend = 1; + var CR = 2; + var LF = 3; + var Control = 4; + var Extend = 5; + var SpacingMark = 7; + var L = 8; + var V = 9; + var T = 10; + var LV = 11; + var LVT = 12; + var ZWJ = 13; + var Extended_Pictographic = 14; + var RI = 15; + var toCodePoints = function(str) { + var codePoints = []; + var i2 = 0; + var length = str.length; + while (i2 < length) { + var value = str.charCodeAt(i2++); + if (value >= 55296 && value <= 56319 && i2 < length) { + var extra = str.charCodeAt(i2++); + if ((extra & 64512) === 56320) { + codePoints.push(((value & 1023) << 10) + (extra & 1023) + 65536); + } else { + codePoints.push(value); + i2--; + } + } else { + codePoints.push(value); + } + } + return codePoints; + }; + var fromCodePoint = function() { + var codePoints = []; + for (var _i = 0; _i < arguments.length; _i++) { + codePoints[_i] = arguments[_i]; + } + if (String.fromCodePoint) { + return String.fromCodePoint.apply(String, codePoints); + } + var length = codePoints.length; + if (!length) { + return ""; + } + var codeUnits = []; + var index = -1; + var result = ""; + while (++index < length) { + var codePoint = codePoints[index]; + if (codePoint <= 65535) { + codeUnits.push(codePoint); + } else { + codePoint -= 65536; + codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320); + } + if (index + 1 === length || codeUnits.length > 16384) { + result += String.fromCharCode.apply(String, codeUnits); + codeUnits.length = 0; + } + } + return result; + }; + var UnicodeTrie = createTrieFromBase64(base64); + var BREAK_NOT_ALLOWED = "\xD7"; + var BREAK_ALLOWED = "\xF7"; + var codePointToClass = function(codePoint) { + return UnicodeTrie.get(codePoint); + }; + var _graphemeBreakAtIndex = function(_codePoints, classTypes, index) { + var prevIndex = index - 2; + var prev = classTypes[prevIndex]; + var current = classTypes[index - 1]; + var next = classTypes[index]; + if (current === CR && next === LF) { + return BREAK_NOT_ALLOWED; + } + if (current === CR || current === LF || current === Control) { + return BREAK_ALLOWED; + } + if (next === CR || next === LF || next === Control) { + return BREAK_ALLOWED; + } + if (current === L && [L, V, LV, LVT].indexOf(next) !== -1) { + return BREAK_NOT_ALLOWED; + } + if ((current === LV || current === V) && (next === V || next === T)) { + return BREAK_NOT_ALLOWED; + } + if ((current === LVT || current === T) && next === T) { + return BREAK_NOT_ALLOWED; + } + if (next === ZWJ || next === Extend) { + return BREAK_NOT_ALLOWED; + } + if (next === SpacingMark) { + return BREAK_NOT_ALLOWED; + } + if (current === Prepend) { + return BREAK_NOT_ALLOWED; + } + if (current === ZWJ && next === Extended_Pictographic) { + while (prev === Extend) { + prev = classTypes[--prevIndex]; + } + if (prev === Extended_Pictographic) { + return BREAK_NOT_ALLOWED; + } + } + if (current === RI && next === RI) { + var countRI = 0; + while (prev === RI) { + countRI++; + prev = classTypes[--prevIndex]; + } + if (countRI % 2 === 0) { + return BREAK_NOT_ALLOWED; + } + } + return BREAK_ALLOWED; + }; + var GraphemeBreaker = function(str) { + var codePoints = toCodePoints(str); + var length = codePoints.length; + var index = 0; + var lastEnd = 0; + var classTypes = codePoints.map(codePointToClass); + return { + next: function() { + if (index >= length) { + return { done: true, value: null }; + } + var graphemeBreak = BREAK_NOT_ALLOWED; + while (index < length && (graphemeBreak = _graphemeBreakAtIndex(codePoints, classTypes, ++index)) === BREAK_NOT_ALLOWED) { + } + if (graphemeBreak !== BREAK_NOT_ALLOWED || index === length) { + var value = fromCodePoint.apply(null, codePoints.slice(lastEnd, index)); + lastEnd = index; + return { value, done: false }; + } + return { done: true, value: null }; + } + }; + }; + var splitGraphemes = function(str) { + var breaker = GraphemeBreaker(str); + var graphemes = []; + var bk; + while (!(bk = breaker.next()).done) { + if (bk.value) { + graphemes.push(bk.value.slice()); + } + } + return graphemes; + }; + var testRangeBounds = function(document2) { + var TEST_HEIGHT = 123; + if (document2.createRange) { + var range2 = document2.createRange(); + if (range2.getBoundingClientRect) { + var testElement = document2.createElement("boundtest"); + testElement.style.height = TEST_HEIGHT + "px"; + testElement.style.display = "block"; + document2.body.appendChild(testElement); + range2.selectNode(testElement); + var rangeBounds = range2.getBoundingClientRect(); + var rangeHeight = Math.round(rangeBounds.height); + document2.body.removeChild(testElement); + if (rangeHeight === TEST_HEIGHT) { + return true; + } + } + } + return false; + }; + var testIOSLineBreak = function(document2) { + var testElement = document2.createElement("boundtest"); + testElement.style.width = "50px"; + testElement.style.display = "block"; + testElement.style.fontSize = "12px"; + testElement.style.letterSpacing = "0px"; + testElement.style.wordSpacing = "0px"; + document2.body.appendChild(testElement); + var range2 = document2.createRange(); + testElement.innerHTML = typeof "".repeat === "function" ? "👨".repeat(10) : ""; + var node = testElement.firstChild; + var textList = toCodePoints$1(node.data).map(function(i2) { + return fromCodePoint$1(i2); + }); + var offset = 0; + var prev = {}; + var supports = textList.every(function(text, i2) { + range2.setStart(node, offset); + range2.setEnd(node, offset + text.length); + var rect = range2.getBoundingClientRect(); + offset += text.length; + var boundAhead = rect.x > prev.x || rect.y > prev.y; + prev = rect; + if (i2 === 0) { + return true; + } + return boundAhead; + }); + document2.body.removeChild(testElement); + return supports; + }; + var testCORS = function() { + return typeof new Image().crossOrigin !== "undefined"; + }; + var testResponseType = function() { + return typeof new XMLHttpRequest().responseType === "string"; + }; + var testSVG = function(document2) { + var img = new Image(); + var canvas = document2.createElement("canvas"); + var ctx = canvas.getContext("2d"); + if (!ctx) { + return false; + } + img.src = "data:image/svg+xml,"; + try { + ctx.drawImage(img, 0, 0); + canvas.toDataURL(); + } catch (e2) { + return false; + } + return true; + }; + var isGreenPixel = function(data) { + return data[0] === 0 && data[1] === 255 && data[2] === 0 && data[3] === 255; + }; + var testForeignObject = function(document2) { + var canvas = document2.createElement("canvas"); + var size = 100; + canvas.width = size; + canvas.height = size; + var ctx = canvas.getContext("2d"); + if (!ctx) { + return Promise.reject(false); + } + ctx.fillStyle = "rgb(0, 255, 0)"; + ctx.fillRect(0, 0, size, size); + var img = new Image(); + var greenImageSrc = canvas.toDataURL(); + img.src = greenImageSrc; + var svg = createForeignObjectSVG(size, size, 0, 0, img); + ctx.fillStyle = "red"; + ctx.fillRect(0, 0, size, size); + return loadSerializedSVG$1(svg).then(function(img2) { + ctx.drawImage(img2, 0, 0); + var data = ctx.getImageData(0, 0, size, size).data; + ctx.fillStyle = "red"; + ctx.fillRect(0, 0, size, size); + var node = document2.createElement("div"); + node.style.backgroundImage = "url(" + greenImageSrc + ")"; + node.style.height = size + "px"; + return isGreenPixel(data) ? loadSerializedSVG$1(createForeignObjectSVG(size, size, 0, 0, node)) : Promise.reject(false); + }).then(function(img2) { + ctx.drawImage(img2, 0, 0); + return isGreenPixel(ctx.getImageData(0, 0, size, size).data); + }).catch(function() { + return false; + }); + }; + var createForeignObjectSVG = function(width, height, x, y, node) { + var xmlns = "http://www.w3.org/2000/svg"; + var svg = document.createElementNS(xmlns, "svg"); + var foreignObject = document.createElementNS(xmlns, "foreignObject"); + svg.setAttributeNS(null, "width", width.toString()); + svg.setAttributeNS(null, "height", height.toString()); + foreignObject.setAttributeNS(null, "width", "100%"); + foreignObject.setAttributeNS(null, "height", "100%"); + foreignObject.setAttributeNS(null, "x", x.toString()); + foreignObject.setAttributeNS(null, "y", y.toString()); + foreignObject.setAttributeNS(null, "externalResourcesRequired", "true"); + svg.appendChild(foreignObject); + foreignObject.appendChild(node); + return svg; + }; + var loadSerializedSVG$1 = function(svg) { + return new Promise(function(resolve, reject) { + var img = new Image(); + img.onload = function() { + return resolve(img); + }; + img.onerror = reject; + img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg)); + }); + }; + var FEATURES = { + get SUPPORT_RANGE_BOUNDS() { + var value = testRangeBounds(document); + Object.defineProperty(FEATURES, "SUPPORT_RANGE_BOUNDS", { value }); + return value; + }, + get SUPPORT_WORD_BREAKING() { + var value = FEATURES.SUPPORT_RANGE_BOUNDS && testIOSLineBreak(document); + Object.defineProperty(FEATURES, "SUPPORT_WORD_BREAKING", { value }); + return value; + }, + get SUPPORT_SVG_DRAWING() { + var value = testSVG(document); + Object.defineProperty(FEATURES, "SUPPORT_SVG_DRAWING", { value }); + return value; + }, + get SUPPORT_FOREIGNOBJECT_DRAWING() { + var value = typeof Array.from === "function" && typeof window.fetch === "function" ? testForeignObject(document) : Promise.resolve(false); + Object.defineProperty(FEATURES, "SUPPORT_FOREIGNOBJECT_DRAWING", { value }); + return value; + }, + get SUPPORT_CORS_IMAGES() { + var value = testCORS(); + Object.defineProperty(FEATURES, "SUPPORT_CORS_IMAGES", { value }); + return value; + }, + get SUPPORT_RESPONSE_TYPE() { + var value = testResponseType(); + Object.defineProperty(FEATURES, "SUPPORT_RESPONSE_TYPE", { value }); + return value; + }, + get SUPPORT_CORS_XHR() { + var value = "withCredentials" in new XMLHttpRequest(); + Object.defineProperty(FEATURES, "SUPPORT_CORS_XHR", { value }); + return value; + }, + get SUPPORT_NATIVE_TEXT_SEGMENTATION() { + var value = !!(typeof Intl !== "undefined" && Intl.Segmenter); + Object.defineProperty(FEATURES, "SUPPORT_NATIVE_TEXT_SEGMENTATION", { value }); + return value; + } + }; + var TextBounds = ( + /** @class */ + /* @__PURE__ */ (function() { + function TextBounds2(text, bounds) { + this.text = text; + this.bounds = bounds; + } + return TextBounds2; + })() + ); + var parseTextBounds = function(context, value, styles, node) { + var textList = breakText(value, styles); + var textBounds = []; + var offset = 0; + textList.forEach(function(text) { + if (styles.textDecorationLine.length || text.trim().length > 0) { + if (FEATURES.SUPPORT_RANGE_BOUNDS) { + var clientRects = createRange(node, offset, text.length).getClientRects(); + if (clientRects.length > 1) { + var subSegments = segmentGraphemes(text); + var subOffset_1 = 0; + subSegments.forEach(function(subSegment) { + textBounds.push(new TextBounds(subSegment, Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects()))); + subOffset_1 += subSegment.length; + }); + } else { + textBounds.push(new TextBounds(text, Bounds.fromDOMRectList(context, clientRects))); + } + } else { + var replacementNode = node.splitText(text.length); + textBounds.push(new TextBounds(text, getWrapperBounds(context, node))); + node = replacementNode; + } + } else if (!FEATURES.SUPPORT_RANGE_BOUNDS) { + node = node.splitText(text.length); + } + offset += text.length; + }); + return textBounds; + }; + var getWrapperBounds = function(context, node) { + var ownerDocument = node.ownerDocument; + if (ownerDocument) { + var wrapper = ownerDocument.createElement("html2canvaswrapper"); + wrapper.appendChild(node.cloneNode(true)); + var parentNode = node.parentNode; + if (parentNode) { + parentNode.replaceChild(wrapper, node); + var bounds = parseBounds(context, wrapper); + if (wrapper.firstChild) { + parentNode.replaceChild(wrapper.firstChild, wrapper); + } + return bounds; + } + } + return Bounds.EMPTY; + }; + var createRange = function(node, offset, length) { + var ownerDocument = node.ownerDocument; + if (!ownerDocument) { + throw new Error("Node has no owner document"); + } + var range2 = ownerDocument.createRange(); + range2.setStart(node, offset); + range2.setEnd(node, offset + length); + return range2; + }; + var segmentGraphemes = function(value) { + if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) { + var segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" }); + return Array.from(segmenter.segment(value)).map(function(segment) { + return segment.segment; + }); + } + return splitGraphemes(value); + }; + var segmentWords = function(value, styles) { + if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) { + var segmenter = new Intl.Segmenter(void 0, { + granularity: "word" + }); + return Array.from(segmenter.segment(value)).map(function(segment) { + return segment.segment; + }); + } + return breakWords(value, styles); + }; + var breakText = function(value, styles) { + return styles.letterSpacing !== 0 ? segmentGraphemes(value) : segmentWords(value, styles); + }; + var wordSeparators = [32, 160, 4961, 65792, 65793, 4153, 4241]; + var breakWords = function(str, styles) { + var breaker = LineBreaker(str, { + lineBreak: styles.lineBreak, + wordBreak: styles.overflowWrap === "break-word" ? "break-word" : styles.wordBreak + }); + var words = []; + var bk; + var _loop_1 = function() { + if (bk.value) { + var value = bk.value.slice(); + var codePoints = toCodePoints$1(value); + var word_1 = ""; + codePoints.forEach(function(codePoint) { + if (wordSeparators.indexOf(codePoint) === -1) { + word_1 += fromCodePoint$1(codePoint); + } else { + if (word_1.length) { + words.push(word_1); + } + words.push(fromCodePoint$1(codePoint)); + word_1 = ""; + } + }); + if (word_1.length) { + words.push(word_1); + } + } + }; + while (!(bk = breaker.next()).done) { + _loop_1(); + } + return words; + }; + var TextContainer = ( + /** @class */ + /* @__PURE__ */ (function() { + function TextContainer2(context, node, styles) { + this.text = transform(node.data, styles.textTransform); + this.textBounds = parseTextBounds(context, this.text, styles, node); + } + return TextContainer2; + })() + ); + var transform = function(text, transform2) { + switch (transform2) { + case 1: + return text.toLowerCase(); + case 3: + return text.replace(CAPITALIZE, capitalize); + case 2: + return text.toUpperCase(); + default: + return text; + } + }; + var CAPITALIZE = /(^|\s|:|-|\(|\))([a-z])/g; + var capitalize = function(m, p1, p2) { + if (m.length > 0) { + return p1 + p2.toUpperCase(); + } + return m; + }; + var ImageElementContainer = ( + /** @class */ + (function(_super) { + __extends(ImageElementContainer2, _super); + function ImageElementContainer2(context, img) { + var _this = _super.call(this, context, img) || this; + _this.src = img.currentSrc || img.src; + _this.intrinsicWidth = img.naturalWidth; + _this.intrinsicHeight = img.naturalHeight; + _this.context.cache.addImage(_this.src); + return _this; + } + return ImageElementContainer2; + })(ElementContainer) + ); + var CanvasElementContainer = ( + /** @class */ + (function(_super) { + __extends(CanvasElementContainer2, _super); + function CanvasElementContainer2(context, canvas) { + var _this = _super.call(this, context, canvas) || this; + _this.canvas = canvas; + _this.intrinsicWidth = canvas.width; + _this.intrinsicHeight = canvas.height; + return _this; + } + return CanvasElementContainer2; + })(ElementContainer) + ); + var SVGElementContainer = ( + /** @class */ + (function(_super) { + __extends(SVGElementContainer2, _super); + function SVGElementContainer2(context, img) { + var _this = _super.call(this, context, img) || this; + var s = new XMLSerializer(); + var bounds = parseBounds(context, img); + img.setAttribute("width", bounds.width + "px"); + img.setAttribute("height", bounds.height + "px"); + _this.svg = "data:image/svg+xml," + encodeURIComponent(s.serializeToString(img)); + _this.intrinsicWidth = img.width.baseVal.value; + _this.intrinsicHeight = img.height.baseVal.value; + _this.context.cache.addImage(_this.svg); + return _this; + } + return SVGElementContainer2; + })(ElementContainer) + ); + var LIElementContainer = ( + /** @class */ + (function(_super) { + __extends(LIElementContainer2, _super); + function LIElementContainer2(context, element) { + var _this = _super.call(this, context, element) || this; + _this.value = element.value; + return _this; + } + return LIElementContainer2; + })(ElementContainer) + ); + var OLElementContainer = ( + /** @class */ + (function(_super) { + __extends(OLElementContainer2, _super); + function OLElementContainer2(context, element) { + var _this = _super.call(this, context, element) || this; + _this.start = element.start; + _this.reversed = typeof element.reversed === "boolean" && element.reversed === true; + return _this; + } + return OLElementContainer2; + })(ElementContainer) + ); + var CHECKBOX_BORDER_RADIUS = [ + { + type: 15, + flags: 0, + unit: "px", + number: 3 + } + ]; + var RADIO_BORDER_RADIUS = [ + { + type: 16, + flags: 0, + number: 50 + } + ]; + var reformatInputBounds = function(bounds) { + if (bounds.width > bounds.height) { + return new Bounds(bounds.left + (bounds.width - bounds.height) / 2, bounds.top, bounds.height, bounds.height); + } else if (bounds.width < bounds.height) { + return new Bounds(bounds.left, bounds.top + (bounds.height - bounds.width) / 2, bounds.width, bounds.width); + } + return bounds; + }; + var getInputValue = function(node) { + var value = node.type === PASSWORD ? new Array(node.value.length + 1).join("\u2022") : node.value; + return value.length === 0 ? node.placeholder || "" : value; + }; + var CHECKBOX = "checkbox"; + var RADIO = "radio"; + var PASSWORD = "password"; + var INPUT_COLOR = 707406591; + var InputElementContainer = ( + /** @class */ + (function(_super) { + __extends(InputElementContainer2, _super); + function InputElementContainer2(context, input) { + var _this = _super.call(this, context, input) || this; + _this.type = input.type.toLowerCase(); + _this.checked = input.checked; + _this.value = getInputValue(input); + if (_this.type === CHECKBOX || _this.type === RADIO) { + _this.styles.backgroundColor = 3739148031; + _this.styles.borderTopColor = _this.styles.borderRightColor = _this.styles.borderBottomColor = _this.styles.borderLeftColor = 2779096575; + _this.styles.borderTopWidth = _this.styles.borderRightWidth = _this.styles.borderBottomWidth = _this.styles.borderLeftWidth = 1; + _this.styles.borderTopStyle = _this.styles.borderRightStyle = _this.styles.borderBottomStyle = _this.styles.borderLeftStyle = 1; + _this.styles.backgroundClip = [ + 0 + /* BORDER_BOX */ + ]; + _this.styles.backgroundOrigin = [ + 0 + /* BORDER_BOX */ + ]; + _this.bounds = reformatInputBounds(_this.bounds); + } + switch (_this.type) { + case CHECKBOX: + _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = CHECKBOX_BORDER_RADIUS; + break; + case RADIO: + _this.styles.borderTopRightRadius = _this.styles.borderTopLeftRadius = _this.styles.borderBottomRightRadius = _this.styles.borderBottomLeftRadius = RADIO_BORDER_RADIUS; + break; + } + return _this; + } + return InputElementContainer2; + })(ElementContainer) + ); + var SelectElementContainer = ( + /** @class */ + (function(_super) { + __extends(SelectElementContainer2, _super); + function SelectElementContainer2(context, element) { + var _this = _super.call(this, context, element) || this; + var option = element.options[element.selectedIndex || 0]; + _this.value = option ? option.text || "" : ""; + return _this; + } + return SelectElementContainer2; + })(ElementContainer) + ); + var TextareaElementContainer = ( + /** @class */ + (function(_super) { + __extends(TextareaElementContainer2, _super); + function TextareaElementContainer2(context, element) { + var _this = _super.call(this, context, element) || this; + _this.value = element.value; + return _this; + } + return TextareaElementContainer2; + })(ElementContainer) + ); + var IFrameElementContainer = ( + /** @class */ + (function(_super) { + __extends(IFrameElementContainer2, _super); + function IFrameElementContainer2(context, iframe) { + var _this = _super.call(this, context, iframe) || this; + _this.src = iframe.src; + _this.width = parseInt(iframe.width, 10) || 0; + _this.height = parseInt(iframe.height, 10) || 0; + _this.backgroundColor = _this.styles.backgroundColor; + try { + if (iframe.contentWindow && iframe.contentWindow.document && iframe.contentWindow.document.documentElement) { + _this.tree = parseTree(context, iframe.contentWindow.document.documentElement); + var documentBackgroundColor = iframe.contentWindow.document.documentElement ? parseColor(context, getComputedStyle(iframe.contentWindow.document.documentElement).backgroundColor) : COLORS.TRANSPARENT; + var bodyBackgroundColor = iframe.contentWindow.document.body ? parseColor(context, getComputedStyle(iframe.contentWindow.document.body).backgroundColor) : COLORS.TRANSPARENT; + _this.backgroundColor = isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? _this.styles.backgroundColor : bodyBackgroundColor : documentBackgroundColor; + } + } catch (e2) { + } + return _this; + } + return IFrameElementContainer2; + })(ElementContainer) + ); + var LIST_OWNERS = ["OL", "UL", "MENU"]; + var parseNodeTree = function(context, node, parent, root) { + for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) { + nextNode = childNode.nextSibling; + if (isTextNode(childNode) && childNode.data.trim().length > 0) { + parent.textNodes.push(new TextContainer(context, childNode, parent.styles)); + } else if (isElementNode(childNode)) { + if (isSlotElement(childNode) && childNode.assignedNodes) { + childNode.assignedNodes().forEach(function(childNode2) { + return parseNodeTree(context, childNode2, parent, root); + }); + } else { + var container = createContainer(context, childNode); + if (container.styles.isVisible()) { + if (createsRealStackingContext(childNode, container, root)) { + container.flags |= 4; + } else if (createsStackingContext(container.styles)) { + container.flags |= 2; + } + if (LIST_OWNERS.indexOf(childNode.tagName) !== -1) { + container.flags |= 8; + } + parent.elements.push(container); + childNode.slot; + if (childNode.shadowRoot) { + parseNodeTree(context, childNode.shadowRoot, container, root); + } else if (!isTextareaElement(childNode) && !isSVGElement(childNode) && !isSelectElement(childNode)) { + parseNodeTree(context, childNode, container, root); + } + } + } + } + } + }; + var createContainer = function(context, element) { + if (isImageElement(element)) { + return new ImageElementContainer(context, element); + } + if (isCanvasElement(element)) { + return new CanvasElementContainer(context, element); + } + if (isSVGElement(element)) { + return new SVGElementContainer(context, element); + } + if (isLIElement(element)) { + return new LIElementContainer(context, element); + } + if (isOLElement(element)) { + return new OLElementContainer(context, element); + } + if (isInputElement(element)) { + return new InputElementContainer(context, element); + } + if (isSelectElement(element)) { + return new SelectElementContainer(context, element); + } + if (isTextareaElement(element)) { + return new TextareaElementContainer(context, element); + } + if (isIFrameElement(element)) { + return new IFrameElementContainer(context, element); + } + return new ElementContainer(context, element); + }; + var parseTree = function(context, element) { + var container = createContainer(context, element); + container.flags |= 4; + parseNodeTree(context, element, container, container); + return container; + }; + var createsRealStackingContext = function(node, container, root) { + return container.styles.isPositionedWithZIndex() || container.styles.opacity < 1 || container.styles.isTransformed() || isBodyElement(node) && root.styles.isTransparent(); + }; + var createsStackingContext = function(styles) { + return styles.isPositioned() || styles.isFloating(); + }; + var isTextNode = function(node) { + return node.nodeType === Node.TEXT_NODE; + }; + var isElementNode = function(node) { + return node.nodeType === Node.ELEMENT_NODE; + }; + var isHTMLElementNode = function(node) { + return isElementNode(node) && typeof node.style !== "undefined" && !isSVGElementNode(node); + }; + var isSVGElementNode = function(element) { + return typeof element.className === "object"; + }; + var isLIElement = function(node) { + return node.tagName === "LI"; + }; + var isOLElement = function(node) { + return node.tagName === "OL"; + }; + var isInputElement = function(node) { + return node.tagName === "INPUT"; + }; + var isHTMLElement2 = function(node) { + return node.tagName === "HTML"; + }; + var isSVGElement = function(node) { + return node.tagName === "svg"; + }; + var isBodyElement = function(node) { + return node.tagName === "BODY"; + }; + var isCanvasElement = function(node) { + return node.tagName === "CANVAS"; + }; + var isVideoElement = function(node) { + return node.tagName === "VIDEO"; + }; + var isImageElement = function(node) { + return node.tagName === "IMG"; + }; + var isIFrameElement = function(node) { + return node.tagName === "IFRAME"; + }; + var isStyleElement = function(node) { + return node.tagName === "STYLE"; + }; + var isScriptElement = function(node) { + return node.tagName === "SCRIPT"; + }; + var isTextareaElement = function(node) { + return node.tagName === "TEXTAREA"; + }; + var isSelectElement = function(node) { + return node.tagName === "SELECT"; + }; + var isSlotElement = function(node) { + return node.tagName === "SLOT"; + }; + var isCustomElement = function(node) { + return node.tagName.indexOf("-") > 0; + }; + var CounterState = ( + /** @class */ + (function() { + function CounterState2() { + this.counters = {}; + } + CounterState2.prototype.getCounterValue = function(name) { + var counter = this.counters[name]; + if (counter && counter.length) { + return counter[counter.length - 1]; + } + return 1; + }; + CounterState2.prototype.getCounterValues = function(name) { + var counter = this.counters[name]; + return counter ? counter : []; + }; + CounterState2.prototype.pop = function(counters) { + var _this = this; + counters.forEach(function(counter) { + return _this.counters[counter].pop(); + }); + }; + CounterState2.prototype.parse = function(style) { + var _this = this; + var counterIncrement2 = style.counterIncrement; + var counterReset2 = style.counterReset; + var canReset = true; + if (counterIncrement2 !== null) { + counterIncrement2.forEach(function(entry) { + var counter = _this.counters[entry.counter]; + if (counter && entry.increment !== 0) { + canReset = false; + if (!counter.length) { + counter.push(1); + } + counter[Math.max(0, counter.length - 1)] += entry.increment; + } + }); + } + var counterNames = []; + if (canReset) { + counterReset2.forEach(function(entry) { + var counter = _this.counters[entry.counter]; + counterNames.push(entry.counter); + if (!counter) { + counter = _this.counters[entry.counter] = []; + } + counter.push(entry.reset); + }); + } + return counterNames; + }; + return CounterState2; + })() + ); + var ROMAN_UPPER = { + integers: [1e3, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1], + values: ["M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"] + }; + var ARMENIAN = { + integers: [ + 9e3, + 8e3, + 7e3, + 6e3, + 5e3, + 4e3, + 3e3, + 2e3, + 1e3, + 900, + 800, + 700, + 600, + 500, + 400, + 300, + 200, + 100, + 90, + 80, + 70, + 60, + 50, + 40, + 30, + 20, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + values: [ + "\u0554", + "\u0553", + "\u0552", + "\u0551", + "\u0550", + "\u054F", + "\u054E", + "\u054D", + "\u054C", + "\u054B", + "\u054A", + "\u0549", + "\u0548", + "\u0547", + "\u0546", + "\u0545", + "\u0544", + "\u0543", + "\u0542", + "\u0541", + "\u0540", + "\u053F", + "\u053E", + "\u053D", + "\u053C", + "\u053B", + "\u053A", + "\u0539", + "\u0538", + "\u0537", + "\u0536", + "\u0535", + "\u0534", + "\u0533", + "\u0532", + "\u0531" + ] + }; + var HEBREW = { + integers: [ + 1e4, + 9e3, + 8e3, + 7e3, + 6e3, + 5e3, + 4e3, + 3e3, + 2e3, + 1e3, + 400, + 300, + 200, + 100, + 90, + 80, + 70, + 60, + 50, + 40, + 30, + 20, + 19, + 18, + 17, + 16, + 15, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + values: [ + "\u05D9\u05F3", + "\u05D8\u05F3", + "\u05D7\u05F3", + "\u05D6\u05F3", + "\u05D5\u05F3", + "\u05D4\u05F3", + "\u05D3\u05F3", + "\u05D2\u05F3", + "\u05D1\u05F3", + "\u05D0\u05F3", + "\u05EA", + "\u05E9", + "\u05E8", + "\u05E7", + "\u05E6", + "\u05E4", + "\u05E2", + "\u05E1", + "\u05E0", + "\u05DE", + "\u05DC", + "\u05DB", + "\u05D9\u05D8", + "\u05D9\u05D7", + "\u05D9\u05D6", + "\u05D8\u05D6", + "\u05D8\u05D5", + "\u05D9", + "\u05D8", + "\u05D7", + "\u05D6", + "\u05D5", + "\u05D4", + "\u05D3", + "\u05D2", + "\u05D1", + "\u05D0" + ] + }; + var GEORGIAN = { + integers: [ + 1e4, + 9e3, + 8e3, + 7e3, + 6e3, + 5e3, + 4e3, + 3e3, + 2e3, + 1e3, + 900, + 800, + 700, + 600, + 500, + 400, + 300, + 200, + 100, + 90, + 80, + 70, + 60, + 50, + 40, + 30, + 20, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + values: [ + "\u10F5", + "\u10F0", + "\u10EF", + "\u10F4", + "\u10EE", + "\u10ED", + "\u10EC", + "\u10EB", + "\u10EA", + "\u10E9", + "\u10E8", + "\u10E7", + "\u10E6", + "\u10E5", + "\u10E4", + "\u10F3", + "\u10E2", + "\u10E1", + "\u10E0", + "\u10DF", + "\u10DE", + "\u10DD", + "\u10F2", + "\u10DC", + "\u10DB", + "\u10DA", + "\u10D9", + "\u10D8", + "\u10D7", + "\u10F1", + "\u10D6", + "\u10D5", + "\u10D4", + "\u10D3", + "\u10D2", + "\u10D1", + "\u10D0" + ] + }; + var createAdditiveCounter = function(value, min, max, symbols, fallback, suffix) { + if (value < min || value > max) { + return createCounterText(value, fallback, suffix.length > 0); + } + return symbols.integers.reduce(function(string, integer, index) { + while (value >= integer) { + value -= integer; + string += symbols.values[index]; + } + return string; + }, "") + suffix; + }; + var createCounterStyleWithSymbolResolver = function(value, codePointRangeLength, isNumeric, resolver) { + var string = ""; + do { + if (!isNumeric) { + value--; + } + string = resolver(value) + string; + value /= codePointRangeLength; + } while (value * codePointRangeLength >= codePointRangeLength); + return string; + }; + var createCounterStyleFromRange = function(value, codePointRangeStart, codePointRangeEnd, isNumeric, suffix) { + var codePointRangeLength = codePointRangeEnd - codePointRangeStart + 1; + return (value < 0 ? "-" : "") + (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, isNumeric, function(codePoint) { + return fromCodePoint$1(Math.floor(codePoint % codePointRangeLength) + codePointRangeStart); + }) + suffix); + }; + var createCounterStyleFromSymbols = function(value, symbols, suffix) { + if (suffix === void 0) { + suffix = ". "; + } + var codePointRangeLength = symbols.length; + return createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function(codePoint) { + return symbols[Math.floor(codePoint % codePointRangeLength)]; + }) + suffix; + }; + var CJK_ZEROS = 1 << 0; + var CJK_TEN_COEFFICIENTS = 1 << 1; + var CJK_TEN_HIGH_COEFFICIENTS = 1 << 2; + var CJK_HUNDRED_COEFFICIENTS = 1 << 3; + var createCJKCounter = function(value, numbers, multipliers, negativeSign, suffix, flags) { + if (value < -9999 || value > 9999) { + return createCounterText(value, 4, suffix.length > 0); + } + var tmp = Math.abs(value); + var string = suffix; + if (tmp === 0) { + return numbers[0] + string; + } + for (var digit = 0; tmp > 0 && digit <= 4; digit++) { + var coefficient = tmp % 10; + if (coefficient === 0 && contains(flags, CJK_ZEROS) && string !== "") { + string = numbers[coefficient] + string; + } else if (coefficient > 1 || coefficient === 1 && digit === 0 || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_COEFFICIENTS) || coefficient === 1 && digit === 1 && contains(flags, CJK_TEN_HIGH_COEFFICIENTS) && value > 100 || coefficient === 1 && digit > 1 && contains(flags, CJK_HUNDRED_COEFFICIENTS)) { + string = numbers[coefficient] + (digit > 0 ? multipliers[digit - 1] : "") + string; + } else if (coefficient === 1 && digit > 0) { + string = multipliers[digit - 1] + string; + } + tmp = Math.floor(tmp / 10); + } + return (value < 0 ? negativeSign : "") + string; + }; + var CHINESE_INFORMAL_MULTIPLIERS = "\u5341\u767E\u5343\u842C"; + var CHINESE_FORMAL_MULTIPLIERS = "\u62FE\u4F70\u4EDF\u842C"; + var JAPANESE_NEGATIVE = "\u30DE\u30A4\u30CA\u30B9"; + var KOREAN_NEGATIVE = "\uB9C8\uC774\uB108\uC2A4"; + var createCounterText = function(value, type, appendSuffix) { + var defaultSuffix = appendSuffix ? ". " : ""; + var cjkSuffix = appendSuffix ? "\u3001" : ""; + var koreanSuffix = appendSuffix ? ", " : ""; + var spaceSuffix = appendSuffix ? " " : ""; + switch (type) { + case 0: + return "\u2022" + spaceSuffix; + case 1: + return "\u25E6" + spaceSuffix; + case 2: + return "\u25FE" + spaceSuffix; + case 5: + var string = createCounterStyleFromRange(value, 48, 57, true, defaultSuffix); + return string.length < 4 ? "0" + string : string; + case 4: + return createCounterStyleFromSymbols(value, "\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", cjkSuffix); + case 6: + return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3, defaultSuffix).toLowerCase(); + case 7: + return createAdditiveCounter(value, 1, 3999, ROMAN_UPPER, 3, defaultSuffix); + case 8: + return createCounterStyleFromRange(value, 945, 969, false, defaultSuffix); + case 9: + return createCounterStyleFromRange(value, 97, 122, false, defaultSuffix); + case 10: + return createCounterStyleFromRange(value, 65, 90, false, defaultSuffix); + case 11: + return createCounterStyleFromRange(value, 1632, 1641, true, defaultSuffix); + case 12: + case 49: + return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3, defaultSuffix); + case 35: + return createAdditiveCounter(value, 1, 9999, ARMENIAN, 3, defaultSuffix).toLowerCase(); + case 13: + return createCounterStyleFromRange(value, 2534, 2543, true, defaultSuffix); + case 14: + case 30: + return createCounterStyleFromRange(value, 6112, 6121, true, defaultSuffix); + case 15: + return createCounterStyleFromSymbols(value, "\u5B50\u4E11\u5BC5\u536F\u8FB0\u5DF3\u5348\u672A\u7533\u9149\u620C\u4EA5", cjkSuffix); + case 16: + return createCounterStyleFromSymbols(value, "\u7532\u4E59\u4E19\u4E01\u620A\u5DF1\u5E9A\u8F9B\u58EC\u7678", cjkSuffix); + case 17: + case 48: + return createCJKCounter(value, "\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", CHINESE_INFORMAL_MULTIPLIERS, "\u8CA0", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case 47: + return createCJKCounter(value, "\u96F6\u58F9\u8CB3\u53C3\u8086\u4F0D\u9678\u67D2\u634C\u7396", CHINESE_FORMAL_MULTIPLIERS, "\u8CA0", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case 42: + return createCJKCounter(value, "\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", CHINESE_INFORMAL_MULTIPLIERS, "\u8D1F", cjkSuffix, CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case 41: + return createCJKCounter(value, "\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396", CHINESE_FORMAL_MULTIPLIERS, "\u8D1F", cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS | CJK_HUNDRED_COEFFICIENTS); + case 26: + return createCJKCounter(value, "\u3007\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", "\u5341\u767E\u5343\u4E07", JAPANESE_NEGATIVE, cjkSuffix, 0); + case 25: + return createCJKCounter(value, "\u96F6\u58F1\u5F10\u53C2\u56DB\u4F0D\u516D\u4E03\u516B\u4E5D", "\u62FE\u767E\u5343\u4E07", JAPANESE_NEGATIVE, cjkSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS); + case 31: + return createCJKCounter(value, "\uC601\uC77C\uC774\uC0BC\uC0AC\uC624\uC721\uCE60\uD314\uAD6C", "\uC2ED\uBC31\uCC9C\uB9CC", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS); + case 33: + return createCJKCounter(value, "\u96F6\u4E00\u4E8C\u4E09\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", "\u5341\u767E\u5343\u842C", KOREAN_NEGATIVE, koreanSuffix, 0); + case 32: + return createCJKCounter(value, "\u96F6\u58F9\u8CB3\u53C3\u56DB\u4E94\u516D\u4E03\u516B\u4E5D", "\u62FE\u767E\u5343", KOREAN_NEGATIVE, koreanSuffix, CJK_ZEROS | CJK_TEN_COEFFICIENTS | CJK_TEN_HIGH_COEFFICIENTS); + case 18: + return createCounterStyleFromRange(value, 2406, 2415, true, defaultSuffix); + case 20: + return createAdditiveCounter(value, 1, 19999, GEORGIAN, 3, defaultSuffix); + case 21: + return createCounterStyleFromRange(value, 2790, 2799, true, defaultSuffix); + case 22: + return createCounterStyleFromRange(value, 2662, 2671, true, defaultSuffix); + case 22: + return createAdditiveCounter(value, 1, 10999, HEBREW, 3, defaultSuffix); + case 23: + return createCounterStyleFromSymbols(value, "\u3042\u3044\u3046\u3048\u304A\u304B\u304D\u304F\u3051\u3053\u3055\u3057\u3059\u305B\u305D\u305F\u3061\u3064\u3066\u3068\u306A\u306B\u306C\u306D\u306E\u306F\u3072\u3075\u3078\u307B\u307E\u307F\u3080\u3081\u3082\u3084\u3086\u3088\u3089\u308A\u308B\u308C\u308D\u308F\u3090\u3091\u3092\u3093"); + case 24: + return createCounterStyleFromSymbols(value, "\u3044\u308D\u306F\u306B\u307B\u3078\u3068\u3061\u308A\u306C\u308B\u3092\u308F\u304B\u3088\u305F\u308C\u305D\u3064\u306D\u306A\u3089\u3080\u3046\u3090\u306E\u304A\u304F\u3084\u307E\u3051\u3075\u3053\u3048\u3066\u3042\u3055\u304D\u3086\u3081\u307F\u3057\u3091\u3072\u3082\u305B\u3059"); + case 27: + return createCounterStyleFromRange(value, 3302, 3311, true, defaultSuffix); + case 28: + return createCounterStyleFromSymbols(value, "\u30A2\u30A4\u30A6\u30A8\u30AA\u30AB\u30AD\u30AF\u30B1\u30B3\u30B5\u30B7\u30B9\u30BB\u30BD\u30BF\u30C1\u30C4\u30C6\u30C8\u30CA\u30CB\u30CC\u30CD\u30CE\u30CF\u30D2\u30D5\u30D8\u30DB\u30DE\u30DF\u30E0\u30E1\u30E2\u30E4\u30E6\u30E8\u30E9\u30EA\u30EB\u30EC\u30ED\u30EF\u30F0\u30F1\u30F2\u30F3", cjkSuffix); + case 29: + return createCounterStyleFromSymbols(value, "\u30A4\u30ED\u30CF\u30CB\u30DB\u30D8\u30C8\u30C1\u30EA\u30CC\u30EB\u30F2\u30EF\u30AB\u30E8\u30BF\u30EC\u30BD\u30C4\u30CD\u30CA\u30E9\u30E0\u30A6\u30F0\u30CE\u30AA\u30AF\u30E4\u30DE\u30B1\u30D5\u30B3\u30A8\u30C6\u30A2\u30B5\u30AD\u30E6\u30E1\u30DF\u30B7\u30F1\u30D2\u30E2\u30BB\u30B9", cjkSuffix); + case 34: + return createCounterStyleFromRange(value, 3792, 3801, true, defaultSuffix); + case 37: + return createCounterStyleFromRange(value, 6160, 6169, true, defaultSuffix); + case 38: + return createCounterStyleFromRange(value, 4160, 4169, true, defaultSuffix); + case 39: + return createCounterStyleFromRange(value, 2918, 2927, true, defaultSuffix); + case 40: + return createCounterStyleFromRange(value, 1776, 1785, true, defaultSuffix); + case 43: + return createCounterStyleFromRange(value, 3046, 3055, true, defaultSuffix); + case 44: + return createCounterStyleFromRange(value, 3174, 3183, true, defaultSuffix); + case 45: + return createCounterStyleFromRange(value, 3664, 3673, true, defaultSuffix); + case 46: + return createCounterStyleFromRange(value, 3872, 3881, true, defaultSuffix); + case 3: + default: + return createCounterStyleFromRange(value, 48, 57, true, defaultSuffix); + } + }; + var IGNORE_ATTRIBUTE = "data-html2canvas-ignore"; + var DocumentCloner = ( + /** @class */ + (function() { + function DocumentCloner2(context, element, options) { + this.context = context; + this.options = options; + this.scrolledElements = []; + this.referenceElement = element; + this.counters = new CounterState(); + this.quoteDepth = 0; + if (!element.ownerDocument) { + throw new Error("Cloned element does not have an owner document"); + } + this.documentElement = this.cloneNode(element.ownerDocument.documentElement, false); + } + DocumentCloner2.prototype.toIFrame = function(ownerDocument, windowSize) { + var _this = this; + var iframe = createIFrameContainer(ownerDocument, windowSize); + if (!iframe.contentWindow) { + return Promise.reject("Unable to find iframe window"); + } + var scrollX = ownerDocument.defaultView.pageXOffset; + var scrollY = ownerDocument.defaultView.pageYOffset; + var cloneWindow = iframe.contentWindow; + var documentClone = cloneWindow.document; + var iframeLoad = iframeLoader(iframe).then(function() { + return __awaiter(_this, void 0, void 0, function() { + var onclone, referenceElement; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + this.scrolledElements.forEach(restoreNodeScroll); + if (cloneWindow) { + cloneWindow.scrollTo(windowSize.left, windowSize.top); + if (/(iPad|iPhone|iPod)/g.test(navigator.userAgent) && (cloneWindow.scrollY !== windowSize.top || cloneWindow.scrollX !== windowSize.left)) { + this.context.logger.warn("Unable to restore scroll position for cloned document"); + this.context.windowBounds = this.context.windowBounds.add(cloneWindow.scrollX - windowSize.left, cloneWindow.scrollY - windowSize.top, 0, 0); + } + } + onclone = this.options.onclone; + referenceElement = this.clonedReferenceElement; + if (typeof referenceElement === "undefined") { + return [2, Promise.reject("Error finding the " + this.referenceElement.nodeName + " in the cloned document")]; + } + if (!(documentClone.fonts && documentClone.fonts.ready)) return [3, 2]; + return [4, documentClone.fonts.ready]; + case 1: + _a.sent(); + _a.label = 2; + case 2: + if (!/(AppleWebKit)/g.test(navigator.userAgent)) return [3, 4]; + return [4, imagesReady(documentClone)]; + case 3: + _a.sent(); + _a.label = 4; + case 4: + if (typeof onclone === "function") { + return [2, Promise.resolve().then(function() { + return onclone(documentClone, referenceElement); + }).then(function() { + return iframe; + })]; + } + return [2, iframe]; + } + }); + }); + }); + documentClone.open(); + documentClone.write(serializeDoctype(document.doctype) + ""); + restoreOwnerScroll(this.referenceElement.ownerDocument, scrollX, scrollY); + documentClone.replaceChild(documentClone.adoptNode(this.documentElement), documentClone.documentElement); + documentClone.close(); + return iframeLoad; + }; + DocumentCloner2.prototype.createElementClone = function(node) { + if (isDebugging( + node, + 2 + /* CLONE */ + )) { + debugger; + } + if (isCanvasElement(node)) { + return this.createCanvasClone(node); + } + if (isVideoElement(node)) { + return this.createVideoClone(node); + } + if (isStyleElement(node)) { + return this.createStyleClone(node); + } + var clone = node.cloneNode(false); + if (isImageElement(clone)) { + if (isImageElement(node) && node.currentSrc && node.currentSrc !== node.src) { + clone.src = node.currentSrc; + clone.srcset = ""; + } + if (clone.loading === "lazy") { + clone.loading = "eager"; + } + } + if (isCustomElement(clone)) { + return this.createCustomElementClone(clone); + } + return clone; + }; + DocumentCloner2.prototype.createCustomElementClone = function(node) { + var clone = document.createElement("html2canvascustomelement"); + copyCSSStyles(node.style, clone); + return clone; + }; + DocumentCloner2.prototype.createStyleClone = function(node) { + try { + var sheet = node.sheet; + if (sheet && sheet.cssRules) { + var css2 = [].slice.call(sheet.cssRules, 0).reduce(function(css3, rule) { + if (rule && typeof rule.cssText === "string") { + return css3 + rule.cssText; + } + return css3; + }, ""); + var style = node.cloneNode(false); + style.textContent = css2; + return style; + } + } catch (e2) { + this.context.logger.error("Unable to access cssRules property", e2); + if (e2.name !== "SecurityError") { + throw e2; + } + } + return node.cloneNode(false); + }; + DocumentCloner2.prototype.createCanvasClone = function(canvas) { + var _a; + if (this.options.inlineImages && canvas.ownerDocument) { + var img = canvas.ownerDocument.createElement("img"); + try { + img.src = canvas.toDataURL(); + return img; + } catch (e2) { + this.context.logger.info("Unable to inline canvas contents, canvas is tainted", canvas); + } + } + var clonedCanvas = canvas.cloneNode(false); + try { + clonedCanvas.width = canvas.width; + clonedCanvas.height = canvas.height; + var ctx = canvas.getContext("2d"); + var clonedCtx = clonedCanvas.getContext("2d"); + if (clonedCtx) { + if (!this.options.allowTaint && ctx) { + clonedCtx.putImageData(ctx.getImageData(0, 0, canvas.width, canvas.height), 0, 0); + } else { + var gl = (_a = canvas.getContext("webgl2")) !== null && _a !== void 0 ? _a : canvas.getContext("webgl"); + if (gl) { + var attribs = gl.getContextAttributes(); + if ((attribs === null || attribs === void 0 ? void 0 : attribs.preserveDrawingBuffer) === false) { + this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false", canvas); + } + } + clonedCtx.drawImage(canvas, 0, 0); + } + } + return clonedCanvas; + } catch (e2) { + this.context.logger.info("Unable to clone canvas as it is tainted", canvas); + } + return clonedCanvas; + }; + DocumentCloner2.prototype.createVideoClone = function(video) { + var canvas = video.ownerDocument.createElement("canvas"); + canvas.width = video.offsetWidth; + canvas.height = video.offsetHeight; + var ctx = canvas.getContext("2d"); + try { + if (ctx) { + ctx.drawImage(video, 0, 0, canvas.width, canvas.height); + if (!this.options.allowTaint) { + ctx.getImageData(0, 0, canvas.width, canvas.height); + } + } + return canvas; + } catch (e2) { + this.context.logger.info("Unable to clone video as it is tainted", video); + } + var blankCanvas = video.ownerDocument.createElement("canvas"); + blankCanvas.width = video.offsetWidth; + blankCanvas.height = video.offsetHeight; + return blankCanvas; + }; + DocumentCloner2.prototype.appendChildNode = function(clone, child, copyStyles) { + if (!isElementNode(child) || !isScriptElement(child) && !child.hasAttribute(IGNORE_ATTRIBUTE) && (typeof this.options.ignoreElements !== "function" || !this.options.ignoreElements(child))) { + if (!this.options.copyStyles || !isElementNode(child) || !isStyleElement(child)) { + clone.appendChild(this.cloneNode(child, copyStyles)); + } + } + }; + DocumentCloner2.prototype.cloneChildNodes = function(node, clone, copyStyles) { + var _this = this; + for (var child = node.shadowRoot ? node.shadowRoot.firstChild : node.firstChild; child; child = child.nextSibling) { + if (isElementNode(child) && isSlotElement(child) && typeof child.assignedNodes === "function") { + var assignedNodes = child.assignedNodes(); + if (assignedNodes.length) { + assignedNodes.forEach(function(assignedNode) { + return _this.appendChildNode(clone, assignedNode, copyStyles); + }); + } + } else { + this.appendChildNode(clone, child, copyStyles); + } + } + }; + DocumentCloner2.prototype.cloneNode = function(node, copyStyles) { + if (isTextNode(node)) { + return document.createTextNode(node.data); + } + if (!node.ownerDocument) { + return node.cloneNode(false); + } + var window2 = node.ownerDocument.defaultView; + if (window2 && isElementNode(node) && (isHTMLElementNode(node) || isSVGElementNode(node))) { + var clone = this.createElementClone(node); + clone.style.transitionProperty = "none"; + var style = window2.getComputedStyle(node); + var styleBefore = window2.getComputedStyle(node, ":before"); + var styleAfter = window2.getComputedStyle(node, ":after"); + if (this.referenceElement === node && isHTMLElementNode(clone)) { + this.clonedReferenceElement = clone; + } + if (isBodyElement(clone)) { + createPseudoHideStyles(clone); + } + var counters = this.counters.parse(new CSSParsedCounterDeclaration(this.context, style)); + var before = this.resolvePseudoContent(node, clone, styleBefore, PseudoElementType.BEFORE); + if (isCustomElement(node)) { + copyStyles = true; + } + if (!isVideoElement(node)) { + this.cloneChildNodes(node, clone, copyStyles); + } + if (before) { + clone.insertBefore(before, clone.firstChild); + } + var after = this.resolvePseudoContent(node, clone, styleAfter, PseudoElementType.AFTER); + if (after) { + clone.appendChild(after); + } + this.counters.pop(counters); + if (style && (this.options.copyStyles || isSVGElementNode(node)) && !isIFrameElement(node) || copyStyles) { + copyCSSStyles(style, clone); + } + if (node.scrollTop !== 0 || node.scrollLeft !== 0) { + this.scrolledElements.push([clone, node.scrollLeft, node.scrollTop]); + } + if ((isTextareaElement(node) || isSelectElement(node)) && (isTextareaElement(clone) || isSelectElement(clone))) { + clone.value = node.value; + } + return clone; + } + return node.cloneNode(false); + }; + DocumentCloner2.prototype.resolvePseudoContent = function(node, clone, style, pseudoElt) { + var _this = this; + if (!style) { + return; + } + var value = style.content; + var document2 = clone.ownerDocument; + if (!document2 || !value || value === "none" || value === "-moz-alt-content" || style.display === "none") { + return; + } + this.counters.parse(new CSSParsedCounterDeclaration(this.context, style)); + var declaration = new CSSParsedPseudoDeclaration(this.context, style); + var anonymousReplacedElement = document2.createElement("html2canvaspseudoelement"); + copyCSSStyles(style, anonymousReplacedElement); + declaration.content.forEach(function(token) { + if (token.type === 0) { + anonymousReplacedElement.appendChild(document2.createTextNode(token.value)); + } else if (token.type === 22) { + var img = document2.createElement("img"); + img.src = token.value; + img.style.opacity = "1"; + anonymousReplacedElement.appendChild(img); + } else if (token.type === 18) { + if (token.name === "attr") { + var attr2 = token.values.filter(isIdentToken); + if (attr2.length) { + anonymousReplacedElement.appendChild(document2.createTextNode(node.getAttribute(attr2[0].value) || "")); + } + } else if (token.name === "counter") { + var _a = token.values.filter(nonFunctionArgSeparator), counter = _a[0], counterStyle = _a[1]; + if (counter && isIdentToken(counter)) { + var counterState = _this.counters.getCounterValue(counter.value); + var counterType = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3; + anonymousReplacedElement.appendChild(document2.createTextNode(createCounterText(counterState, counterType, false))); + } + } else if (token.name === "counters") { + var _b = token.values.filter(nonFunctionArgSeparator), counter = _b[0], delim = _b[1], counterStyle = _b[2]; + if (counter && isIdentToken(counter)) { + var counterStates = _this.counters.getCounterValues(counter.value); + var counterType_1 = counterStyle && isIdentToken(counterStyle) ? listStyleType.parse(_this.context, counterStyle.value) : 3; + var separator = delim && delim.type === 0 ? delim.value : ""; + var text = counterStates.map(function(value2) { + return createCounterText(value2, counterType_1, false); + }).join(separator); + anonymousReplacedElement.appendChild(document2.createTextNode(text)); + } + } else ; + } else if (token.type === 20) { + switch (token.value) { + case "open-quote": + anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, _this.quoteDepth++, true))); + break; + case "close-quote": + anonymousReplacedElement.appendChild(document2.createTextNode(getQuote(declaration.quotes, --_this.quoteDepth, false))); + break; + default: + anonymousReplacedElement.appendChild(document2.createTextNode(token.value)); + } + } + }); + anonymousReplacedElement.className = PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER; + var newClassName = pseudoElt === PseudoElementType.BEFORE ? " " + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE : " " + PSEUDO_HIDE_ELEMENT_CLASS_AFTER; + if (isSVGElementNode(clone)) { + clone.className.baseValue += newClassName; + } else { + clone.className += newClassName; + } + return anonymousReplacedElement; + }; + DocumentCloner2.destroy = function(container) { + if (container.parentNode) { + container.parentNode.removeChild(container); + return true; + } + return false; + }; + return DocumentCloner2; + })() + ); + var PseudoElementType; + (function(PseudoElementType2) { + PseudoElementType2[PseudoElementType2["BEFORE"] = 0] = "BEFORE"; + PseudoElementType2[PseudoElementType2["AFTER"] = 1] = "AFTER"; + })(PseudoElementType || (PseudoElementType = {})); + var createIFrameContainer = function(ownerDocument, bounds) { + var cloneIframeContainer = ownerDocument.createElement("iframe"); + cloneIframeContainer.className = "html2canvas-container"; + cloneIframeContainer.style.visibility = "hidden"; + cloneIframeContainer.style.position = "fixed"; + cloneIframeContainer.style.left = "-10000px"; + cloneIframeContainer.style.top = "0px"; + cloneIframeContainer.style.border = "0"; + cloneIframeContainer.width = bounds.width.toString(); + cloneIframeContainer.height = bounds.height.toString(); + cloneIframeContainer.scrolling = "no"; + cloneIframeContainer.setAttribute(IGNORE_ATTRIBUTE, "true"); + ownerDocument.body.appendChild(cloneIframeContainer); + return cloneIframeContainer; + }; + var imageReady = function(img) { + return new Promise(function(resolve) { + if (img.complete) { + resolve(); + return; + } + if (!img.src) { + resolve(); + return; + } + img.onload = resolve; + img.onerror = resolve; + }); + }; + var imagesReady = function(document2) { + return Promise.all([].slice.call(document2.images, 0).map(imageReady)); + }; + var iframeLoader = function(iframe) { + return new Promise(function(resolve, reject) { + var cloneWindow = iframe.contentWindow; + if (!cloneWindow) { + return reject("No window assigned for iframe"); + } + var documentClone = cloneWindow.document; + cloneWindow.onload = iframe.onload = function() { + cloneWindow.onload = iframe.onload = null; + var interval = setInterval(function() { + if (documentClone.body.childNodes.length > 0 && documentClone.readyState === "complete") { + clearInterval(interval); + resolve(iframe); + } + }, 50); + }; + }); + }; + var ignoredStyleProperties = [ + "all", + "d", + "content" + // Safari shows pseudoelements if content is set + ]; + var copyCSSStyles = function(style, target) { + for (var i2 = style.length - 1; i2 >= 0; i2--) { + var property = style.item(i2); + if (ignoredStyleProperties.indexOf(property) === -1) { + target.style.setProperty(property, style.getPropertyValue(property)); + } + } + return target; + }; + var serializeDoctype = function(doctype) { + var str = ""; + if (doctype) { + str += ""; + } + return str; + }; + var restoreOwnerScroll = function(ownerDocument, x, y) { + if (ownerDocument && ownerDocument.defaultView && (x !== ownerDocument.defaultView.pageXOffset || y !== ownerDocument.defaultView.pageYOffset)) { + ownerDocument.defaultView.scrollTo(x, y); + } + }; + var restoreNodeScroll = function(_a) { + var element = _a[0], x = _a[1], y = _a[2]; + element.scrollLeft = x; + element.scrollTop = y; + }; + var PSEUDO_BEFORE = ":before"; + var PSEUDO_AFTER = ":after"; + var PSEUDO_HIDE_ELEMENT_CLASS_BEFORE = "___html2canvas___pseudoelement_before"; + var PSEUDO_HIDE_ELEMENT_CLASS_AFTER = "___html2canvas___pseudoelement_after"; + var PSEUDO_HIDE_ELEMENT_STYLE = '{\n content: "" !important;\n display: none !important;\n}'; + var createPseudoHideStyles = function(body) { + createStyles(body, "." + PSEUDO_HIDE_ELEMENT_CLASS_BEFORE + PSEUDO_BEFORE + PSEUDO_HIDE_ELEMENT_STYLE + "\n ." + PSEUDO_HIDE_ELEMENT_CLASS_AFTER + PSEUDO_AFTER + PSEUDO_HIDE_ELEMENT_STYLE); + }; + var createStyles = function(body, styles) { + var document2 = body.ownerDocument; + if (document2) { + var style = document2.createElement("style"); + style.textContent = styles; + body.appendChild(style); + } + }; + var CacheStorage = ( + /** @class */ + (function() { + function CacheStorage2() { + } + CacheStorage2.getOrigin = function(url) { + var link = CacheStorage2._link; + if (!link) { + return "about:blank"; + } + link.href = url; + link.href = link.href; + return link.protocol + link.hostname + link.port; + }; + CacheStorage2.isSameOrigin = function(src) { + return CacheStorage2.getOrigin(src) === CacheStorage2._origin; + }; + CacheStorage2.setContext = function(window2) { + CacheStorage2._link = window2.document.createElement("a"); + CacheStorage2._origin = CacheStorage2.getOrigin(window2.location.href); + }; + CacheStorage2._origin = "about:blank"; + return CacheStorage2; + })() + ); + var Cache = ( + /** @class */ + (function() { + function Cache2(context, _options) { + this.context = context; + this._options = _options; + this._cache = {}; + } + Cache2.prototype.addImage = function(src) { + var result = Promise.resolve(); + if (this.has(src)) { + return result; + } + if (isBlobImage(src) || isRenderable(src)) { + (this._cache[src] = this.loadImage(src)).catch(function() { + }); + return result; + } + return result; + }; + Cache2.prototype.match = function(src) { + return this._cache[src]; + }; + Cache2.prototype.loadImage = function(key) { + return __awaiter(this, void 0, void 0, function() { + var isSameOrigin, useCORS, useProxy, src; + var _this = this; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + isSameOrigin = CacheStorage.isSameOrigin(key); + useCORS = !isInlineImage(key) && this._options.useCORS === true && FEATURES.SUPPORT_CORS_IMAGES && !isSameOrigin; + useProxy = !isInlineImage(key) && !isSameOrigin && !isBlobImage(key) && typeof this._options.proxy === "string" && FEATURES.SUPPORT_CORS_XHR && !useCORS; + if (!isSameOrigin && this._options.allowTaint === false && !isInlineImage(key) && !isBlobImage(key) && !useProxy && !useCORS) { + return [ + 2 + /*return*/ + ]; + } + src = key; + if (!useProxy) return [3, 2]; + return [4, this.proxy(src)]; + case 1: + src = _a.sent(); + _a.label = 2; + case 2: + this.context.logger.debug("Added image " + key.substring(0, 256)); + return [4, new Promise(function(resolve, reject) { + var img = new Image(); + img.onload = function() { + return resolve(img); + }; + img.onerror = reject; + if (isInlineBase64Image(src) || useCORS) { + img.crossOrigin = "anonymous"; + } + img.src = src; + if (img.complete === true) { + setTimeout(function() { + return resolve(img); + }, 500); + } + if (_this._options.imageTimeout > 0) { + setTimeout(function() { + return reject("Timed out (" + _this._options.imageTimeout + "ms) loading image"); + }, _this._options.imageTimeout); + } + })]; + case 3: + return [2, _a.sent()]; + } + }); + }); + }; + Cache2.prototype.has = function(key) { + return typeof this._cache[key] !== "undefined"; + }; + Cache2.prototype.keys = function() { + return Promise.resolve(Object.keys(this._cache)); + }; + Cache2.prototype.proxy = function(src) { + var _this = this; + var proxy = this._options.proxy; + if (!proxy) { + throw new Error("No proxy defined"); + } + var key = src.substring(0, 256); + return new Promise(function(resolve, reject) { + var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text"; + var xhr = new XMLHttpRequest(); + xhr.onload = function() { + if (xhr.status === 200) { + if (responseType === "text") { + resolve(xhr.response); + } else { + var reader_1 = new FileReader(); + reader_1.addEventListener("load", function() { + return resolve(reader_1.result); + }, false); + reader_1.addEventListener("error", function(e2) { + return reject(e2); + }, false); + reader_1.readAsDataURL(xhr.response); + } + } else { + reject("Failed to proxy resource " + key + " with status code " + xhr.status); + } + }; + xhr.onerror = reject; + var queryString = proxy.indexOf("?") > -1 ? "&" : "?"; + xhr.open("GET", "" + proxy + queryString + "url=" + encodeURIComponent(src) + "&responseType=" + responseType); + if (responseType !== "text" && xhr instanceof XMLHttpRequest) { + xhr.responseType = responseType; + } + if (_this._options.imageTimeout) { + var timeout_1 = _this._options.imageTimeout; + xhr.timeout = timeout_1; + xhr.ontimeout = function() { + return reject("Timed out (" + timeout_1 + "ms) proxying " + key); + }; + } + xhr.send(); + }); + }; + return Cache2; + })() + ); + var INLINE_SVG = /^data:image\/svg\+xml/i; + var INLINE_BASE64 = /^data:image\/.*;base64,/i; + var INLINE_IMG = /^data:image\/.*/i; + var isRenderable = function(src) { + return FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src); + }; + var isInlineImage = function(src) { + return INLINE_IMG.test(src); + }; + var isInlineBase64Image = function(src) { + return INLINE_BASE64.test(src); + }; + var isBlobImage = function(src) { + return src.substr(0, 4) === "blob"; + }; + var isSVG = function(src) { + return src.substr(-3).toLowerCase() === "svg" || INLINE_SVG.test(src); + }; + var Vector = ( + /** @class */ + (function() { + function Vector2(x, y) { + this.type = 0; + this.x = x; + this.y = y; + } + Vector2.prototype.add = function(deltaX, deltaY) { + return new Vector2(this.x + deltaX, this.y + deltaY); + }; + return Vector2; + })() + ); + var lerp = function(a2, b, t) { + return new Vector(a2.x + (b.x - a2.x) * t, a2.y + (b.y - a2.y) * t); + }; + var BezierCurve = ( + /** @class */ + (function() { + function BezierCurve2(start, startControl, endControl, end) { + this.type = 1; + this.start = start; + this.startControl = startControl; + this.endControl = endControl; + this.end = end; + } + BezierCurve2.prototype.subdivide = function(t, firstHalf) { + var ab = lerp(this.start, this.startControl, t); + var bc = lerp(this.startControl, this.endControl, t); + var cd = lerp(this.endControl, this.end, t); + var abbc = lerp(ab, bc, t); + var bccd = lerp(bc, cd, t); + var dest = lerp(abbc, bccd, t); + return firstHalf ? new BezierCurve2(this.start, ab, abbc, dest) : new BezierCurve2(dest, bccd, cd, this.end); + }; + BezierCurve2.prototype.add = function(deltaX, deltaY) { + return new BezierCurve2(this.start.add(deltaX, deltaY), this.startControl.add(deltaX, deltaY), this.endControl.add(deltaX, deltaY), this.end.add(deltaX, deltaY)); + }; + BezierCurve2.prototype.reverse = function() { + return new BezierCurve2(this.end, this.endControl, this.startControl, this.start); + }; + return BezierCurve2; + })() + ); + var isBezierCurve = function(path) { + return path.type === 1; + }; + var BoundCurves = ( + /** @class */ + /* @__PURE__ */ (function() { + function BoundCurves2(element) { + var styles = element.styles; + var bounds = element.bounds; + var _a = getAbsoluteValueForTuple(styles.borderTopLeftRadius, bounds.width, bounds.height), tlh = _a[0], tlv = _a[1]; + var _b = getAbsoluteValueForTuple(styles.borderTopRightRadius, bounds.width, bounds.height), trh = _b[0], trv = _b[1]; + var _c = getAbsoluteValueForTuple(styles.borderBottomRightRadius, bounds.width, bounds.height), brh = _c[0], brv = _c[1]; + var _d = getAbsoluteValueForTuple(styles.borderBottomLeftRadius, bounds.width, bounds.height), blh = _d[0], blv = _d[1]; + var factors = []; + factors.push((tlh + trh) / bounds.width); + factors.push((blh + brh) / bounds.width); + factors.push((tlv + blv) / bounds.height); + factors.push((trv + brv) / bounds.height); + var maxFactor = Math.max.apply(Math, factors); + if (maxFactor > 1) { + tlh /= maxFactor; + tlv /= maxFactor; + trh /= maxFactor; + trv /= maxFactor; + brh /= maxFactor; + brv /= maxFactor; + blh /= maxFactor; + blv /= maxFactor; + } + var topWidth = bounds.width - trh; + var rightHeight = bounds.height - brv; + var bottomWidth = bounds.width - brh; + var leftHeight = bounds.height - blv; + var borderTopWidth2 = styles.borderTopWidth; + var borderRightWidth2 = styles.borderRightWidth; + var borderBottomWidth2 = styles.borderBottomWidth; + var borderLeftWidth2 = styles.borderLeftWidth; + var paddingTop2 = getAbsoluteValue(styles.paddingTop, element.bounds.width); + var paddingRight2 = getAbsoluteValue(styles.paddingRight, element.bounds.width); + var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, element.bounds.width); + var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, element.bounds.width); + this.topLeftBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 3, bounds.top + borderTopWidth2 / 3, tlh - borderLeftWidth2 / 3, tlv - borderTopWidth2 / 3, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 3, bounds.top + borderTopWidth2 / 3); + this.topRightBorderDoubleOuterBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 / 3, trh - borderRightWidth2 / 3, trv - borderTopWidth2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 3, bounds.top + borderTopWidth2 / 3); + this.bottomRightBorderDoubleOuterBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 / 3, brv - borderBottomWidth2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 3, bounds.top + bounds.height - borderBottomWidth2 / 3); + this.bottomLeftBorderDoubleOuterBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 3, bounds.top + leftHeight, blh - borderLeftWidth2 / 3, blv - borderBottomWidth2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 3, bounds.top + bounds.height - borderBottomWidth2 / 3); + this.topLeftBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3, tlh - borderLeftWidth2 * 2 / 3, tlv - borderTopWidth2 * 2 / 3, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3); + this.topRightBorderDoubleInnerBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 * 2 / 3, trh - borderRightWidth2 * 2 / 3, trv - borderTopWidth2 * 2 / 3, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 * 2 / 3, bounds.top + borderTopWidth2 * 2 / 3); + this.bottomRightBorderDoubleInnerBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 * 2 / 3, brv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 * 2 / 3, bounds.top + bounds.height - borderBottomWidth2 * 2 / 3); + this.bottomLeftBorderDoubleInnerBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + leftHeight, blh - borderLeftWidth2 * 2 / 3, blv - borderBottomWidth2 * 2 / 3, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 * 2 / 3, bounds.top + bounds.height - borderBottomWidth2 * 2 / 3); + this.topLeftBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 2, bounds.top + borderTopWidth2 / 2, tlh - borderLeftWidth2 / 2, tlv - borderTopWidth2 / 2, CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 2, bounds.top + borderTopWidth2 / 2); + this.topRightBorderStroke = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top + borderTopWidth2 / 2, trh - borderRightWidth2 / 2, trv - borderTopWidth2 / 2, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 2, bounds.top + borderTopWidth2 / 2); + this.bottomRightBorderStroke = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh - borderRightWidth2 / 2, brv - borderBottomWidth2 / 2, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2 / 2, bounds.top + bounds.height - borderBottomWidth2 / 2); + this.bottomLeftBorderStroke = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 / 2, bounds.top + leftHeight, blh - borderLeftWidth2 / 2, blv - borderBottomWidth2 / 2, CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 / 2, bounds.top + bounds.height - borderBottomWidth2 / 2); + this.topLeftBorderBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left, bounds.top, tlh, tlv, CORNER.TOP_LEFT) : new Vector(bounds.left, bounds.top); + this.topRightBorderBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + topWidth, bounds.top, trh, trv, CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top); + this.bottomRightBorderBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + bottomWidth, bounds.top + rightHeight, brh, brv, CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width, bounds.top + bounds.height); + this.bottomLeftBorderBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left, bounds.top + leftHeight, blh, blv, CORNER.BOTTOM_LEFT) : new Vector(bounds.left, bounds.top + bounds.height); + this.topLeftPaddingBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2, Math.max(0, tlh - borderLeftWidth2), Math.max(0, tlv - borderTopWidth2), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + borderTopWidth2); + this.topRightPaddingBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width - borderRightWidth2), bounds.top + borderTopWidth2, topWidth > bounds.width + borderRightWidth2 ? 0 : Math.max(0, trh - borderRightWidth2), Math.max(0, trv - borderTopWidth2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + borderTopWidth2); + this.bottomRightPaddingBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - borderLeftWidth2), bounds.top + Math.min(rightHeight, bounds.height - borderBottomWidth2), Math.max(0, brh - borderRightWidth2), Math.max(0, brv - borderBottomWidth2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - borderRightWidth2, bounds.top + bounds.height - borderBottomWidth2); + this.bottomLeftPaddingBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2, bounds.top + Math.min(leftHeight, bounds.height - borderBottomWidth2), Math.max(0, blh - borderLeftWidth2), Math.max(0, blv - borderBottomWidth2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2, bounds.top + bounds.height - borderBottomWidth2); + this.topLeftContentBox = tlh > 0 || tlv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2, Math.max(0, tlh - (borderLeftWidth2 + paddingLeft2)), Math.max(0, tlv - (borderTopWidth2 + paddingTop2)), CORNER.TOP_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + borderTopWidth2 + paddingTop2); + this.topRightContentBox = trh > 0 || trv > 0 ? getCurvePoints(bounds.left + Math.min(topWidth, bounds.width + borderLeftWidth2 + paddingLeft2), bounds.top + borderTopWidth2 + paddingTop2, topWidth > bounds.width + borderLeftWidth2 + paddingLeft2 ? 0 : trh - borderLeftWidth2 + paddingLeft2, trv - (borderTopWidth2 + paddingTop2), CORNER.TOP_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + borderTopWidth2 + paddingTop2); + this.bottomRightContentBox = brh > 0 || brv > 0 ? getCurvePoints(bounds.left + Math.min(bottomWidth, bounds.width - (borderLeftWidth2 + paddingLeft2)), bounds.top + Math.min(rightHeight, bounds.height + borderTopWidth2 + paddingTop2), Math.max(0, brh - (borderRightWidth2 + paddingRight2)), brv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_RIGHT) : new Vector(bounds.left + bounds.width - (borderRightWidth2 + paddingRight2), bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2)); + this.bottomLeftContentBox = blh > 0 || blv > 0 ? getCurvePoints(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + leftHeight, Math.max(0, blh - (borderLeftWidth2 + paddingLeft2)), blv - (borderBottomWidth2 + paddingBottom2), CORNER.BOTTOM_LEFT) : new Vector(bounds.left + borderLeftWidth2 + paddingLeft2, bounds.top + bounds.height - (borderBottomWidth2 + paddingBottom2)); + } + return BoundCurves2; + })() + ); + var CORNER; + (function(CORNER2) { + CORNER2[CORNER2["TOP_LEFT"] = 0] = "TOP_LEFT"; + CORNER2[CORNER2["TOP_RIGHT"] = 1] = "TOP_RIGHT"; + CORNER2[CORNER2["BOTTOM_RIGHT"] = 2] = "BOTTOM_RIGHT"; + CORNER2[CORNER2["BOTTOM_LEFT"] = 3] = "BOTTOM_LEFT"; + })(CORNER || (CORNER = {})); + var getCurvePoints = function(x, y, r1, r2, position2) { + var kappa = 4 * ((Math.sqrt(2) - 1) / 3); + var ox = r1 * kappa; + var oy = r2 * kappa; + var xm = x + r1; + var ym = y + r2; + switch (position2) { + case CORNER.TOP_LEFT: + return new BezierCurve(new Vector(x, ym), new Vector(x, ym - oy), new Vector(xm - ox, y), new Vector(xm, y)); + case CORNER.TOP_RIGHT: + return new BezierCurve(new Vector(x, y), new Vector(x + ox, y), new Vector(xm, ym - oy), new Vector(xm, ym)); + case CORNER.BOTTOM_RIGHT: + return new BezierCurve(new Vector(xm, y), new Vector(xm, y + oy), new Vector(x + ox, ym), new Vector(x, ym)); + case CORNER.BOTTOM_LEFT: + default: + return new BezierCurve(new Vector(xm, ym), new Vector(xm - ox, ym), new Vector(x, y + oy), new Vector(x, y)); + } + }; + var calculateBorderBoxPath = function(curves) { + return [curves.topLeftBorderBox, curves.topRightBorderBox, curves.bottomRightBorderBox, curves.bottomLeftBorderBox]; + }; + var calculateContentBoxPath = function(curves) { + return [ + curves.topLeftContentBox, + curves.topRightContentBox, + curves.bottomRightContentBox, + curves.bottomLeftContentBox + ]; + }; + var calculatePaddingBoxPath = function(curves) { + return [ + curves.topLeftPaddingBox, + curves.topRightPaddingBox, + curves.bottomRightPaddingBox, + curves.bottomLeftPaddingBox + ]; + }; + var TransformEffect = ( + /** @class */ + /* @__PURE__ */ (function() { + function TransformEffect2(offsetX, offsetY, matrix2) { + this.offsetX = offsetX; + this.offsetY = offsetY; + this.matrix = matrix2; + this.type = 0; + this.target = 2 | 4; + } + return TransformEffect2; + })() + ); + var ClipEffect = ( + /** @class */ + /* @__PURE__ */ (function() { + function ClipEffect2(path, target) { + this.path = path; + this.target = target; + this.type = 1; + } + return ClipEffect2; + })() + ); + var OpacityEffect = ( + /** @class */ + /* @__PURE__ */ (function() { + function OpacityEffect2(opacity2) { + this.opacity = opacity2; + this.type = 2; + this.target = 2 | 4; + } + return OpacityEffect2; + })() + ); + var isTransformEffect = function(effect) { + return effect.type === 0; + }; + var isClipEffect = function(effect) { + return effect.type === 1; + }; + var isOpacityEffect = function(effect) { + return effect.type === 2; + }; + var equalPath = function(a2, b) { + if (a2.length === b.length) { + return a2.some(function(v, i2) { + return v === b[i2]; + }); + } + return false; + }; + var transformPath = function(path, deltaX, deltaY, deltaW, deltaH) { + return path.map(function(point, index) { + switch (index) { + case 0: + return point.add(deltaX, deltaY); + case 1: + return point.add(deltaX + deltaW, deltaY); + case 2: + return point.add(deltaX + deltaW, deltaY + deltaH); + case 3: + return point.add(deltaX, deltaY + deltaH); + } + return point; + }); + }; + var StackingContext = ( + /** @class */ + /* @__PURE__ */ (function() { + function StackingContext2(container) { + this.element = container; + this.inlineLevel = []; + this.nonInlineLevel = []; + this.negativeZIndex = []; + this.zeroOrAutoZIndexOrTransformedOrOpacity = []; + this.positiveZIndex = []; + this.nonPositionedFloats = []; + this.nonPositionedInlineLevel = []; + } + return StackingContext2; + })() + ); + var ElementPaint = ( + /** @class */ + (function() { + function ElementPaint2(container, parent) { + this.container = container; + this.parent = parent; + this.effects = []; + this.curves = new BoundCurves(this.container); + if (this.container.styles.opacity < 1) { + this.effects.push(new OpacityEffect(this.container.styles.opacity)); + } + if (this.container.styles.transform !== null) { + var offsetX = this.container.bounds.left + this.container.styles.transformOrigin[0].number; + var offsetY = this.container.bounds.top + this.container.styles.transformOrigin[1].number; + var matrix2 = this.container.styles.transform; + this.effects.push(new TransformEffect(offsetX, offsetY, matrix2)); + } + if (this.container.styles.overflowX !== 0) { + var borderBox = calculateBorderBoxPath(this.curves); + var paddingBox2 = calculatePaddingBoxPath(this.curves); + if (equalPath(borderBox, paddingBox2)) { + this.effects.push(new ClipEffect( + borderBox, + 2 | 4 + /* CONTENT */ + )); + } else { + this.effects.push(new ClipEffect( + borderBox, + 2 + /* BACKGROUND_BORDERS */ + )); + this.effects.push(new ClipEffect( + paddingBox2, + 4 + /* CONTENT */ + )); + } + } + } + ElementPaint2.prototype.getEffects = function(target) { + var inFlow = [ + 2, + 3 + /* FIXED */ + ].indexOf(this.container.styles.position) === -1; + var parent = this.parent; + var effects = this.effects.slice(0); + while (parent) { + var croplessEffects = parent.effects.filter(function(effect) { + return !isClipEffect(effect); + }); + if (inFlow || parent.container.styles.position !== 0 || !parent.parent) { + effects.unshift.apply(effects, croplessEffects); + inFlow = [ + 2, + 3 + /* FIXED */ + ].indexOf(parent.container.styles.position) === -1; + if (parent.container.styles.overflowX !== 0) { + var borderBox = calculateBorderBoxPath(parent.curves); + var paddingBox2 = calculatePaddingBoxPath(parent.curves); + if (!equalPath(borderBox, paddingBox2)) { + effects.unshift(new ClipEffect( + paddingBox2, + 2 | 4 + /* CONTENT */ + )); + } + } + } else { + effects.unshift.apply(effects, croplessEffects); + } + parent = parent.parent; + } + return effects.filter(function(effect) { + return contains(effect.target, target); + }); + }; + return ElementPaint2; + })() + ); + var parseStackTree = function(parent, stackingContext, realStackingContext, listItems) { + parent.container.elements.forEach(function(child) { + var treatAsRealStackingContext = contains( + child.flags, + 4 + /* CREATES_REAL_STACKING_CONTEXT */ + ); + var createsStackingContext2 = contains( + child.flags, + 2 + /* CREATES_STACKING_CONTEXT */ + ); + var paintContainer = new ElementPaint(child, parent); + if (contains( + child.styles.display, + 2048 + /* LIST_ITEM */ + )) { + listItems.push(paintContainer); + } + var listOwnerItems = contains( + child.flags, + 8 + /* IS_LIST_OWNER */ + ) ? [] : listItems; + if (treatAsRealStackingContext || createsStackingContext2) { + var parentStack = treatAsRealStackingContext || child.styles.isPositioned() ? realStackingContext : stackingContext; + var stack = new StackingContext(paintContainer); + if (child.styles.isPositioned() || child.styles.opacity < 1 || child.styles.isTransformed()) { + var order_1 = child.styles.zIndex.order; + if (order_1 < 0) { + var index_1 = 0; + parentStack.negativeZIndex.some(function(current, i2) { + if (order_1 > current.element.container.styles.zIndex.order) { + index_1 = i2; + return false; + } else if (index_1 > 0) { + return true; + } + return false; + }); + parentStack.negativeZIndex.splice(index_1, 0, stack); + } else if (order_1 > 0) { + var index_2 = 0; + parentStack.positiveZIndex.some(function(current, i2) { + if (order_1 >= current.element.container.styles.zIndex.order) { + index_2 = i2 + 1; + return false; + } else if (index_2 > 0) { + return true; + } + return false; + }); + parentStack.positiveZIndex.splice(index_2, 0, stack); + } else { + parentStack.zeroOrAutoZIndexOrTransformedOrOpacity.push(stack); + } + } else { + if (child.styles.isFloating()) { + parentStack.nonPositionedFloats.push(stack); + } else { + parentStack.nonPositionedInlineLevel.push(stack); + } + } + parseStackTree(paintContainer, stack, treatAsRealStackingContext ? stack : realStackingContext, listOwnerItems); + } else { + if (child.styles.isInlineLevel()) { + stackingContext.inlineLevel.push(paintContainer); + } else { + stackingContext.nonInlineLevel.push(paintContainer); + } + parseStackTree(paintContainer, stackingContext, realStackingContext, listOwnerItems); + } + if (contains( + child.flags, + 8 + /* IS_LIST_OWNER */ + )) { + processListItems(child, listOwnerItems); + } + }); + }; + var processListItems = function(owner, elements2) { + var numbering = owner instanceof OLElementContainer ? owner.start : 1; + var reversed = owner instanceof OLElementContainer ? owner.reversed : false; + for (var i2 = 0; i2 < elements2.length; i2++) { + var item = elements2[i2]; + if (item.container instanceof LIElementContainer && typeof item.container.value === "number" && item.container.value !== 0) { + numbering = item.container.value; + } + item.listValue = createCounterText(numbering, item.container.styles.listStyleType, true); + numbering += reversed ? -1 : 1; + } + }; + var parseStackingContexts = function(container) { + var paintContainer = new ElementPaint(container, null); + var root = new StackingContext(paintContainer); + var listItems = []; + parseStackTree(paintContainer, root, root, listItems); + processListItems(paintContainer.container, listItems); + return root; + }; + var parsePathForBorder = function(curves, borderSide) { + switch (borderSide) { + case 0: + return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftPaddingBox, curves.topRightBorderBox, curves.topRightPaddingBox); + case 1: + return createPathFromCurves(curves.topRightBorderBox, curves.topRightPaddingBox, curves.bottomRightBorderBox, curves.bottomRightPaddingBox); + case 2: + return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox); + case 3: + default: + return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftPaddingBox, curves.topLeftBorderBox, curves.topLeftPaddingBox); + } + }; + var parsePathForBorderDoubleOuter = function(curves, borderSide) { + switch (borderSide) { + case 0: + return createPathFromCurves(curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox, curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox); + case 1: + return createPathFromCurves(curves.topRightBorderBox, curves.topRightBorderDoubleOuterBox, curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox); + case 2: + return createPathFromCurves(curves.bottomRightBorderBox, curves.bottomRightBorderDoubleOuterBox, curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox); + case 3: + default: + return createPathFromCurves(curves.bottomLeftBorderBox, curves.bottomLeftBorderDoubleOuterBox, curves.topLeftBorderBox, curves.topLeftBorderDoubleOuterBox); + } + }; + var parsePathForBorderDoubleInner = function(curves, borderSide) { + switch (borderSide) { + case 0: + return createPathFromCurves(curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox, curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox); + case 1: + return createPathFromCurves(curves.topRightBorderDoubleInnerBox, curves.topRightPaddingBox, curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox); + case 2: + return createPathFromCurves(curves.bottomRightBorderDoubleInnerBox, curves.bottomRightPaddingBox, curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox); + case 3: + default: + return createPathFromCurves(curves.bottomLeftBorderDoubleInnerBox, curves.bottomLeftPaddingBox, curves.topLeftBorderDoubleInnerBox, curves.topLeftPaddingBox); + } + }; + var parsePathForBorderStroke = function(curves, borderSide) { + switch (borderSide) { + case 0: + return createStrokePathFromCurves(curves.topLeftBorderStroke, curves.topRightBorderStroke); + case 1: + return createStrokePathFromCurves(curves.topRightBorderStroke, curves.bottomRightBorderStroke); + case 2: + return createStrokePathFromCurves(curves.bottomRightBorderStroke, curves.bottomLeftBorderStroke); + case 3: + default: + return createStrokePathFromCurves(curves.bottomLeftBorderStroke, curves.topLeftBorderStroke); + } + }; + var createStrokePathFromCurves = function(outer1, outer2) { + var path = []; + if (isBezierCurve(outer1)) { + path.push(outer1.subdivide(0.5, false)); + } else { + path.push(outer1); + } + if (isBezierCurve(outer2)) { + path.push(outer2.subdivide(0.5, true)); + } else { + path.push(outer2); + } + return path; + }; + var createPathFromCurves = function(outer1, inner1, outer2, inner2) { + var path = []; + if (isBezierCurve(outer1)) { + path.push(outer1.subdivide(0.5, false)); + } else { + path.push(outer1); + } + if (isBezierCurve(outer2)) { + path.push(outer2.subdivide(0.5, true)); + } else { + path.push(outer2); + } + if (isBezierCurve(inner2)) { + path.push(inner2.subdivide(0.5, true).reverse()); + } else { + path.push(inner2); + } + if (isBezierCurve(inner1)) { + path.push(inner1.subdivide(0.5, false).reverse()); + } else { + path.push(inner1); + } + return path; + }; + var paddingBox = function(element) { + var bounds = element.bounds; + var styles = element.styles; + return bounds.add(styles.borderLeftWidth, styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth), -(styles.borderTopWidth + styles.borderBottomWidth)); + }; + var contentBox = function(element) { + var styles = element.styles; + var bounds = element.bounds; + var paddingLeft2 = getAbsoluteValue(styles.paddingLeft, bounds.width); + var paddingRight2 = getAbsoluteValue(styles.paddingRight, bounds.width); + var paddingTop2 = getAbsoluteValue(styles.paddingTop, bounds.width); + var paddingBottom2 = getAbsoluteValue(styles.paddingBottom, bounds.width); + return bounds.add(paddingLeft2 + styles.borderLeftWidth, paddingTop2 + styles.borderTopWidth, -(styles.borderRightWidth + styles.borderLeftWidth + paddingLeft2 + paddingRight2), -(styles.borderTopWidth + styles.borderBottomWidth + paddingTop2 + paddingBottom2)); + }; + var calculateBackgroundPositioningArea = function(backgroundOrigin2, element) { + if (backgroundOrigin2 === 0) { + return element.bounds; + } + if (backgroundOrigin2 === 2) { + return contentBox(element); + } + return paddingBox(element); + }; + var calculateBackgroundPaintingArea = function(backgroundClip2, element) { + if (backgroundClip2 === 0) { + return element.bounds; + } + if (backgroundClip2 === 2) { + return contentBox(element); + } + return paddingBox(element); + }; + var calculateBackgroundRendering = function(container, index, intrinsicSize) { + var backgroundPositioningArea = calculateBackgroundPositioningArea(getBackgroundValueForIndex(container.styles.backgroundOrigin, index), container); + var backgroundPaintingArea = calculateBackgroundPaintingArea(getBackgroundValueForIndex(container.styles.backgroundClip, index), container); + var backgroundImageSize = calculateBackgroundSize(getBackgroundValueForIndex(container.styles.backgroundSize, index), intrinsicSize, backgroundPositioningArea); + var sizeWidth = backgroundImageSize[0], sizeHeight = backgroundImageSize[1]; + var position2 = getAbsoluteValueForTuple(getBackgroundValueForIndex(container.styles.backgroundPosition, index), backgroundPositioningArea.width - sizeWidth, backgroundPositioningArea.height - sizeHeight); + var path = calculateBackgroundRepeatPath(getBackgroundValueForIndex(container.styles.backgroundRepeat, index), position2, backgroundImageSize, backgroundPositioningArea, backgroundPaintingArea); + var offsetX = Math.round(backgroundPositioningArea.left + position2[0]); + var offsetY = Math.round(backgroundPositioningArea.top + position2[1]); + return [path, offsetX, offsetY, sizeWidth, sizeHeight]; + }; + var isAuto = function(token) { + return isIdentToken(token) && token.value === BACKGROUND_SIZE.AUTO; + }; + var hasIntrinsicValue = function(value) { + return typeof value === "number"; + }; + var calculateBackgroundSize = function(size, _a, bounds) { + var intrinsicWidth = _a[0], intrinsicHeight = _a[1], intrinsicProportion = _a[2]; + var first = size[0], second = size[1]; + if (!first) { + return [0, 0]; + } + if (isLengthPercentage(first) && second && isLengthPercentage(second)) { + return [getAbsoluteValue(first, bounds.width), getAbsoluteValue(second, bounds.height)]; + } + var hasIntrinsicProportion = hasIntrinsicValue(intrinsicProportion); + if (isIdentToken(first) && (first.value === BACKGROUND_SIZE.CONTAIN || first.value === BACKGROUND_SIZE.COVER)) { + if (hasIntrinsicValue(intrinsicProportion)) { + var targetRatio = bounds.width / bounds.height; + return targetRatio < intrinsicProportion !== (first.value === BACKGROUND_SIZE.COVER) ? [bounds.width, bounds.width / intrinsicProportion] : [bounds.height * intrinsicProportion, bounds.height]; + } + return [bounds.width, bounds.height]; + } + var hasIntrinsicWidth = hasIntrinsicValue(intrinsicWidth); + var hasIntrinsicHeight = hasIntrinsicValue(intrinsicHeight); + var hasIntrinsicDimensions = hasIntrinsicWidth || hasIntrinsicHeight; + if (isAuto(first) && (!second || isAuto(second))) { + if (hasIntrinsicWidth && hasIntrinsicHeight) { + return [intrinsicWidth, intrinsicHeight]; + } + if (!hasIntrinsicProportion && !hasIntrinsicDimensions) { + return [bounds.width, bounds.height]; + } + if (hasIntrinsicDimensions && hasIntrinsicProportion) { + var width_1 = hasIntrinsicWidth ? intrinsicWidth : intrinsicHeight * intrinsicProportion; + var height_1 = hasIntrinsicHeight ? intrinsicHeight : intrinsicWidth / intrinsicProportion; + return [width_1, height_1]; + } + var width_2 = hasIntrinsicWidth ? intrinsicWidth : bounds.width; + var height_2 = hasIntrinsicHeight ? intrinsicHeight : bounds.height; + return [width_2, height_2]; + } + if (hasIntrinsicProportion) { + var width_3 = 0; + var height_3 = 0; + if (isLengthPercentage(first)) { + width_3 = getAbsoluteValue(first, bounds.width); + } else if (isLengthPercentage(second)) { + height_3 = getAbsoluteValue(second, bounds.height); + } + if (isAuto(first)) { + width_3 = height_3 * intrinsicProportion; + } else if (!second || isAuto(second)) { + height_3 = width_3 / intrinsicProportion; + } + return [width_3, height_3]; + } + var width = null; + var height = null; + if (isLengthPercentage(first)) { + width = getAbsoluteValue(first, bounds.width); + } else if (second && isLengthPercentage(second)) { + height = getAbsoluteValue(second, bounds.height); + } + if (width !== null && (!second || isAuto(second))) { + height = hasIntrinsicWidth && hasIntrinsicHeight ? width / intrinsicWidth * intrinsicHeight : bounds.height; + } + if (height !== null && isAuto(first)) { + width = hasIntrinsicWidth && hasIntrinsicHeight ? height / intrinsicHeight * intrinsicWidth : bounds.width; + } + if (width !== null && height !== null) { + return [width, height]; + } + throw new Error("Unable to calculate background-size for element"); + }; + var getBackgroundValueForIndex = function(values, index) { + var value = values[index]; + if (typeof value === "undefined") { + return values[0]; + } + return value; + }; + var calculateBackgroundRepeatPath = function(repeat2, _a, _b, backgroundPositioningArea, backgroundPaintingArea) { + var x = _a[0], y = _a[1]; + var width = _b[0], height = _b[1]; + switch (repeat2) { + case 2: + return [ + new Vector(Math.round(backgroundPositioningArea.left), Math.round(backgroundPositioningArea.top + y)), + new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(backgroundPositioningArea.top + y)), + new Vector(Math.round(backgroundPositioningArea.left + backgroundPositioningArea.width), Math.round(height + backgroundPositioningArea.top + y)), + new Vector(Math.round(backgroundPositioningArea.left), Math.round(height + backgroundPositioningArea.top + y)) + ]; + case 3: + return [ + new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top)), + new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top)), + new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)), + new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.height + backgroundPositioningArea.top)) + ]; + case 1: + return [ + new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y)), + new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y)), + new Vector(Math.round(backgroundPositioningArea.left + x + width), Math.round(backgroundPositioningArea.top + y + height)), + new Vector(Math.round(backgroundPositioningArea.left + x), Math.round(backgroundPositioningArea.top + y + height)) + ]; + default: + return [ + new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.top)), + new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.top)), + new Vector(Math.round(backgroundPaintingArea.left + backgroundPaintingArea.width), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)), + new Vector(Math.round(backgroundPaintingArea.left), Math.round(backgroundPaintingArea.height + backgroundPaintingArea.top)) + ]; + } + }; + var SMALL_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"; + var SAMPLE_TEXT = "Hidden Text"; + var FontMetrics = ( + /** @class */ + (function() { + function FontMetrics2(document2) { + this._data = {}; + this._document = document2; + } + FontMetrics2.prototype.parseMetrics = function(fontFamily3, fontSize2) { + var container = this._document.createElement("div"); + var img = this._document.createElement("img"); + var span = this._document.createElement("span"); + var body = this._document.body; + container.style.visibility = "hidden"; + container.style.fontFamily = fontFamily3; + container.style.fontSize = fontSize2; + container.style.margin = "0"; + container.style.padding = "0"; + container.style.whiteSpace = "nowrap"; + body.appendChild(container); + img.src = SMALL_IMAGE; + img.width = 1; + img.height = 1; + img.style.margin = "0"; + img.style.padding = "0"; + img.style.verticalAlign = "baseline"; + span.style.fontFamily = fontFamily3; + span.style.fontSize = fontSize2; + span.style.margin = "0"; + span.style.padding = "0"; + span.appendChild(this._document.createTextNode(SAMPLE_TEXT)); + container.appendChild(span); + container.appendChild(img); + var baseline = img.offsetTop - span.offsetTop + 2; + container.removeChild(span); + container.appendChild(this._document.createTextNode(SAMPLE_TEXT)); + container.style.lineHeight = "normal"; + img.style.verticalAlign = "super"; + var middle = img.offsetTop - container.offsetTop + 2; + body.removeChild(container); + return { baseline, middle }; + }; + FontMetrics2.prototype.getMetrics = function(fontFamily3, fontSize2) { + var key = fontFamily3 + " " + fontSize2; + if (typeof this._data[key] === "undefined") { + this._data[key] = this.parseMetrics(fontFamily3, fontSize2); + } + return this._data[key]; + }; + return FontMetrics2; + })() + ); + var Renderer = ( + /** @class */ + /* @__PURE__ */ (function() { + function Renderer2(context, options) { + this.context = context; + this.options = options; + } + return Renderer2; + })() + ); + var MASK_OFFSET = 1e4; + var CanvasRenderer = ( + /** @class */ + (function(_super) { + __extends(CanvasRenderer2, _super); + function CanvasRenderer2(context, options) { + var _this = _super.call(this, context, options) || this; + _this._activeEffects = []; + _this.canvas = options.canvas ? options.canvas : document.createElement("canvas"); + _this.ctx = _this.canvas.getContext("2d"); + if (!options.canvas) { + _this.canvas.width = Math.floor(options.width * options.scale); + _this.canvas.height = Math.floor(options.height * options.scale); + _this.canvas.style.width = options.width + "px"; + _this.canvas.style.height = options.height + "px"; + } + _this.fontMetrics = new FontMetrics(document); + _this.ctx.scale(_this.options.scale, _this.options.scale); + _this.ctx.translate(-options.x, -options.y); + _this.ctx.textBaseline = "bottom"; + _this._activeEffects = []; + _this.context.logger.debug("Canvas renderer initialized (" + options.width + "x" + options.height + ") with scale " + options.scale); + return _this; + } + CanvasRenderer2.prototype.applyEffects = function(effects) { + var _this = this; + while (this._activeEffects.length) { + this.popEffect(); + } + effects.forEach(function(effect) { + return _this.applyEffect(effect); + }); + }; + CanvasRenderer2.prototype.applyEffect = function(effect) { + this.ctx.save(); + if (isOpacityEffect(effect)) { + this.ctx.globalAlpha = effect.opacity; + } + if (isTransformEffect(effect)) { + this.ctx.translate(effect.offsetX, effect.offsetY); + this.ctx.transform(effect.matrix[0], effect.matrix[1], effect.matrix[2], effect.matrix[3], effect.matrix[4], effect.matrix[5]); + this.ctx.translate(-effect.offsetX, -effect.offsetY); + } + if (isClipEffect(effect)) { + this.path(effect.path); + this.ctx.clip(); + } + this._activeEffects.push(effect); + }; + CanvasRenderer2.prototype.popEffect = function() { + this._activeEffects.pop(); + this.ctx.restore(); + }; + CanvasRenderer2.prototype.renderStack = function(stack) { + return __awaiter(this, void 0, void 0, function() { + var styles; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + styles = stack.element.container.styles; + if (!styles.isVisible()) return [3, 2]; + return [4, this.renderStackContent(stack)]; + case 1: + _a.sent(); + _a.label = 2; + case 2: + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.renderNode = function(paint) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + if (contains( + paint.container.flags, + 16 + /* DEBUG_RENDER */ + )) { + debugger; + } + if (!paint.container.styles.isVisible()) return [3, 3]; + return [4, this.renderNodeBackgroundAndBorders(paint)]; + case 1: + _a.sent(); + return [4, this.renderNodeContent(paint)]; + case 2: + _a.sent(); + _a.label = 3; + case 3: + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.renderTextWithLetterSpacing = function(text, letterSpacing2, baseline) { + var _this = this; + if (letterSpacing2 === 0) { + this.ctx.fillText(text.text, text.bounds.left, text.bounds.top + baseline); + } else { + var letters = segmentGraphemes(text.text); + letters.reduce(function(left, letter) { + _this.ctx.fillText(letter, left, text.bounds.top + baseline); + return left + _this.ctx.measureText(letter).width; + }, text.bounds.left); + } + }; + CanvasRenderer2.prototype.createFontStyle = function(styles) { + var fontVariant2 = styles.fontVariant.filter(function(variant) { + return variant === "normal" || variant === "small-caps"; + }).join(""); + var fontFamily3 = fixIOSSystemFonts(styles.fontFamily).join(", "); + var fontSize2 = isDimensionToken(styles.fontSize) ? "" + styles.fontSize.number + styles.fontSize.unit : styles.fontSize.number + "px"; + return [ + [styles.fontStyle, fontVariant2, styles.fontWeight, fontSize2, fontFamily3].join(" "), + fontFamily3, + fontSize2 + ]; + }; + CanvasRenderer2.prototype.renderTextNode = function(text, styles) { + return __awaiter(this, void 0, void 0, function() { + var _a, font, fontFamily3, fontSize2, _b, baseline, middle, paintOrder2; + var _this = this; + return __generator(this, function(_c) { + _a = this.createFontStyle(styles), font = _a[0], fontFamily3 = _a[1], fontSize2 = _a[2]; + this.ctx.font = font; + this.ctx.direction = styles.direction === 1 ? "rtl" : "ltr"; + this.ctx.textAlign = "left"; + this.ctx.textBaseline = "alphabetic"; + _b = this.fontMetrics.getMetrics(fontFamily3, fontSize2), baseline = _b.baseline, middle = _b.middle; + paintOrder2 = styles.paintOrder; + text.textBounds.forEach(function(text2) { + paintOrder2.forEach(function(paintOrderLayer) { + switch (paintOrderLayer) { + case 0: + _this.ctx.fillStyle = asString(styles.color); + _this.renderTextWithLetterSpacing(text2, styles.letterSpacing, baseline); + var textShadows = styles.textShadow; + if (textShadows.length && text2.text.trim().length) { + textShadows.slice(0).reverse().forEach(function(textShadow2) { + _this.ctx.shadowColor = asString(textShadow2.color); + _this.ctx.shadowOffsetX = textShadow2.offsetX.number * _this.options.scale; + _this.ctx.shadowOffsetY = textShadow2.offsetY.number * _this.options.scale; + _this.ctx.shadowBlur = textShadow2.blur.number; + _this.renderTextWithLetterSpacing(text2, styles.letterSpacing, baseline); + }); + _this.ctx.shadowColor = ""; + _this.ctx.shadowOffsetX = 0; + _this.ctx.shadowOffsetY = 0; + _this.ctx.shadowBlur = 0; + } + if (styles.textDecorationLine.length) { + _this.ctx.fillStyle = asString(styles.textDecorationColor || styles.color); + styles.textDecorationLine.forEach(function(textDecorationLine2) { + switch (textDecorationLine2) { + case 1: + _this.ctx.fillRect(text2.bounds.left, Math.round(text2.bounds.top + baseline), text2.bounds.width, 1); + break; + case 2: + _this.ctx.fillRect(text2.bounds.left, Math.round(text2.bounds.top), text2.bounds.width, 1); + break; + case 3: + _this.ctx.fillRect(text2.bounds.left, Math.ceil(text2.bounds.top + middle), text2.bounds.width, 1); + break; + } + }); + } + break; + case 1: + if (styles.webkitTextStrokeWidth && text2.text.trim().length) { + _this.ctx.strokeStyle = asString(styles.webkitTextStrokeColor); + _this.ctx.lineWidth = styles.webkitTextStrokeWidth; + _this.ctx.lineJoin = !!window.chrome ? "miter" : "round"; + _this.ctx.strokeText(text2.text, text2.bounds.left, text2.bounds.top + baseline); + } + _this.ctx.strokeStyle = ""; + _this.ctx.lineWidth = 0; + _this.ctx.lineJoin = "miter"; + break; + } + }); + }); + return [ + 2 + /*return*/ + ]; + }); + }); + }; + CanvasRenderer2.prototype.renderReplacedElement = function(container, curves, image2) { + if (image2 && container.intrinsicWidth > 0 && container.intrinsicHeight > 0) { + var box = contentBox(container); + var path = calculatePaddingBoxPath(curves); + this.path(path); + this.ctx.save(); + this.ctx.clip(); + this.ctx.drawImage(image2, 0, 0, container.intrinsicWidth, container.intrinsicHeight, box.left, box.top, box.width, box.height); + this.ctx.restore(); + } + }; + CanvasRenderer2.prototype.renderNodeContent = function(paint) { + return __awaiter(this, void 0, void 0, function() { + var container, curves, styles, _i, _a, child, image2, image2, iframeRenderer, canvas, size, _b, fontFamily3, fontSize2, baseline, bounds, x, textBounds, img, image2, url, fontFamily3, bounds; + return __generator(this, function(_c) { + switch (_c.label) { + case 0: + this.applyEffects(paint.getEffects( + 4 + /* CONTENT */ + )); + container = paint.container; + curves = paint.curves; + styles = container.styles; + _i = 0, _a = container.textNodes; + _c.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + child = _a[_i]; + return [4, this.renderTextNode(child, styles)]; + case 2: + _c.sent(); + _c.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: + if (!(container instanceof ImageElementContainer)) return [3, 8]; + _c.label = 5; + case 5: + _c.trys.push([5, 7, , 8]); + return [4, this.context.cache.match(container.src)]; + case 6: + image2 = _c.sent(); + this.renderReplacedElement(container, curves, image2); + return [3, 8]; + case 7: + _c.sent(); + this.context.logger.error("Error loading image " + container.src); + return [3, 8]; + case 8: + if (container instanceof CanvasElementContainer) { + this.renderReplacedElement(container, curves, container.canvas); + } + if (!(container instanceof SVGElementContainer)) return [3, 12]; + _c.label = 9; + case 9: + _c.trys.push([9, 11, , 12]); + return [4, this.context.cache.match(container.svg)]; + case 10: + image2 = _c.sent(); + this.renderReplacedElement(container, curves, image2); + return [3, 12]; + case 11: + _c.sent(); + this.context.logger.error("Error loading svg " + container.svg.substring(0, 255)); + return [3, 12]; + case 12: + if (!(container instanceof IFrameElementContainer && container.tree)) return [3, 14]; + iframeRenderer = new CanvasRenderer2(this.context, { + scale: this.options.scale, + backgroundColor: container.backgroundColor, + x: 0, + y: 0, + width: container.width, + height: container.height + }); + return [4, iframeRenderer.render(container.tree)]; + case 13: + canvas = _c.sent(); + if (container.width && container.height) { + this.ctx.drawImage(canvas, 0, 0, container.width, container.height, container.bounds.left, container.bounds.top, container.bounds.width, container.bounds.height); + } + _c.label = 14; + case 14: + if (container instanceof InputElementContainer) { + size = Math.min(container.bounds.width, container.bounds.height); + if (container.type === CHECKBOX) { + if (container.checked) { + this.ctx.save(); + this.path([ + new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79), + new Vector(container.bounds.left + size * 0.16, container.bounds.top + size * 0.5549), + new Vector(container.bounds.left + size * 0.27347, container.bounds.top + size * 0.44071), + new Vector(container.bounds.left + size * 0.39694, container.bounds.top + size * 0.5649), + new Vector(container.bounds.left + size * 0.72983, container.bounds.top + size * 0.23), + new Vector(container.bounds.left + size * 0.84, container.bounds.top + size * 0.34085), + new Vector(container.bounds.left + size * 0.39363, container.bounds.top + size * 0.79) + ]); + this.ctx.fillStyle = asString(INPUT_COLOR); + this.ctx.fill(); + this.ctx.restore(); + } + } else if (container.type === RADIO) { + if (container.checked) { + this.ctx.save(); + this.ctx.beginPath(); + this.ctx.arc(container.bounds.left + size / 2, container.bounds.top + size / 2, size / 4, 0, Math.PI * 2, true); + this.ctx.fillStyle = asString(INPUT_COLOR); + this.ctx.fill(); + this.ctx.restore(); + } + } + } + if (isTextInputElement(container) && container.value.length) { + _b = this.createFontStyle(styles), fontFamily3 = _b[0], fontSize2 = _b[1]; + baseline = this.fontMetrics.getMetrics(fontFamily3, fontSize2).baseline; + this.ctx.font = fontFamily3; + this.ctx.fillStyle = asString(styles.color); + this.ctx.textBaseline = "alphabetic"; + this.ctx.textAlign = canvasTextAlign(container.styles.textAlign); + bounds = contentBox(container); + x = 0; + switch (container.styles.textAlign) { + case 1: + x += bounds.width / 2; + break; + case 2: + x += bounds.width; + break; + } + textBounds = bounds.add(x, 0, 0, -bounds.height / 2 + 1); + this.ctx.save(); + this.path([ + new Vector(bounds.left, bounds.top), + new Vector(bounds.left + bounds.width, bounds.top), + new Vector(bounds.left + bounds.width, bounds.top + bounds.height), + new Vector(bounds.left, bounds.top + bounds.height) + ]); + this.ctx.clip(); + this.renderTextWithLetterSpacing(new TextBounds(container.value, textBounds), styles.letterSpacing, baseline); + this.ctx.restore(); + this.ctx.textBaseline = "alphabetic"; + this.ctx.textAlign = "left"; + } + if (!contains( + container.styles.display, + 2048 + /* LIST_ITEM */ + )) return [3, 20]; + if (!(container.styles.listStyleImage !== null)) return [3, 19]; + img = container.styles.listStyleImage; + if (!(img.type === 0)) return [3, 18]; + image2 = void 0; + url = img.url; + _c.label = 15; + case 15: + _c.trys.push([15, 17, , 18]); + return [4, this.context.cache.match(url)]; + case 16: + image2 = _c.sent(); + this.ctx.drawImage(image2, container.bounds.left - (image2.width + 10), container.bounds.top); + return [3, 18]; + case 17: + _c.sent(); + this.context.logger.error("Error loading list-style-image " + url); + return [3, 18]; + case 18: + return [3, 20]; + case 19: + if (paint.listValue && container.styles.listStyleType !== -1) { + fontFamily3 = this.createFontStyle(styles)[0]; + this.ctx.font = fontFamily3; + this.ctx.fillStyle = asString(styles.color); + this.ctx.textBaseline = "middle"; + this.ctx.textAlign = "right"; + bounds = new Bounds(container.bounds.left, container.bounds.top + getAbsoluteValue(container.styles.paddingTop, container.bounds.width), container.bounds.width, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 1); + this.renderTextWithLetterSpacing(new TextBounds(paint.listValue, bounds), styles.letterSpacing, computeLineHeight(styles.lineHeight, styles.fontSize.number) / 2 + 2); + this.ctx.textBaseline = "bottom"; + this.ctx.textAlign = "left"; + } + _c.label = 20; + case 20: + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.renderStackContent = function(stack) { + return __awaiter(this, void 0, void 0, function() { + var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child; + return __generator(this, function(_p) { + switch (_p.label) { + case 0: + if (contains( + stack.element.container.flags, + 16 + /* DEBUG_RENDER */ + )) { + debugger; + } + return [4, this.renderNodeBackgroundAndBorders(stack.element)]; + case 1: + _p.sent(); + _i = 0, _a = stack.negativeZIndex; + _p.label = 2; + case 2: + if (!(_i < _a.length)) return [3, 5]; + child = _a[_i]; + return [4, this.renderStack(child)]; + case 3: + _p.sent(); + _p.label = 4; + case 4: + _i++; + return [3, 2]; + case 5: + return [4, this.renderNodeContent(stack.element)]; + case 6: + _p.sent(); + _b = 0, _c = stack.nonInlineLevel; + _p.label = 7; + case 7: + if (!(_b < _c.length)) return [3, 10]; + child = _c[_b]; + return [4, this.renderNode(child)]; + case 8: + _p.sent(); + _p.label = 9; + case 9: + _b++; + return [3, 7]; + case 10: + _d = 0, _e = stack.nonPositionedFloats; + _p.label = 11; + case 11: + if (!(_d < _e.length)) return [3, 14]; + child = _e[_d]; + return [4, this.renderStack(child)]; + case 12: + _p.sent(); + _p.label = 13; + case 13: + _d++; + return [3, 11]; + case 14: + _f = 0, _g = stack.nonPositionedInlineLevel; + _p.label = 15; + case 15: + if (!(_f < _g.length)) return [3, 18]; + child = _g[_f]; + return [4, this.renderStack(child)]; + case 16: + _p.sent(); + _p.label = 17; + case 17: + _f++; + return [3, 15]; + case 18: + _h = 0, _j = stack.inlineLevel; + _p.label = 19; + case 19: + if (!(_h < _j.length)) return [3, 22]; + child = _j[_h]; + return [4, this.renderNode(child)]; + case 20: + _p.sent(); + _p.label = 21; + case 21: + _h++; + return [3, 19]; + case 22: + _k = 0, _l = stack.zeroOrAutoZIndexOrTransformedOrOpacity; + _p.label = 23; + case 23: + if (!(_k < _l.length)) return [3, 26]; + child = _l[_k]; + return [4, this.renderStack(child)]; + case 24: + _p.sent(); + _p.label = 25; + case 25: + _k++; + return [3, 23]; + case 26: + _m = 0, _o = stack.positiveZIndex; + _p.label = 27; + case 27: + if (!(_m < _o.length)) return [3, 30]; + child = _o[_m]; + return [4, this.renderStack(child)]; + case 28: + _p.sent(); + _p.label = 29; + case 29: + _m++; + return [3, 27]; + case 30: + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.mask = function(paths) { + this.ctx.beginPath(); + this.ctx.moveTo(0, 0); + this.ctx.lineTo(this.canvas.width, 0); + this.ctx.lineTo(this.canvas.width, this.canvas.height); + this.ctx.lineTo(0, this.canvas.height); + this.ctx.lineTo(0, 0); + this.formatPath(paths.slice(0).reverse()); + this.ctx.closePath(); + }; + CanvasRenderer2.prototype.path = function(paths) { + this.ctx.beginPath(); + this.formatPath(paths); + this.ctx.closePath(); + }; + CanvasRenderer2.prototype.formatPath = function(paths) { + var _this = this; + paths.forEach(function(point, index) { + var start = isBezierCurve(point) ? point.start : point; + if (index === 0) { + _this.ctx.moveTo(start.x, start.y); + } else { + _this.ctx.lineTo(start.x, start.y); + } + if (isBezierCurve(point)) { + _this.ctx.bezierCurveTo(point.startControl.x, point.startControl.y, point.endControl.x, point.endControl.y, point.end.x, point.end.y); + } + }); + }; + CanvasRenderer2.prototype.renderRepeat = function(path, pattern, offsetX, offsetY) { + this.path(path); + this.ctx.fillStyle = pattern; + this.ctx.translate(offsetX, offsetY); + this.ctx.fill(); + this.ctx.translate(-offsetX, -offsetY); + }; + CanvasRenderer2.prototype.resizeImage = function(image2, width, height) { + var _a; + if (image2.width === width && image2.height === height) { + return image2; + } + var ownerDocument = (_a = this.canvas.ownerDocument) !== null && _a !== void 0 ? _a : document; + var canvas = ownerDocument.createElement("canvas"); + canvas.width = Math.max(1, width); + canvas.height = Math.max(1, height); + var ctx = canvas.getContext("2d"); + ctx.drawImage(image2, 0, 0, image2.width, image2.height, 0, 0, width, height); + return canvas; + }; + CanvasRenderer2.prototype.renderBackgroundImage = function(container) { + return __awaiter(this, void 0, void 0, function() { + var index, _loop_1, this_1, _i, _a, backgroundImage2; + return __generator(this, function(_b) { + switch (_b.label) { + case 0: + index = container.styles.backgroundImage.length - 1; + _loop_1 = function(backgroundImage3) { + var image2, url, _c, path, x, y, width, height, pattern, _d, path, x, y, width, height, _e, lineLength, x0, x1, y0, y1, canvas, ctx, gradient_1, pattern, _f, path, left, top_1, width, height, position2, x, y, _g, rx, ry, radialGradient_1, midX, midY, f2, invF; + return __generator(this, function(_h) { + switch (_h.label) { + case 0: + if (!(backgroundImage3.type === 0)) return [3, 5]; + image2 = void 0; + url = backgroundImage3.url; + _h.label = 1; + case 1: + _h.trys.push([1, 3, , 4]); + return [4, this_1.context.cache.match(url)]; + case 2: + image2 = _h.sent(); + return [3, 4]; + case 3: + _h.sent(); + this_1.context.logger.error("Error loading background-image " + url); + return [3, 4]; + case 4: + if (image2) { + _c = calculateBackgroundRendering(container, index, [ + image2.width, + image2.height, + image2.width / image2.height + ]), path = _c[0], x = _c[1], y = _c[2], width = _c[3], height = _c[4]; + pattern = this_1.ctx.createPattern(this_1.resizeImage(image2, width, height), "repeat"); + this_1.renderRepeat(path, pattern, x, y); + } + return [3, 6]; + case 5: + if (isLinearGradient(backgroundImage3)) { + _d = calculateBackgroundRendering(container, index, [null, null, null]), path = _d[0], x = _d[1], y = _d[2], width = _d[3], height = _d[4]; + _e = calculateGradientDirection(backgroundImage3.angle, width, height), lineLength = _e[0], x0 = _e[1], x1 = _e[2], y0 = _e[3], y1 = _e[4]; + canvas = document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + ctx = canvas.getContext("2d"); + gradient_1 = ctx.createLinearGradient(x0, y0, x1, y1); + processColorStops(backgroundImage3.stops, lineLength).forEach(function(colorStop) { + return gradient_1.addColorStop(colorStop.stop, asString(colorStop.color)); + }); + ctx.fillStyle = gradient_1; + ctx.fillRect(0, 0, width, height); + if (width > 0 && height > 0) { + pattern = this_1.ctx.createPattern(canvas, "repeat"); + this_1.renderRepeat(path, pattern, x, y); + } + } else if (isRadialGradient(backgroundImage3)) { + _f = calculateBackgroundRendering(container, index, [ + null, + null, + null + ]), path = _f[0], left = _f[1], top_1 = _f[2], width = _f[3], height = _f[4]; + position2 = backgroundImage3.position.length === 0 ? [FIFTY_PERCENT] : backgroundImage3.position; + x = getAbsoluteValue(position2[0], width); + y = getAbsoluteValue(position2[position2.length - 1], height); + _g = calculateRadius(backgroundImage3, x, y, width, height), rx = _g[0], ry = _g[1]; + if (rx > 0 && ry > 0) { + radialGradient_1 = this_1.ctx.createRadialGradient(left + x, top_1 + y, 0, left + x, top_1 + y, rx); + processColorStops(backgroundImage3.stops, rx * 2).forEach(function(colorStop) { + return radialGradient_1.addColorStop(colorStop.stop, asString(colorStop.color)); + }); + this_1.path(path); + this_1.ctx.fillStyle = radialGradient_1; + if (rx !== ry) { + midX = container.bounds.left + 0.5 * container.bounds.width; + midY = container.bounds.top + 0.5 * container.bounds.height; + f2 = ry / rx; + invF = 1 / f2; + this_1.ctx.save(); + this_1.ctx.translate(midX, midY); + this_1.ctx.transform(1, 0, 0, f2, 0, 0); + this_1.ctx.translate(-midX, -midY); + this_1.ctx.fillRect(left, invF * (top_1 - midY) + midY, width, height * invF); + this_1.ctx.restore(); + } else { + this_1.ctx.fill(); + } + } + } + _h.label = 6; + case 6: + index--; + return [ + 2 + /*return*/ + ]; + } + }); + }; + this_1 = this; + _i = 0, _a = container.styles.backgroundImage.slice(0).reverse(); + _b.label = 1; + case 1: + if (!(_i < _a.length)) return [3, 4]; + backgroundImage2 = _a[_i]; + return [5, _loop_1(backgroundImage2)]; + case 2: + _b.sent(); + _b.label = 3; + case 3: + _i++; + return [3, 1]; + case 4: + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.renderSolidBorder = function(color2, side, curvePoints) { + return __awaiter(this, void 0, void 0, function() { + return __generator(this, function(_a) { + this.path(parsePathForBorder(curvePoints, side)); + this.ctx.fillStyle = asString(color2); + this.ctx.fill(); + return [ + 2 + /*return*/ + ]; + }); + }); + }; + CanvasRenderer2.prototype.renderDoubleBorder = function(color2, width, side, curvePoints) { + return __awaiter(this, void 0, void 0, function() { + var outerPaths, innerPaths; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + if (!(width < 3)) return [3, 2]; + return [4, this.renderSolidBorder(color2, side, curvePoints)]; + case 1: + _a.sent(); + return [ + 2 + /*return*/ + ]; + case 2: + outerPaths = parsePathForBorderDoubleOuter(curvePoints, side); + this.path(outerPaths); + this.ctx.fillStyle = asString(color2); + this.ctx.fill(); + innerPaths = parsePathForBorderDoubleInner(curvePoints, side); + this.path(innerPaths); + this.ctx.fill(); + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.renderNodeBackgroundAndBorders = function(paint) { + return __awaiter(this, void 0, void 0, function() { + var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border; + var _this = this; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + this.applyEffects(paint.getEffects( + 2 + /* BACKGROUND_BORDERS */ + )); + styles = paint.container.styles; + hasBackground = !isTransparent(styles.backgroundColor) || styles.backgroundImage.length; + borders = [ + { style: styles.borderTopStyle, color: styles.borderTopColor, width: styles.borderTopWidth }, + { style: styles.borderRightStyle, color: styles.borderRightColor, width: styles.borderRightWidth }, + { style: styles.borderBottomStyle, color: styles.borderBottomColor, width: styles.borderBottomWidth }, + { style: styles.borderLeftStyle, color: styles.borderLeftColor, width: styles.borderLeftWidth } + ]; + backgroundPaintingArea = calculateBackgroundCurvedPaintingArea(getBackgroundValueForIndex(styles.backgroundClip, 0), paint.curves); + if (!(hasBackground || styles.boxShadow.length)) return [3, 2]; + this.ctx.save(); + this.path(backgroundPaintingArea); + this.ctx.clip(); + if (!isTransparent(styles.backgroundColor)) { + this.ctx.fillStyle = asString(styles.backgroundColor); + this.ctx.fill(); + } + return [4, this.renderBackgroundImage(paint.container)]; + case 1: + _a.sent(); + this.ctx.restore(); + styles.boxShadow.slice(0).reverse().forEach(function(shadow) { + _this.ctx.save(); + var borderBoxArea = calculateBorderBoxPath(paint.curves); + var maskOffset = shadow.inset ? 0 : MASK_OFFSET; + var shadowPaintingArea = transformPath(borderBoxArea, -maskOffset + (shadow.inset ? 1 : -1) * shadow.spread.number, (shadow.inset ? 1 : -1) * shadow.spread.number, shadow.spread.number * (shadow.inset ? -2 : 2), shadow.spread.number * (shadow.inset ? -2 : 2)); + if (shadow.inset) { + _this.path(borderBoxArea); + _this.ctx.clip(); + _this.mask(shadowPaintingArea); + } else { + _this.mask(borderBoxArea); + _this.ctx.clip(); + _this.path(shadowPaintingArea); + } + _this.ctx.shadowOffsetX = shadow.offsetX.number + maskOffset; + _this.ctx.shadowOffsetY = shadow.offsetY.number; + _this.ctx.shadowColor = asString(shadow.color); + _this.ctx.shadowBlur = shadow.blur.number; + _this.ctx.fillStyle = shadow.inset ? asString(shadow.color) : "rgba(0,0,0,1)"; + _this.ctx.fill(); + _this.ctx.restore(); + }); + _a.label = 2; + case 2: + side = 0; + _i = 0, borders_1 = borders; + _a.label = 3; + case 3: + if (!(_i < borders_1.length)) return [3, 13]; + border = borders_1[_i]; + if (!(border.style !== 0 && !isTransparent(border.color) && border.width > 0)) return [3, 11]; + if (!(border.style === 2)) return [3, 5]; + return [4, this.renderDashedDottedBorder( + border.color, + border.width, + side, + paint.curves, + 2 + /* DASHED */ + )]; + case 4: + _a.sent(); + return [3, 11]; + case 5: + if (!(border.style === 3)) return [3, 7]; + return [4, this.renderDashedDottedBorder( + border.color, + border.width, + side, + paint.curves, + 3 + /* DOTTED */ + )]; + case 6: + _a.sent(); + return [3, 11]; + case 7: + if (!(border.style === 4)) return [3, 9]; + return [4, this.renderDoubleBorder(border.color, border.width, side, paint.curves)]; + case 8: + _a.sent(); + return [3, 11]; + case 9: + return [4, this.renderSolidBorder(border.color, side, paint.curves)]; + case 10: + _a.sent(); + _a.label = 11; + case 11: + side++; + _a.label = 12; + case 12: + _i++; + return [3, 3]; + case 13: + return [ + 2 + /*return*/ + ]; + } + }); + }); + }; + CanvasRenderer2.prototype.renderDashedDottedBorder = function(color2, width, side, curvePoints, style) { + return __awaiter(this, void 0, void 0, function() { + var strokePaths, boxPaths, startX, startY, endX, endY, length, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2; + return __generator(this, function(_a) { + this.ctx.save(); + strokePaths = parsePathForBorderStroke(curvePoints, side); + boxPaths = parsePathForBorder(curvePoints, side); + if (style === 2) { + this.path(boxPaths); + this.ctx.clip(); + } + if (isBezierCurve(boxPaths[0])) { + startX = boxPaths[0].start.x; + startY = boxPaths[0].start.y; + } else { + startX = boxPaths[0].x; + startY = boxPaths[0].y; + } + if (isBezierCurve(boxPaths[1])) { + endX = boxPaths[1].end.x; + endY = boxPaths[1].end.y; + } else { + endX = boxPaths[1].x; + endY = boxPaths[1].y; + } + if (side === 0 || side === 2) { + length = Math.abs(startX - endX); + } else { + length = Math.abs(startY - endY); + } + this.ctx.beginPath(); + if (style === 3) { + this.formatPath(strokePaths); + } else { + this.formatPath(boxPaths.slice(0, 2)); + } + dashLength = width < 3 ? width * 3 : width * 2; + spaceLength = width < 3 ? width * 2 : width; + if (style === 3) { + dashLength = width; + spaceLength = width; + } + useLineDash = true; + if (length <= dashLength * 2) { + useLineDash = false; + } else if (length <= dashLength * 2 + spaceLength) { + multiplier = length / (2 * dashLength + spaceLength); + dashLength *= multiplier; + spaceLength *= multiplier; + } else { + numberOfDashes = Math.floor((length + spaceLength) / (dashLength + spaceLength)); + minSpace = (length - numberOfDashes * dashLength) / (numberOfDashes - 1); + maxSpace = (length - (numberOfDashes + 1) * dashLength) / numberOfDashes; + spaceLength = maxSpace <= 0 || Math.abs(spaceLength - minSpace) < Math.abs(spaceLength - maxSpace) ? minSpace : maxSpace; + } + if (useLineDash) { + if (style === 3) { + this.ctx.setLineDash([0, dashLength + spaceLength]); + } else { + this.ctx.setLineDash([dashLength, spaceLength]); + } + } + if (style === 3) { + this.ctx.lineCap = "round"; + this.ctx.lineWidth = width; + } else { + this.ctx.lineWidth = width * 2 + 1.1; + } + this.ctx.strokeStyle = asString(color2); + this.ctx.stroke(); + this.ctx.setLineDash([]); + if (style === 2) { + if (isBezierCurve(boxPaths[0])) { + path1 = boxPaths[3]; + path2 = boxPaths[0]; + this.ctx.beginPath(); + this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]); + this.ctx.stroke(); + } + if (isBezierCurve(boxPaths[1])) { + path1 = boxPaths[1]; + path2 = boxPaths[2]; + this.ctx.beginPath(); + this.formatPath([new Vector(path1.end.x, path1.end.y), new Vector(path2.start.x, path2.start.y)]); + this.ctx.stroke(); + } + } + this.ctx.restore(); + return [ + 2 + /*return*/ + ]; + }); + }); + }; + CanvasRenderer2.prototype.render = function(element) { + return __awaiter(this, void 0, void 0, function() { + var stack; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + if (this.options.backgroundColor) { + this.ctx.fillStyle = asString(this.options.backgroundColor); + this.ctx.fillRect(this.options.x, this.options.y, this.options.width, this.options.height); + } + stack = parseStackingContexts(element); + return [4, this.renderStack(stack)]; + case 1: + _a.sent(); + this.applyEffects([]); + return [2, this.canvas]; + } + }); + }); + }; + return CanvasRenderer2; + })(Renderer) + ); + var isTextInputElement = function(container) { + if (container instanceof TextareaElementContainer) { + return true; + } else if (container instanceof SelectElementContainer) { + return true; + } else if (container instanceof InputElementContainer && container.type !== RADIO && container.type !== CHECKBOX) { + return true; + } + return false; + }; + var calculateBackgroundCurvedPaintingArea = function(clip, curves) { + switch (clip) { + case 0: + return calculateBorderBoxPath(curves); + case 2: + return calculateContentBoxPath(curves); + case 1: + default: + return calculatePaddingBoxPath(curves); + } + }; + var canvasTextAlign = function(textAlign2) { + switch (textAlign2) { + case 1: + return "center"; + case 2: + return "right"; + case 0: + default: + return "left"; + } + }; + var iOSBrokenFonts = ["-apple-system", "system-ui"]; + var fixIOSSystemFonts = function(fontFamilies) { + return /iPhone OS 15_(0|1)/.test(window.navigator.userAgent) ? fontFamilies.filter(function(fontFamily3) { + return iOSBrokenFonts.indexOf(fontFamily3) === -1; + }) : fontFamilies; + }; + var ForeignObjectRenderer = ( + /** @class */ + (function(_super) { + __extends(ForeignObjectRenderer2, _super); + function ForeignObjectRenderer2(context, options) { + var _this = _super.call(this, context, options) || this; + _this.canvas = options.canvas ? options.canvas : document.createElement("canvas"); + _this.ctx = _this.canvas.getContext("2d"); + _this.options = options; + _this.canvas.width = Math.floor(options.width * options.scale); + _this.canvas.height = Math.floor(options.height * options.scale); + _this.canvas.style.width = options.width + "px"; + _this.canvas.style.height = options.height + "px"; + _this.ctx.scale(_this.options.scale, _this.options.scale); + _this.ctx.translate(-options.x, -options.y); + _this.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized (" + options.width + "x" + options.height + " at " + options.x + "," + options.y + ") with scale " + options.scale); + return _this; + } + ForeignObjectRenderer2.prototype.render = function(element) { + return __awaiter(this, void 0, void 0, function() { + var svg, img; + return __generator(this, function(_a) { + switch (_a.label) { + case 0: + svg = createForeignObjectSVG(this.options.width * this.options.scale, this.options.height * this.options.scale, this.options.scale, this.options.scale, element); + return [4, loadSerializedSVG(svg)]; + case 1: + img = _a.sent(); + if (this.options.backgroundColor) { + this.ctx.fillStyle = asString(this.options.backgroundColor); + this.ctx.fillRect(0, 0, this.options.width * this.options.scale, this.options.height * this.options.scale); + } + this.ctx.drawImage(img, -this.options.x * this.options.scale, -this.options.y * this.options.scale); + return [2, this.canvas]; + } + }); + }); + }; + return ForeignObjectRenderer2; + })(Renderer) + ); + var loadSerializedSVG = function(svg) { + return new Promise(function(resolve, reject) { + var img = new Image(); + img.onload = function() { + resolve(img); + }; + img.onerror = reject; + img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg)); + }); + }; + var Logger = ( + /** @class */ + (function() { + function Logger2(_a) { + var id = _a.id, enabled = _a.enabled; + this.id = id; + this.enabled = enabled; + this.start = Date.now(); + } + Logger2.prototype.debug = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (this.enabled) { + if (typeof window !== "undefined" && window.console && typeof console.debug === "function") { + console.debug.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args)); + } else { + this.info.apply(this, args); + } + } + }; + Logger2.prototype.getTime = function() { + return Date.now() - this.start; + }; + Logger2.prototype.info = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (this.enabled) { + if (typeof window !== "undefined" && window.console && typeof console.info === "function") { + console.info.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args)); + } + } + }; + Logger2.prototype.warn = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (this.enabled) { + if (typeof window !== "undefined" && window.console && typeof console.warn === "function") { + console.warn.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args)); + } else { + this.info.apply(this, args); + } + } + }; + Logger2.prototype.error = function() { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (this.enabled) { + if (typeof window !== "undefined" && window.console && typeof console.error === "function") { + console.error.apply(console, __spreadArray([this.id, this.getTime() + "ms"], args)); + } else { + this.info.apply(this, args); + } + } + }; + Logger2.instances = {}; + return Logger2; + })() + ); + var Context = ( + /** @class */ + (function() { + function Context2(options, windowBounds) { + var _a; + this.windowBounds = windowBounds; + this.instanceName = "#" + Context2.instanceCount++; + this.logger = new Logger({ id: this.instanceName, enabled: options.logging }); + this.cache = (_a = options.cache) !== null && _a !== void 0 ? _a : new Cache(this, options); + } + Context2.instanceCount = 1; + return Context2; + })() + ); + var html2canvas = function(element, options) { + if (options === void 0) { + options = {}; + } + return renderElement(element, options); + }; + if (typeof window !== "undefined") { + CacheStorage.setContext(window); + } + var renderElement = function(element, opts) { + return __awaiter(void 0, void 0, void 0, function() { + var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a, width, height, left, top, backgroundColor2, renderOptions, canvas, renderer, root, renderer; + var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; + return __generator(this, function(_u) { + switch (_u.label) { + case 0: + if (!element || typeof element !== "object") { + return [2, Promise.reject("Invalid element provided as first argument")]; + } + ownerDocument = element.ownerDocument; + if (!ownerDocument) { + throw new Error("Element is not attached to a Document"); + } + defaultView = ownerDocument.defaultView; + if (!defaultView) { + throw new Error("Document is not attached to a Window"); + } + resourceOptions = { + allowTaint: (_b = opts.allowTaint) !== null && _b !== void 0 ? _b : false, + imageTimeout: (_c = opts.imageTimeout) !== null && _c !== void 0 ? _c : 15e3, + proxy: opts.proxy, + useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false + }; + contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions); + windowOptions = { + windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth, + windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight, + scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset, + scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset + }; + windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight); + context = new Context(contextOptions, windowBounds); + foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false; + cloneOptions = { + allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false, + onclone: opts.onclone, + ignoreElements: opts.ignoreElements, + inlineImages: foreignObjectRendering, + copyStyles: foreignObjectRendering + }; + context.logger.debug("Starting document clone with size " + windowBounds.width + "x" + windowBounds.height + " scrolled to " + -windowBounds.left + "," + -windowBounds.top); + documentCloner = new DocumentCloner(context, element, cloneOptions); + clonedElement = documentCloner.clonedReferenceElement; + if (!clonedElement) { + return [2, Promise.reject("Unable to find element in cloned iframe")]; + } + return [4, documentCloner.toIFrame(ownerDocument, windowBounds)]; + case 1: + container = _u.sent(); + _a = isBodyElement(clonedElement) || isHTMLElement2(clonedElement) ? parseDocumentSize(clonedElement.ownerDocument) : parseBounds(context, clonedElement), width = _a.width, height = _a.height, left = _a.left, top = _a.top; + backgroundColor2 = parseBackgroundColor(context, clonedElement, opts.backgroundColor); + renderOptions = { + canvas: opts.canvas, + backgroundColor: backgroundColor2, + scale: (_o = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o !== void 0 ? _o : 1, + x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left, + y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top, + width: (_r = opts.width) !== null && _r !== void 0 ? _r : Math.ceil(width), + height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height) + }; + if (!foreignObjectRendering) return [3, 3]; + context.logger.debug("Document cloned, using foreign object rendering"); + renderer = new ForeignObjectRenderer(context, renderOptions); + return [4, renderer.render(clonedElement)]; + case 2: + canvas = _u.sent(); + return [3, 5]; + case 3: + context.logger.debug("Document cloned, element located at " + left + "," + top + " with size " + width + "x" + height + " using computed rendering"); + context.logger.debug("Starting DOM parsing"); + root = parseTree(context, clonedElement); + if (backgroundColor2 === root.styles.backgroundColor) { + root.styles.backgroundColor = COLORS.TRANSPARENT; + } + context.logger.debug("Starting renderer for element at " + renderOptions.x + "," + renderOptions.y + " with size " + renderOptions.width + "x" + renderOptions.height); + renderer = new CanvasRenderer(context, renderOptions); + return [4, renderer.render(root)]; + case 4: + canvas = _u.sent(); + _u.label = 5; + case 5: + if ((_t = opts.removeContainer) !== null && _t !== void 0 ? _t : true) { + if (!DocumentCloner.destroy(container)) { + context.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore"); + } + } + context.logger.debug("Finished rendering"); + return [2, canvas]; + } + }); + }); + }; + var parseBackgroundColor = function(context, element, backgroundColorOverride) { + var ownerDocument = element.ownerDocument; + var documentBackgroundColor = ownerDocument.documentElement ? parseColor(context, getComputedStyle(ownerDocument.documentElement).backgroundColor) : COLORS.TRANSPARENT; + var bodyBackgroundColor = ownerDocument.body ? parseColor(context, getComputedStyle(ownerDocument.body).backgroundColor) : COLORS.TRANSPARENT; + var defaultBackgroundColor = typeof backgroundColorOverride === "string" ? parseColor(context, backgroundColorOverride) : backgroundColorOverride === null ? COLORS.TRANSPARENT : 4294967295; + return element === ownerDocument.documentElement ? isTransparent(documentBackgroundColor) ? isTransparent(bodyBackgroundColor) ? defaultBackgroundColor : bodyBackgroundColor : documentBackgroundColor : defaultBackgroundColor; + }; + return html2canvas; + })); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/platform.js + function createMetadataLocator() { + const metadataLookup = /* @__PURE__ */ new WeakMap(); + return function(target) { + let metadata = metadataLookup.get(target); + if (metadata === void 0) { + let currentTarget = Reflect.getPrototypeOf(target); + while (metadata === void 0 && currentTarget !== null) { + metadata = metadataLookup.get(currentTarget); + currentTarget = Reflect.getPrototypeOf(currentTarget); + } + metadata = metadata === void 0 ? [] : metadata.slice(0); + metadataLookup.set(target, metadata); + } + return metadata; + }; + } + var $global, propConfig, FAST, emptyArray; + var init_platform = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/platform.js"() { + $global = (function() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + try { + return new Function("return this")(); + } catch (_a) { + return {}; + } + })(); + if ($global.trustedTypes === void 0) { + $global.trustedTypes = { createPolicy: (n, r) => r }; + } + propConfig = { + configurable: false, + enumerable: false, + writable: false + }; + if ($global.FAST === void 0) { + Reflect.defineProperty($global, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, propConfig)); + } + FAST = $global.FAST; + if (FAST.getById === void 0) { + const storage = /* @__PURE__ */ Object.create(null); + Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) { + let found = storage[id]; + if (found === void 0) { + found = initialize ? storage[id] = initialize() : null; + } + return found; + } }, propConfig)); + } + emptyArray = Object.freeze([]); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/dom.js + var updateQueue, fastHTMLPolicy, htmlPolicy, marker, _interpolationStart, _interpolationEnd, DOM; + var init_dom = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/dom.js"() { + init_platform(); + updateQueue = $global.FAST.getById(1, () => { + const tasks = []; + const pendingErrors = []; + function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } + } + function tryRunTask(task) { + try { + task.call(); + } catch (error) { + pendingErrors.push(error); + setTimeout(throwFirstError, 0); + } + } + function process() { + const capacity = 1024; + let index = 0; + while (index < tasks.length) { + tryRunTask(tasks[index]); + index++; + if (index > capacity) { + for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) { + tasks[scan] = tasks[scan + index]; + } + tasks.length -= index; + index = 0; + } + } + tasks.length = 0; + } + function enqueue(callable) { + if (tasks.length < 1) { + $global.requestAnimationFrame(process); + } + tasks.push(callable); + } + return Object.freeze({ + enqueue, + process + }); + }); + fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { + createHTML: (html2) => html2 + }); + htmlPolicy = fastHTMLPolicy; + marker = `fast-${Math.random().toString(36).substring(2, 8)}`; + _interpolationStart = `${marker}{`; + _interpolationEnd = `}${marker}`; + DOM = Object.freeze({ + /** + * Indicates whether the DOM supports the adoptedStyleSheets feature. + */ + supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, + /** + * Sets the HTML trusted types policy used by the templating engine. + * @param policy - The policy to set for HTML. + * @remarks + * This API can only be called once, for security reasons. It should be + * called by the application developer at the start of their program. + */ + setHTMLPolicy(policy) { + if (htmlPolicy !== fastHTMLPolicy) { + throw new Error("The HTML policy can only be set once."); + } + htmlPolicy = policy; + }, + /** + * Turns a string into trusted HTML using the configured trusted types policy. + * @param html - The string to turn into trusted HTML. + * @remarks + * Used internally by the template engine when creating templates + * and setting innerHTML. + */ + createHTML(html2) { + return htmlPolicy.createHTML(html2); + }, + /** + * Determines if the provided node is a template marker used by the runtime. + * @param node - The node to test. + */ + isMarker(node) { + return node && node.nodeType === 8 && node.data.startsWith(marker); + }, + /** + * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. + * @param node - The marker node to extract the index from. + */ + extractDirectiveIndexFromMarker(node) { + return parseInt(node.data.replace(`${marker}:`, "")); + }, + /** + * Creates a placeholder string suitable for marking out a location *within* + * an attribute value or HTML content. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by binding directives. + */ + createInterpolationPlaceholder(index) { + return `${_interpolationStart}${index}${_interpolationEnd}`; + }, + /** + * Creates a placeholder that manifests itself as an attribute on an + * element. + * @param attributeName - The name of the custom attribute. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by attribute directives such as `ref`, `slotted`, and `children`. + */ + createCustomAttributePlaceholder(attributeName, index) { + return `${attributeName}="${this.createInterpolationPlaceholder(index)}"`; + }, + /** + * Creates a placeholder that manifests itself as a marker within the DOM structure. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by structural directives such as `repeat`. + */ + createBlockPlaceholder(index) { + return ``; + }, + /** + * Schedules DOM update work in the next async batch. + * @param callable - The callable function or object to queue. + */ + queueUpdate: updateQueue.enqueue, + /** + * Immediately processes all work previously scheduled + * through queueUpdate. + * @remarks + * This also forces nextUpdate promises + * to resolve. + */ + processUpdates: updateQueue.process, + /** + * Resolves with the next DOM update. + */ + nextUpdate() { + return new Promise(updateQueue.enqueue); + }, + /** + * Sets an attribute value on an element. + * @param element - The element to set the attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is `null` or `undefined`, the attribute is removed, otherwise + * it is set to the provided value using the standard `setAttribute` API. + */ + setAttribute(element, attributeName, value) { + if (value === null || value === void 0) { + element.removeAttribute(attributeName); + } else { + element.setAttribute(attributeName, value); + } + }, + /** + * Sets a boolean attribute value. + * @param element - The element to set the boolean attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is true, the attribute is added; otherwise it is removed. + */ + setBooleanAttribute(element, attributeName, value) { + value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); + }, + /** + * Removes all the child nodes of the provided parent node. + * @param parent - The node to remove the children from. + */ + removeChildNodes(parent) { + for (let child = parent.firstChild; child !== null; child = parent.firstChild) { + parent.removeChild(child); + } + }, + /** + * Creates a TreeWalker configured to walk a template fragment. + * @param fragment - The fragment to walk. + */ + createTemplateWalker(fragment) { + return document.createTreeWalker( + fragment, + 133, + // element, text, comment + null, + false + ); + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js + var SubscriberSet, PropertyChangeNotifier; + var init_notifier = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js"() { + SubscriberSet = class { + /** + * Creates an instance of SubscriberSet for the specified source. + * @param source - The object source that subscribers will receive notifications from. + * @param initialSubscriber - An initial subscriber to changes. + */ + constructor(source, initialSubscriber) { + this.sub1 = void 0; + this.sub2 = void 0; + this.spillover = void 0; + this.source = source; + this.sub1 = initialSubscriber; + } + /** + * Checks whether the provided subscriber has been added to this set. + * @param subscriber - The subscriber to test for inclusion in this set. + */ + has(subscriber) { + return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + */ + subscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.has(subscriber)) { + return; + } + if (this.sub1 === void 0) { + this.sub1 = subscriber; + return; + } + if (this.sub2 === void 0) { + this.sub2 = subscriber; + return; + } + this.spillover = [this.sub1, this.sub2, subscriber]; + this.sub1 = void 0; + this.sub2 = void 0; + } else { + const index = spillover.indexOf(subscriber); + if (index === -1) { + spillover.push(subscriber); + } + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + */ + unsubscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.sub1 === subscriber) { + this.sub1 = void 0; + } else if (this.sub2 === subscriber) { + this.sub2 = void 0; + } + } else { + const index = spillover.indexOf(subscriber); + if (index !== -1) { + spillover.splice(index, 1); + } + } + } + /** + * Notifies all subscribers. + * @param args - Data passed along to subscribers during notification. + */ + notify(args) { + const spillover = this.spillover; + const source = this.source; + if (spillover === void 0) { + const sub1 = this.sub1; + const sub2 = this.sub2; + if (sub1 !== void 0) { + sub1.handleChange(source, args); + } + if (sub2 !== void 0) { + sub2.handleChange(source, args); + } + } else { + for (let i = 0, ii = spillover.length; i < ii; ++i) { + spillover[i].handleChange(source, args); + } + } + } + }; + PropertyChangeNotifier = class { + /** + * Creates an instance of PropertyChangeNotifier for the specified source. + * @param source - The object source that subscribers will receive notifications from. + */ + constructor(source) { + this.subscribers = {}; + this.sourceSubscribers = null; + this.source = source; + } + /** + * Notifies all subscribers, based on the specified property. + * @param propertyName - The property name, passed along to subscribers during notification. + */ + notify(propertyName) { + var _a; + const subscribers = this.subscribers[propertyName]; + if (subscribers !== void 0) { + subscribers.notify(propertyName); + } + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. + */ + subscribe(subscriber, propertyToWatch) { + var _a; + if (propertyToWatch) { + let subscribers = this.subscribers[propertyToWatch]; + if (subscribers === void 0) { + this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); + } + subscribers.subscribe(subscriber); + } else { + this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); + this.sourceSubscribers.subscribe(subscriber); + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. + */ + unsubscribe(subscriber, propertyToUnwatch) { + var _a; + if (propertyToUnwatch) { + const subscribers = this.subscribers[propertyToUnwatch]; + if (subscribers !== void 0) { + subscribers.unsubscribe(subscriber); + } + } else { + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/observable.js + function observable(target, nameOrAccessor) { + Observable.defineProperty(target, nameOrAccessor); + } + function volatile(target, name, descriptor) { + return Object.assign({}, descriptor, { + get: function() { + Observable.trackVolatile(); + return descriptor.get.apply(this); + } + }); + } + var Observable, contextEvent, ExecutionContext, defaultExecutionContext; + var init_observable = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/observable.js"() { + init_dom(); + init_platform(); + init_notifier(); + Observable = FAST.getById(2, () => { + const volatileRegex = /(:|&&|\|\||if)/; + const notifierLookup = /* @__PURE__ */ new WeakMap(); + const queueUpdate = DOM.queueUpdate; + let watcher = void 0; + let createArrayObserver = (array) => { + throw new Error("Must call enableArrayObservation before observing arrays."); + }; + function getNotifier(source) { + let found = source.$fastController || notifierLookup.get(source); + if (found === void 0) { + if (Array.isArray(source)) { + found = createArrayObserver(source); + } else { + notifierLookup.set(source, found = new PropertyChangeNotifier(source)); + } + } + return found; + } + const getAccessors = createMetadataLocator(); + class DefaultObservableAccessor { + constructor(name) { + this.name = name; + this.field = `_${name}`; + this.callback = `${name}Changed`; + } + getValue(source) { + if (watcher !== void 0) { + watcher.watch(source, this.name); + } + return source[this.field]; + } + setValue(source, newValue) { + const field = this.field; + const oldValue = source[field]; + if (oldValue !== newValue) { + source[field] = newValue; + const callback = source[this.callback]; + if (typeof callback === "function") { + callback.call(source, oldValue, newValue); + } + getNotifier(source).notify(this.name); + } + } + } + class BindingObserverImplementation extends SubscriberSet { + constructor(binding, initialSubscriber, isVolatileBinding = false) { + super(binding, initialSubscriber); + this.binding = binding; + this.isVolatileBinding = isVolatileBinding; + this.needsRefresh = true; + this.needsQueue = true; + this.first = this; + this.last = null; + this.propertySource = void 0; + this.propertyName = void 0; + this.notifier = void 0; + this.next = void 0; + } + observe(source, context) { + if (this.needsRefresh && this.last !== null) { + this.disconnect(); + } + const previousWatcher = watcher; + watcher = this.needsRefresh ? this : void 0; + this.needsRefresh = this.isVolatileBinding; + const result = this.binding(source, context); + watcher = previousWatcher; + return result; + } + disconnect() { + if (this.last !== null) { + let current = this.first; + while (current !== void 0) { + current.notifier.unsubscribe(this, current.propertyName); + current = current.next; + } + this.last = null; + this.needsRefresh = this.needsQueue = true; + } + } + watch(propertySource, propertyName) { + const prev = this.last; + const notifier = getNotifier(propertySource); + const current = prev === null ? this.first : {}; + current.propertySource = propertySource; + current.propertyName = propertyName; + current.notifier = notifier; + notifier.subscribe(this, propertyName); + if (prev !== null) { + if (!this.needsRefresh) { + let prevValue; + watcher = void 0; + prevValue = prev.propertySource[prev.propertyName]; + watcher = this; + if (propertySource === prevValue) { + this.needsRefresh = true; + } + } + prev.next = current; + } + this.last = current; + } + handleChange() { + if (this.needsQueue) { + this.needsQueue = false; + queueUpdate(this); + } + } + call() { + if (this.last !== null) { + this.needsQueue = true; + this.notify(this); + } + } + records() { + let next = this.first; + return { + next: () => { + const current = next; + if (current === void 0) { + return { value: void 0, done: true }; + } else { + next = next.next; + return { + value: current, + done: false + }; + } + }, + [Symbol.iterator]: function() { + return this; + } + }; + } + } + return Object.freeze({ + /** + * @internal + * @param factory - The factory used to create array observers. + */ + setArrayObserverFactory(factory) { + createArrayObserver = factory; + }, + /** + * Gets a notifier for an object or Array. + * @param source - The object or Array to get the notifier for. + */ + getNotifier, + /** + * Records a property change for a source object. + * @param source - The object to record the change against. + * @param propertyName - The property to track as changed. + */ + track(source, propertyName) { + if (watcher !== void 0) { + watcher.watch(source, propertyName); + } + }, + /** + * Notifies watchers that the currently executing property getter or function is volatile + * with respect to its observable dependencies. + */ + trackVolatile() { + if (watcher !== void 0) { + watcher.needsRefresh = true; + } + }, + /** + * Notifies subscribers of a source object of changes. + * @param source - the object to notify of changes. + * @param args - The change args to pass to subscribers. + */ + notify(source, args) { + getNotifier(source).notify(args); + }, + /** + * Defines an observable property on an object or prototype. + * @param target - The target object to define the observable on. + * @param nameOrAccessor - The name of the property to define as observable; + * or a custom accessor that specifies the property name and accessor implementation. + */ + defineProperty(target, nameOrAccessor) { + if (typeof nameOrAccessor === "string") { + nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); + } + getAccessors(target).push(nameOrAccessor); + Reflect.defineProperty(target, nameOrAccessor.name, { + enumerable: true, + get: function() { + return nameOrAccessor.getValue(this); + }, + set: function(newValue) { + nameOrAccessor.setValue(this, newValue); + } + }); + }, + /** + * Finds all the observable accessors defined on the target, + * including its prototype chain. + * @param target - The target object to search for accessor on. + */ + getAccessors, + /** + * Creates a {@link BindingObserver} that can watch the + * provided {@link Binding} for changes. + * @param binding - The binding to observe. + * @param initialSubscriber - An initial subscriber to changes in the binding value. + * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. + */ + binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) { + return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding); + }, + /** + * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated + * on every evaluation of the value. + * @param binding - The binding to inspect. + */ + isVolatileBinding(binding) { + return volatileRegex.test(binding.toString()); + } + }); + }); + contextEvent = FAST.getById(3, () => { + let current = null; + return { + get() { + return current; + }, + set(event) { + current = event; + } + }; + }); + ExecutionContext = class { + constructor() { + this.index = 0; + this.length = 0; + this.parent = null; + this.parentContext = null; + } + /** + * The current event within an event handler. + */ + get event() { + return contextEvent.get(); + } + /** + * Indicates whether the current item within a repeat context + * has an even index. + */ + get isEven() { + return this.index % 2 === 0; + } + /** + * Indicates whether the current item within a repeat context + * has an odd index. + */ + get isOdd() { + return this.index % 2 !== 0; + } + /** + * Indicates whether the current item within a repeat context + * is the first item in the collection. + */ + get isFirst() { + return this.index === 0; + } + /** + * Indicates whether the current item within a repeat context + * is somewhere in the middle of the collection. + */ + get isInMiddle() { + return !this.isFirst && !this.isLast; + } + /** + * Indicates whether the current item within a repeat context + * is the last item in the collection. + */ + get isLast() { + return this.index === this.length - 1; + } + /** + * Sets the event for the current execution context. + * @param event - The event to set. + * @internal + */ + static setEvent(event) { + contextEvent.set(event); + } + }; + Observable.defineProperty(ExecutionContext.prototype, "index"); + Observable.defineProperty(ExecutionContext.prototype, "length"); + defaultExecutionContext = Object.seal(new ExecutionContext()); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js + var HTMLDirective, TargetedHTMLDirective, AttachedBehaviorHTMLDirective; + var init_html_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js"() { + init_dom(); + HTMLDirective = class { + constructor() { + this.targetIndex = 0; + } + }; + TargetedHTMLDirective = class extends HTMLDirective { + constructor() { + super(...arguments); + this.createPlaceholder = DOM.createInterpolationPlaceholder; + } + }; + AttachedBehaviorHTMLDirective = class extends HTMLDirective { + /** + * + * @param name - The name of the behavior; used as a custom attribute on the element. + * @param behavior - The behavior to instantiate and attach to the element. + * @param options - Options to pass to the behavior during creation. + */ + constructor(name, behavior, options) { + super(); + this.name = name; + this.behavior = behavior; + this.options = options; + } + /** + * Creates a placeholder string based on the directive's index within the template. + * @param index - The index of the directive within the template. + * @remarks + * Creates a custom attribute placeholder. + */ + createPlaceholder(index) { + return DOM.createCustomAttributePlaceholder(this.name, index); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + * @remarks + * Creates an instance of the `behavior` type this directive was constructed with + * and passes the target and options to that `behavior`'s constructor. + */ + createBehavior(target) { + return new this.behavior(target, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/binding.js + function normalBind(source, context) { + this.source = source; + this.context = context; + if (this.bindingObserver === null) { + this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); + } + this.updateTarget(this.bindingObserver.observe(source, context)); + } + function triggerBind(source, context) { + this.source = source; + this.context = context; + this.target.addEventListener(this.targetName, this); + } + function normalUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + } + function contentUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.unbind(); + view.needsBindOnly = true; + } + } + function triggerUnbind() { + this.target.removeEventListener(this.targetName, this); + this.source = null; + this.context = null; + } + function updateAttributeTarget(value) { + DOM.setAttribute(this.target, this.targetName, value); + } + function updateBooleanAttributeTarget(value) { + DOM.setBooleanAttribute(this.target, this.targetName, value); + } + function updateContentTarget(value) { + if (value === null || value === void 0) { + value = ""; + } + if (value.create) { + this.target.textContent = ""; + let view = this.target.$fastView; + if (view === void 0) { + view = value.create(); + } else { + if (this.target.$fastTemplate !== value) { + if (view.isComposed) { + view.remove(); + view.unbind(); + } + view = value.create(); + } + } + if (!view.isComposed) { + view.isComposed = true; + view.bind(this.source, this.context); + view.insertBefore(this.target); + this.target.$fastView = view; + this.target.$fastTemplate = value; + } else if (view.needsBindOnly) { + view.needsBindOnly = false; + view.bind(this.source, this.context); + } + } else { + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.isComposed = false; + view.remove(); + if (view.needsBindOnly) { + view.needsBindOnly = false; + } else { + view.unbind(); + } + } + this.target.textContent = value; + } + } + function updatePropertyTarget(value) { + this.target[this.targetName] = value; + } + function updateClassTarget(value) { + const classVersions = this.classVersions || /* @__PURE__ */ Object.create(null); + const target = this.target; + let version = this.version || 0; + if (value !== null && value !== void 0 && value.length) { + const names = value.split(/\s+/); + for (let i = 0, ii = names.length; i < ii; ++i) { + const currentName = names[i]; + if (currentName === "") { + continue; + } + classVersions[currentName] = version; + target.classList.add(currentName); + } + } + this.classVersions = classVersions; + this.version = version + 1; + if (version === 0) { + return; + } + version -= 1; + for (const name in classVersions) { + if (classVersions[name] === version) { + target.classList.remove(name); + } + } + } + var HTMLBindingDirective, BindingBehavior; + var init_binding = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/binding.js"() { + init_dom(); + init_observable(); + init_html_directive(); + HTMLBindingDirective = class extends TargetedHTMLDirective { + /** + * Creates an instance of BindingDirective. + * @param binding - A binding that returns the data used to update the DOM. + */ + constructor(binding) { + super(); + this.binding = binding; + this.bind = normalBind; + this.unbind = normalUnbind; + this.updateTarget = updateAttributeTarget; + this.isBindingVolatile = Observable.isVolatileBinding(this.binding); + } + /** + * Gets/sets the name of the attribute or property that this + * binding is targeting. + */ + get targetName() { + return this.originalTargetName; + } + set targetName(value) { + this.originalTargetName = value; + if (value === void 0) { + return; + } + switch (value[0]) { + case ":": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updatePropertyTarget; + if (this.cleanedTargetName === "innerHTML") { + const binding = this.binding; + this.binding = (s, c) => DOM.createHTML(binding(s, c)); + } + break; + case "?": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updateBooleanAttributeTarget; + break; + case "@": + this.cleanedTargetName = value.substr(1); + this.bind = triggerBind; + this.unbind = triggerUnbind; + break; + default: + this.cleanedTargetName = value; + if (value === "class") { + this.updateTarget = updateClassTarget; + } + break; + } + } + /** + * Makes this binding target the content of an element rather than + * a particular attribute or property. + */ + targetAtContent() { + this.updateTarget = updateContentTarget; + this.unbind = contentUnbind; + } + /** + * Creates the runtime BindingBehavior instance based on the configuration + * information stored in the BindingDirective. + * @param target - The target node that the binding behavior should attach to. + */ + createBehavior(target) { + return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); + } + }; + BindingBehavior = class { + /** + * Creates an instance of BindingBehavior. + * @param target - The target of the data updates. + * @param binding - The binding that returns the latest value for an update. + * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. + * @param bind - The operation to perform during binding. + * @param unbind - The operation to perform during unbinding. + * @param updateTarget - The operation to perform when updating. + * @param targetName - The name of the target attribute or property to update. + */ + constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { + this.source = null; + this.context = null; + this.bindingObserver = null; + this.target = target; + this.binding = binding; + this.isBindingVolatile = isBindingVolatile; + this.bind = bind; + this.unbind = unbind; + this.updateTarget = updateTarget; + this.targetName = targetName; + } + /** @internal */ + handleChange() { + this.updateTarget(this.bindingObserver.observe(this.source, this.context)); + } + /** @internal */ + handleEvent(event) { + ExecutionContext.setEvent(event); + const result = this.binding(this.source, this.context); + ExecutionContext.setEvent(null); + if (result !== true) { + event.preventDefault(); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js + function createAggregateBinding(parts) { + if (parts.length === 1) { + return parts[0]; + } + let targetName; + const partCount = parts.length; + const finalParts = parts.map((x) => { + if (typeof x === "string") { + return () => x; + } + targetName = x.targetName || targetName; + return x.binding; + }); + const binding = (scope, context) => { + let output = ""; + for (let i = 0; i < partCount; ++i) { + output += finalParts[i](scope, context); + } + return output; + }; + const directive = new HTMLBindingDirective(binding); + directive.targetName = targetName; + return directive; + } + function parseContent(context, value) { + const valueParts = value.split(_interpolationStart); + if (valueParts.length === 1) { + return null; + } + const bindingParts = []; + for (let i = 0, ii = valueParts.length; i < ii; ++i) { + const current = valueParts[i]; + const index = current.indexOf(_interpolationEnd); + let literal; + if (index === -1) { + literal = current; + } else { + const directiveIndex = parseInt(current.substring(0, index)); + bindingParts.push(context.directives[directiveIndex]); + literal = current.substring(index + interpolationEndLength); + } + if (literal !== "") { + bindingParts.push(literal); + } + } + return bindingParts; + } + function compileAttributes(context, node, includeBasicValues = false) { + const attributes = node.attributes; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const attr2 = attributes[i]; + const attrValue = attr2.value; + const parseResult = parseContent(context, attrValue); + let result = null; + if (parseResult === null) { + if (includeBasicValues) { + result = new HTMLBindingDirective(() => attrValue); + result.targetName = attr2.name; + } + } else { + result = createAggregateBinding(parseResult); + } + if (result !== null) { + node.removeAttributeNode(attr2); + i--; + ii--; + context.addFactory(result); + } + } + } + function compileContent(context, node, walker) { + const parseResult = parseContent(context, node.textContent); + if (parseResult !== null) { + let lastNode = node; + for (let i = 0, ii = parseResult.length; i < ii; ++i) { + const currentPart = parseResult[i]; + const currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); + if (typeof currentPart === "string") { + currentNode.textContent = currentPart; + } else { + currentNode.textContent = " "; + context.captureContentBinding(currentPart); + } + lastNode = currentNode; + context.targetIndex++; + if (currentNode !== node) { + walker.nextNode(); + } + } + context.targetIndex--; + } + } + function compileTemplate(template, directives) { + const fragment = template.content; + document.adoptNode(fragment); + const context = CompilationContext.borrow(directives); + compileAttributes(context, template, true); + const hostBehaviorFactories = context.behaviorFactories; + context.reset(); + const walker = DOM.createTemplateWalker(fragment); + let node; + while (node = walker.nextNode()) { + context.targetIndex++; + switch (node.nodeType) { + case 1: + compileAttributes(context, node); + break; + case 3: + compileContent(context, node, walker); + break; + case 8: + if (DOM.isMarker(node)) { + context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); + } + } + } + let targetOffset = 0; + if ( + // If the first node in a fragment is a marker, that means it's an unstable first node, + // because something like a when, repeat, etc. could add nodes before the marker. + // To mitigate this, we insert a stable first node. However, if we insert a node, + // that will alter the result of the TreeWalker. So, we also need to offset the target index. + DOM.isMarker(fragment.firstChild) || // Or if there is only one node and a directive, it means the template's content + // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by + // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. + fragment.childNodes.length === 1 && directives.length + ) { + fragment.insertBefore(document.createComment(""), fragment.firstChild); + targetOffset = -1; + } + const viewBehaviorFactories = context.behaviorFactories; + context.release(); + return { + fragment, + viewBehaviorFactories, + hostBehaviorFactories, + targetOffset + }; + } + var sharedContext, CompilationContext, interpolationEndLength; + var init_compiler = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js"() { + init_dom(); + init_binding(); + sharedContext = null; + CompilationContext = class _CompilationContext { + addFactory(factory) { + factory.targetIndex = this.targetIndex; + this.behaviorFactories.push(factory); + } + captureContentBinding(directive) { + directive.targetAtContent(); + this.addFactory(directive); + } + reset() { + this.behaviorFactories = []; + this.targetIndex = -1; + } + release() { + sharedContext = this; + } + static borrow(directives) { + const shareable = sharedContext || new _CompilationContext(); + shareable.directives = directives; + shareable.reset(); + sharedContext = null; + return shareable; + } + }; + interpolationEndLength = _interpolationEnd.length; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/view.js + var range, HTMLView; + var init_view = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/view.js"() { + range = document.createRange(); + HTMLView = class { + /** + * Constructs an instance of HTMLView. + * @param fragment - The html fragment that contains the nodes for this view. + * @param behaviors - The behaviors to be applied to this view. + */ + constructor(fragment, behaviors) { + this.fragment = fragment; + this.behaviors = behaviors; + this.source = null; + this.context = null; + this.firstChild = fragment.firstChild; + this.lastChild = fragment.lastChild; + } + /** + * Appends the view's DOM nodes to the referenced node. + * @param node - The parent node to append the view's DOM nodes to. + */ + appendTo(node) { + node.appendChild(this.fragment); + } + /** + * Inserts the view's DOM nodes before the referenced node. + * @param node - The node to insert the view's DOM before. + */ + insertBefore(node) { + if (this.fragment.hasChildNodes()) { + node.parentNode.insertBefore(this.fragment, node); + } else { + const end = this.lastChild; + if (node.previousSibling === end) + return; + const parentNode = node.parentNode; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parentNode.insertBefore(current, node); + current = next; + } + parentNode.insertBefore(end, node); + } + } + /** + * Removes the view's DOM nodes. + * The nodes are not disposed and the view can later be re-inserted. + */ + remove() { + const fragment = this.fragment; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + fragment.appendChild(current); + current = next; + } + fragment.appendChild(end); + } + /** + * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. + * Once a view has been disposed, it cannot be inserted or bound again. + */ + dispose() { + const parent = this.firstChild.parentNode; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parent.removeChild(current); + current = next; + } + parent.removeChild(end); + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + } + /** + * Binds a view's behaviors to its binding source. + * @param source - The binding source for the view's binding behaviors. + * @param context - The execution context to run the behaviors within. + */ + bind(source, context) { + const behaviors = this.behaviors; + if (this.source === source) { + return; + } else if (this.source !== null) { + const oldSource = this.source; + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + const current = behaviors[i]; + current.unbind(oldSource); + current.bind(source, context); + } + } else { + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].bind(source, context); + } + } + } + /** + * Unbinds a view's behaviors from its binding source. + */ + unbind() { + if (this.source === null) { + return; + } + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + this.source = null; + } + /** + * Efficiently disposes of a contiguous range of synthetic view instances. + * @param views - A contiguous range of views to be disposed. + */ + static disposeContiguousBatch(views) { + if (views.length === 0) { + return; + } + range.setStartBefore(views[0].firstChild); + range.setEndAfter(views[views.length - 1].lastChild); + range.deleteContents(); + for (let i = 0, ii = views.length; i < ii; ++i) { + const view = views[i]; + const behaviors = view.behaviors; + const oldSource = view.source; + for (let j = 0, jj = behaviors.length; j < jj; ++j) { + behaviors[j].unbind(oldSource); + } + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/template.js + function html(strings, ...values) { + const directives = []; + let html2 = ""; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + const currentString = strings[i]; + let value = values[i]; + html2 += currentString; + if (value instanceof ViewTemplate) { + const template = value; + value = () => template; + } + if (typeof value === "function") { + value = new HTMLBindingDirective(value); + } + if (value instanceof TargetedHTMLDirective) { + const match = lastAttributeNameRegex.exec(currentString); + if (match !== null) { + value.targetName = match[2]; + } + } + if (value instanceof HTMLDirective) { + html2 += value.createPlaceholder(directives.length); + directives.push(value); + } else { + html2 += value; + } + } + html2 += strings[strings.length - 1]; + return new ViewTemplate(html2, directives); + } + var ViewTemplate, lastAttributeNameRegex; + var init_template = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/template.js"() { + init_dom(); + init_observable(); + init_compiler(); + init_view(); + init_html_directive(); + init_binding(); + ViewTemplate = class { + /** + * Creates an instance of ViewTemplate. + * @param html - The html representing what this template will instantiate, including placeholders for directives. + * @param directives - The directives that will be connected to placeholders in the html. + */ + constructor(html2, directives) { + this.behaviorCount = 0; + this.hasHostBehaviors = false; + this.fragment = null; + this.targetOffset = 0; + this.viewBehaviorFactories = null; + this.hostBehaviorFactories = null; + this.html = html2; + this.directives = directives; + } + /** + * Creates an HTMLView instance based on this template definition. + * @param hostBindingTarget - The element that host behaviors will be bound to. + */ + create(hostBindingTarget) { + if (this.fragment === null) { + let template; + const html2 = this.html; + if (typeof html2 === "string") { + template = document.createElement("template"); + template.innerHTML = DOM.createHTML(html2); + const fec = template.content.firstElementChild; + if (fec !== null && fec.tagName === "TEMPLATE") { + template = fec; + } + } else { + template = html2; + } + const result = compileTemplate(template, this.directives); + this.fragment = result.fragment; + this.viewBehaviorFactories = result.viewBehaviorFactories; + this.hostBehaviorFactories = result.hostBehaviorFactories; + this.targetOffset = result.targetOffset; + this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; + this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; + } + const fragment = this.fragment.cloneNode(true); + const viewFactories = this.viewBehaviorFactories; + const behaviors = new Array(this.behaviorCount); + const walker = DOM.createTemplateWalker(fragment); + let behaviorIndex = 0; + let targetIndex = this.targetOffset; + let node = walker.nextNode(); + for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { + const factory = viewFactories[behaviorIndex]; + const factoryIndex = factory.targetIndex; + while (node !== null) { + if (targetIndex === factoryIndex) { + behaviors[behaviorIndex] = factory.createBehavior(node); + break; + } else { + node = walker.nextNode(); + targetIndex++; + } + } + } + if (this.hasHostBehaviors) { + const hostFactories = this.hostBehaviorFactories; + for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) { + behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); + } + } + return new HTMLView(fragment, behaviors); + } + /** + * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. + * @param source - The data source to bind the template to. + * @param host - The Element where the template will be rendered. + * @param hostBindingTarget - An HTML element to target the host bindings at if different from the + * host that the template is being attached to. + */ + render(source, host, hostBindingTarget) { + if (typeof host === "string") { + host = document.getElementById(host); + } + if (hostBindingTarget === void 0) { + hostBindingTarget = host; + } + const view = this.create(hostBindingTarget); + view.bind(source, defaultExecutionContext); + view.appendTo(host); + return view; + } + }; + lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ + /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js + function reduceStyles(styles) { + return styles.map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x]).reduce((prev, curr) => prev.concat(curr), []); + } + function reduceBehaviors(styles) { + return styles.map((x) => x instanceof ElementStyles ? x.behaviors : null).reduce((prev, curr) => { + if (curr === null) { + return prev; + } + if (prev === null) { + prev = []; + } + return prev.concat(curr); + }, null); + } + function separateSheetsToPrepend(sheets) { + const prepend = []; + const append = []; + sheets.forEach((x) => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x)); + return { prepend, append }; + } + function getNextStyleClass() { + return `fast-style-class-${++styleClassId}`; + } + var ElementStyles, prependToAdoptedStyleSheetsSymbol, addAdoptedStyleSheets, removeAdoptedStyleSheets, AdoptedStyleSheetsStyles, styleClassId, StyleElementStyles; + var init_element_styles = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js"() { + init_dom(); + ElementStyles = class { + constructor() { + this.targets = /* @__PURE__ */ new WeakSet(); + } + /** @internal */ + addStylesTo(target) { + this.targets.add(target); + } + /** @internal */ + removeStylesFrom(target) { + this.targets.delete(target); + } + /** @internal */ + isAttachedTo(target) { + return this.targets.has(target); + } + /** + * Associates behaviors with this set of styles. + * @param behaviors - The behaviors to associate. + */ + withBehaviors(...behaviors) { + this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); + return this; + } + }; + ElementStyles.create = (() => { + if (DOM.supportsAdoptedStyleSheets) { + const styleSheetCache = /* @__PURE__ */ new Map(); + return (styles) => ( + // eslint-disable-next-line @typescript-eslint/no-use-before-define + new AdoptedStyleSheetsStyles(styles, styleSheetCache) + ); + } + return (styles) => new StyleElementStyles(styles); + })(); + prependToAdoptedStyleSheetsSymbol = /* @__PURE__ */ Symbol("prependToAdoptedStyleSheets"); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append]; + }; + removeAdoptedStyleSheets = (target, sheets) => { + target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1); + }; + if (DOM.supportsAdoptedStyleSheets) { + try { + document.adoptedStyleSheets.push(); + document.adoptedStyleSheets.splice(); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets.splice(0, 0, ...prepend); + target.adoptedStyleSheets.push(...append); + }; + removeAdoptedStyleSheets = (target, sheets) => { + for (const sheet of sheets) { + const index = target.adoptedStyleSheets.indexOf(sheet); + if (index !== -1) { + target.adoptedStyleSheets.splice(index, 1); + } + } + }; + } catch (e) { + } + } + AdoptedStyleSheetsStyles = class extends ElementStyles { + constructor(styles, styleSheetCache) { + super(); + this.styles = styles; + this.styleSheetCache = styleSheetCache; + this._styleSheets = void 0; + this.behaviors = reduceBehaviors(styles); + } + get styleSheets() { + if (this._styleSheets === void 0) { + const styles = this.styles; + const styleSheetCache = this.styleSheetCache; + this._styleSheets = reduceStyles(styles).map((x) => { + if (x instanceof CSSStyleSheet) { + return x; + } + let sheet = styleSheetCache.get(x); + if (sheet === void 0) { + sheet = new CSSStyleSheet(); + sheet.replaceSync(x); + styleSheetCache.set(x, sheet); + } + return sheet; + }); + } + return this._styleSheets; + } + addStylesTo(target) { + addAdoptedStyleSheets(target, this.styleSheets); + super.addStylesTo(target); + } + removeStylesFrom(target) { + removeAdoptedStyleSheets(target, this.styleSheets); + super.removeStylesFrom(target); + } + }; + styleClassId = 0; + StyleElementStyles = class extends ElementStyles { + constructor(styles) { + super(); + this.styles = styles; + this.behaviors = null; + this.behaviors = reduceBehaviors(styles); + this.styleSheets = reduceStyles(styles); + this.styleClass = getNextStyleClass(); + } + addStylesTo(target) { + const styleSheets = this.styleSheets; + const styleClass = this.styleClass; + target = this.normalizeTarget(target); + for (let i = 0; i < styleSheets.length; i++) { + const element = document.createElement("style"); + element.innerHTML = styleSheets[i]; + element.className = styleClass; + target.append(element); + } + super.addStylesTo(target); + } + removeStylesFrom(target) { + target = this.normalizeTarget(target); + const styles = target.querySelectorAll(`.${this.styleClass}`); + for (let i = 0, ii = styles.length; i < ii; ++i) { + target.removeChild(styles[i]); + } + super.removeStylesFrom(target); + } + isAttachedTo(target) { + return super.isAttachedTo(this.normalizeTarget(target)); + } + normalizeTarget(target) { + return target === document ? document.body : target; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/attributes.js + function attr(configOrTarget, prop) { + let config; + function decorator($target, $prop) { + if (arguments.length > 1) { + config.property = $prop; + } + AttributeConfiguration.locate($target.constructor).push(config); + } + if (arguments.length > 1) { + config = {}; + decorator(configOrTarget, prop); + return; + } + config = configOrTarget === void 0 ? {} : configOrTarget; + return decorator; + } + var AttributeConfiguration, booleanConverter, nullableNumberConverter, AttributeDefinition; + var init_attributes = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/attributes.js"() { + init_observable(); + init_dom(); + init_platform(); + AttributeConfiguration = Object.freeze({ + /** + * Locates all attribute configurations associated with a type. + */ + locate: createMetadataLocator() + }); + booleanConverter = { + toView(value) { + return value ? "true" : "false"; + }, + fromView(value) { + if (value === null || value === void 0 || value === "false" || value === false || value === 0) { + return false; + } + return true; + } + }; + nullableNumberConverter = { + toView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number.toString(); + }, + fromView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number; + } + }; + AttributeDefinition = class _AttributeDefinition { + /** + * Creates an instance of AttributeDefinition. + * @param Owner - The class constructor that owns this attribute. + * @param name - The name of the property associated with the attribute. + * @param attribute - The name of the attribute in HTML. + * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. + * @param converter - A {@link ValueConverter} that integrates with the property getter/setter + * to convert values to and from a DOM string. + */ + constructor(Owner, name, attribute = name.toLowerCase(), mode = "reflect", converter) { + this.guards = /* @__PURE__ */ new Set(); + this.Owner = Owner; + this.name = name; + this.attribute = attribute; + this.mode = mode; + this.converter = converter; + this.fieldName = `_${name}`; + this.callbackName = `${name}Changed`; + this.hasCallback = this.callbackName in Owner.prototype; + if (mode === "boolean" && converter === void 0) { + this.converter = booleanConverter; + } + } + /** + * Sets the value of the attribute/property on the source element. + * @param source - The source element to access. + * @param value - The value to set the attribute/property to. + */ + setValue(source, newValue) { + const oldValue = source[this.fieldName]; + const converter = this.converter; + if (converter !== void 0) { + newValue = converter.fromView(newValue); + } + if (oldValue !== newValue) { + source[this.fieldName] = newValue; + this.tryReflectToAttribute(source); + if (this.hasCallback) { + source[this.callbackName](oldValue, newValue); + } + source.$fastController.notify(this.name); + } + } + /** + * Gets the value of the attribute/property on the source element. + * @param source - The source element to access. + */ + getValue(source) { + Observable.track(source, this.name); + return source[this.fieldName]; + } + /** @internal */ + onAttributeChangedCallback(element, value) { + if (this.guards.has(element)) { + return; + } + this.guards.add(element); + this.setValue(element, value); + this.guards.delete(element); + } + tryReflectToAttribute(element) { + const mode = this.mode; + const guards = this.guards; + if (guards.has(element) || mode === "fromView") { + return; + } + DOM.queueUpdate(() => { + guards.add(element); + const latestValue = element[this.fieldName]; + switch (mode) { + case "reflect": + const converter = this.converter; + DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); + break; + case "boolean": + DOM.setBooleanAttribute(element, this.attribute, latestValue); + break; + } + guards.delete(element); + }); + } + /** + * Collects all attribute definitions associated with the owner. + * @param Owner - The class constructor to collect attribute for. + * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. + * @internal + */ + static collect(Owner, ...attributeLists) { + const attributes = []; + attributeLists.push(AttributeConfiguration.locate(Owner)); + for (let i = 0, ii = attributeLists.length; i < ii; ++i) { + const list = attributeLists[i]; + if (list === void 0) { + continue; + } + for (let j = 0, jj = list.length; j < jj; ++j) { + const config = list[j]; + if (typeof config === "string") { + attributes.push(new _AttributeDefinition(Owner, config)); + } else { + attributes.push(new _AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); + } + } + } + return attributes; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js + var defaultShadowOptions, defaultElementOptions, fastRegistry, FASTElementDefinition; + var init_fast_definitions = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js"() { + init_platform(); + init_observable(); + init_element_styles(); + init_attributes(); + defaultShadowOptions = { mode: "open" }; + defaultElementOptions = {}; + fastRegistry = FAST.getById(4, () => { + const typeToDefinition = /* @__PURE__ */ new Map(); + return Object.freeze({ + register(definition) { + if (typeToDefinition.has(definition.type)) { + return false; + } + typeToDefinition.set(definition.type, definition); + return true; + }, + getByType(key) { + return typeToDefinition.get(key); + } + }); + }); + FASTElementDefinition = class { + /** + * Creates an instance of FASTElementDefinition. + * @param type - The type this definition is being created for. + * @param nameOrConfig - The name of the element to define or a config object + * that describes the element to define. + */ + constructor(type, nameOrConfig = type.definition) { + if (typeof nameOrConfig === "string") { + nameOrConfig = { name: nameOrConfig }; + } + this.type = type; + this.name = nameOrConfig.name; + this.template = nameOrConfig.template; + const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); + const observedAttributes = new Array(attributes.length); + const propertyLookup = {}; + const attributeLookup = {}; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const current = attributes[i]; + observedAttributes[i] = current.attribute; + propertyLookup[current.name] = current; + attributeLookup[current.attribute] = current; + } + this.attributes = attributes; + this.observedAttributes = observedAttributes; + this.propertyLookup = propertyLookup; + this.attributeLookup = attributeLookup; + this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); + this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); + this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof ElementStyles ? nameOrConfig.styles : ElementStyles.create([nameOrConfig.styles]); + } + /** + * Indicates if this element has been defined in at least one registry. + */ + get isDefined() { + return !!fastRegistry.getByType(this.type); + } + /** + * Defines a custom element based on this definition. + * @param registry - The element registry to define the element in. + */ + define(registry = customElements) { + const type = this.type; + if (fastRegistry.register(this)) { + const attributes = this.attributes; + const proto = type.prototype; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + Observable.defineProperty(proto, attributes[i]); + } + Reflect.defineProperty(type, "observedAttributes", { + value: this.observedAttributes, + enumerable: true + }); + } + if (!registry.get(this.name)) { + registry.define(this.name, type, this.elementOptions); + } + return this; + } + }; + FASTElementDefinition.forType = fastRegistry.getByType; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/controller.js + function getShadowRoot(element) { + return element.shadowRoot || shadowRoots.get(element) || null; + } + var shadowRoots, defaultEventOptions, Controller; + var init_controller = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/controller.js"() { + init_dom(); + init_notifier(); + init_observable(); + init_fast_definitions(); + shadowRoots = /* @__PURE__ */ new WeakMap(); + defaultEventOptions = { + bubbles: true, + composed: true, + cancelable: true + }; + Controller = class _Controller extends PropertyChangeNotifier { + /** + * Creates a Controller to control the specified element. + * @param element - The element to be controlled by this controller. + * @param definition - The element definition metadata that instructs this + * controller in how to handle rendering and other platform integrations. + * @internal + */ + constructor(element, definition) { + super(element); + this.boundObservables = null; + this.behaviors = null; + this.needsInitialization = true; + this._template = null; + this._styles = null; + this._isConnected = false; + this.$fastController = this; + this.view = null; + this.element = element; + this.definition = definition; + const shadowOptions = definition.shadowOptions; + if (shadowOptions !== void 0) { + const shadowRoot = element.attachShadow(shadowOptions); + if (shadowOptions.mode === "closed") { + shadowRoots.set(element, shadowRoot); + } + } + const accessors = Observable.getAccessors(element); + if (accessors.length > 0) { + const boundObservables = this.boundObservables = /* @__PURE__ */ Object.create(null); + for (let i = 0, ii = accessors.length; i < ii; ++i) { + const propertyName = accessors[i].name; + const value = element[propertyName]; + if (value !== void 0) { + delete element[propertyName]; + boundObservables[propertyName] = value; + } + } + } + } + /** + * Indicates whether or not the custom element has been + * connected to the document. + */ + get isConnected() { + Observable.track(this, "isConnected"); + return this._isConnected; + } + setIsConnected(value) { + this._isConnected = value; + Observable.notify(this, "isConnected"); + } + /** + * Gets/sets the template used to render the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get template() { + return this._template; + } + set template(value) { + if (this._template === value) { + return; + } + this._template = value; + if (!this.needsInitialization) { + this.renderTemplate(value); + } + } + /** + * Gets/sets the primary styles used for the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get styles() { + return this._styles; + } + set styles(value) { + if (this._styles === value) { + return; + } + if (this._styles !== null) { + this.removeStyles(this._styles); + } + this._styles = value; + if (!this.needsInitialization && value !== null) { + this.addStyles(value); + } + } + /** + * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. + * @param styles - The styles to add. + */ + addStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.append(styles); + } else if (!styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.addStylesTo(target); + if (sourceBehaviors !== null) { + this.addBehaviors(sourceBehaviors); + } + } + } + /** + * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. + * @param styles - the styles to remove. + */ + removeStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.removeChild(styles); + } else if (styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.removeStylesFrom(target); + if (sourceBehaviors !== null) { + this.removeBehaviors(sourceBehaviors); + } + } + } + /** + * Adds behaviors to this element. + * @param behaviors - The behaviors to add. + */ + addBehaviors(behaviors) { + const targetBehaviors = this.behaviors || (this.behaviors = /* @__PURE__ */ new Map()); + const length = behaviors.length; + const behaviorsToBind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); + } else { + targetBehaviors.set(behavior, 1); + behaviorsToBind.push(behavior); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToBind.length; ++i) { + behaviorsToBind[i].bind(element, defaultExecutionContext); + } + } + } + /** + * Removes behaviors from this element. + * @param behaviors - The behaviors to remove. + * @param force - Forces unbinding of behaviors. + */ + removeBehaviors(behaviors, force = false) { + const targetBehaviors = this.behaviors; + if (targetBehaviors === null) { + return; + } + const length = behaviors.length; + const behaviorsToUnbind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + const count = targetBehaviors.get(behavior) - 1; + count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToUnbind.length; ++i) { + behaviorsToUnbind[i].unbind(element); + } + } + } + /** + * Runs connected lifecycle behavior on the associated element. + */ + onConnectedCallback() { + if (this._isConnected) { + return; + } + const element = this.element; + if (this.needsInitialization) { + this.finishInitialization(); + } else if (this.view !== null) { + this.view.bind(element, defaultExecutionContext); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + for (const [behavior] of behaviors) { + behavior.bind(element, defaultExecutionContext); + } + } + this.setIsConnected(true); + } + /** + * Runs disconnected lifecycle behavior on the associated element. + */ + onDisconnectedCallback() { + if (!this._isConnected) { + return; + } + this.setIsConnected(false); + const view = this.view; + if (view !== null) { + view.unbind(); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + const element = this.element; + for (const [behavior] of behaviors) { + behavior.unbind(element); + } + } + } + /** + * Runs the attribute changed callback for the associated element. + * @param name - The name of the attribute that changed. + * @param oldValue - The previous value of the attribute. + * @param newValue - The new value of the attribute. + */ + onAttributeChangedCallback(name, oldValue, newValue) { + const attrDef = this.definition.attributeLookup[name]; + if (attrDef !== void 0) { + attrDef.onAttributeChangedCallback(this.element, newValue); + } + } + /** + * Emits a custom HTML event. + * @param type - The type name of the event. + * @param detail - The event detail object to send with the event. + * @param options - The event options. By default bubbles and composed. + * @remarks + * Only emits events if connected. + */ + emit(type, detail, options) { + if (this._isConnected) { + return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options))); + } + return false; + } + finishInitialization() { + const element = this.element; + const boundObservables = this.boundObservables; + if (boundObservables !== null) { + const propertyNames = Object.keys(boundObservables); + for (let i = 0, ii = propertyNames.length; i < ii; ++i) { + const propertyName = propertyNames[i]; + element[propertyName] = boundObservables[propertyName]; + } + this.boundObservables = null; + } + const definition = this.definition; + if (this._template === null) { + if (this.element.resolveTemplate) { + this._template = this.element.resolveTemplate(); + } else if (definition.template) { + this._template = definition.template || null; + } + } + if (this._template !== null) { + this.renderTemplate(this._template); + } + if (this._styles === null) { + if (this.element.resolveStyles) { + this._styles = this.element.resolveStyles(); + } else if (definition.styles) { + this._styles = definition.styles || null; + } + } + if (this._styles !== null) { + this.addStyles(this._styles); + } + this.needsInitialization = false; + } + renderTemplate(template) { + const element = this.element; + const host = getShadowRoot(element) || element; + if (this.view !== null) { + this.view.dispose(); + this.view = null; + } else if (!this.needsInitialization) { + DOM.removeChildNodes(host); + } + if (template) { + this.view = template.render(element, host, element); + } + } + /** + * Locates or creates a controller for the specified element. + * @param element - The element to return the controller for. + * @remarks + * The specified element must have a {@link FASTElementDefinition} + * registered either through the use of the {@link customElement} + * decorator or a call to `FASTElement.define`. + */ + static forCustomElement(element) { + const controller = element.$fastController; + if (controller !== void 0) { + return controller; + } + const definition = FASTElementDefinition.forType(element.constructor); + if (definition === void 0) { + throw new Error("Missing FASTElement definition."); + } + return element.$fastController = new _Controller(element, definition); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js + function createFASTElement(BaseType) { + return class extends BaseType { + constructor() { + super(); + Controller.forCustomElement(this); + } + $emit(type, detail, options) { + return this.$fastController.emit(type, detail, options); + } + connectedCallback() { + this.$fastController.onConnectedCallback(); + } + disconnectedCallback() { + this.$fastController.onDisconnectedCallback(); + } + attributeChangedCallback(name, oldValue, newValue) { + this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); + } + }; + } + var FASTElement; + var init_fast_element = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js"() { + init_controller(); + init_fast_definitions(); + FASTElement = Object.assign(createFASTElement(HTMLElement), { + /** + * Creates a new FASTElement base class inherited from the + * provided base type. + * @param BaseType - The base element type to inherit from. + */ + from(BaseType) { + return createFASTElement(BaseType); + }, + /** + * Defines a platform custom element based on the provided type and definition. + * @param type - The custom element type to define. + * @param nameOrDef - The name of the element to define or a definition object + * that describes the element to define. + */ + define(type, nameOrDef) { + return new FASTElementDefinition(type, nameOrDef).define().type; + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js + var CSSDirective; + var init_css_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js"() { + CSSDirective = class { + /** + * Creates a CSS fragment to interpolate into the CSS document. + * @returns - the string to interpolate into CSS + */ + createCSS() { + return ""; + } + /** + * Creates a behavior to bind to the host element. + * @returns - the behavior to bind to the host element, or undefined. + */ + createBehavior() { + return void 0; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css.js + function collectStyles(strings, values) { + const styles = []; + let cssString = ""; + const behaviors = []; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + cssString += strings[i]; + let value = values[i]; + if (value instanceof CSSDirective) { + const behavior = value.createBehavior(); + value = value.createCSS(); + if (behavior) { + behaviors.push(behavior); + } + } + if (value instanceof ElementStyles || value instanceof CSSStyleSheet) { + if (cssString.trim() !== "") { + styles.push(cssString); + cssString = ""; + } + styles.push(value); + } else { + cssString += value; + } + } + cssString += strings[strings.length - 1]; + if (cssString.trim() !== "") { + styles.push(cssString); + } + return { + styles, + behaviors + }; + } + function css(strings, ...values) { + const { styles, behaviors } = collectStyles(strings, values); + const elementStyles = ElementStyles.create(styles); + if (behaviors.length) { + elementStyles.withBehaviors(...behaviors); + } + return elementStyles; + } + var init_css = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css.js"() { + init_css_directive(); + init_element_styles(); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js + function newSplice(index, removed, addedCount) { + return { + index, + removed, + addedCount + }; + } + function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { + const rowCount = oldEnd - oldStart + 1; + const columnCount = currentEnd - currentStart + 1; + const distances = new Array(rowCount); + let north; + let west; + for (let i = 0; i < rowCount; ++i) { + distances[i] = new Array(columnCount); + distances[i][0] = i; + } + for (let j = 0; j < columnCount; ++j) { + distances[0][j] = j; + } + for (let i = 1; i < rowCount; ++i) { + for (let j = 1; j < columnCount; ++j) { + if (current[currentStart + j - 1] === old[oldStart + i - 1]) { + distances[i][j] = distances[i - 1][j - 1]; + } else { + north = distances[i - 1][j] + 1; + west = distances[i][j - 1] + 1; + distances[i][j] = north < west ? north : west; + } + } + } + return distances; + } + function spliceOperationsFromEditDistances(distances) { + let i = distances.length - 1; + let j = distances[0].length - 1; + let current = distances[i][j]; + const edits = []; + while (i > 0 || j > 0) { + if (i === 0) { + edits.push(EDIT_ADD); + j--; + continue; + } + if (j === 0) { + edits.push(EDIT_DELETE); + i--; + continue; + } + const northWest = distances[i - 1][j - 1]; + const west = distances[i - 1][j]; + const north = distances[i][j - 1]; + let min; + if (west < north) { + min = west < northWest ? west : northWest; + } else { + min = north < northWest ? north : northWest; + } + if (min === northWest) { + if (northWest === current) { + edits.push(EDIT_LEAVE); + } else { + edits.push(EDIT_UPDATE); + current = northWest; + } + i--; + j--; + } else if (min === west) { + edits.push(EDIT_DELETE); + i--; + current = west; + } else { + edits.push(EDIT_ADD); + j--; + current = north; + } + } + edits.reverse(); + return edits; + } + function sharedPrefix(current, old, searchLength) { + for (let i = 0; i < searchLength; ++i) { + if (current[i] !== old[i]) { + return i; + } + } + return searchLength; + } + function sharedSuffix(current, old, searchLength) { + let index1 = current.length; + let index2 = old.length; + let count = 0; + while (count < searchLength && current[--index1] === old[--index2]) { + count++; + } + return count; + } + function intersect(start1, end1, start2, end2) { + if (end1 < start2 || end2 < start1) { + return -1; + } + if (end1 === start2 || end2 === start1) { + return 0; + } + if (start1 < start2) { + if (end1 < end2) { + return end1 - start2; + } + return end2 - start2; + } + if (end2 < end1) { + return end2 - start1; + } + return end1 - start1; + } + function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { + let prefixCount = 0; + let suffixCount = 0; + const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); + if (currentStart === 0 && oldStart === 0) { + prefixCount = sharedPrefix(current, old, minLength); + } + if (currentEnd === current.length && oldEnd === old.length) { + suffixCount = sharedSuffix(current, old, minLength - prefixCount); + } + currentStart += prefixCount; + oldStart += prefixCount; + currentEnd -= suffixCount; + oldEnd -= suffixCount; + if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) { + return emptyArray; + } + if (currentStart === currentEnd) { + const splice2 = newSplice(currentStart, [], 0); + while (oldStart < oldEnd) { + splice2.removed.push(old[oldStart++]); + } + return [splice2]; + } else if (oldStart === oldEnd) { + return [newSplice(currentStart, [], currentEnd - currentStart)]; + } + const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); + const splices = []; + let splice = void 0; + let index = currentStart; + let oldIndex = oldStart; + for (let i = 0; i < ops.length; ++i) { + switch (ops[i]) { + case EDIT_LEAVE: + if (splice !== void 0) { + splices.push(splice); + splice = void 0; + } + index++; + oldIndex++; + break; + case EDIT_UPDATE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + case EDIT_ADD: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + break; + case EDIT_DELETE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + } + } + if (splice !== void 0) { + splices.push(splice); + } + return splices; + } + function mergeSplice(splices, index, removed, addedCount) { + const splice = newSplice(index, removed, addedCount); + let inserted = false; + let insertionOffset = 0; + for (let i = 0; i < splices.length; i++) { + const current = splices[i]; + current.index += insertionOffset; + if (inserted) { + continue; + } + const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount); + if (intersectCount >= 0) { + splices.splice(i, 1); + i--; + insertionOffset -= current.addedCount - current.removed.length; + splice.addedCount += current.addedCount - intersectCount; + const deleteCount = splice.removed.length + current.removed.length - intersectCount; + if (!splice.addedCount && !deleteCount) { + inserted = true; + } else { + let currentRemoved = current.removed; + if (splice.index < current.index) { + const prepend = splice.removed.slice(0, current.index - splice.index); + $push.apply(prepend, currentRemoved); + currentRemoved = prepend; + } + if (splice.index + splice.removed.length > current.index + current.addedCount) { + const append = splice.removed.slice(current.index + current.addedCount - splice.index); + $push.apply(currentRemoved, append); + } + splice.removed = currentRemoved; + if (current.index < splice.index) { + splice.index = current.index; + } + } + } else if (splice.index < current.index) { + inserted = true; + splices.splice(i, 0, splice); + i++; + const offset = splice.addedCount - splice.removed.length; + current.index += offset; + insertionOffset += offset; + } + } + if (!inserted) { + splices.push(splice); + } + } + function createInitialSplices(changeRecords) { + const splices = []; + for (let i = 0, ii = changeRecords.length; i < ii; i++) { + const record = changeRecords[i]; + mergeSplice(splices, record.index, record.removed, record.addedCount); + } + return splices; + } + function projectArraySplices(array, changeRecords) { + let splices = []; + const initialSplices = createInitialSplices(changeRecords); + for (let i = 0, ii = initialSplices.length; i < ii; ++i) { + const splice = initialSplices[i]; + if (splice.addedCount === 1 && splice.removed.length === 1) { + if (splice.removed[0] !== array[splice.index]) { + splices.push(splice); + } + continue; + } + splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length)); + } + return splices; + } + var EDIT_LEAVE, EDIT_UPDATE, EDIT_ADD, EDIT_DELETE, $push; + var init_array_change_records = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js"() { + init_platform(); + EDIT_LEAVE = 0; + EDIT_UPDATE = 1; + EDIT_ADD = 2; + EDIT_DELETE = 3; + $push = Array.prototype.push; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js + function adjustIndex(changeRecord, array) { + let index = changeRecord.index; + const arrayLength = array.length; + if (index > arrayLength) { + index = arrayLength - changeRecord.addedCount; + } else if (index < 0) { + index = arrayLength + changeRecord.removed.length + index - changeRecord.addedCount; + } + if (index < 0) { + index = 0; + } + changeRecord.index = index; + return changeRecord; + } + function enableArrayObservation() { + if (arrayObservationEnabled) { + return; + } + arrayObservationEnabled = true; + Observable.setArrayObserverFactory((collection) => { + return new ArrayObserver(collection); + }); + const proto = Array.prototype; + if (proto.$fastPatch) { + return; + } + Reflect.defineProperty(proto, "$fastPatch", { + value: 1, + enumerable: false + }); + const pop = proto.pop; + const push = proto.push; + const reverse = proto.reverse; + const shift = proto.shift; + const sort = proto.sort; + const splice = proto.splice; + const unshift = proto.unshift; + proto.pop = function() { + const notEmpty = this.length > 0; + const methodCallResult = pop.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(this.length, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.push = function() { + const methodCallResult = push.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this)); + } + return methodCallResult; + }; + proto.reverse = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = reverse.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.shift = function() { + const notEmpty = this.length > 0; + const methodCallResult = shift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(0, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.sort = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = sort.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.splice = function() { + const methodCallResult = splice.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this)); + } + return methodCallResult; + }; + proto.unshift = function() { + const methodCallResult = unshift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this)); + } + return methodCallResult; + }; + } + var arrayObservationEnabled, ArrayObserver; + var init_array_observer = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js"() { + init_dom(); + init_array_change_records(); + init_notifier(); + init_observable(); + arrayObservationEnabled = false; + ArrayObserver = class extends SubscriberSet { + constructor(source) { + super(source); + this.oldCollection = void 0; + this.splices = void 0; + this.needsQueue = true; + this.call = this.flush; + Reflect.defineProperty(source, "$fastController", { + value: this, + enumerable: false + }); + } + subscribe(subscriber) { + this.flush(); + super.subscribe(subscriber); + } + addSplice(splice) { + if (this.splices === void 0) { + this.splices = [splice]; + } else { + this.splices.push(splice); + } + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + reset(oldCollection) { + this.oldCollection = oldCollection; + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + flush() { + const splices = this.splices; + const oldCollection = this.oldCollection; + if (splices === void 0 && oldCollection === void 0) { + return; + } + this.needsQueue = true; + this.splices = void 0; + this.oldCollection = void 0; + const finalSplices = oldCollection === void 0 ? projectArraySplices(this.source, splices) : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length); + this.notify(finalSplices); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/ref.js + function ref(propertyName) { + return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); + } + var RefBehavior; + var init_ref = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/ref.js"() { + init_html_directive(); + RefBehavior = class { + /** + * Creates an instance of RefBehavior. + * @param target - The element to reference. + * @param propertyName - The name of the property to assign the reference to. + */ + constructor(target, propertyName) { + this.target = target; + this.propertyName = propertyName; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + source[this.propertyName] = this.target; + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ + unbind() { + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/interfaces.js + var isFunction; + var init_interfaces = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/interfaces.js"() { + isFunction = (object) => typeof object === "function"; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/when.js + function normalizeBinding(value) { + return value === void 0 ? noTemplate : isFunction(value) ? value : () => value; + } + function when(binding, templateOrTemplateBinding, elseTemplateOrTemplateBinding) { + const dataBinding = isFunction(binding) ? binding : () => binding; + const templateBinding = normalizeBinding(templateOrTemplateBinding); + const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding); + return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context); + } + var noTemplate; + var init_when = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/when.js"() { + init_interfaces(); + noTemplate = () => null; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js + function bindWithoutPositioning(view, items, index, context) { + view.bind(items[index], context); + } + function bindWithPositioning(view, items, index, context) { + const childContext = Object.create(context); + childContext.index = index; + childContext.length = items.length; + view.bind(items[index], childContext); + } + var defaultRepeatOptions, RepeatBehavior, RepeatDirective; + var init_repeat = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js"() { + init_dom(); + init_observable(); + init_array_observer(); + init_platform(); + init_html_directive(); + init_view(); + defaultRepeatOptions = Object.freeze({ + positioning: false, + recycle: true + }); + RepeatBehavior = class { + /** + * Creates an instance of RepeatBehavior. + * @param location - The location in the DOM to render the repeat. + * @param itemsBinding - The array to render. + * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies. + * @param templateBinding - The template to render for each item. + * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies. + * @param options - Options used to turn on special repeat features. + */ + constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) { + this.location = location; + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.source = null; + this.views = []; + this.items = null; + this.itemsObserver = null; + this.originalContext = void 0; + this.childContext = void 0; + this.bindView = bindWithoutPositioning; + this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile); + this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile); + if (options.positioning) { + this.bindView = bindWithPositioning; + } + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source, context) { + this.source = source; + this.originalContext = context; + this.childContext = Object.create(context); + this.childContext.parent = source; + this.childContext.parentContext = this.originalContext; + this.items = this.itemsBindingObserver.observe(source, this.originalContext); + this.template = this.templateBindingObserver.observe(source, this.originalContext); + this.observeItems(true); + this.refreshAllViews(); + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.source = null; + this.items = null; + if (this.itemsObserver !== null) { + this.itemsObserver.unsubscribe(this); + } + this.unbindAllViews(); + this.itemsBindingObserver.disconnect(); + this.templateBindingObserver.disconnect(); + } + /** @internal */ + handleChange(source, args) { + if (source === this.itemsBinding) { + this.items = this.itemsBindingObserver.observe(this.source, this.originalContext); + this.observeItems(); + this.refreshAllViews(); + } else if (source === this.templateBinding) { + this.template = this.templateBindingObserver.observe(this.source, this.originalContext); + this.refreshAllViews(true); + } else { + this.updateViews(args); + } + } + observeItems(force = false) { + if (!this.items) { + this.items = emptyArray; + return; + } + const oldObserver = this.itemsObserver; + const newObserver = this.itemsObserver = Observable.getNotifier(this.items); + const hasNewObserver = oldObserver !== newObserver; + if (hasNewObserver && oldObserver !== null) { + oldObserver.unsubscribe(this); + } + if (hasNewObserver || force) { + newObserver.subscribe(this); + } + } + updateViews(splices) { + const childContext = this.childContext; + const views = this.views; + const bindView = this.bindView; + const items = this.items; + const template = this.template; + const recycle = this.options.recycle; + const leftoverViews = []; + let leftoverIndex = 0; + let availableViews = 0; + for (let i = 0, ii = splices.length; i < ii; ++i) { + const splice = splices[i]; + const removed = splice.removed; + let removeIndex = 0; + let addIndex = splice.index; + const end = addIndex + splice.addedCount; + const removedViews = views.splice(splice.index, removed.length); + const totalAvailableViews = availableViews = leftoverViews.length + removedViews.length; + for (; addIndex < end; ++addIndex) { + const neighbor = views[addIndex]; + const location = neighbor ? neighbor.firstChild : this.location; + let view; + if (recycle && availableViews > 0) { + if (removeIndex <= totalAvailableViews && removedViews.length > 0) { + view = removedViews[removeIndex]; + removeIndex++; + } else { + view = leftoverViews[leftoverIndex]; + leftoverIndex++; + } + availableViews--; + } else { + view = template.create(); + } + views.splice(addIndex, 0, view); + bindView(view, items, addIndex, childContext); + view.insertBefore(location); + } + if (removedViews[removeIndex]) { + leftoverViews.push(...removedViews.slice(removeIndex)); + } + } + for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) { + leftoverViews[i].dispose(); + } + if (this.options.positioning) { + for (let i = 0, ii = views.length; i < ii; ++i) { + const currentContext = views[i].context; + currentContext.length = ii; + currentContext.index = i; + } + } + } + refreshAllViews(templateChanged = false) { + const items = this.items; + const childContext = this.childContext; + const template = this.template; + const location = this.location; + const bindView = this.bindView; + let itemsLength = items.length; + let views = this.views; + let viewsLength = views.length; + if (itemsLength === 0 || templateChanged || !this.options.recycle) { + HTMLView.disposeContiguousBatch(views); + viewsLength = 0; + } + if (viewsLength === 0) { + this.views = views = new Array(itemsLength); + for (let i = 0; i < itemsLength; ++i) { + const view = template.create(); + bindView(view, items, i, childContext); + views[i] = view; + view.insertBefore(location); + } + } else { + let i = 0; + for (; i < itemsLength; ++i) { + if (i < viewsLength) { + const view = views[i]; + bindView(view, items, i, childContext); + } else { + const view = template.create(); + bindView(view, items, i, childContext); + views.push(view); + view.insertBefore(location); + } + } + const removed = views.splice(i, viewsLength - i); + for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) { + removed[i].dispose(); + } + } + } + unbindAllViews() { + const views = this.views; + for (let i = 0, ii = views.length; i < ii; ++i) { + views[i].unbind(); + } + } + }; + RepeatDirective = class extends HTMLDirective { + /** + * Creates an instance of RepeatDirective. + * @param itemsBinding - The binding that provides the array to render. + * @param templateBinding - The template binding used to obtain a template to render for each item in the array. + * @param options - Options used to turn on special repeat features. + */ + constructor(itemsBinding, templateBinding, options) { + super(); + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.createPlaceholder = DOM.createBlockPlaceholder; + enableArrayObservation(); + this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding); + this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + */ + createBehavior(target) { + return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js + function elements(selector) { + if (selector) { + return function(value, index, array) { + return value.nodeType === 1 && value.matches(selector); + }; + } + return function(value, index, array) { + return value.nodeType === 1; + }; + } + var NodeObservationBehavior; + var init_node_observation = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js"() { + init_observable(); + init_platform(); + NodeObservationBehavior = class { + /** + * Creates an instance of NodeObservationBehavior. + * @param target - The target to assign the nodes property on. + * @param options - The options to use in configuring node observation. + */ + constructor(target, options) { + this.target = target; + this.options = options; + this.source = null; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + const name = this.options.property; + this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name); + this.source = source; + this.updateTarget(this.computeNodes()); + if (this.shouldUpdate) { + this.observe(); + } + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.updateTarget(emptyArray); + this.source = null; + if (this.shouldUpdate) { + this.disconnect(); + } + } + /** @internal */ + handleEvent() { + this.updateTarget(this.computeNodes()); + } + computeNodes() { + let nodes = this.getNodes(); + if (this.options.filter !== void 0) { + nodes = nodes.filter(this.options.filter); + } + return nodes; + } + updateTarget(value) { + this.source[this.options.property] = value; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js + function slotted(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { property: propertyOrOptions }; + } + return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions); + } + var SlottedBehavior; + var init_slotted = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js"() { + init_html_directive(); + init_node_observation(); + SlottedBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of SlottedBehavior. + * @param target - The slot element target to observe. + * @param options - The options to use when observing the slot. + */ + constructor(target, options) { + super(target, options); + } + /** + * Begins observation of the nodes. + */ + observe() { + this.target.addEventListener("slotchange", this); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.target.removeEventListener("slotchange", this); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + return this.target.assignedNodes(this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/children.js + function children(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { + property: propertyOrOptions + }; + } + return new AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions); + } + var ChildrenBehavior; + var init_children = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/children.js"() { + init_html_directive(); + init_node_observation(); + ChildrenBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of ChildrenBehavior. + * @param target - The element target to observe children on. + * @param options - The options to use when observing the element children. + */ + constructor(target, options) { + super(target, options); + this.observer = null; + options.childList = true; + } + /** + * Begins observation of the nodes. + */ + observe() { + if (this.observer === null) { + this.observer = new MutationObserver(this.handleEvent.bind(this)); + } + this.observer.observe(this.target, this.options); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.observer.disconnect(); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + if ("subtree" in this.options) { + return Array.from(this.target.querySelectorAll(this.options.selector)); + } + return Array.from(this.target.childNodes); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/index.js + var init_esm = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/index.js"() { + init_platform(); + init_template(); + init_fast_element(); + init_fast_definitions(); + init_attributes(); + init_controller(); + init_compiler(); + init_element_styles(); + init_css(); + init_css_directive(); + init_view(); + init_observable(); + init_notifier(); + init_dom(); + init_binding(); + init_html_directive(); + init_ref(); + init_when(); + init_repeat(); + init_slotted(); + init_children(); + init_node_observation(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js + var StartEnd, endSlotTemplate, startSlotTemplate, endTemplate, startTemplate; + var init_start_end = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js"() { + init_esm(); + StartEnd = class { + handleStartContentChange() { + this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); + } + handleEndContentChange() { + this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); + } + }; + endSlotTemplate = (context, definition) => html` + definition.end ? "end" : void 0} + > + + ${definition.end || ""} + + +`; + startSlotTemplate = (context, definition) => html` + + + ${definition.start || ""} + + +`; + endTemplate = html` + + + +`; + startTemplate = html` + + + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js + var init_accordion_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es6 = __esm({ + "node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/di.js + function cloneArrayWithPossibleProps(source) { + const clone = source.slice(); + const keys = Object.keys(source); + const len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + clone[key] = source[key]; + } + } + return clone; + } + function getParamTypes(key) { + return (Type) => { + return Reflect.getOwnMetadata(key, Type); + }; + } + function createResolver(getter) { + return function(key) { + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor); + }; + return resolver; + }; + } + function createAllResolver(getter) { + return function(key, searchAncestors) { + searchAncestors = !!searchAncestors; + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor, searchAncestors); + }; + return resolver; + }; + } + function ignore(target, property, descriptor) { + DI.inject(ignore)(target, property, descriptor); + } + function createNewInstance(key, handler) { + return handler.getFactory(key).construct(handler); + } + function containerGetKey(d) { + return this.get(d); + } + function transformInstance(inst, transform) { + return transform(inst); + } + function isRegistry(obj) { + return typeof obj.register === "function"; + } + function isSelfRegistry(obj) { + return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; + } + function isRegisterInRequester(obj) { + return isSelfRegistry(obj) && obj.registerInRequestor; + } + function isClass(obj) { + return obj.prototype !== void 0; + } + function cacheCallbackResult(fun) { + return function(handler, requestor, resolver) { + if (cache.has(resolver)) { + return cache.get(resolver); + } + const t = fun(handler, requestor, resolver); + cache.set(resolver, t); + return t; + }; + } + function validateKey(key) { + if (key === null || key === void 0) { + throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); + } + } + function buildAllResponse(resolver, handler, requestor) { + if (resolver instanceof ResolverImpl && resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].resolve(handler, requestor); + } + return results; + } + return [resolver.resolve(handler, requestor)]; + } + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + function isArrayIndex(value) { + switch (typeof value) { + case "number": + return value >= 0 && (value | 0) === value; + case "string": { + const result = isNumericLookup[value]; + if (result !== void 0) { + return result; + } + const length = value.length; + if (length === 0) { + return isNumericLookup[value] = false; + } + let ch = 0; + for (let i = 0; i < length; ++i) { + ch = value.charCodeAt(i); + if (i === 0 && ch === 48 && length > 1 || ch < 48 || ch > 57) { + return isNumericLookup[value] = false; + } + } + return isNumericLookup[value] = true; + } + default: + return false; + } + } + var metadataByTarget, ResolverBuilder, DefaultResolver, ContainerConfiguration, dependencyLookup, rootDOMContainer, DI, Container, inject, defaultSingletonOptions, all, lazy, optional, newInstanceForScope, newInstanceOf, ResolverImpl, FactoryImpl, containerResolver, InstrinsicTypeNames, DILocateParentEventType, factories, ContainerImpl, cache, Registration, defaultFriendlyName, isNativeFunction, isNumericLookup; + var init_di = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"() { + init_esm(); + metadataByTarget = /* @__PURE__ */ new Map(); + if (!("metadata" in Reflect)) { + Reflect.metadata = function(key, value) { + return function(target) { + Reflect.defineMetadata(key, value, target); + }; + }; + Reflect.defineMetadata = function(key, value, target) { + let metadata = metadataByTarget.get(target); + if (metadata === void 0) { + metadataByTarget.set(target, metadata = /* @__PURE__ */ new Map()); + } + metadata.set(key, value); + }; + Reflect.getOwnMetadata = function(key, target) { + const metadata = metadataByTarget.get(target); + if (metadata !== void 0) { + return metadata.get(key); + } + return void 0; + }; + } + ResolverBuilder = class { + /** + * + * @param container - The container to create resolvers for. + * @param key - The key to register resolvers under. + */ + constructor(container, key) { + this.container = container; + this.key = key; + } + /** + * Creates a resolver for an existing object instance. + * @param value - The instance to resolve. + * @returns The resolver. + */ + instance(value) { + return this.registerResolver(0, value); + } + /** + * Creates a resolver that enforces a singleton lifetime. + * @param value - The type to create and cache the singleton for. + * @returns The resolver. + */ + singleton(value) { + return this.registerResolver(1, value); + } + /** + * Creates a resolver that creates a new instance for every dependency request. + * @param value - The type to create instances of. + * @returns - The resolver. + */ + transient(value) { + return this.registerResolver(2, value); + } + /** + * Creates a resolver that invokes a callback function for every dependency resolution + * request, allowing custom logic to return the dependency. + * @param value - The callback to call during resolution. + * @returns The resolver. + */ + callback(value) { + return this.registerResolver(3, value); + } + /** + * Creates a resolver that invokes a callback function the first time that a dependency + * resolution is requested. The returned value is then cached and provided for all + * subsequent requests. + * @param value - The callback to call during the first resolution. + * @returns The resolver. + */ + cachedCallback(value) { + return this.registerResolver(3, cacheCallbackResult(value)); + } + /** + * Aliases the current key to a different key. + * @param destinationKey - The key to point the alias to. + * @returns The resolver. + */ + aliasTo(destinationKey) { + return this.registerResolver(5, destinationKey); + } + registerResolver(strategy, state) { + const { container, key } = this; + this.container = this.key = void 0; + return container.registerResolver(key, new ResolverImpl(key, strategy, state)); + } + }; + DefaultResolver = Object.freeze({ + /** + * Disables auto-registration and throws for all un-registered dependencies. + * @param key - The key to create the resolver for. + */ + none(key) { + throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`); + }, + /** + * Provides default singleton resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + singleton(key) { + return new ResolverImpl(key, 1, key); + }, + /** + * Provides default transient resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + transient(key) { + return new ResolverImpl(key, 2, key); + } + }); + ContainerConfiguration = Object.freeze({ + /** + * The default configuration used when creating a DOM-disconnected container. + * @remarks + * The default creates a root container, with no parent container. It does not handle + * owner requests and it uses singleton resolution behavior for auto-registration. + */ + default: Object.freeze({ + parentLocator: () => null, + responsibleForOwnerRequests: false, + defaultResolver: DefaultResolver.singleton + }) + }); + dependencyLookup = /* @__PURE__ */ new Map(); + rootDOMContainer = null; + DI = Object.freeze({ + /** + * Creates a new dependency injection container. + * @param config - The configuration for the container. + * @returns A newly created dependency injection container. + */ + createContainer(config) { + return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); + }, + /** + * Finds the dependency injection container responsible for providing dependencies + * to the specified node. + * @param node - The node to find the responsible container for. + * @returns The container responsible for providing dependencies to the node. + * @remarks + * This will be the same as the parent container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findResponsibleContainer(node) { + const owned = node.$$container$$; + if (owned && owned.responsibleForOwnerRequests) { + return owned; + } + return DI.findParentContainer(node); + }, + /** + * Find the dependency injection container up the DOM tree from this node. + * @param node - The node to find the parent container for. + * @returns The parent container of this node. + * @remarks + * This will be the same as the responsible container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findParentContainer(node) { + const event = new CustomEvent(DILocateParentEventType, { + bubbles: true, + composed: true, + cancelable: true, + detail: { container: void 0 } + }); + node.dispatchEvent(event); + return event.detail.container || DI.getOrCreateDOMContainer(); + }, + /** + * Returns a dependency injection container if one is explicitly owned by the specified + * node. If one is not owned, then a new container is created and assigned to the node. + * @param node - The node to find or create the container for. + * @param config - The configuration for the container if one needs to be created. + * @returns The located or created container. + * @remarks + * This API does not search for a responsible or parent container. It looks only for a container + * directly defined on the specified node and creates one at that location if one does not + * already exist. + */ + getOrCreateDOMContainer(node, config) { + if (!node) { + return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: () => null + }))); + } + return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: DI.findParentContainer + })); + }, + /** + * Gets the "design:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getDesignParamtypes: getParamTypes("design:paramtypes"), + /** + * Gets the "di:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getAnnotationParamtypes: getParamTypes("di:paramtypes"), + /** + * + * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, + * an empty metadata array is created and added. + * @returns The metadata array. + */ + getOrCreateAnnotationParamTypes(Type) { + let annotationParamtypes = this.getAnnotationParamtypes(Type); + if (annotationParamtypes === void 0) { + Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); + } + return annotationParamtypes; + }, + /** + * Gets the dependency keys representing what is needed to instantiate the specified type. + * @param Type - The type to get the dependencies for. + * @returns An array of dependency keys. + */ + getDependencies(Type) { + let dependencies = dependencyLookup.get(Type); + if (dependencies === void 0) { + const inject2 = Type.inject; + if (inject2 === void 0) { + const designParamtypes = DI.getDesignParamtypes(Type); + const annotationParamtypes = DI.getAnnotationParamtypes(Type); + if (designParamtypes === void 0) { + if (annotationParamtypes === void 0) { + const Proto = Object.getPrototypeOf(Type); + if (typeof Proto === "function" && Proto !== Function.prototype) { + dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); + } else { + dependencies = []; + } + } else { + dependencies = cloneArrayWithPossibleProps(annotationParamtypes); + } + } else if (annotationParamtypes === void 0) { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + } else { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + let len = annotationParamtypes.length; + let auAnnotationParamtype; + for (let i = 0; i < len; ++i) { + auAnnotationParamtype = annotationParamtypes[i]; + if (auAnnotationParamtype !== void 0) { + dependencies[i] = auAnnotationParamtype; + } + } + const keys = Object.keys(annotationParamtypes); + len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + dependencies[key] = annotationParamtypes[key]; + } + } + } + } else { + dependencies = cloneArrayWithPossibleProps(inject2); + } + dependencyLookup.set(Type, dependencies); + } + return dependencies; + }, + /** + * Defines a property on a web component class. The value of this property will + * be resolved from the dependency injection container responsible for the element + * instance, based on where it is connected in the DOM. + * @param target - The target to define the property on. + * @param propertyName - The name of the property to define. + * @param key - The dependency injection key. + * @param respectConnection - Indicates whether or not to update the property value if the + * hosting component is disconnected and then re-connected at a different location in the DOM. + * @remarks + * The respectConnection option is only applicable to elements that descend from FASTElement. + */ + defineProperty(target, propertyName, key, respectConnection = false) { + const diPropertyKey = `$di_${propertyName}`; + Reflect.defineProperty(target, propertyName, { + get: function() { + let value = this[diPropertyKey]; + if (value === void 0) { + const container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); + value = container.get(key); + this[diPropertyKey] = value; + if (respectConnection && this instanceof FASTElement) { + const notifier = this.$fastController; + const handleChange = () => { + const newContainer = DI.findResponsibleContainer(this); + const newValue = newContainer.get(key); + const oldValue = this[diPropertyKey]; + if (newValue !== oldValue) { + this[diPropertyKey] = value; + notifier.notify(propertyName); + } + }; + notifier.subscribe({ handleChange }, "isConnected"); + } + } + return value; + } + }); + }, + /** + * Creates a dependency injection key. + * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a + * default resolution for the dependency. + * @param configuror - If a friendly name was provided for the first parameter, then an optional + * lambda that configures a default resolution for the dependency can be provided second. + * @returns The created key. + * @remarks + * The created key can be used as a property decorator or constructor parameter decorator, + * in addition to its standard use in an inject array or through direct container APIs. + */ + createInterface(nameConfigOrCallback, configuror) { + const configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; + const friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; + const respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; + const Interface = function(target, property, index) { + if (target == null || new.target !== void 0) { + throw new Error(`No registration for interface: '${Interface.friendlyName}'`); + } + if (property) { + DI.defineProperty(target, property, Interface, respectConnection); + } else { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + annotationParamtypes[index] = Interface; + } + }; + Interface.$isInterface = true; + Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; + if (configure != null) { + Interface.register = function(container, key) { + return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); + }; + } + Interface.toString = function toString() { + return `InterfaceSymbol<${Interface.friendlyName}>`; + }; + return Interface; + }, + /** + * A decorator that specifies what to inject into its target. + * @param dependencies - The dependencies to inject. + * @returns The decorator to be applied to the target class. + * @remarks + * The decorator can be used to decorate a class, listing all of the classes dependencies. + * Or it can be used to decorate a constructor paramter, indicating what to inject for that + * parameter. + * Or it can be used for a web component property, indicating what that property should resolve to. + */ + inject(...dependencies) { + return function(target, key, descriptor) { + if (typeof descriptor === "number") { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + const dep = dependencies[0]; + if (dep !== void 0) { + annotationParamtypes[descriptor] = dep; + } + } else if (key) { + DI.defineProperty(target, key, dependencies[0]); + } else { + const annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); + let dep; + for (let i = 0; i < dependencies.length; ++i) { + dep = dependencies[i]; + if (dep !== void 0) { + annotationParamtypes[i] = dep; + } + } + } + }; + }, + /** + * Registers the `target` class as a transient dependency; each time the dependency is resolved + * a new instance will be created. + * + * @param target - The class / constructor function to register as transient. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.transient(Foo); + * ``` + * + * @example + * Inline declaration + * + * ```ts + * const Foo = DI.transient(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + transient(target) { + target.register = function register(container) { + const registration = Registration.transient(target, target); + return registration.register(container); + }; + target.registerInRequestor = false; + return target; + }, + /** + * Registers the `target` class as a singleton dependency; the class will only be created once. Each + * consecutive time the dependency is resolved, the same instance will be returned. + * + * @param target - The class / constructor function to register as a singleton. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.singleton(Foo); + * ``` + * + * @example + * Inline declaration + * ```ts + * const Foo = DI.singleton(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + singleton(target, options = defaultSingletonOptions) { + target.register = function register(container) { + const registration = Registration.singleton(target, target); + return registration.register(container); + }; + target.registerInRequestor = options.scoped; + return target; + } + }); + Container = DI.createInterface("Container"); + inject = DI.inject; + defaultSingletonOptions = { scoped: false }; + all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors)); + lazy = createResolver((key, handler, requestor) => { + return () => requestor.get(key); + }); + optional = createResolver((key, handler, requestor) => { + if (requestor.has(key, true)) { + return requestor.get(key); + } else { + return void 0; + } + }); + ignore.$isResolver = true; + ignore.resolve = () => void 0; + newInstanceForScope = createResolver((key, handler, requestor) => { + const instance = createNewInstance(key, handler); + const resolver = new ResolverImpl(key, 0, instance); + requestor.registerResolver(key, resolver); + return instance; + }); + newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler)); + ResolverImpl = class { + constructor(key, strategy, state) { + this.key = key; + this.strategy = strategy; + this.state = state; + this.resolving = false; + } + get $isResolver() { + return true; + } + register(container) { + return container.registerResolver(this.key, this); + } + resolve(handler, requestor) { + switch (this.strategy) { + case 0: + return this.state; + case 1: { + if (this.resolving) { + throw new Error(`Cyclic dependency found: ${this.state.name}`); + } + this.resolving = true; + this.state = handler.getFactory(this.state).construct(requestor); + this.strategy = 0; + this.resolving = false; + return this.state; + } + case 2: { + const factory = handler.getFactory(this.state); + if (factory === null) { + throw new Error(`Resolver for ${String(this.key)} returned a null factory`); + } + return factory.construct(requestor); + } + case 3: + return this.state(handler, requestor, this); + case 4: + return this.state[0].resolve(handler, requestor); + case 5: + return requestor.get(this.state); + default: + throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`); + } + } + getFactory(container) { + var _a, _b, _c; + switch (this.strategy) { + case 1: + case 2: + return container.getFactory(this.state); + case 5: + return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; + default: + return null; + } + } + }; + FactoryImpl = class { + constructor(Type, dependencies) { + this.Type = Type; + this.dependencies = dependencies; + this.transformers = null; + } + construct(container, dynamicDependencies) { + let instance; + if (dynamicDependencies === void 0) { + instance = new this.Type(...this.dependencies.map(containerGetKey, container)); + } else { + instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies); + } + if (this.transformers == null) { + return instance; + } + return this.transformers.reduce(transformInstance, instance); + } + registerTransformer(transformer) { + (this.transformers || (this.transformers = [])).push(transformer); + } + }; + containerResolver = { + $isResolver: true, + resolve(handler, requestor) { + return requestor; + } + }; + InstrinsicTypeNames = /* @__PURE__ */ new Set([ + "Array", + "ArrayBuffer", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Number", + "Object", + "Promise", + "RangeError", + "ReferenceError", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "URIError", + "WeakMap", + "WeakSet" + ]); + DILocateParentEventType = "__DI_LOCATE_PARENT__"; + factories = /* @__PURE__ */ new Map(); + ContainerImpl = class _ContainerImpl { + constructor(owner, config) { + this.owner = owner; + this.config = config; + this._parent = void 0; + this.registerDepth = 0; + this.context = null; + if (owner !== null) { + owner.$$container$$ = this; + } + this.resolvers = /* @__PURE__ */ new Map(); + this.resolvers.set(Container, containerResolver); + if (owner instanceof Node) { + owner.addEventListener(DILocateParentEventType, (e) => { + if (e.composedPath()[0] !== this.owner) { + e.detail.container = this; + e.stopImmediatePropagation(); + } + }); + } + } + get parent() { + if (this._parent === void 0) { + this._parent = this.config.parentLocator(this.owner); + } + return this._parent; + } + get depth() { + return this.parent === null ? 0 : this.parent.depth + 1; + } + get responsibleForOwnerRequests() { + return this.config.responsibleForOwnerRequests; + } + registerWithContext(context, ...params) { + this.context = context; + this.register(...params); + this.context = null; + return this; + } + register(...params) { + if (++this.registerDepth === 100) { + throw new Error("Unable to autoregister dependency"); + } + let current; + let keys; + let value; + let j; + let jj; + const context = this.context; + for (let i = 0, ii = params.length; i < ii; ++i) { + current = params[i]; + if (!isObject(current)) { + continue; + } + if (isRegistry(current)) { + current.register(this, context); + } else if (isClass(current)) { + Registration.singleton(current, current).register(this); + } else { + keys = Object.keys(current); + j = 0; + jj = keys.length; + for (; j < jj; ++j) { + value = current[keys[j]]; + if (!isObject(value)) { + continue; + } + if (isRegistry(value)) { + value.register(this, context); + } else { + this.register(value); + } + } + } + } + --this.registerDepth; + return this; + } + registerResolver(key, resolver) { + validateKey(key); + const resolvers = this.resolvers; + const result = resolvers.get(key); + if (result == null) { + resolvers.set(key, resolver); + } else if (result instanceof ResolverImpl && result.strategy === 4) { + result.state.push(resolver); + } else { + resolvers.set(key, new ResolverImpl(key, 4, [result, resolver])); + } + return resolver; + } + registerTransformer(key, transformer) { + const resolver = this.getResolver(key); + if (resolver == null) { + return false; + } + if (resolver.getFactory) { + const factory = resolver.getFactory(this); + if (factory == null) { + return false; + } + factory.registerTransformer(transformer); + return true; + } + return false; + } + getResolver(key, autoRegister = true) { + validateKey(key); + if (key.resolve !== void 0) { + return key; + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + return autoRegister ? this.jitRegister(key, handler) : null; + } + current = current.parent; + } else { + return resolver; + } + } + return null; + } + has(key, searchAncestors = false) { + return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; + } + get(key) { + validateKey(key); + if (key.$isResolver) { + return key.resolve(this, this); + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + resolver = this.jitRegister(key, handler); + return resolver.resolve(current, this); + } + current = current.parent; + } else { + return resolver.resolve(current, this); + } + } + throw new Error(`Unable to resolve key: ${String(key)}`); + } + getAll(key, searchAncestors = false) { + validateKey(key); + const requestor = this; + let current = requestor; + let resolver; + if (searchAncestors) { + let resolutions = emptyArray; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver != null) { + resolutions = resolutions.concat( + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + buildAllResponse(resolver, current, requestor) + ); + } + current = current.parent; + } + return resolutions; + } else { + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + current = current.parent; + if (current == null) { + return emptyArray; + } + } else { + return buildAllResponse(resolver, current, requestor); + } + } + } + return emptyArray; + } + getFactory(Type) { + let factory = factories.get(Type); + if (factory === void 0) { + if (isNativeFunction(Type)) { + throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`); + } + factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); + } + return factory; + } + registerFactory(key, factory) { + factories.set(key, factory); + } + createChild(config) { + return new _ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this })); + } + jitRegister(keyAsValue, handler) { + if (typeof keyAsValue !== "function") { + throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`); + } + if (InstrinsicTypeNames.has(keyAsValue.name)) { + throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`); + } + if (isRegistry(keyAsValue)) { + const registrationResolver = keyAsValue.register(handler); + if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { + const newResolver = handler.resolvers.get(keyAsValue); + if (newResolver != void 0) { + return newResolver; + } + throw new Error("A valid resolver was not returned from the static register method"); + } + return registrationResolver; + } else if (keyAsValue.$isInterface) { + throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`); + } else { + const resolver = this.config.defaultResolver(keyAsValue, handler); + handler.resolvers.set(keyAsValue, resolver); + return resolver; + } + } + }; + cache = /* @__PURE__ */ new WeakMap(); + Registration = Object.freeze({ + /** + * Allows you to pass an instance. + * Every time you request this {@link Key} you will get this instance back. + * + * @example + * ``` + * Registration.instance(Foo, new Foo())); + * ``` + * + * @param key - The key to register the instance under. + * @param value - The instance to return when the key is requested. + */ + instance(key, value) { + return new ResolverImpl(key, 0, value); + }, + /** + * Creates an instance from the class. + * Every time you request this {@link Key} you will get the same one back. + * + * @example + * ``` + * Registration.singleton(Foo, Foo); + * ``` + * + * @param key - The key to register the singleton under. + * @param value - The class to instantiate as a singleton when first requested. + */ + singleton(key, value) { + return new ResolverImpl(key, 1, value); + }, + /** + * Creates an instance from a class. + * Every time you request this {@link Key} you will get a new instance. + * + * @example + * ``` + * Registration.instance(Foo, Foo); + * ``` + * + * @param key - The key to register the instance type under. + * @param value - The class to instantiate each time the key is requested. + */ + transient(key, value) { + return new ResolverImpl(key, 2, value); + }, + /** + * Delegates to a callback function to provide the dependency. + * Every time you request this {@link Key} the callback will be invoked to provide + * the dependency. + * + * @example + * ``` + * Registration.callback(Foo, () => new Foo()); + * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + */ + callback(key, callback) { + return new ResolverImpl(key, 3, callback); + }, + /** + * Delegates to a callback function to provide the dependency and then caches the + * dependency for future requests. + * + * @example + * ``` + * Registration.cachedCallback(Foo, () => new Foo()); + * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + * @remarks + * If you pass the same Registration to another container, the same cached value will be used. + * Should all references to the resolver returned be removed, the cache will expire. + */ + cachedCallback(key, callback) { + return new ResolverImpl(key, 3, cacheCallbackResult(callback)); + }, + /** + * Creates an alternate {@link Key} to retrieve an instance by. + * + * @example + * ``` + * Register.singleton(Foo, Foo) + * Register.aliasTo(Foo, MyFoos); + * + * container.getAll(MyFoos) // contains an instance of Foo + * ``` + * + * @param originalKey - The original key that has been registered. + * @param aliasKey - The alias to the original key. + */ + aliasTo(originalKey, aliasKey) { + return new ResolverImpl(aliasKey, 5, originalKey); + } + }); + defaultFriendlyName = "(anonymous)"; + isNativeFunction = /* @__PURE__ */ (function() { + const lookup = /* @__PURE__ */ new WeakMap(); + let isNative = false; + let sourceText = ""; + let i = 0; + return function(fn) { + isNative = lookup.get(fn); + if (isNative === void 0) { + sourceText = fn.toString(); + i = sourceText.length; + isNative = // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string + i >= 29 && // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. + i <= 100 && // This whole heuristic *could* be tricked by a comment. Do we need to care about that? + sourceText.charCodeAt(i - 1) === 125 && // } + // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. + sourceText.charCodeAt(i - 2) <= 32 && // whitespace + sourceText.charCodeAt(i - 3) === 93 && // ] + sourceText.charCodeAt(i - 4) === 101 && // e + sourceText.charCodeAt(i - 5) === 100 && // d + sourceText.charCodeAt(i - 6) === 111 && // o + sourceText.charCodeAt(i - 7) === 99 && // c + sourceText.charCodeAt(i - 8) === 32 && // + sourceText.charCodeAt(i - 9) === 101 && // e + sourceText.charCodeAt(i - 10) === 118 && // v + sourceText.charCodeAt(i - 11) === 105 && // i + sourceText.charCodeAt(i - 12) === 116 && // t + sourceText.charCodeAt(i - 13) === 97 && // a + sourceText.charCodeAt(i - 14) === 110 && // n + sourceText.charCodeAt(i - 15) === 88; + lookup.set(fn, isNative); + } + return isNative; + }; + })(); + isNumericLookup = {}; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js + function presentationKeyFromTag(tagName) { + return `${tagName.toLowerCase()}:presentation`; + } + var presentationRegistry, ComponentPresentation, DefaultComponentPresentation; + var init_component_presentation = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js"() { + init_esm(); + init_di(); + presentationRegistry = /* @__PURE__ */ new Map(); + ComponentPresentation = Object.freeze({ + /** + * Defines a component presentation for an element. + * @param tagName - The element name to define the presentation for. + * @param presentation - The presentation that will be applied to matching elements. + * @param container - The dependency injection container to register the configuration in. + * @public + */ + define(tagName, presentation, container) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === void 0) { + presentationRegistry.set(key, presentation); + } else { + presentationRegistry.set(key, false); + } + container.register(Registration.instance(key, presentation)); + }, + /** + * Finds a component presentation for the specified element name, + * searching the DOM hierarchy starting from the provided element. + * @param tagName - The name of the element to locate the presentation for. + * @param element - The element to begin the search from. + * @returns The component presentation or null if none is found. + * @public + */ + forTag(tagName, element) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === false) { + const container = DI.findResponsibleContainer(element); + return container.get(key); + } + return existing || null; + } + }); + DefaultComponentPresentation = class { + /** + * Creates an instance of DefaultComponentPresentation. + * @param template - The template to apply to the element. + * @param styles - The styles to apply to the element. + * @public + */ + constructor(template, styles) { + this.template = template || null; + this.styles = styles === void 0 ? null : Array.isArray(styles) ? ElementStyles.create(styles) : styles instanceof ElementStyles ? styles : ElementStyles.create([styles]); + } + /** + * Applies the presentation details to the specified element. + * @param element - The element to apply the presentation details to. + * @public + */ + applyTo(element) { + const controller = element.$fastController; + if (controller.template === null) { + controller.template = this.template; + } + if (controller.styles === null) { + controller.styles = this.styles; + } + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js + function resolveOption(option, context, definition) { + if (typeof option === "function") { + return option(context, definition); + } + return option; + } + var FoundationElement, FoundationElementRegistry; + var init_foundation_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js"() { + init_tslib_es6(); + init_esm(); + init_component_presentation(); + FoundationElement = class _FoundationElement extends FASTElement { + constructor() { + super(...arguments); + this._presentation = void 0; + } + /** + * A property which resolves the ComponentPresentation instance + * for the current component. + * @public + */ + get $presentation() { + if (this._presentation === void 0) { + this._presentation = ComponentPresentation.forTag(this.tagName, this); + } + return this._presentation; + } + templateChanged() { + if (this.template !== void 0) { + this.$fastController.template = this.template; + } + } + stylesChanged() { + if (this.styles !== void 0) { + this.$fastController.styles = this.styles; + } + } + /** + * The connected callback for this FASTElement. + * @remarks + * This method is invoked by the platform whenever this FoundationElement + * becomes connected to the document. + * @public + */ + connectedCallback() { + if (this.$presentation !== null) { + this.$presentation.applyTo(this); + } + super.connectedCallback(); + } + /** + * Defines an element registry function with a set of element definition defaults. + * @param elementDefinition - The definition of the element to create the registry + * function for. + * @public + */ + static compose(elementDefinition) { + return (overrideDefinition = {}) => new FoundationElementRegistry(this === _FoundationElement ? class extends _FoundationElement { + } : this, elementDefinition, overrideDefinition); + } + }; + __decorate([ + observable + ], FoundationElement.prototype, "template", void 0); + __decorate([ + observable + ], FoundationElement.prototype, "styles", void 0); + FoundationElementRegistry = class { + constructor(type, elementDefinition, overrideDefinition) { + this.type = type; + this.elementDefinition = elementDefinition; + this.overrideDefinition = overrideDefinition; + this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); + } + register(container, context) { + const definition = this.definition; + const overrideDefinition = this.overrideDefinition; + const prefix = definition.prefix || context.elementPrefix; + const name = `${prefix}-${definition.baseName}`; + context.tryDefineElement({ + name, + type: this.type, + baseClass: this.elementDefinition.baseClass, + callback: (x) => { + const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); + x.definePresentation(presentation); + let shadowOptions = resolveOption(definition.shadowOptions, x, definition); + if (x.shadowRootMode) { + if (shadowOptions) { + if (!overrideDefinition.shadowOptions) { + shadowOptions.mode = x.shadowRootMode; + } + } else if (shadowOptions !== null) { + shadowOptions = { mode: x.shadowRootMode }; + } + } + x.defineElement({ + elementOptions: resolveOption(definition.elementOptions, x, definition), + shadowOptions, + attributes: resolveOption(definition.attributes, x, definition) + }); + } + }); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js + function applyMixins(derivedCtor, ...baseCtors) { + const derivedAttributes = AttributeConfiguration.locate(derivedCtor); + baseCtors.forEach((baseCtor) => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { + if (name !== "constructor") { + Object.defineProperty( + derivedCtor.prototype, + name, + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + Object.getOwnPropertyDescriptor(baseCtor.prototype, name) + ); + } + }); + const baseAttributes = AttributeConfiguration.locate(baseCtor); + baseAttributes.forEach((x) => derivedAttributes.push(x)); + }); + } + var init_apply_mixins = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js"() { + init_esm(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js + var AccordionItem; + var init_accordion_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_start_end(); + init_apply_mixins(); + AccordionItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.headinglevel = 2; + this.expanded = false; + this.clickHandler = (e) => { + this.expanded = !this.expanded; + this.change(); + }; + this.change = () => { + this.$emit("change"); + }; + } + }; + __decorate([ + attr({ + attribute: "heading-level", + mode: "fromView", + converter: nullableNumberConverter + }) + ], AccordionItem.prototype, "headinglevel", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], AccordionItem.prototype, "expanded", void 0); + __decorate([ + attr + ], AccordionItem.prototype, "id", void 0); + applyMixins(AccordionItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js + var init_accordion_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js"() { + init_accordion_item_template(); + init_accordion_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js + var init_accordion_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/aria.js + var Orientation; + var init_aria = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/aria.js"() { + Orientation = { + horizontal: "horizontal", + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/array.js + function findLastIndex(array, predicate) { + let k = array.length; + while (k--) { + if (predicate(array[k], k, array)) { + return k; + } + } + return -1; + } + var init_array = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/array.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/class-names.js + var init_class_names = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/class-names.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-dom.js + function canUseDOM() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + var init_can_use_dom = __esm({ + "node_modules/exenv-es6/dist/can-use-dom.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-event-listeners.js + var init_can_use_event_listeners = __esm({ + "node_modules/exenv-es6/dist/can-use-event-listeners.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-viewport.js + var init_can_use_viewport = __esm({ + "node_modules/exenv-es6/dist/can-use-viewport.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-workers.js + var init_can_use_workers = __esm({ + "node_modules/exenv-es6/dist/can-use-workers.js"() { + } + }); + + // node_modules/exenv-es6/dist/index.js + var init_dist = __esm({ + "node_modules/exenv-es6/dist/index.js"() { + init_can_use_dom(); + init_can_use_event_listeners(); + init_can_use_viewport(); + init_can_use_workers(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/dom.js + function isHTMLElement(...args) { + return args.every((arg) => arg instanceof HTMLElement); + } + function getDisplayedNodes(rootNode, selector) { + if (!rootNode || !selector || !isHTMLElement(rootNode)) { + return; + } + const nodes = Array.from(rootNode.querySelectorAll(selector)); + return nodes.filter((node) => node.offsetParent !== null); + } + function getNonce() { + const node = document.querySelector('meta[property="csp-nonce"]'); + if (node) { + return node.getAttribute("content"); + } else { + return null; + } + } + function canUseFocusVisible() { + if (typeof _canUseFocusVisible === "boolean") { + return _canUseFocusVisible; + } + if (!canUseDOM()) { + _canUseFocusVisible = false; + return _canUseFocusVisible; + } + const styleElement = document.createElement("style"); + const styleNonce = getNonce(); + if (styleNonce !== null) { + styleElement.setAttribute("nonce", styleNonce); + } + document.head.appendChild(styleElement); + try { + styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); + _canUseFocusVisible = true; + } catch (e) { + _canUseFocusVisible = false; + } finally { + document.head.removeChild(styleElement); + } + return _canUseFocusVisible; + } + var _canUseFocusVisible; + var init_dom2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/dom.js"() { + init_dist(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/events.js + var eventFocus, eventFocusIn, eventFocusOut, eventKeyDown, eventResize, eventScroll; + var init_events = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/events.js"() { + eventFocus = "focus"; + eventFocusIn = "focusin"; + eventFocusOut = "focusout"; + eventKeyDown = "keydown"; + eventResize = "resize"; + eventScroll = "scroll"; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/html.js + var init_html = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/html.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/key-codes.js + var KeyCodes, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, keyEscape, keyHome, keyEnd, keyFunction2, keyPageDown, keyPageUp, keySpace, keyTab, keyBackspace, keyDelete, ArrowKeys; + var init_key_codes = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/key-codes.js"() { + (function(KeyCodes2) { + KeyCodes2[KeyCodes2["alt"] = 18] = "alt"; + KeyCodes2[KeyCodes2["arrowDown"] = 40] = "arrowDown"; + KeyCodes2[KeyCodes2["arrowLeft"] = 37] = "arrowLeft"; + KeyCodes2[KeyCodes2["arrowRight"] = 39] = "arrowRight"; + KeyCodes2[KeyCodes2["arrowUp"] = 38] = "arrowUp"; + KeyCodes2[KeyCodes2["back"] = 8] = "back"; + KeyCodes2[KeyCodes2["backSlash"] = 220] = "backSlash"; + KeyCodes2[KeyCodes2["break"] = 19] = "break"; + KeyCodes2[KeyCodes2["capsLock"] = 20] = "capsLock"; + KeyCodes2[KeyCodes2["closeBracket"] = 221] = "closeBracket"; + KeyCodes2[KeyCodes2["colon"] = 186] = "colon"; + KeyCodes2[KeyCodes2["colon2"] = 59] = "colon2"; + KeyCodes2[KeyCodes2["comma"] = 188] = "comma"; + KeyCodes2[KeyCodes2["ctrl"] = 17] = "ctrl"; + KeyCodes2[KeyCodes2["delete"] = 46] = "delete"; + KeyCodes2[KeyCodes2["end"] = 35] = "end"; + KeyCodes2[KeyCodes2["enter"] = 13] = "enter"; + KeyCodes2[KeyCodes2["equals"] = 187] = "equals"; + KeyCodes2[KeyCodes2["equals2"] = 61] = "equals2"; + KeyCodes2[KeyCodes2["equals3"] = 107] = "equals3"; + KeyCodes2[KeyCodes2["escape"] = 27] = "escape"; + KeyCodes2[KeyCodes2["forwardSlash"] = 191] = "forwardSlash"; + KeyCodes2[KeyCodes2["function1"] = 112] = "function1"; + KeyCodes2[KeyCodes2["function10"] = 121] = "function10"; + KeyCodes2[KeyCodes2["function11"] = 122] = "function11"; + KeyCodes2[KeyCodes2["function12"] = 123] = "function12"; + KeyCodes2[KeyCodes2["function2"] = 113] = "function2"; + KeyCodes2[KeyCodes2["function3"] = 114] = "function3"; + KeyCodes2[KeyCodes2["function4"] = 115] = "function4"; + KeyCodes2[KeyCodes2["function5"] = 116] = "function5"; + KeyCodes2[KeyCodes2["function6"] = 117] = "function6"; + KeyCodes2[KeyCodes2["function7"] = 118] = "function7"; + KeyCodes2[KeyCodes2["function8"] = 119] = "function8"; + KeyCodes2[KeyCodes2["function9"] = 120] = "function9"; + KeyCodes2[KeyCodes2["home"] = 36] = "home"; + KeyCodes2[KeyCodes2["insert"] = 45] = "insert"; + KeyCodes2[KeyCodes2["menu"] = 93] = "menu"; + KeyCodes2[KeyCodes2["minus"] = 189] = "minus"; + KeyCodes2[KeyCodes2["minus2"] = 109] = "minus2"; + KeyCodes2[KeyCodes2["numLock"] = 144] = "numLock"; + KeyCodes2[KeyCodes2["numPad0"] = 96] = "numPad0"; + KeyCodes2[KeyCodes2["numPad1"] = 97] = "numPad1"; + KeyCodes2[KeyCodes2["numPad2"] = 98] = "numPad2"; + KeyCodes2[KeyCodes2["numPad3"] = 99] = "numPad3"; + KeyCodes2[KeyCodes2["numPad4"] = 100] = "numPad4"; + KeyCodes2[KeyCodes2["numPad5"] = 101] = "numPad5"; + KeyCodes2[KeyCodes2["numPad6"] = 102] = "numPad6"; + KeyCodes2[KeyCodes2["numPad7"] = 103] = "numPad7"; + KeyCodes2[KeyCodes2["numPad8"] = 104] = "numPad8"; + KeyCodes2[KeyCodes2["numPad9"] = 105] = "numPad9"; + KeyCodes2[KeyCodes2["numPadDivide"] = 111] = "numPadDivide"; + KeyCodes2[KeyCodes2["numPadDot"] = 110] = "numPadDot"; + KeyCodes2[KeyCodes2["numPadMinus"] = 109] = "numPadMinus"; + KeyCodes2[KeyCodes2["numPadMultiply"] = 106] = "numPadMultiply"; + KeyCodes2[KeyCodes2["numPadPlus"] = 107] = "numPadPlus"; + KeyCodes2[KeyCodes2["openBracket"] = 219] = "openBracket"; + KeyCodes2[KeyCodes2["pageDown"] = 34] = "pageDown"; + KeyCodes2[KeyCodes2["pageUp"] = 33] = "pageUp"; + KeyCodes2[KeyCodes2["period"] = 190] = "period"; + KeyCodes2[KeyCodes2["print"] = 44] = "print"; + KeyCodes2[KeyCodes2["quote"] = 222] = "quote"; + KeyCodes2[KeyCodes2["scrollLock"] = 145] = "scrollLock"; + KeyCodes2[KeyCodes2["shift"] = 16] = "shift"; + KeyCodes2[KeyCodes2["space"] = 32] = "space"; + KeyCodes2[KeyCodes2["tab"] = 9] = "tab"; + KeyCodes2[KeyCodes2["tilde"] = 192] = "tilde"; + KeyCodes2[KeyCodes2["windowsLeft"] = 91] = "windowsLeft"; + KeyCodes2[KeyCodes2["windowsOpera"] = 219] = "windowsOpera"; + KeyCodes2[KeyCodes2["windowsRight"] = 92] = "windowsRight"; + })(KeyCodes || (KeyCodes = {})); + keyArrowDown = "ArrowDown"; + keyArrowLeft = "ArrowLeft"; + keyArrowRight = "ArrowRight"; + keyArrowUp = "ArrowUp"; + keyEnter = "Enter"; + keyEscape = "Escape"; + keyHome = "Home"; + keyEnd = "End"; + keyFunction2 = "F2"; + keyPageDown = "PageDown"; + keyPageUp = "PageUp"; + keySpace = " "; + keyTab = "Tab"; + keyBackspace = "Backspace"; + keyDelete = "Delete"; + ArrowKeys = { + ArrowDown: keyArrowDown, + ArrowLeft: keyArrowLeft, + ArrowRight: keyArrowRight, + ArrowUp: keyArrowUp + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/localization.js + var Direction; + var init_localization = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/localization.js"() { + (function(Direction2) { + Direction2["ltr"] = "ltr"; + Direction2["rtl"] = "rtl"; + })(Direction || (Direction = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/numbers.js + function wrapInBounds(min, max, value) { + if (value < min) { + return max; + } else if (value > max) { + return min; + } + return value; + } + function limit(min, max, value) { + return Math.min(Math.max(value, min), max); + } + function inRange(value, min, max = 0) { + [min, max] = [min, max].sort((a, b) => a - b); + return min <= value && value < max; + } + var init_numbers = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/numbers.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/strings.js + function uniqueId(prefix = "") { + return `${prefix}${uniqueIdCounter++}`; + } + var uniqueIdCounter; + var init_strings = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/strings.js"() { + uniqueIdCounter = 0; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/query.js + var init_query = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/query.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js + var RtlScrollConverter; + var init_rtl_scroll_converter = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js"() { + init_dist(); + init_localization(); + RtlScrollConverter = class _RtlScrollConverter { + /** + * Gets the scrollLeft value of the provided element + */ + static getScrollLeft(scrolledElement, direction) { + if (direction === Direction.rtl) { + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + return scrolledElement.scrollLeft; + } + /** + * Sets the scrollLeft value of the provided element + */ + static setScrollLeft(scrolledElement, scrollValue, direction) { + if (direction === Direction.rtl) { + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, scrollValue); + return; + } + scrolledElement.scrollLeft = scrollValue; + } + /** + * The initial rtl scroll converter getter function, it calls the browser test to set the correct converter + * functions and then invokes the getter + */ + static initialGetRtlScrollConverter(scrolledElement) { + _RtlScrollConverter.initializeRtlScrollConverters(); + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + /** + * The "direct" rtl get scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft; + } + /** + * The "inverted" get scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedGetRtlScrollConverter(scrolledElement) { + return -Math.abs(scrolledElement.scrollLeft); + } + /** + * The "reverse" get scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft - (scrolledElement.scrollWidth - scrolledElement.clientWidth); + } + /** + * The initial rtl scroll converter setter function, it calls the browser test to set the correct converter + * functions and then invokes the setter + */ + static initialSetRtlScrollConverter(scrolledElement, newScrollValue) { + _RtlScrollConverter.initializeRtlScrollConverters(); + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, newScrollValue); + } + /** + * The "direct" rtl set scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = newScrollValue; + } + /** + * The "inverted" set scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = Math.abs(newScrollValue); + } + /** + * The "reverse" set scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseSetRtlScrollConverter(scrolledElement, newScrollValue) { + const maxScroll = scrolledElement.scrollWidth - scrolledElement.clientWidth; + scrolledElement.scrollLeft = maxScroll + newScrollValue; + } + /** + * detects the appropriate rtl scroll converter functions and assigns them + * should only run once + */ + static initializeRtlScrollConverters() { + if (!canUseDOM()) { + _RtlScrollConverter.applyDirectScrollConverters(); + return; + } + const testElement = _RtlScrollConverter.getTestElement(); + document.body.appendChild(testElement); + _RtlScrollConverter.checkForScrollType(testElement); + document.body.removeChild(testElement); + } + /** + * checks the provided test element to determine scroll type + * and apply appropriate converters + */ + static checkForScrollType(testElement) { + if (_RtlScrollConverter.isReverse(testElement)) { + _RtlScrollConverter.applyReverseScrollConverters(); + } else { + if (_RtlScrollConverter.isDirect(testElement)) { + _RtlScrollConverter.applyDirectScrollConverters(); + } else { + _RtlScrollConverter.applyInvertedScrollConverters(); + } + } + } + /** + * checks test element initial state for rtl "reverse" mode + */ + static isReverse(testElement) { + return testElement.scrollLeft > 0; + } + /** + * checks test element for rtl "direct" mode + */ + static isDirect(testElement) { + testElement.scrollLeft = -1; + return testElement.scrollLeft < 0; + } + /** + * apply direct scroll conververters + */ + static applyDirectScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.directSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.directGetRtlScrollConverter; + } + /** + * apply inverted scroll conververters + */ + static applyInvertedScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.invertedSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.invertedGetRtlScrollConverter; + } + /** + * apply reverse scroll conververters + */ + static applyReverseScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.reverseSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.reverseGetRtlScrollConverter; + } + /** + * generate a test element for rtl testing + */ + static getTestElement() { + const testElement = document.createElement("div"); + testElement.appendChild(document.createTextNode("ABCD")); + testElement.dir = "rtl"; + testElement.style.fontSize = "14px"; + testElement.style.width = "4px"; + testElement.style.height = "1px"; + testElement.style.position = "absolute"; + testElement.style.top = "-1000px"; + testElement.style.overflow = "scroll"; + return testElement; + } + }; + RtlScrollConverter.getRtlScrollLeftConverter = RtlScrollConverter.initialGetRtlScrollConverter; + RtlScrollConverter.setRtlScrollLeftConverter = RtlScrollConverter.initialSetRtlScrollConverter; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/system-colors.js + var SystemColors; + var init_system_colors = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/system-colors.js"() { + (function(SystemColors2) { + SystemColors2["Canvas"] = "Canvas"; + SystemColors2["CanvasText"] = "CanvasText"; + SystemColors2["LinkText"] = "LinkText"; + SystemColors2["VisitedText"] = "VisitedText"; + SystemColors2["ActiveText"] = "ActiveText"; + SystemColors2["ButtonFace"] = "ButtonFace"; + SystemColors2["ButtonText"] = "ButtonText"; + SystemColors2["Field"] = "Field"; + SystemColors2["FieldText"] = "FieldText"; + SystemColors2["Highlight"] = "Highlight"; + SystemColors2["HighlightText"] = "HighlightText"; + SystemColors2["GrayText"] = "GrayText"; + })(SystemColors || (SystemColors = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/index.js + var init_dist2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/index.js"() { + init_aria(); + init_array(); + init_class_names(); + init_dom2(); + init_events(); + init_html(); + init_key_codes(); + init_localization(); + init_numbers(); + init_strings(); + init_query(); + init_rtl_scroll_converter(); + init_system_colors(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js + var AccordionExpandMode, Accordion; + var init_accordion = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_accordion_item(); + AccordionExpandMode = { + /** + * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. + */ + single: "single", + /** + * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously. + */ + multi: "multi" + }; + Accordion = class extends FoundationElement { + constructor() { + super(...arguments); + this.expandmode = AccordionExpandMode.multi; + this.activeItemIndex = 0; + this.change = () => { + this.$emit("change", this.activeid); + }; + this.setItems = () => { + var _a; + if (this.accordionItems.length === 0) { + return; + } + this.accordionIds = this.getItemIds(); + this.accordionItems.forEach((item, index) => { + if (item instanceof AccordionItem) { + item.addEventListener("change", this.activeItemChange); + if (this.isSingleExpandMode()) { + this.activeItemIndex !== index ? item.expanded = false : item.expanded = true; + } + } + const itemId = this.accordionIds[index]; + item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId); + this.activeid = this.accordionIds[this.activeItemIndex]; + item.addEventListener("keydown", this.handleItemKeyDown); + item.addEventListener("focus", this.handleItemFocus); + }); + if (this.isSingleExpandMode()) { + const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0]; + expandedItem.setAttribute("aria-disabled", "true"); + } + }; + this.removeItemListeners = (oldValue) => { + oldValue.forEach((item, index) => { + item.removeEventListener("change", this.activeItemChange); + item.removeEventListener("keydown", this.handleItemKeyDown); + item.removeEventListener("focus", this.handleItemFocus); + }); + }; + this.activeItemChange = (event) => { + if (event.defaultPrevented || event.target !== event.currentTarget) { + return; + } + event.preventDefault(); + const selectedItem = event.target; + this.activeid = selectedItem.getAttribute("id"); + if (this.isSingleExpandMode()) { + this.resetItems(); + selectedItem.expanded = true; + selectedItem.setAttribute("aria-disabled", "true"); + this.accordionItems.forEach((item) => { + if (!item.hasAttribute("disabled") && item.id !== this.activeid) { + item.removeAttribute("aria-disabled"); + } + }); + } + this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem); + this.change(); + }; + this.handleItemKeyDown = (event) => { + if (event.target !== event.currentTarget) { + return; + } + this.accordionIds = this.getItemIds(); + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjust(-1); + break; + case keyArrowDown: + event.preventDefault(); + this.adjust(1); + break; + case keyHome: + this.activeItemIndex = 0; + this.focusItem(); + break; + case keyEnd: + this.activeItemIndex = this.accordionItems.length - 1; + this.focusItem(); + break; + } + }; + this.handleItemFocus = (event) => { + if (event.target === event.currentTarget) { + const focusedItem = event.target; + const focusedIndex = this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem); + if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { + this.activeItemIndex = focusedIndex; + this.activeid = this.accordionIds[this.activeItemIndex]; + } + } + }; + } + /** + * @internal + */ + accordionItemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.removeItemListeners(oldValue); + this.setItems(); + } + } + findExpandedItem() { + for (let item = 0; item < this.accordionItems.length; item++) { + if (this.accordionItems[item].getAttribute("expanded") === "true") { + return this.accordionItems[item]; + } + } + return null; + } + resetItems() { + this.accordionItems.forEach((item, index) => { + item.expanded = false; + }); + } + getItemIds() { + return this.accordionItems.map((accordionItem) => { + return accordionItem.getAttribute("id"); + }); + } + isSingleExpandMode() { + return this.expandmode === AccordionExpandMode.single; + } + adjust(adjustment) { + this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment); + this.focusItem(); + } + focusItem() { + const element = this.accordionItems[this.activeItemIndex]; + if (element instanceof AccordionItem) { + element.expandbutton.focus(); + } + } + }; + __decorate([ + attr({ attribute: "expand-mode" }) + ], Accordion.prototype, "expandmode", void 0); + __decorate([ + observable + ], Accordion.prototype, "accordionItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js + var init_accordion2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js"() { + init_accordion_template(); + init_accordion(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js + var anchorTemplate; + var init_anchor_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js"() { + init_esm(); + init_start_end(); + anchorTemplate = (context, definition) => html` + + ${startSlotTemplate(context, definition)} + + + + ${endSlotTemplate(context, definition)} + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js + var ARIAGlobalStatesAndProperties; + var init_aria_global = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js"() { + init_tslib_es6(); + init_esm(); + ARIAGlobalStatesAndProperties = class { + }; + __decorate([ + attr({ attribute: "aria-atomic" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); + __decorate([ + attr({ attribute: "aria-busy" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); + __decorate([ + attr({ attribute: "aria-controls" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); + __decorate([ + attr({ attribute: "aria-current" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-details" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); + __decorate([ + attr({ attribute: "aria-disabled" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); + __decorate([ + attr({ attribute: "aria-errormessage" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); + __decorate([ + attr({ attribute: "aria-flowto" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); + __decorate([ + attr({ attribute: "aria-haspopup" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); + __decorate([ + attr({ attribute: "aria-hidden" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); + __decorate([ + attr({ attribute: "aria-invalid" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); + __decorate([ + attr({ attribute: "aria-keyshortcuts" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-live" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); + __decorate([ + attr({ attribute: "aria-owns" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); + __decorate([ + attr({ attribute: "aria-relevant" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); + __decorate([ + attr({ attribute: "aria-roledescription" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js + var init_patterns = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js"() { + init_aria_global(); + init_start_end(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js + var Anchor, DelegatesARIALink; + var init_anchor = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_patterns(); + init_apply_mixins(); + Anchor = class extends FoundationElement { + constructor() { + super(...arguments); + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + var _a2; + (_a2 = this.control) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + } + }; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.handleUnsupportedDelegatesFocus(); + } + }; + __decorate([ + attr + ], Anchor.prototype, "download", void 0); + __decorate([ + attr + ], Anchor.prototype, "href", void 0); + __decorate([ + attr + ], Anchor.prototype, "hreflang", void 0); + __decorate([ + attr + ], Anchor.prototype, "ping", void 0); + __decorate([ + attr + ], Anchor.prototype, "referrerpolicy", void 0); + __decorate([ + attr + ], Anchor.prototype, "rel", void 0); + __decorate([ + attr + ], Anchor.prototype, "target", void 0); + __decorate([ + attr + ], Anchor.prototype, "type", void 0); + __decorate([ + observable + ], Anchor.prototype, "defaultSlottedContent", void 0); + DelegatesARIALink = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIALink.prototype, "ariaExpanded", void 0); + applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties); + applyMixins(Anchor, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js + var init_anchor2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js"() { + init_anchor_template(); + init_anchor(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js + var init_anchored_region_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js + var getDirection; + var init_direction = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js"() { + init_dist2(); + getDirection = (rootNode) => { + const dirNode = rootNode.closest("[dir]"); + return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js + var IntersectionService; + var init_intersection_service = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js"() { + init_esm(); + IntersectionService = class { + constructor() { + this.intersectionDetector = null; + this.observedElements = /* @__PURE__ */ new Map(); + this.requestPosition = (target, callback) => { + var _a; + if (this.intersectionDetector === null) { + return; + } + if (this.observedElements.has(target)) { + (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback); + return; + } + this.observedElements.set(target, [callback]); + this.intersectionDetector.observe(target); + }; + this.cancelRequestPosition = (target, callback) => { + const callbacks = this.observedElements.get(target); + if (callbacks !== void 0) { + const callBackIndex = callbacks.indexOf(callback); + if (callBackIndex !== -1) { + callbacks.splice(callBackIndex, 1); + } + } + }; + this.initializeIntersectionDetector = () => { + if (!$global.IntersectionObserver) { + return; + } + this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { + root: null, + rootMargin: "0px", + threshold: [0, 1] + }); + }; + this.handleIntersection = (entries) => { + if (this.intersectionDetector === null) { + return; + } + const pendingCallbacks = []; + const pendingCallbackParams = []; + entries.forEach((entry) => { + var _a; + (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); + const thisElementCallbacks = this.observedElements.get(entry.target); + if (thisElementCallbacks !== void 0) { + thisElementCallbacks.forEach((callback) => { + let targetCallbackIndex = pendingCallbacks.indexOf(callback); + if (targetCallbackIndex === -1) { + targetCallbackIndex = pendingCallbacks.length; + pendingCallbacks.push(callback); + pendingCallbackParams.push([]); + } + pendingCallbackParams[targetCallbackIndex].push(entry); + }); + this.observedElements.delete(entry.target); + } + }); + pendingCallbacks.forEach((callback, index) => { + callback(pendingCallbackParams[index]); + }); + }; + this.initializeIntersectionDetector(); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js + var AnchoredRegion; + var init_anchored_region = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_direction(); + init_intersection_service(); + AnchoredRegion = class _AnchoredRegion extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.viewport = ""; + this.horizontalPositioningMode = "uncontrolled"; + this.horizontalDefaultPosition = "unset"; + this.horizontalViewportLock = false; + this.horizontalInset = false; + this.horizontalScaling = "content"; + this.verticalPositioningMode = "uncontrolled"; + this.verticalDefaultPosition = "unset"; + this.verticalViewportLock = false; + this.verticalInset = false; + this.verticalScaling = "content"; + this.fixedPlacement = false; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.initialLayoutComplete = false; + this.resizeDetector = null; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.pendingPositioningUpdate = false; + this.pendingReset = false; + this.currentDirection = Direction.ltr; + this.regionVisible = false; + this.forceUpdate = false; + this.updateThreshold = 0.5; + this.update = () => { + if (!this.pendingPositioningUpdate) { + this.requestPositionUpdates(); + } + }; + this.startObservers = () => { + this.stopObservers(); + if (this.anchorElement === null) { + return; + } + this.requestPositionUpdates(); + if (this.resizeDetector !== null) { + this.resizeDetector.observe(this.anchorElement); + this.resizeDetector.observe(this); + } + }; + this.requestPositionUpdates = () => { + if (this.anchorElement === null || this.pendingPositioningUpdate) { + return; + } + _AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection); + _AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection); + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection); + } + this.pendingPositioningUpdate = true; + }; + this.stopObservers = () => { + if (this.pendingPositioningUpdate) { + this.pendingPositioningUpdate = false; + _AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection); + if (this.anchorElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection); + } + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection); + } + } + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + } + }; + this.getViewport = () => { + if (typeof this.viewport !== "string" || this.viewport === "") { + return document.documentElement; + } + return document.getElementById(this.viewport); + }; + this.getAnchor = () => { + return document.getElementById(this.anchor); + }; + this.handleIntersection = (entries) => { + if (!this.pendingPositioningUpdate) { + return; + } + this.pendingPositioningUpdate = false; + if (!this.applyIntersectionEntries(entries)) { + return; + } + this.updateLayout(); + }; + this.applyIntersectionEntries = (entries) => { + const regionEntry = entries.find((x) => x.target === this); + const anchorEntry = entries.find((x) => x.target === this.anchorElement); + const viewportEntry = entries.find((x) => x.target === this.viewportElement); + if (regionEntry === void 0 || viewportEntry === void 0 || anchorEntry === void 0) { + return false; + } + if (!this.regionVisible || this.forceUpdate || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0 || this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) || this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) || this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) { + this.regionRect = regionEntry.boundingClientRect; + this.anchorRect = anchorEntry.boundingClientRect; + if (this.viewportElement === document.documentElement) { + this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x + document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y + document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height); + } else { + this.viewportRect = viewportEntry.boundingClientRect; + } + this.updateRegionOffset(); + this.forceUpdate = false; + return true; + } + return false; + }; + this.updateRegionOffset = () => { + if (this.anchorRect && this.regionRect) { + this.baseHorizontalOffset = this.baseHorizontalOffset + (this.anchorRect.left - this.regionRect.left) + (this.translateX - this.baseHorizontalOffset); + this.baseVerticalOffset = this.baseVerticalOffset + (this.anchorRect.top - this.regionRect.top) + (this.translateY - this.baseVerticalOffset); + } + }; + this.isRectDifferent = (rectA, rectB) => { + if (Math.abs(rectA.top - rectB.top) > this.updateThreshold || Math.abs(rectA.right - rectB.right) > this.updateThreshold || Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold || Math.abs(rectA.left - rectB.left) > this.updateThreshold) { + return true; + } + return false; + }; + this.handleResize = (entries) => { + this.update(); + }; + this.reset = () => { + if (!this.pendingReset) { + return; + } + this.pendingReset = false; + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + if (this.viewportElement === null) { + this.viewportElement = this.getViewport(); + } + this.currentDirection = getDirection(this); + this.startObservers(); + }; + this.updateLayout = () => { + let desiredVerticalPosition = void 0; + let desiredHorizontalPosition = void 0; + if (this.horizontalPositioningMode !== "uncontrolled") { + const horizontalOptions = this.getPositioningOptions(this.horizontalInset); + if (this.horizontalDefaultPosition === "center") { + desiredHorizontalPosition = "center"; + } else if (this.horizontalDefaultPosition !== "unset") { + let dirCorrectedHorizontalDefaultPosition = this.horizontalDefaultPosition; + if (dirCorrectedHorizontalDefaultPosition === "start" || dirCorrectedHorizontalDefaultPosition === "end") { + const newDirection = getDirection(this); + if (newDirection !== this.currentDirection) { + this.currentDirection = newDirection; + this.initialize(); + return; + } + if (this.currentDirection === Direction.ltr) { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right"; + } else { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left"; + } + } + switch (dirCorrectedHorizontalDefaultPosition) { + case "left": + desiredHorizontalPosition = this.horizontalInset ? "insetStart" : "start"; + break; + case "right": + desiredHorizontalPosition = this.horizontalInset ? "insetEnd" : "end"; + break; + } + } + const horizontalThreshold = this.horizontalThreshold !== void 0 ? this.horizontalThreshold : this.regionRect !== void 0 ? this.regionRect.width : 0; + const anchorLeft = this.anchorRect !== void 0 ? this.anchorRect.left : 0; + const anchorRight = this.anchorRect !== void 0 ? this.anchorRect.right : 0; + const anchorWidth = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + const viewportLeft = this.viewportRect !== void 0 ? this.viewportRect.left : 0; + const viewportRight = this.viewportRect !== void 0 ? this.viewportRect.right : 0; + if (desiredHorizontalPosition === void 0 || !(this.horizontalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold) { + desiredHorizontalPosition = this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) > this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) ? horizontalOptions[0] : horizontalOptions[1]; + } + } + if (this.verticalPositioningMode !== "uncontrolled") { + const verticalOptions = this.getPositioningOptions(this.verticalInset); + if (this.verticalDefaultPosition === "center") { + desiredVerticalPosition = "center"; + } else if (this.verticalDefaultPosition !== "unset") { + switch (this.verticalDefaultPosition) { + case "top": + desiredVerticalPosition = this.verticalInset ? "insetStart" : "start"; + break; + case "bottom": + desiredVerticalPosition = this.verticalInset ? "insetEnd" : "end"; + break; + } + } + const verticalThreshold = this.verticalThreshold !== void 0 ? this.verticalThreshold : this.regionRect !== void 0 ? this.regionRect.height : 0; + const anchorTop = this.anchorRect !== void 0 ? this.anchorRect.top : 0; + const anchorBottom = this.anchorRect !== void 0 ? this.anchorRect.bottom : 0; + const anchorHeight = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + const viewportTop = this.viewportRect !== void 0 ? this.viewportRect.top : 0; + const viewportBottom = this.viewportRect !== void 0 ? this.viewportRect.bottom : 0; + if (desiredVerticalPosition === void 0 || !(this.verticalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold) { + desiredVerticalPosition = this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) > this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) ? verticalOptions[0] : verticalOptions[1]; + } + } + const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition); + const positionChanged = this.horizontalPosition !== desiredHorizontalPosition || this.verticalPosition !== desiredVerticalPosition; + this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension); + this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension); + this.updateRegionStyle(); + if (!this.initialLayoutComplete) { + this.initialLayoutComplete = true; + this.requestPositionUpdates(); + return; + } + if (!this.regionVisible) { + this.regionVisible = true; + this.style.removeProperty("pointer-events"); + this.style.removeProperty("opacity"); + this.classList.toggle("loaded", true); + this.$emit("loaded", this, { bubbles: false }); + } + this.updatePositionClasses(); + if (positionChanged) { + this.$emit("positionchange", this, { bubbles: false }); + } + }; + this.updateRegionStyle = () => { + this.style.width = this.regionWidth; + this.style.height = this.regionHeight; + this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`; + }; + this.updatePositionClasses = () => { + this.classList.toggle("top", this.verticalPosition === "start"); + this.classList.toggle("bottom", this.verticalPosition === "end"); + this.classList.toggle("inset-top", this.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.verticalPosition === "insetEnd"); + this.classList.toggle("vertical-center", this.verticalPosition === "center"); + this.classList.toggle("left", this.horizontalPosition === "start"); + this.classList.toggle("right", this.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.horizontalPosition === "insetEnd"); + this.classList.toggle("horizontal-center", this.horizontalPosition === "center"); + }; + this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => { + if (desiredHorizontalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionWidth = 0; + switch (this.horizontalScaling) { + case "anchor": + case "fill": + nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width; + this.regionWidth = `${nextRegionWidth}px`; + break; + case "content": + nextRegionWidth = this.regionRect.width; + this.regionWidth = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredHorizontalPosition) { + case "start": + this.translateX = this.baseHorizontalOffset - nextRegionWidth; + if (this.horizontalViewportLock && this.anchorRect.left > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.right); + } + break; + case "insetStart": + this.translateX = this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.right); + } + break; + case "insetEnd": + this.translateX = this.baseHorizontalOffset; + if (this.horizontalViewportLock && this.anchorRect.left < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.left); + } + break; + case "end": + this.translateX = this.baseHorizontalOffset + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.left); + } + break; + case "center": + sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2; + this.translateX = this.baseHorizontalOffset + sizeDelta; + if (this.horizontalViewportLock) { + const regionLeft = this.anchorRect.left + sizeDelta; + const regionRight = this.anchorRect.right - sizeDelta; + if (regionLeft < this.viewportRect.left && !(regionRight > this.viewportRect.right)) { + this.translateX = this.translateX - (regionLeft - this.viewportRect.left); + } else if (regionRight > this.viewportRect.right && !(regionLeft < this.viewportRect.left)) { + this.translateX = this.translateX - (regionRight - this.viewportRect.right); + } + } + break; + } + this.horizontalPosition = desiredHorizontalPosition; + }; + this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => { + if (desiredVerticalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionHeight = 0; + switch (this.verticalScaling) { + case "anchor": + case "fill": + nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height; + this.regionHeight = `${nextRegionHeight}px`; + break; + case "content": + nextRegionHeight = this.regionRect.height; + this.regionHeight = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredVerticalPosition) { + case "start": + this.translateY = this.baseVerticalOffset - nextRegionHeight; + if (this.verticalViewportLock && this.anchorRect.top > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.bottom); + } + break; + case "insetStart": + this.translateY = this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.bottom); + } + break; + case "insetEnd": + this.translateY = this.baseVerticalOffset; + if (this.verticalViewportLock && this.anchorRect.top < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.top); + } + break; + case "end": + this.translateY = this.baseVerticalOffset + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.top); + } + break; + case "center": + sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2; + this.translateY = this.baseVerticalOffset + sizeDelta; + if (this.verticalViewportLock) { + const regionTop = this.anchorRect.top + sizeDelta; + const regionBottom = this.anchorRect.bottom - sizeDelta; + if (regionTop < this.viewportRect.top && !(regionBottom > this.viewportRect.bottom)) { + this.translateY = this.translateY - (regionTop - this.viewportRect.top); + } else if (regionBottom > this.viewportRect.bottom && !(regionTop < this.viewportRect.top)) { + this.translateY = this.translateY - (regionBottom - this.viewportRect.bottom); + } + } + } + this.verticalPosition = desiredVerticalPosition; + }; + this.getPositioningOptions = (inset) => { + if (inset) { + return ["insetStart", "insetEnd"]; + } + return ["start", "end"]; + }; + this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => { + const spaceStart = anchorStart - viewportStart; + const spaceEnd = viewportEnd - (anchorStart + anchorSpan); + switch (positionOption) { + case "start": + return spaceStart; + case "insetStart": + return spaceStart + anchorSpan; + case "insetEnd": + return spaceEnd + anchorSpan; + case "end": + return spaceEnd; + case "center": + return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan; + } + }; + this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => { + const newRegionDimension = { + height: this.regionRect !== void 0 ? this.regionRect.height : 0, + width: this.regionRect !== void 0 ? this.regionRect.width : 0 + }; + if (desiredHorizontalPosition !== void 0 && this.horizontalScaling === "fill") { + newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== void 0 ? this.anchorRect.left : 0, this.anchorRect !== void 0 ? this.anchorRect.right : 0, this.anchorRect !== void 0 ? this.anchorRect.width : 0, this.viewportRect !== void 0 ? this.viewportRect.left : 0, this.viewportRect !== void 0 ? this.viewportRect.right : 0); + } else if (this.horizontalScaling === "anchor") { + newRegionDimension.width = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + } + if (desiredVerticalPosition !== void 0 && this.verticalScaling === "fill") { + newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== void 0 ? this.anchorRect.top : 0, this.anchorRect !== void 0 ? this.anchorRect.bottom : 0, this.anchorRect !== void 0 ? this.anchorRect.height : 0, this.viewportRect !== void 0 ? this.viewportRect.top : 0, this.viewportRect !== void 0 ? this.viewportRect.bottom : 0); + } else if (this.verticalScaling === "anchor") { + newRegionDimension.height = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + } + return newRegionDimension; + }; + this.startAutoUpdateEventListeners = () => { + window.addEventListener(eventResize, this.update, { passive: true }); + window.addEventListener(eventScroll, this.update, { + passive: true, + capture: true + }); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.observe(this.viewportElement); + } + }; + this.stopAutoUpdateEventListeners = () => { + window.removeEventListener(eventResize, this.update); + window.removeEventListener(eventScroll, this.update); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.unobserve(this.viewportElement); + } + }; + } + anchorChanged() { + if (this.initialLayoutComplete) { + this.anchorElement = this.getAnchor(); + } + } + viewportChanged() { + if (this.initialLayoutComplete) { + this.viewportElement = this.getViewport(); + } + } + horizontalPositioningModeChanged() { + this.requestReset(); + } + horizontalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + horizontalViewportLockChanged() { + this.updateForAttributeChange(); + } + horizontalInsetChanged() { + this.updateForAttributeChange(); + } + horizontalThresholdChanged() { + this.updateForAttributeChange(); + } + horizontalScalingChanged() { + this.updateForAttributeChange(); + } + verticalPositioningModeChanged() { + this.requestReset(); + } + verticalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + verticalViewportLockChanged() { + this.updateForAttributeChange(); + } + verticalInsetChanged() { + this.updateForAttributeChange(); + } + verticalThresholdChanged() { + this.updateForAttributeChange(); + } + verticalScalingChanged() { + this.updateForAttributeChange(); + } + fixedPlacementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + autoUpdateModeChanged(prevMode, newMode) { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + if (prevMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + if (newMode === "auto") { + this.startAutoUpdateEventListeners(); + } + } + } + anchorElementChanged() { + this.requestReset(); + } + viewportElementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.autoUpdateMode === "auto") { + this.startAutoUpdateEventListeners(); + } + this.initialize(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.autoUpdateMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + this.stopObservers(); + this.disconnectResizeDetector(); + } + /** + * @internal + */ + adoptedCallback() { + this.initialize(); + } + /** + * destroys the instance's resize observer + */ + disconnectResizeDetector() { + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.handleResize); + } + /** + * react to attribute changes that don't require a reset + */ + updateForAttributeChange() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.forceUpdate = true; + this.update(); + } + } + /** + * fully initializes the component + */ + initialize() { + this.initializeResizeDetector(); + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + this.requestReset(); + } + /** + * Request a reset if there are currently no open requests + */ + requestReset() { + if (this.$fastController.isConnected && this.pendingReset === false) { + this.setInitialState(); + DOM.queueUpdate(() => this.reset()); + this.pendingReset = true; + } + } + /** + * sets the starting configuration for component internal values + */ + setInitialState() { + this.initialLayoutComplete = false; + this.regionVisible = false; + this.translateX = 0; + this.translateY = 0; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.viewportRect = void 0; + this.regionRect = void 0; + this.anchorRect = void 0; + this.verticalPosition = void 0; + this.horizontalPosition = void 0; + this.style.opacity = "0"; + this.style.pointerEvents = "none"; + this.forceUpdate = false; + this.style.position = this.fixedPlacement ? "fixed" : "absolute"; + this.updatePositionClasses(); + this.updateRegionStyle(); + } + }; + AnchoredRegion.intersectionService = new IntersectionService(); + __decorate([ + attr + ], AnchoredRegion.prototype, "anchor", void 0); + __decorate([ + attr + ], AnchoredRegion.prototype, "viewport", void 0); + __decorate([ + attr({ attribute: "horizontal-positioning-mode" }) + ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0); + __decorate([ + attr({ attribute: "horizontal-default-position" }) + ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "horizontal-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalInset", void 0); + __decorate([ + attr({ attribute: "horizontal-threshold" }) + ], AnchoredRegion.prototype, "horizontalThreshold", void 0); + __decorate([ + attr({ attribute: "horizontal-scaling" }) + ], AnchoredRegion.prototype, "horizontalScaling", void 0); + __decorate([ + attr({ attribute: "vertical-positioning-mode" }) + ], AnchoredRegion.prototype, "verticalPositioningMode", void 0); + __decorate([ + attr({ attribute: "vertical-default-position" }) + ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalInset", void 0); + __decorate([ + attr({ attribute: "vertical-threshold" }) + ], AnchoredRegion.prototype, "verticalThreshold", void 0); + __decorate([ + attr({ attribute: "vertical-scaling" }) + ], AnchoredRegion.prototype, "verticalScaling", void 0); + __decorate([ + attr({ attribute: "fixed-placement", mode: "boolean" }) + ], AnchoredRegion.prototype, "fixedPlacement", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], AnchoredRegion.prototype, "autoUpdateMode", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "anchorElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "viewportElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "initialLayoutComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js + var horizontalAnchorOverlay, FlyoutPosTop, FlyoutPosBottom, FlyoutPosTallest, FlyoutPosTopFill, FlyoutPosBottomFill, FlyoutPosTallestFill; + var init_anchored_region_config = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js"() { + horizontalAnchorOverlay = { + horizontalDefaultPosition: "center", + horizontalPositioningMode: "locktodefault", + horizontalInset: false, + horizontalScaling: "anchor" + }; + FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "top", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "bottom", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: "dynamic", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: "fill" }); + FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: "fill" }); + FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: "fill" }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js + var init_anchored_region2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js"() { + init_anchored_region_template(); + init_anchored_region(); + init_anchored_region_config(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js + var init_avatar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js + var Avatar; + var init_avatar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Avatar = class extends FoundationElement { + /** + * Internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.shape) { + this.shape = "circle"; + } + } + }; + __decorate([ + attr + ], Avatar.prototype, "fill", void 0); + __decorate([ + attr + ], Avatar.prototype, "color", void 0); + __decorate([ + attr + ], Avatar.prototype, "link", void 0); + __decorate([ + attr + ], Avatar.prototype, "shape", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js + var init_avatar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js"() { + init_avatar_template(); + init_avatar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js + var badgeTemplate; + var init_badge_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js"() { + init_esm(); + badgeTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js + var Badge; + var init_badge = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Badge = class extends FoundationElement { + constructor() { + super(...arguments); + this.generateBadgeStyle = () => { + if (!this.fill && !this.color) { + return; + } + const fill = `background-color: var(--badge-fill-${this.fill});`; + const color = `color: var(--badge-color-${this.color});`; + if (this.fill && !this.color) { + return fill; + } else if (this.color && !this.fill) { + return color; + } else { + return `${color} ${fill}`; + } + }; + } + }; + __decorate([ + attr({ attribute: "fill" }) + ], Badge.prototype, "fill", void 0); + __decorate([ + attr({ attribute: "color" }) + ], Badge.prototype, "color", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Badge.prototype, "circular", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js + var init_badge2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js"() { + init_badge_template(); + init_badge(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js + var init_breadcrumb_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js + var BreadcrumbItem; + var init_breadcrumb_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js"() { + init_tslib_es6(); + init_esm(); + init_anchor(); + init_patterns(); + init_apply_mixins(); + BreadcrumbItem = class extends Anchor { + constructor() { + super(...arguments); + this.separator = true; + } + }; + __decorate([ + observable + ], BreadcrumbItem.prototype, "separator", void 0); + applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js + var init_breadcrumb_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js"() { + init_breadcrumb_item_template(); + init_breadcrumb_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js + var init_breadcrumb_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js + var Breadcrumb; + var init_breadcrumb = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js"() { + init_tslib_es6(); + init_esm(); + init_breadcrumb_item(); + init_foundation_element(); + Breadcrumb = class extends FoundationElement { + slottedBreadcrumbItemsChanged() { + if (this.$fastController.isConnected) { + if (this.slottedBreadcrumbItems === void 0 || this.slottedBreadcrumbItems.length === 0) { + return; + } + const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1]; + this.slottedBreadcrumbItems.forEach((item) => { + const itemIsLastNode = item === lastNode; + this.setItemSeparator(item, itemIsLastNode); + this.setAriaCurrent(item, itemIsLastNode); + }); + } + } + setItemSeparator(item, isLastNode) { + if (item instanceof BreadcrumbItem) { + item.separator = !isLastNode; + } + } + /** + * Finds href on childnodes in the light DOM or shadow DOM. + * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href. + */ + findChildWithHref(node) { + var _a, _b; + if (node.childElementCount > 0) { + return node.querySelector("a[href]"); + } else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) { + return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]"); + } else + return null; + } + /** + * Sets ARIA Current for the current node + * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node, + * otherwise apply aria-current to the host element, with an href + */ + setAriaCurrent(item, isLastNode) { + const childNodeWithHref = this.findChildWithHref(item); + if (childNodeWithHref === null && item.hasAttribute("href") && item instanceof BreadcrumbItem) { + isLastNode ? item.setAttribute("aria-current", "page") : item.removeAttribute("aria-current"); + } else if (childNodeWithHref !== null) { + isLastNode ? childNodeWithHref.setAttribute("aria-current", "page") : childNodeWithHref.removeAttribute("aria-current"); + } + } + }; + __decorate([ + observable + ], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js + var init_breadcrumb2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js"() { + init_breadcrumb_template(); + init_breadcrumb(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js + var buttonTemplate; + var init_button_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js"() { + init_esm(); + init_start_end(); + buttonTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js + function FormAssociated(BaseCtor) { + const C = class extends BaseCtor { + constructor(...args) { + super(...args); + this.dirtyValue = false; + this.disabled = false; + this.proxyEventsToBlock = ["change", "click"]; + this.proxyInitialized = false; + this.required = false; + this.initialValue = this.initialValue || ""; + if (!this.elementInternals) { + this.formResetCallback = this.formResetCallback.bind(this); + } + } + /** + * Must evaluate to true to enable elementInternals. + * Feature detects API support and resolve respectively + * + * @internal + */ + static get formAssociated() { + return supportsElementInternals; + } + /** + * Returns the validity state of the element + * + * @alpha + */ + get validity() { + return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; + } + /** + * Retrieve a reference to the associated form. + * Returns null if not associated to any form. + * + * @alpha + */ + get form() { + return this.elementInternals ? this.elementInternals.form : this.proxy.form; + } + /** + * Retrieve the localized validation message, + * or custom validation message if set. + * + * @alpha + */ + get validationMessage() { + return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; + } + /** + * Whether the element will be validated when the + * form is submitted + */ + get willValidate() { + return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; + } + /** + * A reference to all associated label elements + */ + get labels() { + if (this.elementInternals) { + return Object.freeze(Array.from(this.elementInternals.labels)); + } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { + const parentLabels = this.proxy.labels; + const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)); + const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; + return Object.freeze(labels); + } else { + return emptyArray; + } + } + /** + * Invoked when the `value` property changes + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `valueChanged` method + * They must be sure to invoke `super.valueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + valueChanged(previous, next) { + this.dirtyValue = true; + if (this.proxy instanceof HTMLElement) { + this.proxy.value = this.value; + } + this.currentValue = this.value; + this.setFormValue(this.value); + this.validate(); + } + currentValueChanged() { + this.value = this.currentValue; + } + /** + * Invoked when the `initialValue` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `initialValueChanged` method + * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + /** + * Invoked when the `disabled` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `disabledChanged` method + * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + disabledChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.disabled = this.disabled; + } + DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled)); + } + /** + * Invoked when the `name` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `nameChanged` method + * They must be sure to invoke `super.nameChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + nameChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.name = this.name; + } + } + /** + * Invoked when the `required` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `requiredChanged` method + * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + requiredChanged(prev, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.required = this.required; + } + DOM.queueUpdate(() => this.classList.toggle("required", this.required)); + this.validate(); + } + /** + * The element internals object. Will only exist + * in browsers supporting the attachInternals API + */ + get elementInternals() { + if (!supportsElementInternals) { + return null; + } + let internals = InternalsMap.get(this); + if (!internals) { + internals = this.attachInternals(); + InternalsMap.set(this, internals); + } + return internals; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("keypress", this._keypressHandler); + if (!this.value) { + this.value = this.initialValue; + this.dirtyValue = false; + } + if (!this.elementInternals) { + this.attachProxy(); + if (this.form) { + this.form.addEventListener("reset", this.formResetCallback); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.proxyEventsToBlock.forEach((name) => this.proxy.removeEventListener(name, this.stopPropagation)); + if (!this.elementInternals && this.form) { + this.form.removeEventListener("reset", this.formResetCallback); + } + } + /** + * Return the current validity of the element. + */ + checkValidity() { + return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); + } + /** + * Return the current validity of the element. + * If false, fires an invalid event at the element. + */ + reportValidity() { + return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); + } + /** + * Set the validity of the control. In cases when the elementInternals object is not + * available (and the proxy element is used to report validity), this function will + * do nothing unless a message is provided, at which point the setCustomValidity method + * of the proxy element will be invoked with the provided message. + * @param flags - Validity flags + * @param message - Optional message to supply + * @param anchor - Optional element used by UA to display an interactive validation UI + */ + setValidity(flags, message, anchor) { + if (this.elementInternals) { + this.elementInternals.setValidity(flags, message, anchor); + } else if (typeof message === "string") { + this.proxy.setCustomValidity(message); + } + } + /** + * Invoked when a connected component's form or fieldset has its disabled + * state changed. + * @param disabled - the disabled value of the form / fieldset + */ + formDisabledCallback(disabled) { + this.disabled = disabled; + } + formResetCallback() { + this.value = this.initialValue; + this.dirtyValue = false; + } + /** + * Attach the proxy element to the DOM + */ + attachProxy() { + var _a; + if (!this.proxyInitialized) { + this.proxyInitialized = true; + this.proxy.style.display = "none"; + this.proxyEventsToBlock.forEach((name) => this.proxy.addEventListener(name, this.stopPropagation)); + this.proxy.disabled = this.disabled; + this.proxy.required = this.required; + if (typeof this.name === "string") { + this.proxy.name = this.name; + } + if (typeof this.value === "string") { + this.proxy.value = this.value; + } + this.proxy.setAttribute("slot", proxySlotName); + this.proxySlot = document.createElement("slot"); + this.proxySlot.setAttribute("name", proxySlotName); + } + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); + this.appendChild(this.proxy); + } + /** + * Detach the proxy element from the DOM + */ + detachProxy() { + var _a; + this.removeChild(this.proxy); + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate(anchor) { + if (this.proxy instanceof HTMLElement) { + this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); + } + } + /** + * Associates the provided value (and optional state) with the parent form. + * @param value - The value to set + * @param state - The state object provided to during session restores and when autofilling. + */ + setFormValue(value, state) { + if (this.elementInternals) { + this.elementInternals.setFormValue(value, state || value); + } + } + _keypressHandler(e) { + switch (e.key) { + case keyEnter: + if (this.form instanceof HTMLFormElement) { + const defaultButton = this.form.querySelector("[type=submit]"); + defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); + } + break; + } + } + /** + * Used to stop propagation of proxy element events + * @param e - Event object + */ + stopPropagation(e) { + e.stopPropagation(); + } + }; + attr({ mode: "boolean" })(C.prototype, "disabled"); + attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue"); + attr({ attribute: "current-value" })(C.prototype, "currentValue"); + attr(C.prototype, "name"); + attr({ mode: "boolean" })(C.prototype, "required"); + observable(C.prototype, "value"); + return C; + } + function CheckableFormAssociated(BaseCtor) { + class C extends FormAssociated(BaseCtor) { + } + class D extends C { + constructor(...args) { + super(args); + this.dirtyChecked = false; + this.checkedAttribute = false; + this.checked = false; + this.dirtyChecked = false; + } + checkedAttributeChanged() { + this.defaultChecked = this.checkedAttribute; + } + /** + * @internal + */ + defaultCheckedChanged() { + if (!this.dirtyChecked) { + this.checked = this.defaultChecked; + this.dirtyChecked = false; + } + } + checkedChanged(prev, next) { + if (!this.dirtyChecked) { + this.dirtyChecked = true; + } + this.currentChecked = this.checked; + this.updateForm(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.checked = this.checked; + } + if (prev !== void 0) { + this.$emit("change"); + } + this.validate(); + } + currentCheckedChanged(prev, next) { + this.checked = this.currentChecked; + } + updateForm() { + const value = this.checked ? this.value : null; + this.setFormValue(value, value); + } + connectedCallback() { + super.connectedCallback(); + this.updateForm(); + } + formResetCallback() { + super.formResetCallback(); + this.checked = !!this.checkedAttribute; + this.dirtyChecked = false; + } + } + attr({ attribute: "checked", mode: "boolean" })(D.prototype, "checkedAttribute"); + attr({ attribute: "current-checked", converter: booleanConverter })(D.prototype, "currentChecked"); + observable(D.prototype, "defaultChecked"); + observable(D.prototype, "checked"); + return D; + } + var proxySlotName, ElementInternalsKey, supportsElementInternals, InternalsMap; + var init_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js"() { + init_esm(); + init_dist2(); + proxySlotName = "form-associated-proxy"; + ElementInternalsKey = "ElementInternals"; + supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; + InternalsMap = /* @__PURE__ */ new WeakMap(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js + var _Button, FormAssociatedButton; + var init_button_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Button = class extends FoundationElement { + }; + FormAssociatedButton = class extends FormAssociated(_Button) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.js + var Button, DelegatesARIAButton; + var init_button = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_button_form_associated(); + Button = class extends FormAssociatedButton { + constructor() { + super(...arguments); + this.handleClick = (e) => { + var _a; + if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) { + e.stopPropagation(); + } + }; + this.handleSubmission = () => { + if (!this.form) { + return; + } + const attached = this.proxy.isConnected; + if (!attached) { + this.attachProxy(); + } + typeof this.form.requestSubmit === "function" ? this.form.requestSubmit(this.proxy) : this.proxy.click(); + if (!attached) { + this.detachProxy(); + } + }; + this.handleFormReset = () => { + var _a; + (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset(); + }; + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + this.control.focus(); + }; + } + }; + } + formactionChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formAction = this.formaction; + } + } + formenctypeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formEnctype = this.formenctype; + } + } + formmethodChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formMethod = this.formmethod; + } + } + formnovalidateChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formNoValidate = this.formnovalidate; + } + } + formtargetChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formTarget = this.formtarget; + } + } + typeChanged(previous, next) { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + } + next === "submit" && this.addEventListener("click", this.handleSubmission); + previous === "submit" && this.removeEventListener("click", this.handleSubmission); + next === "reset" && this.addEventListener("click", this.handleFormReset); + previous === "reset" && this.removeEventListener("click", this.handleFormReset); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.handleUnsupportedDelegatesFocus(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.addEventListener("click", this.handleClick); + }); + } + } + /** + * @internal + */ + disconnectedCallback() { + var _a; + super.disconnectedCallback(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.removeEventListener("click", this.handleClick); + }); + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], Button.prototype, "formId", void 0); + __decorate([ + attr + ], Button.prototype, "formaction", void 0); + __decorate([ + attr + ], Button.prototype, "formenctype", void 0); + __decorate([ + attr + ], Button.prototype, "formmethod", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "formnovalidate", void 0); + __decorate([ + attr + ], Button.prototype, "formtarget", void 0); + __decorate([ + attr + ], Button.prototype, "type", void 0); + __decorate([ + observable + ], Button.prototype, "defaultSlottedContent", void 0); + DelegatesARIAButton = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIAButton.prototype, "ariaExpanded", void 0); + __decorate([ + attr({ attribute: "aria-pressed" }) + ], DelegatesARIAButton.prototype, "ariaPressed", void 0); + applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties); + applyMixins(Button, StartEnd, DelegatesARIAButton); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/index.js + var init_button2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/index.js"() { + init_button_template(); + init_button(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js + var DateFormatter; + var init_date_formatter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js"() { + DateFormatter = class { + constructor(config) { + this.dayFormat = "numeric"; + this.weekdayFormat = "long"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.date = /* @__PURE__ */ new Date(); + if (config) { + for (const key in config) { + const value = config[key]; + if (key === "date") { + this.date = this.getDateObject(value); + } else { + this[key] = value; + } + } + } + } + /** + * Helper function to make sure that the DateFormatter is working with an instance of Date + * @param date - The date as an object, string or Date insance + * @returns - A Date instance + * @public + */ + getDateObject(date) { + if (typeof date === "string") { + const dates = date.split(/[/-]/); + if (dates.length < 3) { + return /* @__PURE__ */ new Date(); + } + return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10)); + } else if ("day" in date && "month" in date && "year" in date) { + const { day, month, year } = date; + return new Date(year, month - 1, day); + } + return date; + } + /** + * + * @param date - a valide date as either a Date, string, objec or a DateFormatter + * @param format - The formatting for the string + * @param locale - locale data used for formatting + * @returns A localized string of the date provided + * @public + */ + getDate(date = this.date, format = { + weekday: this.weekdayFormat, + month: this.monthFormat, + day: this.dayFormat, + year: this.yearFormat + }, locale = this.locale) { + const dateObj = this.getDateObject(date); + if (!dateObj.getTime()) { + return ""; + } + const optionsWithTimeZone = Object.assign({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }, format); + return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj); + } + /** + * + * @param day - Day to localize + * @param format - The formatting for the day + * @param locale - The locale data used for formatting + * @returns - A localized number for the day + * @public + */ + getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) { + return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale); + } + /** + * + * @param month - The month to localize + * @param format - The formatting for the month + * @param locale - The locale data used for formatting + * @returns - A localized name of the month + * @public + */ + getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) { + return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale); + } + /** + * + * @param year - The year to localize + * @param format - The formatting for the year + * @param locale - The locale data used for formatting + * @returns - A localized string for the year + * @public + */ + getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) { + return this.getDate({ month: 2, day: 2, year }, { year: format }, locale); + } + /** + * + * @param weekday - The number of the weekday, defaults to Sunday + * @param format - The formatting for the weekday label + * @param locale - The locale data used for formatting + * @returns - A formatted weekday label + * @public + */ + getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) { + const date = `1-${weekday + 1}-2017`; + return this.getDate(date, { weekday: format }, locale); + } + /** + * + * @param format - The formatting for the weekdays + * @param locale - The locale data used for formatting + * @returns - An array of the weekday labels + * @public + */ + getWeekdays(format = this.weekdayFormat, locale = this.locale) { + return Array(7).fill(null).map((_, day) => this.getWeekday(day, format, locale)); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js + var Calendar; + var init_calendar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_date_formatter(); + Calendar = class extends FoundationElement { + constructor() { + super(...arguments); + this.dateFormatter = new DateFormatter(); + this.readonly = false; + this.locale = "en-US"; + this.month = (/* @__PURE__ */ new Date()).getMonth() + 1; + this.year = (/* @__PURE__ */ new Date()).getFullYear(); + this.dayFormat = "numeric"; + this.weekdayFormat = "short"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.minWeeks = 0; + this.disabledDates = ""; + this.selectedDates = ""; + this.oneDayInMs = 864e5; + } + localeChanged() { + this.dateFormatter.locale = this.locale; + } + dayFormatChanged() { + this.dateFormatter.dayFormat = this.dayFormat; + } + weekdayFormatChanged() { + this.dateFormatter.weekdayFormat = this.weekdayFormat; + } + monthFormatChanged() { + this.dateFormatter.monthFormat = this.monthFormat; + } + yearFormatChanged() { + this.dateFormatter.yearFormat = this.yearFormat; + } + /** + * Gets data needed to render about a calendar month as well as the previous and next months + * @param year - year of the calendar + * @param month - month of the calendar + * @returns - an object with data about the current and 2 surrounding months + * @public + */ + getMonthInfo(month = this.month, year = this.year) { + const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay(); + const getLength = (date) => { + const nextMonth2 = new Date(date.getFullYear(), date.getMonth() + 1, 1); + return new Date(nextMonth2.getTime() - this.oneDayInMs).getDate(); + }; + const thisMonth = new Date(year, month - 1); + const nextMonth = new Date(year, month); + const previousMonth = new Date(year, month - 2); + return { + length: getLength(thisMonth), + month, + start: getFirstDay(thisMonth), + year, + previous: { + length: getLength(previousMonth), + month: previousMonth.getMonth() + 1, + start: getFirstDay(previousMonth), + year: previousMonth.getFullYear() + }, + next: { + length: getLength(nextMonth), + month: nextMonth.getMonth() + 1, + start: getFirstDay(nextMonth), + year: nextMonth.getFullYear() + } + }; + } + /** + * A list of calendar days + * @param info - an object containing the information needed to render a calendar month + * @param minWeeks - minimum number of weeks to show + * @returns a list of days in a calendar month + * @public + */ + getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) { + minWeeks = minWeeks > 10 ? 10 : minWeeks; + const { start, length, previous, next } = info; + const days = []; + let dayCount = 1 - start; + while (dayCount < length + 1 || days.length < minWeeks || days[days.length - 1].length % 7 !== 0) { + const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info; + const day = dayCount < 1 ? previous.length + dayCount : dayCount > length ? dayCount - length : dayCount; + const dateString = `${month}-${day}-${year}`; + const disabled = this.dateInString(dateString, this.disabledDates); + const selected = this.dateInString(dateString, this.selectedDates); + const date = { + day, + month, + year, + disabled, + selected + }; + const target = days[days.length - 1]; + if (days.length === 0 || target.length % 7 === 0) { + days.push([date]); + } else { + target.push(date); + } + dayCount++; + } + return days; + } + /** + * A helper function that checks if a date exists in a list of dates + * @param date - A date objec that includes the day, month and year + * @param datesString - a comma separated list of dates + * @returns - Returns true if it found the date in the list of dates + * @public + */ + dateInString(date, datesString) { + const dates = datesString.split(",").map((str) => str.trim()); + date = typeof date === "string" ? date : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; + return dates.some((d) => d === date); + } + /** + * Creates a class string for the day container + * @param date - date of the calendar cell + * @returns - string of class names + * @public + */ + getDayClassNames(date, todayString) { + const { day, month, year, disabled, selected } = date; + const today = todayString === `${month}-${day}-${year}`; + const inactive = this.month !== month; + return [ + "day", + today && "today", + inactive && "inactive", + disabled && "disabled", + selected && "selected" + ].filter(Boolean).join(" "); + } + /** + * Returns a list of weekday labels + * @returns An array of weekday text and full text if abbreviated + * @public + */ + getWeekdayText() { + const weekdayText = this.dateFormatter.getWeekdays().map((text) => ({ text })); + if (this.weekdayFormat !== "long") { + const longText = this.dateFormatter.getWeekdays("long"); + weekdayText.forEach((weekday, index) => { + weekday.abbr = longText[index]; + }); + } + return weekdayText; + } + /** + * Emits the "date-select" event with the day, month and year. + * @param date - Date cell + * @public + */ + handleDateSelect(event, day) { + event.preventDefault; + this.$emit("dateselected", day); + } + /** + * Handles keyboard events on a cell + * @param event - Keyboard event + * @param date - Date of the cell selected + */ + handleKeydown(event, date) { + if (event.key === keyEnter) { + this.handleDateSelect(event, date); + } + return true; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Calendar.prototype, "readonly", void 0); + __decorate([ + attr + ], Calendar.prototype, "locale", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "month", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "year", void 0); + __decorate([ + attr({ attribute: "day-format", mode: "fromView" }) + ], Calendar.prototype, "dayFormat", void 0); + __decorate([ + attr({ attribute: "weekday-format", mode: "fromView" }) + ], Calendar.prototype, "weekdayFormat", void 0); + __decorate([ + attr({ attribute: "month-format", mode: "fromView" }) + ], Calendar.prototype, "monthFormat", void 0); + __decorate([ + attr({ attribute: "year-format", mode: "fromView" }) + ], Calendar.prototype, "yearFormat", void 0); + __decorate([ + attr({ attribute: "min-weeks", converter: nullableNumberConverter }) + ], Calendar.prototype, "minWeeks", void 0); + __decorate([ + attr({ attribute: "disabled-dates" }) + ], Calendar.prototype, "disabledDates", void 0); + __decorate([ + attr({ attribute: "selected-dates" }) + ], Calendar.prototype, "selectedDates", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js + var GenerateHeaderOptions, DataGridCellTypes, DataGridRowTypes; + var init_data_grid_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js"() { + GenerateHeaderOptions = { + none: "none", + default: "default", + sticky: "sticky" + }; + DataGridCellTypes = { + default: "default", + columnHeader: "columnheader", + rowHeader: "rowheader" + }; + DataGridRowTypes = { + default: "default", + header: "header", + stickyHeader: "sticky-header" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js + var DataGridRow; + var init_data_grid_row = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGridRow = class extends FoundationElement { + constructor() { + super(...arguments); + this.rowType = DataGridRowTypes.default; + this.rowData = null; + this.columnDefinitions = null; + this.isActiveRow = false; + this.cellsRepeatBehavior = null; + this.cellsPlaceholder = null; + this.focusColumnIndex = 0; + this.refocusOnLoad = false; + this.updateRowStyle = () => { + this.style.gridTemplateColumns = this.gridTemplateColumns; + }; + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowStyle(); + } + } + rowTypeChanged() { + if (this.$fastController.isConnected) { + this.updateItemTemplate(); + } + } + rowDataChanged() { + if (this.rowData !== null && this.isActiveRow) { + this.refocusOnLoad = true; + return; + } + } + cellItemTemplateChanged() { + this.updateItemTemplate(); + } + headerCellItemTemplateChanged() { + this.updateItemTemplate(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.cellsRepeatBehavior === null) { + this.cellsPlaceholder = document.createComment(""); + this.appendChild(this.cellsPlaceholder); + this.updateItemTemplate(); + this.cellsRepeatBehavior = new RepeatDirective((x) => x.columnDefinitions, (x) => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder); + this.$fastController.addBehaviors([this.cellsRepeatBehavior]); + } + this.addEventListener("cell-focused", this.handleCellFocus); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.updateRowStyle(); + if (this.refocusOnLoad) { + this.refocusOnLoad = false; + if (this.cellElements.length > this.focusColumnIndex) { + this.cellElements[this.focusColumnIndex].focus(); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("cell-focused", this.handleCellFocus); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + } + handleFocusout(e) { + if (!this.contains(e.target)) { + this.isActiveRow = false; + this.focusColumnIndex = 0; + } + } + handleCellFocus(e) { + this.isActiveRow = true; + this.focusColumnIndex = this.cellElements.indexOf(e.target); + this.$emit("row-focused", this); + } + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusColumnIndex = 0; + switch (e.key) { + case keyArrowLeft: + newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyArrowRight: + newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyHome: + if (!e.ctrlKey) { + this.cellElements[0].focus(); + e.preventDefault(); + } + break; + case keyEnd: + if (!e.ctrlKey) { + this.cellElements[this.cellElements.length - 1].focus(); + e.preventDefault(); + } + break; + } + } + updateItemTemplate() { + this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate; + } + }; + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGridRow.prototype, "gridTemplateColumns", void 0); + __decorate([ + attr({ attribute: "row-type" }) + ], DataGridRow.prototype, "rowType", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowIndex", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "isActiveRow", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "activeCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js + function createRowItemTemplate(context) { + const rowTag = context.tagFor(DataGridRow); + return html` + <${rowTag} + :rowData="${(x) => x}" + :cellItemTemplate="${(x, c) => c.parent.cellItemTemplate}" + :headerCellItemTemplate="${(x, c) => c.parent.headerCellItemTemplate}" + > +`; + } + var dataGridTemplate; + var init_data_grid_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js"() { + init_esm(); + init_data_grid_row(); + dataGridTemplate = (context, definition) => { + const rowItemTemplate = createRowItemTemplate(context); + const rowTag = context.tagFor(DataGridRow); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js + var DataGrid; + var init_data_grid = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGrid = class _DataGrid extends FoundationElement { + constructor() { + super(); + this.noTabbing = false; + this.generateHeader = GenerateHeaderOptions.default; + this.rowsData = []; + this.columnDefinitions = null; + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + this.rowsPlaceholder = null; + this.generatedHeader = null; + this.isUpdatingFocus = false; + this.pendingFocusUpdate = false; + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = true; + this.generatedGridTemplateColumns = ""; + this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => { + if (this.rowElements.length === 0) { + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + return; + } + const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex)); + const focusRow = this.rowElements[focusRowIndex]; + const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'); + const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex)); + const focusTarget = cells[focusColumnIndex]; + if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) { + focusTarget.scrollIntoView({ block: "center", inline: "center" }); + } + focusTarget.focus(); + }; + this.onChildListChange = (mutations, observer) => { + if (mutations && mutations.length) { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((newNode) => { + if (newNode.nodeType === 1 && newNode.getAttribute("role") === "row") { + newNode.columnDefinitions = this.columnDefinitions; + } + }); + }); + this.queueRowIndexUpdate(); + } + }; + this.queueRowIndexUpdate = () => { + if (!this.rowindexUpdateQueued) { + this.rowindexUpdateQueued = true; + DOM.queueUpdate(this.updateRowIndexes); + } + }; + this.updateRowIndexes = () => { + let newGridTemplateColumns = this.gridTemplateColumns; + if (newGridTemplateColumns === void 0) { + if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) { + const firstRow = this.rowElements[0]; + this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" "); + } + newGridTemplateColumns = this.generatedGridTemplateColumns; + } + this.rowElements.forEach((element, index) => { + const thisRow = element; + thisRow.rowIndex = index; + thisRow.gridTemplateColumns = newGridTemplateColumns; + if (this.columnDefinitionsStale) { + thisRow.columnDefinitions = this.columnDefinitions; + } + }); + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = false; + }; + } + /** + * generates a gridTemplateColumns based on columndata array + */ + static generateTemplateColumns(columnDefinitions) { + let templateColumns = ""; + columnDefinitions.forEach((column) => { + templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`; + }); + return templateColumns; + } + noTabbingChanged() { + if (this.$fastController.isConnected) { + if (this.noTabbing) { + this.setAttribute("tabIndex", "-1"); + } else { + this.setAttribute("tabIndex", this.contains(document.activeElement) || this === document.activeElement ? "-1" : "0"); + } + } + } + generateHeaderChanged() { + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowIndexes(); + } + } + rowsDataChanged() { + if (this.columnDefinitions === null && this.rowsData.length > 0) { + this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]); + } + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + columnDefinitionsChanged() { + if (this.columnDefinitions === null) { + this.generatedGridTemplateColumns = ""; + return; + } + this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(this.columnDefinitions); + if (this.$fastController.isConnected) { + this.columnDefinitionsStale = true; + this.queueRowIndexUpdate(); + } + } + headerCellItemTemplateChanged() { + if (this.$fastController.isConnected) { + if (this.generatedHeader !== null) { + this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate; + } + } + } + focusRowIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + focusColumnIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.rowItemTemplate === void 0) { + this.rowItemTemplate = this.defaultRowItemTemplate; + } + this.rowsPlaceholder = document.createComment(""); + this.appendChild(this.rowsPlaceholder); + this.toggleGeneratedHeader(); + this.rowsRepeatBehavior = new RepeatDirective((x) => x.rowsData, (x) => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder); + this.$fastController.addBehaviors([this.rowsRepeatBehavior]); + this.addEventListener("row-focused", this.handleRowFocus); + this.addEventListener(eventFocus, this.handleFocus); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.addEventListener(eventFocusOut, this.handleFocusOut); + this.observer = new MutationObserver(this.onChildListChange); + this.observer.observe(this, { childList: true }); + if (this.noTabbing) { + this.setAttribute("tabindex", "-1"); + } + DOM.queueUpdate(this.queueRowIndexUpdate); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("row-focused", this.handleRowFocus); + this.removeEventListener(eventFocus, this.handleFocus); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.removeEventListener(eventFocusOut, this.handleFocusOut); + this.observer.disconnect(); + this.rowsPlaceholder = null; + this.generatedHeader = null; + } + /** + * @internal + */ + handleRowFocus(e) { + this.isUpdatingFocus = true; + const focusRow = e.target; + this.focusRowIndex = this.rowElements.indexOf(focusRow); + this.focusColumnIndex = focusRow.focusColumnIndex; + this.setAttribute("tabIndex", "-1"); + this.isUpdatingFocus = false; + } + /** + * @internal + */ + handleFocus(e) { + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + /** + * @internal + */ + handleFocusOut(e) { + if (e.relatedTarget === null || !this.contains(e.relatedTarget)) { + this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0"); + } + } + /** + * @internal + */ + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusRowIndex; + const maxIndex = this.rowElements.length - 1; + const currentGridBottom = this.offsetHeight + this.scrollTop; + const lastRow = this.rowElements[maxIndex]; + switch (e.key) { + case keyArrowUp: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true); + break; + case keyArrowDown: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true); + break; + case keyPageUp: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex === 0) { + this.focusOnCell(0, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex - 1; + for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop < this.scrollTop) { + this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyPageDown: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) { + this.focusOnCell(maxIndex, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex + 1; + for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) { + let stickyHeaderOffset = 0; + if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) { + stickyHeaderOffset = this.generatedHeader.clientHeight; + } + this.scrollTop = thisRow.offsetTop - stickyHeaderOffset; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyHome: + if (e.ctrlKey) { + e.preventDefault(); + this.focusOnCell(0, 0, true); + } + break; + case keyEnd: + if (e.ctrlKey && this.columnDefinitions !== null) { + e.preventDefault(); + this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true); + } + break; + } + } + queueFocusUpdate() { + if (this.isUpdatingFocus && (this.contains(document.activeElement) || this === document.activeElement)) { + return; + } + if (this.pendingFocusUpdate === false) { + this.pendingFocusUpdate = true; + DOM.queueUpdate(() => this.updateFocus()); + } + } + updateFocus() { + this.pendingFocusUpdate = false; + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + toggleGeneratedHeader() { + if (this.generatedHeader !== null) { + this.removeChild(this.generatedHeader); + this.generatedHeader = null; + } + if (this.generateHeader !== GenerateHeaderOptions.none && this.rowsData.length > 0) { + const generatedHeaderElement = document.createElement(this.rowElementTag); + this.generatedHeader = generatedHeaderElement; + this.generatedHeader.columnDefinitions = this.columnDefinitions; + this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns; + this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header; + if (this.firstChild !== null || this.rowsPlaceholder !== null) { + this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder); + } + return; + } + } + }; + DataGrid.generateColumns = (row) => { + return Object.getOwnPropertyNames(row).map((property, index) => { + return { + columnDataKey: property, + gridColumn: `${index}` + }; + }); + }; + __decorate([ + attr({ attribute: "no-tabbing", mode: "boolean" }) + ], DataGrid.prototype, "noTabbing", void 0); + __decorate([ + attr({ attribute: "generate-header" }) + ], DataGrid.prototype, "generateHeader", void 0); + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGrid.prototype, "gridTemplateColumns", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowsData", void 0); + __decorate([ + observable + ], DataGrid.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusRowIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusColumnIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "defaultRowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElementTag", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js + var defaultCellContentsTemplate, defaultHeaderCellContentsTemplate, DataGridCell; + var init_data_grid_cell = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + defaultCellContentsTemplate = html` + +`; + defaultHeaderCellContentsTemplate = html` + +`; + DataGridCell = class extends FoundationElement { + constructor() { + super(...arguments); + this.cellType = DataGridCellTypes.default; + this.rowData = null; + this.columnDefinition = null; + this.isActiveCell = false; + this.customCellView = null; + this.updateCellStyle = () => { + this.style.gridColumn = this.gridColumn; + }; + } + cellTypeChanged() { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + gridColumnChanged() { + if (this.$fastController.isConnected) { + this.updateCellStyle(); + } + } + columnDefinitionChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.addEventListener(eventFocusIn, this.handleFocusin); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === void 0 ? 0 : this.columnDefinition.gridColumn}`; + this.updateCellView(); + this.updateCellStyle(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener(eventFocusIn, this.handleFocusin); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.disconnectCellView(); + } + handleFocusin(e) { + if (this.isActiveCell) { + return; + } + this.isActiveCell = true; + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + default: + if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + } + this.$emit("cell-focused", this); + } + handleFocusout(e) { + if (this !== document.activeElement && !this.contains(document.activeElement)) { + this.isActiveCell = false; + } + } + handleKeydown(e) { + if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) { + return; + } + switch (e.key) { + case keyEnter: + case keyFunction2: + if (this.contains(document.activeElement) && document.activeElement !== this) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + default: + if (this.columnDefinition.cellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + } + break; + case keyEscape: + if (this.contains(document.activeElement) && document.activeElement !== this) { + this.focus(); + e.preventDefault(); + } + break; + } + } + updateCellView() { + this.disconnectCellView(); + if (this.columnDefinition === null) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellTemplate !== void 0) { + this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this); + } else { + this.customCellView = defaultHeaderCellContentsTemplate.render(this, this); + } + break; + case void 0: + case DataGridCellTypes.rowHeader: + case DataGridCellTypes.default: + if (this.columnDefinition.cellTemplate !== void 0) { + this.customCellView = this.columnDefinition.cellTemplate.render(this, this); + } else { + this.customCellView = defaultCellContentsTemplate.render(this, this); + } + break; + } + } + disconnectCellView() { + if (this.customCellView !== null) { + this.customCellView.dispose(); + this.customCellView = null; + } + } + }; + __decorate([ + attr({ attribute: "cell-type" }) + ], DataGridCell.prototype, "cellType", void 0); + __decorate([ + attr({ attribute: "grid-column" }) + ], DataGridCell.prototype, "gridColumn", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "columnDefinition", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js + function createCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}" + grid-column="${(x, c) => c.index + 1}" + :rowData="${(x, c) => c.parent.rowData}" + :columnDefinition="${(x) => x}" + > +`; + } + function createHeaderCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="columnheader" + grid-column="${(x, c) => c.index + 1}" + :columnDefinition="${(x) => x}" + > +`; + } + var dataGridRowTemplate; + var init_data_grid_row_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js"() { + init_esm(); + init_data_grid_cell(); + dataGridRowTemplate = (context, definition) => { + const cellItemTemplate = createCellItemTemplate(context); + const headerCellItemTemplate = createHeaderCellItemTemplate(context); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js + var dataGridCellTemplate; + var init_data_grid_cell_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js"() { + init_esm(); + dataGridCellTemplate = (context, definition) => { + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js + var init_data_grid2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js"() { + init_data_grid_template(); + init_data_grid(); + init_data_grid_row_template(); + init_data_grid_row(); + init_data_grid_cell_template(); + init_data_grid_cell(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js + var CalendarTitleTemplate; + var init_calendar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js"() { + init_esm(); + CalendarTitleTemplate = html` +
+ + ${(x) => x.dateFormatter.getMonth(x.month)} + + ${(x) => x.dateFormatter.getYear(x.year)} +
+`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js + var init_calendar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js"() { + init_calendar(); + init_calendar_template(); + init_date_formatter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js + var init_card_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.js + var init_card = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/index.js + var init_card2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/index.js"() { + init_card_template(); + init_card(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js + var checkboxTemplate; + var init_checkbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js"() { + init_esm(); + checkboxTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js + var _Checkbox, FormAssociatedCheckbox; + var init_checkbox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Checkbox = class extends FoundationElement { + }; + FormAssociatedCheckbox = class extends CheckableFormAssociated(_Checkbox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js + var Checkbox; + var init_checkbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_checkbox_form_associated(); + Checkbox = class extends FormAssociatedCheckbox { + constructor() { + super(); + this.initialValue = "on"; + this.indeterminate = false; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keySpace: + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Checkbox.prototype, "readOnly", void 0); + __decorate([ + observable + ], Checkbox.prototype, "defaultSlottedNodes", void 0); + __decorate([ + observable + ], Checkbox.prototype, "indeterminate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js + var init_checkbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js"() { + init_checkbox_template(); + init_checkbox(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js + function isListboxOption(el) { + return isHTMLElement(el) && (el.getAttribute("role") === "option" || el instanceof HTMLOptionElement); + } + var ListboxOption, DelegatesARIAListboxOption; + var init_listbox_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + ListboxOption = class extends FoundationElement { + constructor(text, value, defaultSelected, selected) { + super(); + this.defaultSelected = false; + this.dirtySelected = false; + this.selected = this.defaultSelected; + this.dirtyValue = false; + if (text) { + this.textContent = text; + } + if (value) { + this.initialValue = value; + } + if (defaultSelected) { + this.defaultSelected = defaultSelected; + } + if (selected) { + this.selected = selected; + } + this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected); + this.proxy.disabled = this.disabled; + } + /** + * Updates the ariaChecked property when the checked property changes. + * + * @param prev - the previous checked value + * @param next - the current checked value + * + * @public + */ + checkedChanged(prev, next) { + if (typeof next === "boolean") { + this.ariaChecked = next ? "true" : "false"; + return; + } + this.ariaChecked = null; + } + /** + * Updates the proxy's text content when the default slot changes. + * @param prev - the previous content value + * @param next - the current content value + * + * @internal + */ + contentChanged(prev, next) { + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.textContent = this.textContent; + } + this.$emit("contentchange", null, { bubbles: true }); + } + defaultSelectedChanged() { + if (!this.dirtySelected) { + this.selected = this.defaultSelected; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.defaultSelected; + } + } + } + disabledChanged(prev, next) { + this.ariaDisabled = this.disabled ? "true" : "false"; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.disabled = this.disabled; + } + } + selectedAttributeChanged() { + this.defaultSelected = this.selectedAttribute; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.defaultSelected = this.defaultSelected; + } + } + selectedChanged() { + this.ariaSelected = this.selected ? "true" : "false"; + if (!this.dirtySelected) { + this.dirtySelected = true; + } + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.selected; + } + } + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + get label() { + var _a; + return (_a = this.value) !== null && _a !== void 0 ? _a : this.text; + } + get text() { + var _a, _b; + return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : ""; + } + set value(next) { + const newValue = `${next !== null && next !== void 0 ? next : ""}`; + this._value = newValue; + this.dirtyValue = true; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.value = newValue; + } + Observable.notify(this, "value"); + } + get value() { + var _a; + Observable.track(this, "value"); + return (_a = this._value) !== null && _a !== void 0 ? _a : this.text; + } + get form() { + return this.proxy ? this.proxy.form : null; + } + }; + __decorate([ + observable + ], ListboxOption.prototype, "checked", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "content", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "defaultSelected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxOption.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "selected", mode: "boolean" }) + ], ListboxOption.prototype, "selectedAttribute", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "selected", void 0); + __decorate([ + attr({ attribute: "value", mode: "fromView" }) + ], ListboxOption.prototype, "initialValue", void 0); + DelegatesARIAListboxOption = class { + }; + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0); + applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties); + applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js + var Listbox, DelegatesARIAListbox; + var init_listbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_listbox_option(); + init_aria_global(); + init_apply_mixins(); + Listbox = class _Listbox extends FoundationElement { + constructor() { + super(...arguments); + this._options = []; + this.selectedIndex = -1; + this.selectedOptions = []; + this.shouldSkipFocus = false; + this.typeaheadBuffer = ""; + this.typeaheadExpired = true; + this.typeaheadTimeout = -1; + } + /** + * The first selected option. + * + * @internal + */ + get firstSelectedOption() { + var _a; + return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null; + } + /** + * Returns true if there is one or more selectable option. + * + * @internal + */ + get hasSelectableOptions() { + return this.options.length > 0 && !this.options.every((o) => o.disabled); + } + /** + * The number of options. + * + * @public + */ + get length() { + var _a, _b; + return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + } + /** + * The list of options. + * + * @public + */ + get options() { + Observable.track(this, "options"); + return this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Flag for the typeahead timeout expiration. + * + * @deprecated use `Listbox.typeaheadExpired` + * @internal + */ + get typeAheadExpired() { + return this.typeaheadExpired; + } + set typeAheadExpired(value) { + this.typeaheadExpired = value; + } + /** + * Handle click events for listbox options. + * + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && !captured.disabled) { + this.selectedIndex = this.options.indexOf(captured); + return true; + } + } + /** + * Ensures that the provided option is focused and scrolled into view. + * + * @param optionToFocus - The option to focus + * @internal + */ + focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) { + if (this.contains(document.activeElement) && optionToFocus !== null) { + optionToFocus.focus(); + requestAnimationFrame(() => { + optionToFocus.scrollIntoView({ block: "nearest" }); + }); + } + } + /** + * Handles `focusin` actions for the component. When the component receives focus, + * the list of selected options is refreshed and the first selected option is scrolled + * into view. + * + * @internal + */ + focusinHandler(e) { + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Returns the options which match the current typeahead buffer. + * + * @internal + */ + getTypeaheadMatches() { + const pattern = this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp(`^${pattern}`, "gi"); + return this.options.filter((o) => o.text.trim().match(re)); + } + /** + * Determines the index of the next option which is selectable, if any. + * + * @param prev - the previous selected index + * @param next - the next index to select + * + * @internal + */ + getSelectableIndex(prev = this.selectedIndex, next) { + const direction = prev > next ? -1 : prev < next ? 1 : 0; + const potentialDirection = prev + direction; + let nextSelectableOption = null; + switch (direction) { + case -1: { + nextSelectableOption = this.options.reduceRight((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + case 1: { + nextSelectableOption = this.options.reduce((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + } + return this.options.indexOf(nextSelectableOption); + } + /** + * Handles external changes to child options. + * + * @param source - the source object + * @param propertyName - the property + * + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "selected": { + if (_Listbox.slottedOptionFilter(source)) { + this.selectedIndex = this.options.indexOf(source); + } + this.setSelectedOptions(); + break; + } + } + } + /** + * Moves focus to an option whose label matches characters typed by the user. + * Consecutive keystrokes are batched into a buffer of search text used + * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes + * between consecutive keystrokes, the search restarts. + * + * @param key - the key to be evaluated + * + * @internal + */ + handleTypeAhead(key) { + if (this.typeaheadTimeout) { + window.clearTimeout(this.typeaheadTimeout); + } + this.typeaheadTimeout = window.setTimeout(() => this.typeaheadExpired = true, _Listbox.TYPE_AHEAD_TIMEOUT_MS); + if (key.length > 1) { + return; + } + this.typeaheadBuffer = `${this.typeaheadExpired ? "" : this.typeaheadBuffer}${key}`; + } + /** + * Handles `keydown` actions for listbox navigation and typeahead. + * + * @internal + */ + keydownHandler(e) { + if (this.disabled) { + return true; + } + this.shouldSkipFocus = false; + const key = e.key; + switch (key) { + // Select the first available option + case keyHome: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectFirstOption(); + } + break; + } + // Select the next selectable option + case keyArrowDown: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectNextOption(); + } + break; + } + // Select the previous selectable option + case keyArrowUp: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectPreviousOption(); + } + break; + } + // Select the last available option + case keyEnd: { + e.preventDefault(); + this.selectLastOption(); + break; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEnter: + case keyEscape: { + return true; + } + case keySpace: { + if (this.typeaheadExpired) { + return true; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @internal + */ + mousedownHandler(e) { + this.shouldSkipFocus = !this.contains(document.activeElement); + return true; + } + /** + * Switches between single-selection and multi-selection mode. + * + * @param prev - the previous value of the `multiple` attribute + * @param next - the next value of the `multiple` attribute + * + * @internal + */ + multipleChanged(prev, next) { + this.ariaMultiSelectable = next ? "true" : null; + } + /** + * Updates the list of selected options when the `selectedIndex` changes. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + var _a; + if (!this.hasSelectableOptions) { + this.selectedIndex = -1; + return; + } + if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") { + const selectableIndex = this.getSelectableIndex(prev, next); + const newNext = selectableIndex > -1 ? selectableIndex : prev; + this.selectedIndex = newNext; + if (next === newNext) { + this.selectedIndexChanged(next, newNext); + } + return; + } + this.setSelectedOptions(); + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + const filteredNext = next.filter(_Listbox.slottedOptionFilter); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "selected"); + o.selected = filteredNext.includes(o); + notifier.subscribe(this, "selected"); + }); + } + /** + * Moves focus to the first selectable option. + * + * @public + */ + selectFirstOption() { + var _a, _b; + if (!this.disabled) { + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((o) => !o.disabled)) !== null && _b !== void 0 ? _b : -1; + } + } + /** + * Moves focus to the last selectable option. + * + * @internal + */ + selectLastOption() { + if (!this.disabled) { + this.selectedIndex = findLastIndex(this.options, (o) => !o.disabled); + } + } + /** + * Moves focus to the next selectable option. + * + * @internal + */ + selectNextOption() { + if (!this.disabled && this.selectedIndex < this.options.length - 1) { + this.selectedIndex += 1; + } + } + /** + * Moves focus to the previous selectable option. + * + * @internal + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex > 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Updates the selected index to match the first selected option. + * + * @internal + */ + setDefaultSelectedOption() { + var _a, _b; + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((el) => el.defaultSelected)) !== null && _b !== void 0 ? _b : -1; + } + /** + * Sets an option as selected and gives it focus. + * + * @public + */ + setSelectedOptions() { + var _a, _b, _c; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) { + this.selectedOptions = [this.options[this.selectedIndex]]; + this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""; + this.focusAndScrollOptionIntoView(); + } + } + /** + * Updates the list of options and resets the selected option when the slotted option content changes. + * + * @param prev - the previous list of slotted options + * @param next - the current list of slotted options + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options = next.reduce((options, item) => { + if (isListboxOption(item)) { + options.push(item); + } + return options; + }, []); + const setSize = `${this.options.length}`; + this.options.forEach((option, index) => { + if (!option.id) { + option.id = uniqueId("option-"); + } + option.ariaPosInSet = `${index + 1}`; + option.ariaSetSize = setSize; + }); + if (this.$fastController.isConnected) { + this.setSelectedOptions(); + this.setDefaultSelectedOption(); + } + } + /** + * Updates the filtered list of options when the typeahead buffer changes. + * + * @param prev - the previous typeahead buffer value + * @param next - the current typeahead buffer value + * + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + if (typeaheadMatches.length) { + const selectedIndex = this.options.indexOf(typeaheadMatches[0]); + if (selectedIndex > -1) { + this.selectedIndex = selectedIndex; + } + } + this.typeaheadExpired = false; + } + } + }; + Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; + Listbox.TYPE_AHEAD_TIMEOUT_MS = 1e3; + __decorate([ + attr({ mode: "boolean" }) + ], Listbox.prototype, "disabled", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedIndex", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "slottedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "typeaheadBuffer", void 0); + DelegatesARIAListbox = class { + }; + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaDisabled", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaExpanded", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0); + applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties); + applyMixins(Listbox, DelegatesARIAListbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js + var SelectPosition; + var init_select_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js"() { + SelectPosition = { + above: "above", + below: "below" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js + var _Combobox, FormAssociatedCombobox; + var init_combobox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js"() { + init_form_associated(); + init_listbox(); + _Combobox = class extends Listbox { + }; + FormAssociatedCombobox = class extends FormAssociated(_Combobox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js + var ComboboxAutocomplete; + var init_combobox_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js"() { + ComboboxAutocomplete = { + inline: "inline", + list: "list", + both: "both", + none: "none" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js + var Combobox, DelegatesARIACombobox; + var init_combobox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_select_options(); + init_apply_mixins(); + init_combobox_form_associated(); + init_combobox_options(); + Combobox = class extends FormAssociatedCombobox { + constructor() { + super(...arguments); + this._value = ""; + this.filteredOptions = []; + this.filter = ""; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + this.open = false; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + super.formResetCallback(); + this.setDefaultSelectedOption(); + this.updateValue(); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + get isAutocompleteInline() { + return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth; + } + get isAutocompleteList() { + return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth; + } + get isAutocompleteBoth() { + return this.autocomplete === ComboboxAutocomplete.both; + } + /** + * Sets focus and synchronize ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged() { + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The list of options. + * + * @public + * @remarks + * Overrides `Listbox.options`. + */ + get options() { + Observable.track(this, "options"); + return this.filteredOptions.length ? this.filteredOptions : this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Updates the placeholder on the proxy element. + * @internal + */ + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c; + const prev = `${this._value}`; + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el) => el.text.toLowerCase() === next.toLowerCase()); + const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text; + const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text; + this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex; + next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + } + } + /** + * Handle opening and closing the listbox when the combobox is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (this.disabled || (captured === null || captured === void 0 ? void 0 : captured.disabled)) { + return; + } + if (this.open) { + if (e.composedPath()[0] === this.control) { + return; + } + if (captured) { + this.selectedOptions = [captured]; + this.control.value = captured.text; + this.clearSelectionRange(); + this.updateValue(true); + } + } + this.open = !this.open; + if (this.open) { + this.control.focus(); + } + return true; + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + if (this.value) { + this.initialValue = this.value; + } + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Filter available options by text value. + * + * @public + */ + filterOptions() { + if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) { + this.filter = ""; + } + const filter = this.filter.toLowerCase(); + this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase())); + if (this.isAutocompleteList) { + if (!this.filteredOptions.length && !filter) { + this.filteredOptions = this._options; + } + this._options.forEach((o) => { + o.hidden = !this.filteredOptions.includes(o); + }); + } + } + /** + * Focus the control and scroll the first selected option into view. + * + * @internal + * @remarks + * Overrides: `Listbox.focusAndScrollOptionIntoView` + */ + focusAndScrollOptionIntoView() { + if (this.contains(document.activeElement)) { + this.control.focus(); + if (this.firstSelectedOption) { + requestAnimationFrame(() => { + var _a; + (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest" }); + }); + } + } + } + /** + * Handle focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + this.syncValue(); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!this.options || !this.options.includes(focusTarget)) { + this.open = false; + } + } + /** + * Handle content changes on the control input. + * + * @param e - the input event + * @internal + */ + inputHandler(e) { + this.filter = this.control.value; + this.filterOptions(); + if (!this.isAutocompleteInline) { + this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value); + } + if (e.inputType.includes("deleteContent") || !this.filter.length) { + return true; + } + if (this.isAutocompleteList && !this.open) { + this.open = true; + } + if (this.isAutocompleteInline) { + if (this.filteredOptions.length) { + this.selectedOptions = [this.filteredOptions[0]]; + this.selectedIndex = this.options.indexOf(this.firstSelectedOption); + this.setInlineSelection(); + } else { + this.selectedIndex = -1; + } + } + return; + } + /** + * Handle keydown actions for listbox navigation. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (e.ctrlKey || e.shiftKey) { + return true; + } + switch (key) { + case "Enter": { + this.syncValue(); + if (this.isAutocompleteInline) { + this.filter = this.value; + } + this.open = false; + this.clearSelectionRange(); + break; + } + case "Escape": { + if (!this.isAutocompleteInline) { + this.selectedIndex = -1; + } + if (this.open) { + this.open = false; + break; + } + this.value = ""; + this.control.value = ""; + this.filter = ""; + this.filterOptions(); + break; + } + case "Tab": { + this.setInputToSelection(); + if (!this.open) { + return true; + } + e.preventDefault(); + this.open = false; + break; + } + case "ArrowUp": + case "ArrowDown": { + this.filterOptions(); + if (!this.open) { + this.open = true; + break; + } + if (this.filteredOptions.length > 0) { + super.keydownHandler(e); + } + if (this.isAutocompleteInline) { + this.setInlineSelection(); + } + break; + } + default: { + return true; + } + } + } + /** + * Handle keyup actions for value input and text field manipulations. + * + * @param e - the keyboard event + * @internal + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + case "ArrowRight": + case "Backspace": + case "Delete": + case "Home": + case "End": { + this.filter = this.control.value; + this.selectedIndex = -1; + this.filterOptions(); + break; + } + } + } + /** + * Ensure that the selectedIndex is within the current allowable filtered range. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + if (this.$fastController.isConnected) { + next = limit(-1, this.options.length - 1, next); + if (next !== this.selectedIndex) { + this.selectedIndex = next; + return; + } + super.selectedIndexChanged(prev, next); + } + } + /** + * Move focus to the previous selectable option. + * + * @internal + * @remarks + * Overrides `Listbox.selectPreviousOption` + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex >= 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Set the default selected options at initialization or reset. + * + * @internal + * @remarks + * Overrides `Listbox.setDefaultSelectedOption` + */ + setDefaultSelectedOption() { + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el) => el.getAttribute("selected") !== null || el.selected); + this.selectedIndex = selectedIndex; + if (!this.dirtyValue && this.firstSelectedOption) { + this.value = this.firstSelectedOption.text; + } + this.setSelectedOptions(); + } + } + /** + * Focus and set the content of the control based on the first selected option. + * + * @internal + */ + setInputToSelection() { + if (this.firstSelectedOption) { + this.control.value = this.firstSelectedOption.text; + this.control.focus(); + } + } + /** + * Focus, set and select the content of the control based on the first selected option. + * + * @internal + */ + setInlineSelection() { + if (this.firstSelectedOption) { + this.setInputToSelection(); + this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward"); + } + } + /** + * Determines if a value update should involve emitting a change event, then updates the value. + * + * @internal + */ + syncValue() { + var _a; + const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value; + this.updateValue(this.value !== newValue); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @param force - direction to force the listbox to display + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * Ensure that the entire list of options is used when setting the selected property. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + * @remarks + * Overrides: `Listbox.selectedOptionsChanged` + */ + selectedOptionsChanged(prev, next) { + if (this.$fastController.isConnected) { + this._options.forEach((o) => { + o.selected = next.includes(o); + }); + } + } + /** + * Synchronize the form-associated proxy and update the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + super.slottedOptionsChanged(prev, next); + this.updateValue(); + } + /** + * Sets the value and to match the first selected option. + * + * @param shouldEmit - if true, the change event will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a; + if (this.$fastController.isConnected) { + this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value; + this.control.value = this.value; + } + if (shouldEmit) { + this.$emit("change"); + } + } + /** + * @internal + */ + clearSelectionRange() { + const controlValueLength = this.control.value.length; + this.control.setSelectionRange(controlValueLength, controlValueLength); + } + }; + __decorate([ + attr({ attribute: "autocomplete", mode: "fromView" }) + ], Combobox.prototype, "autocomplete", void 0); + __decorate([ + observable + ], Combobox.prototype, "maxHeight", void 0); + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Combobox.prototype, "open", void 0); + __decorate([ + attr + ], Combobox.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Combobox.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Combobox.prototype, "position", void 0); + DelegatesARIACombobox = class { + }; + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0); + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIACombobox, DelegatesARIAListbox); + applyMixins(Combobox, StartEnd, DelegatesARIACombobox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js + var init_combobox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js + var init_combobox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js"() { + init_combobox(); + init_combobox_options(); + init_combobox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js + function composedParent(element) { + const parentNode = element.parentElement; + if (parentNode) { + return parentNode; + } else { + const rootNode = element.getRootNode(); + if (rootNode.host instanceof HTMLElement) { + return rootNode.host; + } + } + return null; + } + var init_composed_parent = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js + function composedContains(reference, test) { + let current = test; + while (current !== null) { + if (current === reference) { + return true; + } + current = composedParent(current); + } + return false; + } + var init_composed_contains = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js"() { + init_composed_parent(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js + function isFastElement(element) { + return element instanceof FASTElement; + } + var defaultElement, QueuedStyleSheetTarget, ConstructableStyleSheetTarget, DocumentStyleSheetTarget, HeadStyleElementStyleSheetTarget, StyleElementStyleSheetTarget, ElementStyleSheetTarget, RootStyleSheetTarget, propertyTargetCache, propertyTargetCtor, PropertyTargetManager; + var init_custom_property_manager = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js"() { + init_tslib_es6(); + init_esm(); + defaultElement = document.createElement("div"); + QueuedStyleSheetTarget = class { + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + ConstructableStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor(source) { + super(); + const sheet = new CSSStyleSheet(); + sheet[prependToAdoptedStyleSheetsSymbol] = true; + this.target = sheet.cssRules[sheet.insertRule(":host{}")].style; + source.$fastController.addStyles(ElementStyles.create([sheet])); + } + }; + DocumentStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + const sheet = new CSSStyleSheet(); + this.target = sheet.cssRules[sheet.insertRule(":root{}")].style; + document.adoptedStyleSheets = [ + ...document.adoptedStyleSheets, + sheet + ]; + } + }; + HeadStyleElementStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + this.style = document.createElement("style"); + document.head.appendChild(this.style); + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":root{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } + } + }; + StyleElementStyleSheetTarget = class { + constructor(target) { + this.store = /* @__PURE__ */ new Map(); + this.target = null; + const controller = target.$fastController; + this.style = document.createElement("style"); + controller.addStyles(this.style); + Observable.getNotifier(controller).subscribe(this, "isConnected"); + this.handleChange(controller, "isConnected"); + } + targetChanged() { + if (this.target !== null) { + for (const [key, value] of this.store.entries()) { + this.target.setProperty(key, value); + } + } + } + setProperty(name, value) { + this.store.set(name, value); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.setProperty(name, value); + } + }); + } + removeProperty(name) { + this.store.delete(name); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.removeProperty(name); + } + }); + } + handleChange(source, key) { + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":host{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } else { + this.target = null; + } + } + }; + __decorate([ + observable + ], StyleElementStyleSheetTarget.prototype, "target", void 0); + ElementStyleSheetTarget = class { + constructor(source) { + this.target = source.style; + } + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + RootStyleSheetTarget = class _RootStyleSheetTarget { + setProperty(name, value) { + _RootStyleSheetTarget.properties[name] = value; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); + } + } + removeProperty(name) { + delete _RootStyleSheetTarget.properties[name]; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); + } + } + static registerRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (!roots.has(root)) { + roots.add(root); + const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.setProperty(key, _RootStyleSheetTarget.properties[key]); + } + } + } + static unregisterRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (roots.has(root)) { + roots.delete(root); + const target = PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.removeProperty(key); + } + } + } + /** + * Returns the document when provided the default element, + * otherwise is a no-op + * @param root - the root to normalize + */ + static normalizeRoot(root) { + return root === defaultElement ? document : root; + } + }; + RootStyleSheetTarget.roots = /* @__PURE__ */ new Set(); + RootStyleSheetTarget.properties = {}; + propertyTargetCache = /* @__PURE__ */ new WeakMap(); + propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; + PropertyTargetManager = Object.freeze({ + getOrCreate(source) { + if (propertyTargetCache.has(source)) { + return propertyTargetCache.get(source); + } + let target; + if (source === defaultElement) { + target = new RootStyleSheetTarget(); + } else if (source instanceof Document) { + target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); + } else if (isFastElement(source)) { + target = new propertyTargetCtor(source); + } else { + target = new ElementStyleSheetTarget(source); + } + propertyTargetCache.set(source, target); + return target; + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js + function create(nameOrConfig) { + return DesignTokenImpl.from(nameOrConfig); + } + var DesignTokenImpl, CustomPropertyReflector, DesignTokenBindingObserver, Store, nodeCache, childToParent, DesignTokenNode, DesignToken; + var init_design_token = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js"() { + init_tslib_es6(); + init_esm(); + init_composed_parent(); + init_composed_contains(); + init_custom_property_manager(); + init_custom_property_manager(); + DesignTokenImpl = class _DesignTokenImpl extends CSSDirective { + constructor(configuration) { + super(); + this.subscribers = /* @__PURE__ */ new WeakMap(); + this._appliedTo = /* @__PURE__ */ new Set(); + this.name = configuration.name; + if (configuration.cssCustomPropertyName !== null) { + this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`; + this.cssVar = `var(${this.cssCustomProperty})`; + } + this.id = _DesignTokenImpl.uniqueId(); + _DesignTokenImpl.tokensById.set(this.id, this); + } + get appliedTo() { + return [...this._appliedTo]; + } + static from(nameOrConfig) { + return new _DesignTokenImpl({ + name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, + cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName + }); + } + static isCSSDesignToken(token) { + return typeof token.cssCustomProperty === "string"; + } + static isDerivedDesignTokenValue(value) { + return typeof value === "function"; + } + /** + * Gets a token by ID. Returns undefined if the token was not found. + * @param id - The ID of the token + * @returns + */ + static getTokenById(id) { + return _DesignTokenImpl.tokensById.get(id); + } + getOrCreateSubscriberSet(target = this) { + return this.subscribers.get(target) || this.subscribers.set(target, /* @__PURE__ */ new Set()) && this.subscribers.get(target); + } + createCSS() { + return this.cssVar || ""; + } + getValueFor(element) { + const value = DesignTokenNode.getOrCreate(element).get(this); + if (value !== void 0) { + return value; + } + throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${element} or an ancestor of ${element}.`); + } + setValueFor(element, value) { + this._appliedTo.add(element); + if (value instanceof _DesignTokenImpl) { + value = this.alias(value); + } + DesignTokenNode.getOrCreate(element).set(this, value); + return this; + } + deleteValueFor(element) { + this._appliedTo.delete(element); + if (DesignTokenNode.existsFor(element)) { + DesignTokenNode.getOrCreate(element).delete(this); + } + return this; + } + withDefault(value) { + this.setValueFor(defaultElement, value); + return this; + } + subscribe(subscriber, target) { + const subscriberSet = this.getOrCreateSubscriberSet(target); + if (target && !DesignTokenNode.existsFor(target)) { + DesignTokenNode.getOrCreate(target); + } + if (!subscriberSet.has(subscriber)) { + subscriberSet.add(subscriber); + } + } + unsubscribe(subscriber, target) { + const list = this.subscribers.get(target || this); + if (list && list.has(subscriber)) { + list.delete(subscriber); + } + } + /** + * Notifies subscribers that the value for an element has changed. + * @param element - The element to emit a notification for + */ + notify(element) { + const record = Object.freeze({ token: this, target: element }); + if (this.subscribers.has(this)) { + this.subscribers.get(this).forEach((sub) => sub.handleChange(record)); + } + if (this.subscribers.has(element)) { + this.subscribers.get(element).forEach((sub) => sub.handleChange(record)); + } + } + /** + * Alias the token to the provided token. + * @param token - the token to alias to + */ + alias(token) { + return ((target) => token.getValueFor(target)); + } + }; + DesignTokenImpl.uniqueId = /* @__PURE__ */ (() => { + let id = 0; + return () => { + id++; + return id.toString(16); + }; + })(); + DesignTokenImpl.tokensById = /* @__PURE__ */ new Map(); + CustomPropertyReflector = class { + startReflection(token, target) { + token.subscribe(this, target); + this.handleChange({ token, target }); + } + stopReflection(token, target) { + token.unsubscribe(this, target); + this.remove(token, target); + } + handleChange(record) { + const { token, target } = record; + this.add(token, target); + } + add(token, target) { + PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); + } + remove(token, target) { + PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); + } + resolveCSSValue(value) { + return value && typeof value.createCSS === "function" ? value.createCSS() : value; + } + }; + DesignTokenBindingObserver = class { + constructor(source, token, node) { + this.source = source; + this.token = token; + this.node = node; + this.dependencies = /* @__PURE__ */ new Set(); + this.observer = Observable.binding(source, this, false); + this.observer.handleChange = this.observer.call; + this.handleChange(); + } + disconnect() { + this.observer.disconnect(); + } + /** + * @internal + */ + handleChange() { + try { + this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); + } catch (e) { + console.error(e); + } + } + }; + Store = class { + constructor() { + this.values = /* @__PURE__ */ new Map(); + } + set(token, value) { + if (this.values.get(token) !== value) { + this.values.set(token, value); + Observable.getNotifier(this).notify(token.id); + } + } + get(token) { + Observable.track(this, token.id); + return this.values.get(token); + } + delete(token) { + this.values.delete(token); + Observable.getNotifier(this).notify(token.id); + } + all() { + return this.values.entries(); + } + }; + nodeCache = /* @__PURE__ */ new WeakMap(); + childToParent = /* @__PURE__ */ new WeakMap(); + DesignTokenNode = class _DesignTokenNode { + constructor(target) { + this.target = target; + this.store = new Store(); + this.children = []; + this.assignedValues = /* @__PURE__ */ new Map(); + this.reflecting = /* @__PURE__ */ new Set(); + this.bindingObservers = /* @__PURE__ */ new Map(); + this.tokenValueChangeHandler = { + handleChange: (source, arg) => { + const token = DesignTokenImpl.getTokenById(arg); + if (token) { + token.notify(this.target); + this.updateCSSTokenReflection(source, token); + } + } + }; + nodeCache.set(target, this); + Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); + if (target instanceof FASTElement) { + target.$fastController.addBehaviors([this]); + } else if (target.isConnected) { + this.bind(); + } + } + /** + * Returns a DesignTokenNode for an element. + * Creates a new instance if one does not already exist for a node, + * otherwise returns the cached instance + * + * @param target - The HTML element to retrieve a DesignTokenNode for + */ + static getOrCreate(target) { + return nodeCache.get(target) || new _DesignTokenNode(target); + } + /** + * Determines if a DesignTokenNode has been created for a target + * @param target - The element to test + */ + static existsFor(target) { + return nodeCache.has(target); + } + /** + * Searches for and return the nearest parent DesignTokenNode. + * Null is returned if no node is found or the node provided is for a default element. + */ + static findParent(node) { + if (!(defaultElement === node.target)) { + let parent = composedParent(node.target); + while (parent !== null) { + if (nodeCache.has(parent)) { + return nodeCache.get(parent); + } + parent = composedParent(parent); + } + return _DesignTokenNode.getOrCreate(defaultElement); + } + return null; + } + /** + * Finds the closest node with a value explicitly assigned for a token, otherwise null. + * @param token - The token to look for + * @param start - The node to start looking for value assignment + * @returns + */ + static findClosestAssignedNode(token, start) { + let current = start; + do { + if (current.has(token)) { + return current; + } + current = current.parent ? current.parent : current.target !== defaultElement ? _DesignTokenNode.getOrCreate(defaultElement) : null; + } while (current !== null); + return null; + } + /** + * The parent DesignTokenNode, or null. + */ + get parent() { + return childToParent.get(this) || null; + } + updateCSSTokenReflection(source, token) { + if (DesignTokenImpl.isCSSDesignToken(token)) { + const parent = this.parent; + const reflecting = this.isReflecting(token); + if (parent) { + const parentValue = parent.get(token); + const sourceValue = source.get(token); + if (parentValue !== sourceValue && !reflecting) { + this.reflectToCSS(token); + } else if (parentValue === sourceValue && reflecting) { + this.stopReflectToCSS(token); + } + } else if (!reflecting) { + this.reflectToCSS(token); + } + } + } + /** + * Checks if a token has been assigned an explicit value the node. + * @param token - the token to check. + */ + has(token) { + return this.assignedValues.has(token); + } + /** + * Gets the value of a token for a node + * @param token - The token to retrieve the value for + * @returns + */ + get(token) { + const value = this.store.get(token); + if (value !== void 0) { + return value; + } + const raw = this.getRaw(token); + if (raw !== void 0) { + this.hydrate(token, raw); + return this.get(token); + } + } + /** + * Retrieves the raw assigned value of a token from the nearest assigned node. + * @param token - The token to retrieve a raw value for + * @returns + */ + getRaw(token) { + var _a; + if (this.assignedValues.has(token)) { + return this.assignedValues.get(token); + } + return (_a = _DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); + } + /** + * Sets a token to a value for a node + * @param token - The token to set + * @param value - The value to set the token to + */ + set(token, value) { + if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { + this.tearDownBindingObserver(token); + } + this.assignedValues.set(token, value); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + this.setupBindingObserver(token, value); + } else { + this.store.set(token, value); + } + } + /** + * Deletes a token value for the node. + * @param token - The token to delete the value for + */ + delete(token) { + this.assignedValues.delete(token); + this.tearDownBindingObserver(token); + const upstream = this.getRaw(token); + if (upstream) { + this.hydrate(token, upstream); + } else { + this.store.delete(token); + } + } + /** + * Invoked when the DesignTokenNode.target is attached to the document + */ + bind() { + const parent = _DesignTokenNode.findParent(this); + if (parent) { + parent.appendChild(this); + } + for (const key of this.assignedValues.keys()) { + key.notify(this.target); + } + } + /** + * Invoked when the DesignTokenNode.target is detached from the document + */ + unbind() { + if (this.parent) { + const parent = childToParent.get(this); + parent.removeChild(this); + } + for (const token of this.bindingObservers.keys()) { + this.tearDownBindingObserver(token); + } + } + /** + * Appends a child to a parent DesignTokenNode. + * @param child - The child to append to the node + */ + appendChild(child) { + if (child.parent) { + childToParent.get(child).removeChild(child); + } + const reParent = this.children.filter((x) => child.contains(x)); + childToParent.set(child, this); + this.children.push(child); + reParent.forEach((x) => child.appendChild(x)); + Observable.getNotifier(this.store).subscribe(child); + for (const [token, value] of this.store.all()) { + child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); + child.updateCSSTokenReflection(child.store, token); + } + } + /** + * Removes a child from a node. + * @param child - The child to remove. + */ + removeChild(child) { + const childIndex = this.children.indexOf(child); + if (childIndex !== -1) { + this.children.splice(childIndex, 1); + } + Observable.getNotifier(this.store).unsubscribe(child); + if (child.parent !== this) { + return false; + } + const deleted = childToParent.delete(child); + for (const [token] of this.store.all()) { + child.hydrate(token, child.getRaw(token)); + child.updateCSSTokenReflection(child.store, token); + } + return deleted; + } + /** + * Tests whether a provided node is contained by + * the calling node. + * @param test - The node to test + */ + contains(test) { + return composedContains(this.target, test.target); + } + /** + * Instructs the node to reflect a design token for the provided token. + * @param token - The design token to reflect + */ + reflectToCSS(token) { + if (!this.isReflecting(token)) { + this.reflecting.add(token); + _DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); + } + } + /** + * Stops reflecting a DesignToken to CSS + * @param token - The design token to stop reflecting + */ + stopReflectToCSS(token) { + if (this.isReflecting(token)) { + this.reflecting.delete(token); + _DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); + } + } + /** + * Determines if a token is being reflected to CSS for a node. + * @param token - The token to check for reflection + * @returns + */ + isReflecting(token) { + return this.reflecting.has(token); + } + /** + * Handle changes to upstream tokens + * @param source - The parent DesignTokenNode + * @param property - The token ID that changed + */ + handleChange(source, property) { + const token = DesignTokenImpl.getTokenById(property); + if (!token) { + return; + } + this.hydrate(token, this.getRaw(token)); + this.updateCSSTokenReflection(this.store, token); + } + /** + * Hydrates a token with a DesignTokenValue, making retrieval available. + * @param token - The token to hydrate + * @param value - The value to hydrate + */ + hydrate(token, value) { + if (!this.has(token)) { + const observer = this.bindingObservers.get(token); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + if (observer) { + if (observer.source !== value) { + this.tearDownBindingObserver(token); + this.setupBindingObserver(token, value); + } + } else { + this.setupBindingObserver(token, value); + } + } else { + if (observer) { + this.tearDownBindingObserver(token); + } + this.store.set(token, value); + } + } + } + /** + * Sets up a binding observer for a derived token value that notifies token + * subscribers on change. + * + * @param token - The token to notify when the binding updates + * @param source - The binding source + */ + setupBindingObserver(token, source) { + const binding = new DesignTokenBindingObserver(source, token, this); + this.bindingObservers.set(token, binding); + return binding; + } + /** + * Tear down a binding observer for a token. + */ + tearDownBindingObserver(token) { + if (this.bindingObservers.has(token)) { + this.bindingObservers.get(token).disconnect(); + this.bindingObservers.delete(token); + return true; + } + return false; + } + }; + DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); + __decorate([ + observable + ], DesignTokenNode.prototype, "children", void 0); + DesignToken = Object.freeze({ + create, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been connected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * 3. The HTMLElement is not connected to the document when token values are set. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyConnection(element) { + if (!element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).bind(); + return true; + }, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been disconnected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyDisconnection(element) { + if (element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).unbind(); + return true; + }, + /** + * Registers and element or document as a DesignToken root. + * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via + * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all + * registered roots. + * @param target - The root to register + */ + registerRoot(target = defaultElement) { + RootStyleSheetTarget.registerRoot(target); + }, + /** + * Unregister an element or document as a DesignToken root. + * @param target - The root to deregister + */ + unregisterRoot(target = defaultElement) { + RootStyleSheetTarget.unregisterRoot(target); + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js + function extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) { + if (typeof params === "string") { + return { + name: params, + type: elementDefinitionType, + callback: elementDefinitionCallback + }; + } else { + return params; + } + } + var ElementDisambiguation, elementTypesByTag, elementTagsByType, rootDesignSystem, designSystemKey, DesignSystem, DefaultDesignSystem, ElementDefinitionEntry; + var init_design_system = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"() { + init_esm(); + init_foundation_element(); + init_di(); + init_design_token(); + init_component_presentation(); + ElementDisambiguation = Object.freeze({ + /** + * Skip defining the element but still call the provided callback passed + * to DesignSystemRegistrationContext.tryDefineElement + */ + definitionCallbackOnly: null, + /** + * Ignore the duplicate element entirely. + */ + ignoreDuplicate: /* @__PURE__ */ Symbol() + }); + elementTypesByTag = /* @__PURE__ */ new Map(); + elementTagsByType = /* @__PURE__ */ new Map(); + rootDesignSystem = null; + designSystemKey = DI.createInterface((x) => x.cachedCallback((handler) => { + if (rootDesignSystem === null) { + rootDesignSystem = new DefaultDesignSystem(null, handler); + } + return rootDesignSystem; + })); + DesignSystem = Object.freeze({ + /** + * Returns the HTML element name that the type is defined as. + * @param type - The type to lookup. + * @public + */ + tagFor(type) { + return elementTagsByType.get(type); + }, + /** + * Searches the DOM hierarchy for the design system that is responsible + * for the provided element. + * @param element - The element to locate the design system for. + * @returns The located design system. + * @public + */ + responsibleFor(element) { + const owned = element.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.findResponsibleContainer(element); + return container.get(designSystemKey); + }, + /** + * Gets the DesignSystem if one is explicitly defined on the provided element; + * otherwise creates a design system defined directly on the element. + * @param element - The element to get or create a design system for. + * @returns The design system. + * @public + */ + getOrCreate(node) { + if (!node) { + if (rootDesignSystem === null) { + rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey); + } + return rootDesignSystem; + } + const owned = node.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.getOrCreateDOMContainer(node); + if (container.has(designSystemKey, false)) { + return container.get(designSystemKey); + } else { + const system = new DefaultDesignSystem(node, container); + container.register(Registration.instance(designSystemKey, system)); + return system; + } + } + }); + DefaultDesignSystem = class { + constructor(owner, container) { + this.owner = owner; + this.container = container; + this.designTokensInitialized = false; + this.prefix = "fast"; + this.shadowRootMode = void 0; + this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly; + if (owner !== null) { + owner.$$designSystem$$ = this; + } + } + withPrefix(prefix) { + this.prefix = prefix; + return this; + } + withShadowRootMode(mode) { + this.shadowRootMode = mode; + return this; + } + withElementDisambiguation(callback) { + this.disambiguate = callback; + return this; + } + withDesignTokenRoot(root) { + this.designTokenRoot = root; + return this; + } + register(...registrations) { + const container = this.container; + const elementDefinitionEntries = []; + const disambiguate = this.disambiguate; + const shadowRootMode = this.shadowRootMode; + const context = { + elementPrefix: this.prefix, + tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) { + const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback); + const { name, callback, baseClass } = extractedParams; + let { type } = extractedParams; + let elementName = name; + let typeFoundByName = elementTypesByTag.get(elementName); + let needsDefine = true; + while (typeFoundByName) { + const result = disambiguate(elementName, type, typeFoundByName); + switch (result) { + case ElementDisambiguation.ignoreDuplicate: + return; + case ElementDisambiguation.definitionCallbackOnly: + needsDefine = false; + typeFoundByName = void 0; + break; + default: + elementName = result; + typeFoundByName = elementTypesByTag.get(elementName); + break; + } + } + if (needsDefine) { + if (elementTagsByType.has(type) || type === FoundationElement) { + type = class extends type { + }; + } + elementTypesByTag.set(elementName, type); + elementTagsByType.set(type, elementName); + if (baseClass) { + elementTagsByType.set(baseClass, elementName); + } + } + elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine)); + } + }; + if (!this.designTokensInitialized) { + this.designTokensInitialized = true; + if (this.designTokenRoot !== null) { + DesignToken.registerRoot(this.designTokenRoot); + } + } + container.registerWithContext(context, ...registrations); + for (const entry of elementDefinitionEntries) { + entry.callback(entry); + if (entry.willDefine && entry.definition !== null) { + entry.definition.define(); + } + } + return this; + } + }; + ElementDefinitionEntry = class { + constructor(container, name, type, shadowRootMode, callback, willDefine) { + this.container = container; + this.name = name; + this.type = type; + this.shadowRootMode = shadowRootMode; + this.callback = callback; + this.willDefine = willDefine; + this.definition = null; + } + definePresentation(presentation) { + ComponentPresentation.define(this.name, presentation, this.container); + } + defineElement(definition) { + this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name })); + } + tagFor(type) { + return DesignSystem.tagFor(type); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js + var init_registration_context = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js + var init_design_system2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js"() { + init_design_system(); + init_component_presentation(); + init_registration_context(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/index.js + var init_di2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/index.js"() { + init_di(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js + var init_dialog_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js"() { + } + }); + + // node_modules/tabbable/dist/index.esm.js + var candidateSelectors, candidateSelector, NoElement, matches, getRootNode, getTabindex, isInput, isHiddenInput, isDetailsWithSummary, getCheckedRadio, isTabbableRadio, isRadio, isNonTabbableRadio, isZeroArea, isHidden, isDisabledFromFieldset, isNodeMatchingSelectorFocusable, isNodeMatchingSelectorTabbable, isTabbable, focusableCandidateSelector, isFocusable; + var init_index_esm = __esm({ + "node_modules/tabbable/dist/index.esm.js"() { + candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + NoElement = typeof Element === "undefined"; + matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; + }; + getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } + }; + isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot2 = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot2 === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot2(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js + var Dialog; + var init_dialog = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + Dialog = class _Dialog extends FoundationElement { + constructor() { + super(...arguments); + this.modal = true; + this.hidden = false; + this.trapFocus = true; + this.trapFocusChanged = () => { + if (this.$fastController.isConnected) { + this.updateTrapFocus(); + } + }; + this.isTrappingFocus = false; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && !this.hidden) { + switch (e.key) { + case keyEscape: + this.dismiss(); + e.preventDefault(); + break; + case keyTab: + this.handleTabKeyDown(e); + break; + } + } + }; + this.handleDocumentFocus = (e) => { + if (!e.defaultPrevented && this.shouldForceFocus(e.target)) { + this.focusFirstElement(); + e.preventDefault(); + } + }; + this.handleTabKeyDown = (e) => { + if (!this.trapFocus || this.hidden) { + return; + } + const bounds = this.getTabQueueBounds(); + if (bounds.length === 0) { + return; + } + if (bounds.length === 1) { + bounds[0].focus(); + e.preventDefault(); + return; + } + if (e.shiftKey && e.target === bounds[0]) { + bounds[bounds.length - 1].focus(); + e.preventDefault(); + } else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) { + bounds[0].focus(); + e.preventDefault(); + } + return; + }; + this.getTabQueueBounds = () => { + const bounds = []; + return _Dialog.reduceTabbableItems(bounds, this); + }; + this.focusFirstElement = () => { + const bounds = this.getTabQueueBounds(); + if (bounds.length > 0) { + bounds[0].focus(); + } else { + if (this.dialog instanceof HTMLElement) { + this.dialog.focus(); + } + } + }; + this.shouldForceFocus = (currentFocusElement) => { + return this.isTrappingFocus && !this.contains(currentFocusElement); + }; + this.shouldTrapFocus = () => { + return this.trapFocus && !this.hidden; + }; + this.updateTrapFocus = (shouldTrapFocusOverride) => { + const shouldTrapFocus = shouldTrapFocusOverride === void 0 ? this.shouldTrapFocus() : shouldTrapFocusOverride; + if (shouldTrapFocus && !this.isTrappingFocus) { + this.isTrappingFocus = true; + document.addEventListener("focusin", this.handleDocumentFocus); + DOM.queueUpdate(() => { + if (this.shouldForceFocus(document.activeElement)) { + this.focusFirstElement(); + } + }); + } else if (!shouldTrapFocus && this.isTrappingFocus) { + this.isTrappingFocus = false; + document.removeEventListener("focusin", this.handleDocumentFocus); + } + }; + } + /** + * @internal + */ + dismiss() { + this.$emit("dismiss"); + this.$emit("cancel"); + } + /** + * The method to show the dialog. + * + * @public + */ + show() { + this.hidden = false; + } + /** + * The method to hide the dialog. + * + * @public + */ + hide() { + this.hidden = true; + this.$emit("close"); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + document.addEventListener("keydown", this.handleDocumentKeydown); + this.notifier = Observable.getNotifier(this); + this.notifier.subscribe(this, "hidden"); + this.updateTrapFocus(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.updateTrapFocus(false); + this.notifier.unsubscribe(this, "hidden"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "hidden": + this.updateTrapFocus(); + break; + default: + break; + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceTabbableItems(elements2, element) { + if (element.getAttribute("tabindex") === "-1") { + return elements2; + } + if (isTabbable(element) || _Dialog.isFocusableFastElement(element) && _Dialog.hasTabbableShadow(element)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Dialog.reduceTabbableItems, [])); + } + return elements2; + } + /** + * Test if element is focusable fast element + * + * @param element - The element to check + * + * @internal + */ + static isFocusableFastElement(element) { + var _a, _b; + return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus); + } + /** + * Test if the element has a focusable shadow + * + * @param element - The element to check + * + * @internal + */ + static hasTabbableShadow(element) { + var _a, _b; + return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("*")) !== null && _b !== void 0 ? _b : []).some((x) => { + return isTabbable(x); + }); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "modal", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "hidden", void 0); + __decorate([ + attr({ attribute: "trap-focus", mode: "boolean" }) + ], Dialog.prototype, "trapFocus", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], Dialog.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], Dialog.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], Dialog.prototype, "ariaLabel", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js + var init_dialog2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js"() { + init_dialog_template(); + init_dialog(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js + var init_disclosure_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js + var Disclosure; + var init_disclosure = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Disclosure = class extends FoundationElement { + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.setup(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.details.removeEventListener("toggle", this.onToggle); + } + /** + * Show extra content. + */ + show() { + this.details.open = true; + } + /** + * Hide extra content. + */ + hide() { + this.details.open = false; + } + /** + * Toggle the current(expanded/collapsed) state. + */ + toggle() { + this.details.open = !this.details.open; + } + /** + * Register listener and set default disclosure mode + */ + setup() { + this.onToggle = this.onToggle.bind(this); + this.details.addEventListener("toggle", this.onToggle); + if (this.expanded) { + this.show(); + } + } + /** + * Update the aria attr and fire `toggle` event + */ + onToggle() { + this.expanded = this.details.open; + this.$emit("toggle"); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Disclosure.prototype, "expanded", void 0); + __decorate([ + attr + ], Disclosure.prototype, "title", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js + var init_disclosure2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js"() { + init_disclosure_template(); + init_disclosure(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js + var dividerTemplate; + var init_divider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js"() { + init_esm(); + dividerTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js + var DividerRole; + var init_divider_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js"() { + DividerRole = { + /** + * The divider semantically separates content + */ + separator: "separator", + /** + * The divider has no semantic value and is for visual presentation only. + */ + presentation: "presentation" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js + var Divider; + var init_divider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_divider_options(); + Divider = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = DividerRole.separator; + this.orientation = Orientation.horizontal; + } + }; + __decorate([ + attr + ], Divider.prototype, "role", void 0); + __decorate([ + attr + ], Divider.prototype, "orientation", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js + var init_divider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js"() { + init_divider_template(); + init_divider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js + var FlipperDirection; + var init_flipper_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js"() { + FlipperDirection = { + next: "next", + previous: "previous" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js + var init_flipper_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js + var Flipper; + var init_flipper = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_flipper_options(); + Flipper = class extends FoundationElement { + constructor() { + super(...arguments); + this.hiddenFromAT = true; + this.direction = FlipperDirection.next; + } + /** + * Simulate a click event when the flipper has focus and the user hits enter or space keys + * Blur focus if the user hits escape key + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + if (!this.hiddenFromAT) { + const key = e.key; + if (key === "Enter" || key === "Space") { + this.$emit("click", e); + } + if (key === "Escape") { + this.blur(); + } + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Flipper.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "aria-hidden", converter: booleanConverter }) + ], Flipper.prototype, "hiddenFromAT", void 0); + __decorate([ + attr + ], Flipper.prototype, "direction", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js + var init_flipper2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js"() { + init_flipper_template(); + init_flipper(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js + var init_form_associated2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js"() { + init_form_associated(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js + var init_foundation_element2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js"() { + init_foundation_element(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js + var listboxOptionTemplate; + var init_listbox_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js"() { + init_esm(); + init_start_end(); + listboxOptionTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js + var init_listbox_option2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js"() { + init_listbox_option(); + init_listbox_option_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js + var ListboxElement; + var init_listbox_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + ListboxElement = class extends Listbox { + constructor() { + super(...arguments); + this.activeIndex = -1; + this.rangeStartIndex = -1; + } + /** + * Returns the last checked option. + * + * @internal + */ + get activeOption() { + return this.options[this.activeIndex]; + } + /** + * Returns the list of checked options. + * + * @internal + */ + get checkedOptions() { + var _a; + return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((o) => o.checked); + } + /** + * Returns the index of the first selected option. + * + * @internal + */ + get firstSelectedOptionIndex() { + return this.options.indexOf(this.firstSelectedOption); + } + /** + * Updates the `ariaActiveDescendant` property when the active index changes. + * + * @param prev - the previous active index + * @param next - the next active index + * + * @internal + */ + activeIndexChanged(prev, next) { + var _a, _b; + this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; + this.focusAndScrollOptionIntoView(); + } + /** + * Toggles the checked state for the currently active option. + * + * @remarks + * Multiple-selection mode only. + * + * @internal + */ + checkActiveIndex() { + if (!this.multiple) { + return; + } + const activeItem = this.activeOption; + if (activeItem) { + activeItem.checked = true; + } + } + /** + * Sets the active index to the first option and marks it as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkFirstOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex + 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and sets the matching option as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkLastOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.options.length); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = this.options.length - 1; + this.checkActiveIndex(); + } + /** + * @override + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("focusout", this.focusoutHandler); + } + /** + * @override + * @internal + */ + disconnectedCallback() { + this.removeEventListener("focusout", this.focusoutHandler); + super.disconnectedCallback(); + } + /** + * Increments the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkNextOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.activeIndex + 1); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkPreviousOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + if (this.checkedOptions.length === 1) { + this.rangeStartIndex += 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.activeIndex, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex -= this.activeIndex > 0 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Handles click events for listbox options. + * + * @param e - the event object + * + * @override + * @internal + */ + clickHandler(e) { + var _a; + if (!this.multiple) { + return super.clickHandler(e); + } + const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`); + if (!captured || captured.disabled) { + return; + } + this.uncheckAllOptions(); + this.activeIndex = this.options.indexOf(captured); + this.checkActiveIndex(); + this.toggleSelectedForAllCheckedOptions(); + return true; + } + /** + * @override + * @internal + */ + focusAndScrollOptionIntoView() { + super.focusAndScrollOptionIntoView(this.activeOption); + } + /** + * In multiple-selection mode: + * If any options are selected, the first selected option is checked when + * the listbox receives focus. If no options are selected, the first + * selectable option is checked. + * + * @override + * @internal + */ + focusinHandler(e) { + if (!this.multiple) { + return super.focusinHandler(e); + } + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.uncheckAllOptions(); + if (this.activeIndex === -1) { + this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0; + } + this.checkActiveIndex(); + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Unchecks all options when the listbox loses focus. + * + * @internal + */ + focusoutHandler(e) { + if (this.multiple) { + this.uncheckAllOptions(); + } + } + /** + * Handles keydown actions for listbox navigation and typeahead + * + * @override + * @internal + */ + keydownHandler(e) { + if (!this.multiple) { + return super.keydownHandler(e); + } + if (this.disabled) { + return true; + } + const { key, shiftKey } = e; + this.shouldSkipFocus = false; + switch (key) { + // Select the first available option + case keyHome: { + this.checkFirstOption(shiftKey); + return; + } + // Select the next selectable option + case keyArrowDown: { + this.checkNextOption(shiftKey); + return; + } + // Select the previous selectable option + case keyArrowUp: { + this.checkPreviousOption(shiftKey); + return; + } + // Select the last available option + case keyEnd: { + this.checkLastOption(shiftKey); + return; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEscape: { + this.uncheckAllOptions(); + this.checkActiveIndex(); + return true; + } + case keySpace: { + e.preventDefault(); + if (this.typeAheadExpired) { + this.toggleSelectedForAllCheckedOptions(); + return; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @override + * @internal + */ + mousedownHandler(e) { + if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) { + return super.mousedownHandler(e); + } + } + /** + * Switches between single-selection and multi-selection mode. + * + * @internal + */ + multipleChanged(prev, next) { + var _a; + this.ariaMultiSelectable = next ? "true" : null; + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + o.checked = next ? false : void 0; + }); + this.setSelectedOptions(); + } + /** + * Sets an option as selected and gives it focus. + * + * @override + * @public + */ + setSelectedOptions() { + if (!this.multiple) { + super.setSelectedOptions(); + return; + } + if (this.$fastController.isConnected && this.options) { + this.selectedOptions = this.options.filter((o) => o.selected); + this.focusAndScrollOptionIntoView(); + } + } + /** + * Ensures the size is a positive integer when the property is updated. + * + * @param prev - the previous size value + * @param next - the current size value + * + * @internal + */ + sizeChanged(prev, next) { + var _a; + const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10)); + if (size !== next) { + DOM.queueUpdate(() => { + this.size = size; + }); + } + } + /** + * Toggles the selected state of the provided options. If any provided items + * are in an unselected state, all items are set to selected. If every + * provided item is selected, they are all unselected. + * + * @internal + */ + toggleSelectedForAllCheckedOptions() { + const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled); + const force = !enabledCheckedOptions.every((o) => o.selected); + enabledCheckedOptions.forEach((o) => o.selected = force); + this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]); + this.setSelectedOptions(); + } + /** + * @override + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (!this.multiple) { + super.typeaheadBufferChanged(prev, next); + return; + } + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + const activeIndex = this.options.indexOf(typeaheadMatches[0]); + if (activeIndex > -1) { + this.activeIndex = activeIndex; + this.uncheckAllOptions(); + this.checkActiveIndex(); + } + this.typeAheadExpired = false; + } + } + /** + * Unchecks all options. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - reset the rangeStartIndex + * + * @internal + */ + uncheckAllOptions(preserveChecked = false) { + this.options.forEach((o) => o.checked = this.multiple ? false : void 0); + if (!preserveChecked) { + this.rangeStartIndex = -1; + } + } + }; + __decorate([ + observable + ], ListboxElement.prototype, "activeIndex", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxElement.prototype, "multiple", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], ListboxElement.prototype, "size", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js + var init_listbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js + var init_listbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js"() { + init_listbox(); + init_listbox_element(); + init_listbox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js + var PickerMenu; + var init_picker_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js"() { + init_tslib_es6(); + init_dist2(); + init_esm(); + init_foundation_element(); + PickerMenu = class extends FoundationElement { + constructor() { + super(...arguments); + this.optionElements = []; + } + menuElementsChanged() { + this.updateOptions(); + } + headerElementsChanged() { + this.updateOptions(); + } + footerElementsChanged() { + this.updateOptions(); + } + updateOptions() { + this.optionElements.splice(0, this.optionElements.length); + this.addSlottedListItems(this.headerElements); + this.addSlottedListItems(this.menuElements); + this.addSlottedListItems(this.footerElements); + this.$emit("optionsupdated", { bubbles: false }); + } + addSlottedListItems(slotChildren) { + if (slotChildren === void 0) { + return; + } + slotChildren.forEach((child) => { + if (child.nodeType === 1 && child.getAttribute("role") === "listitem") { + child.id = child.id || uniqueId("option-"); + this.optionElements.push(child); + } + }); + } + }; + __decorate([ + observable + ], PickerMenu.prototype, "menuElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "headerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "footerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "suggestionsAvailableText", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js + var defaultContentsTemplate, PickerMenuOption; + var init_picker_menu_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + defaultContentsTemplate = html` + +`; + PickerMenuOption = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.disconnectView(); + } + handleClick(e) { + if (e.defaultPrevented) { + return false; + } + this.handleInvoked(); + return false; + } + handleInvoked() { + this.$emit("pickeroptioninvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerMenuOption.prototype, "value", void 0); + __decorate([ + observable + ], PickerMenuOption.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js + var init_picker_list = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js + var defaultContentsTemplate2, PickerListItem; + var init_picker_list_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + defaultContentsTemplate2 = html` + +`; + PickerListItem = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + this.disconnectView(); + super.disconnectedCallback(); + } + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + if (e.key === keyEnter) { + this.handleInvoke(); + return false; + } + return true; + } + handleClick(e) { + if (!e.defaultPrevented) { + this.handleInvoke(); + } + return false; + } + handleInvoke() { + this.$emit("pickeriteminvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate2.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerListItem.prototype, "value", void 0); + __decorate([ + observable + ], PickerListItem.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js + var init_picker_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js + var _Picker, FormAssociatedPicker; + var init_picker_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Picker = class extends FoundationElement { + }; + FormAssociatedPicker = class extends FormAssociated(_Picker) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js + var pickerInputTemplate, Picker; + var init_picker = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_anchored_region2(); + init_picker_menu_option(); + init_picker_list_item(); + init_picker_form_associated(); + pickerInputTemplate = html` + +`; + Picker = class extends FormAssociatedPicker { + constructor() { + super(...arguments); + this.selection = ""; + this.filterSelected = true; + this.filterQuery = true; + this.noSuggestionsText = "No suggestions available"; + this.suggestionsAvailableText = "Suggestions available"; + this.loadingText = "Loading suggestions"; + this.menuPlacement = "bottom-fill"; + this.showLoading = false; + this.optionsList = []; + this.filteredOptionsList = []; + this.flyoutOpen = false; + this.menuFocusIndex = -1; + this.showNoOptions = false; + this.selectedItems = []; + this.inputElementView = null; + this.handleTextInput = (e) => { + this.query = this.inputElement.value; + }; + this.handleInputClick = (e) => { + e.preventDefault(); + this.toggleFlyout(true); + }; + this.setRegionProps = () => { + if (!this.flyoutOpen) { + return; + } + if (this.region === null || this.region === void 0) { + DOM.queueUpdate(this.setRegionProps); + return; + } + this.region.anchorElement = this.inputElement; + }; + this.configLookup = { + top: FlyoutPosTop, + bottom: FlyoutPosBottom, + tallest: FlyoutPosTallest, + "top-fill": FlyoutPosTopFill, + "bottom-fill": FlyoutPosBottomFill, + "tallest-fill": FlyoutPosTallestFill + }; + } + selectionChanged() { + if (this.$fastController.isConnected) { + this.handleSelectionChange(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.value = this.selection; + this.validate(); + } + } + } + optionsChanged() { + this.optionsList = this.options.split(",").map((opt) => opt.trim()).filter((opt) => opt !== ""); + } + menuPlacementChanged() { + if (this.$fastController.isConnected) { + this.updateMenuConfig(); + } + } + showLoadingChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + listItemTemplateChanged() { + this.updateListItemTemplate(); + } + defaultListItemTemplateChanged() { + this.updateListItemTemplate(); + } + menuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + defaultMenuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + optionsListChanged() { + this.updateFilteredOptions(); + } + queryChanged() { + if (this.$fastController.isConnected) { + if (this.inputElement.value !== this.query) { + this.inputElement.value = this.query; + } + this.updateFilteredOptions(); + this.$emit("querychange", { bubbles: false }); + } + } + filteredOptionsListChanged() { + if (this.$fastController.isConnected) { + this.showNoOptions = this.filteredOptionsList.length === 0 && this.menuElement.querySelectorAll('[role="listitem"]').length === 0; + this.setFocusedOption(this.showNoOptions ? -1 : 0); + } + } + flyoutOpenChanged() { + if (this.flyoutOpen) { + DOM.queueUpdate(this.setRegionProps); + this.$emit("menuopening", { bubbles: false }); + } else { + this.$emit("menuclosing", { bubbles: false }); + } + } + showNoOptionsChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.listElement = document.createElement(this.selectedListTag); + this.appendChild(this.listElement); + this.itemsPlaceholderElement = document.createComment(""); + this.listElement.append(this.itemsPlaceholderElement); + this.inputElementView = pickerInputTemplate.render(this, this.listElement); + const match = this.menuTag.toUpperCase(); + this.menuElement = Array.from(this.children).find((element) => { + return element.tagName === match; + }); + if (this.menuElement === void 0) { + this.menuElement = document.createElement(this.menuTag); + this.appendChild(this.menuElement); + } + if (this.menuElement.id === "") { + this.menuElement.id = uniqueId("listbox-"); + } + this.menuId = this.menuElement.id; + this.optionsPlaceholder = document.createComment(""); + this.menuElement.append(this.optionsPlaceholder); + this.updateMenuConfig(); + DOM.queueUpdate(() => this.initialize()); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.toggleFlyout(false); + this.inputElement.removeEventListener("input", this.handleTextInput); + this.inputElement.removeEventListener("click", this.handleInputClick); + if (this.inputElementView !== null) { + this.inputElementView.dispose(); + this.inputElementView = null; + } + } + /** + * Move focus to the input element + * @public + */ + focus() { + this.inputElement.focus(); + } + /** + * Initialize the component. This is delayed a frame to ensure children are connected as well. + */ + initialize() { + this.updateListItemTemplate(); + this.updateOptionTemplate(); + this.itemsRepeatBehavior = new RepeatDirective((x) => x.selectedItems, (x) => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement); + this.inputElement.addEventListener("input", this.handleTextInput); + this.inputElement.addEventListener("click", this.handleInputClick); + this.$fastController.addBehaviors([this.itemsRepeatBehavior]); + this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText; + this.menuElement.addEventListener("optionsupdated", this.handleMenuOptionsUpdated); + this.optionsRepeatBehavior = new RepeatDirective((x) => x.filteredOptionsList, (x) => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder); + this.$fastController.addBehaviors([this.optionsRepeatBehavior]); + this.handleSelectionChange(); + } + /** + * Toggles the menu flyout + */ + toggleFlyout(open) { + if (this.flyoutOpen === open) { + return; + } + if (open && document.activeElement === this.inputElement) { + this.flyoutOpen = open; + DOM.queueUpdate(() => { + if (this.menuElement !== void 0) { + this.setFocusedOption(0); + } else { + this.disableMenu(); + } + }); + return; + } + this.flyoutOpen = false; + this.disableMenu(); + return; + } + /** + * Handle the menu options updated event from the child menu + */ + handleMenuOptionsUpdated(e) { + e.preventDefault(); + if (this.flyoutOpen) { + this.setFocusedOption(0); + } + } + /** + * Handle key down events. + */ + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + // TODO: what should "home" and "end" keys do, exactly? + // + // case keyHome: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.setFocusedOption(0); + // } + // } + // return false; + // } + // case keyEnd: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.toggleFlyout(true); + // this.setFocusedOption(this.menuElement.optionElements.length - 1); + // } + // } + // return false; + // } + case keyArrowDown: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const nextFocusOptionIndex = this.flyoutOpen ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1) : 0; + this.setFocusedOption(nextFocusOptionIndex); + } + return false; + } + case keyArrowUp: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const previousFocusOptionIndex = this.flyoutOpen ? Math.max(this.menuFocusIndex - 1, 0) : 0; + this.setFocusedOption(previousFocusOptionIndex); + } + return false; + } + case keyEscape: { + this.toggleFlyout(false); + return false; + } + case keyEnter: { + if (this.menuFocusIndex !== -1 && this.menuElement.optionElements.length > this.menuFocusIndex) { + this.menuElement.optionElements[this.menuFocusIndex].click(); + } + return false; + } + case keyArrowRight: { + if (document.activeElement !== this.inputElement) { + this.incrementFocusedItem(1); + return false; + } + return true; + } + case keyArrowLeft: { + if (this.inputElement.selectionStart === 0) { + this.incrementFocusedItem(-1); + return false; + } + return true; + } + case keyDelete: + case keyBackspace: { + if (document.activeElement === null) { + return true; + } + if (document.activeElement === this.inputElement) { + if (this.inputElement.selectionStart === 0) { + this.selection = this.selectedItems.slice(0, this.selectedItems.length - 1).toString(); + this.toggleFlyout(false); + return false; + } + return true; + } + const selectedItems = Array.from(this.listElement.children); + const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement); + if (currentFocusedItemIndex > -1) { + this.selection = this.selectedItems.splice(currentFocusedItemIndex, 1).toString(); + DOM.queueUpdate(() => { + selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus(); + }); + return false; + } + return true; + } + } + this.toggleFlyout(true); + return true; + } + /** + * Handle focus in events. + */ + handleFocusIn(e) { + return false; + } + /** + * Handle focus out events. + */ + handleFocusOut(e) { + if (this.menuElement === void 0 || !this.menuElement.contains(e.relatedTarget)) { + this.toggleFlyout(false); + } + return false; + } + /** + * The list of selected items has changed + */ + handleSelectionChange() { + if (this.selectedItems.toString() === this.selection) { + return; + } + this.selectedItems = this.selection === "" ? [] : this.selection.split(","); + this.updateFilteredOptions(); + DOM.queueUpdate(() => { + this.checkMaxItems(); + }); + this.$emit("selectionchange", { bubbles: false }); + } + /** + * Anchored region is loaded, menu and options exist in the DOM. + */ + handleRegionLoaded(e) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + this.$emit("menuloaded", { bubbles: false }); + }); + } + /** + * Checks if the maximum number of items has been chosen and updates the ui. + */ + checkMaxItems() { + if (this.inputElement === void 0) { + return; + } + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + if (document.activeElement === this.inputElement) { + const selectedItemInstances = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + selectedItemInstances[selectedItemInstances.length - 1].focus(); + } + this.inputElement.hidden = true; + } else { + this.inputElement.hidden = false; + } + } + /** + * A list item has been invoked. + */ + handleItemInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerListItem) { + const listItems = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + const itemIndex = listItems.indexOf(e.target); + if (itemIndex !== -1) { + const newSelection = this.selectedItems.slice(); + newSelection.splice(itemIndex, 1); + this.selection = newSelection.toString(); + DOM.queueUpdate(() => this.incrementFocusedItem(0)); + } + return false; + } + return true; + } + /** + * A menu option has been invoked. + */ + handleOptionInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerMenuOption) { + if (e.target.value !== void 0) { + this.selection = `${this.selection}${this.selection === "" ? "" : ","}${e.target.value}`; + } + this.inputElement.value = ""; + this.query = ""; + this.inputElement.focus(); + this.toggleFlyout(false); + return false; + } + return true; + } + /** + * Increments the focused list item by the specified amount + */ + incrementFocusedItem(increment) { + if (this.selectedItems.length === 0) { + this.inputElement.focus(); + return; + } + const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + if (document.activeElement !== null) { + let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement); + if (currentFocusedItemIndex === -1) { + currentFocusedItemIndex = selectedItemsAsElements.length; + } + const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment)); + if (newFocusedItemIndex === selectedItemsAsElements.length) { + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + selectedItemsAsElements[newFocusedItemIndex - 1].focus(); + } else { + this.inputElement.focus(); + } + } else { + selectedItemsAsElements[newFocusedItemIndex].focus(); + } + } + } + /** + * Disables the menu. Note that the menu can be open, just doens't have any valid options on display. + */ + disableMenu() { + var _a, _b, _c; + this.menuFocusIndex = -1; + this.menuFocusOptionId = void 0; + (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant"); + (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns"); + (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded"); + } + /** + * Sets the currently focused menu option by index + */ + setFocusedOption(optionIndex) { + if (!this.flyoutOpen || optionIndex === -1 || this.showNoOptions || this.showLoading) { + this.disableMenu(); + return; + } + if (this.menuElement.optionElements.length === 0) { + return; + } + this.menuElement.optionElements.forEach((element) => { + element.setAttribute("aria-selected", "false"); + }); + this.menuFocusIndex = optionIndex; + if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) { + this.menuFocusIndex = this.menuElement.optionElements.length - 1; + } + this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id; + this.inputElement.setAttribute("aria-owns", this.menuId); + this.inputElement.setAttribute("aria-expanded", "true"); + this.inputElement.setAttribute("aria-activedescendant", this.menuFocusOptionId); + const focusedOption = this.menuElement.optionElements[this.menuFocusIndex]; + focusedOption.setAttribute("aria-selected", "true"); + this.menuElement.scrollTo(0, focusedOption.offsetTop); + } + /** + * Updates the template used for the list item repeat behavior + */ + updateListItemTemplate() { + var _a; + this.activeListItemTemplate = (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate; + } + /** + * Updates the template used for the menu option repeat behavior + */ + updateOptionTemplate() { + var _a; + this.activeMenuOptionTemplate = (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate; + } + /** + * Updates the filtered options array + */ + updateFilteredOptions() { + this.filteredOptionsList = this.optionsList.slice(0); + if (this.filterSelected) { + this.filteredOptionsList = this.filteredOptionsList.filter((el) => this.selectedItems.indexOf(el) === -1); + } + if (this.filterQuery && this.query !== "" && this.query !== void 0) { + this.filteredOptionsList = this.filteredOptionsList.filter((el) => el.indexOf(this.query) !== -1); + } + } + /** + * Updates the menu configuration + */ + updateMenuConfig() { + let newConfig = this.configLookup[this.menuPlacement]; + if (newConfig === null) { + newConfig = FlyoutPosBottomFill; + } + this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false }); + } + }; + __decorate([ + attr({ attribute: "selection" }) + ], Picker.prototype, "selection", void 0); + __decorate([ + attr({ attribute: "options" }) + ], Picker.prototype, "options", void 0); + __decorate([ + attr({ attribute: "filter-selected", mode: "boolean" }) + ], Picker.prototype, "filterSelected", void 0); + __decorate([ + attr({ attribute: "filter-query", mode: "boolean" }) + ], Picker.prototype, "filterQuery", void 0); + __decorate([ + attr({ attribute: "max-selected" }) + ], Picker.prototype, "maxSelected", void 0); + __decorate([ + attr({ attribute: "no-suggestions-text" }) + ], Picker.prototype, "noSuggestionsText", void 0); + __decorate([ + attr({ attribute: "suggestions-available-text" }) + ], Picker.prototype, "suggestionsAvailableText", void 0); + __decorate([ + attr({ attribute: "loading-text" }) + ], Picker.prototype, "loadingText", void 0); + __decorate([ + attr({ attribute: "label" }) + ], Picker.prototype, "label", void 0); + __decorate([ + attr({ attribute: "labelledby" }) + ], Picker.prototype, "labelledBy", void 0); + __decorate([ + attr({ attribute: "placeholder" }) + ], Picker.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "menu-placement" }) + ], Picker.prototype, "menuPlacement", void 0); + __decorate([ + observable + ], Picker.prototype, "showLoading", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "optionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "query", void 0); + __decorate([ + observable + ], Picker.prototype, "filteredOptionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "flyoutOpen", void 0); + __decorate([ + observable + ], Picker.prototype, "menuId", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedListTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusIndex", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusOptionId", void 0); + __decorate([ + observable + ], Picker.prototype, "showNoOptions", void 0); + __decorate([ + observable + ], Picker.prototype, "menuConfig", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js + var init_picker_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js + var init_picker_menu_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js + var init_picker_list_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js + var init_picker_list_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js + var init_picker2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js"() { + init_picker_template(); + init_picker(); + init_picker_menu_template(); + init_picker_menu(); + init_picker_menu_option_template(); + init_picker_menu_option(); + init_picker_list_template(); + init_picker_list(); + init_picker_list_item_template(); + init_picker_list_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js + var MenuItemRole, roleForMenuItem; + var init_menu_item_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js"() { + MenuItemRole = { + /** + * The menu item has a "menuitem" role + */ + menuitem: "menuitem", + /** + * The menu item has a "menuitemcheckbox" role + */ + menuitemcheckbox: "menuitemcheckbox", + /** + * The menu item has a "menuitemradio" role + */ + menuitemradio: "menuitemradio" + }; + roleForMenuItem = { + [MenuItemRole.menuitem]: "menuitem", + [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox", + [MenuItemRole.menuitemradio]: "menuitemradio" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js + var MenuItem; + var init_menu_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_start_end(); + init_direction(); + init_apply_mixins(); + init_menu_item_options(); + MenuItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = MenuItemRole.menuitem; + this.hasSubmenu = false; + this.currentDirection = Direction.ltr; + this.focusSubmenuOnLoad = false; + this.handleMenuItemKeyDown = (e) => { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.invoke(); + return false; + case keyArrowRight: + this.expandAndFocus(); + return false; + case keyArrowLeft: + if (this.expanded) { + this.expanded = false; + this.focus(); + return false; + } + } + return true; + }; + this.handleMenuItemClick = (e) => { + if (e.defaultPrevented || this.disabled) { + return false; + } + this.invoke(); + return false; + }; + this.submenuLoaded = () => { + if (!this.focusSubmenuOnLoad) { + return; + } + this.focusSubmenuOnLoad = false; + if (this.hasSubmenu) { + this.submenu.focus(); + this.setAttribute("tabindex", "-1"); + } + }; + this.handleMouseOver = (e) => { + if (this.disabled || !this.hasSubmenu || this.expanded) { + return false; + } + this.expanded = true; + return false; + }; + this.handleMouseOut = (e) => { + if (!this.expanded || this.contains(document.activeElement)) { + return false; + } + this.expanded = false; + return false; + }; + this.expandAndFocus = () => { + if (!this.hasSubmenu) { + return; + } + this.focusSubmenuOnLoad = true; + this.expanded = true; + }; + this.invoke = () => { + if (this.disabled) { + return; + } + switch (this.role) { + case MenuItemRole.menuitemcheckbox: + this.checked = !this.checked; + break; + case MenuItemRole.menuitem: + this.updateSubmenu(); + if (this.hasSubmenu) { + this.expandAndFocus(); + } else { + this.$emit("change"); + } + break; + case MenuItemRole.menuitemradio: + if (!this.checked) { + this.checked = true; + } + break; + } + }; + this.updateSubmenu = () => { + this.submenu = this.domChildren().find((element) => { + return element.getAttribute("role") === "menu"; + }); + this.hasSubmenu = this.submenu === void 0 ? false : true; + }; + } + expandedChanged(oldValue) { + if (this.$fastController.isConnected) { + if (this.submenu === void 0) { + return; + } + if (this.expanded === false) { + this.submenu.collapseExpandedItem(); + } else { + this.currentDirection = getDirection(this); + } + this.$emit("expanded-change", this, { bubbles: false }); + } + } + checkedChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.$emit("change"); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.updateSubmenu(); + }); + if (!this.startColumnCount) { + this.startColumnCount = 1; + } + this.observer = new MutationObserver(this.updateSubmenu); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.submenu = void 0; + if (this.observer !== void 0) { + this.observer.disconnect(); + this.observer = void 0; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "disabled", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "expanded", void 0); + __decorate([ + observable + ], MenuItem.prototype, "startColumnCount", void 0); + __decorate([ + attr + ], MenuItem.prototype, "role", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "checked", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenuRegion", void 0); + __decorate([ + observable + ], MenuItem.prototype, "hasSubmenu", void 0); + __decorate([ + observable + ], MenuItem.prototype, "currentDirection", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenu", void 0); + applyMixins(MenuItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js + var init_menu_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js + var init_menu_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js"() { + init_menu_item_template(); + init_menu_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js + var init_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js + var Menu; + var init_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_menu_item2(); + init_foundation_element(); + Menu = class _Menu extends FoundationElement { + constructor() { + super(...arguments); + this.expandedItem = null; + this.focusIndex = -1; + this.isNestedMenu = () => { + return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem"; + }; + this.handleFocusOut = (e) => { + if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) { + this.collapseExpandedItem(); + const focusIndex = this.menuItems.findIndex(this.isFocusableElement); + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.menuItems[focusIndex].setAttribute("tabindex", "0"); + this.focusIndex = focusIndex; + } + }; + this.handleItemFocus = (e) => { + const targetItem = e.target; + if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.focusIndex = this.menuItems.indexOf(targetItem); + targetItem.setAttribute("tabindex", "0"); + } + }; + this.handleExpandedChanged = (e) => { + if (e.defaultPrevented || e.target === null || this.menuItems === void 0 || this.menuItems.indexOf(e.target) < 0) { + return; + } + e.preventDefault(); + const changedItem = e.target; + if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) { + this.expandedItem = null; + return; + } + if (changedItem.expanded) { + if (this.expandedItem !== null && this.expandedItem !== changedItem) { + this.expandedItem.expanded = false; + } + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.expandedItem = changedItem; + this.focusIndex = this.menuItems.indexOf(changedItem); + changedItem.setAttribute("tabindex", "0"); + } + }; + this.removeItemListeners = () => { + if (this.menuItems !== void 0) { + this.menuItems.forEach((item) => { + item.removeEventListener("expanded-change", this.handleExpandedChanged); + item.removeEventListener("focus", this.handleItemFocus); + }); + } + }; + this.setItems = () => { + const newItems = this.domChildren(); + this.removeItemListeners(); + this.menuItems = newItems; + const menuItems = this.menuItems.filter(this.isMenuItemElement); + if (menuItems.length) { + this.focusIndex = 0; + } + function elementIndent(el) { + const role = el.getAttribute("role"); + const startSlot = el.querySelector("[slot=start]"); + if (role !== MenuItemRole.menuitem && startSlot === null) { + return 1; + } else if (role === MenuItemRole.menuitem && startSlot !== null) { + return 1; + } else if (role !== MenuItemRole.menuitem && startSlot !== null) { + return 2; + } else { + return 0; + } + } + const indent = menuItems.reduce((accum, current) => { + const elementValue = elementIndent(current); + return accum > elementValue ? accum : elementValue; + }, 0); + menuItems.forEach((item, index) => { + item.setAttribute("tabindex", index === 0 ? "0" : "-1"); + item.addEventListener("expanded-change", this.handleExpandedChanged); + item.addEventListener("focus", this.handleItemFocus); + if (item instanceof MenuItem || "startColumnCount" in item) { + item.startColumnCount = indent; + } + }); + }; + this.changeHandler = (e) => { + if (this.menuItems === void 0) { + return; + } + const changedMenuItem = e.target; + const changeItemIndex = this.menuItems.indexOf(changedMenuItem); + if (changeItemIndex === -1) { + return; + } + if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) { + for (let i = changeItemIndex - 1; i >= 0; --i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + const maxIndex = this.menuItems.length - 1; + for (let i = changeItemIndex + 1; i <= maxIndex; ++i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + } + }; + this.isMenuItemElement = (el) => { + return isHTMLElement(el) && _Menu.focusableElementRoles.hasOwnProperty(el.getAttribute("role")); + }; + this.isFocusableElement = (el) => { + return this.isMenuItemElement(el); + }; + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.menuItems !== void 0) { + this.setItems(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.setItems(); + }); + this.addEventListener("change", this.changeHandler); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeItemListeners(); + this.menuItems = void 0; + this.removeEventListener("change", this.changeHandler); + } + /** + * Focuses the first item in the menu. + * + * @public + */ + focus() { + this.setFocus(0, 1); + } + /** + * Collapses any expanded menu items. + * + * @public + */ + collapseExpandedItem() { + if (this.expandedItem !== null) { + this.expandedItem.expanded = false; + this.expandedItem = null; + } + } + /** + * @internal + */ + handleMenuKeyDown(e) { + if (e.defaultPrevented || this.menuItems === void 0) { + return; + } + switch (e.key) { + case keyArrowDown: + this.setFocus(this.focusIndex + 1, 1); + return; + case keyArrowUp: + this.setFocus(this.focusIndex - 1, -1); + return; + case keyEnd: + this.setFocus(this.menuItems.length - 1, -1); + return; + case keyHome: + this.setFocus(0, 1); + return; + default: + return true; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + setFocus(focusIndex, adjustment) { + if (this.menuItems === void 0) { + return; + } + while (focusIndex >= 0 && focusIndex < this.menuItems.length) { + const child = this.menuItems[focusIndex]; + if (this.isFocusableElement(child)) { + if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + } + this.focusIndex = focusIndex; + child.setAttribute("tabindex", "0"); + child.focus(); + break; + } + focusIndex += adjustment; + } + } + }; + Menu.focusableElementRoles = roleForMenuItem; + __decorate([ + observable + ], Menu.prototype, "items", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js + var init_menu2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js"() { + init_menu_template(); + init_menu(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js + var init_number_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js + var _TextField, FormAssociatedTextField; + var init_text_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextField = class extends FoundationElement { + }; + FormAssociatedTextField = class extends FormAssociated(_TextField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js + var TextFieldType; + var init_text_field_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js"() { + TextFieldType = { + /** + * An email TextField + */ + email: "email", + /** + * A password TextField + */ + password: "password", + /** + * A telephone TextField + */ + tel: "tel", + /** + * A text TextField + */ + text: "text", + /** + * A URL TextField + */ + url: "url" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js + var TextField, DelegatesARIATextbox; + var init_text_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_text_field_form_associated(); + init_text_field_options(); + TextField = class extends FormAssociatedTextField { + constructor() { + super(...arguments); + this.type = TextFieldType.text; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + typeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + this.validate(); + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the text field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], TextField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "autofocus", void 0); + __decorate([ + attr + ], TextField.prototype, "placeholder", void 0); + __decorate([ + attr + ], TextField.prototype, "type", void 0); + __decorate([ + attr + ], TextField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "minlength", void 0); + __decorate([ + attr + ], TextField.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextField.prototype, "defaultSlottedNodes", void 0); + DelegatesARIATextbox = class { + }; + applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties); + applyMixins(TextField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js + var _NumberField, FormAssociatedNumberField; + var init_number_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _NumberField = class extends FoundationElement { + }; + FormAssociatedNumberField = class extends FormAssociated(_NumberField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js + var NumberField; + var init_number_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_text_field(); + init_number_field_form_associated(); + NumberField = class extends FormAssociatedNumberField { + constructor() { + super(...arguments); + this.hideStep = false; + this.step = 1; + this.isUserInput = false; + } + /** + * Ensures that the max is greater than the min and that the value + * is less than the max + * @param previous - the previous max value + * @param next - updated max value + * + * @internal + */ + maxChanged(previous, next) { + var _a; + this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next); + const min = Math.min(this.min, this.max); + if (this.min !== void 0 && this.min !== min) { + this.min = min; + } + this.value = this.getValidValue(this.value); + } + /** + * Ensures that the min is less than the max and that the value + * is greater than the min + * @param previous - previous min value + * @param next - updated min value + * + * @internal + */ + minChanged(previous, next) { + var _a; + this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next); + const max = Math.max(this.min, this.max); + if (this.max !== void 0 && this.max !== max) { + this.max = max; + } + this.value = this.getValidValue(this.value); + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * Validates that the value is a number between the min and max + * @param previous - previous stored value + * @param next - value being updated + * @param updateControl - should the text field be updated with value, defaults to true + * @internal + */ + valueChanged(previous, next) { + this.value = this.getValidValue(next); + if (next !== this.value) { + return; + } + if (this.control && !this.isUserInput) { + this.control.value = this.value; + } + super.valueChanged(previous, this.value); + if (previous !== void 0 && !this.isUserInput) { + this.$emit("input"); + this.$emit("change"); + } + this.isUserInput = false; + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Sets the internal value to a valid number between the min and max properties + * @param value - user input + * + * @internal + */ + getValidValue(value) { + var _a, _b; + let validValue = parseFloat(parseFloat(value).toPrecision(12)); + if (isNaN(validValue)) { + validValue = ""; + } else { + validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue); + validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString(); + } + return validValue; + } + /** + * Increments the value using the step value + * + * @public + */ + stepUp() { + const value = parseFloat(this.value); + const stepUpValue = !isNaN(value) ? value + this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? this.step : 0; + this.value = stepUpValue.toString(); + } + /** + * Decrements the value using the step value + * + * @public + */ + stepDown() { + const value = parseFloat(this.value); + const stepDownValue = !isNaN(value) ? value - this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? 0 - this.step : 0; + this.value = stepDownValue.toString(); + } + /** + * Sets up the initial state of the number field + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "number"); + this.validate(); + this.control.value = this.value; + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the number field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, ""); + this.isUserInput = true; + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** + * Handles the internal control's `keydown` event + * @internal + */ + handleKeyDown(e) { + const key = e.key; + switch (key) { + case keyArrowUp: + this.stepUp(); + return false; + case keyArrowDown: + this.stepDown(); + return false; + } + return true; + } + /** + * Handles populating the input field with a validated value when + * leaving the input field. + * @internal + */ + handleBlur() { + this.control.value = this.value; + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], NumberField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], NumberField.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "hide-step", mode: "boolean" }) + ], NumberField.prototype, "hideStep", void 0); + __decorate([ + attr + ], NumberField.prototype, "placeholder", void 0); + __decorate([ + attr + ], NumberField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "minlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "size", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "step", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "min", void 0); + __decorate([ + observable + ], NumberField.prototype, "defaultSlottedNodes", void 0); + applyMixins(NumberField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js + var init_number_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js"() { + init_number_field_template(); + init_number_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js + var progressSegments, progressRingTemplate; + var init_progress_ring_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js"() { + init_esm(); + progressSegments = 44; + progressRingTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js + var init_progress_ring = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js"() { + init_progress_ring_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js + var BaseProgress; + var init_base_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + BaseProgress = class extends FoundationElement { + constructor() { + super(...arguments); + this.percentComplete = 0; + } + valueChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + minChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + maxChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updatePercentComplete(); + } + updatePercentComplete() { + const min = typeof this.min === "number" ? this.min : 0; + const max = typeof this.max === "number" ? this.max : 100; + const value = typeof this.value === "number" ? this.value : 0; + const range2 = max - min; + this.percentComplete = range2 === 0 ? 0 : Math.fround((value - min) / range2 * 100); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "value", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "max", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], BaseProgress.prototype, "paused", void 0); + __decorate([ + observable + ], BaseProgress.prototype, "percentComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js + var init_progress_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js + var init_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js"() { + init_base_progress(); + init_progress_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js + var radioGroupTemplate; + var init_radio_group_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js"() { + init_esm(); + init_dist2(); + radioGroupTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js + var RadioGroup; + var init_radio_group = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + RadioGroup = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = Orientation.horizontal; + this.radioChangeHandler = (e) => { + const changedRadio = e.target; + if (changedRadio.checked) { + this.slottedRadioButtons.forEach((radio) => { + if (radio !== changedRadio) { + radio.checked = false; + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + } + }); + this.selectedRadio = changedRadio; + this.value = changedRadio.value; + changedRadio.setAttribute("tabindex", "0"); + this.focusedRadio = changedRadio; + } + e.stopPropagation(); + }; + this.moveToRadioByIndex = (group, index) => { + const radio = group[index]; + if (!this.isInsideToolbar) { + radio.setAttribute("tabindex", "0"); + if (radio.readOnly) { + this.slottedRadioButtons.forEach((nextRadio) => { + if (nextRadio !== radio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + radio.checked = true; + this.selectedRadio = radio; + } + } + this.focusedRadio = radio; + radio.focus(); + }; + this.moveRightOffGroup = () => { + var _a; + (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.moveLeftOffGroup = () => { + var _a; + (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.focusOutHandler = (e) => { + const group = this.slottedRadioButtons; + const radio = e.target; + const index = radio !== null ? group.indexOf(radio) : 0; + const focusedIndex = this.focusedRadio ? group.indexOf(this.focusedRadio) : -1; + if (focusedIndex === 0 && index === focusedIndex || focusedIndex === group.length - 1 && focusedIndex === index) { + if (!this.selectedRadio) { + this.focusedRadio = group[0]; + this.focusedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.focusedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + this.focusedRadio = this.selectedRadio; + if (!this.isInsideFoundationToolbar) { + this.selectedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.selectedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } + } + } + return true; + }; + this.clickHandler = (e) => { + const radio = e.target; + if (radio) { + const group = this.slottedRadioButtons; + if (radio.checked || group.indexOf(radio) === 0) { + radio.setAttribute("tabindex", "0"); + this.selectedRadio = radio; + } else { + radio.setAttribute("tabindex", "-1"); + this.selectedRadio = null; + } + this.focusedRadio = radio; + } + e.preventDefault(); + }; + this.shouldMoveOffGroupToTheRight = (index, group, key) => { + return index === group.length && this.isInsideToolbar && key === keyArrowRight; + }; + this.shouldMoveOffGroupToTheLeft = (group, key) => { + const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + return index < 0 && this.isInsideToolbar && key === keyArrowLeft; + }; + this.checkFocusedRadio = () => { + if (this.focusedRadio !== null && !this.focusedRadio.readOnly && !this.focusedRadio.checked) { + this.focusedRadio.checked = true; + this.focusedRadio.setAttribute("tabindex", "0"); + this.focusedRadio.focus(); + this.selectedRadio = this.focusedRadio; + } + }; + this.moveRight = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1; + if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) { + this.moveRightOffGroup(); + return; + } else if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index + 1 >= group.length) { + if (this.isInsideToolbar) { + break; + } else { + index = 0; + } + } else { + index += 1; + } + } + }; + this.moveLeft = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + if (this.shouldMoveOffGroupToTheLeft(group, e.key)) { + this.moveLeftOffGroup(); + return; + } + while (index >= 0 && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.keydownHandler = (e) => { + const key = e.key; + if (key in ArrowKeys && this.isInsideFoundationToolbar) { + return true; + } + switch (key) { + case keyEnter: { + this.checkFocusedRadio(); + break; + } + case keyArrowRight: + case keyArrowDown: { + if (this.direction === Direction.ltr) { + this.moveRight(e); + } else { + this.moveLeft(e); + } + break; + } + case keyArrowLeft: + case keyArrowUp: { + if (this.direction === Direction.ltr) { + this.moveLeft(e); + } else { + this.moveRight(e); + } + break; + } + default: { + return true; + } + } + }; + } + readOnlyChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.readOnly) { + radio.readOnly = true; + } else { + radio.readOnly = false; + } + }); + } + } + disabledChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.disabled) { + radio.disabled = true; + } else { + radio.disabled = false; + } + }); + } + } + nameChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + radio.setAttribute("name", this.name); + }); + } + } + valueChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + if (radio.value === this.value) { + radio.checked = true; + this.selectedRadio = radio; + } + }); + } + this.$emit("change"); + } + slottedRadioButtonsChanged(oldValue, newValue) { + if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) { + this.setupRadioButtons(); + } + } + get parentToolbar() { + return this.closest('[role="toolbar"]'); + } + get isInsideToolbar() { + var _a; + return (_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false; + } + get isInsideFoundationToolbar() { + var _a; + return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + this.setupRadioButtons(); + } + disconnectedCallback() { + this.slottedRadioButtons.forEach((radio) => { + radio.removeEventListener("change", this.radioChangeHandler); + }); + } + setupRadioButtons() { + const checkedRadios = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0; + if (numberOfCheckedRadios > 1) { + const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1]; + lastCheckedRadio.checked = true; + } + let foundMatchingVal = false; + this.slottedRadioButtons.forEach((radio) => { + if (this.name !== void 0) { + radio.setAttribute("name", this.name); + } + if (this.disabled) { + radio.disabled = true; + } + if (this.readOnly) { + radio.readOnly = true; + } + if (this.value && this.value === radio.value) { + this.selectedRadio = radio; + this.focusedRadio = radio; + radio.checked = true; + radio.setAttribute("tabindex", "0"); + foundMatchingVal = true; + } else { + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + radio.checked = false; + } + radio.addEventListener("change", this.radioChangeHandler); + }); + if (this.value === void 0 && this.slottedRadioButtons.length > 0) { + const checkedRadios2 = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios2 = checkedRadios2 !== null ? checkedRadios2.length : 0; + if (numberOfCheckedRadios2 > 0 && !foundMatchingVal) { + const lastCheckedRadio = checkedRadios2[numberOfCheckedRadios2 - 1]; + lastCheckedRadio.checked = true; + this.focusedRadio = lastCheckedRadio; + lastCheckedRadio.setAttribute("tabindex", "0"); + } else { + this.slottedRadioButtons[0].setAttribute("tabindex", "0"); + this.focusedRadio = this.slottedRadioButtons[0]; + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], RadioGroup.prototype, "readOnly", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], RadioGroup.prototype, "disabled", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "name", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "value", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "orientation", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "childItems", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "slottedRadioButtons", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js + var init_radio_group2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js"() { + init_radio_group_template(); + init_radio_group(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js + var radioTemplate; + var init_radio_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js"() { + init_esm(); + radioTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js + var _Radio, FormAssociatedRadio; + var init_radio_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Radio = class extends FoundationElement { + }; + FormAssociatedRadio = class extends CheckableFormAssociated(_Radio) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js + var Radio; + var init_radio = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_radio_form_associated(); + Radio = class extends FormAssociatedRadio { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + switch (e.key) { + case keySpace: + if (!this.checked && !this.readOnly) { + this.checked = true; + } + return; + } + return true; + }; + this.proxy.setAttribute("type", "radio"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * @internal + */ + defaultCheckedChanged() { + var _a; + if (this.$fastController.isConnected && !this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false; + this.dirtyChecked = false; + } + } + } + /** + * @internal + */ + connectedCallback() { + var _a, _b; + super.connectedCallback(); + this.validate(); + if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" && this.getAttribute("tabindex") === null) { + if (!this.disabled) { + this.setAttribute("tabindex", "0"); + } + } + if (this.checkedAttribute) { + if (!this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false; + this.dirtyChecked = false; + } + } + } + } + isInsideRadioGroup() { + const parent = this.closest("[role=radiogroup]"); + return parent !== null; + } + /** + * @internal + */ + clickHandler(e) { + if (!this.disabled && !this.readOnly && !this.checked) { + this.checked = true; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Radio.prototype, "readOnly", void 0); + __decorate([ + observable + ], Radio.prototype, "name", void 0); + __decorate([ + observable + ], Radio.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js + var init_radio2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js"() { + init_radio_template(); + init_radio(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js + var HorizontalScroll; + var init_horizontal_scroll = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + HorizontalScroll = class extends FoundationElement { + constructor() { + super(...arguments); + this.framesPerSecond = 60; + this.updatingItems = false; + this.speed = 600; + this.easing = "ease-in-out"; + this.flippersHiddenFromAT = false; + this.scrolling = false; + this.resizeDetector = null; + } + /** + * The calculated duration for a frame. + * + * @internal + */ + get frameTime() { + return 1e3 / this.framesPerSecond; + } + /** + * Firing scrollstart and scrollend events + * @internal + */ + scrollingChanged(prev, next) { + if (this.scrollContainer) { + const event = this.scrolling == true ? "scrollstart" : "scrollend"; + this.$emit(event, this.scrollContainer.scrollLeft); + } + } + /** + * In RTL mode + * @internal + */ + get isRtl() { + return this.scrollItems.length > 1 && this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft; + } + connectedCallback() { + super.connectedCallback(); + this.initializeResizeDetector(); + } + disconnectedCallback() { + this.disconnectResizeDetector(); + super.disconnectedCallback(); + } + /** + * Updates scroll stops and flippers when scroll items change + * @param previous - current scroll items + * @param next - new updated scroll items + * @public + */ + scrollItemsChanged(previous, next) { + if (next && !this.updatingItems) { + DOM.queueUpdate(() => this.setStops()); + } + } + /** + * destroys the instance's resize observer + * @internal + */ + disconnectResizeDetector() { + if (this.resizeDetector) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + * @internal + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.resized.bind(this)); + this.resizeDetector.observe(this); + } + /** + * Looks for slots and uses child nodes instead + * @internal + */ + updateScrollStops() { + this.updatingItems = true; + const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => { + if (scrollItem instanceof HTMLSlotElement) { + return scrollItems.concat(scrollItem.assignedElements()); + } + scrollItems.push(scrollItem); + return scrollItems; + }, []); + this.scrollItems = updatedItems; + this.updatingItems = false; + } + /** + * Finds all of the scroll stops between elements + * @internal + */ + setStops() { + this.updateScrollStops(); + const { scrollContainer: container } = this; + const { scrollLeft } = container; + const { width: containerWidth, left: containerLeft } = container.getBoundingClientRect(); + this.width = containerWidth; + let lastStop = 0; + let stops = this.scrollItems.map((item, index) => { + const { left, width } = item.getBoundingClientRect(); + const leftPosition = Math.round(left + scrollLeft - containerLeft); + const right = Math.round(leftPosition + width); + if (this.isRtl) { + return -right; + } + lastStop = right; + return index === 0 ? 0 : leftPosition; + }).concat(lastStop); + stops = this.fixScrollMisalign(stops); + stops.sort((a, b) => Math.abs(a) - Math.abs(b)); + this.scrollStops = stops; + this.setFlippers(); + } + /** + * Checks to see if the stops are returning values + * otherwise it will try to reinitialize them + * + * @returns boolean indicating that current scrollStops are valid non-zero values + * @internal + */ + validateStops(reinit = true) { + const hasStops = () => !!this.scrollStops.find((stop) => stop > 0); + if (!hasStops() && reinit) { + this.setStops(); + } + return hasStops(); + } + /** + * + */ + fixScrollMisalign(stops) { + if (this.isRtl && stops.some((stop) => stop > 0)) { + stops.sort((a, b) => b - a); + const offset = stops[0]; + stops = stops.map((stop) => stop - offset); + } + return stops; + } + /** + * Sets the controls view if enabled + * @internal + */ + setFlippers() { + var _a, _b; + const position = this.scrollContainer.scrollLeft; + (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle("disabled", position === 0); + if (this.scrollStops) { + const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]); + (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", this.validateStops(false) && Math.abs(position) + this.width >= lastStop); + } + } + /** + * Function that can scroll an item into view. + * @param item - An item index, a scroll item or a child of one of the scroll items + * @param padding - Padding of the viewport where the active item shouldn't be + * @param rightPadding - Optional right padding. Uses the padding if not defined + * + * @public + */ + scrollInView(item, padding = 0, rightPadding) { + var _a; + if (typeof item !== "number" && item) { + item = this.scrollItems.findIndex((scrollItem) => scrollItem === item || scrollItem.contains(item)); + } + if (item !== void 0) { + rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding; + const { scrollContainer: container, scrollStops, scrollItems: items } = this; + const { scrollLeft } = this.scrollContainer; + const { width: containerWidth } = container.getBoundingClientRect(); + const itemStart = scrollStops[item]; + const { width } = items[item].getBoundingClientRect(); + const itemEnd = itemStart + width; + const isBefore = scrollLeft + padding > itemStart; + if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) { + const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b); + const scrollTo = (_a = stops.find((position) => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0; + this.scrollToPosition(scrollTo); + } + } + } + /** + * Lets the user arrow left and right through the horizontal scroll + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + this.scrollToPrevious(); + break; + case "ArrowRight": + this.scrollToNext(); + break; + } + } + /** + * Scrolls items to the left + * @public + */ + scrollToPrevious() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition && (this.isRtl || index === this.scrollStops.length - 1 || this.scrollStops[index + 1] > scrollPosition)); + const right = Math.abs(this.scrollStops[current + 1]); + let nextIndex = this.scrollStops.findIndex((stop) => Math.abs(stop) + this.width > right); + if (nextIndex >= current || nextIndex === -1) { + nextIndex = current > 0 ? current - 1 : 0; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Scrolls items to the right + * @public + */ + scrollToNext() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop) => Math.abs(stop) >= Math.abs(scrollPosition)); + const outOfView = this.scrollStops.findIndex((stop) => Math.abs(scrollPosition) + this.width <= Math.abs(stop)); + let nextIndex = current; + if (outOfView > current + 2) { + nextIndex = outOfView - 2; + } else if (current < this.scrollStops.length - 2) { + nextIndex = current + 1; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Handles scrolling with easing + * @param position - starting position + * @param newPosition - position to scroll to + * @public + */ + scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) { + var _a; + if (this.scrolling) { + return; + } + this.scrolling = true; + const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`; + this.content.style.setProperty("transition-duration", seconds); + const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue("transition-duration")); + const transitionendHandler = (e) => { + if (e && e.target !== e.currentTarget) { + return; + } + this.content.style.setProperty("transition-duration", "0s"); + this.content.style.removeProperty("transform"); + this.scrollContainer.style.setProperty("scroll-behavior", "auto"); + this.scrollContainer.scrollLeft = newPosition; + this.setFlippers(); + this.content.removeEventListener("transitionend", transitionendHandler); + this.scrolling = false; + }; + if (computedDuration === 0) { + transitionendHandler(); + return; + } + this.content.addEventListener("transitionend", transitionendHandler); + const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth; + let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue); + if (this.isRtl) { + transitionStop = this.scrollContainer.scrollLeft + Math.min(Math.abs(newPosition), maxScrollValue); + } + this.content.style.setProperty("transition-property", "transform"); + this.content.style.setProperty("transition-timing-function", this.easing); + this.content.style.setProperty("transform", `translateX(${transitionStop}px)`); + } + /** + * Monitors resize event on the horizontal-scroll element + * @public + */ + resized() { + if (this.resizeTimeout) { + this.resizeTimeout = clearTimeout(this.resizeTimeout); + } + this.resizeTimeout = setTimeout(() => { + this.width = this.scrollContainer.offsetWidth; + this.setFlippers(); + }, this.frameTime); + } + /** + * Monitors scrolled event on the content container + * @public + */ + scrolled() { + if (this.scrollTimeout) { + this.scrollTimeout = clearTimeout(this.scrollTimeout); + } + this.scrollTimeout = setTimeout(() => { + this.setFlippers(); + }, this.frameTime); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], HorizontalScroll.prototype, "speed", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "duration", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "easing", void 0); + __decorate([ + attr({ attribute: "flippers-hidden-from-at", converter: booleanConverter }) + ], HorizontalScroll.prototype, "flippersHiddenFromAT", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrolling", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrollItems", void 0); + __decorate([ + attr({ attribute: "view" }) + ], HorizontalScroll.prototype, "view", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js + var init_horizontal_scroll_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js + var init_horizontal_scroll2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js"() { + init_horizontal_scroll(); + init_horizontal_scroll_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js + function whitespaceFilter(value, index, array) { + return value.nodeType !== Node.TEXT_NODE ? true : typeof value.nodeValue === "string" && !!value.nodeValue.trim().length; + } + var init_whitespace_filter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js + var init_search_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js + var _Search, FormAssociatedSearch; + var init_search_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Search = class extends FoundationElement { + }; + FormAssociatedSearch = class extends FormAssociated(_Search) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.js + var Search, DelegatesARIASearch; + var init_search = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_search_form_associated(); + Search = class extends FormAssociatedSearch { + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Handles the control's clear value event + * @public + */ + handleClearInput() { + this.value = ""; + this.control.focus(); + this.handleChange(); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Search.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "autofocus", void 0); + __decorate([ + attr + ], Search.prototype, "placeholder", void 0); + __decorate([ + attr + ], Search.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "minlength", void 0); + __decorate([ + attr + ], Search.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "spellcheck", void 0); + __decorate([ + observable + ], Search.prototype, "defaultSlottedNodes", void 0); + DelegatesARIASearch = class { + }; + applyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties); + applyMixins(Search, StartEnd, DelegatesARIASearch); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/index.js + var init_search2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/index.js"() { + init_search_template(); + init_search(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js + var _Select, FormAssociatedSelect; + var init_select_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js"() { + init_listbox_element(); + init_form_associated(); + _Select = class extends ListboxElement { + }; + FormAssociatedSelect = class extends FormAssociated(_Select) { + constructor() { + super(...arguments); + this.proxy = document.createElement("select"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.js + var Select, DelegatesARIASelect; + var init_select = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_apply_mixins(); + init_select_form_associated(); + init_select_options(); + Select = class extends FormAssociatedSelect { + constructor() { + super(...arguments); + this.open = false; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + } + /** + * Sets focus and synchronizes ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged(prev, next) { + if (!this.collapsible) { + return; + } + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + this.indexWhenOpened = this.selectedIndex; + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The component is collapsible when in single-selection mode with no size attribute. + * + * @internal + */ + get collapsible() { + return !(this.multiple || typeof this.size === "number"); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c, _d, _e, _f, _g; + const prev = `${this._value}`; + if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) { + const selectedIndex = this._options.findIndex((el) => el.value === next); + const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; + const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null; + if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) { + next = ""; + this.selectedIndex = selectedIndex; + } + next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + this.updateDisplayValue(); + } + } + /** + * Sets the value and display value to match the first selected option. + * + * @param shouldEmit - if true, the input and change events will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a, _b; + if (this.$fastController.isConnected) { + this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; + } + if (shouldEmit) { + this.$emit("input"); + this.$emit("change", this, { + bubbles: true, + composed: void 0 + }); + } + } + /** + * Updates the proxy value when the selected index changes. + * + * @param prev - the previous selected index + * @param next - the next selected index + * + * @internal + */ + selectedIndexChanged(prev, next) { + super.selectedIndexChanged(prev, next); + this.updateValue(); + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * The value displayed on the button. + * + * @public + */ + get displayValue() { + var _a, _b; + Observable.track(this, "displayValue"); + return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ""; + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + this.setProxyOptions(); + super.setDefaultSelectedOption(); + if (this.selectedIndex === -1) { + this.selectedIndex = 0; + } + } + /** + * Handle opening and closing the listbox when the select is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + if (this.disabled) { + return; + } + if (this.open) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && captured.disabled) { + return; + } + } + super.clickHandler(e); + this.open = this.collapsible && !this.open; + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + return true; + } + /** + * Handles focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + var _a; + super.focusoutHandler(e); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) { + this.open = false; + if (this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + } + } + /** + * Updates the value when an option's value changes. + * + * @param source - the source object + * @param propertyName - the property to evaluate + * + * @internal + * @override + */ + handleChange(source, propertyName) { + super.handleChange(source, propertyName); + if (propertyName === "value") { + this.updateValue(); + } + } + /** + * Synchronize the form-associated proxy and updates the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "value"); + }); + super.slottedOptionsChanged(prev, next); + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.subscribe(this, "value"); + }); + this.setProxyOptions(); + this.updateValue(); + } + /** + * Prevents focus when size is set and a scrollbar is clicked. + * + * @param e - the mouse event object + * + * @override + * @internal + */ + mousedownHandler(e) { + var _a; + if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) { + return super.mousedownHandler(e); + } + return this.collapsible; + } + /** + * Sets the multiple property on the proxy element. + * + * @param prev - the previous multiple value + * @param next - the current multiple value + */ + multipleChanged(prev, next) { + super.multipleChanged(prev, next); + if (this.proxy) { + this.proxy.multiple = next; + } + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @override + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + super.selectedOptionsChanged(prev, next); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => { + var _a2; + const proxyOption = (_a2 = this.proxy) === null || _a2 === void 0 ? void 0 : _a2.options.item(i); + if (proxyOption) { + proxyOption.selected = o.selected; + } + }); + } + /** + * Sets the selected index to match the first option with the selected attribute, or + * the first selectable option. + * + * @override + * @internal + */ + setDefaultSelectedOption() { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter); + const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex((el) => el.hasAttribute("selected") || el.selected || el.value === this.value); + if (selectedIndex !== -1) { + this.selectedIndex = selectedIndex; + return; + } + this.selectedIndex = 0; + } + /** + * Resets and fills the proxy to match the component's options. + * + * @internal + */ + setProxyOptions() { + if (this.proxy instanceof HTMLSelectElement && this.options) { + this.proxy.options.length = 0; + this.options.forEach((option) => { + const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null); + if (proxyOption) { + this.proxy.options.add(proxyOption); + } + }); + } + } + /** + * Handle keyboard interaction for the select. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + super.keydownHandler(e); + const key = e.key || e.key.charCodeAt(0); + switch (key) { + case keySpace: { + e.preventDefault(); + if (this.collapsible && this.typeAheadExpired) { + this.open = !this.open; + } + break; + } + case keyHome: + case keyEnd: { + e.preventDefault(); + break; + } + case keyEnter: { + e.preventDefault(); + this.open = !this.open; + break; + } + case keyEscape: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + break; + } + case keyTab: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + return true; + } + } + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + this.indexWhenOpened = this.selectedIndex; + } + return !(key === keyArrowDown || key === keyArrowUp); + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + this.addEventListener("contentchange", this.updateDisplayValue); + } + disconnectedCallback() { + this.removeEventListener("contentchange", this.updateDisplayValue); + super.disconnectedCallback(); + } + /** + * Updates the proxy's size property when the size attribute changes. + * + * @param prev - the previous size + * @param next - the current size + * + * @override + * @internal + */ + sizeChanged(prev, next) { + super.sizeChanged(prev, next); + if (this.proxy) { + this.proxy.size = next; + } + } + /** + * + * @internal + */ + updateDisplayValue() { + if (this.collapsible) { + Observable.notify(this, "displayValue"); + } + } + }; + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Select.prototype, "open", void 0); + __decorate([ + volatile + ], Select.prototype, "collapsible", null); + __decorate([ + observable + ], Select.prototype, "control", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Select.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Select.prototype, "position", void 0); + __decorate([ + observable + ], Select.prototype, "maxHeight", void 0); + DelegatesARIASelect = class { + }; + __decorate([ + observable + ], DelegatesARIASelect.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIASelect, DelegatesARIAListbox); + applyMixins(Select, StartEnd, DelegatesARIASelect); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js + var selectTemplate; + var init_select_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js"() { + init_esm(); + init_listbox(); + init_start_end(); + selectTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/index.js + var init_select2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/index.js"() { + init_select(); + init_select_options(); + init_select_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js + var init_skeleton_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js + var Skeleton; + var init_skeleton = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Skeleton = class extends FoundationElement { + constructor() { + super(...arguments); + this.shape = "rect"; + } + }; + __decorate([ + attr + ], Skeleton.prototype, "fill", void 0); + __decorate([ + attr + ], Skeleton.prototype, "shape", void 0); + __decorate([ + attr + ], Skeleton.prototype, "pattern", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Skeleton.prototype, "shimmer", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js + var init_skeleton2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js"() { + init_skeleton_template(); + init_skeleton(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js + var init_slider_label_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js + function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) { + let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition)); + if (direction === Direction.rtl) { + pct = 1 - pct; + } + return pct; + } + var init_slider_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js"() { + init_dist2(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js + var defaultConfig, SliderLabel; + var init_slider_label = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_slider_utilities(); + init_foundation_element(); + defaultConfig = { + min: 0, + max: 0, + direction: Direction.ltr, + orientation: Orientation.horizontal, + disabled: false + }; + SliderLabel = class extends FoundationElement { + constructor() { + super(...arguments); + this.hideMark = false; + this.sliderDirection = Direction.ltr; + this.getSliderConfiguration = () => { + if (!this.isSliderConfig(this.parentNode)) { + this.sliderDirection = defaultConfig.direction || Direction.ltr; + this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal; + this.sliderMaxPosition = defaultConfig.max; + this.sliderMinPosition = defaultConfig.min; + } else { + const parentSlider = this.parentNode; + const { min, max, direction, orientation, disabled } = parentSlider; + if (disabled !== void 0) { + this.disabled = disabled; + } + this.sliderDirection = direction || Direction.ltr; + this.sliderOrientation = orientation || Orientation.horizontal; + this.sliderMaxPosition = max; + this.sliderMinPosition = min; + } + }; + this.positionAsStyle = () => { + const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr; + const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition)); + let rightNum = Math.round((1 - pct) * 100); + let leftNum = Math.round(pct * 100); + if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) { + rightNum = 50; + leftNum = 50; + } + if (this.sliderOrientation === Orientation.horizontal) { + return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`; + } else { + return `top: ${leftNum}%; bottom: ${rightNum}%;`; + } + }; + } + positionChanged() { + this.positionStyle = this.positionAsStyle(); + } + /** + * @internal + */ + sliderOrientationChanged() { + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.getSliderConfiguration(); + this.positionStyle = this.positionAsStyle(); + this.notifier = Observable.getNotifier(this.parentNode); + this.notifier.subscribe(this, "orientation"); + this.notifier.subscribe(this, "direction"); + this.notifier.subscribe(this, "max"); + this.notifier.subscribe(this, "min"); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.notifier.unsubscribe(this, "orientation"); + this.notifier.unsubscribe(this, "direction"); + this.notifier.unsubscribe(this, "max"); + this.notifier.unsubscribe(this, "min"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "direction": + this.sliderDirection = source.direction; + break; + case "orientation": + this.sliderOrientation = source.orientation; + break; + case "max": + this.sliderMaxPosition = source.max; + break; + case "min": + this.sliderMinPosition = source.min; + break; + default: + break; + } + this.positionStyle = this.positionAsStyle(); + } + isSliderConfig(node) { + return node.max !== void 0 && node.min !== void 0; + } + }; + __decorate([ + observable + ], SliderLabel.prototype, "positionStyle", void 0); + __decorate([ + attr + ], SliderLabel.prototype, "position", void 0); + __decorate([ + attr({ attribute: "hide-mark", mode: "boolean" }) + ], SliderLabel.prototype, "hideMark", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], SliderLabel.prototype, "disabled", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderOrientation", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMinPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMaxPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js + var init_slider_label2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js"() { + init_slider_label_template(); + init_slider_label(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js + var init_slider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js + var _Slider, FormAssociatedSlider; + var init_slider_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Slider = class extends FoundationElement { + }; + FormAssociatedSlider = class extends FormAssociated(_Slider) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js + var SliderMode, Slider; + var init_slider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_slider_utilities(); + init_slider_form_associated(); + SliderMode = { + singleValue: "single-value" + }; + Slider = class extends FormAssociatedSlider { + constructor() { + super(...arguments); + this.direction = Direction.ltr; + this.isDragging = false; + this.trackWidth = 0; + this.trackMinWidth = 0; + this.trackHeight = 0; + this.trackLeft = 0; + this.trackMinHeight = 0; + this.valueTextFormatter = () => null; + this.min = 0; + this.max = 10; + this.step = 1; + this.orientation = Orientation.horizontal; + this.mode = SliderMode.singleValue; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + if (e.key === keyHome) { + e.preventDefault(); + this.value = `${this.min}`; + } else if (e.key === keyEnd) { + e.preventDefault(); + this.value = `${this.max}`; + } else if (!e.shiftKey) { + switch (e.key) { + case keyArrowRight: + case keyArrowUp: + e.preventDefault(); + this.increment(); + break; + case keyArrowLeft: + case keyArrowDown: + e.preventDefault(); + this.decrement(); + break; + } + } + }; + this.setupTrackConstraints = () => { + const clientRect = this.track.getBoundingClientRect(); + this.trackWidth = this.track.clientWidth; + this.trackMinWidth = this.track.clientLeft; + this.trackHeight = clientRect.bottom; + this.trackMinHeight = clientRect.top; + this.trackLeft = this.getBoundingClientRect().left; + if (this.trackWidth === 0) { + this.trackWidth = 1; + } + }; + this.setupListeners = (remove = false) => { + const eventAction = `${remove ? "remove" : "add"}EventListener`; + this[eventAction]("keydown", this.keypressHandler); + this[eventAction]("mousedown", this.handleMouseDown); + this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { + passive: true + }); + this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { + passive: true + }); + if (remove) { + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + } + }; + this.initialValue = ""; + this.handleThumbMouseDown = (event) => { + if (event) { + if (this.readOnly || this.disabled || event.defaultPrevented) { + return; + } + event.target.focus(); + } + const eventAction = `${event !== null ? "add" : "remove"}EventListener`; + window[eventAction]("mouseup", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchmove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchend", this.handleWindowMouseUp); + this.isDragging = event !== null; + }; + this.handleMouseMove = (e) => { + if (this.readOnly || this.disabled || e.defaultPrevented) { + return; + } + const sourceEvent = window.TouchEvent && e instanceof TouchEvent ? e.touches[0] : e; + const eventValue = this.orientation === Orientation.horizontal ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft : sourceEvent.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(eventValue)}`; + }; + this.calculateNewValue = (rawValue) => { + const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal ? this.trackMinWidth : this.trackMinHeight, this.orientation === Orientation.horizontal ? this.trackWidth : this.trackHeight, this.direction); + const newValue = (this.max - this.min) * newPosition + this.min; + return this.convertToConstrainedValue(newValue); + }; + this.handleWindowMouseUp = (event) => { + this.stopDragging(); + }; + this.stopDragging = () => { + this.isDragging = false; + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + }; + this.handleMouseDown = (e) => { + const eventAction = `${e !== null ? "add" : "remove"}EventListener`; + if (e === null || !this.disabled && !this.readOnly) { + window[eventAction]("mouseup", this.handleWindowMouseUp); + window.document[eventAction]("mouseleave", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove); + if (e) { + e.preventDefault(); + this.setupTrackConstraints(); + e.target.focus(); + const controlValue = this.orientation === Orientation.horizontal ? e.pageX - document.documentElement.scrollLeft - this.trackLeft : e.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(controlValue)}`; + } + } + }; + this.convertToConstrainedValue = (value) => { + if (isNaN(value)) { + value = this.min; + } + let constrainedValue = value - this.min; + const roundedConstrainedValue = Math.round(constrainedValue / this.step); + const remainderValue = constrainedValue - roundedConstrainedValue * (this.stepMultiplier * this.step) / this.stepMultiplier; + constrainedValue = remainderValue >= Number(this.step) / 2 ? constrainedValue - remainderValue + Number(this.step) : constrainedValue - remainderValue; + return constrainedValue + this.min; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * @internal + */ + valueChanged(previous, next) { + super.valueChanged(previous, next); + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + this.$emit("change"); + } + minChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.min = `${this.min}`; + } + this.validate(); + } + maxChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.max = `${this.max}`; + } + this.validate(); + } + stepChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.step = `${this.step}`; + } + this.updateStepMultiplier(); + this.validate(); + } + orientationChanged() { + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "range"); + this.direction = getDirection(this); + this.updateStepMultiplier(); + this.setupTrackConstraints(); + this.setupListeners(); + this.setupDefaultValue(); + this.setThumbPositionForOrientation(this.direction); + } + /** + * @internal + */ + disconnectedCallback() { + this.setupListeners(true); + } + /** + * Increment the value by the step + * + * @public + */ + increment() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step); + const incrementedVal = this.convertToConstrainedValue(newVal); + const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`; + this.value = incrementedValString; + } + /** + * Decrement the value by the step + * + * @public + */ + decrement() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step); + const decrementedVal = this.convertToConstrainedValue(newVal); + const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`; + this.value = decrementedValString; + } + /** + * Places the thumb based on the current value + * + * @public + * @param direction - writing mode + */ + setThumbPositionForOrientation(direction) { + const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction); + const percentage = (1 - newPct) * 100; + if (this.orientation === Orientation.horizontal) { + this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`; + } else { + this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`; + } + } + /** + * Update the step multiplier used to ensure rounding errors from steps that + * are not whole numbers + */ + updateStepMultiplier() { + const stepString = this.step + ""; + const decimalPlacesOfStep = !!(this.step % 1) ? stepString.length - stepString.indexOf(".") - 1 : 0; + this.stepMultiplier = Math.pow(10, decimalPlacesOfStep); + } + get midpoint() { + return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`; + } + setupDefaultValue() { + if (typeof this.value === "string") { + if (this.value.length === 0) { + this.initialValue = this.midpoint; + } else { + const value = parseFloat(this.value); + if (!Number.isNaN(value) && (value < this.min || value > this.max)) { + this.value = this.midpoint; + } + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Slider.prototype, "readOnly", void 0); + __decorate([ + observable + ], Slider.prototype, "direction", void 0); + __decorate([ + observable + ], Slider.prototype, "isDragging", void 0); + __decorate([ + observable + ], Slider.prototype, "position", void 0); + __decorate([ + observable + ], Slider.prototype, "trackWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "trackLeft", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "valueTextFormatter", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "step", void 0); + __decorate([ + attr + ], Slider.prototype, "orientation", void 0); + __decorate([ + attr + ], Slider.prototype, "mode", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js + var init_slider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js"() { + init_slider_template(); + init_slider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js + var init_switch_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js + var _Switch, FormAssociatedSwitch; + var init_switch_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Switch = class extends FoundationElement { + }; + FormAssociatedSwitch = class extends CheckableFormAssociated(_Switch) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js + var Switch; + var init_switch = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_switch_form_associated(); + Switch = class extends FormAssociatedSwitch { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + this.readOnly ? this.classList.add("readonly") : this.classList.remove("readonly"); + } + /** + * @internal + */ + checkedChanged(prev, next) { + super.checkedChanged(prev, next); + this.checked ? this.classList.add("checked") : this.classList.remove("checked"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Switch.prototype, "readOnly", void 0); + __decorate([ + observable + ], Switch.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js + var init_switch2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js"() { + init_switch_template(); + init_switch(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js + var tabPanelTemplate; + var init_tab_panel_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js"() { + init_esm(); + tabPanelTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js + var TabPanel; + var init_tab_panel = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js"() { + init_foundation_element(); + TabPanel = class extends FoundationElement { + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js + var init_tab_panel2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js"() { + init_tab_panel_template(); + init_tab_panel(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js + var tabTemplate; + var init_tab_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js"() { + init_esm(); + tabTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js + var Tab; + var init_tab = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Tab = class extends FoundationElement { + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tab.prototype, "disabled", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js + var init_tab2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js"() { + init_tab_template(); + init_tab(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js + var tabsTemplate; + var init_tabs_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js"() { + init_esm(); + init_start_end(); + tabsTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js + var TabsOrientation, Tabs; + var init_tabs = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TabsOrientation = { + vertical: "vertical", + horizontal: "horizontal" + }; + Tabs = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = TabsOrientation.horizontal; + this.activeindicator = true; + this.showActiveIndicator = true; + this.prevActiveTabIndex = 0; + this.activeTabIndex = 0; + this.ticking = false; + this.change = () => { + this.$emit("change", this.activetab); + }; + this.isDisabledElement = (el) => { + return el.getAttribute("aria-disabled") === "true"; + }; + this.isHiddenElement = (el) => { + return el.hasAttribute("hidden"); + }; + this.isFocusableElement = (el) => { + return !this.isDisabledElement(el) && !this.isHiddenElement(el); + }; + this.setTabs = () => { + const gridHorizontalProperty = "gridColumn"; + const gridVerticalProperty = "gridRow"; + const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty; + this.activeTabIndex = this.getActiveIndex(); + this.showActiveIndicator = false; + this.tabs.forEach((tab, index) => { + if (tab.slot === "tab") { + const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab); + if (this.activeindicator && this.isFocusableElement(tab)) { + this.showActiveIndicator = true; + } + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tab.setAttribute("id", tabId); + tab.setAttribute("aria-selected", isActiveTab ? "true" : "false"); + tab.setAttribute("aria-controls", tabpanelId); + tab.addEventListener("click", this.handleTabClick); + tab.addEventListener("keydown", this.handleTabKeyDown); + tab.setAttribute("tabindex", isActiveTab ? "0" : "-1"); + if (isActiveTab) { + this.activetab = tab; + this.activeid = tabId; + } + } + tab.style[gridHorizontalProperty] = ""; + tab.style[gridVerticalProperty] = ""; + tab.style[gridProperty] = `${index + 1}`; + !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical"); + }); + }; + this.setTabPanels = () => { + this.tabpanels.forEach((tabpanel, index) => { + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tabpanel.setAttribute("id", tabpanelId); + tabpanel.setAttribute("aria-labelledby", tabId); + this.activeTabIndex !== index ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden"); + }); + }; + this.handleTabClick = (event) => { + const selectedTab = event.currentTarget; + if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) { + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = this.tabs.indexOf(selectedTab); + this.setComponent(); + } + }; + this.handleTabKeyDown = (event) => { + if (this.isHorizontal()) { + switch (event.key) { + case keyArrowLeft: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowRight: + event.preventDefault(); + this.adjustForward(event); + break; + } + } else { + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowDown: + event.preventDefault(); + this.adjustForward(event); + break; + } + } + switch (event.key) { + case keyHome: + event.preventDefault(); + this.adjust(-this.activeTabIndex); + break; + case keyEnd: + event.preventDefault(); + this.adjust(this.tabs.length - this.activeTabIndex - 1); + break; + } + }; + this.adjustForward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) + 1 : 1; + if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (this.activetab && index === group.indexOf(this.activetab)) { + break; + } else if (index + 1 >= group.length) { + index = 0; + } else { + index += 1; + } + } + }; + this.adjustBackward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + while (index >= 0 && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.moveToTabByIndex = (group, index) => { + const tab = group[index]; + this.activetab = tab; + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = index; + tab.focus(); + this.setComponent(); + }; + } + /** + * @internal + */ + orientationChanged() { + if (this.$fastController.isConnected) { + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + activeidChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabsChanged() { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabpanelsChanged() { + if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + getActiveIndex() { + const id = this.activeid; + if (id !== void 0) { + return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid); + } else { + return 0; + } + } + getTabIds() { + return this.tabs.map((tab) => { + var _a; + return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`; + }); + } + getTabPanelIds() { + return this.tabpanels.map((tabPanel) => { + var _a; + return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`; + }); + } + setComponent() { + if (this.activeTabIndex !== this.prevActiveTabIndex) { + this.activeid = this.tabIds[this.activeTabIndex]; + this.focusTab(); + this.change(); + } + } + isHorizontal() { + return this.orientation === TabsOrientation.horizontal; + } + handleActiveIndicatorPosition() { + if (this.showActiveIndicator && this.activeindicator && this.activeTabIndex !== this.prevActiveTabIndex) { + if (this.ticking) { + this.ticking = false; + } else { + this.ticking = true; + this.animateActiveIndicator(); + } + } + } + animateActiveIndicator() { + this.ticking = true; + const gridProperty = this.isHorizontal() ? "gridColumn" : "gridRow"; + const translateProperty = this.isHorizontal() ? "translateX" : "translateY"; + const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop"; + const prev = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + const next = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const dif = next - prev; + this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; + this.activeIndicatorRef.classList.add("activeIndicatorTransition"); + this.activeIndicatorRef.addEventListener("transitionend", () => { + this.ticking = false; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`; + this.activeIndicatorRef.classList.remove("activeIndicatorTransition"); + }); + } + /** + * The adjust method for FASTTabs + * @public + * @remarks + * This method allows the active index to be adjusted by numerical increments + */ + adjust(adjustment) { + const focusableTabs = this.tabs.filter((t) => this.isFocusableElement(t)); + const currentActiveTabIndex = focusableTabs.indexOf(this.activetab); + const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment); + const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]); + if (nextIndex > -1) { + this.moveToTabByIndex(this.tabs, nextIndex); + } + } + focusTab() { + this.tabs[this.activeTabIndex].focus(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.activeTabIndex = this.getActiveIndex(); + } + }; + __decorate([ + attr + ], Tabs.prototype, "orientation", void 0); + __decorate([ + attr + ], Tabs.prototype, "activeid", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabs", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabpanels", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Tabs.prototype, "activeindicator", void 0); + __decorate([ + observable + ], Tabs.prototype, "activeIndicatorRef", void 0); + __decorate([ + observable + ], Tabs.prototype, "showActiveIndicator", void 0); + applyMixins(Tabs, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js + var init_tabs2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js"() { + init_tabs_template(); + init_tabs(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js + var _TextArea, FormAssociatedTextArea; + var init_text_area_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextArea = class extends FoundationElement { + }; + FormAssociatedTextArea = class extends FormAssociated(_TextArea) { + constructor() { + super(...arguments); + this.proxy = document.createElement("textarea"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js + var TextAreaResize; + var init_text_area_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js"() { + TextAreaResize = { + /** + * No resize. + */ + none: "none", + /** + * Resize vertically and horizontally. + */ + both: "both", + /** + * Resize horizontally. + */ + horizontal: "horizontal", + /** + * Resize vertically. + */ + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js + var TextArea; + var init_text_area = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js"() { + init_tslib_es6(); + init_esm(); + init_text_field(); + init_apply_mixins(); + init_text_area_form_associated(); + init_text_area_options(); + TextArea = class extends FormAssociatedTextArea { + constructor() { + super(...arguments); + this.resize = TextAreaResize.none; + this.cols = 20; + this.handleTextInput = () => { + this.value = this.control.value; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.readOnly = this.readOnly; + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.autofocus = this.autofocus; + } + } + listChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.setAttribute("list", this.list); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.maxLength = this.maxlength; + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.minLength = this.minlength; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * Selects all the text in the text area + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "readOnly", void 0); + __decorate([ + attr + ], TextArea.prototype, "resize", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], TextArea.prototype, "formId", void 0); + __decorate([ + attr + ], TextArea.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "minlength", void 0); + __decorate([ + attr + ], TextArea.prototype, "name", void 0); + __decorate([ + attr + ], TextArea.prototype, "placeholder", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "cols", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "rows", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextArea.prototype, "defaultSlottedNodes", void 0); + applyMixins(TextArea, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js + var textAreaTemplate; + var init_text_area_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js"() { + init_esm(); + init_text_area(); + textAreaTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js + var init_text_area2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js"() { + init_text_area_template(); + init_text_area(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js + var textFieldTemplate; + var init_text_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js"() { + init_esm(); + init_start_end(); + init_whitespace_filter(); + textFieldTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js + var init_text_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js"() { + init_text_field_template(); + init_text_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js + var init_toolbar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js + function getRootActiveElement(element) { + const rootNode = element.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.activeElement; + } + return document.activeElement; + } + var init_root_active_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js + var ToolbarArrowKeyMap, Toolbar, DelegatesARIAToolbar; + var init_toolbar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + init_direction(); + init_root_active_element(); + ToolbarArrowKeyMap = Object.freeze({ + [ArrowKeys.ArrowUp]: { + [Orientation.vertical]: -1 + }, + [ArrowKeys.ArrowDown]: { + [Orientation.vertical]: 1 + }, + [ArrowKeys.ArrowLeft]: { + [Orientation.horizontal]: { + [Direction.ltr]: -1, + [Direction.rtl]: 1 + } + }, + [ArrowKeys.ArrowRight]: { + [Orientation.horizontal]: { + [Direction.ltr]: 1, + [Direction.rtl]: -1 + } + } + }); + Toolbar = class _Toolbar extends FoundationElement { + constructor() { + super(...arguments); + this._activeIndex = 0; + this.direction = Direction.ltr; + this.orientation = Orientation.horizontal; + } + /** + * The index of the currently focused element, clamped between 0 and the last element. + * + * @internal + */ + get activeIndex() { + Observable.track(this, "activeIndex"); + return this._activeIndex; + } + set activeIndex(value) { + if (this.$fastController.isConnected) { + this._activeIndex = limit(0, this.focusableElements.length - 1, value); + Observable.notify(this, "activeIndex"); + } + } + slottedItemsChanged() { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * Set the activeIndex when a focusable element in the toolbar is clicked. + * + * @internal + */ + mouseDownHandler(e) { + var _a; + const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.findIndex((x) => x.contains(e.target)); + if (activeIndex > -1 && this.activeIndex !== activeIndex) { + this.setFocusedElement(activeIndex); + } + return true; + } + childItemsChanged(prev, next) { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + } + /** + * When the toolbar receives focus, set the currently active element as focused. + * + * @internal + */ + focusinHandler(e) { + const relatedTarget = e.relatedTarget; + if (!relatedTarget || this.contains(relatedTarget)) { + return; + } + this.setFocusedElement(); + } + /** + * Determines a value that can be used to iterate a list with the arrow keys. + * + * @param this - An element with an orientation and direction + * @param key - The event key value + * @internal + */ + getDirectionalIncrementer(key) { + var _a, _b, _c, _d, _e; + return (_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0; + } + /** + * Handle keyboard events for the toolbar. + * + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) { + return true; + } + const incrementer = this.getDirectionalIncrementer(key); + if (!incrementer) { + return !e.target.closest("[role=radiogroup]"); + } + const nextIndex = this.activeIndex + incrementer; + if (this.focusableElements[nextIndex]) { + e.preventDefault(); + } + this.setFocusedElement(nextIndex); + return true; + } + /** + * get all the slotted elements + * @internal + */ + get allSlottedItems() { + return [ + ...this.start.assignedElements(), + ...this.slottedItems, + ...this.end.assignedElements() + ]; + } + /** + * Prepare the slotted elements which can be focusable. + * + * @internal + */ + reduceFocusableElements() { + var _a; + const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex]; + this.focusableElements = this.allSlottedItems.reduce(_Toolbar.reduceFocusableItems, []); + const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement); + this.activeIndex = Math.max(0, adjustedActiveIndex); + this.setFocusableElements(); + } + /** + * Set the activeIndex and focus the corresponding control. + * + * @param activeIndex - The new index to set + * @internal + */ + setFocusedElement(activeIndex = this.activeIndex) { + this.activeIndex = activeIndex; + this.setFocusableElements(); + if (this.focusableElements[this.activeIndex] && // Don't focus the toolbar element if some event handlers moved + // the focus on another element in the page. + this.contains(getRootActiveElement(this))) { + this.focusableElements[this.activeIndex].focus(); + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceFocusableItems(elements2, element) { + var _a, _b, _c, _d; + const isRoleRadio = element.getAttribute("role") === "radio"; + const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus; + const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some((x) => isFocusable(x)); + if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Toolbar.reduceFocusableItems, [])); + } + return elements2; + } + /** + * @internal + */ + setFocusableElements() { + if (this.$fastController.isConnected && this.focusableElements.length > 0) { + this.focusableElements.forEach((element, index) => { + element.tabIndex = this.activeIndex === index ? 0 : -1; + }); + } + } + }; + __decorate([ + observable + ], Toolbar.prototype, "direction", void 0); + __decorate([ + attr + ], Toolbar.prototype, "orientation", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedItems", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedLabel", void 0); + __decorate([ + observable + ], Toolbar.prototype, "childItems", void 0); + DelegatesARIAToolbar = class { + }; + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], DelegatesARIAToolbar.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], DelegatesARIAToolbar.prototype, "ariaLabel", void 0); + applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties); + applyMixins(Toolbar, StartEnd, DelegatesARIAToolbar); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js + var init_toolbar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js"() { + init_toolbar_template(); + init_toolbar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js + var init_tooltip_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js + var TooltipPosition; + var init_tooltip_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js"() { + TooltipPosition = { + /** + * The tooltip is positioned above the element + */ + top: "top", + /** + * The tooltip is positioned to the right of the element + */ + right: "right", + /** + * The tooltip is positioned below the element + */ + bottom: "bottom", + /** + * The tooltip is positioned to the left of the element + */ + left: "left", + /** + * The tooltip is positioned before the element + */ + start: "start", + /** + * The tooltip is positioned after the element + */ + end: "end", + /** + * The tooltip is positioned above the element and to the left + */ + topLeft: "top-left", + /** + * The tooltip is positioned above the element and to the right + */ + topRight: "top-right", + /** + * The tooltip is positioned below the element and to the left + */ + bottomLeft: "bottom-left", + /** + * The tooltip is positioned below the element and to the right + */ + bottomRight: "bottom-right", + /** + * The tooltip is positioned above the element and to the left + */ + topStart: "top-start", + /** + * The tooltip is positioned above the element and to the right + */ + topEnd: "top-end", + /** + * The tooltip is positioned below the element and to the left + */ + bottomStart: "bottom-start", + /** + * The tooltip is positioned below the element and to the right + */ + bottomEnd: "bottom-end" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js + var Tooltip; + var init_tooltip = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + init_tooltip_options(); + Tooltip = class extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.delay = 300; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.horizontalInset = "false"; + this.verticalInset = "false"; + this.horizontalScaling = "content"; + this.verticalScaling = "content"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = void 0; + this.tooltipVisible = false; + this.currentDirection = Direction.ltr; + this.showDelayTimer = null; + this.hideDelayTimer = null; + this.isAnchorHoveredFocused = false; + this.isRegionHovered = false; + this.handlePositionChange = (ev) => { + this.classList.toggle("top", this.region.verticalPosition === "start"); + this.classList.toggle("bottom", this.region.verticalPosition === "end"); + this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd"); + this.classList.toggle("center-vertical", this.region.verticalPosition === "center"); + this.classList.toggle("left", this.region.horizontalPosition === "start"); + this.classList.toggle("right", this.region.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd"); + this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center"); + }; + this.handleRegionMouseOver = (ev) => { + this.isRegionHovered = true; + }; + this.handleRegionMouseOut = (ev) => { + this.isRegionHovered = false; + this.startHideDelayTimer(); + }; + this.handleAnchorMouseOver = (ev) => { + if (this.tooltipVisible) { + this.isAnchorHoveredFocused = true; + return; + } + this.startShowDelayTimer(); + }; + this.handleAnchorMouseOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.handleAnchorFocusIn = (ev) => { + this.startShowDelayTimer(); + }; + this.handleAnchorFocusOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.startHideDelayTimer = () => { + this.clearHideDelayTimer(); + if (!this.tooltipVisible) { + return; + } + this.hideDelayTimer = window.setTimeout(() => { + this.updateTooltipVisibility(); + }, 60); + }; + this.clearHideDelayTimer = () => { + if (this.hideDelayTimer !== null) { + clearTimeout(this.hideDelayTimer); + this.hideDelayTimer = null; + } + }; + this.startShowDelayTimer = () => { + if (this.isAnchorHoveredFocused) { + return; + } + if (this.delay > 1) { + if (this.showDelayTimer === null) + this.showDelayTimer = window.setTimeout(() => { + this.startHover(); + }, this.delay); + return; + } + this.startHover(); + }; + this.startHover = () => { + this.isAnchorHoveredFocused = true; + this.updateTooltipVisibility(); + }; + this.clearShowDelayTimer = () => { + if (this.showDelayTimer !== null) { + clearTimeout(this.showDelayTimer); + this.showDelayTimer = null; + } + }; + this.getAnchor = () => { + const rootNode = this.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.getElementById(this.anchor); + } + return document.getElementById(this.anchor); + }; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && this.tooltipVisible) { + switch (e.key) { + case keyEscape: + this.isAnchorHoveredFocused = false; + this.updateTooltipVisibility(); + this.$emit("dismiss"); + break; + } + } + }; + this.updateTooltipVisibility = () => { + if (this.visible === false) { + this.hideTooltip(); + } else if (this.visible === true) { + this.showTooltip(); + return; + } else { + if (this.isAnchorHoveredFocused || this.isRegionHovered) { + this.showTooltip(); + return; + } + this.hideTooltip(); + } + }; + this.showTooltip = () => { + if (this.tooltipVisible) { + return; + } + this.currentDirection = getDirection(this); + this.tooltipVisible = true; + document.addEventListener("keydown", this.handleDocumentKeydown); + DOM.queueUpdate(this.setRegionProps); + }; + this.hideTooltip = () => { + if (!this.tooltipVisible) { + return; + } + this.clearHideDelayTimer(); + if (this.region !== null && this.region !== void 0) { + this.region.removeEventListener("positionchange", this.handlePositionChange); + this.region.viewportElement = null; + this.region.anchorElement = null; + this.region.removeEventListener("mouseover", this.handleRegionMouseOver); + this.region.removeEventListener("mouseout", this.handleRegionMouseOut); + } + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.tooltipVisible = false; + }; + this.setRegionProps = () => { + if (!this.tooltipVisible) { + return; + } + this.region.viewportElement = this.viewportElement; + this.region.anchorElement = this.anchorElement; + this.region.addEventListener("positionchange", this.handlePositionChange); + this.region.addEventListener("mouseover", this.handleRegionMouseOver, { + passive: true + }); + this.region.addEventListener("mouseout", this.handleRegionMouseOut, { + passive: true + }); + }; + } + visibleChanged() { + if (this.$fastController.isConnected) { + this.updateTooltipVisibility(); + this.updateLayout(); + } + } + anchorChanged() { + if (this.$fastController.isConnected) { + this.anchorElement = this.getAnchor(); + } + } + positionChanged() { + if (this.$fastController.isConnected) { + this.updateLayout(); + } + } + anchorElementChanged(oldValue) { + if (this.$fastController.isConnected) { + if (oldValue !== null && oldValue !== void 0) { + oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver); + oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut); + oldValue.removeEventListener("focusin", this.handleAnchorFocusIn); + oldValue.removeEventListener("focusout", this.handleAnchorFocusOut); + } + if (this.anchorElement !== null && this.anchorElement !== void 0) { + this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true }); + this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true }); + this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, { + passive: true + }); + this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true }); + const anchorId = this.anchorElement.id; + if (this.anchorElement.parentElement !== null) { + this.anchorElement.parentElement.querySelectorAll(":hover").forEach((element) => { + if (element.id === anchorId) { + this.startShowDelayTimer(); + } + }); + } + } + if (this.region !== null && this.region !== void 0 && this.tooltipVisible) { + this.region.anchorElement = this.anchorElement; + } + this.updateLayout(); + } + } + viewportElementChanged() { + if (this.region !== null && this.region !== void 0) { + this.region.viewportElement = this.viewportElement; + } + this.updateLayout(); + } + connectedCallback() { + super.connectedCallback(); + this.anchorElement = this.getAnchor(); + this.updateTooltipVisibility(); + } + disconnectedCallback() { + this.hideTooltip(); + this.clearShowDelayTimer(); + this.clearHideDelayTimer(); + super.disconnectedCallback(); + } + /** + * updated the properties being passed to the anchored region + */ + updateLayout() { + this.verticalPositioningMode = "locktodefault"; + this.horizontalPositioningMode = "locktodefault"; + switch (this.position) { + case TooltipPosition.top: + case TooltipPosition.bottom: + this.verticalDefaultPosition = this.position; + this.horizontalDefaultPosition = "center"; + break; + case TooltipPosition.right: + case TooltipPosition.left: + case TooltipPosition.start: + case TooltipPosition.end: + this.verticalDefaultPosition = "center"; + this.horizontalDefaultPosition = this.position; + break; + case TooltipPosition.topLeft: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.topRight: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.bottomLeft: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.bottomRight: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.topStart: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.topEnd: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "end"; + break; + case TooltipPosition.bottomStart: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.bottomEnd: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "end"; + break; + default: + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = "center"; + break; + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tooltip.prototype, "visible", void 0); + __decorate([ + attr + ], Tooltip.prototype, "anchor", void 0); + __decorate([ + attr + ], Tooltip.prototype, "delay", void 0); + __decorate([ + attr + ], Tooltip.prototype, "position", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], Tooltip.prototype, "autoUpdateMode", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock" }) + ], Tooltip.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock" }) + ], Tooltip.prototype, "verticalViewportLock", void 0); + __decorate([ + observable + ], Tooltip.prototype, "anchorElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "viewportElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "tooltipVisible", void 0); + __decorate([ + observable + ], Tooltip.prototype, "currentDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js + var init_tooltip2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js"() { + init_tooltip_template(); + init_tooltip(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js + var init_tree_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js + function isTreeItemElement(el) { + return isHTMLElement(el) && el.getAttribute("role") === "treeitem"; + } + var TreeItem; + var init_tree_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TreeItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.expanded = false; + this.focusable = false; + this.isNestedItem = () => { + return isTreeItemElement(this.parentElement); + }; + this.handleExpandCollapseButtonClick = (e) => { + if (!this.disabled && !e.defaultPrevented) { + this.expanded = !this.expanded; + } + }; + this.handleFocus = (e) => { + this.setAttribute("tabindex", "0"); + }; + this.handleBlur = (e) => { + this.setAttribute("tabindex", "-1"); + }; + } + expandedChanged() { + if (this.$fastController.isConnected) { + this.$emit("expanded-change", this); + } + } + selectedChanged() { + if (this.$fastController.isConnected) { + this.$emit("selected-change", this); + } + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.items.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = true; + } + }); + } + } + /** + * Places document focus on a tree item + * + * @public + * @param el - the element to focus + */ + static focusItem(el) { + el.focusable = true; + el.focus(); + } + /** + * Gets number of children + * + * @internal + */ + childItemLength() { + const treeChildren = this.childItems.filter((item) => { + return isTreeItemElement(item); + }); + return treeChildren ? treeChildren.length : 0; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "expanded", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "selected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "disabled", void 0); + __decorate([ + observable + ], TreeItem.prototype, "focusable", void 0); + __decorate([ + observable + ], TreeItem.prototype, "childItems", void 0); + __decorate([ + observable + ], TreeItem.prototype, "items", void 0); + __decorate([ + observable + ], TreeItem.prototype, "nested", void 0); + __decorate([ + observable + ], TreeItem.prototype, "renderCollapsedChildren", void 0); + applyMixins(TreeItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js + var init_tree_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js"() { + init_tree_item_template(); + init_tree_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js + var init_tree_view_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js + var TreeView; + var init_tree_view = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_tree_item(); + init_foundation_element(); + TreeView = class extends FoundationElement { + constructor() { + super(...arguments); + this.currentFocused = null; + this.handleFocus = (e) => { + if (this.slottedTreeItems.length < 1) { + return; + } + if (e.target === this) { + if (this.currentFocused === null) { + this.currentFocused = this.getValidFocusableItem(); + } + if (this.currentFocused !== null) { + TreeItem.focusItem(this.currentFocused); + } + return; + } + if (this.contains(e.target)) { + this.setAttribute("tabindex", "-1"); + this.currentFocused = e.target; + } + }; + this.handleBlur = (e) => { + if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) { + this.setAttribute("tabindex", "0"); + } + }; + this.handleKeyDown = (e) => { + if (e.defaultPrevented) { + return; + } + if (this.slottedTreeItems.length < 1) { + return true; + } + const treeItems = this.getVisibleNodes(); + switch (e.key) { + case keyHome: + if (treeItems.length) { + TreeItem.focusItem(treeItems[0]); + } + return; + case keyEnd: + if (treeItems.length) { + TreeItem.focusItem(treeItems[treeItems.length - 1]); + } + return; + case keyArrowLeft: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) { + item.expanded = false; + } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) { + TreeItem.focusItem(item.parentElement); + } + } + return false; + case keyArrowRight: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) { + item.expanded = true; + } else if (item instanceof TreeItem && item.childItemLength() > 0) { + this.focusNextNode(1, e.target); + } + } + return; + case keyArrowDown: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(1, e.target); + } + return; + case keyArrowUp: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(-1, e.target); + } + return; + case keyEnter: + this.handleClick(e); + return; + } + return true; + }; + this.handleSelectedChange = (e) => { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (item.selected) { + if (this.currentSelected && this.currentSelected !== item) { + this.currentSelected.selected = false; + } + this.currentSelected = item; + } else if (!item.selected && this.currentSelected === item) { + this.currentSelected = null; + } + return; + }; + this.setItems = () => { + const selectedItem = this.treeView.querySelector("[aria-selected='true']"); + this.currentSelected = selectedItem; + if (this.currentFocused === null || !this.contains(this.currentFocused)) { + this.currentFocused = this.getValidFocusableItem(); + } + this.nested = this.checkForNestedItems(); + const treeItems = this.getVisibleNodes(); + treeItems.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = this.nested; + } + }); + }; + this.isFocusableElement = (el) => { + return isTreeItemElement(el); + }; + this.isSelectedElement = (el) => { + return el.selected; + }; + } + slottedTreeItemsChanged() { + if (this.$fastController.isConnected) { + this.setItems(); + } + } + connectedCallback() { + super.connectedCallback(); + this.setAttribute("tabindex", "0"); + DOM.queueUpdate(() => { + this.setItems(); + }); + } + /** + * Handles click events bubbling up + * + * @internal + */ + handleClick(e) { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (!item.disabled) { + item.selected = !item.selected; + } + return; + } + /** + * Move focus to a tree item based on its offset from the provided item + */ + focusNextNode(delta, item) { + const visibleNodes = this.getVisibleNodes(); + if (!visibleNodes) { + return; + } + const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta]; + if (isHTMLElement(focusItem)) { + TreeItem.focusItem(focusItem); + } + } + /** + * checks if there are any nested tree items + */ + getValidFocusableItem() { + const treeItems = this.getVisibleNodes(); + let focusIndex = treeItems.findIndex(this.isSelectedElement); + if (focusIndex === -1) { + focusIndex = treeItems.findIndex(this.isFocusableElement); + } + if (focusIndex !== -1) { + return treeItems[focusIndex]; + } + return null; + } + /** + * checks if there are any nested tree items + */ + checkForNestedItems() { + return this.slottedTreeItems.some((node) => { + return isTreeItemElement(node) && node.querySelector("[role='treeitem']"); + }); + } + getVisibleNodes() { + return getDisplayedNodes(this, "[role='treeitem']") || []; + } + }; + __decorate([ + attr({ attribute: "render-collapsed-nodes" }) + ], TreeView.prototype, "renderCollapsedNodes", void 0); + __decorate([ + observable + ], TreeView.prototype, "currentSelected", void 0); + __decorate([ + observable + ], TreeView.prototype, "slottedTreeItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js + var init_tree_view2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js"() { + init_tree_view_template(); + init_tree_view(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js + var MatchMediaBehavior, MatchMediaStyleSheetBehavior, forcedColorsStylesheetBehavior, darkModeStylesheetBehavior, lightModeStylesheetBehavior; + var init_match_media_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js"() { + MatchMediaBehavior = class { + /** + * + * @param query - The media query to operate from. + */ + constructor(query) { + this.listenerCache = /* @__PURE__ */ new WeakMap(); + this.query = query; + } + /** + * Binds the behavior to the element. + * @param source - The element for which the behavior is bound. + */ + bind(source) { + const { query } = this; + const listener = this.constructListener(source); + listener.bind(query)(); + query.addListener(listener); + this.listenerCache.set(source, listener); + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + */ + unbind(source) { + const listener = this.listenerCache.get(source); + if (listener) { + this.query.removeListener(listener); + this.listenerCache.delete(source); + } + } + }; + MatchMediaStyleSheetBehavior = class _MatchMediaStyleSheetBehavior extends MatchMediaBehavior { + /** + * Constructs a {@link MatchMediaStyleSheetBehavior} instance. + * @param query - The media query to operate from. + * @param styles - The styles to coordinate with the query. + */ + constructor(query, styles) { + super(query); + this.styles = styles; + } + /** + * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for + * a provided query. + * @param query - The media query to operate from. + * + * @public + * @example + * + * ```ts + * import { css } from "@microsoft/fast-element"; + * import { MatchMediaStyleSheetBehavior } from "@microsoft/fast-foundation"; + * + * const landscapeBehavior = MatchMediaStyleSheetBehavior.with( + * window.matchMedia("(orientation: landscape)") + * ); + * const styles = css` + * :host { + * width: 200px; + * height: 400px; + * } + * ` + * .withBehaviors(landscapeBehavior(css` + * :host { + * width: 400px; + * height: 200px; + * } + * `)) + * ``` + */ + static with(query) { + return (styles) => { + return new _MatchMediaStyleSheetBehavior(query, styles); + }; + } + /** + * Constructs a match-media listener for a provided element. + * @param source - the element for which to attach or detach styles. + * @internal + */ + constructListener(source) { + let attached = false; + const styles = this.styles; + return function listener() { + const { matches: matches2 } = this; + if (matches2 && !attached) { + source.$fastController.addStyles(styles); + attached = matches2; + } else if (!matches2 && attached) { + source.$fastController.removeStyles(styles); + attached = matches2; + } + }; + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + * @internal + */ + unbind(source) { + super.unbind(source); + source.$fastController.removeStyles(this.styles); + } + }; + forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)")); + darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)")); + lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)")); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js + var init_property_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js + var disabledCursor; + var init_disabled = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js"() { + disabledCursor = "not-allowed"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js + function display(displayValue) { + return `${hidden}:host{display:${displayValue}}`; + } + var hidden; + var init_display = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js"() { + hidden = `:host([hidden]){display:none}`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js + var focusVisible; + var init_focus = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js"() { + init_dist2(); + focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js + var init_style = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js"() { + init_disabled(); + init_display(); + init_focus(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js + var init_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js"() { + init_apply_mixins(); + init_composed_parent(); + init_match_media_stylesheet_behavior(); + init_property_stylesheet_behavior(); + init_style(); + init_direction(); + init_whitespace_filter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/index.js + var init_esm2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/index.js"() { + init_accordion_item2(); + init_accordion2(); + init_anchor2(); + init_anchored_region2(); + init_avatar2(); + init_badge2(); + init_breadcrumb_item2(); + init_breadcrumb2(); + init_button2(); + init_calendar2(); + init_card2(); + init_checkbox2(); + init_combobox2(); + init_data_grid2(); + init_design_system2(); + init_design_token(); + init_di2(); + init_dialog2(); + init_disclosure2(); + init_divider2(); + init_flipper2(); + init_form_associated2(); + init_foundation_element2(); + init_listbox_option2(); + init_listbox2(); + init_picker2(); + init_menu_item2(); + init_menu2(); + init_number_field2(); + init_patterns(); + init_progress_ring(); + init_progress(); + init_radio_group2(); + init_radio2(); + init_horizontal_scroll2(); + init_search2(); + init_select2(); + init_skeleton2(); + init_slider_label2(); + init_slider2(); + init_switch2(); + init_tab_panel2(); + init_tab2(); + init_tabs2(); + init_text_area2(); + init_text_field2(); + init_toolbar2(); + init_tooltip2(); + init_tree_item2(); + init_tree_view2(); + init_utilities(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js + function provideVSCodeDesignSystem(element) { + return DesignSystem.getOrCreate(element).withPrefix("vscode"); + } + var init_vscode_design_system = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js"() { + init_esm2(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js + function initThemeChangeListener(tokenMappings2) { + window.addEventListener("load", () => { + const observer = new MutationObserver(() => { + applyCurrentTheme(tokenMappings2); + }); + observer.observe(document.body, { + attributes: true, + attributeFilter: ["class"] + }); + applyCurrentTheme(tokenMappings2); + }); + } + function applyCurrentTheme(tokenMappings2) { + const styles = getComputedStyle(document.body); + const body = document.querySelector("body"); + if (body) { + const themeKind = body.getAttribute("data-vscode-theme-kind"); + for (const [vscodeTokenName, toolkitToken] of tokenMappings2) { + let value = styles.getPropertyValue(vscodeTokenName).toString(); + if (themeKind === "vscode-high-contrast") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + value = "transparent"; + } + if (toolkitToken.name === "button-icon-hover-background") { + value = "transparent"; + } + } else if (themeKind === "vscode-high-contrast-light") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + switch (toolkitToken.name) { + case "button-primary-hover-background": + value = "#0F4A85"; + break; + case "button-secondary-hover-background": + value = "transparent"; + break; + case "button-icon-hover-background": + value = "transparent"; + break; + } + } + } else { + if (toolkitToken.name === "contrast-active-border") { + value = "transparent"; + } + } + toolkitToken.setValueFor(body, value); + } + } + } + var init_applyTheme = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js + function create2(name, vscodeThemeVar) { + const designToken = DesignToken.create(name); + if (vscodeThemeVar) { + if (vscodeThemeVar.includes("--fake-vscode-token")) { + const uniqueId2 = "id" + Math.random().toString(16).slice(2); + vscodeThemeVar = `${vscodeThemeVar}-${uniqueId2}`; + } + tokenMappings.set(vscodeThemeVar, designToken); + } + if (!isThemeListenerInitialized) { + initThemeChangeListener(tokenMappings); + isThemeListenerInitialized = true; + } + return designToken; + } + var tokenMappings, isThemeListenerInitialized; + var init_create = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js"() { + init_esm2(); + init_applyTheme(); + tokenMappings = /* @__PURE__ */ new Map(); + isThemeListenerInitialized = false; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js + var background, borderWidth, contrastActiveBorder, contrastBorder, cornerRadius, cornerRadiusRound, designUnit, disabledOpacity, focusBorder, fontFamily, fontWeight, foreground, inputHeight, inputMinWidth, typeRampBaseFontSize, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1LineHeight, scrollbarWidth, scrollbarHeight, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, badgeBackground, badgeForeground, buttonBorder, buttonIconBackground, buttonIconCornerRadius, buttonIconFocusBorderOffset, buttonIconHoverBackground, buttonIconPadding, buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonPaddingHorizontal, buttonPaddingVertical, checkboxBackground, checkboxBorder, checkboxCornerRadius, checkboxForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, dividerBackground, dropdownBackground, dropdownBorder, dropdownForeground, dropdownListMaxHeight, inputBackground, inputForeground, inputPlaceholderForeground, linkActiveForeground, linkForeground, progressBackground, panelTabActiveBorder, panelTabActiveForeground, panelTabForeground, panelViewBackground, panelViewBorder, tagCornerRadius; + var init_design_tokens = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js"() { + init_create(); + background = create2("background", "--vscode-editor-background").withDefault("#1e1e1e"); + borderWidth = create2("border-width").withDefault(1); + contrastActiveBorder = create2("contrast-active-border", "--vscode-contrastActiveBorder").withDefault("#f38518"); + contrastBorder = create2("contrast-border", "--vscode-contrastBorder").withDefault("#6fc3df"); + cornerRadius = create2("corner-radius").withDefault(0); + cornerRadiusRound = create2("corner-radius-round").withDefault(2); + designUnit = create2("design-unit").withDefault(4); + disabledOpacity = create2("disabled-opacity").withDefault(0.4); + focusBorder = create2("focus-border", "--vscode-focusBorder").withDefault("#007fd4"); + fontFamily = create2("font-family", "--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"); + fontWeight = create2("font-weight", "--vscode-font-weight").withDefault("400"); + foreground = create2("foreground", "--vscode-foreground").withDefault("#cccccc"); + inputHeight = create2("input-height").withDefault("26"); + inputMinWidth = create2("input-min-width").withDefault("100px"); + typeRampBaseFontSize = create2("type-ramp-base-font-size", "--vscode-font-size").withDefault("13px"); + typeRampBaseLineHeight = create2("type-ramp-base-line-height").withDefault("normal"); + typeRampMinus1FontSize = create2("type-ramp-minus1-font-size").withDefault("11px"); + typeRampMinus1LineHeight = create2("type-ramp-minus1-line-height").withDefault("16px"); + typeRampMinus2FontSize = create2("type-ramp-minus2-font-size").withDefault("9px"); + typeRampMinus2LineHeight = create2("type-ramp-minus2-line-height").withDefault("16px"); + typeRampPlus1FontSize = create2("type-ramp-plus1-font-size").withDefault("16px"); + typeRampPlus1LineHeight = create2("type-ramp-plus1-line-height").withDefault("24px"); + scrollbarWidth = create2("scrollbarWidth").withDefault("10px"); + scrollbarHeight = create2("scrollbarHeight").withDefault("10px"); + scrollbarSliderBackground = create2("scrollbar-slider-background", "--vscode-scrollbarSlider-background").withDefault("#79797966"); + scrollbarSliderHoverBackground = create2("scrollbar-slider-hover-background", "--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"); + scrollbarSliderActiveBackground = create2("scrollbar-slider-active-background", "--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"); + badgeBackground = create2("badge-background", "--vscode-badge-background").withDefault("#4d4d4d"); + badgeForeground = create2("badge-foreground", "--vscode-badge-foreground").withDefault("#ffffff"); + buttonBorder = create2("button-border", "--vscode-button-border").withDefault("transparent"); + buttonIconBackground = create2("button-icon-background").withDefault("transparent"); + buttonIconCornerRadius = create2("button-icon-corner-radius").withDefault("5px"); + buttonIconFocusBorderOffset = create2("button-icon-outline-offset").withDefault(0); + buttonIconHoverBackground = create2("button-icon-hover-background", "--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"); + buttonIconPadding = create2("button-icon-padding").withDefault("3px"); + buttonPrimaryBackground = create2("button-primary-background", "--vscode-button-background").withDefault("#0e639c"); + buttonPrimaryForeground = create2("button-primary-foreground", "--vscode-button-foreground").withDefault("#ffffff"); + buttonPrimaryHoverBackground = create2("button-primary-hover-background", "--vscode-button-hoverBackground").withDefault("#1177bb"); + buttonSecondaryBackground = create2("button-secondary-background", "--vscode-button-secondaryBackground").withDefault("#3a3d41"); + buttonSecondaryForeground = create2("button-secondary-foreground", "--vscode-button-secondaryForeground").withDefault("#ffffff"); + buttonSecondaryHoverBackground = create2("button-secondary-hover-background", "--vscode-button-secondaryHoverBackground").withDefault("#45494e"); + buttonPaddingHorizontal = create2("button-padding-horizontal").withDefault("11px"); + buttonPaddingVertical = create2("button-padding-vertical").withDefault("4px"); + checkboxBackground = create2("checkbox-background", "--vscode-checkbox-background").withDefault("#3c3c3c"); + checkboxBorder = create2("checkbox-border", "--vscode-checkbox-border").withDefault("#3c3c3c"); + checkboxCornerRadius = create2("checkbox-corner-radius").withDefault(3); + checkboxForeground = create2("checkbox-foreground", "--vscode-checkbox-foreground").withDefault("#f0f0f0"); + listActiveSelectionBackground = create2("list-active-selection-background", "--vscode-list-activeSelectionBackground").withDefault("#094771"); + listActiveSelectionForeground = create2("list-active-selection-foreground", "--vscode-list-activeSelectionForeground").withDefault("#ffffff"); + listHoverBackground = create2("list-hover-background", "--vscode-list-hoverBackground").withDefault("#2a2d2e"); + dividerBackground = create2("divider-background", "--vscode-settings-dropdownListBorder").withDefault("#454545"); + dropdownBackground = create2("dropdown-background", "--vscode-dropdown-background").withDefault("#3c3c3c"); + dropdownBorder = create2("dropdown-border", "--vscode-dropdown-border").withDefault("#3c3c3c"); + dropdownForeground = create2("dropdown-foreground", "--vscode-dropdown-foreground").withDefault("#f0f0f0"); + dropdownListMaxHeight = create2("dropdown-list-max-height").withDefault("200px"); + inputBackground = create2("input-background", "--vscode-input-background").withDefault("#3c3c3c"); + inputForeground = create2("input-foreground", "--vscode-input-foreground").withDefault("#cccccc"); + inputPlaceholderForeground = create2("input-placeholder-foreground", "--vscode-input-placeholderForeground").withDefault("#cccccc"); + linkActiveForeground = create2("link-active-foreground", "--vscode-textLink-activeForeground").withDefault("#3794ff"); + linkForeground = create2("link-foreground", "--vscode-textLink-foreground").withDefault("#3794ff"); + progressBackground = create2("progress-background", "--vscode-progressBar-background").withDefault("#0e70c0"); + panelTabActiveBorder = create2("panel-tab-active-border", "--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"); + panelTabActiveForeground = create2("panel-tab-active-foreground", "--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"); + panelTabForeground = create2("panel-tab-foreground", "--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"); + panelViewBackground = create2("panel-view-background", "--vscode-panel-background").withDefault("#1e1e1e"); + panelViewBorder = create2("panel-view-border", "--vscode-panel-border").withDefault("#80808059"); + tagCornerRadius = create2("tag-corner-radius").withDefault("2px"); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js + var badgeStyles; + var init_badge_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + badgeStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + text-align: center; + } + .control { + align-items: center; + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: 11px; + box-sizing: border-box; + color: ${badgeForeground}; + display: flex; + height: calc(${designUnit} * 4px); + justify-content: center; + min-width: calc(${designUnit} * 4px + 2px); + min-height: calc(${designUnit} * 4px + 2px); + padding: 3px 6px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js + var Badge2, vsCodeBadge; + var init_badge3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js"() { + init_esm2(); + init_badge_styles(); + Badge2 = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.circular) { + this.circular = true; + } + } + }; + vsCodeBadge = Badge2.compose({ + baseName: "badge", + template: badgeTemplate, + styles: badgeStyles + }); + } + }); + + // node_modules/tslib/tslib.es6.mjs + function __decorate2(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es62 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js + var BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles, buttonStyles; + var init_button_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + BaseButtonStyles = css` + ${display("inline-flex")} :host { + outline: none; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${buttonPrimaryForeground}; + background: ${buttonPrimaryBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + fill: currentColor; + cursor: pointer; + } + .control { + background: transparent; + height: inherit; + flex-grow: 1; + box-sizing: border-box; + display: inline-flex; + justify-content: center; + align-items: center; + padding: ${buttonPaddingVertical} ${buttonPaddingHorizontal}; + white-space: wrap; + outline: none; + text-decoration: none; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + color: inherit; + border-radius: inherit; + fill: inherit; + cursor: inherit; + font-family: inherit; + } + :host(:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host(:active) { + background: ${buttonPrimaryBackground}; + } + .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + .control::-moz-focus-inner { + border: 0; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + background: ${buttonPrimaryBackground}; + cursor: ${disabledCursor}; + } + .content { + display: flex; + } + .start { + display: flex; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-end: 8px; + } +`; + PrimaryButtonStyles = css` + :host([appearance='primary']) { + background: ${buttonPrimaryBackground}; + color: ${buttonPrimaryForeground}; + } + :host([appearance='primary']:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host([appearance='primary']:active) .control:active { + background: ${buttonPrimaryBackground}; + } + :host([appearance='primary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='primary'][disabled]) { + background: ${buttonPrimaryBackground}; + } +`; + SecondaryButtonStyles = css` + :host([appearance='secondary']) { + background: ${buttonSecondaryBackground}; + color: ${buttonSecondaryForeground}; + } + :host([appearance='secondary']:hover) { + background: ${buttonSecondaryHoverBackground}; + } + :host([appearance='secondary']:active) .control:active { + background: ${buttonSecondaryBackground}; + } + :host([appearance='secondary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='secondary'][disabled]) { + background: ${buttonSecondaryBackground}; + } +`; + IconButtonStyles = css` + :host([appearance='icon']) { + background: ${buttonIconBackground}; + border-radius: ${buttonIconCornerRadius}; + color: ${foreground}; + } + :host([appearance='icon']:hover) { + background: ${buttonIconHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } + :host([appearance='icon']) .control { + padding: ${buttonIconPadding}; + border: none; + } + :host([appearance='icon']:active) .control:active { + background: ${buttonIconHoverBackground}; + } + :host([appearance='icon']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: ${buttonIconFocusBorderOffset}; + } + :host([appearance='icon'][disabled]) { + background: ${buttonIconBackground}; + } +`; + buttonStyles = (context, definition) => css` + ${BaseButtonStyles} + ${PrimaryButtonStyles} + ${SecondaryButtonStyles} + ${IconButtonStyles} +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/index.js + var Button2, vsCodeButton; + var init_button3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/index.js"() { + init_tslib_es62(); + init_esm(); + init_esm2(); + init_button_styles(); + Button2 = class extends Button { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.appearance) { + const appearanceValue = this.getAttribute("appearance"); + this.appearance = appearanceValue; + } + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "appearance" && newVal === "icon") { + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.ariaLabel = "Icon Button"; + } + } + if (attrName === "aria-label") { + this.ariaLabel = newVal; + } + if (attrName === "disabled") { + this.disabled = newVal !== null; + } + } + }; + __decorate2([ + attr + ], Button2.prototype, "appearance", void 0); + vsCodeButton = Button2.compose({ + baseName: "button", + template: buttonTemplate, + styles: buttonStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js + var checkboxStyles; + var init_checkbox_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + checkboxStyles = (context, defintiion) => css` + ${display("inline-flex")} :host { + align-items: center; + outline: none; + margin: calc(${designUnit} * 1px) 0; + user-select: none; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control { + position: relative; + width: calc(${designUnit} * 4px + 2px); + height: calc(${designUnit} * 4px + 2px); + box-sizing: border-box; + border-radius: calc(${checkboxCornerRadius} * 1px); + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + background: ${checkboxBackground}; + outline: none; + cursor: pointer; + } + .label { + font-family: ${fontFamily}; + color: ${foreground}; + padding-inline-start: calc(${designUnit} * 2px + 2px); + margin-inline-end: calc(${designUnit} * 2px + 2px); + cursor: pointer; + } + .label__hidden { + display: none; + visibility: hidden; + } + .checked-indicator { + width: 100%; + height: 100%; + display: block; + fill: ${foreground}; + opacity: 0; + pointer-events: none; + } + .indeterminate-indicator { + border-radius: 2px; + background: ${foreground}; + position: absolute; + top: 50%; + left: 50%; + width: 50%; + height: 50%; + transform: translate(-50%, -50%); + opacity: 0; + } + :host(:enabled) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:enabled) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host(.disabled) .label, + :host(.readonly) .label, + :host(.readonly) .control, + :host(.disabled) .control { + cursor: ${disabledCursor}; + } + :host(.checked:not(.indeterminate)) .checked-indicator, + :host(.indeterminate) .indeterminate-indicator { + opacity: 1; + } + :host(.disabled) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js + var Checkbox2, vsCodeCheckbox; + var init_checkbox3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js"() { + init_esm2(); + init_checkbox_styles(); + Checkbox2 = class extends Checkbox { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Checkbox"); + } + } + }; + vsCodeCheckbox = Checkbox2.compose({ + baseName: "checkbox", + template: checkboxTemplate, + styles: checkboxStyles, + checkedIndicator: ` + + + + `, + indeterminateIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js + var dataGridStyles; + var init_data_grid_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js"() { + init_esm(); + dataGridStyles = (context, definition) => css` + :host { + display: flex; + position: relative; + flex-direction: column; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js + var dataGridRowStyles; + var init_data_grid_row_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js"() { + init_esm(); + init_design_tokens(); + dataGridRowStyles = (context, definition) => css` + :host { + display: grid; + padding: calc((${designUnit} / 4) * 1px) 0; + box-sizing: border-box; + width: 100%; + background: transparent; + } + :host(.header) { + } + :host(.sticky-header) { + background: ${background}; + position: sticky; + top: 0; + } + :host(:hover) { + background: ${listHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js + var dataGridCellStyles; + var init_data_grid_cell_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dataGridCellStyles = (context, definition) => css` + :host { + padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px); + color: ${foreground}; + opacity: 1; + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + font-weight: 400; + border: solid calc(${borderWidth} * 1px) transparent; + border-radius: calc(${cornerRadius} * 1px); + white-space: wrap; + overflow-wrap: anywhere; + } + :host(.column-header) { + font-weight: 600; + } + :host(:${focusVisible}), + :host(:focus), + :host(:active) { + background: ${listActiveSelectionBackground}; + border: solid calc(${borderWidth} * 1px) ${focusBorder}; + color: ${listActiveSelectionForeground}; + outline: none; + } + :host(:${focusVisible}) ::slotted(*), + :host(:focus) ::slotted(*), + :host(:active) ::slotted(*) { + color: ${listActiveSelectionForeground} !important; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js + var DataGrid2, vsCodeDataGrid, DataGridRow2, vsCodeDataGridRow, DataGridCell2, vsCodeDataGridCell; + var init_data_grid3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js"() { + init_esm2(); + init_data_grid_styles(); + init_data_grid_row_styles(); + init_data_grid_cell_styles(); + DataGrid2 = class extends DataGrid { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Data Grid"); + } + } + }; + vsCodeDataGrid = DataGrid2.compose({ + baseName: "data-grid", + baseClass: DataGrid, + template: dataGridTemplate, + styles: dataGridStyles + }); + DataGridRow2 = class extends DataGridRow { + }; + vsCodeDataGridRow = DataGridRow2.compose({ + baseName: "data-grid-row", + baseClass: DataGridRow, + template: dataGridRowTemplate, + styles: dataGridRowStyles + }); + DataGridCell2 = class extends DataGridCell { + }; + vsCodeDataGridCell = DataGridCell2.compose({ + baseName: "data-grid-cell", + baseClass: DataGridCell, + template: dataGridCellTemplate, + styles: dataGridCellStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js + var dividerStyles; + var init_divider_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dividerStyles = (context, definition) => css` + ${display("block")} :host { + border: none; + border-top: calc(${borderWidth} * 1px) solid ${dividerBackground}; + box-sizing: content-box; + height: 0; + margin: calc(${designUnit} * 1px) 0; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js + var Divider2, vsCodeDivider; + var init_divider3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js"() { + init_esm2(); + init_divider_styles(); + Divider2 = class extends Divider { + }; + vsCodeDivider = Divider2.compose({ + baseName: "divider", + template: dividerTemplate, + styles: dividerStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js + var dropdownStyles; + var init_dropdown_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dropdownStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: ${dropdownBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + color: ${foreground}; + contain: contents; + font-family: ${fontFamily}; + height: calc(${inputHeight} * 1px); + position: relative; + user-select: none; + min-width: ${inputMinWidth}; + outline: none; + vertical-align: top; + } + .control { + align-items: center; + box-sizing: border-box; + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + cursor: pointer; + display: flex; + font-family: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + min-height: 100%; + padding: 2px 6px 2px 8px; + width: 100%; + } + .listbox { + background: ${dropdownBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + display: inline-flex; + flex-direction: column; + left: 0; + max-height: ${dropdownListMaxHeight}; + padding: 0; + overflow-y: auto; + position: absolute; + width: 100%; + z-index: 1; + } + .listbox[hidden] { + display: none; + } + :host(:${focusVisible}) .control { + border-color: ${focusBorder}; + } + :host(:not([disabled]):hover) { + background: ${dropdownBackground}; + border-color: ${dropdownBorder}; + } + :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + cursor: ${disabledCursor}; + user-select: none; + } + :host([disabled]:hover) { + background: ${dropdownBackground}; + color: ${foreground}; + fill: currentcolor; + } + :host(:not([disabled])) .control:active { + border-color: ${focusBorder}; + } + :host(:empty) .listbox { + display: none; + } + :host([open]) .control { + border-color: ${focusBorder}; + } + :host([open][position='above']) .listbox { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + :host([open][position='below']) .listbox { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + :host([open][position='above']) .listbox { + bottom: calc(${inputHeight} * 1px); + } + :host([open][position='below']) .listbox { + top: calc(${inputHeight} * 1px); + } + .selected-value { + flex: 1 1 auto; + font-family: inherit; + overflow: hidden; + text-align: start; + text-overflow: ellipsis; + white-space: nowrap; + } + .indicator { + flex: 0 0 auto; + margin-inline-start: 1em; + } + slot[name='listbox'] { + display: none; + width: 100%; + } + :host([open]) slot[name='listbox'] { + display: flex; + position: absolute; + } + .end { + margin-inline-start: auto; + } + .start, + .end, + .indicator, + .select-indicator, + ::slotted(svg), + ::slotted(span) { + fill: currentcolor; + height: 1em; + min-height: calc(${designUnit} * 4px); + min-width: calc(${designUnit} * 4px); + width: 1em; + } + ::slotted([role='option']), + ::slotted(option) { + flex: 0 0 auto; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js + var Dropdown, vsCodeDropdown; + var init_dropdown = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js"() { + init_esm2(); + init_dropdown_styles(); + Dropdown = class extends Select { + }; + vsCodeDropdown = Dropdown.compose({ + baseName: "dropdown", + template: selectTemplate, + styles: dropdownStyles, + indicator: ` + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js + var linkStyles; + var init_link_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + linkStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: transparent; + box-sizing: border-box; + color: ${linkForeground}; + cursor: pointer; + fill: currentcolor; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + outline: none; + } + .control { + background: transparent; + border: calc(${borderWidth} * 1px) solid transparent; + border-radius: calc(${cornerRadius} * 1px); + box-sizing: border-box; + color: inherit; + cursor: inherit; + fill: inherit; + font-family: inherit; + height: inherit; + padding: 0; + outline: none; + text-decoration: none; + word-break: break-word; + } + .control::-moz-focus-inner { + border: 0; + } + :host(:hover) { + color: ${linkActiveForeground}; + } + :host(:hover) .content { + text-decoration: underline; + } + :host(:active) { + background: transparent; + color: ${linkActiveForeground}; + } + :host(:${focusVisible}) .control, + :host(:focus) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/index.js + var Link, vsCodeLink; + var init_link = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/index.js"() { + init_esm2(); + init_link_styles(); + Link = class extends Anchor { + }; + vsCodeLink = Link.compose({ + baseName: "link", + template: anchorTemplate, + styles: linkStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js + var optionStyles; + var init_option_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + optionStyles = (context, definition) => css` + ${display("inline-flex")} :host { + font-family: var(--body-font); + border-radius: ${cornerRadius}; + border: calc(${borderWidth} * 1px) solid transparent; + box-sizing: border-box; + color: ${foreground}; + cursor: pointer; + fill: currentcolor; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: 0; + outline: none; + overflow: hidden; + padding: 0 calc((${designUnit} / 2) * 1px) + calc((${designUnit} / 4) * 1px); + user-select: none; + white-space: nowrap; + } + :host(:${focusVisible}) { + border-color: ${focusBorder}; + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([aria-selected='true']) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:active) { + background: ${listActiveSelectionBackground}; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):hover) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):active) { + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]:hover) { + background-color: inherit; + } + .content { + grid-column-start: 2; + justify-self: start; + overflow: hidden; + text-overflow: ellipsis; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/index.js + var Option2, vsCodeOption; + var init_option = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/index.js"() { + init_esm2(); + init_option_styles(); + Option2 = class extends ListboxOption { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Option"); + } + } + }; + vsCodeOption = Option2.compose({ + baseName: "option", + template: listboxOptionTemplate, + styles: optionStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js + var panelsStyles; + var init_panels_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelsStyles = (context, definition) => css` + ${display("grid")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${foreground}; + grid-template-columns: auto 1fr auto; + grid-template-rows: auto 1fr; + overflow-x: auto; + } + .tablist { + display: grid; + grid-template-rows: auto auto; + grid-template-columns: auto; + column-gap: calc(${designUnit} * 8px); + position: relative; + width: max-content; + align-self: end; + padding: calc(${designUnit} * 1px) calc(${designUnit} * 1px) 0; + box-sizing: border-box; + } + .start, + .end { + align-self: center; + } + .activeIndicator { + grid-row: 2; + grid-column: 1; + width: 100%; + height: calc((${designUnit} / 4) * 1px); + justify-self: center; + background: ${panelTabActiveForeground}; + margin: 0; + border-radius: calc(${cornerRadius} * 1px); + } + .activeIndicatorTransition { + transition: transform 0.01s linear; + } + .tabpanel { + grid-row: 2; + grid-column-start: 1; + grid-column-end: 4; + position: relative; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js + var panelTabStyles; + var init_panel_tab_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelTabStyles = (context, definition) => css` + ${display("inline-flex")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + height: calc(${designUnit} * 7px); + padding: calc(${designUnit} * 1px) 0; + color: ${panelTabForeground}; + fill: currentcolor; + border-radius: calc(${cornerRadius} * 1px); + border: solid calc(${borderWidth} * 1px) transparent; + align-items: center; + justify-content: center; + grid-row: 1; + cursor: pointer; + } + :host(:hover) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:active) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:hover) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:active) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:${focusVisible}) { + outline: none; + border: solid calc(${borderWidth} * 1px) ${panelTabActiveBorder}; + } + :host(:focus) { + outline: none; + } + ::slotted(vscode-badge) { + margin-inline-start: calc(${designUnit} * 2px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js + var panelViewStyles; + var init_panel_view_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelViewStyles = (context, definition) => css` + ${display("flex")} :host { + color: inherit; + background-color: transparent; + border: solid calc(${borderWidth} * 1px) transparent; + box-sizing: border-box; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: 10px calc((${designUnit} + 2) * 1px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js + var Panels, vsCodePanels, PanelTab, vsCodePanelTab, PanelView, vsCodePanelView; + var init_panels = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js"() { + init_esm2(); + init_panels_styles(); + init_panel_tab_styles(); + init_panel_view_styles(); + Panels = class extends Tabs { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.orientation) { + this.orientation = TabsOrientation.horizontal; + } + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Panels"); + } + } + }; + vsCodePanels = Panels.compose({ + baseName: "panels", + template: tabsTemplate, + styles: panelsStyles + }); + PanelTab = class extends Tab { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.disabled) { + this.disabled = false; + } + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } + } + }; + vsCodePanelTab = PanelTab.compose({ + baseName: "panel-tab", + template: tabTemplate, + styles: panelTabStyles + }); + PanelView = class extends TabPanel { + }; + vsCodePanelView = PanelView.compose({ + baseName: "panel-view", + template: tabPanelTemplate, + styles: panelViewStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js + var progressRingStyles; + var init_progress_ring_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + progressRingStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: center; + outline: none; + height: calc(${designUnit} * 7px); + width: calc(${designUnit} * 7px); + margin: 0; + } + .progress { + height: 100%; + width: 100%; + } + .background { + fill: none; + stroke: transparent; + stroke-width: calc(${designUnit} / 2 * 1px); + } + .indeterminate-indicator-1 { + fill: none; + stroke: ${progressBackground}; + stroke-width: calc(${designUnit} / 2 * 1px); + stroke-linecap: square; + transform-origin: 50% 50%; + transform: rotate(-90deg); + transition: all 0.2s ease-in-out; + animation: spin-infinite 2s linear infinite; + } + @keyframes spin-infinite { + 0% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(0deg); + } + 50% { + stroke-dasharray: 21.99px 21.99px; + transform: rotate(450deg); + } + 100% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(1080deg); + } + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js + var ProgressRing, vsCodeProgressRing; + var init_progress_ring2 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js"() { + init_esm2(); + init_progress_ring_styles(); + ProgressRing = class extends BaseProgress { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.paused) { + this.paused = false; + } + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-live", "assertive"); + this.setAttribute("role", "alert"); + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "value") { + this.removeAttribute("value"); + } + } + }; + vsCodeProgressRing = ProgressRing.compose({ + baseName: "progress-ring", + template: progressRingTemplate, + styles: progressRingStyles, + indeterminateIndicator: ` + + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js + var radioGroupStyles; + var init_radio_group_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioGroupStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: flex-start; + margin: calc(${designUnit} * 1px) 0; + flex-direction: column; + } + .positioning-region { + display: flex; + flex-wrap: wrap; + } + :host([orientation='vertical']) .positioning-region { + flex-direction: column; + } + :host([orientation='horizontal']) .positioning-region { + flex-direction: row; + } + ::slotted([slot='label']) { + color: ${foreground}; + font-size: ${typeRampBaseFontSize}; + margin: calc(${designUnit} * 1px) 0; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js + var RadioGroup2, vsCodeRadioGroup; + var init_radio_group3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js"() { + init_dist2(); + init_esm2(); + init_radio_group_styles(); + RadioGroup2 = class extends RadioGroup { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const label = this.querySelector("label"); + if (label) { + const id = "radio-group-" + Math.random().toString(16).slice(2); + label.setAttribute("id", id); + this.setAttribute("aria-labelledby", id); + } + } + }; + vsCodeRadioGroup = RadioGroup2.compose({ + baseName: "radio-group", + template: radioGroupTemplate, + styles: radioGroupStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js + var radioStyles; + var init_radio_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioStyles = (context, definition) => css` + ${display("inline-flex")} :host { + align-items: center; + flex-direction: row; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: calc(${designUnit} * 1px) 0; + outline: none; + position: relative; + transition: all 0.2s ease-in-out; + user-select: none; + } + .control { + background: ${checkboxBackground}; + border-radius: 999px; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + box-sizing: border-box; + cursor: pointer; + height: calc(${designUnit} * 4px); + position: relative; + outline: none; + width: calc(${designUnit} * 4px); + } + .label { + color: ${foreground}; + cursor: pointer; + font-family: ${fontFamily}; + margin-inline-end: calc(${designUnit} * 2px + 2px); + padding-inline-start: calc(${designUnit} * 2px + 2px); + } + .label__hidden { + display: none; + visibility: hidden; + } + .control, + .checked-indicator { + flex-shrink: 0; + } + .checked-indicator { + background: ${foreground}; + border-radius: 999px; + display: inline-block; + inset: calc(${designUnit} * 1px); + opacity: 0; + pointer-events: none; + position: absolute; + } + :host(:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:not([disabled])) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked='true']) .control { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:active { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked="true"]:${focusVisible}:not([disabled])) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([aria-checked='true']) .checked-indicator { + opacity: 1; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js + var Radio2, vsCodeRadio; + var init_radio3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js"() { + init_esm2(); + init_radio_styles(); + Radio2 = class extends Radio { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Radio"); + } + } + }; + vsCodeRadio = Radio2.compose({ + baseName: "radio", + template: radioTemplate, + styles: radioStyles, + checkedIndicator: ` +
+ ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js + var tagStyles; + var init_tag_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + tagStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + } + .control { + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: ${tagCornerRadius}; + color: ${badgeForeground}; + padding: calc(${designUnit} * 0.5px) calc(${designUnit} * 1px); + text-transform: uppercase; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js + var Tag, vsCodeTag; + var init_tag = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js"() { + init_esm2(); + init_tag_styles(); + Tag = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.circular) { + this.circular = false; + } + } + }; + vsCodeTag = Tag.compose({ + baseName: "tag", + template: badgeTemplate, + styles: tagStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js + var textAreaStyles; + var init_text_area_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textAreaStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .control { + box-sizing: border-box; + position: relative; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + font: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: calc(${designUnit} * 2px + 1px); + width: 100%; + min-width: ${inputMinWidth}; + resize: none; + } + .control:hover:enabled { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + .control:active:enabled { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .control::-webkit-scrollbar { + width: ${scrollbarWidth}; + height: ${scrollbarHeight}; + } + .control::-webkit-scrollbar-corner { + background: ${inputBackground}; + } + .control::-webkit-scrollbar-thumb { + background: ${scrollbarSliderBackground}; + } + .control::-webkit-scrollbar-thumb:hover { + background: ${scrollbarSliderHoverBackground}; + } + .control::-webkit-scrollbar-thumb:active { + background: ${scrollbarSliderActiveBackground}; + } + :host(:focus-within:not([disabled])) .control { + border-color: ${focusBorder}; + } + :host([resize='both']) .control { + resize: both; + } + :host([resize='horizontal']) .control { + resize: horizontal; + } + :host([resize='vertical']) .control { + resize: vertical; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js + var TextArea2, vsCodeTextArea; + var init_text_area3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js"() { + init_esm2(); + init_text_area_styles(); + TextArea2 = class extends TextArea { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text area"); + } + } + }; + vsCodeTextArea = TextArea2.compose({ + baseName: "text-area", + template: textAreaTemplate, + styles: textAreaStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js + var textFieldStyles; + var init_text_field_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textFieldStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .root { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: row; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + height: calc(${inputHeight} * 1px); + min-width: ${inputMinWidth}; + } + .control { + -webkit-appearance: none; + font: inherit; + background: transparent; + border: 0; + color: inherit; + height: calc(100% - (${designUnit} * 1px)); + width: 100%; + margin-top: auto; + margin-bottom: auto; + border: none; + padding: 0 calc(${designUnit} * 2px + 1px); + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + .start, + .end { + display: flex; + margin: auto; + fill: currentcolor; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-start: calc(${designUnit} * 2px); + } + .end { + margin-inline-end: calc(${designUnit} * 2px); + } + :host(:hover:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + :host(:active:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + :host(:focus-within:not([disabled])) .root { + border-color: ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js + var TextField2, vsCodeTextField; + var init_text_field3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js"() { + init_esm2(); + init_text_field_styles(); + TextField2 = class extends TextField { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text field"); + } + } + }; + vsCodeTextField = TextField2.compose({ + baseName: "text-field", + template: textFieldTemplate, + styles: textFieldStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js + var allComponents; + var init_custom_elements = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js"() { + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + allComponents = { + vsCodeBadge, + vsCodeButton, + vsCodeCheckbox, + vsCodeDataGrid, + vsCodeDataGridCell, + vsCodeDataGridRow, + vsCodeDivider, + vsCodeDropdown, + vsCodeLink, + vsCodeOption, + vsCodePanels, + vsCodePanelTab, + vsCodePanelView, + vsCodeProgressRing, + vsCodeRadioGroup, + vsCodeRadio, + vsCodeTag, + vsCodeTextArea, + vsCodeTextField, + register(container, ...rest) { + if (!container) { + return; + } + for (const key in this) { + if (key === "register") { + continue; + } + this[key]().register(container, ...rest); + } + } + }; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/index.js + var dist_exports = {}; + __export(dist_exports, { + Badge: () => Badge2, + Button: () => Button2, + Checkbox: () => Checkbox2, + DataGrid: () => DataGrid2, + DataGridCell: () => DataGridCell2, + DataGridCellTypes: () => DataGridCellTypes, + DataGridRow: () => DataGridRow2, + DataGridRowTypes: () => DataGridRowTypes, + Divider: () => Divider2, + DividerRole: () => DividerRole, + Dropdown: () => Dropdown, + DropdownPosition: () => SelectPosition, + GenerateHeaderOptions: () => GenerateHeaderOptions, + Link: () => Link, + Option: () => Option2, + PanelTab: () => PanelTab, + PanelView: () => PanelView, + Panels: () => Panels, + ProgressRing: () => ProgressRing, + Radio: () => Radio2, + RadioGroup: () => RadioGroup2, + RadioGroupOrientation: () => Orientation, + Tag: () => Tag, + TextArea: () => TextArea2, + TextAreaResize: () => TextAreaResize, + TextField: () => TextField2, + TextFieldType: () => TextFieldType, + allComponents: () => allComponents, + provideVSCodeDesignSystem: () => provideVSCodeDesignSystem, + vsCodeBadge: () => vsCodeBadge, + vsCodeButton: () => vsCodeButton, + vsCodeCheckbox: () => vsCodeCheckbox, + vsCodeDataGrid: () => vsCodeDataGrid, + vsCodeDataGridCell: () => vsCodeDataGridCell, + vsCodeDataGridRow: () => vsCodeDataGridRow, + vsCodeDivider: () => vsCodeDivider, + vsCodeDropdown: () => vsCodeDropdown, + vsCodeLink: () => vsCodeLink, + vsCodeOption: () => vsCodeOption, + vsCodePanelTab: () => vsCodePanelTab, + vsCodePanelView: () => vsCodePanelView, + vsCodePanels: () => vsCodePanels, + vsCodeProgressRing: () => vsCodeProgressRing, + vsCodeRadio: () => vsCodeRadio, + vsCodeRadioGroup: () => vsCodeRadioGroup, + vsCodeTag: () => vsCodeTag, + vsCodeTextArea: () => vsCodeTextArea, + vsCodeTextField: () => vsCodeTextField + }); + var init_dist3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/index.js"() { + init_vscode_design_system(); + init_custom_elements(); + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + } + }); + + // src/webview/shared/buttonConfig.ts + var BUTTONS = { + "btn-refresh": { + id: "btn-refresh", + label: "\u{1F504} Refresh", + appearance: "primary" + }, + "btn-details": { + id: "btn-details", + label: "\u{1F916} Details" + }, + "btn-chart": { + id: "btn-chart", + label: "\u{1F4C8} Chart" + }, + "btn-usage": { + id: "btn-usage", + label: "\u{1F4CA} Usage Analysis" + }, + "btn-diagnostics": { + id: "btn-diagnostics", + label: "\u{1F50D} Diagnostics" + }, + "btn-maturity": { + id: "btn-maturity", + label: "\u{1F3AF} Fluency Score" + }, + "btn-dashboard": { + id: "btn-dashboard", + label: "\u{1F4CA} Team Dashboard" + }, + "btn-level-viewer": { + id: "btn-level-viewer", + label: "\u{1F50D} Level Viewer" + }, + "btn-environmental": { + id: "btn-environmental", + label: "\u{1F33F} Environmental Impact" + } + }; + function buttonHtml(id) { + const config = BUTTONS[id]; + const appearance = config.appearance ? ` appearance="${config.appearance}"` : ""; + return `${config.label}`; + } + + // src/webview/shared/theme.css + var theme_default = '/**\n * Shared theme variables for all webview panels\n * Uses VS Code theme tokens for automatic light/dark theme support\n */\n\n:root {\n /* VS Code base colors */\n --bg-primary: var(--vscode-editor-background);\n --bg-secondary: var(--vscode-sideBar-background);\n --bg-tertiary: var(--vscode-editorWidget-background);\n --text-primary: var(--vscode-editor-foreground);\n --text-secondary: var(--vscode-descriptionForeground);\n --text-muted: var(--vscode-disabledForeground);\n --border-color: var(--vscode-panel-border);\n --border-subtle: var(--vscode-widget-border);\n \n /* Button colors */\n --button-bg: var(--vscode-button-background);\n --button-fg: var(--vscode-button-foreground);\n --button-hover-bg: var(--vscode-button-hoverBackground);\n --button-secondary-bg: var(--vscode-button-secondaryBackground);\n --button-secondary-fg: var(--vscode-button-secondaryForeground);\n --button-secondary-hover-bg: var(--vscode-button-secondaryHoverBackground);\n \n /* Input colors */\n --input-bg: var(--vscode-input-background);\n --input-fg: var(--vscode-input-foreground);\n --input-border: var(--vscode-input-border);\n \n /* List/card colors */\n --list-hover-bg: var(--vscode-list-hoverBackground);\n --list-active-bg: var(--vscode-list-activeSelectionBackground);\n --list-active-fg: var(--vscode-list-activeSelectionForeground);\n --list-inactive-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Alternating row colors for better readability */\n --row-alternate-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Badge colors */\n --badge-bg: var(--vscode-badge-background);\n --badge-fg: var(--vscode-badge-foreground);\n \n /* Focus colors */\n --focus-border: var(--vscode-focusBorder);\n \n /* Link colors */\n --link-color: var(--vscode-textLink-foreground);\n --link-hover-color: var(--vscode-textLink-activeForeground);\n \n /* Status colors */\n --error-fg: var(--vscode-errorForeground);\n --warning-fg: var(--vscode-editorWarning-foreground);\n --success-fg: var(--vscode-terminal-ansiGreen);\n \n /* Shadow for cards */\n --shadow-color: rgb(0, 0, 0, 0.16);\n --shadow-hover-color: rgb(0, 0, 0, 0.24);\n}\n\n/* Light theme adjustments */\nbody[data-vscode-theme-kind="vscode-light"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --shadow-color: rgb(0, 0, 0, 0.08);\n --shadow-hover-color: rgb(0, 0, 0, 0.12);\n}\n\n/* High contrast mode adjustments */\nbody[data-vscode-theme-kind="vscode-high-contrast"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --border-color: var(--vscode-contrastBorder);\n --border-subtle: var(--vscode-contrastBorder);\n}\n'; + + // src/webview/maturity/styles.css + var styles_default = `* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + background: var(--bg-primary); + color: var(--text-primary); + padding: 16px; + line-height: 1.5; + min-width: 320px; +} + +.container { + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 10px; + padding: 16px; + box-shadow: 0 4px 10px var(--shadow-color); + max-width: 1200px; + margin: 0 auto; +} + +.header { + display: flex; + justify-content: space-between; + align-items: center; + gap: 12px; + margin-bottom: 14px; + padding-bottom: 4px; +} + +.header-left { + display: flex; + align-items: center; + gap: 8px; +} + +.header-icon { + font-size: 20px; +} + +.header-title { + font-size: 16px; + font-weight: 700; + color: var(--text-primary); + letter-spacing: 0.2px; +} + +.button-row { + display: flex; + flex-wrap: wrap; + gap: 8px; +} + +/* Overall stage banner */ +.stage-banner { + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 10px; + padding: 20px 24px; + margin-bottom: 16px; + text-align: center; +} + +.stage-banner-label { + font-size: 12px; + color: var(--text-secondary); + text-transform: uppercase; + letter-spacing: 1.5px; + margin-bottom: 6px; +} + +.stage-banner-title { + font-size: 24px; + font-weight: 800; + margin-bottom: 4px; +} + +.stage-banner-subtitle { + font-size: 13px; + color: var(--text-secondary); +} + +/* Stage accent colors \u2014 dark theme defaults */ +.stage-1 { color: #93c5fd; } +.stage-2 { color: #6ee7b7; } +.stage-3 { color: #3b82f6; } +.stage-4 { color: #10b981; } + +/* Light theme: darken pale stage colors for readable contrast */ +body[data-vscode-theme-kind="vscode-light"] .stage-1, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .stage-1 { color: #1d6fa4 !important; } +body[data-vscode-theme-kind="vscode-light"] .stage-2, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .stage-2 { color: #059669 !important; } +body[data-vscode-theme-kind="vscode-light"] .stage-3, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .stage-3 { color: #2563eb !important; } +body[data-vscode-theme-kind="vscode-light"] .stage-4, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .stage-4 { color: #059669 !important; } + +/* Radar / spider chart container */ +.radar-wrapper { + display: flex; + gap: 20px; + margin-bottom: 20px; + align-items: flex-start; +} + +.radar-container { + flex: 1; + display: flex; + justify-content: center; +} + +.radar-svg { + max-width: 650px; + width: 100%; + height: auto; +} + +/* SVG radar chart elements \u2014 use CSS fill/stroke so theme variables apply */ +.radar-svg .radar-label { + fill: var(--text-primary); +} + +.radar-svg .radar-ring-label { + fill: var(--text-muted); +} + +.radar-svg .radar-grid { + stroke: var(--border-subtle); +} + +.radar-svg .radar-dot { + stroke: var(--bg-primary); +} + +/* Legend panel */ +.legend-panel { + background: var(--bg-tertiary); + border: 1px solid var(--border-subtle); + border-radius: 8px; + padding: 16px; + min-width: 280px; + max-width: 320px; + flex-shrink: 0; +} + +.legend-title { + font-size: 14px; + font-weight: 700; + color: var(--text-primary); + margin-bottom: 14px; + padding-bottom: 10px; + border-bottom: 1px solid var(--border-subtle); +} + +.legend-item { + display: flex; + gap: 12px; + margin-bottom: 14px; + align-items: flex-start; +} + +.legend-item:last-child { + margin-bottom: 0; +} + +.legend-dot { + width: 14px; + height: 14px; + border-radius: 50%; + flex-shrink: 0; + margin-top: 2px; + border: 2px solid var(--bg-primary); +} + +.stage-1-dot { background: #93c5fd; } +.stage-2-dot { background: #6ee7b7; } +.stage-3-dot { background: #3b82f6; } +.stage-4-dot { background: #10b981; } + +.legend-content { + flex: 1; +} + +.legend-label { + font-size: 12px; + font-weight: 600; + color: var(--text-primary); + margin-bottom: 2px; +} + +.legend-desc { + font-size: 11px; + color: var(--text-muted); + line-height: 1.4; +} + +/* Category cards grid */ +.category-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); + gap: 14px; + margin-bottom: 16px; +} + +.category-card { + background: var(--bg-tertiary); + border: 1px solid var(--border-subtle); + border-radius: 8px; + padding: 14px; + box-shadow: 0 2px 6px var(--shadow-color); +} + +.category-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; +} + +.category-name { + font-size: 14px; + font-weight: 700; + color: var(--text-primary); +} + +.category-stage-badge { + font-size: 11px; + font-weight: 700; + padding: 3px 10px; + border-radius: 12px; + letter-spacing: 0.5px; +} + +/* Dark theme badge backgrounds */ +.badge-1 { + background: rgba(147, 197, 253, 0.15); + color: #93c5fd; + border: 1px solid rgba(147, 197, 253, 0.4); +} + +.badge-2 { + background: rgba(110, 231, 183, 0.15); + color: #6ee7b7; + border: 1px solid rgba(110, 231, 183, 0.4); +} + +.badge-3 { + background: rgba(59, 130, 246, 0.15); + color: #3b82f6; + border: 1px solid rgba(59, 130, 246, 0.4); +} + +.badge-4 { + background: rgba(16, 185, 129, 0.15); + color: #10b981; + border: 1px solid rgba(16, 185, 129, 0.4); +} + +/* Light theme badge overrides \u2014 use darker text for contrast */ +body[data-vscode-theme-kind="vscode-light"] .badge-1, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .badge-1 { color: #1d6fa4; } +body[data-vscode-theme-kind="vscode-light"] .badge-2, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .badge-2 { color: #059669; } +body[data-vscode-theme-kind="vscode-light"] .badge-3, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .badge-3 { color: #2563eb; } +body[data-vscode-theme-kind="vscode-light"] .badge-4, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .badge-4 { color: #059669; } + +.category-stage-label { + font-size: 11px; + color: var(--text-muted); + margin-bottom: 10px; +} + +/* Progress bar for category */ +.category-progress { + background: var(--row-alternate-bg); + height: 6px; + border-radius: 3px; + overflow: hidden; + margin-bottom: 12px; +} + +.category-progress-fill { + height: 100%; + border-radius: 3px; + transition: width 0.4s ease; +} + +/* Evidence list */ +.evidence-list { + list-style: none; + padding: 0; +} + +.evidence-item { + display: flex; + align-items: flex-start; + gap: 8px; + padding: 4px 0; + font-size: 12px; + color: var(--text-secondary); +} + +.evidence-icon { + flex-shrink: 0; + width: 16px; + text-align: center; +} + +/* Tips section */ +.tips-section { + background: var(--bg-secondary); + border: 1px solid var(--border-subtle); + border-radius: 8px; + padding: 14px; + margin-bottom: 16px; +} + +.tips-title { + font-size: 14px; + font-weight: 700; + color: var(--text-primary); + margin-bottom: 10px; + display: flex; + align-items: center; + gap: 6px; +} + +.tip-item { + background: var(--list-hover-bg); + border: 1px solid var(--border-subtle); + border-radius: 6px; + padding: 10px 12px; + margin-bottom: 8px; + font-size: 12px; + color: var(--text-primary); +} + +.tip-item strong { + color: var(--link-color); +} + +.tip-item a { + color: var(--link-color); + text-decoration: none; + border-bottom: 1px solid transparent; + transition: border-color 0.2s ease; +} + +.tip-item a:hover { + border-bottom-color: var(--link-color); +} + +/* MCP Discovery Button */ +.mcp-discover-btn { + width: 100%; + background: var(--button-bg); + border: 1px solid var(--button-bg); + color: var(--button-fg); + padding: 10px 14px; + border-radius: 6px; + font-size: 12px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease; + display: flex; + align-items: center; + justify-content: center; + gap: 6px; +} + +.mcp-discover-btn:hover { + background: var(--button-hover-bg); + transform: translateY(-1px); + box-shadow: 0 4px 8px var(--shadow-color); +} + +.mcp-discover-btn:active { + transform: translateY(0); +} + +.dismiss-tips-btn { + background: transparent; + border: 1px solid var(--border-subtle); + color: var(--text-muted); + padding: 2px 6px; + border-radius: 4px; + font-size: 11px; + cursor: pointer; + transition: all 0.2s ease; + line-height: 1; +} + +.dismiss-tips-btn:hover { + background: var(--list-hover-bg); + border-color: var(--border-color); + color: var(--text-secondary); +} + +.dismiss-tips-btn:active { + transform: scale(0.95); +} + +.info-box { + background: var(--bg-tertiary); + border: 1px solid var(--border-subtle); + border-radius: 6px; + padding: 12px; + margin-bottom: 16px; + font-size: 12px; + color: var(--text-secondary); +} + +.info-box-title { + font-weight: 600; + color: var(--text-primary); + margin-bottom: 6px; +} + +.footer { + margin-top: 6px; + padding-top: 12px; + border-top: 1px solid var(--border-subtle); + font-size: 11px; + color: var(--text-muted); + display: flex; + justify-content: space-between; + align-items: center; + gap: 16px; +} + +.footer-info { + flex: 1; +} + +.reset-tips-btn { + display: inline-block; + padding: 4px 10px; + background: var(--button-secondary-bg); + border: 1px solid var(--border-color); + color: var(--button-secondary-fg); + border-radius: 4px; + font-size: 10px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease; + white-space: nowrap; + vertical-align: middle; +} + +.reset-tips-btn:hover { + background: var(--button-secondary-hover-bg); + transform: translateY(-1px); + box-shadow: 0 2px 6px var(--shadow-color); +} + +.reset-tips-btn:active { + transform: translateY(0); +} + +.inline-action-btn { + display: inline-block; + padding: 2px 8px; + background: var(--button-secondary-bg); + border: 1px solid var(--border-color); + color: var(--button-secondary-fg); + border-radius: 4px; + font-size: 11px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease; + white-space: nowrap; + vertical-align: middle; +} + +.inline-action-btn:hover { + background: var(--button-secondary-hover-bg); + transform: translateY(-1px); + box-shadow: 0 2px 6px var(--shadow-color); +} + +.inline-action-btn:active { + transform: translateY(0); +} + +/* Beta warning footer */ +.beta-footer { + display: flex; + align-items: center; + gap: 10px; + margin-top: 12px; + padding: 12px 14px; + background: rgba(245, 158, 11, 0.1); + border: 1px solid rgba(245, 158, 11, 0.4); + border-radius: 6px; + font-size: 12px; + color: var(--warning-fg); +} + +/* Share to social media section */ +.share-section { + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 8px; + padding: 18px; + margin-top: 16px; + margin-bottom: 16px; +} + +.share-header { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 8px; +} + +.share-icon { + font-size: 20px; +} + +.share-title { + font-size: 16px; + font-weight: 700; + color: var(--text-primary); +} + +.share-description { + font-size: 12px; + color: var(--text-secondary); + margin-bottom: 14px; + line-height: 1.5; +} + +.share-buttons { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); + gap: 10px; +} + +.share-btn { + display: flex; + align-items: center; + justify-content: center; + gap: 8px; + padding: 12px 16px; + border-radius: 6px; + font-size: 13px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease; + border: 1px solid; + background: var(--button-secondary-bg); +} + +.share-btn-icon { + font-size: 16px; + flex-shrink: 0; +} + +.share-btn-linkedin { + color: #0a66c2; + border-color: rgba(10, 102, 194, 0.5); +} + +.share-btn-linkedin:hover { + background: rgba(10, 102, 194, 0.12); + border-color: #0a66c2; + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(10, 102, 194, 0.25); +} + +.share-btn-bluesky { + color: #1285fe; + border-color: rgba(18, 133, 254, 0.5); +} + +.share-btn-bluesky:hover { + background: rgba(18, 133, 254, 0.12); + border-color: #1285fe; + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(18, 133, 254, 0.25); +} + +.share-btn-mastodon { + color: #6364ff; + border-color: rgba(99, 100, 255, 0.5); +} + +.share-btn-mastodon:hover { + background: rgba(99, 100, 255, 0.12); + border-color: #6364ff; + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(99, 100, 255, 0.25); +} + +.share-btn-download { + color: #10b981; + border-color: rgba(16, 185, 129, 0.5); +} + +.share-btn-download:hover { + background: rgba(16, 185, 129, 0.12); + border-color: #10b981; + transform: translateY(-2px); + box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25); +} + +/* Light theme overrides for share button text colors */ +body[data-vscode-theme-kind="vscode-light"] .share-btn-linkedin, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .share-btn-linkedin { color: #0a66c2; } +body[data-vscode-theme-kind="vscode-light"] .share-btn-bluesky, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .share-btn-bluesky { color: #0369a1; } +body[data-vscode-theme-kind="vscode-light"] .share-btn-mastodon, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .share-btn-mastodon { color: #4f46e5; } +body[data-vscode-theme-kind="vscode-light"] .share-btn-download, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .share-btn-download { color: #059669; } + +.export-dropdown-container { + position: relative; +} + +.dropdown-arrow { + font-size: 10px; + margin-left: 4px; + transition: transform 0.2s ease; +} + +.export-dropdown-menu { + position: absolute; + top: 100%; + left: 0; + right: 0; + margin-top: 4px; + background: var(--bg-secondary); + border: 1px solid var(--border-color); + border-radius: 6px; + box-shadow: 0 4px 12px var(--shadow-color); + z-index: 1000; + overflow: hidden; +} + +.export-menu-item { + display: flex; + align-items: center; + gap: 8px; + width: 100%; + padding: 12px 16px; + border: none; + background: transparent; + color: var(--text-primary); + font-size: 13px; + font-weight: 600; + cursor: pointer; + transition: background 0.2s ease; + text-align: left; +} + +.export-menu-item:hover { + background: var(--list-hover-bg); +} + +.export-menu-item:active { + background: var(--list-active-bg); +} + +.export-menu-icon { + font-size: 16px; + flex-shrink: 0; +} + +.share-btn:active { + transform: translateY(0); +} + +.beta-footer-icon { + flex-shrink: 0; + font-size: 16px; +} + +.beta-footer-content { + flex: 1; + line-height: 1.5; +} + +.beta-link { + color: var(--warning-fg); + text-decoration: underline; +} + +.beta-link:hover { + color: var(--warning-fg); + opacity: 0.8; +} + +.share-issue-btn { + flex-shrink: 0; + background: rgba(245, 158, 11, 0.1); + border: 1px solid var(--warning-fg); + color: var(--warning-fg); + padding: 6px 14px; + border-radius: 6px; + font-size: 12px; + font-weight: 600; + cursor: pointer; + transition: all 0.2s ease; + white-space: nowrap; +} + +.share-issue-btn:hover { + background: rgba(245, 158, 11, 0.2); + transform: translateY(-1px); + box-shadow: 0 4px 8px rgba(245, 158, 11, 0.2); +} + +.share-issue-btn:active { + transform: translateY(0); +} + +@media (width <= 768px) { + .category-grid { + grid-template-columns: 1fr; + } + + .radar-wrapper { + flex-direction: column; + } + + .legend-panel { + max-width: 100%; + min-width: 0; + } + + /* Allow chart to be larger on small screens since legend is stacked below */ + .radar-svg { + max-width: 100%; + } +} + +/* Demo mode controls */ +.demo-panel { + background: var(--bg-tertiary); + border: 1px solid var(--border-color); + border-radius: 8px; + padding: 14px; + margin-bottom: 16px; +} + +.demo-panel-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 12px; + padding-bottom: 10px; + border-bottom: 1px solid var(--border-subtle); +} + +.demo-panel-header.demo-collapsed { + margin-bottom: 0; + padding-bottom: 0; + border-bottom: none; +} + +.demo-panel-title { + font-size: 13px; + font-weight: 700; + color: var(--link-color); + display: flex; + align-items: center; + gap: 8px; +} + +.demo-expand-btn { + background: transparent; + border: none; + color: var(--link-color); + font-size: 12px; + cursor: pointer; + padding: 2px 4px; + transition: transform 0.2s ease; + line-height: 1; +} + +.demo-expand-btn:hover { + color: var(--link-hover-color); + transform: scale(1.1); +} + +.demo-hidden { + display: none !important; +} + +.demo-panel-actions { + display: flex; + gap: 8px; +} + +.demo-btn { + padding: 4px 12px; + border-radius: 4px; + font-size: 11px; + font-weight: 600; + cursor: pointer; + border: 1px solid; + transition: all 0.2s ease; +} + +.demo-btn-toggle { + background: var(--button-bg); + border-color: var(--button-bg); + color: var(--button-fg); +} + +.demo-btn-toggle:hover { + background: var(--button-hover-bg); +} + +.demo-btn-reset { + background: transparent; + border-color: var(--border-subtle); + color: var(--text-muted); +} + +.demo-btn-reset:hover { + background: var(--list-hover-bg); + border-color: var(--border-color); + color: var(--text-secondary); +} + +.demo-sliders { + display: flex; + flex-direction: column; + gap: 8px; +} + +.demo-sliders.demo-disabled { + opacity: 0.45; + pointer-events: none; +} + +.demo-slider-row { + display: flex; + align-items: center; + gap: 12px; +} + +.demo-slider-label { + font-size: 12px; + color: var(--text-secondary); + min-width: 160px; + flex-shrink: 0; +} + +.demo-step-group { + display: flex; + gap: 0; + border-radius: 6px; + overflow: hidden; + border: 1px solid var(--border-subtle); +} + +.demo-step-btn { + width: 36px; + height: 28px; + border: none; + background: var(--bg-secondary); + color: var(--text-muted); + font-size: 12px; + font-weight: 700; + cursor: pointer; + transition: all 0.15s ease; + border-right: 1px solid var(--border-subtle); +} + +.demo-step-btn:last-child { + border-right: none; +} + +.demo-step-btn:hover { + background: var(--list-hover-bg); + color: var(--text-secondary); +} + +.demo-step-active.demo-step-1 { background: rgba(147, 197, 253, 0.2); color: #93c5fd; } +.demo-step-active.demo-step-2 { background: rgba(110, 231, 183, 0.2); color: #6ee7b7; } +.demo-step-active.demo-step-3 { background: rgba(59, 130, 246, 0.2); color: #3b82f6; } +.demo-step-active.demo-step-4 { background: rgba(16, 185, 129, 0.2); color: #10b981; } + +body[data-vscode-theme-kind="vscode-light"] .demo-step-active.demo-step-1, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .demo-step-active.demo-step-1 { color: #1d6fa4; } +body[data-vscode-theme-kind="vscode-light"] .demo-step-active.demo-step-2, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .demo-step-active.demo-step-2 { color: #059669; } +body[data-vscode-theme-kind="vscode-light"] .demo-step-active.demo-step-3, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .demo-step-active.demo-step-3 { color: #2563eb; } +body[data-vscode-theme-kind="vscode-light"] .demo-step-active.demo-step-4, +body[data-vscode-theme-kind="vscode-high-contrast-light"] .demo-step-active.demo-step-4 { color: #059669; } + +.demo-slider-value { + font-size: 11px; + font-weight: 700; + padding: 2px 8px; + border-radius: 10px; + min-width: 180px; + text-align: center; + flex-shrink: 0; +} + +/* Demo mode card highlight */ +.demo-card-highlight { + border-color: var(--border-color) !important; + box-shadow: 0 0 0 1px var(--focus-border), 0 2px 8px var(--shadow-color) !important; +} + +.demo-card-description { + font-size: 12px; + color: var(--text-secondary); + margin-bottom: 10px; + font-style: italic; +} + +.demo-section-label { + font-size: 11px; + font-weight: 600; + color: var(--text-primary); + margin-bottom: 6px; +} + +`; + + // src/webview/maturity/main.ts + var vscode = acquireVsCodeApi(); + var initialData = window.__INITIAL_MATURITY__; + var demoModeActive = false; + var demoStageOverrides = []; + var demoPanelExpanded = false; + var STAGE_LABELS = { + 1: "Stage 1: Copilot Skeptic", + 2: "Stage 2: Copilot Explorer", + 3: "Stage 3: Copilot Collaborator", + 4: "Stage 4: Copilot Strategist" + }; + var STAGE_DESCRIPTIONS = { + 1: "Rarely uses Copilot or uses only basic features", + 2: "Exploring Copilot capabilities with occasional use", + 3: "Regular, purposeful use across multiple features", + 4: "Strategic, advanced use leveraging the full Copilot ecosystem" + }; + function renderRadarChart(categories) { + const cx = 325, cy = 325, maxR = 150; + const n = categories.length; + const angleStep = 2 * Math.PI / n; + const startAngle = -Math.PI / 2; + const rings = [1, 2, 3, 4].map((level) => { + const r = level / 4 * maxR; + const points = Array.from({ length: n }, (_, i) => { + const angle = startAngle + i * angleStep; + return `${cx + r * Math.cos(angle)},${cy + r * Math.sin(angle)}`; + }).join(" "); + return ``; + }).join(""); + const axes = Array.from({ length: n }, (_, i) => { + const angle = startAngle + i * angleStep; + const x2 = cx + maxR * Math.cos(angle); + const y2 = cy + maxR * Math.sin(angle); + return ``; + }).join(""); + const dataPoints = categories.map((cat, i) => { + const r = cat.stage / 4 * maxR; + const angle = startAngle + i * angleStep; + return `${cx + r * Math.cos(angle)},${cy + r * Math.sin(angle)}`; + }).join(" "); + const labels = categories.map((cat, i) => { + const angle = startAngle + i * angleStep; + const labelR = maxR + 35; + const x = cx + labelR * Math.cos(angle); + const y = cy + labelR * Math.sin(angle); + let anchor = "middle"; + if (Math.cos(angle) < -0.3) { + anchor = "end"; + } else if (Math.cos(angle) > 0.3) { + anchor = "start"; + } + return `${cat.icon} ${cat.category}`; + }).join(""); + const dots = categories.map((cat, i) => { + const r = cat.stage / 4 * maxR; + const angle = startAngle + i * angleStep; + const x = cx + r * Math.cos(angle); + const y = cy + r * Math.sin(angle); + const color = stageColor(cat.stage); + return ``; + }).join(""); + const ringLabels = [1, 2, 3, 4].map((level) => { + const r = level / 4 * maxR; + return `${level}`; + }).join(""); + return ` + ${rings} + ${axes} + + ${dots} + ${labels} + ${ringLabels} + `; + } + function stageColor(stage) { + switch (stage) { + case 1: + return "#93c5fd"; + case 2: + return "#6ee7b7"; + case 3: + return "#3b82f6"; + case 4: + return "#10b981"; + default: + return "#666"; + } + } + function escapeHtml(text) { + return text.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); + } + function markdownToHtml(text) { + let escaped = escapeHtml(text); + escaped = escaped.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'); + return escaped; + } + function renderDemoControls(categories) { + const sliders = categories.map((cat, i) => { + const currentStage = demoModeActive ? demoStageOverrides[i] : cat.stage; + const stageButtons = [1, 2, 3, 4].map( + (s) => `` + ).join(""); + return ` +
+ +
${stageButtons}
+ ${escapeHtml(STAGE_LABELS[currentStage] || "")} +
+ `; + }).join(""); + return ` +
+
+
+ + \u{1F41B} Demo Mode \u2014 Override Spider Chart +
+
+ + +
+
+
+ ${sliders} +
+
+ `; + } + function wireDemoControls(data) { + if (demoStageOverrides.length === 0) { + demoStageOverrides = data.categories.map((c) => c.stage); + } + document.getElementById("demo-expand-toggle")?.addEventListener("click", () => { + demoPanelExpanded = !demoPanelExpanded; + renderLayout(data); + }); + document.getElementById("demo-toggle")?.addEventListener("click", () => { + demoModeActive = !demoModeActive; + renderLayout(data); + }); + document.getElementById("demo-reset")?.addEventListener("click", () => { + demoStageOverrides = data.categories.map((c) => c.stage); + demoModeActive = false; + renderLayout(data); + }); + document.querySelectorAll(".demo-step-btn").forEach((btn) => { + btn.addEventListener("click", (e) => { + const target = e.currentTarget; + const idx = parseInt(target.getAttribute("data-index") || "0", 10); + const stage = parseInt(target.getAttribute("data-stage") || "1", 10); + demoStageOverrides[idx] = stage; + if (demoModeActive) { + renderLayout(data); + } + }); + }); + } + function renderLayout(data) { + const root = document.getElementById("root"); + if (!root) { + return; + } + const dismissedTips = data.dismissedTips || []; + const useDemoCards = demoModeActive && data.fluencyLevels; + const categoryCards = data.categories.map((cat, catIdx) => { + const demoStage = demoStageOverrides[catIdx] ?? cat.stage; + const displayStage = useDemoCards ? demoStage : cat.stage; + const progressPct = displayStage / 4 * 100; + const color = stageColor(displayStage); + if (useDemoCards && data.fluencyLevels) { + const levelData = data.fluencyLevels.find((l) => l.category === cat.category); + const stageInfo = levelData?.levels.find((l) => l.stage === demoStage); + const thresholdsHtml = stageInfo && stageInfo.thresholds.length > 0 ? stageInfo.thresholds.map( + (t) => `
  • \u{1F3AF}${escapeHtml(t)}
  • ` + ).join("") : '
  • -No thresholds defined
  • '; + const tipsHtml2 = stageInfo && stageInfo.tips.length > 0 ? stageInfo.tips.map((t) => `
    ${markdownToHtml(t)}
    `).join("") : '
    No tips for this stage
    '; + return ` +
    +
    + ${cat.icon} ${escapeHtml(cat.category)} + Stage ${displayStage} +
    +
    ${escapeHtml(STAGE_LABELS[displayStage] || "Unknown")}
    +
    ${escapeHtml(stageInfo?.description || "")}
    +
    +
    +
    + +
      ${thresholdsHtml}
    +
    + + ${tipsHtml2} +
    +
    `; + } + const evidenceHtml = cat.evidence.map( + (e) => `
  • ${escapeHtml(e)}
  • ` + ).join(""); + const tipsHtml = cat.tips.length > 0 ? cat.tips.map((t) => { + if (t.includes("\n")) { + const lines = t.split("\n").filter((line) => line.trim()); + const summary = lines[0]; + const hasHeader = lines.length > 1 && lines[1].toLowerCase().includes("top repos"); + if (hasHeader && lines.length > 2) { + const header = lines[1]; + const listItems = lines.slice(2).map((item) => `
  • ${markdownToHtml(item)}
  • `).join(""); + return `
    ${markdownToHtml(summary)}
    ${markdownToHtml(header)}
      ${listItems}
    `; + } else { + return `
    ${lines.map((line) => markdownToHtml(line)).join("
    ")}
    `; + } + } else { + return `
    ${markdownToHtml(t)}
    `; + } + }).join("") : `
    No specific suggestions - you're doing great!
    `; + const tipsAreDismissed = dismissedTips.includes(cat.category); + const mcpButton = cat.category === "Tool Usage" ? ` +
    + +
    + ` : ""; + return ` +
    +
    + ${cat.icon} ${escapeHtml(cat.category)} + Stage ${cat.stage} +
    +
    ${escapeHtml(STAGE_LABELS[cat.stage] || "Unknown")}
    +
    +
    +
    +
      ${evidenceHtml || '
    • -No significant activity detected
    • '}
    + ${!tipsAreDismissed && cat.tips.length > 0 ? ` +
    +
    +
    \u{1F4A1} Next steps to level up:
    + +
    + ${tipsHtml} +
    + ` : ""}${mcpButton}
    `; + }).join(""); + root.innerHTML = ` + + +
    +
    +
    + \u{1F3AF} + Copilot Fluency Score +
    +
    + ${buttonHtml("btn-refresh")} + ${buttonHtml("btn-details")} + ${buttonHtml("btn-chart")} + ${buttonHtml("btn-usage")} + ${buttonHtml("btn-environmental")} + ${buttonHtml("btn-diagnostics")} + ${data.backendConfigured ? buttonHtml("btn-dashboard") : ""} +
    +
    + +
    +
    \u{1F4CB} About This Dashboard
    +
    + This dashboard maps your GitHub Copilot usage patterns from the last 30 days to a maturity model with 4 stages across 6 categories. + It helps you understand which Copilot capabilities you already use and suggests areas to explore for greater productivity. +

    + \u{1F4D6} Read the full scoring rules to learn how each category and stage is calculated. +

    + Note: Scores are based on data from session log files. Some features (e.g., inline suggestion acceptance) cannot be tracked via logs. +
    +
    + + +
    +
    Overall Copilot Fluency
    +
    ${escapeHtml(data.overallLabel)}
    +
    ${escapeHtml(STAGE_DESCRIPTIONS[data.overallStage] || "")}
    +
    + + + ${data.isDebugMode ? renderDemoControls(data.categories) : ""} + + +
    +
    + ${renderRadarChart(demoModeActive ? data.categories.map((c, i) => ({ ...c, stage: demoStageOverrides[i] ?? c.stage })) : data.categories)} +
    +
    +
    Stage Reference
    +
    +
    +
    +
    Stage 1: Copilot Skeptic
    +
    Rarely uses Copilot or uses only basic features
    +
    +
    +
    +
    +
    +
    Stage 2: Copilot Explorer
    +
    Exploring Copilot capabilities with occasional use
    +
    +
    +
    +
    +
    +
    Stage 3: Copilot Collaborator
    +
    Regular, purposeful use across multiple features
    +
    +
    +
    +
    +
    +
    Stage 4: Copilot Strategist
    +
    Strategic, advanced use leveraging the full Copilot ecosystem
    +
    +
    +
    +
    + + +
    + ${categoryCards} +
    + + + + + + + +
    + `; + document.getElementById("btn-refresh")?.addEventListener("click", () => { + vscode.postMessage({ command: "refresh" }); + }); + document.getElementById("btn-level-viewer-inline")?.addEventListener("click", () => { + vscode.postMessage({ command: "showFluencyLevelViewer" }); + }); + document.getElementById("btn-details")?.addEventListener("click", () => { + vscode.postMessage({ command: "showDetails" }); + }); + document.getElementById("btn-chart")?.addEventListener("click", () => { + vscode.postMessage({ command: "showChart" }); + }); + document.getElementById("btn-usage")?.addEventListener("click", () => { + vscode.postMessage({ command: "showUsageAnalysis" }); + }); + document.getElementById("btn-diagnostics")?.addEventListener("click", () => { + vscode.postMessage({ command: "showDiagnostics" }); + }); + document.getElementById("btn-dashboard")?.addEventListener("click", () => { + vscode.postMessage({ command: "showDashboard" }); + }); + document.getElementById("btn-environmental")?.addEventListener("click", () => { + vscode.postMessage({ command: "showEnvironmental" }); + }); + document.getElementById("btn-share-issue")?.addEventListener("click", () => { + vscode.postMessage({ command: "shareToIssue" }); + }); + document.querySelector(".mcp-discover-btn")?.addEventListener("click", () => { + vscode.postMessage({ command: "searchMcpExtensions" }); + }); + document.querySelectorAll(".dismiss-tips-btn").forEach((btn) => { + btn.addEventListener("click", (e) => { + const target = e.target; + const category = target.getAttribute("data-category"); + if (category) { + vscode.postMessage({ command: "dismissTips", category }); + } + }); + }); + document.getElementById("btn-reset-tips")?.addEventListener("click", () => { + vscode.postMessage({ command: "resetDismissedTips" }); + }); + document.getElementById("btn-share-linkedin")?.addEventListener("click", () => { + vscode.postMessage({ command: "shareToLinkedIn" }); + }); + document.getElementById("btn-share-bluesky")?.addEventListener("click", () => { + vscode.postMessage({ command: "shareToBluesky" }); + }); + document.getElementById("btn-share-mastodon")?.addEventListener("click", () => { + vscode.postMessage({ command: "shareToMastodon" }); + }); + const exportToggleBtn = document.getElementById("btn-export-toggle"); + const exportDropdown = document.getElementById("export-dropdown"); + exportToggleBtn?.addEventListener("click", (e) => { + e.stopPropagation(); + if (exportDropdown) { + const isVisible = exportDropdown.style.display === "block"; + exportDropdown.style.display = isVisible ? "none" : "block"; + } + }); + document.addEventListener("click", () => { + if (exportDropdown) { + exportDropdown.style.display = "none"; + } + }); + document.querySelectorAll(".export-menu-item").forEach((item) => { + item.addEventListener("click", (e) => { + e.stopPropagation(); + const target = e.currentTarget; + const exportType = target.getAttribute("data-export-type"); + if (exportDropdown) { + exportDropdown.style.display = "none"; + } + if (exportType === "png") { + handlePngExport(); + } else if (exportType === "pdf") { + void handleScreenshotExport("exportPdf"); + } else if (exportType === "pptx") { + void handleScreenshotExport("exportPptx"); + } + }); + }); + function handlePngExport() { + const svgEl = document.querySelector(".radar-svg"); + if (!svgEl) { + return; + } + const clone = svgEl.cloneNode(true); + clone.setAttribute("width", "1100"); + clone.setAttribute("height", "1100"); + const bg = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + bg.setAttribute("width", "100%"); + bg.setAttribute("height", "100%"); + bg.setAttribute("fill", "#1b1b1e"); + clone.insertBefore(bg, clone.firstChild); + const svgData = new XMLSerializer().serializeToString(clone); + const encodedSvg = "data:image/svg+xml;base64," + btoa(unescape(encodeURIComponent(svgData))); + const img = new Image(); + img.onload = () => { + const canvas = document.createElement("canvas"); + canvas.width = 1100; + canvas.height = 1100; + const ctx = canvas.getContext("2d"); + if (!ctx) { + return; + } + ctx.drawImage(img, 0, 0, 1100, 1100); + const dataUrl = canvas.toDataURL("image/png"); + vscode.postMessage({ command: "saveChartImage", data: dataUrl }); + }; + img.onerror = () => { + vscode.postMessage({ command: "downloadChartImage" }); + }; + img.src = encodedSvg; + } + async function handleScreenshotExport(command) { + const html2canvasModule = await Promise.resolve().then(() => __toESM(require_html2canvas())); + const html2canvas = html2canvasModule.default ?? html2canvasModule; + const images = []; + const stageBanner = document.querySelector(".stage-banner"); + const radarWrapper = document.querySelector(".radar-wrapper"); + const coverContainer = document.createElement("div"); + coverContainer.style.cssText = "position:absolute;left:-9999px;top:0;width:1200px;background:#1b1b1e;padding:24px;border-radius:10px;"; + const titleEl = document.createElement("div"); + titleEl.style.cssText = "text-align:center;margin-bottom:20px;"; + titleEl.innerHTML = `
    GitHub Copilot Fluency Score
    Report · ${(/* @__PURE__ */ new Date()).toLocaleDateString()}
    `; + coverContainer.appendChild(titleEl); + if (stageBanner) { + coverContainer.appendChild(stageBanner.cloneNode(true)); + } + if (radarWrapper) { + coverContainer.appendChild(radarWrapper.cloneNode(true)); + } + document.body.appendChild(coverContainer); + try { + const coverCanvas = await html2canvas(coverContainer, { backgroundColor: "#1b1b1e", scale: 2, useCORS: true }); + images.push({ label: "Cover", dataUrl: coverCanvas.toDataURL("image/png") }); + } finally { + document.body.removeChild(coverContainer); + } + const cards = Array.from(document.querySelectorAll(".category-card")); + for (const card of cards) { + const wrapper = document.createElement("div"); + wrapper.style.cssText = "position:absolute;left:-9999px;top:0;width:900px;background:#1b1b1e;padding:24px;border-radius:10px;"; + wrapper.appendChild(card.cloneNode(true)); + document.body.appendChild(wrapper); + try { + const cardCanvas = await html2canvas(wrapper, { backgroundColor: "#1b1b1e", scale: 2, useCORS: true }); + const nameEl = card.querySelector(".category-name"); + const label = nameEl?.textContent?.trim() || "Category"; + images.push({ label, dataUrl: cardCanvas.toDataURL("image/png") }); + } finally { + document.body.removeChild(wrapper); + } + } + vscode.postMessage({ command, data: images }); + } + if (data.isDebugMode) { + wireDemoControls(data); + } + } + async function bootstrap() { + const { provideVSCodeDesignSystem: provideVSCodeDesignSystem2, vsCodeButton: vsCodeButton2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports)); + provideVSCodeDesignSystem2().register(vsCodeButton2()); + if (!initialData) { + const root = document.getElementById("root"); + if (root) { + root.textContent = "No data available."; + } + return; + } + renderLayout(initialData); + } + void bootstrap(); +})(); +/*! Bundled license information: + +html2canvas/dist/html2canvas.js: + (*! + * html2canvas 1.4.1 + * Copyright (c) 2022 Niklas von Hertzen + * Released under MIT License + *) + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tabbable/dist/index.esm.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=maturity.js.map diff --git a/visualstudio-extension/src/CopilotTokenTracker/webview/usage.js b/visualstudio-extension/src/CopilotTokenTracker/webview/usage.js new file mode 100644 index 00000000..123a225b --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTracker/webview/usage.js @@ -0,0 +1,22003 @@ +"use strict"; +(() => { + var __defProp = Object.defineProperty; + var __getOwnPropNames = Object.getOwnPropertyNames; + var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; + }; + var __export = (target, all2) => { + for (var name in all2) + __defProp(target, name, { get: all2[name], enumerable: true }); + }; + + // node_modules/@microsoft/fast-element/dist/esm/platform.js + function createMetadataLocator() { + const metadataLookup = /* @__PURE__ */ new WeakMap(); + return function(target) { + let metadata = metadataLookup.get(target); + if (metadata === void 0) { + let currentTarget = Reflect.getPrototypeOf(target); + while (metadata === void 0 && currentTarget !== null) { + metadata = metadataLookup.get(currentTarget); + currentTarget = Reflect.getPrototypeOf(currentTarget); + } + metadata = metadata === void 0 ? [] : metadata.slice(0); + metadataLookup.set(target, metadata); + } + return metadata; + }; + } + var $global, propConfig, FAST, emptyArray; + var init_platform = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/platform.js"() { + $global = (function() { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof global !== "undefined") { + return global; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + try { + return new Function("return this")(); + } catch (_a) { + return {}; + } + })(); + if ($global.trustedTypes === void 0) { + $global.trustedTypes = { createPolicy: (n, r) => r }; + } + propConfig = { + configurable: false, + enumerable: false, + writable: false + }; + if ($global.FAST === void 0) { + Reflect.defineProperty($global, "FAST", Object.assign({ value: /* @__PURE__ */ Object.create(null) }, propConfig)); + } + FAST = $global.FAST; + if (FAST.getById === void 0) { + const storage = /* @__PURE__ */ Object.create(null); + Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) { + let found = storage[id]; + if (found === void 0) { + found = initialize ? storage[id] = initialize() : null; + } + return found; + } }, propConfig)); + } + emptyArray = Object.freeze([]); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/dom.js + var updateQueue, fastHTMLPolicy, htmlPolicy, marker, _interpolationStart, _interpolationEnd, DOM; + var init_dom = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/dom.js"() { + init_platform(); + updateQueue = $global.FAST.getById(1, () => { + const tasks = []; + const pendingErrors = []; + function throwFirstError() { + if (pendingErrors.length) { + throw pendingErrors.shift(); + } + } + function tryRunTask(task) { + try { + task.call(); + } catch (error) { + pendingErrors.push(error); + setTimeout(throwFirstError, 0); + } + } + function process() { + const capacity = 1024; + let index = 0; + while (index < tasks.length) { + tryRunTask(tasks[index]); + index++; + if (index > capacity) { + for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) { + tasks[scan] = tasks[scan + index]; + } + tasks.length -= index; + index = 0; + } + } + tasks.length = 0; + } + function enqueue(callable) { + if (tasks.length < 1) { + $global.requestAnimationFrame(process); + } + tasks.push(callable); + } + return Object.freeze({ + enqueue, + process + }); + }); + fastHTMLPolicy = $global.trustedTypes.createPolicy("fast-html", { + createHTML: (html2) => html2 + }); + htmlPolicy = fastHTMLPolicy; + marker = `fast-${Math.random().toString(36).substring(2, 8)}`; + _interpolationStart = `${marker}{`; + _interpolationEnd = `}${marker}`; + DOM = Object.freeze({ + /** + * Indicates whether the DOM supports the adoptedStyleSheets feature. + */ + supportsAdoptedStyleSheets: Array.isArray(document.adoptedStyleSheets) && "replace" in CSSStyleSheet.prototype, + /** + * Sets the HTML trusted types policy used by the templating engine. + * @param policy - The policy to set for HTML. + * @remarks + * This API can only be called once, for security reasons. It should be + * called by the application developer at the start of their program. + */ + setHTMLPolicy(policy) { + if (htmlPolicy !== fastHTMLPolicy) { + throw new Error("The HTML policy can only be set once."); + } + htmlPolicy = policy; + }, + /** + * Turns a string into trusted HTML using the configured trusted types policy. + * @param html - The string to turn into trusted HTML. + * @remarks + * Used internally by the template engine when creating templates + * and setting innerHTML. + */ + createHTML(html2) { + return htmlPolicy.createHTML(html2); + }, + /** + * Determines if the provided node is a template marker used by the runtime. + * @param node - The node to test. + */ + isMarker(node) { + return node && node.nodeType === 8 && node.data.startsWith(marker); + }, + /** + * Given a marker node, extract the {@link HTMLDirective} index from the placeholder. + * @param node - The marker node to extract the index from. + */ + extractDirectiveIndexFromMarker(node) { + return parseInt(node.data.replace(`${marker}:`, "")); + }, + /** + * Creates a placeholder string suitable for marking out a location *within* + * an attribute value or HTML content. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by binding directives. + */ + createInterpolationPlaceholder(index) { + return `${_interpolationStart}${index}${_interpolationEnd}`; + }, + /** + * Creates a placeholder that manifests itself as an attribute on an + * element. + * @param attributeName - The name of the custom attribute. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by attribute directives such as `ref`, `slotted`, and `children`. + */ + createCustomAttributePlaceholder(attributeName, index) { + return `${attributeName}="${this.createInterpolationPlaceholder(index)}"`; + }, + /** + * Creates a placeholder that manifests itself as a marker within the DOM structure. + * @param index - The directive index to create the placeholder for. + * @remarks + * Used internally by structural directives such as `repeat`. + */ + createBlockPlaceholder(index) { + return ``; + }, + /** + * Schedules DOM update work in the next async batch. + * @param callable - The callable function or object to queue. + */ + queueUpdate: updateQueue.enqueue, + /** + * Immediately processes all work previously scheduled + * through queueUpdate. + * @remarks + * This also forces nextUpdate promises + * to resolve. + */ + processUpdates: updateQueue.process, + /** + * Resolves with the next DOM update. + */ + nextUpdate() { + return new Promise(updateQueue.enqueue); + }, + /** + * Sets an attribute value on an element. + * @param element - The element to set the attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is `null` or `undefined`, the attribute is removed, otherwise + * it is set to the provided value using the standard `setAttribute` API. + */ + setAttribute(element, attributeName, value) { + if (value === null || value === void 0) { + element.removeAttribute(attributeName); + } else { + element.setAttribute(attributeName, value); + } + }, + /** + * Sets a boolean attribute value. + * @param element - The element to set the boolean attribute value on. + * @param attributeName - The attribute name to set. + * @param value - The value of the attribute to set. + * @remarks + * If the value is true, the attribute is added; otherwise it is removed. + */ + setBooleanAttribute(element, attributeName, value) { + value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName); + }, + /** + * Removes all the child nodes of the provided parent node. + * @param parent - The node to remove the children from. + */ + removeChildNodes(parent) { + for (let child = parent.firstChild; child !== null; child = parent.firstChild) { + parent.removeChild(child); + } + }, + /** + * Creates a TreeWalker configured to walk a template fragment. + * @param fragment - The fragment to walk. + */ + createTemplateWalker(fragment) { + return document.createTreeWalker( + fragment, + 133, + // element, text, comment + null, + false + ); + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js + var SubscriberSet, PropertyChangeNotifier; + var init_notifier = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js"() { + SubscriberSet = class { + /** + * Creates an instance of SubscriberSet for the specified source. + * @param source - The object source that subscribers will receive notifications from. + * @param initialSubscriber - An initial subscriber to changes. + */ + constructor(source, initialSubscriber) { + this.sub1 = void 0; + this.sub2 = void 0; + this.spillover = void 0; + this.source = source; + this.sub1 = initialSubscriber; + } + /** + * Checks whether the provided subscriber has been added to this set. + * @param subscriber - The subscriber to test for inclusion in this set. + */ + has(subscriber) { + return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1; + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + */ + subscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.has(subscriber)) { + return; + } + if (this.sub1 === void 0) { + this.sub1 = subscriber; + return; + } + if (this.sub2 === void 0) { + this.sub2 = subscriber; + return; + } + this.spillover = [this.sub1, this.sub2, subscriber]; + this.sub1 = void 0; + this.sub2 = void 0; + } else { + const index = spillover.indexOf(subscriber); + if (index === -1) { + spillover.push(subscriber); + } + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + */ + unsubscribe(subscriber) { + const spillover = this.spillover; + if (spillover === void 0) { + if (this.sub1 === subscriber) { + this.sub1 = void 0; + } else if (this.sub2 === subscriber) { + this.sub2 = void 0; + } + } else { + const index = spillover.indexOf(subscriber); + if (index !== -1) { + spillover.splice(index, 1); + } + } + } + /** + * Notifies all subscribers. + * @param args - Data passed along to subscribers during notification. + */ + notify(args) { + const spillover = this.spillover; + const source = this.source; + if (spillover === void 0) { + const sub1 = this.sub1; + const sub2 = this.sub2; + if (sub1 !== void 0) { + sub1.handleChange(source, args); + } + if (sub2 !== void 0) { + sub2.handleChange(source, args); + } + } else { + for (let i = 0, ii = spillover.length; i < ii; ++i) { + spillover[i].handleChange(source, args); + } + } + } + }; + PropertyChangeNotifier = class { + /** + * Creates an instance of PropertyChangeNotifier for the specified source. + * @param source - The object source that subscribers will receive notifications from. + */ + constructor(source) { + this.subscribers = {}; + this.sourceSubscribers = null; + this.source = source; + } + /** + * Notifies all subscribers, based on the specified property. + * @param propertyName - The property name, passed along to subscribers during notification. + */ + notify(propertyName) { + var _a; + const subscribers = this.subscribers[propertyName]; + if (subscribers !== void 0) { + subscribers.notify(propertyName); + } + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.notify(propertyName); + } + /** + * Subscribes to notification of changes in an object's state. + * @param subscriber - The object that is subscribing for change notification. + * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes. + */ + subscribe(subscriber, propertyToWatch) { + var _a; + if (propertyToWatch) { + let subscribers = this.subscribers[propertyToWatch]; + if (subscribers === void 0) { + this.subscribers[propertyToWatch] = subscribers = new SubscriberSet(this.source); + } + subscribers.subscribe(subscriber); + } else { + this.sourceSubscribers = (_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source); + this.sourceSubscribers.subscribe(subscriber); + } + } + /** + * Unsubscribes from notification of changes in an object's state. + * @param subscriber - The object that is unsubscribing from change notification. + * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching. + */ + unsubscribe(subscriber, propertyToUnwatch) { + var _a; + if (propertyToUnwatch) { + const subscribers = this.subscribers[propertyToUnwatch]; + if (subscribers !== void 0) { + subscribers.unsubscribe(subscriber); + } + } else { + (_a = this.sourceSubscribers) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/observable.js + function observable(target, nameOrAccessor) { + Observable.defineProperty(target, nameOrAccessor); + } + function volatile(target, name, descriptor) { + return Object.assign({}, descriptor, { + get: function() { + Observable.trackVolatile(); + return descriptor.get.apply(this); + } + }); + } + var Observable, contextEvent, ExecutionContext, defaultExecutionContext; + var init_observable = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/observable.js"() { + init_dom(); + init_platform(); + init_notifier(); + Observable = FAST.getById(2, () => { + const volatileRegex = /(:|&&|\|\||if)/; + const notifierLookup = /* @__PURE__ */ new WeakMap(); + const queueUpdate = DOM.queueUpdate; + let watcher = void 0; + let createArrayObserver = (array) => { + throw new Error("Must call enableArrayObservation before observing arrays."); + }; + function getNotifier(source) { + let found = source.$fastController || notifierLookup.get(source); + if (found === void 0) { + if (Array.isArray(source)) { + found = createArrayObserver(source); + } else { + notifierLookup.set(source, found = new PropertyChangeNotifier(source)); + } + } + return found; + } + const getAccessors = createMetadataLocator(); + class DefaultObservableAccessor { + constructor(name) { + this.name = name; + this.field = `_${name}`; + this.callback = `${name}Changed`; + } + getValue(source) { + if (watcher !== void 0) { + watcher.watch(source, this.name); + } + return source[this.field]; + } + setValue(source, newValue) { + const field = this.field; + const oldValue = source[field]; + if (oldValue !== newValue) { + source[field] = newValue; + const callback = source[this.callback]; + if (typeof callback === "function") { + callback.call(source, oldValue, newValue); + } + getNotifier(source).notify(this.name); + } + } + } + class BindingObserverImplementation extends SubscriberSet { + constructor(binding, initialSubscriber, isVolatileBinding = false) { + super(binding, initialSubscriber); + this.binding = binding; + this.isVolatileBinding = isVolatileBinding; + this.needsRefresh = true; + this.needsQueue = true; + this.first = this; + this.last = null; + this.propertySource = void 0; + this.propertyName = void 0; + this.notifier = void 0; + this.next = void 0; + } + observe(source, context) { + if (this.needsRefresh && this.last !== null) { + this.disconnect(); + } + const previousWatcher = watcher; + watcher = this.needsRefresh ? this : void 0; + this.needsRefresh = this.isVolatileBinding; + const result = this.binding(source, context); + watcher = previousWatcher; + return result; + } + disconnect() { + if (this.last !== null) { + let current = this.first; + while (current !== void 0) { + current.notifier.unsubscribe(this, current.propertyName); + current = current.next; + } + this.last = null; + this.needsRefresh = this.needsQueue = true; + } + } + watch(propertySource, propertyName) { + const prev = this.last; + const notifier = getNotifier(propertySource); + const current = prev === null ? this.first : {}; + current.propertySource = propertySource; + current.propertyName = propertyName; + current.notifier = notifier; + notifier.subscribe(this, propertyName); + if (prev !== null) { + if (!this.needsRefresh) { + let prevValue; + watcher = void 0; + prevValue = prev.propertySource[prev.propertyName]; + watcher = this; + if (propertySource === prevValue) { + this.needsRefresh = true; + } + } + prev.next = current; + } + this.last = current; + } + handleChange() { + if (this.needsQueue) { + this.needsQueue = false; + queueUpdate(this); + } + } + call() { + if (this.last !== null) { + this.needsQueue = true; + this.notify(this); + } + } + records() { + let next = this.first; + return { + next: () => { + const current = next; + if (current === void 0) { + return { value: void 0, done: true }; + } else { + next = next.next; + return { + value: current, + done: false + }; + } + }, + [Symbol.iterator]: function() { + return this; + } + }; + } + } + return Object.freeze({ + /** + * @internal + * @param factory - The factory used to create array observers. + */ + setArrayObserverFactory(factory) { + createArrayObserver = factory; + }, + /** + * Gets a notifier for an object or Array. + * @param source - The object or Array to get the notifier for. + */ + getNotifier, + /** + * Records a property change for a source object. + * @param source - The object to record the change against. + * @param propertyName - The property to track as changed. + */ + track(source, propertyName) { + if (watcher !== void 0) { + watcher.watch(source, propertyName); + } + }, + /** + * Notifies watchers that the currently executing property getter or function is volatile + * with respect to its observable dependencies. + */ + trackVolatile() { + if (watcher !== void 0) { + watcher.needsRefresh = true; + } + }, + /** + * Notifies subscribers of a source object of changes. + * @param source - the object to notify of changes. + * @param args - The change args to pass to subscribers. + */ + notify(source, args) { + getNotifier(source).notify(args); + }, + /** + * Defines an observable property on an object or prototype. + * @param target - The target object to define the observable on. + * @param nameOrAccessor - The name of the property to define as observable; + * or a custom accessor that specifies the property name and accessor implementation. + */ + defineProperty(target, nameOrAccessor) { + if (typeof nameOrAccessor === "string") { + nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor); + } + getAccessors(target).push(nameOrAccessor); + Reflect.defineProperty(target, nameOrAccessor.name, { + enumerable: true, + get: function() { + return nameOrAccessor.getValue(this); + }, + set: function(newValue) { + nameOrAccessor.setValue(this, newValue); + } + }); + }, + /** + * Finds all the observable accessors defined on the target, + * including its prototype chain. + * @param target - The target object to search for accessor on. + */ + getAccessors, + /** + * Creates a {@link BindingObserver} that can watch the + * provided {@link Binding} for changes. + * @param binding - The binding to observe. + * @param initialSubscriber - An initial subscriber to changes in the binding value. + * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation. + */ + binding(binding, initialSubscriber, isVolatileBinding = this.isVolatileBinding(binding)) { + return new BindingObserverImplementation(binding, initialSubscriber, isVolatileBinding); + }, + /** + * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated + * on every evaluation of the value. + * @param binding - The binding to inspect. + */ + isVolatileBinding(binding) { + return volatileRegex.test(binding.toString()); + } + }); + }); + contextEvent = FAST.getById(3, () => { + let current = null; + return { + get() { + return current; + }, + set(event) { + current = event; + } + }; + }); + ExecutionContext = class { + constructor() { + this.index = 0; + this.length = 0; + this.parent = null; + this.parentContext = null; + } + /** + * The current event within an event handler. + */ + get event() { + return contextEvent.get(); + } + /** + * Indicates whether the current item within a repeat context + * has an even index. + */ + get isEven() { + return this.index % 2 === 0; + } + /** + * Indicates whether the current item within a repeat context + * has an odd index. + */ + get isOdd() { + return this.index % 2 !== 0; + } + /** + * Indicates whether the current item within a repeat context + * is the first item in the collection. + */ + get isFirst() { + return this.index === 0; + } + /** + * Indicates whether the current item within a repeat context + * is somewhere in the middle of the collection. + */ + get isInMiddle() { + return !this.isFirst && !this.isLast; + } + /** + * Indicates whether the current item within a repeat context + * is the last item in the collection. + */ + get isLast() { + return this.index === this.length - 1; + } + /** + * Sets the event for the current execution context. + * @param event - The event to set. + * @internal + */ + static setEvent(event) { + contextEvent.set(event); + } + }; + Observable.defineProperty(ExecutionContext.prototype, "index"); + Observable.defineProperty(ExecutionContext.prototype, "length"); + defaultExecutionContext = Object.seal(new ExecutionContext()); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js + var HTMLDirective, TargetedHTMLDirective, AttachedBehaviorHTMLDirective; + var init_html_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/html-directive.js"() { + init_dom(); + HTMLDirective = class { + constructor() { + this.targetIndex = 0; + } + }; + TargetedHTMLDirective = class extends HTMLDirective { + constructor() { + super(...arguments); + this.createPlaceholder = DOM.createInterpolationPlaceholder; + } + }; + AttachedBehaviorHTMLDirective = class extends HTMLDirective { + /** + * + * @param name - The name of the behavior; used as a custom attribute on the element. + * @param behavior - The behavior to instantiate and attach to the element. + * @param options - Options to pass to the behavior during creation. + */ + constructor(name, behavior, options) { + super(); + this.name = name; + this.behavior = behavior; + this.options = options; + } + /** + * Creates a placeholder string based on the directive's index within the template. + * @param index - The index of the directive within the template. + * @remarks + * Creates a custom attribute placeholder. + */ + createPlaceholder(index) { + return DOM.createCustomAttributePlaceholder(this.name, index); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + * @remarks + * Creates an instance of the `behavior` type this directive was constructed with + * and passes the target and options to that `behavior`'s constructor. + */ + createBehavior(target) { + return new this.behavior(target, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/binding.js + function normalBind(source, context) { + this.source = source; + this.context = context; + if (this.bindingObserver === null) { + this.bindingObserver = Observable.binding(this.binding, this, this.isBindingVolatile); + } + this.updateTarget(this.bindingObserver.observe(source, context)); + } + function triggerBind(source, context) { + this.source = source; + this.context = context; + this.target.addEventListener(this.targetName, this); + } + function normalUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + } + function contentUnbind() { + this.bindingObserver.disconnect(); + this.source = null; + this.context = null; + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.unbind(); + view.needsBindOnly = true; + } + } + function triggerUnbind() { + this.target.removeEventListener(this.targetName, this); + this.source = null; + this.context = null; + } + function updateAttributeTarget(value) { + DOM.setAttribute(this.target, this.targetName, value); + } + function updateBooleanAttributeTarget(value) { + DOM.setBooleanAttribute(this.target, this.targetName, value); + } + function updateContentTarget(value) { + if (value === null || value === void 0) { + value = ""; + } + if (value.create) { + this.target.textContent = ""; + let view = this.target.$fastView; + if (view === void 0) { + view = value.create(); + } else { + if (this.target.$fastTemplate !== value) { + if (view.isComposed) { + view.remove(); + view.unbind(); + } + view = value.create(); + } + } + if (!view.isComposed) { + view.isComposed = true; + view.bind(this.source, this.context); + view.insertBefore(this.target); + this.target.$fastView = view; + this.target.$fastTemplate = value; + } else if (view.needsBindOnly) { + view.needsBindOnly = false; + view.bind(this.source, this.context); + } + } else { + const view = this.target.$fastView; + if (view !== void 0 && view.isComposed) { + view.isComposed = false; + view.remove(); + if (view.needsBindOnly) { + view.needsBindOnly = false; + } else { + view.unbind(); + } + } + this.target.textContent = value; + } + } + function updatePropertyTarget(value) { + this.target[this.targetName] = value; + } + function updateClassTarget(value) { + const classVersions = this.classVersions || /* @__PURE__ */ Object.create(null); + const target = this.target; + let version = this.version || 0; + if (value !== null && value !== void 0 && value.length) { + const names = value.split(/\s+/); + for (let i = 0, ii = names.length; i < ii; ++i) { + const currentName = names[i]; + if (currentName === "") { + continue; + } + classVersions[currentName] = version; + target.classList.add(currentName); + } + } + this.classVersions = classVersions; + this.version = version + 1; + if (version === 0) { + return; + } + version -= 1; + for (const name in classVersions) { + if (classVersions[name] === version) { + target.classList.remove(name); + } + } + } + var HTMLBindingDirective, BindingBehavior; + var init_binding = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/binding.js"() { + init_dom(); + init_observable(); + init_html_directive(); + HTMLBindingDirective = class extends TargetedHTMLDirective { + /** + * Creates an instance of BindingDirective. + * @param binding - A binding that returns the data used to update the DOM. + */ + constructor(binding) { + super(); + this.binding = binding; + this.bind = normalBind; + this.unbind = normalUnbind; + this.updateTarget = updateAttributeTarget; + this.isBindingVolatile = Observable.isVolatileBinding(this.binding); + } + /** + * Gets/sets the name of the attribute or property that this + * binding is targeting. + */ + get targetName() { + return this.originalTargetName; + } + set targetName(value) { + this.originalTargetName = value; + if (value === void 0) { + return; + } + switch (value[0]) { + case ":": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updatePropertyTarget; + if (this.cleanedTargetName === "innerHTML") { + const binding = this.binding; + this.binding = (s, c) => DOM.createHTML(binding(s, c)); + } + break; + case "?": + this.cleanedTargetName = value.substr(1); + this.updateTarget = updateBooleanAttributeTarget; + break; + case "@": + this.cleanedTargetName = value.substr(1); + this.bind = triggerBind; + this.unbind = triggerUnbind; + break; + default: + this.cleanedTargetName = value; + if (value === "class") { + this.updateTarget = updateClassTarget; + } + break; + } + } + /** + * Makes this binding target the content of an element rather than + * a particular attribute or property. + */ + targetAtContent() { + this.updateTarget = updateContentTarget; + this.unbind = contentUnbind; + } + /** + * Creates the runtime BindingBehavior instance based on the configuration + * information stored in the BindingDirective. + * @param target - The target node that the binding behavior should attach to. + */ + createBehavior(target) { + return new BindingBehavior(target, this.binding, this.isBindingVolatile, this.bind, this.unbind, this.updateTarget, this.cleanedTargetName); + } + }; + BindingBehavior = class { + /** + * Creates an instance of BindingBehavior. + * @param target - The target of the data updates. + * @param binding - The binding that returns the latest value for an update. + * @param isBindingVolatile - Indicates whether the binding has volatile dependencies. + * @param bind - The operation to perform during binding. + * @param unbind - The operation to perform during unbinding. + * @param updateTarget - The operation to perform when updating. + * @param targetName - The name of the target attribute or property to update. + */ + constructor(target, binding, isBindingVolatile, bind, unbind, updateTarget, targetName) { + this.source = null; + this.context = null; + this.bindingObserver = null; + this.target = target; + this.binding = binding; + this.isBindingVolatile = isBindingVolatile; + this.bind = bind; + this.unbind = unbind; + this.updateTarget = updateTarget; + this.targetName = targetName; + } + /** @internal */ + handleChange() { + this.updateTarget(this.bindingObserver.observe(this.source, this.context)); + } + /** @internal */ + handleEvent(event) { + ExecutionContext.setEvent(event); + const result = this.binding(this.source, this.context); + ExecutionContext.setEvent(null); + if (result !== true) { + event.preventDefault(); + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js + function createAggregateBinding(parts) { + if (parts.length === 1) { + return parts[0]; + } + let targetName; + const partCount = parts.length; + const finalParts = parts.map((x) => { + if (typeof x === "string") { + return () => x; + } + targetName = x.targetName || targetName; + return x.binding; + }); + const binding = (scope, context) => { + let output = ""; + for (let i = 0; i < partCount; ++i) { + output += finalParts[i](scope, context); + } + return output; + }; + const directive = new HTMLBindingDirective(binding); + directive.targetName = targetName; + return directive; + } + function parseContent(context, value) { + const valueParts = value.split(_interpolationStart); + if (valueParts.length === 1) { + return null; + } + const bindingParts = []; + for (let i = 0, ii = valueParts.length; i < ii; ++i) { + const current = valueParts[i]; + const index = current.indexOf(_interpolationEnd); + let literal; + if (index === -1) { + literal = current; + } else { + const directiveIndex = parseInt(current.substring(0, index)); + bindingParts.push(context.directives[directiveIndex]); + literal = current.substring(index + interpolationEndLength); + } + if (literal !== "") { + bindingParts.push(literal); + } + } + return bindingParts; + } + function compileAttributes(context, node, includeBasicValues = false) { + const attributes = node.attributes; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const attr2 = attributes[i]; + const attrValue = attr2.value; + const parseResult = parseContent(context, attrValue); + let result = null; + if (parseResult === null) { + if (includeBasicValues) { + result = new HTMLBindingDirective(() => attrValue); + result.targetName = attr2.name; + } + } else { + result = createAggregateBinding(parseResult); + } + if (result !== null) { + node.removeAttributeNode(attr2); + i--; + ii--; + context.addFactory(result); + } + } + } + function compileContent(context, node, walker) { + const parseResult = parseContent(context, node.textContent); + if (parseResult !== null) { + let lastNode = node; + for (let i = 0, ii = parseResult.length; i < ii; ++i) { + const currentPart = parseResult[i]; + const currentNode = i === 0 ? node : lastNode.parentNode.insertBefore(document.createTextNode(""), lastNode.nextSibling); + if (typeof currentPart === "string") { + currentNode.textContent = currentPart; + } else { + currentNode.textContent = " "; + context.captureContentBinding(currentPart); + } + lastNode = currentNode; + context.targetIndex++; + if (currentNode !== node) { + walker.nextNode(); + } + } + context.targetIndex--; + } + } + function compileTemplate(template, directives) { + const fragment = template.content; + document.adoptNode(fragment); + const context = CompilationContext.borrow(directives); + compileAttributes(context, template, true); + const hostBehaviorFactories = context.behaviorFactories; + context.reset(); + const walker = DOM.createTemplateWalker(fragment); + let node; + while (node = walker.nextNode()) { + context.targetIndex++; + switch (node.nodeType) { + case 1: + compileAttributes(context, node); + break; + case 3: + compileContent(context, node, walker); + break; + case 8: + if (DOM.isMarker(node)) { + context.addFactory(directives[DOM.extractDirectiveIndexFromMarker(node)]); + } + } + } + let targetOffset = 0; + if ( + // If the first node in a fragment is a marker, that means it's an unstable first node, + // because something like a when, repeat, etc. could add nodes before the marker. + // To mitigate this, we insert a stable first node. However, if we insert a node, + // that will alter the result of the TreeWalker. So, we also need to offset the target index. + DOM.isMarker(fragment.firstChild) || // Or if there is only one node and a directive, it means the template's content + // is *only* the directive. In that case, HTMLView.dispose() misses any nodes inserted by + // the directive. Inserting a new node ensures proper disposal of nodes added by the directive. + fragment.childNodes.length === 1 && directives.length + ) { + fragment.insertBefore(document.createComment(""), fragment.firstChild); + targetOffset = -1; + } + const viewBehaviorFactories = context.behaviorFactories; + context.release(); + return { + fragment, + viewBehaviorFactories, + hostBehaviorFactories, + targetOffset + }; + } + var sharedContext, CompilationContext, interpolationEndLength; + var init_compiler = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/compiler.js"() { + init_dom(); + init_binding(); + sharedContext = null; + CompilationContext = class _CompilationContext { + addFactory(factory) { + factory.targetIndex = this.targetIndex; + this.behaviorFactories.push(factory); + } + captureContentBinding(directive) { + directive.targetAtContent(); + this.addFactory(directive); + } + reset() { + this.behaviorFactories = []; + this.targetIndex = -1; + } + release() { + sharedContext = this; + } + static borrow(directives) { + const shareable = sharedContext || new _CompilationContext(); + shareable.directives = directives; + shareable.reset(); + sharedContext = null; + return shareable; + } + }; + interpolationEndLength = _interpolationEnd.length; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/view.js + var range, HTMLView; + var init_view = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/view.js"() { + range = document.createRange(); + HTMLView = class { + /** + * Constructs an instance of HTMLView. + * @param fragment - The html fragment that contains the nodes for this view. + * @param behaviors - The behaviors to be applied to this view. + */ + constructor(fragment, behaviors) { + this.fragment = fragment; + this.behaviors = behaviors; + this.source = null; + this.context = null; + this.firstChild = fragment.firstChild; + this.lastChild = fragment.lastChild; + } + /** + * Appends the view's DOM nodes to the referenced node. + * @param node - The parent node to append the view's DOM nodes to. + */ + appendTo(node) { + node.appendChild(this.fragment); + } + /** + * Inserts the view's DOM nodes before the referenced node. + * @param node - The node to insert the view's DOM before. + */ + insertBefore(node) { + if (this.fragment.hasChildNodes()) { + node.parentNode.insertBefore(this.fragment, node); + } else { + const end = this.lastChild; + if (node.previousSibling === end) + return; + const parentNode = node.parentNode; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parentNode.insertBefore(current, node); + current = next; + } + parentNode.insertBefore(end, node); + } + } + /** + * Removes the view's DOM nodes. + * The nodes are not disposed and the view can later be re-inserted. + */ + remove() { + const fragment = this.fragment; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + fragment.appendChild(current); + current = next; + } + fragment.appendChild(end); + } + /** + * Removes the view and unbinds its behaviors, disposing of DOM nodes afterward. + * Once a view has been disposed, it cannot be inserted or bound again. + */ + dispose() { + const parent = this.firstChild.parentNode; + const end = this.lastChild; + let current = this.firstChild; + let next; + while (current !== end) { + next = current.nextSibling; + parent.removeChild(current); + current = next; + } + parent.removeChild(end); + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + } + /** + * Binds a view's behaviors to its binding source. + * @param source - The binding source for the view's binding behaviors. + * @param context - The execution context to run the behaviors within. + */ + bind(source, context) { + const behaviors = this.behaviors; + if (this.source === source) { + return; + } else if (this.source !== null) { + const oldSource = this.source; + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + const current = behaviors[i]; + current.unbind(oldSource); + current.bind(source, context); + } + } else { + this.source = source; + this.context = context; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].bind(source, context); + } + } + } + /** + * Unbinds a view's behaviors from its binding source. + */ + unbind() { + if (this.source === null) { + return; + } + const behaviors = this.behaviors; + const oldSource = this.source; + for (let i = 0, ii = behaviors.length; i < ii; ++i) { + behaviors[i].unbind(oldSource); + } + this.source = null; + } + /** + * Efficiently disposes of a contiguous range of synthetic view instances. + * @param views - A contiguous range of views to be disposed. + */ + static disposeContiguousBatch(views) { + if (views.length === 0) { + return; + } + range.setStartBefore(views[0].firstChild); + range.setEndAfter(views[views.length - 1].lastChild); + range.deleteContents(); + for (let i = 0, ii = views.length; i < ii; ++i) { + const view = views[i]; + const behaviors = view.behaviors; + const oldSource = view.source; + for (let j = 0, jj = behaviors.length; j < jj; ++j) { + behaviors[j].unbind(oldSource); + } + } + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/template.js + function html(strings, ...values) { + const directives = []; + let html2 = ""; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + const currentString = strings[i]; + let value = values[i]; + html2 += currentString; + if (value instanceof ViewTemplate) { + const template = value; + value = () => template; + } + if (typeof value === "function") { + value = new HTMLBindingDirective(value); + } + if (value instanceof TargetedHTMLDirective) { + const match = lastAttributeNameRegex.exec(currentString); + if (match !== null) { + value.targetName = match[2]; + } + } + if (value instanceof HTMLDirective) { + html2 += value.createPlaceholder(directives.length); + directives.push(value); + } else { + html2 += value; + } + } + html2 += strings[strings.length - 1]; + return new ViewTemplate(html2, directives); + } + var ViewTemplate, lastAttributeNameRegex; + var init_template = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/template.js"() { + init_dom(); + init_observable(); + init_compiler(); + init_view(); + init_html_directive(); + init_binding(); + ViewTemplate = class { + /** + * Creates an instance of ViewTemplate. + * @param html - The html representing what this template will instantiate, including placeholders for directives. + * @param directives - The directives that will be connected to placeholders in the html. + */ + constructor(html2, directives) { + this.behaviorCount = 0; + this.hasHostBehaviors = false; + this.fragment = null; + this.targetOffset = 0; + this.viewBehaviorFactories = null; + this.hostBehaviorFactories = null; + this.html = html2; + this.directives = directives; + } + /** + * Creates an HTMLView instance based on this template definition. + * @param hostBindingTarget - The element that host behaviors will be bound to. + */ + create(hostBindingTarget) { + if (this.fragment === null) { + let template; + const html2 = this.html; + if (typeof html2 === "string") { + template = document.createElement("template"); + template.innerHTML = DOM.createHTML(html2); + const fec = template.content.firstElementChild; + if (fec !== null && fec.tagName === "TEMPLATE") { + template = fec; + } + } else { + template = html2; + } + const result = compileTemplate(template, this.directives); + this.fragment = result.fragment; + this.viewBehaviorFactories = result.viewBehaviorFactories; + this.hostBehaviorFactories = result.hostBehaviorFactories; + this.targetOffset = result.targetOffset; + this.behaviorCount = this.viewBehaviorFactories.length + this.hostBehaviorFactories.length; + this.hasHostBehaviors = this.hostBehaviorFactories.length > 0; + } + const fragment = this.fragment.cloneNode(true); + const viewFactories = this.viewBehaviorFactories; + const behaviors = new Array(this.behaviorCount); + const walker = DOM.createTemplateWalker(fragment); + let behaviorIndex = 0; + let targetIndex = this.targetOffset; + let node = walker.nextNode(); + for (let ii = viewFactories.length; behaviorIndex < ii; ++behaviorIndex) { + const factory = viewFactories[behaviorIndex]; + const factoryIndex = factory.targetIndex; + while (node !== null) { + if (targetIndex === factoryIndex) { + behaviors[behaviorIndex] = factory.createBehavior(node); + break; + } else { + node = walker.nextNode(); + targetIndex++; + } + } + } + if (this.hasHostBehaviors) { + const hostFactories = this.hostBehaviorFactories; + for (let i = 0, ii = hostFactories.length; i < ii; ++i, ++behaviorIndex) { + behaviors[behaviorIndex] = hostFactories[i].createBehavior(hostBindingTarget); + } + } + return new HTMLView(fragment, behaviors); + } + /** + * Creates an HTMLView from this template, binds it to the source, and then appends it to the host. + * @param source - The data source to bind the template to. + * @param host - The Element where the template will be rendered. + * @param hostBindingTarget - An HTML element to target the host bindings at if different from the + * host that the template is being attached to. + */ + render(source, host, hostBindingTarget) { + if (typeof host === "string") { + host = document.getElementById(host); + } + if (hostBindingTarget === void 0) { + hostBindingTarget = host; + } + const view = this.create(hostBindingTarget); + view.bind(source, defaultExecutionContext); + view.appendTo(host); + return view; + } + }; + lastAttributeNameRegex = /* eslint-disable-next-line no-control-regex */ + /([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js + function reduceStyles(styles) { + return styles.map((x) => x instanceof ElementStyles ? reduceStyles(x.styles) : [x]).reduce((prev, curr) => prev.concat(curr), []); + } + function reduceBehaviors(styles) { + return styles.map((x) => x instanceof ElementStyles ? x.behaviors : null).reduce((prev, curr) => { + if (curr === null) { + return prev; + } + if (prev === null) { + prev = []; + } + return prev.concat(curr); + }, null); + } + function separateSheetsToPrepend(sheets) { + const prepend = []; + const append = []; + sheets.forEach((x) => (x[prependToAdoptedStyleSheetsSymbol] ? prepend : append).push(x)); + return { prepend, append }; + } + function getNextStyleClass() { + return `fast-style-class-${++styleClassId}`; + } + var ElementStyles, prependToAdoptedStyleSheetsSymbol, addAdoptedStyleSheets, removeAdoptedStyleSheets, AdoptedStyleSheetsStyles, styleClassId, StyleElementStyles; + var init_element_styles = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/element-styles.js"() { + init_dom(); + ElementStyles = class { + constructor() { + this.targets = /* @__PURE__ */ new WeakSet(); + } + /** @internal */ + addStylesTo(target) { + this.targets.add(target); + } + /** @internal */ + removeStylesFrom(target) { + this.targets.delete(target); + } + /** @internal */ + isAttachedTo(target) { + return this.targets.has(target); + } + /** + * Associates behaviors with this set of styles. + * @param behaviors - The behaviors to associate. + */ + withBehaviors(...behaviors) { + this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors); + return this; + } + }; + ElementStyles.create = (() => { + if (DOM.supportsAdoptedStyleSheets) { + const styleSheetCache = /* @__PURE__ */ new Map(); + return (styles) => ( + // eslint-disable-next-line @typescript-eslint/no-use-before-define + new AdoptedStyleSheetsStyles(styles, styleSheetCache) + ); + } + return (styles) => new StyleElementStyles(styles); + })(); + prependToAdoptedStyleSheetsSymbol = /* @__PURE__ */ Symbol("prependToAdoptedStyleSheets"); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets = [...prepend, ...target.adoptedStyleSheets, ...append]; + }; + removeAdoptedStyleSheets = (target, sheets) => { + target.adoptedStyleSheets = target.adoptedStyleSheets.filter((x) => sheets.indexOf(x) === -1); + }; + if (DOM.supportsAdoptedStyleSheets) { + try { + document.adoptedStyleSheets.push(); + document.adoptedStyleSheets.splice(); + addAdoptedStyleSheets = (target, sheets) => { + const { prepend, append } = separateSheetsToPrepend(sheets); + target.adoptedStyleSheets.splice(0, 0, ...prepend); + target.adoptedStyleSheets.push(...append); + }; + removeAdoptedStyleSheets = (target, sheets) => { + for (const sheet of sheets) { + const index = target.adoptedStyleSheets.indexOf(sheet); + if (index !== -1) { + target.adoptedStyleSheets.splice(index, 1); + } + } + }; + } catch (e) { + } + } + AdoptedStyleSheetsStyles = class extends ElementStyles { + constructor(styles, styleSheetCache) { + super(); + this.styles = styles; + this.styleSheetCache = styleSheetCache; + this._styleSheets = void 0; + this.behaviors = reduceBehaviors(styles); + } + get styleSheets() { + if (this._styleSheets === void 0) { + const styles = this.styles; + const styleSheetCache = this.styleSheetCache; + this._styleSheets = reduceStyles(styles).map((x) => { + if (x instanceof CSSStyleSheet) { + return x; + } + let sheet = styleSheetCache.get(x); + if (sheet === void 0) { + sheet = new CSSStyleSheet(); + sheet.replaceSync(x); + styleSheetCache.set(x, sheet); + } + return sheet; + }); + } + return this._styleSheets; + } + addStylesTo(target) { + addAdoptedStyleSheets(target, this.styleSheets); + super.addStylesTo(target); + } + removeStylesFrom(target) { + removeAdoptedStyleSheets(target, this.styleSheets); + super.removeStylesFrom(target); + } + }; + styleClassId = 0; + StyleElementStyles = class extends ElementStyles { + constructor(styles) { + super(); + this.styles = styles; + this.behaviors = null; + this.behaviors = reduceBehaviors(styles); + this.styleSheets = reduceStyles(styles); + this.styleClass = getNextStyleClass(); + } + addStylesTo(target) { + const styleSheets = this.styleSheets; + const styleClass = this.styleClass; + target = this.normalizeTarget(target); + for (let i = 0; i < styleSheets.length; i++) { + const element = document.createElement("style"); + element.innerHTML = styleSheets[i]; + element.className = styleClass; + target.append(element); + } + super.addStylesTo(target); + } + removeStylesFrom(target) { + target = this.normalizeTarget(target); + const styles = target.querySelectorAll(`.${this.styleClass}`); + for (let i = 0, ii = styles.length; i < ii; ++i) { + target.removeChild(styles[i]); + } + super.removeStylesFrom(target); + } + isAttachedTo(target) { + return super.isAttachedTo(this.normalizeTarget(target)); + } + normalizeTarget(target) { + return target === document ? document.body : target; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/attributes.js + function attr(configOrTarget, prop) { + let config; + function decorator($target, $prop) { + if (arguments.length > 1) { + config.property = $prop; + } + AttributeConfiguration.locate($target.constructor).push(config); + } + if (arguments.length > 1) { + config = {}; + decorator(configOrTarget, prop); + return; + } + config = configOrTarget === void 0 ? {} : configOrTarget; + return decorator; + } + var AttributeConfiguration, booleanConverter, nullableNumberConverter, AttributeDefinition; + var init_attributes = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/attributes.js"() { + init_observable(); + init_dom(); + init_platform(); + AttributeConfiguration = Object.freeze({ + /** + * Locates all attribute configurations associated with a type. + */ + locate: createMetadataLocator() + }); + booleanConverter = { + toView(value) { + return value ? "true" : "false"; + }, + fromView(value) { + if (value === null || value === void 0 || value === "false" || value === false || value === 0) { + return false; + } + return true; + } + }; + nullableNumberConverter = { + toView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number.toString(); + }, + fromView(value) { + if (value === null || value === void 0) { + return null; + } + const number = value * 1; + return isNaN(number) ? null : number; + } + }; + AttributeDefinition = class _AttributeDefinition { + /** + * Creates an instance of AttributeDefinition. + * @param Owner - The class constructor that owns this attribute. + * @param name - The name of the property associated with the attribute. + * @param attribute - The name of the attribute in HTML. + * @param mode - The {@link AttributeMode} that describes the behavior of this attribute. + * @param converter - A {@link ValueConverter} that integrates with the property getter/setter + * to convert values to and from a DOM string. + */ + constructor(Owner, name, attribute = name.toLowerCase(), mode = "reflect", converter) { + this.guards = /* @__PURE__ */ new Set(); + this.Owner = Owner; + this.name = name; + this.attribute = attribute; + this.mode = mode; + this.converter = converter; + this.fieldName = `_${name}`; + this.callbackName = `${name}Changed`; + this.hasCallback = this.callbackName in Owner.prototype; + if (mode === "boolean" && converter === void 0) { + this.converter = booleanConverter; + } + } + /** + * Sets the value of the attribute/property on the source element. + * @param source - The source element to access. + * @param value - The value to set the attribute/property to. + */ + setValue(source, newValue) { + const oldValue = source[this.fieldName]; + const converter = this.converter; + if (converter !== void 0) { + newValue = converter.fromView(newValue); + } + if (oldValue !== newValue) { + source[this.fieldName] = newValue; + this.tryReflectToAttribute(source); + if (this.hasCallback) { + source[this.callbackName](oldValue, newValue); + } + source.$fastController.notify(this.name); + } + } + /** + * Gets the value of the attribute/property on the source element. + * @param source - The source element to access. + */ + getValue(source) { + Observable.track(source, this.name); + return source[this.fieldName]; + } + /** @internal */ + onAttributeChangedCallback(element, value) { + if (this.guards.has(element)) { + return; + } + this.guards.add(element); + this.setValue(element, value); + this.guards.delete(element); + } + tryReflectToAttribute(element) { + const mode = this.mode; + const guards = this.guards; + if (guards.has(element) || mode === "fromView") { + return; + } + DOM.queueUpdate(() => { + guards.add(element); + const latestValue = element[this.fieldName]; + switch (mode) { + case "reflect": + const converter = this.converter; + DOM.setAttribute(element, this.attribute, converter !== void 0 ? converter.toView(latestValue) : latestValue); + break; + case "boolean": + DOM.setBooleanAttribute(element, this.attribute, latestValue); + break; + } + guards.delete(element); + }); + } + /** + * Collects all attribute definitions associated with the owner. + * @param Owner - The class constructor to collect attribute for. + * @param attributeLists - Any existing attributes to collect and merge with those associated with the owner. + * @internal + */ + static collect(Owner, ...attributeLists) { + const attributes = []; + attributeLists.push(AttributeConfiguration.locate(Owner)); + for (let i = 0, ii = attributeLists.length; i < ii; ++i) { + const list = attributeLists[i]; + if (list === void 0) { + continue; + } + for (let j = 0, jj = list.length; j < jj; ++j) { + const config = list[j]; + if (typeof config === "string") { + attributes.push(new _AttributeDefinition(Owner, config)); + } else { + attributes.push(new _AttributeDefinition(Owner, config.property, config.attribute, config.mode, config.converter)); + } + } + } + return attributes; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js + var defaultShadowOptions, defaultElementOptions, fastRegistry, FASTElementDefinition; + var init_fast_definitions = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-definitions.js"() { + init_platform(); + init_observable(); + init_element_styles(); + init_attributes(); + defaultShadowOptions = { mode: "open" }; + defaultElementOptions = {}; + fastRegistry = FAST.getById(4, () => { + const typeToDefinition = /* @__PURE__ */ new Map(); + return Object.freeze({ + register(definition) { + if (typeToDefinition.has(definition.type)) { + return false; + } + typeToDefinition.set(definition.type, definition); + return true; + }, + getByType(key) { + return typeToDefinition.get(key); + } + }); + }); + FASTElementDefinition = class { + /** + * Creates an instance of FASTElementDefinition. + * @param type - The type this definition is being created for. + * @param nameOrConfig - The name of the element to define or a config object + * that describes the element to define. + */ + constructor(type, nameOrConfig = type.definition) { + if (typeof nameOrConfig === "string") { + nameOrConfig = { name: nameOrConfig }; + } + this.type = type; + this.name = nameOrConfig.name; + this.template = nameOrConfig.template; + const attributes = AttributeDefinition.collect(type, nameOrConfig.attributes); + const observedAttributes = new Array(attributes.length); + const propertyLookup = {}; + const attributeLookup = {}; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + const current = attributes[i]; + observedAttributes[i] = current.attribute; + propertyLookup[current.name] = current; + attributeLookup[current.attribute] = current; + } + this.attributes = attributes; + this.observedAttributes = observedAttributes; + this.propertyLookup = propertyLookup; + this.attributeLookup = attributeLookup; + this.shadowOptions = nameOrConfig.shadowOptions === void 0 ? defaultShadowOptions : nameOrConfig.shadowOptions === null ? void 0 : Object.assign(Object.assign({}, defaultShadowOptions), nameOrConfig.shadowOptions); + this.elementOptions = nameOrConfig.elementOptions === void 0 ? defaultElementOptions : Object.assign(Object.assign({}, defaultElementOptions), nameOrConfig.elementOptions); + this.styles = nameOrConfig.styles === void 0 ? void 0 : Array.isArray(nameOrConfig.styles) ? ElementStyles.create(nameOrConfig.styles) : nameOrConfig.styles instanceof ElementStyles ? nameOrConfig.styles : ElementStyles.create([nameOrConfig.styles]); + } + /** + * Indicates if this element has been defined in at least one registry. + */ + get isDefined() { + return !!fastRegistry.getByType(this.type); + } + /** + * Defines a custom element based on this definition. + * @param registry - The element registry to define the element in. + */ + define(registry = customElements) { + const type = this.type; + if (fastRegistry.register(this)) { + const attributes = this.attributes; + const proto = type.prototype; + for (let i = 0, ii = attributes.length; i < ii; ++i) { + Observable.defineProperty(proto, attributes[i]); + } + Reflect.defineProperty(type, "observedAttributes", { + value: this.observedAttributes, + enumerable: true + }); + } + if (!registry.get(this.name)) { + registry.define(this.name, type, this.elementOptions); + } + return this; + } + }; + FASTElementDefinition.forType = fastRegistry.getByType; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/controller.js + function getShadowRoot(element) { + return element.shadowRoot || shadowRoots.get(element) || null; + } + var shadowRoots, defaultEventOptions, Controller; + var init_controller = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/controller.js"() { + init_dom(); + init_notifier(); + init_observable(); + init_fast_definitions(); + shadowRoots = /* @__PURE__ */ new WeakMap(); + defaultEventOptions = { + bubbles: true, + composed: true, + cancelable: true + }; + Controller = class _Controller extends PropertyChangeNotifier { + /** + * Creates a Controller to control the specified element. + * @param element - The element to be controlled by this controller. + * @param definition - The element definition metadata that instructs this + * controller in how to handle rendering and other platform integrations. + * @internal + */ + constructor(element, definition) { + super(element); + this.boundObservables = null; + this.behaviors = null; + this.needsInitialization = true; + this._template = null; + this._styles = null; + this._isConnected = false; + this.$fastController = this; + this.view = null; + this.element = element; + this.definition = definition; + const shadowOptions = definition.shadowOptions; + if (shadowOptions !== void 0) { + const shadowRoot = element.attachShadow(shadowOptions); + if (shadowOptions.mode === "closed") { + shadowRoots.set(element, shadowRoot); + } + } + const accessors = Observable.getAccessors(element); + if (accessors.length > 0) { + const boundObservables = this.boundObservables = /* @__PURE__ */ Object.create(null); + for (let i = 0, ii = accessors.length; i < ii; ++i) { + const propertyName = accessors[i].name; + const value = element[propertyName]; + if (value !== void 0) { + delete element[propertyName]; + boundObservables[propertyName] = value; + } + } + } + } + /** + * Indicates whether or not the custom element has been + * connected to the document. + */ + get isConnected() { + Observable.track(this, "isConnected"); + return this._isConnected; + } + setIsConnected(value) { + this._isConnected = value; + Observable.notify(this, "isConnected"); + } + /** + * Gets/sets the template used to render the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get template() { + return this._template; + } + set template(value) { + if (this._template === value) { + return; + } + this._template = value; + if (!this.needsInitialization) { + this.renderTemplate(value); + } + } + /** + * Gets/sets the primary styles used for the component. + * @remarks + * This value can only be accurately read after connect but can be set at any time. + */ + get styles() { + return this._styles; + } + set styles(value) { + if (this._styles === value) { + return; + } + if (this._styles !== null) { + this.removeStyles(this._styles); + } + this._styles = value; + if (!this.needsInitialization && value !== null) { + this.addStyles(value); + } + } + /** + * Adds styles to this element. Providing an HTMLStyleElement will attach the element instance to the shadowRoot. + * @param styles - The styles to add. + */ + addStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.append(styles); + } else if (!styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.addStylesTo(target); + if (sourceBehaviors !== null) { + this.addBehaviors(sourceBehaviors); + } + } + } + /** + * Removes styles from this element. Providing an HTMLStyleElement will detach the element instance from the shadowRoot. + * @param styles - the styles to remove. + */ + removeStyles(styles) { + const target = getShadowRoot(this.element) || this.element.getRootNode(); + if (styles instanceof HTMLStyleElement) { + target.removeChild(styles); + } else if (styles.isAttachedTo(target)) { + const sourceBehaviors = styles.behaviors; + styles.removeStylesFrom(target); + if (sourceBehaviors !== null) { + this.removeBehaviors(sourceBehaviors); + } + } + } + /** + * Adds behaviors to this element. + * @param behaviors - The behaviors to add. + */ + addBehaviors(behaviors) { + const targetBehaviors = this.behaviors || (this.behaviors = /* @__PURE__ */ new Map()); + const length = behaviors.length; + const behaviorsToBind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + targetBehaviors.set(behavior, targetBehaviors.get(behavior) + 1); + } else { + targetBehaviors.set(behavior, 1); + behaviorsToBind.push(behavior); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToBind.length; ++i) { + behaviorsToBind[i].bind(element, defaultExecutionContext); + } + } + } + /** + * Removes behaviors from this element. + * @param behaviors - The behaviors to remove. + * @param force - Forces unbinding of behaviors. + */ + removeBehaviors(behaviors, force = false) { + const targetBehaviors = this.behaviors; + if (targetBehaviors === null) { + return; + } + const length = behaviors.length; + const behaviorsToUnbind = []; + for (let i = 0; i < length; ++i) { + const behavior = behaviors[i]; + if (targetBehaviors.has(behavior)) { + const count = targetBehaviors.get(behavior) - 1; + count === 0 || force ? targetBehaviors.delete(behavior) && behaviorsToUnbind.push(behavior) : targetBehaviors.set(behavior, count); + } + } + if (this._isConnected) { + const element = this.element; + for (let i = 0; i < behaviorsToUnbind.length; ++i) { + behaviorsToUnbind[i].unbind(element); + } + } + } + /** + * Runs connected lifecycle behavior on the associated element. + */ + onConnectedCallback() { + if (this._isConnected) { + return; + } + const element = this.element; + if (this.needsInitialization) { + this.finishInitialization(); + } else if (this.view !== null) { + this.view.bind(element, defaultExecutionContext); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + for (const [behavior] of behaviors) { + behavior.bind(element, defaultExecutionContext); + } + } + this.setIsConnected(true); + } + /** + * Runs disconnected lifecycle behavior on the associated element. + */ + onDisconnectedCallback() { + if (!this._isConnected) { + return; + } + this.setIsConnected(false); + const view = this.view; + if (view !== null) { + view.unbind(); + } + const behaviors = this.behaviors; + if (behaviors !== null) { + const element = this.element; + for (const [behavior] of behaviors) { + behavior.unbind(element); + } + } + } + /** + * Runs the attribute changed callback for the associated element. + * @param name - The name of the attribute that changed. + * @param oldValue - The previous value of the attribute. + * @param newValue - The new value of the attribute. + */ + onAttributeChangedCallback(name, oldValue, newValue) { + const attrDef = this.definition.attributeLookup[name]; + if (attrDef !== void 0) { + attrDef.onAttributeChangedCallback(this.element, newValue); + } + } + /** + * Emits a custom HTML event. + * @param type - The type name of the event. + * @param detail - The event detail object to send with the event. + * @param options - The event options. By default bubbles and composed. + * @remarks + * Only emits events if connected. + */ + emit(type, detail, options) { + if (this._isConnected) { + return this.element.dispatchEvent(new CustomEvent(type, Object.assign(Object.assign({ detail }, defaultEventOptions), options))); + } + return false; + } + finishInitialization() { + const element = this.element; + const boundObservables = this.boundObservables; + if (boundObservables !== null) { + const propertyNames = Object.keys(boundObservables); + for (let i = 0, ii = propertyNames.length; i < ii; ++i) { + const propertyName = propertyNames[i]; + element[propertyName] = boundObservables[propertyName]; + } + this.boundObservables = null; + } + const definition = this.definition; + if (this._template === null) { + if (this.element.resolveTemplate) { + this._template = this.element.resolveTemplate(); + } else if (definition.template) { + this._template = definition.template || null; + } + } + if (this._template !== null) { + this.renderTemplate(this._template); + } + if (this._styles === null) { + if (this.element.resolveStyles) { + this._styles = this.element.resolveStyles(); + } else if (definition.styles) { + this._styles = definition.styles || null; + } + } + if (this._styles !== null) { + this.addStyles(this._styles); + } + this.needsInitialization = false; + } + renderTemplate(template) { + const element = this.element; + const host = getShadowRoot(element) || element; + if (this.view !== null) { + this.view.dispose(); + this.view = null; + } else if (!this.needsInitialization) { + DOM.removeChildNodes(host); + } + if (template) { + this.view = template.render(element, host, element); + } + } + /** + * Locates or creates a controller for the specified element. + * @param element - The element to return the controller for. + * @remarks + * The specified element must have a {@link FASTElementDefinition} + * registered either through the use of the {@link customElement} + * decorator or a call to `FASTElement.define`. + */ + static forCustomElement(element) { + const controller = element.$fastController; + if (controller !== void 0) { + return controller; + } + const definition = FASTElementDefinition.forType(element.constructor); + if (definition === void 0) { + throw new Error("Missing FASTElement definition."); + } + return element.$fastController = new _Controller(element, definition); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js + function createFASTElement(BaseType) { + return class extends BaseType { + constructor() { + super(); + Controller.forCustomElement(this); + } + $emit(type, detail, options) { + return this.$fastController.emit(type, detail, options); + } + connectedCallback() { + this.$fastController.onConnectedCallback(); + } + disconnectedCallback() { + this.$fastController.onDisconnectedCallback(); + } + attributeChangedCallback(name, oldValue, newValue) { + this.$fastController.onAttributeChangedCallback(name, oldValue, newValue); + } + }; + } + var FASTElement; + var init_fast_element = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/components/fast-element.js"() { + init_controller(); + init_fast_definitions(); + FASTElement = Object.assign(createFASTElement(HTMLElement), { + /** + * Creates a new FASTElement base class inherited from the + * provided base type. + * @param BaseType - The base element type to inherit from. + */ + from(BaseType) { + return createFASTElement(BaseType); + }, + /** + * Defines a platform custom element based on the provided type and definition. + * @param type - The custom element type to define. + * @param nameOrDef - The name of the element to define or a definition object + * that describes the element to define. + */ + define(type, nameOrDef) { + return new FASTElementDefinition(type, nameOrDef).define().type; + } + }); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js + var CSSDirective; + var init_css_directive = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css-directive.js"() { + CSSDirective = class { + /** + * Creates a CSS fragment to interpolate into the CSS document. + * @returns - the string to interpolate into CSS + */ + createCSS() { + return ""; + } + /** + * Creates a behavior to bind to the host element. + * @returns - the behavior to bind to the host element, or undefined. + */ + createBehavior() { + return void 0; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/styles/css.js + function collectStyles(strings, values) { + const styles = []; + let cssString = ""; + const behaviors = []; + for (let i = 0, ii = strings.length - 1; i < ii; ++i) { + cssString += strings[i]; + let value = values[i]; + if (value instanceof CSSDirective) { + const behavior = value.createBehavior(); + value = value.createCSS(); + if (behavior) { + behaviors.push(behavior); + } + } + if (value instanceof ElementStyles || value instanceof CSSStyleSheet) { + if (cssString.trim() !== "") { + styles.push(cssString); + cssString = ""; + } + styles.push(value); + } else { + cssString += value; + } + } + cssString += strings[strings.length - 1]; + if (cssString.trim() !== "") { + styles.push(cssString); + } + return { + styles, + behaviors + }; + } + function css(strings, ...values) { + const { styles, behaviors } = collectStyles(strings, values); + const elementStyles = ElementStyles.create(styles); + if (behaviors.length) { + elementStyles.withBehaviors(...behaviors); + } + return elementStyles; + } + var init_css = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/styles/css.js"() { + init_css_directive(); + init_element_styles(); + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js + function newSplice(index, removed, addedCount) { + return { + index, + removed, + addedCount + }; + } + function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) { + const rowCount = oldEnd - oldStart + 1; + const columnCount = currentEnd - currentStart + 1; + const distances = new Array(rowCount); + let north; + let west; + for (let i = 0; i < rowCount; ++i) { + distances[i] = new Array(columnCount); + distances[i][0] = i; + } + for (let j = 0; j < columnCount; ++j) { + distances[0][j] = j; + } + for (let i = 1; i < rowCount; ++i) { + for (let j = 1; j < columnCount; ++j) { + if (current[currentStart + j - 1] === old[oldStart + i - 1]) { + distances[i][j] = distances[i - 1][j - 1]; + } else { + north = distances[i - 1][j] + 1; + west = distances[i][j - 1] + 1; + distances[i][j] = north < west ? north : west; + } + } + } + return distances; + } + function spliceOperationsFromEditDistances(distances) { + let i = distances.length - 1; + let j = distances[0].length - 1; + let current = distances[i][j]; + const edits = []; + while (i > 0 || j > 0) { + if (i === 0) { + edits.push(EDIT_ADD); + j--; + continue; + } + if (j === 0) { + edits.push(EDIT_DELETE); + i--; + continue; + } + const northWest = distances[i - 1][j - 1]; + const west = distances[i - 1][j]; + const north = distances[i][j - 1]; + let min; + if (west < north) { + min = west < northWest ? west : northWest; + } else { + min = north < northWest ? north : northWest; + } + if (min === northWest) { + if (northWest === current) { + edits.push(EDIT_LEAVE); + } else { + edits.push(EDIT_UPDATE); + current = northWest; + } + i--; + j--; + } else if (min === west) { + edits.push(EDIT_DELETE); + i--; + current = west; + } else { + edits.push(EDIT_ADD); + j--; + current = north; + } + } + edits.reverse(); + return edits; + } + function sharedPrefix(current, old, searchLength) { + for (let i = 0; i < searchLength; ++i) { + if (current[i] !== old[i]) { + return i; + } + } + return searchLength; + } + function sharedSuffix(current, old, searchLength) { + let index1 = current.length; + let index2 = old.length; + let count = 0; + while (count < searchLength && current[--index1] === old[--index2]) { + count++; + } + return count; + } + function intersect(start1, end1, start2, end2) { + if (end1 < start2 || end2 < start1) { + return -1; + } + if (end1 === start2 || end2 === start1) { + return 0; + } + if (start1 < start2) { + if (end1 < end2) { + return end1 - start2; + } + return end2 - start2; + } + if (end2 < end1) { + return end2 - start1; + } + return end1 - start1; + } + function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) { + let prefixCount = 0; + let suffixCount = 0; + const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart); + if (currentStart === 0 && oldStart === 0) { + prefixCount = sharedPrefix(current, old, minLength); + } + if (currentEnd === current.length && oldEnd === old.length) { + suffixCount = sharedSuffix(current, old, minLength - prefixCount); + } + currentStart += prefixCount; + oldStart += prefixCount; + currentEnd -= suffixCount; + oldEnd -= suffixCount; + if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) { + return emptyArray; + } + if (currentStart === currentEnd) { + const splice2 = newSplice(currentStart, [], 0); + while (oldStart < oldEnd) { + splice2.removed.push(old[oldStart++]); + } + return [splice2]; + } else if (oldStart === oldEnd) { + return [newSplice(currentStart, [], currentEnd - currentStart)]; + } + const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd)); + const splices = []; + let splice = void 0; + let index = currentStart; + let oldIndex = oldStart; + for (let i = 0; i < ops.length; ++i) { + switch (ops[i]) { + case EDIT_LEAVE: + if (splice !== void 0) { + splices.push(splice); + splice = void 0; + } + index++; + oldIndex++; + break; + case EDIT_UPDATE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + case EDIT_ADD: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.addedCount++; + index++; + break; + case EDIT_DELETE: + if (splice === void 0) { + splice = newSplice(index, [], 0); + } + splice.removed.push(old[oldIndex]); + oldIndex++; + break; + } + } + if (splice !== void 0) { + splices.push(splice); + } + return splices; + } + function mergeSplice(splices, index, removed, addedCount) { + const splice = newSplice(index, removed, addedCount); + let inserted = false; + let insertionOffset = 0; + for (let i = 0; i < splices.length; i++) { + const current = splices[i]; + current.index += insertionOffset; + if (inserted) { + continue; + } + const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount); + if (intersectCount >= 0) { + splices.splice(i, 1); + i--; + insertionOffset -= current.addedCount - current.removed.length; + splice.addedCount += current.addedCount - intersectCount; + const deleteCount = splice.removed.length + current.removed.length - intersectCount; + if (!splice.addedCount && !deleteCount) { + inserted = true; + } else { + let currentRemoved = current.removed; + if (splice.index < current.index) { + const prepend = splice.removed.slice(0, current.index - splice.index); + $push.apply(prepend, currentRemoved); + currentRemoved = prepend; + } + if (splice.index + splice.removed.length > current.index + current.addedCount) { + const append = splice.removed.slice(current.index + current.addedCount - splice.index); + $push.apply(currentRemoved, append); + } + splice.removed = currentRemoved; + if (current.index < splice.index) { + splice.index = current.index; + } + } + } else if (splice.index < current.index) { + inserted = true; + splices.splice(i, 0, splice); + i++; + const offset = splice.addedCount - splice.removed.length; + current.index += offset; + insertionOffset += offset; + } + } + if (!inserted) { + splices.push(splice); + } + } + function createInitialSplices(changeRecords) { + const splices = []; + for (let i = 0, ii = changeRecords.length; i < ii; i++) { + const record = changeRecords[i]; + mergeSplice(splices, record.index, record.removed, record.addedCount); + } + return splices; + } + function projectArraySplices(array, changeRecords) { + let splices = []; + const initialSplices = createInitialSplices(changeRecords); + for (let i = 0, ii = initialSplices.length; i < ii; ++i) { + const splice = initialSplices[i]; + if (splice.addedCount === 1 && splice.removed.length === 1) { + if (splice.removed[0] !== array[splice.index]) { + splices.push(splice); + } + continue; + } + splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length)); + } + return splices; + } + var EDIT_LEAVE, EDIT_UPDATE, EDIT_ADD, EDIT_DELETE, $push; + var init_array_change_records = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-change-records.js"() { + init_platform(); + EDIT_LEAVE = 0; + EDIT_UPDATE = 1; + EDIT_ADD = 2; + EDIT_DELETE = 3; + $push = Array.prototype.push; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js + function adjustIndex(changeRecord, array) { + let index = changeRecord.index; + const arrayLength = array.length; + if (index > arrayLength) { + index = arrayLength - changeRecord.addedCount; + } else if (index < 0) { + index = arrayLength + changeRecord.removed.length + index - changeRecord.addedCount; + } + if (index < 0) { + index = 0; + } + changeRecord.index = index; + return changeRecord; + } + function enableArrayObservation() { + if (arrayObservationEnabled) { + return; + } + arrayObservationEnabled = true; + Observable.setArrayObserverFactory((collection) => { + return new ArrayObserver(collection); + }); + const proto = Array.prototype; + if (proto.$fastPatch) { + return; + } + Reflect.defineProperty(proto, "$fastPatch", { + value: 1, + enumerable: false + }); + const pop = proto.pop; + const push = proto.push; + const reverse = proto.reverse; + const shift = proto.shift; + const sort = proto.sort; + const splice = proto.splice; + const unshift = proto.unshift; + proto.pop = function() { + const notEmpty = this.length > 0; + const methodCallResult = pop.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(this.length, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.push = function() { + const methodCallResult = push.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this)); + } + return methodCallResult; + }; + proto.reverse = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = reverse.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.shift = function() { + const notEmpty = this.length > 0; + const methodCallResult = shift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0 && notEmpty) { + o.addSplice(newSplice(0, [methodCallResult], 0)); + } + return methodCallResult; + }; + proto.sort = function() { + let oldArray; + const o = this.$fastController; + if (o !== void 0) { + o.flush(); + oldArray = this.slice(); + } + const methodCallResult = sort.apply(this, arguments); + if (o !== void 0) { + o.reset(oldArray); + } + return methodCallResult; + }; + proto.splice = function() { + const methodCallResult = splice.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this)); + } + return methodCallResult; + }; + proto.unshift = function() { + const methodCallResult = unshift.apply(this, arguments); + const o = this.$fastController; + if (o !== void 0) { + o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this)); + } + return methodCallResult; + }; + } + var arrayObservationEnabled, ArrayObserver; + var init_array_observer = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/observation/array-observer.js"() { + init_dom(); + init_array_change_records(); + init_notifier(); + init_observable(); + arrayObservationEnabled = false; + ArrayObserver = class extends SubscriberSet { + constructor(source) { + super(source); + this.oldCollection = void 0; + this.splices = void 0; + this.needsQueue = true; + this.call = this.flush; + Reflect.defineProperty(source, "$fastController", { + value: this, + enumerable: false + }); + } + subscribe(subscriber) { + this.flush(); + super.subscribe(subscriber); + } + addSplice(splice) { + if (this.splices === void 0) { + this.splices = [splice]; + } else { + this.splices.push(splice); + } + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + reset(oldCollection) { + this.oldCollection = oldCollection; + if (this.needsQueue) { + this.needsQueue = false; + DOM.queueUpdate(this); + } + } + flush() { + const splices = this.splices; + const oldCollection = this.oldCollection; + if (splices === void 0 && oldCollection === void 0) { + return; + } + this.needsQueue = true; + this.splices = void 0; + this.oldCollection = void 0; + const finalSplices = oldCollection === void 0 ? projectArraySplices(this.source, splices) : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length); + this.notify(finalSplices); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/ref.js + function ref(propertyName) { + return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName); + } + var RefBehavior; + var init_ref = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/ref.js"() { + init_html_directive(); + RefBehavior = class { + /** + * Creates an instance of RefBehavior. + * @param target - The element to reference. + * @param propertyName - The name of the property to assign the reference to. + */ + constructor(target, propertyName) { + this.target = target; + this.propertyName = propertyName; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + source[this.propertyName] = this.target; + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + /* eslint-disable-next-line @typescript-eslint/no-empty-function */ + unbind() { + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/interfaces.js + var isFunction; + var init_interfaces = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/interfaces.js"() { + isFunction = (object) => typeof object === "function"; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/when.js + function normalizeBinding(value) { + return value === void 0 ? noTemplate : isFunction(value) ? value : () => value; + } + function when(binding, templateOrTemplateBinding, elseTemplateOrTemplateBinding) { + const dataBinding = isFunction(binding) ? binding : () => binding; + const templateBinding = normalizeBinding(templateOrTemplateBinding); + const elseBinding = normalizeBinding(elseTemplateOrTemplateBinding); + return (source, context) => dataBinding(source, context) ? templateBinding(source, context) : elseBinding(source, context); + } + var noTemplate; + var init_when = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/when.js"() { + init_interfaces(); + noTemplate = () => null; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js + function bindWithoutPositioning(view, items, index, context) { + view.bind(items[index], context); + } + function bindWithPositioning(view, items, index, context) { + const childContext = Object.create(context); + childContext.index = index; + childContext.length = items.length; + view.bind(items[index], childContext); + } + var defaultRepeatOptions, RepeatBehavior, RepeatDirective; + var init_repeat = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/repeat.js"() { + init_dom(); + init_observable(); + init_array_observer(); + init_platform(); + init_html_directive(); + init_view(); + defaultRepeatOptions = Object.freeze({ + positioning: false, + recycle: true + }); + RepeatBehavior = class { + /** + * Creates an instance of RepeatBehavior. + * @param location - The location in the DOM to render the repeat. + * @param itemsBinding - The array to render. + * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies. + * @param templateBinding - The template to render for each item. + * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies. + * @param options - Options used to turn on special repeat features. + */ + constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) { + this.location = location; + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.source = null; + this.views = []; + this.items = null; + this.itemsObserver = null; + this.originalContext = void 0; + this.childContext = void 0; + this.bindView = bindWithoutPositioning; + this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile); + this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile); + if (options.positioning) { + this.bindView = bindWithPositioning; + } + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source, context) { + this.source = source; + this.originalContext = context; + this.childContext = Object.create(context); + this.childContext.parent = source; + this.childContext.parentContext = this.originalContext; + this.items = this.itemsBindingObserver.observe(source, this.originalContext); + this.template = this.templateBindingObserver.observe(source, this.originalContext); + this.observeItems(true); + this.refreshAllViews(); + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.source = null; + this.items = null; + if (this.itemsObserver !== null) { + this.itemsObserver.unsubscribe(this); + } + this.unbindAllViews(); + this.itemsBindingObserver.disconnect(); + this.templateBindingObserver.disconnect(); + } + /** @internal */ + handleChange(source, args) { + if (source === this.itemsBinding) { + this.items = this.itemsBindingObserver.observe(this.source, this.originalContext); + this.observeItems(); + this.refreshAllViews(); + } else if (source === this.templateBinding) { + this.template = this.templateBindingObserver.observe(this.source, this.originalContext); + this.refreshAllViews(true); + } else { + this.updateViews(args); + } + } + observeItems(force = false) { + if (!this.items) { + this.items = emptyArray; + return; + } + const oldObserver = this.itemsObserver; + const newObserver = this.itemsObserver = Observable.getNotifier(this.items); + const hasNewObserver = oldObserver !== newObserver; + if (hasNewObserver && oldObserver !== null) { + oldObserver.unsubscribe(this); + } + if (hasNewObserver || force) { + newObserver.subscribe(this); + } + } + updateViews(splices) { + const childContext = this.childContext; + const views = this.views; + const bindView = this.bindView; + const items = this.items; + const template = this.template; + const recycle = this.options.recycle; + const leftoverViews = []; + let leftoverIndex = 0; + let availableViews = 0; + for (let i = 0, ii = splices.length; i < ii; ++i) { + const splice = splices[i]; + const removed = splice.removed; + let removeIndex = 0; + let addIndex = splice.index; + const end = addIndex + splice.addedCount; + const removedViews = views.splice(splice.index, removed.length); + const totalAvailableViews = availableViews = leftoverViews.length + removedViews.length; + for (; addIndex < end; ++addIndex) { + const neighbor = views[addIndex]; + const location = neighbor ? neighbor.firstChild : this.location; + let view; + if (recycle && availableViews > 0) { + if (removeIndex <= totalAvailableViews && removedViews.length > 0) { + view = removedViews[removeIndex]; + removeIndex++; + } else { + view = leftoverViews[leftoverIndex]; + leftoverIndex++; + } + availableViews--; + } else { + view = template.create(); + } + views.splice(addIndex, 0, view); + bindView(view, items, addIndex, childContext); + view.insertBefore(location); + } + if (removedViews[removeIndex]) { + leftoverViews.push(...removedViews.slice(removeIndex)); + } + } + for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) { + leftoverViews[i].dispose(); + } + if (this.options.positioning) { + for (let i = 0, ii = views.length; i < ii; ++i) { + const currentContext = views[i].context; + currentContext.length = ii; + currentContext.index = i; + } + } + } + refreshAllViews(templateChanged = false) { + const items = this.items; + const childContext = this.childContext; + const template = this.template; + const location = this.location; + const bindView = this.bindView; + let itemsLength = items.length; + let views = this.views; + let viewsLength = views.length; + if (itemsLength === 0 || templateChanged || !this.options.recycle) { + HTMLView.disposeContiguousBatch(views); + viewsLength = 0; + } + if (viewsLength === 0) { + this.views = views = new Array(itemsLength); + for (let i = 0; i < itemsLength; ++i) { + const view = template.create(); + bindView(view, items, i, childContext); + views[i] = view; + view.insertBefore(location); + } + } else { + let i = 0; + for (; i < itemsLength; ++i) { + if (i < viewsLength) { + const view = views[i]; + bindView(view, items, i, childContext); + } else { + const view = template.create(); + bindView(view, items, i, childContext); + views.push(view); + view.insertBefore(location); + } + } + const removed = views.splice(i, viewsLength - i); + for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) { + removed[i].dispose(); + } + } + } + unbindAllViews() { + const views = this.views; + for (let i = 0, ii = views.length; i < ii; ++i) { + views[i].unbind(); + } + } + }; + RepeatDirective = class extends HTMLDirective { + /** + * Creates an instance of RepeatDirective. + * @param itemsBinding - The binding that provides the array to render. + * @param templateBinding - The template binding used to obtain a template to render for each item in the array. + * @param options - Options used to turn on special repeat features. + */ + constructor(itemsBinding, templateBinding, options) { + super(); + this.itemsBinding = itemsBinding; + this.templateBinding = templateBinding; + this.options = options; + this.createPlaceholder = DOM.createBlockPlaceholder; + enableArrayObservation(); + this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding); + this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding); + } + /** + * Creates a behavior for the provided target node. + * @param target - The node instance to create the behavior for. + */ + createBehavior(target) { + return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js + function elements(selector) { + if (selector) { + return function(value, index, array) { + return value.nodeType === 1 && value.matches(selector); + }; + } + return function(value, index, array) { + return value.nodeType === 1; + }; + } + var NodeObservationBehavior; + var init_node_observation = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/node-observation.js"() { + init_observable(); + init_platform(); + NodeObservationBehavior = class { + /** + * Creates an instance of NodeObservationBehavior. + * @param target - The target to assign the nodes property on. + * @param options - The options to use in configuring node observation. + */ + constructor(target, options) { + this.target = target; + this.options = options; + this.source = null; + } + /** + * Bind this behavior to the source. + * @param source - The source to bind to. + * @param context - The execution context that the binding is operating within. + */ + bind(source) { + const name = this.options.property; + this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name); + this.source = source; + this.updateTarget(this.computeNodes()); + if (this.shouldUpdate) { + this.observe(); + } + } + /** + * Unbinds this behavior from the source. + * @param source - The source to unbind from. + */ + unbind() { + this.updateTarget(emptyArray); + this.source = null; + if (this.shouldUpdate) { + this.disconnect(); + } + } + /** @internal */ + handleEvent() { + this.updateTarget(this.computeNodes()); + } + computeNodes() { + let nodes = this.getNodes(); + if (this.options.filter !== void 0) { + nodes = nodes.filter(this.options.filter); + } + return nodes; + } + updateTarget(value) { + this.source[this.options.property] = value; + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js + function slotted(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { property: propertyOrOptions }; + } + return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions); + } + var SlottedBehavior; + var init_slotted = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/slotted.js"() { + init_html_directive(); + init_node_observation(); + SlottedBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of SlottedBehavior. + * @param target - The slot element target to observe. + * @param options - The options to use when observing the slot. + */ + constructor(target, options) { + super(target, options); + } + /** + * Begins observation of the nodes. + */ + observe() { + this.target.addEventListener("slotchange", this); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.target.removeEventListener("slotchange", this); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + return this.target.assignedNodes(this.options); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/templating/children.js + function children(propertyOrOptions) { + if (typeof propertyOrOptions === "string") { + propertyOrOptions = { + property: propertyOrOptions + }; + } + return new AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions); + } + var ChildrenBehavior; + var init_children = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/templating/children.js"() { + init_html_directive(); + init_node_observation(); + ChildrenBehavior = class extends NodeObservationBehavior { + /** + * Creates an instance of ChildrenBehavior. + * @param target - The element target to observe children on. + * @param options - The options to use when observing the element children. + */ + constructor(target, options) { + super(target, options); + this.observer = null; + options.childList = true; + } + /** + * Begins observation of the nodes. + */ + observe() { + if (this.observer === null) { + this.observer = new MutationObserver(this.handleEvent.bind(this)); + } + this.observer.observe(this.target, this.options); + } + /** + * Disconnects observation of the nodes. + */ + disconnect() { + this.observer.disconnect(); + } + /** + * Retrieves the nodes that should be assigned to the target. + */ + getNodes() { + if ("subtree" in this.options) { + return Array.from(this.target.querySelectorAll(this.options.selector)); + } + return Array.from(this.target.childNodes); + } + }; + } + }); + + // node_modules/@microsoft/fast-element/dist/esm/index.js + var init_esm = __esm({ + "node_modules/@microsoft/fast-element/dist/esm/index.js"() { + init_platform(); + init_template(); + init_fast_element(); + init_fast_definitions(); + init_attributes(); + init_controller(); + init_compiler(); + init_element_styles(); + init_css(); + init_css_directive(); + init_view(); + init_observable(); + init_notifier(); + init_dom(); + init_binding(); + init_html_directive(); + init_ref(); + init_when(); + init_repeat(); + init_slotted(); + init_children(); + init_node_observation(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js + var StartEnd, endSlotTemplate, startSlotTemplate, endTemplate, startTemplate; + var init_start_end = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/start-end.js"() { + init_esm(); + StartEnd = class { + handleStartContentChange() { + this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0); + } + handleEndContentChange() { + this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0); + } + }; + endSlotTemplate = (context, definition) => html` + definition.end ? "end" : void 0} + > + + ${definition.end || ""} + + +`; + startSlotTemplate = (context, definition) => html` + + + ${definition.start || ""} + + +`; + endTemplate = html` + + + +`; + startTemplate = html` + + + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js + var init_accordion_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js + function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es6 = __esm({ + "node_modules/@microsoft/fast-foundation/node_modules/tslib/tslib.es6.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/di.js + function cloneArrayWithPossibleProps(source) { + const clone = source.slice(); + const keys = Object.keys(source); + const len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + clone[key] = source[key]; + } + } + return clone; + } + function getParamTypes(key) { + return (Type) => { + return Reflect.getOwnMetadata(key, Type); + }; + } + function createResolver(getter) { + return function(key) { + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor); + }; + return resolver; + }; + } + function createAllResolver(getter) { + return function(key, searchAncestors) { + searchAncestors = !!searchAncestors; + const resolver = function(target, property, descriptor) { + DI.inject(resolver)(target, property, descriptor); + }; + resolver.$isResolver = true; + resolver.resolve = function(handler, requestor) { + return getter(key, handler, requestor, searchAncestors); + }; + return resolver; + }; + } + function ignore(target, property, descriptor) { + DI.inject(ignore)(target, property, descriptor); + } + function createNewInstance(key, handler) { + return handler.getFactory(key).construct(handler); + } + function containerGetKey(d) { + return this.get(d); + } + function transformInstance(inst, transform) { + return transform(inst); + } + function isRegistry(obj) { + return typeof obj.register === "function"; + } + function isSelfRegistry(obj) { + return isRegistry(obj) && typeof obj.registerInRequestor === "boolean"; + } + function isRegisterInRequester(obj) { + return isSelfRegistry(obj) && obj.registerInRequestor; + } + function isClass(obj) { + return obj.prototype !== void 0; + } + function cacheCallbackResult(fun) { + return function(handler, requestor, resolver) { + if (cache.has(resolver)) { + return cache.get(resolver); + } + const t = fun(handler, requestor, resolver); + cache.set(resolver, t); + return t; + }; + } + function validateKey(key) { + if (key === null || key === void 0) { + throw new Error("key/value cannot be null or undefined. Are you trying to inject/register something that doesn't exist with DI?"); + } + } + function buildAllResponse(resolver, handler, requestor) { + if (resolver instanceof ResolverImpl && resolver.strategy === 4) { + const state = resolver.state; + let i = state.length; + const results = new Array(i); + while (i--) { + results[i] = state[i].resolve(handler, requestor); + } + return results; + } + return [resolver.resolve(handler, requestor)]; + } + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + function isArrayIndex(value) { + switch (typeof value) { + case "number": + return value >= 0 && (value | 0) === value; + case "string": { + const result = isNumericLookup[value]; + if (result !== void 0) { + return result; + } + const length = value.length; + if (length === 0) { + return isNumericLookup[value] = false; + } + let ch = 0; + for (let i = 0; i < length; ++i) { + ch = value.charCodeAt(i); + if (i === 0 && ch === 48 && length > 1 || ch < 48 || ch > 57) { + return isNumericLookup[value] = false; + } + } + return isNumericLookup[value] = true; + } + default: + return false; + } + } + var metadataByTarget, ResolverBuilder, DefaultResolver, ContainerConfiguration, dependencyLookup, rootDOMContainer, DI, Container, inject, defaultSingletonOptions, all, lazy, optional, newInstanceForScope, newInstanceOf, ResolverImpl, FactoryImpl, containerResolver, InstrinsicTypeNames, DILocateParentEventType, factories, ContainerImpl, cache, Registration, defaultFriendlyName, isNativeFunction, isNumericLookup; + var init_di = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/di.js"() { + init_esm(); + metadataByTarget = /* @__PURE__ */ new Map(); + if (!("metadata" in Reflect)) { + Reflect.metadata = function(key, value) { + return function(target) { + Reflect.defineMetadata(key, value, target); + }; + }; + Reflect.defineMetadata = function(key, value, target) { + let metadata = metadataByTarget.get(target); + if (metadata === void 0) { + metadataByTarget.set(target, metadata = /* @__PURE__ */ new Map()); + } + metadata.set(key, value); + }; + Reflect.getOwnMetadata = function(key, target) { + const metadata = metadataByTarget.get(target); + if (metadata !== void 0) { + return metadata.get(key); + } + return void 0; + }; + } + ResolverBuilder = class { + /** + * + * @param container - The container to create resolvers for. + * @param key - The key to register resolvers under. + */ + constructor(container, key) { + this.container = container; + this.key = key; + } + /** + * Creates a resolver for an existing object instance. + * @param value - The instance to resolve. + * @returns The resolver. + */ + instance(value) { + return this.registerResolver(0, value); + } + /** + * Creates a resolver that enforces a singleton lifetime. + * @param value - The type to create and cache the singleton for. + * @returns The resolver. + */ + singleton(value) { + return this.registerResolver(1, value); + } + /** + * Creates a resolver that creates a new instance for every dependency request. + * @param value - The type to create instances of. + * @returns - The resolver. + */ + transient(value) { + return this.registerResolver(2, value); + } + /** + * Creates a resolver that invokes a callback function for every dependency resolution + * request, allowing custom logic to return the dependency. + * @param value - The callback to call during resolution. + * @returns The resolver. + */ + callback(value) { + return this.registerResolver(3, value); + } + /** + * Creates a resolver that invokes a callback function the first time that a dependency + * resolution is requested. The returned value is then cached and provided for all + * subsequent requests. + * @param value - The callback to call during the first resolution. + * @returns The resolver. + */ + cachedCallback(value) { + return this.registerResolver(3, cacheCallbackResult(value)); + } + /** + * Aliases the current key to a different key. + * @param destinationKey - The key to point the alias to. + * @returns The resolver. + */ + aliasTo(destinationKey) { + return this.registerResolver(5, destinationKey); + } + registerResolver(strategy, state) { + const { container, key } = this; + this.container = this.key = void 0; + return container.registerResolver(key, new ResolverImpl(key, strategy, state)); + } + }; + DefaultResolver = Object.freeze({ + /** + * Disables auto-registration and throws for all un-registered dependencies. + * @param key - The key to create the resolver for. + */ + none(key) { + throw Error(`${key.toString()} not registered, did you forget to add @singleton()?`); + }, + /** + * Provides default singleton resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + singleton(key) { + return new ResolverImpl(key, 1, key); + }, + /** + * Provides default transient resolution behavior during auto-registration. + * @param key - The key to create the resolver for. + * @returns The resolver. + */ + transient(key) { + return new ResolverImpl(key, 2, key); + } + }); + ContainerConfiguration = Object.freeze({ + /** + * The default configuration used when creating a DOM-disconnected container. + * @remarks + * The default creates a root container, with no parent container. It does not handle + * owner requests and it uses singleton resolution behavior for auto-registration. + */ + default: Object.freeze({ + parentLocator: () => null, + responsibleForOwnerRequests: false, + defaultResolver: DefaultResolver.singleton + }) + }); + dependencyLookup = /* @__PURE__ */ new Map(); + rootDOMContainer = null; + DI = Object.freeze({ + /** + * Creates a new dependency injection container. + * @param config - The configuration for the container. + * @returns A newly created dependency injection container. + */ + createContainer(config) { + return new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config)); + }, + /** + * Finds the dependency injection container responsible for providing dependencies + * to the specified node. + * @param node - The node to find the responsible container for. + * @returns The container responsible for providing dependencies to the node. + * @remarks + * This will be the same as the parent container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findResponsibleContainer(node) { + const owned = node.$$container$$; + if (owned && owned.responsibleForOwnerRequests) { + return owned; + } + return DI.findParentContainer(node); + }, + /** + * Find the dependency injection container up the DOM tree from this node. + * @param node - The node to find the parent container for. + * @returns The parent container of this node. + * @remarks + * This will be the same as the responsible container if the specified node + * does not itself host a container configured with responsibleForOwnerRequests. + */ + findParentContainer(node) { + const event = new CustomEvent(DILocateParentEventType, { + bubbles: true, + composed: true, + cancelable: true, + detail: { container: void 0 } + }); + node.dispatchEvent(event); + return event.detail.container || DI.getOrCreateDOMContainer(); + }, + /** + * Returns a dependency injection container if one is explicitly owned by the specified + * node. If one is not owned, then a new container is created and assigned to the node. + * @param node - The node to find or create the container for. + * @param config - The configuration for the container if one needs to be created. + * @returns The located or created container. + * @remarks + * This API does not search for a responsible or parent container. It looks only for a container + * directly defined on the specified node and creates one at that location if one does not + * already exist. + */ + getOrCreateDOMContainer(node, config) { + if (!node) { + return rootDOMContainer || (rootDOMContainer = new ContainerImpl(null, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: () => null + }))); + } + return node.$$container$$ || new ContainerImpl(node, Object.assign({}, ContainerConfiguration.default, config, { + parentLocator: DI.findParentContainer + })); + }, + /** + * Gets the "design:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getDesignParamtypes: getParamTypes("design:paramtypes"), + /** + * Gets the "di:paramtypes" metadata for the specified type. + * @param Type - The type to get the metadata for. + * @returns The metadata array or undefined if no metadata is found. + */ + getAnnotationParamtypes: getParamTypes("di:paramtypes"), + /** + * + * @param Type - Gets the "di:paramtypes" metadata for the specified type. If none is found, + * an empty metadata array is created and added. + * @returns The metadata array. + */ + getOrCreateAnnotationParamTypes(Type) { + let annotationParamtypes = this.getAnnotationParamtypes(Type); + if (annotationParamtypes === void 0) { + Reflect.defineMetadata("di:paramtypes", annotationParamtypes = [], Type); + } + return annotationParamtypes; + }, + /** + * Gets the dependency keys representing what is needed to instantiate the specified type. + * @param Type - The type to get the dependencies for. + * @returns An array of dependency keys. + */ + getDependencies(Type) { + let dependencies = dependencyLookup.get(Type); + if (dependencies === void 0) { + const inject2 = Type.inject; + if (inject2 === void 0) { + const designParamtypes = DI.getDesignParamtypes(Type); + const annotationParamtypes = DI.getAnnotationParamtypes(Type); + if (designParamtypes === void 0) { + if (annotationParamtypes === void 0) { + const Proto = Object.getPrototypeOf(Type); + if (typeof Proto === "function" && Proto !== Function.prototype) { + dependencies = cloneArrayWithPossibleProps(DI.getDependencies(Proto)); + } else { + dependencies = []; + } + } else { + dependencies = cloneArrayWithPossibleProps(annotationParamtypes); + } + } else if (annotationParamtypes === void 0) { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + } else { + dependencies = cloneArrayWithPossibleProps(designParamtypes); + let len = annotationParamtypes.length; + let auAnnotationParamtype; + for (let i = 0; i < len; ++i) { + auAnnotationParamtype = annotationParamtypes[i]; + if (auAnnotationParamtype !== void 0) { + dependencies[i] = auAnnotationParamtype; + } + } + const keys = Object.keys(annotationParamtypes); + len = keys.length; + let key; + for (let i = 0; i < len; ++i) { + key = keys[i]; + if (!isArrayIndex(key)) { + dependencies[key] = annotationParamtypes[key]; + } + } + } + } else { + dependencies = cloneArrayWithPossibleProps(inject2); + } + dependencyLookup.set(Type, dependencies); + } + return dependencies; + }, + /** + * Defines a property on a web component class. The value of this property will + * be resolved from the dependency injection container responsible for the element + * instance, based on where it is connected in the DOM. + * @param target - The target to define the property on. + * @param propertyName - The name of the property to define. + * @param key - The dependency injection key. + * @param respectConnection - Indicates whether or not to update the property value if the + * hosting component is disconnected and then re-connected at a different location in the DOM. + * @remarks + * The respectConnection option is only applicable to elements that descend from FASTElement. + */ + defineProperty(target, propertyName, key, respectConnection = false) { + const diPropertyKey = `$di_${propertyName}`; + Reflect.defineProperty(target, propertyName, { + get: function() { + let value = this[diPropertyKey]; + if (value === void 0) { + const container = this instanceof HTMLElement ? DI.findResponsibleContainer(this) : DI.getOrCreateDOMContainer(); + value = container.get(key); + this[diPropertyKey] = value; + if (respectConnection && this instanceof FASTElement) { + const notifier = this.$fastController; + const handleChange = () => { + const newContainer = DI.findResponsibleContainer(this); + const newValue = newContainer.get(key); + const oldValue = this[diPropertyKey]; + if (newValue !== oldValue) { + this[diPropertyKey] = value; + notifier.notify(propertyName); + } + }; + notifier.subscribe({ handleChange }, "isConnected"); + } + } + return value; + } + }); + }, + /** + * Creates a dependency injection key. + * @param nameConfigOrCallback - A friendly name for the key or a lambda that configures a + * default resolution for the dependency. + * @param configuror - If a friendly name was provided for the first parameter, then an optional + * lambda that configures a default resolution for the dependency can be provided second. + * @returns The created key. + * @remarks + * The created key can be used as a property decorator or constructor parameter decorator, + * in addition to its standard use in an inject array or through direct container APIs. + */ + createInterface(nameConfigOrCallback, configuror) { + const configure = typeof nameConfigOrCallback === "function" ? nameConfigOrCallback : configuror; + const friendlyName = typeof nameConfigOrCallback === "string" ? nameConfigOrCallback : nameConfigOrCallback && "friendlyName" in nameConfigOrCallback ? nameConfigOrCallback.friendlyName || defaultFriendlyName : defaultFriendlyName; + const respectConnection = typeof nameConfigOrCallback === "string" ? false : nameConfigOrCallback && "respectConnection" in nameConfigOrCallback ? nameConfigOrCallback.respectConnection || false : false; + const Interface = function(target, property, index) { + if (target == null || new.target !== void 0) { + throw new Error(`No registration for interface: '${Interface.friendlyName}'`); + } + if (property) { + DI.defineProperty(target, property, Interface, respectConnection); + } else { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + annotationParamtypes[index] = Interface; + } + }; + Interface.$isInterface = true; + Interface.friendlyName = friendlyName == null ? "(anonymous)" : friendlyName; + if (configure != null) { + Interface.register = function(container, key) { + return configure(new ResolverBuilder(container, key !== null && key !== void 0 ? key : Interface)); + }; + } + Interface.toString = function toString() { + return `InterfaceSymbol<${Interface.friendlyName}>`; + }; + return Interface; + }, + /** + * A decorator that specifies what to inject into its target. + * @param dependencies - The dependencies to inject. + * @returns The decorator to be applied to the target class. + * @remarks + * The decorator can be used to decorate a class, listing all of the classes dependencies. + * Or it can be used to decorate a constructor paramter, indicating what to inject for that + * parameter. + * Or it can be used for a web component property, indicating what that property should resolve to. + */ + inject(...dependencies) { + return function(target, key, descriptor) { + if (typeof descriptor === "number") { + const annotationParamtypes = DI.getOrCreateAnnotationParamTypes(target); + const dep = dependencies[0]; + if (dep !== void 0) { + annotationParamtypes[descriptor] = dep; + } + } else if (key) { + DI.defineProperty(target, key, dependencies[0]); + } else { + const annotationParamtypes = descriptor ? DI.getOrCreateAnnotationParamTypes(descriptor.value) : DI.getOrCreateAnnotationParamTypes(target); + let dep; + for (let i = 0; i < dependencies.length; ++i) { + dep = dependencies[i]; + if (dep !== void 0) { + annotationParamtypes[i] = dep; + } + } + } + }; + }, + /** + * Registers the `target` class as a transient dependency; each time the dependency is resolved + * a new instance will be created. + * + * @param target - The class / constructor function to register as transient. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.transient(Foo); + * ``` + * + * @example + * Inline declaration + * + * ```ts + * const Foo = DI.transient(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + transient(target) { + target.register = function register(container) { + const registration = Registration.transient(target, target); + return registration.register(container); + }; + target.registerInRequestor = false; + return target; + }, + /** + * Registers the `target` class as a singleton dependency; the class will only be created once. Each + * consecutive time the dependency is resolved, the same instance will be returned. + * + * @param target - The class / constructor function to register as a singleton. + * @returns The same class, with a static `register` method that takes a container and returns the appropriate resolver. + * @example + * On an existing class + * ```ts + * class Foo { } + * DI.singleton(Foo); + * ``` + * + * @example + * Inline declaration + * ```ts + * const Foo = DI.singleton(class { }); + * // Foo is now strongly typed with register + * Foo.register(container); + * ``` + * + * @public + */ + singleton(target, options = defaultSingletonOptions) { + target.register = function register(container) { + const registration = Registration.singleton(target, target); + return registration.register(container); + }; + target.registerInRequestor = options.scoped; + return target; + } + }); + Container = DI.createInterface("Container"); + inject = DI.inject; + defaultSingletonOptions = { scoped: false }; + all = createAllResolver((key, handler, requestor, searchAncestors) => requestor.getAll(key, searchAncestors)); + lazy = createResolver((key, handler, requestor) => { + return () => requestor.get(key); + }); + optional = createResolver((key, handler, requestor) => { + if (requestor.has(key, true)) { + return requestor.get(key); + } else { + return void 0; + } + }); + ignore.$isResolver = true; + ignore.resolve = () => void 0; + newInstanceForScope = createResolver((key, handler, requestor) => { + const instance = createNewInstance(key, handler); + const resolver = new ResolverImpl(key, 0, instance); + requestor.registerResolver(key, resolver); + return instance; + }); + newInstanceOf = createResolver((key, handler, _requestor) => createNewInstance(key, handler)); + ResolverImpl = class { + constructor(key, strategy, state) { + this.key = key; + this.strategy = strategy; + this.state = state; + this.resolving = false; + } + get $isResolver() { + return true; + } + register(container) { + return container.registerResolver(this.key, this); + } + resolve(handler, requestor) { + switch (this.strategy) { + case 0: + return this.state; + case 1: { + if (this.resolving) { + throw new Error(`Cyclic dependency found: ${this.state.name}`); + } + this.resolving = true; + this.state = handler.getFactory(this.state).construct(requestor); + this.strategy = 0; + this.resolving = false; + return this.state; + } + case 2: { + const factory = handler.getFactory(this.state); + if (factory === null) { + throw new Error(`Resolver for ${String(this.key)} returned a null factory`); + } + return factory.construct(requestor); + } + case 3: + return this.state(handler, requestor, this); + case 4: + return this.state[0].resolve(handler, requestor); + case 5: + return requestor.get(this.state); + default: + throw new Error(`Invalid resolver strategy specified: ${this.strategy}.`); + } + } + getFactory(container) { + var _a, _b, _c; + switch (this.strategy) { + case 1: + case 2: + return container.getFactory(this.state); + case 5: + return (_c = (_b = (_a = container.getResolver(this.state)) === null || _a === void 0 ? void 0 : _a.getFactory) === null || _b === void 0 ? void 0 : _b.call(_a, container)) !== null && _c !== void 0 ? _c : null; + default: + return null; + } + } + }; + FactoryImpl = class { + constructor(Type, dependencies) { + this.Type = Type; + this.dependencies = dependencies; + this.transformers = null; + } + construct(container, dynamicDependencies) { + let instance; + if (dynamicDependencies === void 0) { + instance = new this.Type(...this.dependencies.map(containerGetKey, container)); + } else { + instance = new this.Type(...this.dependencies.map(containerGetKey, container), ...dynamicDependencies); + } + if (this.transformers == null) { + return instance; + } + return this.transformers.reduce(transformInstance, instance); + } + registerTransformer(transformer) { + (this.transformers || (this.transformers = [])).push(transformer); + } + }; + containerResolver = { + $isResolver: true, + resolve(handler, requestor) { + return requestor; + } + }; + InstrinsicTypeNames = /* @__PURE__ */ new Set([ + "Array", + "ArrayBuffer", + "Boolean", + "DataView", + "Date", + "Error", + "EvalError", + "Float32Array", + "Float64Array", + "Function", + "Int8Array", + "Int16Array", + "Int32Array", + "Map", + "Number", + "Object", + "Promise", + "RangeError", + "ReferenceError", + "RegExp", + "Set", + "SharedArrayBuffer", + "String", + "SyntaxError", + "TypeError", + "Uint8Array", + "Uint8ClampedArray", + "Uint16Array", + "Uint32Array", + "URIError", + "WeakMap", + "WeakSet" + ]); + DILocateParentEventType = "__DI_LOCATE_PARENT__"; + factories = /* @__PURE__ */ new Map(); + ContainerImpl = class _ContainerImpl { + constructor(owner, config) { + this.owner = owner; + this.config = config; + this._parent = void 0; + this.registerDepth = 0; + this.context = null; + if (owner !== null) { + owner.$$container$$ = this; + } + this.resolvers = /* @__PURE__ */ new Map(); + this.resolvers.set(Container, containerResolver); + if (owner instanceof Node) { + owner.addEventListener(DILocateParentEventType, (e) => { + if (e.composedPath()[0] !== this.owner) { + e.detail.container = this; + e.stopImmediatePropagation(); + } + }); + } + } + get parent() { + if (this._parent === void 0) { + this._parent = this.config.parentLocator(this.owner); + } + return this._parent; + } + get depth() { + return this.parent === null ? 0 : this.parent.depth + 1; + } + get responsibleForOwnerRequests() { + return this.config.responsibleForOwnerRequests; + } + registerWithContext(context, ...params) { + this.context = context; + this.register(...params); + this.context = null; + return this; + } + register(...params) { + if (++this.registerDepth === 100) { + throw new Error("Unable to autoregister dependency"); + } + let current; + let keys; + let value; + let j; + let jj; + const context = this.context; + for (let i = 0, ii = params.length; i < ii; ++i) { + current = params[i]; + if (!isObject(current)) { + continue; + } + if (isRegistry(current)) { + current.register(this, context); + } else if (isClass(current)) { + Registration.singleton(current, current).register(this); + } else { + keys = Object.keys(current); + j = 0; + jj = keys.length; + for (; j < jj; ++j) { + value = current[keys[j]]; + if (!isObject(value)) { + continue; + } + if (isRegistry(value)) { + value.register(this, context); + } else { + this.register(value); + } + } + } + } + --this.registerDepth; + return this; + } + registerResolver(key, resolver) { + validateKey(key); + const resolvers = this.resolvers; + const result = resolvers.get(key); + if (result == null) { + resolvers.set(key, resolver); + } else if (result instanceof ResolverImpl && result.strategy === 4) { + result.state.push(resolver); + } else { + resolvers.set(key, new ResolverImpl(key, 4, [result, resolver])); + } + return resolver; + } + registerTransformer(key, transformer) { + const resolver = this.getResolver(key); + if (resolver == null) { + return false; + } + if (resolver.getFactory) { + const factory = resolver.getFactory(this); + if (factory == null) { + return false; + } + factory.registerTransformer(transformer); + return true; + } + return false; + } + getResolver(key, autoRegister = true) { + validateKey(key); + if (key.resolve !== void 0) { + return key; + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + return autoRegister ? this.jitRegister(key, handler) : null; + } + current = current.parent; + } else { + return resolver; + } + } + return null; + } + has(key, searchAncestors = false) { + return this.resolvers.has(key) ? true : searchAncestors && this.parent != null ? this.parent.has(key, true) : false; + } + get(key) { + validateKey(key); + if (key.$isResolver) { + return key.resolve(this, this); + } + let current = this; + let resolver; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + if (current.parent == null) { + const handler = isRegisterInRequester(key) ? this : current; + resolver = this.jitRegister(key, handler); + return resolver.resolve(current, this); + } + current = current.parent; + } else { + return resolver.resolve(current, this); + } + } + throw new Error(`Unable to resolve key: ${String(key)}`); + } + getAll(key, searchAncestors = false) { + validateKey(key); + const requestor = this; + let current = requestor; + let resolver; + if (searchAncestors) { + let resolutions = emptyArray; + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver != null) { + resolutions = resolutions.concat( + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + buildAllResponse(resolver, current, requestor) + ); + } + current = current.parent; + } + return resolutions; + } else { + while (current != null) { + resolver = current.resolvers.get(key); + if (resolver == null) { + current = current.parent; + if (current == null) { + return emptyArray; + } + } else { + return buildAllResponse(resolver, current, requestor); + } + } + } + return emptyArray; + } + getFactory(Type) { + let factory = factories.get(Type); + if (factory === void 0) { + if (isNativeFunction(Type)) { + throw new Error(`${Type.name} is a native function and therefore cannot be safely constructed by DI. If this is intentional, please use a callback or cachedCallback resolver.`); + } + factories.set(Type, factory = new FactoryImpl(Type, DI.getDependencies(Type))); + } + return factory; + } + registerFactory(key, factory) { + factories.set(key, factory); + } + createChild(config) { + return new _ContainerImpl(null, Object.assign({}, this.config, config, { parentLocator: () => this })); + } + jitRegister(keyAsValue, handler) { + if (typeof keyAsValue !== "function") { + throw new Error(`Attempted to jitRegister something that is not a constructor: '${keyAsValue}'. Did you forget to register this dependency?`); + } + if (InstrinsicTypeNames.has(keyAsValue.name)) { + throw new Error(`Attempted to jitRegister an intrinsic type: ${keyAsValue.name}. Did you forget to add @inject(Key)`); + } + if (isRegistry(keyAsValue)) { + const registrationResolver = keyAsValue.register(handler); + if (!(registrationResolver instanceof Object) || registrationResolver.resolve == null) { + const newResolver = handler.resolvers.get(keyAsValue); + if (newResolver != void 0) { + return newResolver; + } + throw new Error("A valid resolver was not returned from the static register method"); + } + return registrationResolver; + } else if (keyAsValue.$isInterface) { + throw new Error(`Attempted to jitRegister an interface: ${keyAsValue.friendlyName}`); + } else { + const resolver = this.config.defaultResolver(keyAsValue, handler); + handler.resolvers.set(keyAsValue, resolver); + return resolver; + } + } + }; + cache = /* @__PURE__ */ new WeakMap(); + Registration = Object.freeze({ + /** + * Allows you to pass an instance. + * Every time you request this {@link Key} you will get this instance back. + * + * @example + * ``` + * Registration.instance(Foo, new Foo())); + * ``` + * + * @param key - The key to register the instance under. + * @param value - The instance to return when the key is requested. + */ + instance(key, value) { + return new ResolverImpl(key, 0, value); + }, + /** + * Creates an instance from the class. + * Every time you request this {@link Key} you will get the same one back. + * + * @example + * ``` + * Registration.singleton(Foo, Foo); + * ``` + * + * @param key - The key to register the singleton under. + * @param value - The class to instantiate as a singleton when first requested. + */ + singleton(key, value) { + return new ResolverImpl(key, 1, value); + }, + /** + * Creates an instance from a class. + * Every time you request this {@link Key} you will get a new instance. + * + * @example + * ``` + * Registration.instance(Foo, Foo); + * ``` + * + * @param key - The key to register the instance type under. + * @param value - The class to instantiate each time the key is requested. + */ + transient(key, value) { + return new ResolverImpl(key, 2, value); + }, + /** + * Delegates to a callback function to provide the dependency. + * Every time you request this {@link Key} the callback will be invoked to provide + * the dependency. + * + * @example + * ``` + * Registration.callback(Foo, () => new Foo()); + * Registration.callback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + */ + callback(key, callback) { + return new ResolverImpl(key, 3, callback); + }, + /** + * Delegates to a callback function to provide the dependency and then caches the + * dependency for future requests. + * + * @example + * ``` + * Registration.cachedCallback(Foo, () => new Foo()); + * Registration.cachedCallback(Bar, (c: Container) => new Bar(c.get(Foo))); + * ``` + * + * @param key - The key to register the callback for. + * @param callback - The function that is expected to return the dependency. + * @remarks + * If you pass the same Registration to another container, the same cached value will be used. + * Should all references to the resolver returned be removed, the cache will expire. + */ + cachedCallback(key, callback) { + return new ResolverImpl(key, 3, cacheCallbackResult(callback)); + }, + /** + * Creates an alternate {@link Key} to retrieve an instance by. + * + * @example + * ``` + * Register.singleton(Foo, Foo) + * Register.aliasTo(Foo, MyFoos); + * + * container.getAll(MyFoos) // contains an instance of Foo + * ``` + * + * @param originalKey - The original key that has been registered. + * @param aliasKey - The alias to the original key. + */ + aliasTo(originalKey, aliasKey) { + return new ResolverImpl(aliasKey, 5, originalKey); + } + }); + defaultFriendlyName = "(anonymous)"; + isNativeFunction = /* @__PURE__ */ (function() { + const lookup = /* @__PURE__ */ new WeakMap(); + let isNative = false; + let sourceText = ""; + let i = 0; + return function(fn) { + isNative = lookup.get(fn); + if (isNative === void 0) { + sourceText = fn.toString(); + i = sourceText.length; + isNative = // 29 is the length of 'function () { [native code] }' which is the smallest length of a native function string + i >= 29 && // 100 seems to be a safe upper bound of the max length of a native function. In Chrome and FF it's 56, in Edge it's 61. + i <= 100 && // This whole heuristic *could* be tricked by a comment. Do we need to care about that? + sourceText.charCodeAt(i - 1) === 125 && // } + // TODO: the spec is a little vague about the precise constraints, so we do need to test this across various browsers to make sure just one whitespace is a safe assumption. + sourceText.charCodeAt(i - 2) <= 32 && // whitespace + sourceText.charCodeAt(i - 3) === 93 && // ] + sourceText.charCodeAt(i - 4) === 101 && // e + sourceText.charCodeAt(i - 5) === 100 && // d + sourceText.charCodeAt(i - 6) === 111 && // o + sourceText.charCodeAt(i - 7) === 99 && // c + sourceText.charCodeAt(i - 8) === 32 && // + sourceText.charCodeAt(i - 9) === 101 && // e + sourceText.charCodeAt(i - 10) === 118 && // v + sourceText.charCodeAt(i - 11) === 105 && // i + sourceText.charCodeAt(i - 12) === 116 && // t + sourceText.charCodeAt(i - 13) === 97 && // a + sourceText.charCodeAt(i - 14) === 110 && // n + sourceText.charCodeAt(i - 15) === 88; + lookup.set(fn, isNative); + } + return isNative; + }; + })(); + isNumericLookup = {}; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js + function presentationKeyFromTag(tagName) { + return `${tagName.toLowerCase()}:presentation`; + } + var presentationRegistry, ComponentPresentation, DefaultComponentPresentation; + var init_component_presentation = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/component-presentation.js"() { + init_esm(); + init_di(); + presentationRegistry = /* @__PURE__ */ new Map(); + ComponentPresentation = Object.freeze({ + /** + * Defines a component presentation for an element. + * @param tagName - The element name to define the presentation for. + * @param presentation - The presentation that will be applied to matching elements. + * @param container - The dependency injection container to register the configuration in. + * @public + */ + define(tagName, presentation, container) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === void 0) { + presentationRegistry.set(key, presentation); + } else { + presentationRegistry.set(key, false); + } + container.register(Registration.instance(key, presentation)); + }, + /** + * Finds a component presentation for the specified element name, + * searching the DOM hierarchy starting from the provided element. + * @param tagName - The name of the element to locate the presentation for. + * @param element - The element to begin the search from. + * @returns The component presentation or null if none is found. + * @public + */ + forTag(tagName, element) { + const key = presentationKeyFromTag(tagName); + const existing = presentationRegistry.get(key); + if (existing === false) { + const container = DI.findResponsibleContainer(element); + return container.get(key); + } + return existing || null; + } + }); + DefaultComponentPresentation = class { + /** + * Creates an instance of DefaultComponentPresentation. + * @param template - The template to apply to the element. + * @param styles - The styles to apply to the element. + * @public + */ + constructor(template, styles) { + this.template = template || null; + this.styles = styles === void 0 ? null : Array.isArray(styles) ? ElementStyles.create(styles) : styles instanceof ElementStyles ? styles : ElementStyles.create([styles]); + } + /** + * Applies the presentation details to the specified element. + * @param element - The element to apply the presentation details to. + * @public + */ + applyTo(element) { + const controller = element.$fastController; + if (controller.template === null) { + controller.template = this.template; + } + if (controller.styles === null) { + controller.styles = this.styles; + } + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js + function resolveOption(option, context, definition) { + if (typeof option === "function") { + return option(context, definition); + } + return option; + } + var FoundationElement, FoundationElementRegistry; + var init_foundation_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/foundation-element.js"() { + init_tslib_es6(); + init_esm(); + init_component_presentation(); + FoundationElement = class _FoundationElement extends FASTElement { + constructor() { + super(...arguments); + this._presentation = void 0; + } + /** + * A property which resolves the ComponentPresentation instance + * for the current component. + * @public + */ + get $presentation() { + if (this._presentation === void 0) { + this._presentation = ComponentPresentation.forTag(this.tagName, this); + } + return this._presentation; + } + templateChanged() { + if (this.template !== void 0) { + this.$fastController.template = this.template; + } + } + stylesChanged() { + if (this.styles !== void 0) { + this.$fastController.styles = this.styles; + } + } + /** + * The connected callback for this FASTElement. + * @remarks + * This method is invoked by the platform whenever this FoundationElement + * becomes connected to the document. + * @public + */ + connectedCallback() { + if (this.$presentation !== null) { + this.$presentation.applyTo(this); + } + super.connectedCallback(); + } + /** + * Defines an element registry function with a set of element definition defaults. + * @param elementDefinition - The definition of the element to create the registry + * function for. + * @public + */ + static compose(elementDefinition) { + return (overrideDefinition = {}) => new FoundationElementRegistry(this === _FoundationElement ? class extends _FoundationElement { + } : this, elementDefinition, overrideDefinition); + } + }; + __decorate([ + observable + ], FoundationElement.prototype, "template", void 0); + __decorate([ + observable + ], FoundationElement.prototype, "styles", void 0); + FoundationElementRegistry = class { + constructor(type, elementDefinition, overrideDefinition) { + this.type = type; + this.elementDefinition = elementDefinition; + this.overrideDefinition = overrideDefinition; + this.definition = Object.assign(Object.assign({}, this.elementDefinition), this.overrideDefinition); + } + register(container, context) { + const definition = this.definition; + const overrideDefinition = this.overrideDefinition; + const prefix = definition.prefix || context.elementPrefix; + const name = `${prefix}-${definition.baseName}`; + context.tryDefineElement({ + name, + type: this.type, + baseClass: this.elementDefinition.baseClass, + callback: (x) => { + const presentation = new DefaultComponentPresentation(resolveOption(definition.template, x, definition), resolveOption(definition.styles, x, definition)); + x.definePresentation(presentation); + let shadowOptions = resolveOption(definition.shadowOptions, x, definition); + if (x.shadowRootMode) { + if (shadowOptions) { + if (!overrideDefinition.shadowOptions) { + shadowOptions.mode = x.shadowRootMode; + } + } else if (shadowOptions !== null) { + shadowOptions = { mode: x.shadowRootMode }; + } + } + x.defineElement({ + elementOptions: resolveOption(definition.elementOptions, x, definition), + shadowOptions, + attributes: resolveOption(definition.attributes, x, definition) + }); + } + }); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js + function applyMixins(derivedCtor, ...baseCtors) { + const derivedAttributes = AttributeConfiguration.locate(derivedCtor); + baseCtors.forEach((baseCtor) => { + Object.getOwnPropertyNames(baseCtor.prototype).forEach((name) => { + if (name !== "constructor") { + Object.defineProperty( + derivedCtor.prototype, + name, + /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */ + Object.getOwnPropertyDescriptor(baseCtor.prototype, name) + ); + } + }); + const baseAttributes = AttributeConfiguration.locate(baseCtor); + baseAttributes.forEach((x) => derivedAttributes.push(x)); + }); + } + var init_apply_mixins = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/apply-mixins.js"() { + init_esm(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js + var AccordionItem; + var init_accordion_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/accordion-item.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_start_end(); + init_apply_mixins(); + AccordionItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.headinglevel = 2; + this.expanded = false; + this.clickHandler = (e) => { + this.expanded = !this.expanded; + this.change(); + }; + this.change = () => { + this.$emit("change"); + }; + } + }; + __decorate([ + attr({ + attribute: "heading-level", + mode: "fromView", + converter: nullableNumberConverter + }) + ], AccordionItem.prototype, "headinglevel", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], AccordionItem.prototype, "expanded", void 0); + __decorate([ + attr + ], AccordionItem.prototype, "id", void 0); + applyMixins(AccordionItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js + var init_accordion_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion-item/index.js"() { + init_accordion_item_template(); + init_accordion_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js + var init_accordion_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.template.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/aria.js + var Orientation; + var init_aria = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/aria.js"() { + Orientation = { + horizontal: "horizontal", + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/array.js + function findLastIndex(array, predicate) { + let k = array.length; + while (k--) { + if (predicate(array[k], k, array)) { + return k; + } + } + return -1; + } + var init_array = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/array.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/class-names.js + var init_class_names = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/class-names.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-dom.js + function canUseDOM() { + return !!(typeof window !== "undefined" && window.document && window.document.createElement); + } + var init_can_use_dom = __esm({ + "node_modules/exenv-es6/dist/can-use-dom.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-event-listeners.js + var init_can_use_event_listeners = __esm({ + "node_modules/exenv-es6/dist/can-use-event-listeners.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-viewport.js + var init_can_use_viewport = __esm({ + "node_modules/exenv-es6/dist/can-use-viewport.js"() { + } + }); + + // node_modules/exenv-es6/dist/can-use-workers.js + var init_can_use_workers = __esm({ + "node_modules/exenv-es6/dist/can-use-workers.js"() { + } + }); + + // node_modules/exenv-es6/dist/index.js + var init_dist = __esm({ + "node_modules/exenv-es6/dist/index.js"() { + init_can_use_dom(); + init_can_use_event_listeners(); + init_can_use_viewport(); + init_can_use_workers(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/dom.js + function isHTMLElement(...args) { + return args.every((arg) => arg instanceof HTMLElement); + } + function getDisplayedNodes(rootNode, selector) { + if (!rootNode || !selector || !isHTMLElement(rootNode)) { + return; + } + const nodes = Array.from(rootNode.querySelectorAll(selector)); + return nodes.filter((node) => node.offsetParent !== null); + } + function getNonce() { + const node = document.querySelector('meta[property="csp-nonce"]'); + if (node) { + return node.getAttribute("content"); + } else { + return null; + } + } + function canUseFocusVisible() { + if (typeof _canUseFocusVisible === "boolean") { + return _canUseFocusVisible; + } + if (!canUseDOM()) { + _canUseFocusVisible = false; + return _canUseFocusVisible; + } + const styleElement = document.createElement("style"); + const styleNonce = getNonce(); + if (styleNonce !== null) { + styleElement.setAttribute("nonce", styleNonce); + } + document.head.appendChild(styleElement); + try { + styleElement.sheet.insertRule("foo:focus-visible {color:inherit}", 0); + _canUseFocusVisible = true; + } catch (e) { + _canUseFocusVisible = false; + } finally { + document.head.removeChild(styleElement); + } + return _canUseFocusVisible; + } + var _canUseFocusVisible; + var init_dom2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/dom.js"() { + init_dist(); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/events.js + var eventFocus, eventFocusIn, eventFocusOut, eventKeyDown, eventResize, eventScroll; + var init_events = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/events.js"() { + eventFocus = "focus"; + eventFocusIn = "focusin"; + eventFocusOut = "focusout"; + eventKeyDown = "keydown"; + eventResize = "resize"; + eventScroll = "scroll"; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/html.js + var init_html = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/html.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/key-codes.js + var KeyCodes, keyArrowDown, keyArrowLeft, keyArrowRight, keyArrowUp, keyEnter, keyEscape, keyHome, keyEnd, keyFunction2, keyPageDown, keyPageUp, keySpace, keyTab, keyBackspace, keyDelete, ArrowKeys; + var init_key_codes = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/key-codes.js"() { + (function(KeyCodes2) { + KeyCodes2[KeyCodes2["alt"] = 18] = "alt"; + KeyCodes2[KeyCodes2["arrowDown"] = 40] = "arrowDown"; + KeyCodes2[KeyCodes2["arrowLeft"] = 37] = "arrowLeft"; + KeyCodes2[KeyCodes2["arrowRight"] = 39] = "arrowRight"; + KeyCodes2[KeyCodes2["arrowUp"] = 38] = "arrowUp"; + KeyCodes2[KeyCodes2["back"] = 8] = "back"; + KeyCodes2[KeyCodes2["backSlash"] = 220] = "backSlash"; + KeyCodes2[KeyCodes2["break"] = 19] = "break"; + KeyCodes2[KeyCodes2["capsLock"] = 20] = "capsLock"; + KeyCodes2[KeyCodes2["closeBracket"] = 221] = "closeBracket"; + KeyCodes2[KeyCodes2["colon"] = 186] = "colon"; + KeyCodes2[KeyCodes2["colon2"] = 59] = "colon2"; + KeyCodes2[KeyCodes2["comma"] = 188] = "comma"; + KeyCodes2[KeyCodes2["ctrl"] = 17] = "ctrl"; + KeyCodes2[KeyCodes2["delete"] = 46] = "delete"; + KeyCodes2[KeyCodes2["end"] = 35] = "end"; + KeyCodes2[KeyCodes2["enter"] = 13] = "enter"; + KeyCodes2[KeyCodes2["equals"] = 187] = "equals"; + KeyCodes2[KeyCodes2["equals2"] = 61] = "equals2"; + KeyCodes2[KeyCodes2["equals3"] = 107] = "equals3"; + KeyCodes2[KeyCodes2["escape"] = 27] = "escape"; + KeyCodes2[KeyCodes2["forwardSlash"] = 191] = "forwardSlash"; + KeyCodes2[KeyCodes2["function1"] = 112] = "function1"; + KeyCodes2[KeyCodes2["function10"] = 121] = "function10"; + KeyCodes2[KeyCodes2["function11"] = 122] = "function11"; + KeyCodes2[KeyCodes2["function12"] = 123] = "function12"; + KeyCodes2[KeyCodes2["function2"] = 113] = "function2"; + KeyCodes2[KeyCodes2["function3"] = 114] = "function3"; + KeyCodes2[KeyCodes2["function4"] = 115] = "function4"; + KeyCodes2[KeyCodes2["function5"] = 116] = "function5"; + KeyCodes2[KeyCodes2["function6"] = 117] = "function6"; + KeyCodes2[KeyCodes2["function7"] = 118] = "function7"; + KeyCodes2[KeyCodes2["function8"] = 119] = "function8"; + KeyCodes2[KeyCodes2["function9"] = 120] = "function9"; + KeyCodes2[KeyCodes2["home"] = 36] = "home"; + KeyCodes2[KeyCodes2["insert"] = 45] = "insert"; + KeyCodes2[KeyCodes2["menu"] = 93] = "menu"; + KeyCodes2[KeyCodes2["minus"] = 189] = "minus"; + KeyCodes2[KeyCodes2["minus2"] = 109] = "minus2"; + KeyCodes2[KeyCodes2["numLock"] = 144] = "numLock"; + KeyCodes2[KeyCodes2["numPad0"] = 96] = "numPad0"; + KeyCodes2[KeyCodes2["numPad1"] = 97] = "numPad1"; + KeyCodes2[KeyCodes2["numPad2"] = 98] = "numPad2"; + KeyCodes2[KeyCodes2["numPad3"] = 99] = "numPad3"; + KeyCodes2[KeyCodes2["numPad4"] = 100] = "numPad4"; + KeyCodes2[KeyCodes2["numPad5"] = 101] = "numPad5"; + KeyCodes2[KeyCodes2["numPad6"] = 102] = "numPad6"; + KeyCodes2[KeyCodes2["numPad7"] = 103] = "numPad7"; + KeyCodes2[KeyCodes2["numPad8"] = 104] = "numPad8"; + KeyCodes2[KeyCodes2["numPad9"] = 105] = "numPad9"; + KeyCodes2[KeyCodes2["numPadDivide"] = 111] = "numPadDivide"; + KeyCodes2[KeyCodes2["numPadDot"] = 110] = "numPadDot"; + KeyCodes2[KeyCodes2["numPadMinus"] = 109] = "numPadMinus"; + KeyCodes2[KeyCodes2["numPadMultiply"] = 106] = "numPadMultiply"; + KeyCodes2[KeyCodes2["numPadPlus"] = 107] = "numPadPlus"; + KeyCodes2[KeyCodes2["openBracket"] = 219] = "openBracket"; + KeyCodes2[KeyCodes2["pageDown"] = 34] = "pageDown"; + KeyCodes2[KeyCodes2["pageUp"] = 33] = "pageUp"; + KeyCodes2[KeyCodes2["period"] = 190] = "period"; + KeyCodes2[KeyCodes2["print"] = 44] = "print"; + KeyCodes2[KeyCodes2["quote"] = 222] = "quote"; + KeyCodes2[KeyCodes2["scrollLock"] = 145] = "scrollLock"; + KeyCodes2[KeyCodes2["shift"] = 16] = "shift"; + KeyCodes2[KeyCodes2["space"] = 32] = "space"; + KeyCodes2[KeyCodes2["tab"] = 9] = "tab"; + KeyCodes2[KeyCodes2["tilde"] = 192] = "tilde"; + KeyCodes2[KeyCodes2["windowsLeft"] = 91] = "windowsLeft"; + KeyCodes2[KeyCodes2["windowsOpera"] = 219] = "windowsOpera"; + KeyCodes2[KeyCodes2["windowsRight"] = 92] = "windowsRight"; + })(KeyCodes || (KeyCodes = {})); + keyArrowDown = "ArrowDown"; + keyArrowLeft = "ArrowLeft"; + keyArrowRight = "ArrowRight"; + keyArrowUp = "ArrowUp"; + keyEnter = "Enter"; + keyEscape = "Escape"; + keyHome = "Home"; + keyEnd = "End"; + keyFunction2 = "F2"; + keyPageDown = "PageDown"; + keyPageUp = "PageUp"; + keySpace = " "; + keyTab = "Tab"; + keyBackspace = "Backspace"; + keyDelete = "Delete"; + ArrowKeys = { + ArrowDown: keyArrowDown, + ArrowLeft: keyArrowLeft, + ArrowRight: keyArrowRight, + ArrowUp: keyArrowUp + }; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/localization.js + var Direction; + var init_localization = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/localization.js"() { + (function(Direction2) { + Direction2["ltr"] = "ltr"; + Direction2["rtl"] = "rtl"; + })(Direction || (Direction = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/numbers.js + function wrapInBounds(min, max, value) { + if (value < min) { + return max; + } else if (value > max) { + return min; + } + return value; + } + function limit(min, max, value) { + return Math.min(Math.max(value, min), max); + } + function inRange(value, min, max = 0) { + [min, max] = [min, max].sort((a, b) => a - b); + return min <= value && value < max; + } + var init_numbers = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/numbers.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/strings.js + function uniqueId(prefix = "") { + return `${prefix}${uniqueIdCounter++}`; + } + var uniqueIdCounter; + var init_strings = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/strings.js"() { + uniqueIdCounter = 0; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/query.js + var init_query = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/query.js"() { + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js + var RtlScrollConverter; + var init_rtl_scroll_converter = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/rtl-scroll-converter.js"() { + init_dist(); + init_localization(); + RtlScrollConverter = class _RtlScrollConverter { + /** + * Gets the scrollLeft value of the provided element + */ + static getScrollLeft(scrolledElement, direction) { + if (direction === Direction.rtl) { + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + return scrolledElement.scrollLeft; + } + /** + * Sets the scrollLeft value of the provided element + */ + static setScrollLeft(scrolledElement, scrollValue, direction) { + if (direction === Direction.rtl) { + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, scrollValue); + return; + } + scrolledElement.scrollLeft = scrollValue; + } + /** + * The initial rtl scroll converter getter function, it calls the browser test to set the correct converter + * functions and then invokes the getter + */ + static initialGetRtlScrollConverter(scrolledElement) { + _RtlScrollConverter.initializeRtlScrollConverters(); + return _RtlScrollConverter.getRtlScrollLeftConverter(scrolledElement); + } + /** + * The "direct" rtl get scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft; + } + /** + * The "inverted" get scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedGetRtlScrollConverter(scrolledElement) { + return -Math.abs(scrolledElement.scrollLeft); + } + /** + * The "reverse" get scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseGetRtlScrollConverter(scrolledElement) { + return scrolledElement.scrollLeft - (scrolledElement.scrollWidth - scrolledElement.clientWidth); + } + /** + * The initial rtl scroll converter setter function, it calls the browser test to set the correct converter + * functions and then invokes the setter + */ + static initialSetRtlScrollConverter(scrolledElement, newScrollValue) { + _RtlScrollConverter.initializeRtlScrollConverters(); + _RtlScrollConverter.setRtlScrollLeftConverter(scrolledElement, newScrollValue); + } + /** + * The "direct" rtl set scroll converter does not need to tamper with the scrollLeft + * values as the browser is already doing the right thing. Content start = 0 and + * scrolling left goes negative. + */ + static directSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = newScrollValue; + } + /** + * The "inverted" set scroll converter is used when the browser reports scroll left + * as a positive maximum scroll value at content start and then goes to zero as content + * is scrolled left + */ + static invertedSetRtlScrollConverter(scrolledElement, newScrollValue) { + scrolledElement.scrollLeft = Math.abs(newScrollValue); + } + /** + * The "reverse" set scroll converter is used when the browser reports scroll left + * as 0 at content start and then goes positive as content is scrolled left + */ + static reverseSetRtlScrollConverter(scrolledElement, newScrollValue) { + const maxScroll = scrolledElement.scrollWidth - scrolledElement.clientWidth; + scrolledElement.scrollLeft = maxScroll + newScrollValue; + } + /** + * detects the appropriate rtl scroll converter functions and assigns them + * should only run once + */ + static initializeRtlScrollConverters() { + if (!canUseDOM()) { + _RtlScrollConverter.applyDirectScrollConverters(); + return; + } + const testElement = _RtlScrollConverter.getTestElement(); + document.body.appendChild(testElement); + _RtlScrollConverter.checkForScrollType(testElement); + document.body.removeChild(testElement); + } + /** + * checks the provided test element to determine scroll type + * and apply appropriate converters + */ + static checkForScrollType(testElement) { + if (_RtlScrollConverter.isReverse(testElement)) { + _RtlScrollConverter.applyReverseScrollConverters(); + } else { + if (_RtlScrollConverter.isDirect(testElement)) { + _RtlScrollConverter.applyDirectScrollConverters(); + } else { + _RtlScrollConverter.applyInvertedScrollConverters(); + } + } + } + /** + * checks test element initial state for rtl "reverse" mode + */ + static isReverse(testElement) { + return testElement.scrollLeft > 0; + } + /** + * checks test element for rtl "direct" mode + */ + static isDirect(testElement) { + testElement.scrollLeft = -1; + return testElement.scrollLeft < 0; + } + /** + * apply direct scroll conververters + */ + static applyDirectScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.directSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.directGetRtlScrollConverter; + } + /** + * apply inverted scroll conververters + */ + static applyInvertedScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.invertedSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.invertedGetRtlScrollConverter; + } + /** + * apply reverse scroll conververters + */ + static applyReverseScrollConverters() { + _RtlScrollConverter.setRtlScrollLeftConverter = _RtlScrollConverter.reverseSetRtlScrollConverter; + _RtlScrollConverter.getRtlScrollLeftConverter = _RtlScrollConverter.reverseGetRtlScrollConverter; + } + /** + * generate a test element for rtl testing + */ + static getTestElement() { + const testElement = document.createElement("div"); + testElement.appendChild(document.createTextNode("ABCD")); + testElement.dir = "rtl"; + testElement.style.fontSize = "14px"; + testElement.style.width = "4px"; + testElement.style.height = "1px"; + testElement.style.position = "absolute"; + testElement.style.top = "-1000px"; + testElement.style.overflow = "scroll"; + return testElement; + } + }; + RtlScrollConverter.getRtlScrollLeftConverter = RtlScrollConverter.initialGetRtlScrollConverter; + RtlScrollConverter.setRtlScrollLeftConverter = RtlScrollConverter.initialSetRtlScrollConverter; + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/system-colors.js + var SystemColors; + var init_system_colors = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/system-colors.js"() { + (function(SystemColors2) { + SystemColors2["Canvas"] = "Canvas"; + SystemColors2["CanvasText"] = "CanvasText"; + SystemColors2["LinkText"] = "LinkText"; + SystemColors2["VisitedText"] = "VisitedText"; + SystemColors2["ActiveText"] = "ActiveText"; + SystemColors2["ButtonFace"] = "ButtonFace"; + SystemColors2["ButtonText"] = "ButtonText"; + SystemColors2["Field"] = "Field"; + SystemColors2["FieldText"] = "FieldText"; + SystemColors2["Highlight"] = "Highlight"; + SystemColors2["HighlightText"] = "HighlightText"; + SystemColors2["GrayText"] = "GrayText"; + })(SystemColors || (SystemColors = {})); + } + }); + + // node_modules/@microsoft/fast-web-utilities/dist/index.js + var init_dist2 = __esm({ + "node_modules/@microsoft/fast-web-utilities/dist/index.js"() { + init_aria(); + init_array(); + init_class_names(); + init_dom2(); + init_events(); + init_html(); + init_key_codes(); + init_localization(); + init_numbers(); + init_strings(); + init_query(); + init_rtl_scroll_converter(); + init_system_colors(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js + var AccordionExpandMode, Accordion; + var init_accordion = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/accordion.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_accordion_item(); + AccordionExpandMode = { + /** + * Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time. + */ + single: "single", + /** + * Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously. + */ + multi: "multi" + }; + Accordion = class extends FoundationElement { + constructor() { + super(...arguments); + this.expandmode = AccordionExpandMode.multi; + this.activeItemIndex = 0; + this.change = () => { + this.$emit("change", this.activeid); + }; + this.setItems = () => { + var _a; + if (this.accordionItems.length === 0) { + return; + } + this.accordionIds = this.getItemIds(); + this.accordionItems.forEach((item, index) => { + if (item instanceof AccordionItem) { + item.addEventListener("change", this.activeItemChange); + if (this.isSingleExpandMode()) { + this.activeItemIndex !== index ? item.expanded = false : item.expanded = true; + } + } + const itemId = this.accordionIds[index]; + item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId); + this.activeid = this.accordionIds[this.activeItemIndex]; + item.addEventListener("keydown", this.handleItemKeyDown); + item.addEventListener("focus", this.handleItemFocus); + }); + if (this.isSingleExpandMode()) { + const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0]; + expandedItem.setAttribute("aria-disabled", "true"); + } + }; + this.removeItemListeners = (oldValue) => { + oldValue.forEach((item, index) => { + item.removeEventListener("change", this.activeItemChange); + item.removeEventListener("keydown", this.handleItemKeyDown); + item.removeEventListener("focus", this.handleItemFocus); + }); + }; + this.activeItemChange = (event) => { + if (event.defaultPrevented || event.target !== event.currentTarget) { + return; + } + event.preventDefault(); + const selectedItem = event.target; + this.activeid = selectedItem.getAttribute("id"); + if (this.isSingleExpandMode()) { + this.resetItems(); + selectedItem.expanded = true; + selectedItem.setAttribute("aria-disabled", "true"); + this.accordionItems.forEach((item) => { + if (!item.hasAttribute("disabled") && item.id !== this.activeid) { + item.removeAttribute("aria-disabled"); + } + }); + } + this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem); + this.change(); + }; + this.handleItemKeyDown = (event) => { + if (event.target !== event.currentTarget) { + return; + } + this.accordionIds = this.getItemIds(); + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjust(-1); + break; + case keyArrowDown: + event.preventDefault(); + this.adjust(1); + break; + case keyHome: + this.activeItemIndex = 0; + this.focusItem(); + break; + case keyEnd: + this.activeItemIndex = this.accordionItems.length - 1; + this.focusItem(); + break; + } + }; + this.handleItemFocus = (event) => { + if (event.target === event.currentTarget) { + const focusedItem = event.target; + const focusedIndex = this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem); + if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) { + this.activeItemIndex = focusedIndex; + this.activeid = this.accordionIds[this.activeItemIndex]; + } + } + }; + } + /** + * @internal + */ + accordionItemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.removeItemListeners(oldValue); + this.setItems(); + } + } + findExpandedItem() { + for (let item = 0; item < this.accordionItems.length; item++) { + if (this.accordionItems[item].getAttribute("expanded") === "true") { + return this.accordionItems[item]; + } + } + return null; + } + resetItems() { + this.accordionItems.forEach((item, index) => { + item.expanded = false; + }); + } + getItemIds() { + return this.accordionItems.map((accordionItem) => { + return accordionItem.getAttribute("id"); + }); + } + isSingleExpandMode() { + return this.expandmode === AccordionExpandMode.single; + } + adjust(adjustment) { + this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment); + this.focusItem(); + } + focusItem() { + const element = this.accordionItems[this.activeItemIndex]; + if (element instanceof AccordionItem) { + element.expandbutton.focus(); + } + } + }; + __decorate([ + attr({ attribute: "expand-mode" }) + ], Accordion.prototype, "expandmode", void 0); + __decorate([ + observable + ], Accordion.prototype, "accordionItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js + var init_accordion2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/accordion/index.js"() { + init_accordion_template(); + init_accordion(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js + var anchorTemplate; + var init_anchor_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.template.js"() { + init_esm(); + init_start_end(); + anchorTemplate = (context, definition) => html` + + ${startSlotTemplate(context, definition)} + + + + ${endSlotTemplate(context, definition)} + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js + var ARIAGlobalStatesAndProperties; + var init_aria_global = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/aria-global.js"() { + init_tslib_es6(); + init_esm(); + ARIAGlobalStatesAndProperties = class { + }; + __decorate([ + attr({ attribute: "aria-atomic" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0); + __decorate([ + attr({ attribute: "aria-busy" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0); + __decorate([ + attr({ attribute: "aria-controls" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0); + __decorate([ + attr({ attribute: "aria-current" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-details" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0); + __decorate([ + attr({ attribute: "aria-disabled" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0); + __decorate([ + attr({ attribute: "aria-errormessage" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0); + __decorate([ + attr({ attribute: "aria-flowto" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0); + __decorate([ + attr({ attribute: "aria-haspopup" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0); + __decorate([ + attr({ attribute: "aria-hidden" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0); + __decorate([ + attr({ attribute: "aria-invalid" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0); + __decorate([ + attr({ attribute: "aria-keyshortcuts" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-live" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0); + __decorate([ + attr({ attribute: "aria-owns" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0); + __decorate([ + attr({ attribute: "aria-relevant" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0); + __decorate([ + attr({ attribute: "aria-roledescription" }) + ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js + var init_patterns = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/patterns/index.js"() { + init_aria_global(); + init_start_end(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js + var Anchor, DelegatesARIALink; + var init_anchor = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/anchor.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_patterns(); + init_apply_mixins(); + Anchor = class extends FoundationElement { + constructor() { + super(...arguments); + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + var _a2; + (_a2 = this.control) === null || _a2 === void 0 ? void 0 : _a2.focus(); + }; + } + }; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.handleUnsupportedDelegatesFocus(); + } + }; + __decorate([ + attr + ], Anchor.prototype, "download", void 0); + __decorate([ + attr + ], Anchor.prototype, "href", void 0); + __decorate([ + attr + ], Anchor.prototype, "hreflang", void 0); + __decorate([ + attr + ], Anchor.prototype, "ping", void 0); + __decorate([ + attr + ], Anchor.prototype, "referrerpolicy", void 0); + __decorate([ + attr + ], Anchor.prototype, "rel", void 0); + __decorate([ + attr + ], Anchor.prototype, "target", void 0); + __decorate([ + attr + ], Anchor.prototype, "type", void 0); + __decorate([ + observable + ], Anchor.prototype, "defaultSlottedContent", void 0); + DelegatesARIALink = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIALink.prototype, "ariaExpanded", void 0); + applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties); + applyMixins(Anchor, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js + var init_anchor2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchor/index.js"() { + init_anchor_template(); + init_anchor(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js + var init_anchored_region_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js + var getDirection; + var init_direction = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/direction.js"() { + init_dist2(); + getDirection = (rootNode) => { + const dirNode = rootNode.closest("[dir]"); + return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js + var IntersectionService; + var init_intersection_service = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/intersection-service.js"() { + init_esm(); + IntersectionService = class { + constructor() { + this.intersectionDetector = null; + this.observedElements = /* @__PURE__ */ new Map(); + this.requestPosition = (target, callback) => { + var _a; + if (this.intersectionDetector === null) { + return; + } + if (this.observedElements.has(target)) { + (_a = this.observedElements.get(target)) === null || _a === void 0 ? void 0 : _a.push(callback); + return; + } + this.observedElements.set(target, [callback]); + this.intersectionDetector.observe(target); + }; + this.cancelRequestPosition = (target, callback) => { + const callbacks = this.observedElements.get(target); + if (callbacks !== void 0) { + const callBackIndex = callbacks.indexOf(callback); + if (callBackIndex !== -1) { + callbacks.splice(callBackIndex, 1); + } + } + }; + this.initializeIntersectionDetector = () => { + if (!$global.IntersectionObserver) { + return; + } + this.intersectionDetector = new IntersectionObserver(this.handleIntersection, { + root: null, + rootMargin: "0px", + threshold: [0, 1] + }); + }; + this.handleIntersection = (entries) => { + if (this.intersectionDetector === null) { + return; + } + const pendingCallbacks = []; + const pendingCallbackParams = []; + entries.forEach((entry) => { + var _a; + (_a = this.intersectionDetector) === null || _a === void 0 ? void 0 : _a.unobserve(entry.target); + const thisElementCallbacks = this.observedElements.get(entry.target); + if (thisElementCallbacks !== void 0) { + thisElementCallbacks.forEach((callback) => { + let targetCallbackIndex = pendingCallbacks.indexOf(callback); + if (targetCallbackIndex === -1) { + targetCallbackIndex = pendingCallbacks.length; + pendingCallbacks.push(callback); + pendingCallbackParams.push([]); + } + pendingCallbackParams[targetCallbackIndex].push(entry); + }); + this.observedElements.delete(entry.target); + } + }); + pendingCallbacks.forEach((callback, index) => { + callback(pendingCallbackParams[index]); + }); + }; + this.initializeIntersectionDetector(); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js + var AnchoredRegion; + var init_anchored_region = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_direction(); + init_intersection_service(); + AnchoredRegion = class _AnchoredRegion extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.viewport = ""; + this.horizontalPositioningMode = "uncontrolled"; + this.horizontalDefaultPosition = "unset"; + this.horizontalViewportLock = false; + this.horizontalInset = false; + this.horizontalScaling = "content"; + this.verticalPositioningMode = "uncontrolled"; + this.verticalDefaultPosition = "unset"; + this.verticalViewportLock = false; + this.verticalInset = false; + this.verticalScaling = "content"; + this.fixedPlacement = false; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.initialLayoutComplete = false; + this.resizeDetector = null; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.pendingPositioningUpdate = false; + this.pendingReset = false; + this.currentDirection = Direction.ltr; + this.regionVisible = false; + this.forceUpdate = false; + this.updateThreshold = 0.5; + this.update = () => { + if (!this.pendingPositioningUpdate) { + this.requestPositionUpdates(); + } + }; + this.startObservers = () => { + this.stopObservers(); + if (this.anchorElement === null) { + return; + } + this.requestPositionUpdates(); + if (this.resizeDetector !== null) { + this.resizeDetector.observe(this.anchorElement); + this.resizeDetector.observe(this); + } + }; + this.requestPositionUpdates = () => { + if (this.anchorElement === null || this.pendingPositioningUpdate) { + return; + } + _AnchoredRegion.intersectionService.requestPosition(this, this.handleIntersection); + _AnchoredRegion.intersectionService.requestPosition(this.anchorElement, this.handleIntersection); + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.requestPosition(this.viewportElement, this.handleIntersection); + } + this.pendingPositioningUpdate = true; + }; + this.stopObservers = () => { + if (this.pendingPositioningUpdate) { + this.pendingPositioningUpdate = false; + _AnchoredRegion.intersectionService.cancelRequestPosition(this, this.handleIntersection); + if (this.anchorElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.anchorElement, this.handleIntersection); + } + if (this.viewportElement !== null) { + _AnchoredRegion.intersectionService.cancelRequestPosition(this.viewportElement, this.handleIntersection); + } + } + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + } + }; + this.getViewport = () => { + if (typeof this.viewport !== "string" || this.viewport === "") { + return document.documentElement; + } + return document.getElementById(this.viewport); + }; + this.getAnchor = () => { + return document.getElementById(this.anchor); + }; + this.handleIntersection = (entries) => { + if (!this.pendingPositioningUpdate) { + return; + } + this.pendingPositioningUpdate = false; + if (!this.applyIntersectionEntries(entries)) { + return; + } + this.updateLayout(); + }; + this.applyIntersectionEntries = (entries) => { + const regionEntry = entries.find((x) => x.target === this); + const anchorEntry = entries.find((x) => x.target === this.anchorElement); + const viewportEntry = entries.find((x) => x.target === this.viewportElement); + if (regionEntry === void 0 || viewportEntry === void 0 || anchorEntry === void 0) { + return false; + } + if (!this.regionVisible || this.forceUpdate || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0 || this.isRectDifferent(this.anchorRect, anchorEntry.boundingClientRect) || this.isRectDifferent(this.viewportRect, viewportEntry.boundingClientRect) || this.isRectDifferent(this.regionRect, regionEntry.boundingClientRect)) { + this.regionRect = regionEntry.boundingClientRect; + this.anchorRect = anchorEntry.boundingClientRect; + if (this.viewportElement === document.documentElement) { + this.viewportRect = new DOMRectReadOnly(viewportEntry.boundingClientRect.x + document.documentElement.scrollLeft, viewportEntry.boundingClientRect.y + document.documentElement.scrollTop, viewportEntry.boundingClientRect.width, viewportEntry.boundingClientRect.height); + } else { + this.viewportRect = viewportEntry.boundingClientRect; + } + this.updateRegionOffset(); + this.forceUpdate = false; + return true; + } + return false; + }; + this.updateRegionOffset = () => { + if (this.anchorRect && this.regionRect) { + this.baseHorizontalOffset = this.baseHorizontalOffset + (this.anchorRect.left - this.regionRect.left) + (this.translateX - this.baseHorizontalOffset); + this.baseVerticalOffset = this.baseVerticalOffset + (this.anchorRect.top - this.regionRect.top) + (this.translateY - this.baseVerticalOffset); + } + }; + this.isRectDifferent = (rectA, rectB) => { + if (Math.abs(rectA.top - rectB.top) > this.updateThreshold || Math.abs(rectA.right - rectB.right) > this.updateThreshold || Math.abs(rectA.bottom - rectB.bottom) > this.updateThreshold || Math.abs(rectA.left - rectB.left) > this.updateThreshold) { + return true; + } + return false; + }; + this.handleResize = (entries) => { + this.update(); + }; + this.reset = () => { + if (!this.pendingReset) { + return; + } + this.pendingReset = false; + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + if (this.viewportElement === null) { + this.viewportElement = this.getViewport(); + } + this.currentDirection = getDirection(this); + this.startObservers(); + }; + this.updateLayout = () => { + let desiredVerticalPosition = void 0; + let desiredHorizontalPosition = void 0; + if (this.horizontalPositioningMode !== "uncontrolled") { + const horizontalOptions = this.getPositioningOptions(this.horizontalInset); + if (this.horizontalDefaultPosition === "center") { + desiredHorizontalPosition = "center"; + } else if (this.horizontalDefaultPosition !== "unset") { + let dirCorrectedHorizontalDefaultPosition = this.horizontalDefaultPosition; + if (dirCorrectedHorizontalDefaultPosition === "start" || dirCorrectedHorizontalDefaultPosition === "end") { + const newDirection = getDirection(this); + if (newDirection !== this.currentDirection) { + this.currentDirection = newDirection; + this.initialize(); + return; + } + if (this.currentDirection === Direction.ltr) { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "left" : "right"; + } else { + dirCorrectedHorizontalDefaultPosition = dirCorrectedHorizontalDefaultPosition === "start" ? "right" : "left"; + } + } + switch (dirCorrectedHorizontalDefaultPosition) { + case "left": + desiredHorizontalPosition = this.horizontalInset ? "insetStart" : "start"; + break; + case "right": + desiredHorizontalPosition = this.horizontalInset ? "insetEnd" : "end"; + break; + } + } + const horizontalThreshold = this.horizontalThreshold !== void 0 ? this.horizontalThreshold : this.regionRect !== void 0 ? this.regionRect.width : 0; + const anchorLeft = this.anchorRect !== void 0 ? this.anchorRect.left : 0; + const anchorRight = this.anchorRect !== void 0 ? this.anchorRect.right : 0; + const anchorWidth = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + const viewportLeft = this.viewportRect !== void 0 ? this.viewportRect.left : 0; + const viewportRight = this.viewportRect !== void 0 ? this.viewportRect.right : 0; + if (desiredHorizontalPosition === void 0 || !(this.horizontalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredHorizontalPosition, anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) < horizontalThreshold) { + desiredHorizontalPosition = this.getAvailableSpace(horizontalOptions[0], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) > this.getAvailableSpace(horizontalOptions[1], anchorLeft, anchorRight, anchorWidth, viewportLeft, viewportRight) ? horizontalOptions[0] : horizontalOptions[1]; + } + } + if (this.verticalPositioningMode !== "uncontrolled") { + const verticalOptions = this.getPositioningOptions(this.verticalInset); + if (this.verticalDefaultPosition === "center") { + desiredVerticalPosition = "center"; + } else if (this.verticalDefaultPosition !== "unset") { + switch (this.verticalDefaultPosition) { + case "top": + desiredVerticalPosition = this.verticalInset ? "insetStart" : "start"; + break; + case "bottom": + desiredVerticalPosition = this.verticalInset ? "insetEnd" : "end"; + break; + } + } + const verticalThreshold = this.verticalThreshold !== void 0 ? this.verticalThreshold : this.regionRect !== void 0 ? this.regionRect.height : 0; + const anchorTop = this.anchorRect !== void 0 ? this.anchorRect.top : 0; + const anchorBottom = this.anchorRect !== void 0 ? this.anchorRect.bottom : 0; + const anchorHeight = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + const viewportTop = this.viewportRect !== void 0 ? this.viewportRect.top : 0; + const viewportBottom = this.viewportRect !== void 0 ? this.viewportRect.bottom : 0; + if (desiredVerticalPosition === void 0 || !(this.verticalPositioningMode === "locktodefault") && this.getAvailableSpace(desiredVerticalPosition, anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) < verticalThreshold) { + desiredVerticalPosition = this.getAvailableSpace(verticalOptions[0], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) > this.getAvailableSpace(verticalOptions[1], anchorTop, anchorBottom, anchorHeight, viewportTop, viewportBottom) ? verticalOptions[0] : verticalOptions[1]; + } + } + const nextPositionerDimension = this.getNextRegionDimension(desiredHorizontalPosition, desiredVerticalPosition); + const positionChanged = this.horizontalPosition !== desiredHorizontalPosition || this.verticalPosition !== desiredVerticalPosition; + this.setHorizontalPosition(desiredHorizontalPosition, nextPositionerDimension); + this.setVerticalPosition(desiredVerticalPosition, nextPositionerDimension); + this.updateRegionStyle(); + if (!this.initialLayoutComplete) { + this.initialLayoutComplete = true; + this.requestPositionUpdates(); + return; + } + if (!this.regionVisible) { + this.regionVisible = true; + this.style.removeProperty("pointer-events"); + this.style.removeProperty("opacity"); + this.classList.toggle("loaded", true); + this.$emit("loaded", this, { bubbles: false }); + } + this.updatePositionClasses(); + if (positionChanged) { + this.$emit("positionchange", this, { bubbles: false }); + } + }; + this.updateRegionStyle = () => { + this.style.width = this.regionWidth; + this.style.height = this.regionHeight; + this.style.transform = `translate(${this.translateX}px, ${this.translateY}px)`; + }; + this.updatePositionClasses = () => { + this.classList.toggle("top", this.verticalPosition === "start"); + this.classList.toggle("bottom", this.verticalPosition === "end"); + this.classList.toggle("inset-top", this.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.verticalPosition === "insetEnd"); + this.classList.toggle("vertical-center", this.verticalPosition === "center"); + this.classList.toggle("left", this.horizontalPosition === "start"); + this.classList.toggle("right", this.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.horizontalPosition === "insetEnd"); + this.classList.toggle("horizontal-center", this.horizontalPosition === "center"); + }; + this.setHorizontalPosition = (desiredHorizontalPosition, nextPositionerDimension) => { + if (desiredHorizontalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionWidth = 0; + switch (this.horizontalScaling) { + case "anchor": + case "fill": + nextRegionWidth = this.horizontalViewportLock ? this.viewportRect.width : nextPositionerDimension.width; + this.regionWidth = `${nextRegionWidth}px`; + break; + case "content": + nextRegionWidth = this.regionRect.width; + this.regionWidth = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredHorizontalPosition) { + case "start": + this.translateX = this.baseHorizontalOffset - nextRegionWidth; + if (this.horizontalViewportLock && this.anchorRect.left > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.right); + } + break; + case "insetStart": + this.translateX = this.baseHorizontalOffset - nextRegionWidth + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right > this.viewportRect.right) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.right); + } + break; + case "insetEnd": + this.translateX = this.baseHorizontalOffset; + if (this.horizontalViewportLock && this.anchorRect.left < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.left - this.viewportRect.left); + } + break; + case "end": + this.translateX = this.baseHorizontalOffset + this.anchorRect.width; + if (this.horizontalViewportLock && this.anchorRect.right < this.viewportRect.left) { + this.translateX = this.translateX - (this.anchorRect.right - this.viewportRect.left); + } + break; + case "center": + sizeDelta = (this.anchorRect.width - nextRegionWidth) / 2; + this.translateX = this.baseHorizontalOffset + sizeDelta; + if (this.horizontalViewportLock) { + const regionLeft = this.anchorRect.left + sizeDelta; + const regionRight = this.anchorRect.right - sizeDelta; + if (regionLeft < this.viewportRect.left && !(regionRight > this.viewportRect.right)) { + this.translateX = this.translateX - (regionLeft - this.viewportRect.left); + } else if (regionRight > this.viewportRect.right && !(regionLeft < this.viewportRect.left)) { + this.translateX = this.translateX - (regionRight - this.viewportRect.right); + } + } + break; + } + this.horizontalPosition = desiredHorizontalPosition; + }; + this.setVerticalPosition = (desiredVerticalPosition, nextPositionerDimension) => { + if (desiredVerticalPosition === void 0 || this.regionRect === void 0 || this.anchorRect === void 0 || this.viewportRect === void 0) { + return; + } + let nextRegionHeight = 0; + switch (this.verticalScaling) { + case "anchor": + case "fill": + nextRegionHeight = this.verticalViewportLock ? this.viewportRect.height : nextPositionerDimension.height; + this.regionHeight = `${nextRegionHeight}px`; + break; + case "content": + nextRegionHeight = this.regionRect.height; + this.regionHeight = "unset"; + break; + } + let sizeDelta = 0; + switch (desiredVerticalPosition) { + case "start": + this.translateY = this.baseVerticalOffset - nextRegionHeight; + if (this.verticalViewportLock && this.anchorRect.top > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.bottom); + } + break; + case "insetStart": + this.translateY = this.baseVerticalOffset - nextRegionHeight + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom > this.viewportRect.bottom) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.bottom); + } + break; + case "insetEnd": + this.translateY = this.baseVerticalOffset; + if (this.verticalViewportLock && this.anchorRect.top < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.top - this.viewportRect.top); + } + break; + case "end": + this.translateY = this.baseVerticalOffset + this.anchorRect.height; + if (this.verticalViewportLock && this.anchorRect.bottom < this.viewportRect.top) { + this.translateY = this.translateY - (this.anchorRect.bottom - this.viewportRect.top); + } + break; + case "center": + sizeDelta = (this.anchorRect.height - nextRegionHeight) / 2; + this.translateY = this.baseVerticalOffset + sizeDelta; + if (this.verticalViewportLock) { + const regionTop = this.anchorRect.top + sizeDelta; + const regionBottom = this.anchorRect.bottom - sizeDelta; + if (regionTop < this.viewportRect.top && !(regionBottom > this.viewportRect.bottom)) { + this.translateY = this.translateY - (regionTop - this.viewportRect.top); + } else if (regionBottom > this.viewportRect.bottom && !(regionTop < this.viewportRect.top)) { + this.translateY = this.translateY - (regionBottom - this.viewportRect.bottom); + } + } + } + this.verticalPosition = desiredVerticalPosition; + }; + this.getPositioningOptions = (inset) => { + if (inset) { + return ["insetStart", "insetEnd"]; + } + return ["start", "end"]; + }; + this.getAvailableSpace = (positionOption, anchorStart, anchorEnd, anchorSpan, viewportStart, viewportEnd) => { + const spaceStart = anchorStart - viewportStart; + const spaceEnd = viewportEnd - (anchorStart + anchorSpan); + switch (positionOption) { + case "start": + return spaceStart; + case "insetStart": + return spaceStart + anchorSpan; + case "insetEnd": + return spaceEnd + anchorSpan; + case "end": + return spaceEnd; + case "center": + return Math.min(spaceStart, spaceEnd) * 2 + anchorSpan; + } + }; + this.getNextRegionDimension = (desiredHorizontalPosition, desiredVerticalPosition) => { + const newRegionDimension = { + height: this.regionRect !== void 0 ? this.regionRect.height : 0, + width: this.regionRect !== void 0 ? this.regionRect.width : 0 + }; + if (desiredHorizontalPosition !== void 0 && this.horizontalScaling === "fill") { + newRegionDimension.width = this.getAvailableSpace(desiredHorizontalPosition, this.anchorRect !== void 0 ? this.anchorRect.left : 0, this.anchorRect !== void 0 ? this.anchorRect.right : 0, this.anchorRect !== void 0 ? this.anchorRect.width : 0, this.viewportRect !== void 0 ? this.viewportRect.left : 0, this.viewportRect !== void 0 ? this.viewportRect.right : 0); + } else if (this.horizontalScaling === "anchor") { + newRegionDimension.width = this.anchorRect !== void 0 ? this.anchorRect.width : 0; + } + if (desiredVerticalPosition !== void 0 && this.verticalScaling === "fill") { + newRegionDimension.height = this.getAvailableSpace(desiredVerticalPosition, this.anchorRect !== void 0 ? this.anchorRect.top : 0, this.anchorRect !== void 0 ? this.anchorRect.bottom : 0, this.anchorRect !== void 0 ? this.anchorRect.height : 0, this.viewportRect !== void 0 ? this.viewportRect.top : 0, this.viewportRect !== void 0 ? this.viewportRect.bottom : 0); + } else if (this.verticalScaling === "anchor") { + newRegionDimension.height = this.anchorRect !== void 0 ? this.anchorRect.height : 0; + } + return newRegionDimension; + }; + this.startAutoUpdateEventListeners = () => { + window.addEventListener(eventResize, this.update, { passive: true }); + window.addEventListener(eventScroll, this.update, { + passive: true, + capture: true + }); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.observe(this.viewportElement); + } + }; + this.stopAutoUpdateEventListeners = () => { + window.removeEventListener(eventResize, this.update); + window.removeEventListener(eventScroll, this.update); + if (this.resizeDetector !== null && this.viewportElement !== null) { + this.resizeDetector.unobserve(this.viewportElement); + } + }; + } + anchorChanged() { + if (this.initialLayoutComplete) { + this.anchorElement = this.getAnchor(); + } + } + viewportChanged() { + if (this.initialLayoutComplete) { + this.viewportElement = this.getViewport(); + } + } + horizontalPositioningModeChanged() { + this.requestReset(); + } + horizontalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + horizontalViewportLockChanged() { + this.updateForAttributeChange(); + } + horizontalInsetChanged() { + this.updateForAttributeChange(); + } + horizontalThresholdChanged() { + this.updateForAttributeChange(); + } + horizontalScalingChanged() { + this.updateForAttributeChange(); + } + verticalPositioningModeChanged() { + this.requestReset(); + } + verticalDefaultPositionChanged() { + this.updateForAttributeChange(); + } + verticalViewportLockChanged() { + this.updateForAttributeChange(); + } + verticalInsetChanged() { + this.updateForAttributeChange(); + } + verticalThresholdChanged() { + this.updateForAttributeChange(); + } + verticalScalingChanged() { + this.updateForAttributeChange(); + } + fixedPlacementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + autoUpdateModeChanged(prevMode, newMode) { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + if (prevMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + if (newMode === "auto") { + this.startAutoUpdateEventListeners(); + } + } + } + anchorElementChanged() { + this.requestReset(); + } + viewportElementChanged() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.initialize(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.autoUpdateMode === "auto") { + this.startAutoUpdateEventListeners(); + } + this.initialize(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + if (this.autoUpdateMode === "auto") { + this.stopAutoUpdateEventListeners(); + } + this.stopObservers(); + this.disconnectResizeDetector(); + } + /** + * @internal + */ + adoptedCallback() { + this.initialize(); + } + /** + * destroys the instance's resize observer + */ + disconnectResizeDetector() { + if (this.resizeDetector !== null) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.handleResize); + } + /** + * react to attribute changes that don't require a reset + */ + updateForAttributeChange() { + if (this.$fastController.isConnected && this.initialLayoutComplete) { + this.forceUpdate = true; + this.update(); + } + } + /** + * fully initializes the component + */ + initialize() { + this.initializeResizeDetector(); + if (this.anchorElement === null) { + this.anchorElement = this.getAnchor(); + } + this.requestReset(); + } + /** + * Request a reset if there are currently no open requests + */ + requestReset() { + if (this.$fastController.isConnected && this.pendingReset === false) { + this.setInitialState(); + DOM.queueUpdate(() => this.reset()); + this.pendingReset = true; + } + } + /** + * sets the starting configuration for component internal values + */ + setInitialState() { + this.initialLayoutComplete = false; + this.regionVisible = false; + this.translateX = 0; + this.translateY = 0; + this.baseHorizontalOffset = 0; + this.baseVerticalOffset = 0; + this.viewportRect = void 0; + this.regionRect = void 0; + this.anchorRect = void 0; + this.verticalPosition = void 0; + this.horizontalPosition = void 0; + this.style.opacity = "0"; + this.style.pointerEvents = "none"; + this.forceUpdate = false; + this.style.position = this.fixedPlacement ? "fixed" : "absolute"; + this.updatePositionClasses(); + this.updateRegionStyle(); + } + }; + AnchoredRegion.intersectionService = new IntersectionService(); + __decorate([ + attr + ], AnchoredRegion.prototype, "anchor", void 0); + __decorate([ + attr + ], AnchoredRegion.prototype, "viewport", void 0); + __decorate([ + attr({ attribute: "horizontal-positioning-mode" }) + ], AnchoredRegion.prototype, "horizontalPositioningMode", void 0); + __decorate([ + attr({ attribute: "horizontal-default-position" }) + ], AnchoredRegion.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "horizontal-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "horizontalInset", void 0); + __decorate([ + attr({ attribute: "horizontal-threshold" }) + ], AnchoredRegion.prototype, "horizontalThreshold", void 0); + __decorate([ + attr({ attribute: "horizontal-scaling" }) + ], AnchoredRegion.prototype, "horizontalScaling", void 0); + __decorate([ + attr({ attribute: "vertical-positioning-mode" }) + ], AnchoredRegion.prototype, "verticalPositioningMode", void 0); + __decorate([ + attr({ attribute: "vertical-default-position" }) + ], AnchoredRegion.prototype, "verticalDefaultPosition", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-inset", mode: "boolean" }) + ], AnchoredRegion.prototype, "verticalInset", void 0); + __decorate([ + attr({ attribute: "vertical-threshold" }) + ], AnchoredRegion.prototype, "verticalThreshold", void 0); + __decorate([ + attr({ attribute: "vertical-scaling" }) + ], AnchoredRegion.prototype, "verticalScaling", void 0); + __decorate([ + attr({ attribute: "fixed-placement", mode: "boolean" }) + ], AnchoredRegion.prototype, "fixedPlacement", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], AnchoredRegion.prototype, "autoUpdateMode", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "anchorElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "viewportElement", void 0); + __decorate([ + observable + ], AnchoredRegion.prototype, "initialLayoutComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js + var horizontalAnchorOverlay, FlyoutPosTop, FlyoutPosBottom, FlyoutPosTallest, FlyoutPosTopFill, FlyoutPosBottomFill, FlyoutPosTallestFill; + var init_anchored_region_config = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/anchored-region-config.js"() { + horizontalAnchorOverlay = { + horizontalDefaultPosition: "center", + horizontalPositioningMode: "locktodefault", + horizontalInset: false, + horizontalScaling: "anchor" + }; + FlyoutPosTop = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "top", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosBottom = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalDefaultPosition: "bottom", verticalPositioningMode: "locktodefault", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTallest = Object.assign(Object.assign({}, horizontalAnchorOverlay), { verticalPositioningMode: "dynamic", verticalInset: false, verticalScaling: "content" }); + FlyoutPosTopFill = Object.assign(Object.assign({}, FlyoutPosTop), { verticalScaling: "fill" }); + FlyoutPosBottomFill = Object.assign(Object.assign({}, FlyoutPosBottom), { verticalScaling: "fill" }); + FlyoutPosTallestFill = Object.assign(Object.assign({}, FlyoutPosTallest), { verticalScaling: "fill" }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js + var init_anchored_region2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/anchored-region/index.js"() { + init_anchored_region_template(); + init_anchored_region(); + init_anchored_region_config(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js + var init_avatar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js + var Avatar; + var init_avatar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/avatar.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Avatar = class extends FoundationElement { + /** + * Internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.shape) { + this.shape = "circle"; + } + } + }; + __decorate([ + attr + ], Avatar.prototype, "fill", void 0); + __decorate([ + attr + ], Avatar.prototype, "color", void 0); + __decorate([ + attr + ], Avatar.prototype, "link", void 0); + __decorate([ + attr + ], Avatar.prototype, "shape", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js + var init_avatar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/avatar/index.js"() { + init_avatar_template(); + init_avatar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js + var badgeTemplate; + var init_badge_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.template.js"() { + init_esm(); + badgeTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js + var Badge; + var init_badge = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/badge.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Badge = class extends FoundationElement { + constructor() { + super(...arguments); + this.generateBadgeStyle = () => { + if (!this.fill && !this.color) { + return; + } + const fill = `background-color: var(--badge-fill-${this.fill});`; + const color = `color: var(--badge-color-${this.color});`; + if (this.fill && !this.color) { + return fill; + } else if (this.color && !this.fill) { + return color; + } else { + return `${color} ${fill}`; + } + }; + } + }; + __decorate([ + attr({ attribute: "fill" }) + ], Badge.prototype, "fill", void 0); + __decorate([ + attr({ attribute: "color" }) + ], Badge.prototype, "color", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Badge.prototype, "circular", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js + var init_badge2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/badge/index.js"() { + init_badge_template(); + init_badge(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js + var init_breadcrumb_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js + var BreadcrumbItem; + var init_breadcrumb_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/breadcrumb-item.js"() { + init_tslib_es6(); + init_esm(); + init_anchor(); + init_patterns(); + init_apply_mixins(); + BreadcrumbItem = class extends Anchor { + constructor() { + super(...arguments); + this.separator = true; + } + }; + __decorate([ + observable + ], BreadcrumbItem.prototype, "separator", void 0); + applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js + var init_breadcrumb_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb-item/index.js"() { + init_breadcrumb_item_template(); + init_breadcrumb_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js + var init_breadcrumb_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js + var Breadcrumb; + var init_breadcrumb = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/breadcrumb.js"() { + init_tslib_es6(); + init_esm(); + init_breadcrumb_item(); + init_foundation_element(); + Breadcrumb = class extends FoundationElement { + slottedBreadcrumbItemsChanged() { + if (this.$fastController.isConnected) { + if (this.slottedBreadcrumbItems === void 0 || this.slottedBreadcrumbItems.length === 0) { + return; + } + const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1]; + this.slottedBreadcrumbItems.forEach((item) => { + const itemIsLastNode = item === lastNode; + this.setItemSeparator(item, itemIsLastNode); + this.setAriaCurrent(item, itemIsLastNode); + }); + } + } + setItemSeparator(item, isLastNode) { + if (item instanceof BreadcrumbItem) { + item.separator = !isLastNode; + } + } + /** + * Finds href on childnodes in the light DOM or shadow DOM. + * We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href. + */ + findChildWithHref(node) { + var _a, _b; + if (node.childElementCount > 0) { + return node.querySelector("a[href]"); + } else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) { + return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]"); + } else + return null; + } + /** + * Sets ARIA Current for the current node + * If child node with an anchor tag and with href is found then set aria-current to correct value for the child node, + * otherwise apply aria-current to the host element, with an href + */ + setAriaCurrent(item, isLastNode) { + const childNodeWithHref = this.findChildWithHref(item); + if (childNodeWithHref === null && item.hasAttribute("href") && item instanceof BreadcrumbItem) { + isLastNode ? item.setAttribute("aria-current", "page") : item.removeAttribute("aria-current"); + } else if (childNodeWithHref !== null) { + isLastNode ? childNodeWithHref.setAttribute("aria-current", "page") : childNodeWithHref.removeAttribute("aria-current"); + } + } + }; + __decorate([ + observable + ], Breadcrumb.prototype, "slottedBreadcrumbItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js + var init_breadcrumb2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/breadcrumb/index.js"() { + init_breadcrumb_template(); + init_breadcrumb(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js + var buttonTemplate; + var init_button_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.template.js"() { + init_esm(); + init_start_end(); + buttonTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js + function FormAssociated(BaseCtor) { + const C = class extends BaseCtor { + constructor(...args) { + super(...args); + this.dirtyValue = false; + this.disabled = false; + this.proxyEventsToBlock = ["change", "click"]; + this.proxyInitialized = false; + this.required = false; + this.initialValue = this.initialValue || ""; + if (!this.elementInternals) { + this.formResetCallback = this.formResetCallback.bind(this); + } + } + /** + * Must evaluate to true to enable elementInternals. + * Feature detects API support and resolve respectively + * + * @internal + */ + static get formAssociated() { + return supportsElementInternals; + } + /** + * Returns the validity state of the element + * + * @alpha + */ + get validity() { + return this.elementInternals ? this.elementInternals.validity : this.proxy.validity; + } + /** + * Retrieve a reference to the associated form. + * Returns null if not associated to any form. + * + * @alpha + */ + get form() { + return this.elementInternals ? this.elementInternals.form : this.proxy.form; + } + /** + * Retrieve the localized validation message, + * or custom validation message if set. + * + * @alpha + */ + get validationMessage() { + return this.elementInternals ? this.elementInternals.validationMessage : this.proxy.validationMessage; + } + /** + * Whether the element will be validated when the + * form is submitted + */ + get willValidate() { + return this.elementInternals ? this.elementInternals.willValidate : this.proxy.willValidate; + } + /** + * A reference to all associated label elements + */ + get labels() { + if (this.elementInternals) { + return Object.freeze(Array.from(this.elementInternals.labels)); + } else if (this.proxy instanceof HTMLElement && this.proxy.ownerDocument && this.id) { + const parentLabels = this.proxy.labels; + const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`)); + const labels = parentLabels ? forLabels.concat(Array.from(parentLabels)) : forLabels; + return Object.freeze(labels); + } else { + return emptyArray; + } + } + /** + * Invoked when the `value` property changes + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `valueChanged` method + * They must be sure to invoke `super.valueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + valueChanged(previous, next) { + this.dirtyValue = true; + if (this.proxy instanceof HTMLElement) { + this.proxy.value = this.value; + } + this.currentValue = this.value; + this.setFormValue(this.value); + this.validate(); + } + currentValueChanged() { + this.value = this.currentValue; + } + /** + * Invoked when the `initialValue` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `initialValueChanged` method + * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + /** + * Invoked when the `disabled` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `disabledChanged` method + * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + disabledChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.disabled = this.disabled; + } + DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled)); + } + /** + * Invoked when the `name` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `nameChanged` method + * They must be sure to invoke `super.nameChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + nameChanged(previous, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.name = this.name; + } + } + /** + * Invoked when the `required` property changes + * + * @param previous - the previous value + * @param next - the new value + * + * @remarks + * If elements extending `FormAssociated` implement a `requiredChanged` method + * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure + * proper functioning of `FormAssociated` + */ + requiredChanged(prev, next) { + if (this.proxy instanceof HTMLElement) { + this.proxy.required = this.required; + } + DOM.queueUpdate(() => this.classList.toggle("required", this.required)); + this.validate(); + } + /** + * The element internals object. Will only exist + * in browsers supporting the attachInternals API + */ + get elementInternals() { + if (!supportsElementInternals) { + return null; + } + let internals = InternalsMap.get(this); + if (!internals) { + internals = this.attachInternals(); + InternalsMap.set(this, internals); + } + return internals; + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("keypress", this._keypressHandler); + if (!this.value) { + this.value = this.initialValue; + this.dirtyValue = false; + } + if (!this.elementInternals) { + this.attachProxy(); + if (this.form) { + this.form.addEventListener("reset", this.formResetCallback); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.proxyEventsToBlock.forEach((name) => this.proxy.removeEventListener(name, this.stopPropagation)); + if (!this.elementInternals && this.form) { + this.form.removeEventListener("reset", this.formResetCallback); + } + } + /** + * Return the current validity of the element. + */ + checkValidity() { + return this.elementInternals ? this.elementInternals.checkValidity() : this.proxy.checkValidity(); + } + /** + * Return the current validity of the element. + * If false, fires an invalid event at the element. + */ + reportValidity() { + return this.elementInternals ? this.elementInternals.reportValidity() : this.proxy.reportValidity(); + } + /** + * Set the validity of the control. In cases when the elementInternals object is not + * available (and the proxy element is used to report validity), this function will + * do nothing unless a message is provided, at which point the setCustomValidity method + * of the proxy element will be invoked with the provided message. + * @param flags - Validity flags + * @param message - Optional message to supply + * @param anchor - Optional element used by UA to display an interactive validation UI + */ + setValidity(flags, message, anchor) { + if (this.elementInternals) { + this.elementInternals.setValidity(flags, message, anchor); + } else if (typeof message === "string") { + this.proxy.setCustomValidity(message); + } + } + /** + * Invoked when a connected component's form or fieldset has its disabled + * state changed. + * @param disabled - the disabled value of the form / fieldset + */ + formDisabledCallback(disabled) { + this.disabled = disabled; + } + formResetCallback() { + this.value = this.initialValue; + this.dirtyValue = false; + } + /** + * Attach the proxy element to the DOM + */ + attachProxy() { + var _a; + if (!this.proxyInitialized) { + this.proxyInitialized = true; + this.proxy.style.display = "none"; + this.proxyEventsToBlock.forEach((name) => this.proxy.addEventListener(name, this.stopPropagation)); + this.proxy.disabled = this.disabled; + this.proxy.required = this.required; + if (typeof this.name === "string") { + this.proxy.name = this.name; + } + if (typeof this.value === "string") { + this.proxy.value = this.value; + } + this.proxy.setAttribute("slot", proxySlotName); + this.proxySlot = document.createElement("slot"); + this.proxySlot.setAttribute("name", proxySlotName); + } + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot); + this.appendChild(this.proxy); + } + /** + * Detach the proxy element from the DOM + */ + detachProxy() { + var _a; + this.removeChild(this.proxy); + (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate(anchor) { + if (this.proxy instanceof HTMLElement) { + this.setValidity(this.proxy.validity, this.proxy.validationMessage, anchor); + } + } + /** + * Associates the provided value (and optional state) with the parent form. + * @param value - The value to set + * @param state - The state object provided to during session restores and when autofilling. + */ + setFormValue(value, state) { + if (this.elementInternals) { + this.elementInternals.setFormValue(value, state || value); + } + } + _keypressHandler(e) { + switch (e.key) { + case keyEnter: + if (this.form instanceof HTMLFormElement) { + const defaultButton = this.form.querySelector("[type=submit]"); + defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click(); + } + break; + } + } + /** + * Used to stop propagation of proxy element events + * @param e - Event object + */ + stopPropagation(e) { + e.stopPropagation(); + } + }; + attr({ mode: "boolean" })(C.prototype, "disabled"); + attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue"); + attr({ attribute: "current-value" })(C.prototype, "currentValue"); + attr(C.prototype, "name"); + attr({ mode: "boolean" })(C.prototype, "required"); + observable(C.prototype, "value"); + return C; + } + function CheckableFormAssociated(BaseCtor) { + class C extends FormAssociated(BaseCtor) { + } + class D extends C { + constructor(...args) { + super(args); + this.dirtyChecked = false; + this.checkedAttribute = false; + this.checked = false; + this.dirtyChecked = false; + } + checkedAttributeChanged() { + this.defaultChecked = this.checkedAttribute; + } + /** + * @internal + */ + defaultCheckedChanged() { + if (!this.dirtyChecked) { + this.checked = this.defaultChecked; + this.dirtyChecked = false; + } + } + checkedChanged(prev, next) { + if (!this.dirtyChecked) { + this.dirtyChecked = true; + } + this.currentChecked = this.checked; + this.updateForm(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.checked = this.checked; + } + if (prev !== void 0) { + this.$emit("change"); + } + this.validate(); + } + currentCheckedChanged(prev, next) { + this.checked = this.currentChecked; + } + updateForm() { + const value = this.checked ? this.value : null; + this.setFormValue(value, value); + } + connectedCallback() { + super.connectedCallback(); + this.updateForm(); + } + formResetCallback() { + super.formResetCallback(); + this.checked = !!this.checkedAttribute; + this.dirtyChecked = false; + } + } + attr({ attribute: "checked", mode: "boolean" })(D.prototype, "checkedAttribute"); + attr({ attribute: "current-checked", converter: booleanConverter })(D.prototype, "currentChecked"); + observable(D.prototype, "defaultChecked"); + observable(D.prototype, "checked"); + return D; + } + var proxySlotName, ElementInternalsKey, supportsElementInternals, InternalsMap; + var init_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/form-associated.js"() { + init_esm(); + init_dist2(); + proxySlotName = "form-associated-proxy"; + ElementInternalsKey = "ElementInternals"; + supportsElementInternals = ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype; + InternalsMap = /* @__PURE__ */ new WeakMap(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js + var _Button, FormAssociatedButton; + var init_button_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Button = class extends FoundationElement { + }; + FormAssociatedButton = class extends FormAssociated(_Button) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/button.js + var Button, DelegatesARIAButton; + var init_button = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/button.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_button_form_associated(); + Button = class extends FormAssociatedButton { + constructor() { + super(...arguments); + this.handleClick = (e) => { + var _a; + if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) { + e.stopPropagation(); + } + }; + this.handleSubmission = () => { + if (!this.form) { + return; + } + const attached = this.proxy.isConnected; + if (!attached) { + this.attachProxy(); + } + typeof this.form.requestSubmit === "function" ? this.form.requestSubmit(this.proxy) : this.proxy.click(); + if (!attached) { + this.detachProxy(); + } + }; + this.handleFormReset = () => { + var _a; + (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset(); + }; + this.handleUnsupportedDelegatesFocus = () => { + var _a; + if (window.ShadowRoot && !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) { + this.focus = () => { + this.control.focus(); + }; + } + }; + } + formactionChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formAction = this.formaction; + } + } + formenctypeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formEnctype = this.formenctype; + } + } + formmethodChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formMethod = this.formmethod; + } + } + formnovalidateChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formNoValidate = this.formnovalidate; + } + } + formtargetChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.formTarget = this.formtarget; + } + } + typeChanged(previous, next) { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + } + next === "submit" && this.addEventListener("click", this.handleSubmission); + previous === "submit" && this.removeEventListener("click", this.handleSubmission); + next === "reset" && this.addEventListener("click", this.handleFormReset); + previous === "reset" && this.removeEventListener("click", this.handleFormReset); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.handleUnsupportedDelegatesFocus(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.addEventListener("click", this.handleClick); + }); + } + } + /** + * @internal + */ + disconnectedCallback() { + var _a; + super.disconnectedCallback(); + const elements2 = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children); + if (elements2) { + elements2.forEach((span) => { + span.removeEventListener("click", this.handleClick); + }); + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], Button.prototype, "formId", void 0); + __decorate([ + attr + ], Button.prototype, "formaction", void 0); + __decorate([ + attr + ], Button.prototype, "formenctype", void 0); + __decorate([ + attr + ], Button.prototype, "formmethod", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Button.prototype, "formnovalidate", void 0); + __decorate([ + attr + ], Button.prototype, "formtarget", void 0); + __decorate([ + attr + ], Button.prototype, "type", void 0); + __decorate([ + observable + ], Button.prototype, "defaultSlottedContent", void 0); + DelegatesARIAButton = class { + }; + __decorate([ + attr({ attribute: "aria-expanded" }) + ], DelegatesARIAButton.prototype, "ariaExpanded", void 0); + __decorate([ + attr({ attribute: "aria-pressed" }) + ], DelegatesARIAButton.prototype, "ariaPressed", void 0); + applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties); + applyMixins(Button, StartEnd, DelegatesARIAButton); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/button/index.js + var init_button2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/button/index.js"() { + init_button_template(); + init_button(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js + var DateFormatter; + var init_date_formatter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/date-formatter.js"() { + DateFormatter = class { + constructor(config) { + this.dayFormat = "numeric"; + this.weekdayFormat = "long"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.date = /* @__PURE__ */ new Date(); + if (config) { + for (const key in config) { + const value = config[key]; + if (key === "date") { + this.date = this.getDateObject(value); + } else { + this[key] = value; + } + } + } + } + /** + * Helper function to make sure that the DateFormatter is working with an instance of Date + * @param date - The date as an object, string or Date insance + * @returns - A Date instance + * @public + */ + getDateObject(date) { + if (typeof date === "string") { + const dates = date.split(/[/-]/); + if (dates.length < 3) { + return /* @__PURE__ */ new Date(); + } + return new Date(parseInt(dates[2], 10), parseInt(dates[0], 10) - 1, parseInt(dates[1], 10)); + } else if ("day" in date && "month" in date && "year" in date) { + const { day, month, year } = date; + return new Date(year, month - 1, day); + } + return date; + } + /** + * + * @param date - a valide date as either a Date, string, objec or a DateFormatter + * @param format - The formatting for the string + * @param locale - locale data used for formatting + * @returns A localized string of the date provided + * @public + */ + getDate(date = this.date, format = { + weekday: this.weekdayFormat, + month: this.monthFormat, + day: this.dayFormat, + year: this.yearFormat + }, locale = this.locale) { + const dateObj = this.getDateObject(date); + if (!dateObj.getTime()) { + return ""; + } + const optionsWithTimeZone = Object.assign({ timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone }, format); + return new Intl.DateTimeFormat(locale, optionsWithTimeZone).format(dateObj); + } + /** + * + * @param day - Day to localize + * @param format - The formatting for the day + * @param locale - The locale data used for formatting + * @returns - A localized number for the day + * @public + */ + getDay(day = this.date.getDate(), format = this.dayFormat, locale = this.locale) { + return this.getDate({ month: 1, day, year: 2020 }, { day: format }, locale); + } + /** + * + * @param month - The month to localize + * @param format - The formatting for the month + * @param locale - The locale data used for formatting + * @returns - A localized name of the month + * @public + */ + getMonth(month = this.date.getMonth() + 1, format = this.monthFormat, locale = this.locale) { + return this.getDate({ month, day: 2, year: 2020 }, { month: format }, locale); + } + /** + * + * @param year - The year to localize + * @param format - The formatting for the year + * @param locale - The locale data used for formatting + * @returns - A localized string for the year + * @public + */ + getYear(year = this.date.getFullYear(), format = this.yearFormat, locale = this.locale) { + return this.getDate({ month: 2, day: 2, year }, { year: format }, locale); + } + /** + * + * @param weekday - The number of the weekday, defaults to Sunday + * @param format - The formatting for the weekday label + * @param locale - The locale data used for formatting + * @returns - A formatted weekday label + * @public + */ + getWeekday(weekday = 0, format = this.weekdayFormat, locale = this.locale) { + const date = `1-${weekday + 1}-2017`; + return this.getDate(date, { weekday: format }, locale); + } + /** + * + * @param format - The formatting for the weekdays + * @param locale - The locale data used for formatting + * @returns - An array of the weekday labels + * @public + */ + getWeekdays(format = this.weekdayFormat, locale = this.locale) { + return Array(7).fill(null).map((_, day) => this.getWeekday(day, format, locale)); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js + var Calendar; + var init_calendar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_date_formatter(); + Calendar = class extends FoundationElement { + constructor() { + super(...arguments); + this.dateFormatter = new DateFormatter(); + this.readonly = false; + this.locale = "en-US"; + this.month = (/* @__PURE__ */ new Date()).getMonth() + 1; + this.year = (/* @__PURE__ */ new Date()).getFullYear(); + this.dayFormat = "numeric"; + this.weekdayFormat = "short"; + this.monthFormat = "long"; + this.yearFormat = "numeric"; + this.minWeeks = 0; + this.disabledDates = ""; + this.selectedDates = ""; + this.oneDayInMs = 864e5; + } + localeChanged() { + this.dateFormatter.locale = this.locale; + } + dayFormatChanged() { + this.dateFormatter.dayFormat = this.dayFormat; + } + weekdayFormatChanged() { + this.dateFormatter.weekdayFormat = this.weekdayFormat; + } + monthFormatChanged() { + this.dateFormatter.monthFormat = this.monthFormat; + } + yearFormatChanged() { + this.dateFormatter.yearFormat = this.yearFormat; + } + /** + * Gets data needed to render about a calendar month as well as the previous and next months + * @param year - year of the calendar + * @param month - month of the calendar + * @returns - an object with data about the current and 2 surrounding months + * @public + */ + getMonthInfo(month = this.month, year = this.year) { + const getFirstDay = (date) => new Date(date.getFullYear(), date.getMonth(), 1).getDay(); + const getLength = (date) => { + const nextMonth2 = new Date(date.getFullYear(), date.getMonth() + 1, 1); + return new Date(nextMonth2.getTime() - this.oneDayInMs).getDate(); + }; + const thisMonth = new Date(year, month - 1); + const nextMonth = new Date(year, month); + const previousMonth = new Date(year, month - 2); + return { + length: getLength(thisMonth), + month, + start: getFirstDay(thisMonth), + year, + previous: { + length: getLength(previousMonth), + month: previousMonth.getMonth() + 1, + start: getFirstDay(previousMonth), + year: previousMonth.getFullYear() + }, + next: { + length: getLength(nextMonth), + month: nextMonth.getMonth() + 1, + start: getFirstDay(nextMonth), + year: nextMonth.getFullYear() + } + }; + } + /** + * A list of calendar days + * @param info - an object containing the information needed to render a calendar month + * @param minWeeks - minimum number of weeks to show + * @returns a list of days in a calendar month + * @public + */ + getDays(info = this.getMonthInfo(), minWeeks = this.minWeeks) { + minWeeks = minWeeks > 10 ? 10 : minWeeks; + const { start, length, previous, next } = info; + const days = []; + let dayCount = 1 - start; + while (dayCount < length + 1 || days.length < minWeeks || days[days.length - 1].length % 7 !== 0) { + const { month, year } = dayCount < 1 ? previous : dayCount > length ? next : info; + const day = dayCount < 1 ? previous.length + dayCount : dayCount > length ? dayCount - length : dayCount; + const dateString = `${month}-${day}-${year}`; + const disabled = this.dateInString(dateString, this.disabledDates); + const selected = this.dateInString(dateString, this.selectedDates); + const date = { + day, + month, + year, + disabled, + selected + }; + const target = days[days.length - 1]; + if (days.length === 0 || target.length % 7 === 0) { + days.push([date]); + } else { + target.push(date); + } + dayCount++; + } + return days; + } + /** + * A helper function that checks if a date exists in a list of dates + * @param date - A date objec that includes the day, month and year + * @param datesString - a comma separated list of dates + * @returns - Returns true if it found the date in the list of dates + * @public + */ + dateInString(date, datesString) { + const dates = datesString.split(",").map((str) => str.trim()); + date = typeof date === "string" ? date : `${date.getMonth() + 1}-${date.getDate()}-${date.getFullYear()}`; + return dates.some((d) => d === date); + } + /** + * Creates a class string for the day container + * @param date - date of the calendar cell + * @returns - string of class names + * @public + */ + getDayClassNames(date, todayString) { + const { day, month, year, disabled, selected } = date; + const today = todayString === `${month}-${day}-${year}`; + const inactive = this.month !== month; + return [ + "day", + today && "today", + inactive && "inactive", + disabled && "disabled", + selected && "selected" + ].filter(Boolean).join(" "); + } + /** + * Returns a list of weekday labels + * @returns An array of weekday text and full text if abbreviated + * @public + */ + getWeekdayText() { + const weekdayText = this.dateFormatter.getWeekdays().map((text) => ({ text })); + if (this.weekdayFormat !== "long") { + const longText = this.dateFormatter.getWeekdays("long"); + weekdayText.forEach((weekday, index) => { + weekday.abbr = longText[index]; + }); + } + return weekdayText; + } + /** + * Emits the "date-select" event with the day, month and year. + * @param date - Date cell + * @public + */ + handleDateSelect(event, day) { + event.preventDefault; + this.$emit("dateselected", day); + } + /** + * Handles keyboard events on a cell + * @param event - Keyboard event + * @param date - Date of the cell selected + */ + handleKeydown(event, date) { + if (event.key === keyEnter) { + this.handleDateSelect(event, date); + } + return true; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Calendar.prototype, "readonly", void 0); + __decorate([ + attr + ], Calendar.prototype, "locale", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "month", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Calendar.prototype, "year", void 0); + __decorate([ + attr({ attribute: "day-format", mode: "fromView" }) + ], Calendar.prototype, "dayFormat", void 0); + __decorate([ + attr({ attribute: "weekday-format", mode: "fromView" }) + ], Calendar.prototype, "weekdayFormat", void 0); + __decorate([ + attr({ attribute: "month-format", mode: "fromView" }) + ], Calendar.prototype, "monthFormat", void 0); + __decorate([ + attr({ attribute: "year-format", mode: "fromView" }) + ], Calendar.prototype, "yearFormat", void 0); + __decorate([ + attr({ attribute: "min-weeks", converter: nullableNumberConverter }) + ], Calendar.prototype, "minWeeks", void 0); + __decorate([ + attr({ attribute: "disabled-dates" }) + ], Calendar.prototype, "disabledDates", void 0); + __decorate([ + attr({ attribute: "selected-dates" }) + ], Calendar.prototype, "selectedDates", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js + var GenerateHeaderOptions, DataGridCellTypes, DataGridRowTypes; + var init_data_grid_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.options.js"() { + GenerateHeaderOptions = { + none: "none", + default: "default", + sticky: "sticky" + }; + DataGridCellTypes = { + default: "default", + columnHeader: "columnheader", + rowHeader: "rowheader" + }; + DataGridRowTypes = { + default: "default", + header: "header", + stickyHeader: "sticky-header" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js + var DataGridRow; + var init_data_grid_row = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGridRow = class extends FoundationElement { + constructor() { + super(...arguments); + this.rowType = DataGridRowTypes.default; + this.rowData = null; + this.columnDefinitions = null; + this.isActiveRow = false; + this.cellsRepeatBehavior = null; + this.cellsPlaceholder = null; + this.focusColumnIndex = 0; + this.refocusOnLoad = false; + this.updateRowStyle = () => { + this.style.gridTemplateColumns = this.gridTemplateColumns; + }; + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowStyle(); + } + } + rowTypeChanged() { + if (this.$fastController.isConnected) { + this.updateItemTemplate(); + } + } + rowDataChanged() { + if (this.rowData !== null && this.isActiveRow) { + this.refocusOnLoad = true; + return; + } + } + cellItemTemplateChanged() { + this.updateItemTemplate(); + } + headerCellItemTemplateChanged() { + this.updateItemTemplate(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.cellsRepeatBehavior === null) { + this.cellsPlaceholder = document.createComment(""); + this.appendChild(this.cellsPlaceholder); + this.updateItemTemplate(); + this.cellsRepeatBehavior = new RepeatDirective((x) => x.columnDefinitions, (x) => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder); + this.$fastController.addBehaviors([this.cellsRepeatBehavior]); + } + this.addEventListener("cell-focused", this.handleCellFocus); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.updateRowStyle(); + if (this.refocusOnLoad) { + this.refocusOnLoad = false; + if (this.cellElements.length > this.focusColumnIndex) { + this.cellElements[this.focusColumnIndex].focus(); + } + } + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("cell-focused", this.handleCellFocus); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + } + handleFocusout(e) { + if (!this.contains(e.target)) { + this.isActiveRow = false; + this.focusColumnIndex = 0; + } + } + handleCellFocus(e) { + this.isActiveRow = true; + this.focusColumnIndex = this.cellElements.indexOf(e.target); + this.$emit("row-focused", this); + } + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusColumnIndex = 0; + switch (e.key) { + case keyArrowLeft: + newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyArrowRight: + newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1); + this.cellElements[newFocusColumnIndex].focus(); + e.preventDefault(); + break; + case keyHome: + if (!e.ctrlKey) { + this.cellElements[0].focus(); + e.preventDefault(); + } + break; + case keyEnd: + if (!e.ctrlKey) { + this.cellElements[this.cellElements.length - 1].focus(); + e.preventDefault(); + } + break; + } + } + updateItemTemplate() { + this.activeCellItemTemplate = this.rowType === DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate; + } + }; + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGridRow.prototype, "gridTemplateColumns", void 0); + __decorate([ + attr({ attribute: "row-type" }) + ], DataGridRow.prototype, "rowType", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "rowIndex", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "isActiveRow", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "activeCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0); + __decorate([ + observable + ], DataGridRow.prototype, "cellElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js + function createRowItemTemplate(context) { + const rowTag = context.tagFor(DataGridRow); + return html` + <${rowTag} + :rowData="${(x) => x}" + :cellItemTemplate="${(x, c) => c.parent.cellItemTemplate}" + :headerCellItemTemplate="${(x, c) => c.parent.headerCellItemTemplate}" + > +`; + } + var dataGridTemplate; + var init_data_grid_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.template.js"() { + init_esm(); + init_data_grid_row(); + dataGridTemplate = (context, definition) => { + const rowItemTemplate = createRowItemTemplate(context); + const rowTag = context.tagFor(DataGridRow); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js + var DataGrid; + var init_data_grid = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + DataGrid = class _DataGrid extends FoundationElement { + constructor() { + super(); + this.noTabbing = false; + this.generateHeader = GenerateHeaderOptions.default; + this.rowsData = []; + this.columnDefinitions = null; + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + this.rowsPlaceholder = null; + this.generatedHeader = null; + this.isUpdatingFocus = false; + this.pendingFocusUpdate = false; + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = true; + this.generatedGridTemplateColumns = ""; + this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => { + if (this.rowElements.length === 0) { + this.focusRowIndex = 0; + this.focusColumnIndex = 0; + return; + } + const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex)); + const focusRow = this.rowElements[focusRowIndex]; + const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]'); + const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex)); + const focusTarget = cells[focusColumnIndex]; + if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) { + focusTarget.scrollIntoView({ block: "center", inline: "center" }); + } + focusTarget.focus(); + }; + this.onChildListChange = (mutations, observer) => { + if (mutations && mutations.length) { + mutations.forEach((mutation) => { + mutation.addedNodes.forEach((newNode) => { + if (newNode.nodeType === 1 && newNode.getAttribute("role") === "row") { + newNode.columnDefinitions = this.columnDefinitions; + } + }); + }); + this.queueRowIndexUpdate(); + } + }; + this.queueRowIndexUpdate = () => { + if (!this.rowindexUpdateQueued) { + this.rowindexUpdateQueued = true; + DOM.queueUpdate(this.updateRowIndexes); + } + }; + this.updateRowIndexes = () => { + let newGridTemplateColumns = this.gridTemplateColumns; + if (newGridTemplateColumns === void 0) { + if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) { + const firstRow = this.rowElements[0]; + this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" "); + } + newGridTemplateColumns = this.generatedGridTemplateColumns; + } + this.rowElements.forEach((element, index) => { + const thisRow = element; + thisRow.rowIndex = index; + thisRow.gridTemplateColumns = newGridTemplateColumns; + if (this.columnDefinitionsStale) { + thisRow.columnDefinitions = this.columnDefinitions; + } + }); + this.rowindexUpdateQueued = false; + this.columnDefinitionsStale = false; + }; + } + /** + * generates a gridTemplateColumns based on columndata array + */ + static generateTemplateColumns(columnDefinitions) { + let templateColumns = ""; + columnDefinitions.forEach((column) => { + templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`; + }); + return templateColumns; + } + noTabbingChanged() { + if (this.$fastController.isConnected) { + if (this.noTabbing) { + this.setAttribute("tabIndex", "-1"); + } else { + this.setAttribute("tabIndex", this.contains(document.activeElement) || this === document.activeElement ? "-1" : "0"); + } + } + } + generateHeaderChanged() { + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + gridTemplateColumnsChanged() { + if (this.$fastController.isConnected) { + this.updateRowIndexes(); + } + } + rowsDataChanged() { + if (this.columnDefinitions === null && this.rowsData.length > 0) { + this.columnDefinitions = _DataGrid.generateColumns(this.rowsData[0]); + } + if (this.$fastController.isConnected) { + this.toggleGeneratedHeader(); + } + } + columnDefinitionsChanged() { + if (this.columnDefinitions === null) { + this.generatedGridTemplateColumns = ""; + return; + } + this.generatedGridTemplateColumns = _DataGrid.generateTemplateColumns(this.columnDefinitions); + if (this.$fastController.isConnected) { + this.columnDefinitionsStale = true; + this.queueRowIndexUpdate(); + } + } + headerCellItemTemplateChanged() { + if (this.$fastController.isConnected) { + if (this.generatedHeader !== null) { + this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate; + } + } + } + focusRowIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + focusColumnIndexChanged() { + if (this.$fastController.isConnected) { + this.queueFocusUpdate(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.rowItemTemplate === void 0) { + this.rowItemTemplate = this.defaultRowItemTemplate; + } + this.rowsPlaceholder = document.createComment(""); + this.appendChild(this.rowsPlaceholder); + this.toggleGeneratedHeader(); + this.rowsRepeatBehavior = new RepeatDirective((x) => x.rowsData, (x) => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder); + this.$fastController.addBehaviors([this.rowsRepeatBehavior]); + this.addEventListener("row-focused", this.handleRowFocus); + this.addEventListener(eventFocus, this.handleFocus); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.addEventListener(eventFocusOut, this.handleFocusOut); + this.observer = new MutationObserver(this.onChildListChange); + this.observer.observe(this, { childList: true }); + if (this.noTabbing) { + this.setAttribute("tabindex", "-1"); + } + DOM.queueUpdate(this.queueRowIndexUpdate); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener("row-focused", this.handleRowFocus); + this.removeEventListener(eventFocus, this.handleFocus); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.removeEventListener(eventFocusOut, this.handleFocusOut); + this.observer.disconnect(); + this.rowsPlaceholder = null; + this.generatedHeader = null; + } + /** + * @internal + */ + handleRowFocus(e) { + this.isUpdatingFocus = true; + const focusRow = e.target; + this.focusRowIndex = this.rowElements.indexOf(focusRow); + this.focusColumnIndex = focusRow.focusColumnIndex; + this.setAttribute("tabIndex", "-1"); + this.isUpdatingFocus = false; + } + /** + * @internal + */ + handleFocus(e) { + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + /** + * @internal + */ + handleFocusOut(e) { + if (e.relatedTarget === null || !this.contains(e.relatedTarget)) { + this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0"); + } + } + /** + * @internal + */ + handleKeydown(e) { + if (e.defaultPrevented) { + return; + } + let newFocusRowIndex; + const maxIndex = this.rowElements.length - 1; + const currentGridBottom = this.offsetHeight + this.scrollTop; + const lastRow = this.rowElements[maxIndex]; + switch (e.key) { + case keyArrowUp: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true); + break; + case keyArrowDown: + e.preventDefault(); + this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true); + break; + case keyPageUp: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex === 0) { + this.focusOnCell(0, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex - 1; + for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop < this.scrollTop) { + this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyPageDown: + e.preventDefault(); + if (this.rowElements.length === 0) { + this.focusOnCell(0, 0, false); + break; + } + if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) { + this.focusOnCell(maxIndex, this.focusColumnIndex, false); + return; + } + newFocusRowIndex = this.focusRowIndex + 1; + for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) { + const thisRow = this.rowElements[newFocusRowIndex]; + if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) { + let stickyHeaderOffset = 0; + if (this.generateHeader === GenerateHeaderOptions.sticky && this.generatedHeader !== null) { + stickyHeaderOffset = this.generatedHeader.clientHeight; + } + this.scrollTop = thisRow.offsetTop - stickyHeaderOffset; + break; + } + } + this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false); + break; + case keyHome: + if (e.ctrlKey) { + e.preventDefault(); + this.focusOnCell(0, 0, true); + } + break; + case keyEnd: + if (e.ctrlKey && this.columnDefinitions !== null) { + e.preventDefault(); + this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true); + } + break; + } + } + queueFocusUpdate() { + if (this.isUpdatingFocus && (this.contains(document.activeElement) || this === document.activeElement)) { + return; + } + if (this.pendingFocusUpdate === false) { + this.pendingFocusUpdate = true; + DOM.queueUpdate(() => this.updateFocus()); + } + } + updateFocus() { + this.pendingFocusUpdate = false; + this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true); + } + toggleGeneratedHeader() { + if (this.generatedHeader !== null) { + this.removeChild(this.generatedHeader); + this.generatedHeader = null; + } + if (this.generateHeader !== GenerateHeaderOptions.none && this.rowsData.length > 0) { + const generatedHeaderElement = document.createElement(this.rowElementTag); + this.generatedHeader = generatedHeaderElement; + this.generatedHeader.columnDefinitions = this.columnDefinitions; + this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns; + this.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header; + if (this.firstChild !== null || this.rowsPlaceholder !== null) { + this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder); + } + return; + } + } + }; + DataGrid.generateColumns = (row) => { + return Object.getOwnPropertyNames(row).map((property, index) => { + return { + columnDataKey: property, + gridColumn: `${index}` + }; + }); + }; + __decorate([ + attr({ attribute: "no-tabbing", mode: "boolean" }) + ], DataGrid.prototype, "noTabbing", void 0); + __decorate([ + attr({ attribute: "generate-header" }) + ], DataGrid.prototype, "generateHeader", void 0); + __decorate([ + attr({ attribute: "grid-template-columns" }) + ], DataGrid.prototype, "gridTemplateColumns", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowsData", void 0); + __decorate([ + observable + ], DataGrid.prototype, "columnDefinitions", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "cellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "headerCellItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusRowIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "focusColumnIndex", void 0); + __decorate([ + observable + ], DataGrid.prototype, "defaultRowItemTemplate", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElementTag", void 0); + __decorate([ + observable + ], DataGrid.prototype, "rowElements", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js + var defaultCellContentsTemplate, defaultHeaderCellContentsTemplate, DataGridCell; + var init_data_grid_cell = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_data_grid_options(); + defaultCellContentsTemplate = html` + +`; + defaultHeaderCellContentsTemplate = html` + +`; + DataGridCell = class extends FoundationElement { + constructor() { + super(...arguments); + this.cellType = DataGridCellTypes.default; + this.rowData = null; + this.columnDefinition = null; + this.isActiveCell = false; + this.customCellView = null; + this.updateCellStyle = () => { + this.style.gridColumn = this.gridColumn; + }; + } + cellTypeChanged() { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + gridColumnChanged() { + if (this.$fastController.isConnected) { + this.updateCellStyle(); + } + } + columnDefinitionChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.updateCellView(); + } + } + /** + * @internal + */ + connectedCallback() { + var _a; + super.connectedCallback(); + this.addEventListener(eventFocusIn, this.handleFocusin); + this.addEventListener(eventFocusOut, this.handleFocusout); + this.addEventListener(eventKeyDown, this.handleKeydown); + this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === void 0 ? 0 : this.columnDefinition.gridColumn}`; + this.updateCellView(); + this.updateCellStyle(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeEventListener(eventFocusIn, this.handleFocusin); + this.removeEventListener(eventFocusOut, this.handleFocusout); + this.removeEventListener(eventKeyDown, this.handleKeydown); + this.disconnectCellView(); + } + handleFocusin(e) { + if (this.isActiveCell) { + return; + } + this.isActiveCell = true; + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + default: + if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + } + break; + } + this.$emit("cell-focused", this); + } + handleFocusout(e) { + if (this !== document.activeElement && !this.contains(document.activeElement)) { + this.isActiveCell = false; + } + } + handleKeydown(e) { + if (e.defaultPrevented || this.columnDefinition === null || this.cellType === DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) { + return; + } + switch (e.key) { + case keyEnter: + case keyFunction2: + if (this.contains(document.activeElement) && document.activeElement !== this) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + default: + if (this.columnDefinition.cellFocusTargetCallback !== void 0) { + const focusTarget = this.columnDefinition.cellFocusTargetCallback(this); + if (focusTarget !== null) { + focusTarget.focus(); + } + e.preventDefault(); + } + break; + } + break; + case keyEscape: + if (this.contains(document.activeElement) && document.activeElement !== this) { + this.focus(); + e.preventDefault(); + } + break; + } + } + updateCellView() { + this.disconnectCellView(); + if (this.columnDefinition === null) { + return; + } + switch (this.cellType) { + case DataGridCellTypes.columnHeader: + if (this.columnDefinition.headerCellTemplate !== void 0) { + this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this); + } else { + this.customCellView = defaultHeaderCellContentsTemplate.render(this, this); + } + break; + case void 0: + case DataGridCellTypes.rowHeader: + case DataGridCellTypes.default: + if (this.columnDefinition.cellTemplate !== void 0) { + this.customCellView = this.columnDefinition.cellTemplate.render(this, this); + } else { + this.customCellView = defaultCellContentsTemplate.render(this, this); + } + break; + } + } + disconnectCellView() { + if (this.customCellView !== null) { + this.customCellView.dispose(); + this.customCellView = null; + } + } + }; + __decorate([ + attr({ attribute: "cell-type" }) + ], DataGridCell.prototype, "cellType", void 0); + __decorate([ + attr({ attribute: "grid-column" }) + ], DataGridCell.prototype, "gridColumn", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "rowData", void 0); + __decorate([ + observable + ], DataGridCell.prototype, "columnDefinition", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js + function createCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}" + grid-column="${(x, c) => c.index + 1}" + :rowData="${(x, c) => c.parent.rowData}" + :columnDefinition="${(x) => x}" + > +`; + } + function createHeaderCellItemTemplate(context) { + const cellTag = context.tagFor(DataGridCell); + return html` + <${cellTag} + cell-type="columnheader" + grid-column="${(x, c) => c.index + 1}" + :columnDefinition="${(x) => x}" + > +`; + } + var dataGridRowTemplate; + var init_data_grid_row_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-row.template.js"() { + init_esm(); + init_data_grid_cell(); + dataGridRowTemplate = (context, definition) => { + const cellItemTemplate = createCellItemTemplate(context); + const headerCellItemTemplate = createHeaderCellItemTemplate(context); + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js + var dataGridCellTemplate; + var init_data_grid_cell_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/data-grid-cell.template.js"() { + init_esm(); + dataGridCellTemplate = (context, definition) => { + return html` + + `; + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js + var init_data_grid2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/data-grid/index.js"() { + init_data_grid_template(); + init_data_grid(); + init_data_grid_row_template(); + init_data_grid_row(); + init_data_grid_cell_template(); + init_data_grid_cell(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js + var CalendarTitleTemplate; + var init_calendar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/calendar.template.js"() { + init_esm(); + CalendarTitleTemplate = html` +
    + + ${(x) => x.dateFormatter.getMonth(x.month)} + + ${(x) => x.dateFormatter.getYear(x.year)} +
    +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js + var init_calendar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/calendar/index.js"() { + init_calendar(); + init_calendar_template(); + init_date_formatter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js + var init_card_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/card.js + var init_card = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/card.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/card/index.js + var init_card2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/card/index.js"() { + init_card_template(); + init_card(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js + var checkboxTemplate; + var init_checkbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.template.js"() { + init_esm(); + checkboxTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js + var _Checkbox, FormAssociatedCheckbox; + var init_checkbox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Checkbox = class extends FoundationElement { + }; + FormAssociatedCheckbox = class extends CheckableFormAssociated(_Checkbox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js + var Checkbox; + var init_checkbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/checkbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_checkbox_form_associated(); + Checkbox = class extends FormAssociatedCheckbox { + constructor() { + super(); + this.initialValue = "on"; + this.indeterminate = false; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keySpace: + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + if (this.indeterminate) { + this.indeterminate = false; + } + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Checkbox.prototype, "readOnly", void 0); + __decorate([ + observable + ], Checkbox.prototype, "defaultSlottedNodes", void 0); + __decorate([ + observable + ], Checkbox.prototype, "indeterminate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js + var init_checkbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/checkbox/index.js"() { + init_checkbox_template(); + init_checkbox(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js + function isListboxOption(el2) { + return isHTMLElement(el2) && (el2.getAttribute("role") === "option" || el2 instanceof HTMLOptionElement); + } + var ListboxOption, DelegatesARIAListboxOption; + var init_listbox_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + ListboxOption = class extends FoundationElement { + constructor(text, value, defaultSelected, selected) { + super(); + this.defaultSelected = false; + this.dirtySelected = false; + this.selected = this.defaultSelected; + this.dirtyValue = false; + if (text) { + this.textContent = text; + } + if (value) { + this.initialValue = value; + } + if (defaultSelected) { + this.defaultSelected = defaultSelected; + } + if (selected) { + this.selected = selected; + } + this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected); + this.proxy.disabled = this.disabled; + } + /** + * Updates the ariaChecked property when the checked property changes. + * + * @param prev - the previous checked value + * @param next - the current checked value + * + * @public + */ + checkedChanged(prev, next) { + if (typeof next === "boolean") { + this.ariaChecked = next ? "true" : "false"; + return; + } + this.ariaChecked = null; + } + /** + * Updates the proxy's text content when the default slot changes. + * @param prev - the previous content value + * @param next - the current content value + * + * @internal + */ + contentChanged(prev, next) { + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.textContent = this.textContent; + } + this.$emit("contentchange", null, { bubbles: true }); + } + defaultSelectedChanged() { + if (!this.dirtySelected) { + this.selected = this.defaultSelected; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.defaultSelected; + } + } + } + disabledChanged(prev, next) { + this.ariaDisabled = this.disabled ? "true" : "false"; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.disabled = this.disabled; + } + } + selectedAttributeChanged() { + this.defaultSelected = this.selectedAttribute; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.defaultSelected = this.defaultSelected; + } + } + selectedChanged() { + this.ariaSelected = this.selected ? "true" : "false"; + if (!this.dirtySelected) { + this.dirtySelected = true; + } + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.selected = this.selected; + } + } + initialValueChanged(previous, next) { + if (!this.dirtyValue) { + this.value = this.initialValue; + this.dirtyValue = false; + } + } + get label() { + var _a; + return (_a = this.value) !== null && _a !== void 0 ? _a : this.text; + } + get text() { + var _a, _b; + return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : ""; + } + set value(next) { + const newValue = `${next !== null && next !== void 0 ? next : ""}`; + this._value = newValue; + this.dirtyValue = true; + if (this.proxy instanceof HTMLOptionElement) { + this.proxy.value = newValue; + } + Observable.notify(this, "value"); + } + get value() { + var _a; + Observable.track(this, "value"); + return (_a = this._value) !== null && _a !== void 0 ? _a : this.text; + } + get form() { + return this.proxy ? this.proxy.form : null; + } + }; + __decorate([ + observable + ], ListboxOption.prototype, "checked", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "content", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "defaultSelected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxOption.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "selected", mode: "boolean" }) + ], ListboxOption.prototype, "selectedAttribute", void 0); + __decorate([ + observable + ], ListboxOption.prototype, "selected", void 0); + __decorate([ + attr({ attribute: "value", mode: "fromView" }) + ], ListboxOption.prototype, "initialValue", void 0); + DelegatesARIAListboxOption = class { + }; + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0); + __decorate([ + observable + ], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0); + applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties); + applyMixins(ListboxOption, StartEnd, DelegatesARIAListboxOption); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js + var Listbox, DelegatesARIAListbox; + var init_listbox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_listbox_option(); + init_aria_global(); + init_apply_mixins(); + Listbox = class _Listbox extends FoundationElement { + constructor() { + super(...arguments); + this._options = []; + this.selectedIndex = -1; + this.selectedOptions = []; + this.shouldSkipFocus = false; + this.typeaheadBuffer = ""; + this.typeaheadExpired = true; + this.typeaheadTimeout = -1; + } + /** + * The first selected option. + * + * @internal + */ + get firstSelectedOption() { + var _a; + return (_a = this.selectedOptions[0]) !== null && _a !== void 0 ? _a : null; + } + /** + * Returns true if there is one or more selectable option. + * + * @internal + */ + get hasSelectableOptions() { + return this.options.length > 0 && !this.options.every((o) => o.disabled); + } + /** + * The number of options. + * + * @public + */ + get length() { + var _a, _b; + return (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0; + } + /** + * The list of options. + * + * @public + */ + get options() { + Observable.track(this, "options"); + return this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Flag for the typeahead timeout expiration. + * + * @deprecated use `Listbox.typeaheadExpired` + * @internal + */ + get typeAheadExpired() { + return this.typeaheadExpired; + } + set typeAheadExpired(value) { + this.typeaheadExpired = value; + } + /** + * Handle click events for listbox options. + * + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && !captured.disabled) { + this.selectedIndex = this.options.indexOf(captured); + return true; + } + } + /** + * Ensures that the provided option is focused and scrolled into view. + * + * @param optionToFocus - The option to focus + * @internal + */ + focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) { + if (this.contains(document.activeElement) && optionToFocus !== null) { + optionToFocus.focus(); + requestAnimationFrame(() => { + optionToFocus.scrollIntoView({ block: "nearest" }); + }); + } + } + /** + * Handles `focusin` actions for the component. When the component receives focus, + * the list of selected options is refreshed and the first selected option is scrolled + * into view. + * + * @internal + */ + focusinHandler(e) { + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Returns the options which match the current typeahead buffer. + * + * @internal + */ + getTypeaheadMatches() { + const pattern = this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp(`^${pattern}`, "gi"); + return this.options.filter((o) => o.text.trim().match(re)); + } + /** + * Determines the index of the next option which is selectable, if any. + * + * @param prev - the previous selected index + * @param next - the next index to select + * + * @internal + */ + getSelectableIndex(prev = this.selectedIndex, next) { + const direction = prev > next ? -1 : prev < next ? 1 : 0; + const potentialDirection = prev + direction; + let nextSelectableOption = null; + switch (direction) { + case -1: { + nextSelectableOption = this.options.reduceRight((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index < potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + case 1: { + nextSelectableOption = this.options.reduce((nextSelectableOption2, thisOption, index) => !nextSelectableOption2 && !thisOption.disabled && index > potentialDirection ? thisOption : nextSelectableOption2, nextSelectableOption); + break; + } + } + return this.options.indexOf(nextSelectableOption); + } + /** + * Handles external changes to child options. + * + * @param source - the source object + * @param propertyName - the property + * + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "selected": { + if (_Listbox.slottedOptionFilter(source)) { + this.selectedIndex = this.options.indexOf(source); + } + this.setSelectedOptions(); + break; + } + } + } + /** + * Moves focus to an option whose label matches characters typed by the user. + * Consecutive keystrokes are batched into a buffer of search text used + * to match against the set of options. If `TYPE_AHEAD_TIMEOUT_MS` passes + * between consecutive keystrokes, the search restarts. + * + * @param key - the key to be evaluated + * + * @internal + */ + handleTypeAhead(key) { + if (this.typeaheadTimeout) { + window.clearTimeout(this.typeaheadTimeout); + } + this.typeaheadTimeout = window.setTimeout(() => this.typeaheadExpired = true, _Listbox.TYPE_AHEAD_TIMEOUT_MS); + if (key.length > 1) { + return; + } + this.typeaheadBuffer = `${this.typeaheadExpired ? "" : this.typeaheadBuffer}${key}`; + } + /** + * Handles `keydown` actions for listbox navigation and typeahead. + * + * @internal + */ + keydownHandler(e) { + if (this.disabled) { + return true; + } + this.shouldSkipFocus = false; + const key = e.key; + switch (key) { + // Select the first available option + case keyHome: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectFirstOption(); + } + break; + } + // Select the next selectable option + case keyArrowDown: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectNextOption(); + } + break; + } + // Select the previous selectable option + case keyArrowUp: { + if (!e.shiftKey) { + e.preventDefault(); + this.selectPreviousOption(); + } + break; + } + // Select the last available option + case keyEnd: { + e.preventDefault(); + this.selectLastOption(); + break; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEnter: + case keyEscape: { + return true; + } + case keySpace: { + if (this.typeaheadExpired) { + return true; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @internal + */ + mousedownHandler(e) { + this.shouldSkipFocus = !this.contains(document.activeElement); + return true; + } + /** + * Switches between single-selection and multi-selection mode. + * + * @param prev - the previous value of the `multiple` attribute + * @param next - the next value of the `multiple` attribute + * + * @internal + */ + multipleChanged(prev, next) { + this.ariaMultiSelectable = next ? "true" : null; + } + /** + * Updates the list of selected options when the `selectedIndex` changes. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + var _a; + if (!this.hasSelectableOptions) { + this.selectedIndex = -1; + return; + } + if (((_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.disabled) && typeof prev === "number") { + const selectableIndex = this.getSelectableIndex(prev, next); + const newNext = selectableIndex > -1 ? selectableIndex : prev; + this.selectedIndex = newNext; + if (next === newNext) { + this.selectedIndexChanged(next, newNext); + } + return; + } + this.setSelectedOptions(); + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + const filteredNext = next.filter(_Listbox.slottedOptionFilter); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "selected"); + o.selected = filteredNext.includes(o); + notifier.subscribe(this, "selected"); + }); + } + /** + * Moves focus to the first selectable option. + * + * @public + */ + selectFirstOption() { + var _a, _b; + if (!this.disabled) { + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((o) => !o.disabled)) !== null && _b !== void 0 ? _b : -1; + } + } + /** + * Moves focus to the last selectable option. + * + * @internal + */ + selectLastOption() { + if (!this.disabled) { + this.selectedIndex = findLastIndex(this.options, (o) => !o.disabled); + } + } + /** + * Moves focus to the next selectable option. + * + * @internal + */ + selectNextOption() { + if (!this.disabled && this.selectedIndex < this.options.length - 1) { + this.selectedIndex += 1; + } + } + /** + * Moves focus to the previous selectable option. + * + * @internal + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex > 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Updates the selected index to match the first selected option. + * + * @internal + */ + setDefaultSelectedOption() { + var _a, _b; + this.selectedIndex = (_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.findIndex((el2) => el2.defaultSelected)) !== null && _b !== void 0 ? _b : -1; + } + /** + * Sets an option as selected and gives it focus. + * + * @public + */ + setSelectedOptions() { + var _a, _b, _c; + if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.length) { + this.selectedOptions = [this.options[this.selectedIndex]]; + this.ariaActiveDescendant = (_c = (_b = this.firstSelectedOption) === null || _b === void 0 ? void 0 : _b.id) !== null && _c !== void 0 ? _c : ""; + this.focusAndScrollOptionIntoView(); + } + } + /** + * Updates the list of options and resets the selected option when the slotted option content changes. + * + * @param prev - the previous list of slotted options + * @param next - the current list of slotted options + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options = next.reduce((options, item) => { + if (isListboxOption(item)) { + options.push(item); + } + return options; + }, []); + const setSize = `${this.options.length}`; + this.options.forEach((option, index) => { + if (!option.id) { + option.id = uniqueId("option-"); + } + option.ariaPosInSet = `${index + 1}`; + option.ariaSetSize = setSize; + }); + if (this.$fastController.isConnected) { + this.setSelectedOptions(); + this.setDefaultSelectedOption(); + } + } + /** + * Updates the filtered list of options when the typeahead buffer changes. + * + * @param prev - the previous typeahead buffer value + * @param next - the current typeahead buffer value + * + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + if (typeaheadMatches.length) { + const selectedIndex = this.options.indexOf(typeaheadMatches[0]); + if (selectedIndex > -1) { + this.selectedIndex = selectedIndex; + } + } + this.typeaheadExpired = false; + } + } + }; + Listbox.slottedOptionFilter = (n) => isListboxOption(n) && !n.hidden; + Listbox.TYPE_AHEAD_TIMEOUT_MS = 1e3; + __decorate([ + attr({ mode: "boolean" }) + ], Listbox.prototype, "disabled", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedIndex", void 0); + __decorate([ + observable + ], Listbox.prototype, "selectedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "slottedOptions", void 0); + __decorate([ + observable + ], Listbox.prototype, "typeaheadBuffer", void 0); + DelegatesARIAListbox = class { + }; + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaActiveDescendant", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaDisabled", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaExpanded", void 0); + __decorate([ + observable + ], DelegatesARIAListbox.prototype, "ariaMultiSelectable", void 0); + applyMixins(DelegatesARIAListbox, ARIAGlobalStatesAndProperties); + applyMixins(Listbox, DelegatesARIAListbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js + var SelectPosition; + var init_select_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.options.js"() { + SelectPosition = { + above: "above", + below: "below" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js + var _Combobox, FormAssociatedCombobox; + var init_combobox_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.form-associated.js"() { + init_form_associated(); + init_listbox(); + _Combobox = class extends Listbox { + }; + FormAssociatedCombobox = class extends FormAssociated(_Combobox) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js + var ComboboxAutocomplete; + var init_combobox_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.options.js"() { + ComboboxAutocomplete = { + inline: "inline", + list: "list", + both: "both", + none: "none" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js + var Combobox, DelegatesARIACombobox; + var init_combobox = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_select_options(); + init_apply_mixins(); + init_combobox_form_associated(); + init_combobox_options(); + Combobox = class extends FormAssociatedCombobox { + constructor() { + super(...arguments); + this._value = ""; + this.filteredOptions = []; + this.filter = ""; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + this.open = false; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + super.formResetCallback(); + this.setDefaultSelectedOption(); + this.updateValue(); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + get isAutocompleteInline() { + return this.autocomplete === ComboboxAutocomplete.inline || this.isAutocompleteBoth; + } + get isAutocompleteList() { + return this.autocomplete === ComboboxAutocomplete.list || this.isAutocompleteBoth; + } + get isAutocompleteBoth() { + return this.autocomplete === ComboboxAutocomplete.both; + } + /** + * Sets focus and synchronize ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged() { + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The list of options. + * + * @public + * @remarks + * Overrides `Listbox.options`. + */ + get options() { + Observable.track(this, "options"); + return this.filteredOptions.length ? this.filteredOptions : this._options; + } + set options(value) { + this._options = value; + Observable.notify(this, "options"); + } + /** + * Updates the placeholder on the proxy element. + * @internal + */ + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c; + const prev = `${this._value}`; + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.text.toLowerCase() === next.toLowerCase()); + const prevSelectedValue = (_a = this.options[this.selectedIndex]) === null || _a === void 0 ? void 0 : _a.text; + const nextSelectedValue = (_b = this.options[selectedIndex]) === null || _b === void 0 ? void 0 : _b.text; + this.selectedIndex = prevSelectedValue !== nextSelectedValue ? selectedIndex : this.selectedIndex; + next = ((_c = this.firstSelectedOption) === null || _c === void 0 ? void 0 : _c.text) || next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + } + } + /** + * Handle opening and closing the listbox when the combobox is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + const captured = e.target.closest(`option,[role=option]`); + if (this.disabled || (captured === null || captured === void 0 ? void 0 : captured.disabled)) { + return; + } + if (this.open) { + if (e.composedPath()[0] === this.control) { + return; + } + if (captured) { + this.selectedOptions = [captured]; + this.control.value = captured.text; + this.clearSelectionRange(); + this.updateValue(true); + } + } + this.open = !this.open; + if (this.open) { + this.control.focus(); + } + return true; + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + if (this.value) { + this.initialValue = this.value; + } + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Filter available options by text value. + * + * @public + */ + filterOptions() { + if (!this.autocomplete || this.autocomplete === ComboboxAutocomplete.none) { + this.filter = ""; + } + const filter = this.filter.toLowerCase(); + this.filteredOptions = this._options.filter((o) => o.text.toLowerCase().startsWith(this.filter.toLowerCase())); + if (this.isAutocompleteList) { + if (!this.filteredOptions.length && !filter) { + this.filteredOptions = this._options; + } + this._options.forEach((o) => { + o.hidden = !this.filteredOptions.includes(o); + }); + } + } + /** + * Focus the control and scroll the first selected option into view. + * + * @internal + * @remarks + * Overrides: `Listbox.focusAndScrollOptionIntoView` + */ + focusAndScrollOptionIntoView() { + if (this.contains(document.activeElement)) { + this.control.focus(); + if (this.firstSelectedOption) { + requestAnimationFrame(() => { + var _a; + (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.scrollIntoView({ block: "nearest" }); + }); + } + } + } + /** + * Handle focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + this.syncValue(); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!this.options || !this.options.includes(focusTarget)) { + this.open = false; + } + } + /** + * Handle content changes on the control input. + * + * @param e - the input event + * @internal + */ + inputHandler(e) { + this.filter = this.control.value; + this.filterOptions(); + if (!this.isAutocompleteInline) { + this.selectedIndex = this.options.map((option) => option.text).indexOf(this.control.value); + } + if (e.inputType.includes("deleteContent") || !this.filter.length) { + return true; + } + if (this.isAutocompleteList && !this.open) { + this.open = true; + } + if (this.isAutocompleteInline) { + if (this.filteredOptions.length) { + this.selectedOptions = [this.filteredOptions[0]]; + this.selectedIndex = this.options.indexOf(this.firstSelectedOption); + this.setInlineSelection(); + } else { + this.selectedIndex = -1; + } + } + return; + } + /** + * Handle keydown actions for listbox navigation. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (e.ctrlKey || e.shiftKey) { + return true; + } + switch (key) { + case "Enter": { + this.syncValue(); + if (this.isAutocompleteInline) { + this.filter = this.value; + } + this.open = false; + this.clearSelectionRange(); + break; + } + case "Escape": { + if (!this.isAutocompleteInline) { + this.selectedIndex = -1; + } + if (this.open) { + this.open = false; + break; + } + this.value = ""; + this.control.value = ""; + this.filter = ""; + this.filterOptions(); + break; + } + case "Tab": { + this.setInputToSelection(); + if (!this.open) { + return true; + } + e.preventDefault(); + this.open = false; + break; + } + case "ArrowUp": + case "ArrowDown": { + this.filterOptions(); + if (!this.open) { + this.open = true; + break; + } + if (this.filteredOptions.length > 0) { + super.keydownHandler(e); + } + if (this.isAutocompleteInline) { + this.setInlineSelection(); + } + break; + } + default: { + return true; + } + } + } + /** + * Handle keyup actions for value input and text field manipulations. + * + * @param e - the keyboard event + * @internal + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + case "ArrowRight": + case "Backspace": + case "Delete": + case "Home": + case "End": { + this.filter = this.control.value; + this.selectedIndex = -1; + this.filterOptions(); + break; + } + } + } + /** + * Ensure that the selectedIndex is within the current allowable filtered range. + * + * @param prev - the previous selected index value + * @param next - the current selected index value + * + * @internal + */ + selectedIndexChanged(prev, next) { + if (this.$fastController.isConnected) { + next = limit(-1, this.options.length - 1, next); + if (next !== this.selectedIndex) { + this.selectedIndex = next; + return; + } + super.selectedIndexChanged(prev, next); + } + } + /** + * Move focus to the previous selectable option. + * + * @internal + * @remarks + * Overrides `Listbox.selectPreviousOption` + */ + selectPreviousOption() { + if (!this.disabled && this.selectedIndex >= 0) { + this.selectedIndex = this.selectedIndex - 1; + } + } + /** + * Set the default selected options at initialization or reset. + * + * @internal + * @remarks + * Overrides `Listbox.setDefaultSelectedOption` + */ + setDefaultSelectedOption() { + if (this.$fastController.isConnected && this.options) { + const selectedIndex = this.options.findIndex((el2) => el2.getAttribute("selected") !== null || el2.selected); + this.selectedIndex = selectedIndex; + if (!this.dirtyValue && this.firstSelectedOption) { + this.value = this.firstSelectedOption.text; + } + this.setSelectedOptions(); + } + } + /** + * Focus and set the content of the control based on the first selected option. + * + * @internal + */ + setInputToSelection() { + if (this.firstSelectedOption) { + this.control.value = this.firstSelectedOption.text; + this.control.focus(); + } + } + /** + * Focus, set and select the content of the control based on the first selected option. + * + * @internal + */ + setInlineSelection() { + if (this.firstSelectedOption) { + this.setInputToSelection(); + this.control.setSelectionRange(this.filter.length, this.control.value.length, "backward"); + } + } + /** + * Determines if a value update should involve emitting a change event, then updates the value. + * + * @internal + */ + syncValue() { + var _a; + const newValue = this.selectedIndex > -1 ? (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text : this.control.value; + this.updateValue(this.value !== newValue); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @param force - direction to force the listbox to display + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * Ensure that the entire list of options is used when setting the selected property. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @internal + * @remarks + * Overrides: `Listbox.selectedOptionsChanged` + */ + selectedOptionsChanged(prev, next) { + if (this.$fastController.isConnected) { + this._options.forEach((o) => { + o.selected = next.includes(o); + }); + } + } + /** + * Synchronize the form-associated proxy and update the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + super.slottedOptionsChanged(prev, next); + this.updateValue(); + } + /** + * Sets the value and to match the first selected option. + * + * @param shouldEmit - if true, the change event will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a; + if (this.$fastController.isConnected) { + this.value = ((_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) || this.control.value; + this.control.value = this.value; + } + if (shouldEmit) { + this.$emit("change"); + } + } + /** + * @internal + */ + clearSelectionRange() { + const controlValueLength = this.control.value.length; + this.control.setSelectionRange(controlValueLength, controlValueLength); + } + }; + __decorate([ + attr({ attribute: "autocomplete", mode: "fromView" }) + ], Combobox.prototype, "autocomplete", void 0); + __decorate([ + observable + ], Combobox.prototype, "maxHeight", void 0); + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Combobox.prototype, "open", void 0); + __decorate([ + attr + ], Combobox.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Combobox.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Combobox.prototype, "position", void 0); + DelegatesARIACombobox = class { + }; + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaAutoComplete", void 0); + __decorate([ + observable + ], DelegatesARIACombobox.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIACombobox, DelegatesARIAListbox); + applyMixins(Combobox, StartEnd, DelegatesARIACombobox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js + var init_combobox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/combobox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js + var init_combobox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/combobox/index.js"() { + init_combobox(); + init_combobox_options(); + init_combobox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js + function composedParent(element) { + const parentNode = element.parentElement; + if (parentNode) { + return parentNode; + } else { + const rootNode = element.getRootNode(); + if (rootNode.host instanceof HTMLElement) { + return rootNode.host; + } + } + return null; + } + var init_composed_parent = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-parent.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js + function composedContains(reference, test) { + let current = test; + while (current !== null) { + if (current === reference) { + return true; + } + current = composedParent(current); + } + return false; + } + var init_composed_contains = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/composed-contains.js"() { + init_composed_parent(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js + function isFastElement(element) { + return element instanceof FASTElement; + } + var defaultElement, QueuedStyleSheetTarget, ConstructableStyleSheetTarget, DocumentStyleSheetTarget, HeadStyleElementStyleSheetTarget, StyleElementStyleSheetTarget, ElementStyleSheetTarget, RootStyleSheetTarget, propertyTargetCache, propertyTargetCtor, PropertyTargetManager; + var init_custom_property_manager = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/custom-property-manager.js"() { + init_tslib_es6(); + init_esm(); + defaultElement = document.createElement("div"); + QueuedStyleSheetTarget = class { + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + ConstructableStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor(source) { + super(); + const sheet = new CSSStyleSheet(); + sheet[prependToAdoptedStyleSheetsSymbol] = true; + this.target = sheet.cssRules[sheet.insertRule(":host{}")].style; + source.$fastController.addStyles(ElementStyles.create([sheet])); + } + }; + DocumentStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + const sheet = new CSSStyleSheet(); + this.target = sheet.cssRules[sheet.insertRule(":root{}")].style; + document.adoptedStyleSheets = [ + ...document.adoptedStyleSheets, + sheet + ]; + } + }; + HeadStyleElementStyleSheetTarget = class extends QueuedStyleSheetTarget { + constructor() { + super(); + this.style = document.createElement("style"); + document.head.appendChild(this.style); + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":root{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } + } + }; + StyleElementStyleSheetTarget = class { + constructor(target) { + this.store = /* @__PURE__ */ new Map(); + this.target = null; + const controller = target.$fastController; + this.style = document.createElement("style"); + controller.addStyles(this.style); + Observable.getNotifier(controller).subscribe(this, "isConnected"); + this.handleChange(controller, "isConnected"); + } + targetChanged() { + if (this.target !== null) { + for (const [key, value] of this.store.entries()) { + this.target.setProperty(key, value); + } + } + } + setProperty(name, value) { + this.store.set(name, value); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.setProperty(name, value); + } + }); + } + removeProperty(name) { + this.store.delete(name); + DOM.queueUpdate(() => { + if (this.target !== null) { + this.target.removeProperty(name); + } + }); + } + handleChange(source, key) { + const { sheet } = this.style; + if (sheet) { + const index = sheet.insertRule(":host{}", sheet.cssRules.length); + this.target = sheet.cssRules[index].style; + } else { + this.target = null; + } + } + }; + __decorate([ + observable + ], StyleElementStyleSheetTarget.prototype, "target", void 0); + ElementStyleSheetTarget = class { + constructor(source) { + this.target = source.style; + } + setProperty(name, value) { + DOM.queueUpdate(() => this.target.setProperty(name, value)); + } + removeProperty(name) { + DOM.queueUpdate(() => this.target.removeProperty(name)); + } + }; + RootStyleSheetTarget = class _RootStyleSheetTarget { + setProperty(name, value) { + _RootStyleSheetTarget.properties[name] = value; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).setProperty(name, value); + } + } + removeProperty(name) { + delete _RootStyleSheetTarget.properties[name]; + for (const target of _RootStyleSheetTarget.roots.values()) { + PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(target)).removeProperty(name); + } + } + static registerRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (!roots.has(root)) { + roots.add(root); + const target = PropertyTargetManager.getOrCreate(this.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.setProperty(key, _RootStyleSheetTarget.properties[key]); + } + } + } + static unregisterRoot(root) { + const { roots } = _RootStyleSheetTarget; + if (roots.has(root)) { + roots.delete(root); + const target = PropertyTargetManager.getOrCreate(_RootStyleSheetTarget.normalizeRoot(root)); + for (const key in _RootStyleSheetTarget.properties) { + target.removeProperty(key); + } + } + } + /** + * Returns the document when provided the default element, + * otherwise is a no-op + * @param root - the root to normalize + */ + static normalizeRoot(root) { + return root === defaultElement ? document : root; + } + }; + RootStyleSheetTarget.roots = /* @__PURE__ */ new Set(); + RootStyleSheetTarget.properties = {}; + propertyTargetCache = /* @__PURE__ */ new WeakMap(); + propertyTargetCtor = DOM.supportsAdoptedStyleSheets ? ConstructableStyleSheetTarget : StyleElementStyleSheetTarget; + PropertyTargetManager = Object.freeze({ + getOrCreate(source) { + if (propertyTargetCache.has(source)) { + return propertyTargetCache.get(source); + } + let target; + if (source === defaultElement) { + target = new RootStyleSheetTarget(); + } else if (source instanceof Document) { + target = DOM.supportsAdoptedStyleSheets ? new DocumentStyleSheetTarget() : new HeadStyleElementStyleSheetTarget(); + } else if (isFastElement(source)) { + target = new propertyTargetCtor(source); + } else { + target = new ElementStyleSheetTarget(source); + } + propertyTargetCache.set(source, target); + return target; + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js + function create(nameOrConfig) { + return DesignTokenImpl.from(nameOrConfig); + } + var DesignTokenImpl, CustomPropertyReflector, DesignTokenBindingObserver, Store, nodeCache, childToParent, DesignTokenNode, DesignToken; + var init_design_token = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-token/design-token.js"() { + init_tslib_es6(); + init_esm(); + init_composed_parent(); + init_composed_contains(); + init_custom_property_manager(); + init_custom_property_manager(); + DesignTokenImpl = class _DesignTokenImpl extends CSSDirective { + constructor(configuration) { + super(); + this.subscribers = /* @__PURE__ */ new WeakMap(); + this._appliedTo = /* @__PURE__ */ new Set(); + this.name = configuration.name; + if (configuration.cssCustomPropertyName !== null) { + this.cssCustomProperty = `--${configuration.cssCustomPropertyName}`; + this.cssVar = `var(${this.cssCustomProperty})`; + } + this.id = _DesignTokenImpl.uniqueId(); + _DesignTokenImpl.tokensById.set(this.id, this); + } + get appliedTo() { + return [...this._appliedTo]; + } + static from(nameOrConfig) { + return new _DesignTokenImpl({ + name: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.name, + cssCustomPropertyName: typeof nameOrConfig === "string" ? nameOrConfig : nameOrConfig.cssCustomPropertyName === void 0 ? nameOrConfig.name : nameOrConfig.cssCustomPropertyName + }); + } + static isCSSDesignToken(token) { + return typeof token.cssCustomProperty === "string"; + } + static isDerivedDesignTokenValue(value) { + return typeof value === "function"; + } + /** + * Gets a token by ID. Returns undefined if the token was not found. + * @param id - The ID of the token + * @returns + */ + static getTokenById(id) { + return _DesignTokenImpl.tokensById.get(id); + } + getOrCreateSubscriberSet(target = this) { + return this.subscribers.get(target) || this.subscribers.set(target, /* @__PURE__ */ new Set()) && this.subscribers.get(target); + } + createCSS() { + return this.cssVar || ""; + } + getValueFor(element) { + const value = DesignTokenNode.getOrCreate(element).get(this); + if (value !== void 0) { + return value; + } + throw new Error(`Value could not be retrieved for token named "${this.name}". Ensure the value is set for ${element} or an ancestor of ${element}.`); + } + setValueFor(element, value) { + this._appliedTo.add(element); + if (value instanceof _DesignTokenImpl) { + value = this.alias(value); + } + DesignTokenNode.getOrCreate(element).set(this, value); + return this; + } + deleteValueFor(element) { + this._appliedTo.delete(element); + if (DesignTokenNode.existsFor(element)) { + DesignTokenNode.getOrCreate(element).delete(this); + } + return this; + } + withDefault(value) { + this.setValueFor(defaultElement, value); + return this; + } + subscribe(subscriber, target) { + const subscriberSet = this.getOrCreateSubscriberSet(target); + if (target && !DesignTokenNode.existsFor(target)) { + DesignTokenNode.getOrCreate(target); + } + if (!subscriberSet.has(subscriber)) { + subscriberSet.add(subscriber); + } + } + unsubscribe(subscriber, target) { + const list = this.subscribers.get(target || this); + if (list && list.has(subscriber)) { + list.delete(subscriber); + } + } + /** + * Notifies subscribers that the value for an element has changed. + * @param element - The element to emit a notification for + */ + notify(element) { + const record = Object.freeze({ token: this, target: element }); + if (this.subscribers.has(this)) { + this.subscribers.get(this).forEach((sub) => sub.handleChange(record)); + } + if (this.subscribers.has(element)) { + this.subscribers.get(element).forEach((sub) => sub.handleChange(record)); + } + } + /** + * Alias the token to the provided token. + * @param token - the token to alias to + */ + alias(token) { + return ((target) => token.getValueFor(target)); + } + }; + DesignTokenImpl.uniqueId = /* @__PURE__ */ (() => { + let id = 0; + return () => { + id++; + return id.toString(16); + }; + })(); + DesignTokenImpl.tokensById = /* @__PURE__ */ new Map(); + CustomPropertyReflector = class { + startReflection(token, target) { + token.subscribe(this, target); + this.handleChange({ token, target }); + } + stopReflection(token, target) { + token.unsubscribe(this, target); + this.remove(token, target); + } + handleChange(record) { + const { token, target } = record; + this.add(token, target); + } + add(token, target) { + PropertyTargetManager.getOrCreate(target).setProperty(token.cssCustomProperty, this.resolveCSSValue(DesignTokenNode.getOrCreate(target).get(token))); + } + remove(token, target) { + PropertyTargetManager.getOrCreate(target).removeProperty(token.cssCustomProperty); + } + resolveCSSValue(value) { + return value && typeof value.createCSS === "function" ? value.createCSS() : value; + } + }; + DesignTokenBindingObserver = class { + constructor(source, token, node) { + this.source = source; + this.token = token; + this.node = node; + this.dependencies = /* @__PURE__ */ new Set(); + this.observer = Observable.binding(source, this, false); + this.observer.handleChange = this.observer.call; + this.handleChange(); + } + disconnect() { + this.observer.disconnect(); + } + /** + * @internal + */ + handleChange() { + try { + this.node.store.set(this.token, this.observer.observe(this.node.target, defaultExecutionContext)); + } catch (e) { + console.error(e); + } + } + }; + Store = class { + constructor() { + this.values = /* @__PURE__ */ new Map(); + } + set(token, value) { + if (this.values.get(token) !== value) { + this.values.set(token, value); + Observable.getNotifier(this).notify(token.id); + } + } + get(token) { + Observable.track(this, token.id); + return this.values.get(token); + } + delete(token) { + this.values.delete(token); + Observable.getNotifier(this).notify(token.id); + } + all() { + return this.values.entries(); + } + }; + nodeCache = /* @__PURE__ */ new WeakMap(); + childToParent = /* @__PURE__ */ new WeakMap(); + DesignTokenNode = class _DesignTokenNode { + constructor(target) { + this.target = target; + this.store = new Store(); + this.children = []; + this.assignedValues = /* @__PURE__ */ new Map(); + this.reflecting = /* @__PURE__ */ new Set(); + this.bindingObservers = /* @__PURE__ */ new Map(); + this.tokenValueChangeHandler = { + handleChange: (source, arg) => { + const token = DesignTokenImpl.getTokenById(arg); + if (token) { + token.notify(this.target); + this.updateCSSTokenReflection(source, token); + } + } + }; + nodeCache.set(target, this); + Observable.getNotifier(this.store).subscribe(this.tokenValueChangeHandler); + if (target instanceof FASTElement) { + target.$fastController.addBehaviors([this]); + } else if (target.isConnected) { + this.bind(); + } + } + /** + * Returns a DesignTokenNode for an element. + * Creates a new instance if one does not already exist for a node, + * otherwise returns the cached instance + * + * @param target - The HTML element to retrieve a DesignTokenNode for + */ + static getOrCreate(target) { + return nodeCache.get(target) || new _DesignTokenNode(target); + } + /** + * Determines if a DesignTokenNode has been created for a target + * @param target - The element to test + */ + static existsFor(target) { + return nodeCache.has(target); + } + /** + * Searches for and return the nearest parent DesignTokenNode. + * Null is returned if no node is found or the node provided is for a default element. + */ + static findParent(node) { + if (!(defaultElement === node.target)) { + let parent = composedParent(node.target); + while (parent !== null) { + if (nodeCache.has(parent)) { + return nodeCache.get(parent); + } + parent = composedParent(parent); + } + return _DesignTokenNode.getOrCreate(defaultElement); + } + return null; + } + /** + * Finds the closest node with a value explicitly assigned for a token, otherwise null. + * @param token - The token to look for + * @param start - The node to start looking for value assignment + * @returns + */ + static findClosestAssignedNode(token, start) { + let current = start; + do { + if (current.has(token)) { + return current; + } + current = current.parent ? current.parent : current.target !== defaultElement ? _DesignTokenNode.getOrCreate(defaultElement) : null; + } while (current !== null); + return null; + } + /** + * The parent DesignTokenNode, or null. + */ + get parent() { + return childToParent.get(this) || null; + } + updateCSSTokenReflection(source, token) { + if (DesignTokenImpl.isCSSDesignToken(token)) { + const parent = this.parent; + const reflecting = this.isReflecting(token); + if (parent) { + const parentValue = parent.get(token); + const sourceValue = source.get(token); + if (parentValue !== sourceValue && !reflecting) { + this.reflectToCSS(token); + } else if (parentValue === sourceValue && reflecting) { + this.stopReflectToCSS(token); + } + } else if (!reflecting) { + this.reflectToCSS(token); + } + } + } + /** + * Checks if a token has been assigned an explicit value the node. + * @param token - the token to check. + */ + has(token) { + return this.assignedValues.has(token); + } + /** + * Gets the value of a token for a node + * @param token - The token to retrieve the value for + * @returns + */ + get(token) { + const value = this.store.get(token); + if (value !== void 0) { + return value; + } + const raw = this.getRaw(token); + if (raw !== void 0) { + this.hydrate(token, raw); + return this.get(token); + } + } + /** + * Retrieves the raw assigned value of a token from the nearest assigned node. + * @param token - The token to retrieve a raw value for + * @returns + */ + getRaw(token) { + var _a; + if (this.assignedValues.has(token)) { + return this.assignedValues.get(token); + } + return (_a = _DesignTokenNode.findClosestAssignedNode(token, this)) === null || _a === void 0 ? void 0 : _a.getRaw(token); + } + /** + * Sets a token to a value for a node + * @param token - The token to set + * @param value - The value to set the token to + */ + set(token, value) { + if (DesignTokenImpl.isDerivedDesignTokenValue(this.assignedValues.get(token))) { + this.tearDownBindingObserver(token); + } + this.assignedValues.set(token, value); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + this.setupBindingObserver(token, value); + } else { + this.store.set(token, value); + } + } + /** + * Deletes a token value for the node. + * @param token - The token to delete the value for + */ + delete(token) { + this.assignedValues.delete(token); + this.tearDownBindingObserver(token); + const upstream = this.getRaw(token); + if (upstream) { + this.hydrate(token, upstream); + } else { + this.store.delete(token); + } + } + /** + * Invoked when the DesignTokenNode.target is attached to the document + */ + bind() { + const parent = _DesignTokenNode.findParent(this); + if (parent) { + parent.appendChild(this); + } + for (const key of this.assignedValues.keys()) { + key.notify(this.target); + } + } + /** + * Invoked when the DesignTokenNode.target is detached from the document + */ + unbind() { + if (this.parent) { + const parent = childToParent.get(this); + parent.removeChild(this); + } + for (const token of this.bindingObservers.keys()) { + this.tearDownBindingObserver(token); + } + } + /** + * Appends a child to a parent DesignTokenNode. + * @param child - The child to append to the node + */ + appendChild(child) { + if (child.parent) { + childToParent.get(child).removeChild(child); + } + const reParent = this.children.filter((x) => child.contains(x)); + childToParent.set(child, this); + this.children.push(child); + reParent.forEach((x) => child.appendChild(x)); + Observable.getNotifier(this.store).subscribe(child); + for (const [token, value] of this.store.all()) { + child.hydrate(token, this.bindingObservers.has(token) ? this.getRaw(token) : value); + child.updateCSSTokenReflection(child.store, token); + } + } + /** + * Removes a child from a node. + * @param child - The child to remove. + */ + removeChild(child) { + const childIndex = this.children.indexOf(child); + if (childIndex !== -1) { + this.children.splice(childIndex, 1); + } + Observable.getNotifier(this.store).unsubscribe(child); + if (child.parent !== this) { + return false; + } + const deleted = childToParent.delete(child); + for (const [token] of this.store.all()) { + child.hydrate(token, child.getRaw(token)); + child.updateCSSTokenReflection(child.store, token); + } + return deleted; + } + /** + * Tests whether a provided node is contained by + * the calling node. + * @param test - The node to test + */ + contains(test) { + return composedContains(this.target, test.target); + } + /** + * Instructs the node to reflect a design token for the provided token. + * @param token - The design token to reflect + */ + reflectToCSS(token) { + if (!this.isReflecting(token)) { + this.reflecting.add(token); + _DesignTokenNode.cssCustomPropertyReflector.startReflection(token, this.target); + } + } + /** + * Stops reflecting a DesignToken to CSS + * @param token - The design token to stop reflecting + */ + stopReflectToCSS(token) { + if (this.isReflecting(token)) { + this.reflecting.delete(token); + _DesignTokenNode.cssCustomPropertyReflector.stopReflection(token, this.target); + } + } + /** + * Determines if a token is being reflected to CSS for a node. + * @param token - The token to check for reflection + * @returns + */ + isReflecting(token) { + return this.reflecting.has(token); + } + /** + * Handle changes to upstream tokens + * @param source - The parent DesignTokenNode + * @param property - The token ID that changed + */ + handleChange(source, property) { + const token = DesignTokenImpl.getTokenById(property); + if (!token) { + return; + } + this.hydrate(token, this.getRaw(token)); + this.updateCSSTokenReflection(this.store, token); + } + /** + * Hydrates a token with a DesignTokenValue, making retrieval available. + * @param token - The token to hydrate + * @param value - The value to hydrate + */ + hydrate(token, value) { + if (!this.has(token)) { + const observer = this.bindingObservers.get(token); + if (DesignTokenImpl.isDerivedDesignTokenValue(value)) { + if (observer) { + if (observer.source !== value) { + this.tearDownBindingObserver(token); + this.setupBindingObserver(token, value); + } + } else { + this.setupBindingObserver(token, value); + } + } else { + if (observer) { + this.tearDownBindingObserver(token); + } + this.store.set(token, value); + } + } + } + /** + * Sets up a binding observer for a derived token value that notifies token + * subscribers on change. + * + * @param token - The token to notify when the binding updates + * @param source - The binding source + */ + setupBindingObserver(token, source) { + const binding = new DesignTokenBindingObserver(source, token, this); + this.bindingObservers.set(token, binding); + return binding; + } + /** + * Tear down a binding observer for a token. + */ + tearDownBindingObserver(token) { + if (this.bindingObservers.has(token)) { + this.bindingObservers.get(token).disconnect(); + this.bindingObservers.delete(token); + return true; + } + return false; + } + }; + DesignTokenNode.cssCustomPropertyReflector = new CustomPropertyReflector(); + __decorate([ + observable + ], DesignTokenNode.prototype, "children", void 0); + DesignToken = Object.freeze({ + create, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been connected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * 3. The HTMLElement is not connected to the document when token values are set. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyConnection(element) { + if (!element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).bind(); + return true; + }, + /** + * Informs DesignToken that an HTMLElement for which tokens have + * been set has been disconnected to the document. + * + * The browser does not provide a reliable mechanism to observe an HTMLElement's connectedness + * in all scenarios, so invoking this method manually is necessary when: + * + * 1. Token values are set for an HTMLElement. + * 2. The HTMLElement does not inherit from FASTElement. + * + * @param element - The element to notify + * @returns - true if notification was successful, otherwise false. + */ + notifyDisconnection(element) { + if (element.isConnected || !DesignTokenNode.existsFor(element)) { + return false; + } + DesignTokenNode.getOrCreate(element).unbind(); + return true; + }, + /** + * Registers and element or document as a DesignToken root. + * {@link CSSDesignToken | CSSDesignTokens} with default values assigned via + * {@link (DesignToken:interface).withDefault} will emit CSS custom properties to all + * registered roots. + * @param target - The root to register + */ + registerRoot(target = defaultElement) { + RootStyleSheetTarget.registerRoot(target); + }, + /** + * Unregister an element or document as a DesignToken root. + * @param target - The root to deregister + */ + unregisterRoot(target = defaultElement) { + RootStyleSheetTarget.unregisterRoot(target); + } + }); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js + function extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback) { + if (typeof params === "string") { + return { + name: params, + type: elementDefinitionType, + callback: elementDefinitionCallback + }; + } else { + return params; + } + } + var ElementDisambiguation, elementTypesByTag, elementTagsByType, rootDesignSystem, designSystemKey, DesignSystem, DefaultDesignSystem, ElementDefinitionEntry; + var init_design_system = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/design-system.js"() { + init_esm(); + init_foundation_element(); + init_di(); + init_design_token(); + init_component_presentation(); + ElementDisambiguation = Object.freeze({ + /** + * Skip defining the element but still call the provided callback passed + * to DesignSystemRegistrationContext.tryDefineElement + */ + definitionCallbackOnly: null, + /** + * Ignore the duplicate element entirely. + */ + ignoreDuplicate: /* @__PURE__ */ Symbol() + }); + elementTypesByTag = /* @__PURE__ */ new Map(); + elementTagsByType = /* @__PURE__ */ new Map(); + rootDesignSystem = null; + designSystemKey = DI.createInterface((x) => x.cachedCallback((handler) => { + if (rootDesignSystem === null) { + rootDesignSystem = new DefaultDesignSystem(null, handler); + } + return rootDesignSystem; + })); + DesignSystem = Object.freeze({ + /** + * Returns the HTML element name that the type is defined as. + * @param type - The type to lookup. + * @public + */ + tagFor(type) { + return elementTagsByType.get(type); + }, + /** + * Searches the DOM hierarchy for the design system that is responsible + * for the provided element. + * @param element - The element to locate the design system for. + * @returns The located design system. + * @public + */ + responsibleFor(element) { + const owned = element.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.findResponsibleContainer(element); + return container.get(designSystemKey); + }, + /** + * Gets the DesignSystem if one is explicitly defined on the provided element; + * otherwise creates a design system defined directly on the element. + * @param element - The element to get or create a design system for. + * @returns The design system. + * @public + */ + getOrCreate(node) { + if (!node) { + if (rootDesignSystem === null) { + rootDesignSystem = DI.getOrCreateDOMContainer().get(designSystemKey); + } + return rootDesignSystem; + } + const owned = node.$$designSystem$$; + if (owned) { + return owned; + } + const container = DI.getOrCreateDOMContainer(node); + if (container.has(designSystemKey, false)) { + return container.get(designSystemKey); + } else { + const system = new DefaultDesignSystem(node, container); + container.register(Registration.instance(designSystemKey, system)); + return system; + } + } + }); + DefaultDesignSystem = class { + constructor(owner, container) { + this.owner = owner; + this.container = container; + this.designTokensInitialized = false; + this.prefix = "fast"; + this.shadowRootMode = void 0; + this.disambiguate = () => ElementDisambiguation.definitionCallbackOnly; + if (owner !== null) { + owner.$$designSystem$$ = this; + } + } + withPrefix(prefix) { + this.prefix = prefix; + return this; + } + withShadowRootMode(mode) { + this.shadowRootMode = mode; + return this; + } + withElementDisambiguation(callback) { + this.disambiguate = callback; + return this; + } + withDesignTokenRoot(root) { + this.designTokenRoot = root; + return this; + } + register(...registrations) { + const container = this.container; + const elementDefinitionEntries = []; + const disambiguate = this.disambiguate; + const shadowRootMode = this.shadowRootMode; + const context = { + elementPrefix: this.prefix, + tryDefineElement(params, elementDefinitionType, elementDefinitionCallback) { + const extractedParams = extractTryDefineElementParams(params, elementDefinitionType, elementDefinitionCallback); + const { name, callback, baseClass } = extractedParams; + let { type } = extractedParams; + let elementName = name; + let typeFoundByName = elementTypesByTag.get(elementName); + let needsDefine = true; + while (typeFoundByName) { + const result = disambiguate(elementName, type, typeFoundByName); + switch (result) { + case ElementDisambiguation.ignoreDuplicate: + return; + case ElementDisambiguation.definitionCallbackOnly: + needsDefine = false; + typeFoundByName = void 0; + break; + default: + elementName = result; + typeFoundByName = elementTypesByTag.get(elementName); + break; + } + } + if (needsDefine) { + if (elementTagsByType.has(type) || type === FoundationElement) { + type = class extends type { + }; + } + elementTypesByTag.set(elementName, type); + elementTagsByType.set(type, elementName); + if (baseClass) { + elementTagsByType.set(baseClass, elementName); + } + } + elementDefinitionEntries.push(new ElementDefinitionEntry(container, elementName, type, shadowRootMode, callback, needsDefine)); + } + }; + if (!this.designTokensInitialized) { + this.designTokensInitialized = true; + if (this.designTokenRoot !== null) { + DesignToken.registerRoot(this.designTokenRoot); + } + } + container.registerWithContext(context, ...registrations); + for (const entry of elementDefinitionEntries) { + entry.callback(entry); + if (entry.willDefine && entry.definition !== null) { + entry.definition.define(); + } + } + return this; + } + }; + ElementDefinitionEntry = class { + constructor(container, name, type, shadowRootMode, callback, willDefine) { + this.container = container; + this.name = name; + this.type = type; + this.shadowRootMode = shadowRootMode; + this.callback = callback; + this.willDefine = willDefine; + this.definition = null; + } + definePresentation(presentation) { + ComponentPresentation.define(this.name, presentation, this.container); + } + defineElement(definition) { + this.definition = new FASTElementDefinition(this.type, Object.assign(Object.assign({}, definition), { name: this.name })); + } + tagFor(type) { + return DesignSystem.tagFor(type); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js + var init_registration_context = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/registration-context.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js + var init_design_system2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/design-system/index.js"() { + init_design_system(); + init_component_presentation(); + init_registration_context(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/di/index.js + var init_di2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/di/index.js"() { + init_di(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js + var init_dialog_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.template.js"() { + } + }); + + // node_modules/tabbable/dist/index.esm.js + var candidateSelectors, candidateSelector, NoElement, matches, getRootNode, getTabindex, isInput, isHiddenInput, isDetailsWithSummary, getCheckedRadio, isTabbableRadio, isRadio, isNonTabbableRadio, isZeroArea, isHidden, isDisabledFromFieldset, isNodeMatchingSelectorFocusable, isNodeMatchingSelectorTabbable, isTabbable, focusableCandidateSelector, isFocusable; + var init_index_esm = __esm({ + "node_modules/tabbable/dist/index.esm.js"() { + candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + NoElement = typeof Element === "undefined"; + matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; + } + } + return node.tabIndex; + }; + isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; + }); + return r; + }; + getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i = 0; i < nodes.length; i++) { + if (nodes[i].checked && nodes[i].form === form) { + return nodes[i]; + } + } + }; + isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; + } + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + 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", err.message); + return false; + } + } + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot2 = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; + } + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; + } + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot2 === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot2(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } + } + node = originalNode; + } + if (nodeIsAttached) { + return !node.getClientRects().length; + } + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); + } + return false; + }; + isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i = 0; i < parentNode.children.length; i++) { + var child = parentNode.children.item(i); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; + } + parentNode = parentNode.parentElement; + } + } + return false; + }; + isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; + } + return true; + }; + isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; + } + return true; + }; + isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, candidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorTabbable(options, node); + }; + focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + isFocusable = function isFocusable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); + } + if (matches.call(node, focusableCandidateSelector) === false) { + return false; + } + return isNodeMatchingSelectorFocusable(options, node); + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js + var Dialog; + var init_dialog = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/dialog.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + Dialog = class _Dialog extends FoundationElement { + constructor() { + super(...arguments); + this.modal = true; + this.hidden = false; + this.trapFocus = true; + this.trapFocusChanged = () => { + if (this.$fastController.isConnected) { + this.updateTrapFocus(); + } + }; + this.isTrappingFocus = false; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && !this.hidden) { + switch (e.key) { + case keyEscape: + this.dismiss(); + e.preventDefault(); + break; + case keyTab: + this.handleTabKeyDown(e); + break; + } + } + }; + this.handleDocumentFocus = (e) => { + if (!e.defaultPrevented && this.shouldForceFocus(e.target)) { + this.focusFirstElement(); + e.preventDefault(); + } + }; + this.handleTabKeyDown = (e) => { + if (!this.trapFocus || this.hidden) { + return; + } + const bounds = this.getTabQueueBounds(); + if (bounds.length === 0) { + return; + } + if (bounds.length === 1) { + bounds[0].focus(); + e.preventDefault(); + return; + } + if (e.shiftKey && e.target === bounds[0]) { + bounds[bounds.length - 1].focus(); + e.preventDefault(); + } else if (!e.shiftKey && e.target === bounds[bounds.length - 1]) { + bounds[0].focus(); + e.preventDefault(); + } + return; + }; + this.getTabQueueBounds = () => { + const bounds = []; + return _Dialog.reduceTabbableItems(bounds, this); + }; + this.focusFirstElement = () => { + const bounds = this.getTabQueueBounds(); + if (bounds.length > 0) { + bounds[0].focus(); + } else { + if (this.dialog instanceof HTMLElement) { + this.dialog.focus(); + } + } + }; + this.shouldForceFocus = (currentFocusElement) => { + return this.isTrappingFocus && !this.contains(currentFocusElement); + }; + this.shouldTrapFocus = () => { + return this.trapFocus && !this.hidden; + }; + this.updateTrapFocus = (shouldTrapFocusOverride) => { + const shouldTrapFocus = shouldTrapFocusOverride === void 0 ? this.shouldTrapFocus() : shouldTrapFocusOverride; + if (shouldTrapFocus && !this.isTrappingFocus) { + this.isTrappingFocus = true; + document.addEventListener("focusin", this.handleDocumentFocus); + DOM.queueUpdate(() => { + if (this.shouldForceFocus(document.activeElement)) { + this.focusFirstElement(); + } + }); + } else if (!shouldTrapFocus && this.isTrappingFocus) { + this.isTrappingFocus = false; + document.removeEventListener("focusin", this.handleDocumentFocus); + } + }; + } + /** + * @internal + */ + dismiss() { + this.$emit("dismiss"); + this.$emit("cancel"); + } + /** + * The method to show the dialog. + * + * @public + */ + show() { + this.hidden = false; + } + /** + * The method to hide the dialog. + * + * @public + */ + hide() { + this.hidden = true; + this.$emit("close"); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + document.addEventListener("keydown", this.handleDocumentKeydown); + this.notifier = Observable.getNotifier(this); + this.notifier.subscribe(this, "hidden"); + this.updateTrapFocus(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.updateTrapFocus(false); + this.notifier.unsubscribe(this, "hidden"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "hidden": + this.updateTrapFocus(); + break; + default: + break; + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceTabbableItems(elements2, element) { + if (element.getAttribute("tabindex") === "-1") { + return elements2; + } + if (isTabbable(element) || _Dialog.isFocusableFastElement(element) && _Dialog.hasTabbableShadow(element)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Dialog.reduceTabbableItems, [])); + } + return elements2; + } + /** + * Test if element is focusable fast element + * + * @param element - The element to check + * + * @internal + */ + static isFocusableFastElement(element) { + var _a, _b; + return !!((_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus); + } + /** + * Test if the element has a focusable shadow + * + * @param element - The element to check + * + * @internal + */ + static hasTabbableShadow(element) { + var _a, _b; + return Array.from((_b = (_a = element.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll("*")) !== null && _b !== void 0 ? _b : []).some((x) => { + return isTabbable(x); + }); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "modal", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Dialog.prototype, "hidden", void 0); + __decorate([ + attr({ attribute: "trap-focus", mode: "boolean" }) + ], Dialog.prototype, "trapFocus", void 0); + __decorate([ + attr({ attribute: "aria-describedby" }) + ], Dialog.prototype, "ariaDescribedby", void 0); + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], Dialog.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], Dialog.prototype, "ariaLabel", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js + var init_dialog2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/dialog/index.js"() { + init_dialog_template(); + init_dialog(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js + var init_disclosure_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js + var Disclosure; + var init_disclosure = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/disclosure.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Disclosure = class extends FoundationElement { + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.setup(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.details.removeEventListener("toggle", this.onToggle); + } + /** + * Show extra content. + */ + show() { + this.details.open = true; + } + /** + * Hide extra content. + */ + hide() { + this.details.open = false; + } + /** + * Toggle the current(expanded/collapsed) state. + */ + toggle() { + this.details.open = !this.details.open; + } + /** + * Register listener and set default disclosure mode + */ + setup() { + this.onToggle = this.onToggle.bind(this); + this.details.addEventListener("toggle", this.onToggle); + if (this.expanded) { + this.show(); + } + } + /** + * Update the aria attr and fire `toggle` event + */ + onToggle() { + this.expanded = this.details.open; + this.$emit("toggle"); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Disclosure.prototype, "expanded", void 0); + __decorate([ + attr + ], Disclosure.prototype, "title", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js + var init_disclosure2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/disclosure/index.js"() { + init_disclosure_template(); + init_disclosure(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js + var dividerTemplate; + var init_divider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.template.js"() { + init_esm(); + dividerTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js + var DividerRole; + var init_divider_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.options.js"() { + DividerRole = { + /** + * The divider semantically separates content + */ + separator: "separator", + /** + * The divider has no semantic value and is for visual presentation only. + */ + presentation: "presentation" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js + var Divider; + var init_divider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/divider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_divider_options(); + Divider = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = DividerRole.separator; + this.orientation = Orientation.horizontal; + } + }; + __decorate([ + attr + ], Divider.prototype, "role", void 0); + __decorate([ + attr + ], Divider.prototype, "orientation", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js + var init_divider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/divider/index.js"() { + init_divider_template(); + init_divider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js + var FlipperDirection; + var init_flipper_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.options.js"() { + FlipperDirection = { + next: "next", + previous: "previous" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js + var init_flipper_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js + var Flipper; + var init_flipper = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/flipper.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + init_flipper_options(); + Flipper = class extends FoundationElement { + constructor() { + super(...arguments); + this.hiddenFromAT = true; + this.direction = FlipperDirection.next; + } + /** + * Simulate a click event when the flipper has focus and the user hits enter or space keys + * Blur focus if the user hits escape key + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + if (!this.hiddenFromAT) { + const key = e.key; + if (key === "Enter" || key === "Space") { + this.$emit("click", e); + } + if (key === "Escape") { + this.blur(); + } + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Flipper.prototype, "disabled", void 0); + __decorate([ + attr({ attribute: "aria-hidden", converter: booleanConverter }) + ], Flipper.prototype, "hiddenFromAT", void 0); + __decorate([ + attr + ], Flipper.prototype, "direction", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js + var init_flipper2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/flipper/index.js"() { + init_flipper_template(); + init_flipper(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js + var init_form_associated2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/form-associated/index.js"() { + init_form_associated(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js + var init_foundation_element2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/foundation-element/index.js"() { + init_foundation_element(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js + var listboxOptionTemplate; + var init_listbox_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/listbox-option.template.js"() { + init_esm(); + init_start_end(); + listboxOptionTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js + var init_listbox_option2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox-option/index.js"() { + init_listbox_option(); + init_listbox_option_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js + var ListboxElement; + var init_listbox_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.element.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + ListboxElement = class extends Listbox { + constructor() { + super(...arguments); + this.activeIndex = -1; + this.rangeStartIndex = -1; + } + /** + * Returns the last checked option. + * + * @internal + */ + get activeOption() { + return this.options[this.activeIndex]; + } + /** + * Returns the list of checked options. + * + * @internal + */ + get checkedOptions() { + var _a; + return (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((o) => o.checked); + } + /** + * Returns the index of the first selected option. + * + * @internal + */ + get firstSelectedOptionIndex() { + return this.options.indexOf(this.firstSelectedOption); + } + /** + * Updates the `ariaActiveDescendant` property when the active index changes. + * + * @param prev - the previous active index + * @param next - the next active index + * + * @internal + */ + activeIndexChanged(prev, next) { + var _a, _b; + this.ariaActiveDescendant = (_b = (_a = this.options[next]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : ""; + this.focusAndScrollOptionIntoView(); + } + /** + * Toggles the checked state for the currently active option. + * + * @remarks + * Multiple-selection mode only. + * + * @internal + */ + checkActiveIndex() { + if (!this.multiple) { + return; + } + const activeItem = this.activeOption; + if (activeItem) { + activeItem.checked = true; + } + } + /** + * Sets the active index to the first option and marks it as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkFirstOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex + 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and sets the matching option as checked. + * + * @remarks + * Multi-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkLastOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.options.length); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex = this.options.length - 1; + this.checkActiveIndex(); + } + /** + * @override + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.addEventListener("focusout", this.focusoutHandler); + } + /** + * @override + * @internal + */ + disconnectedCallback() { + this.removeEventListener("focusout", this.focusoutHandler); + super.disconnectedCallback(); + } + /** + * Increments the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkNextOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.rangeStartIndex, this.activeIndex + 1); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex += this.activeIndex < this.options.length - 1 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Decrements the active index and marks the matching option as checked. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - mark all options unchecked before changing the active index + * + * @internal + */ + checkPreviousOption(preserveChecked = false) { + if (preserveChecked) { + if (this.rangeStartIndex === -1) { + this.rangeStartIndex = this.activeIndex; + } + if (this.checkedOptions.length === 1) { + this.rangeStartIndex += 1; + } + this.options.forEach((o, i) => { + o.checked = inRange(i, this.activeIndex, this.rangeStartIndex); + }); + } else { + this.uncheckAllOptions(); + } + this.activeIndex -= this.activeIndex > 0 ? 1 : 0; + this.checkActiveIndex(); + } + /** + * Handles click events for listbox options. + * + * @param e - the event object + * + * @override + * @internal + */ + clickHandler(e) { + var _a; + if (!this.multiple) { + return super.clickHandler(e); + } + const captured = (_a = e.target) === null || _a === void 0 ? void 0 : _a.closest(`[role=option]`); + if (!captured || captured.disabled) { + return; + } + this.uncheckAllOptions(); + this.activeIndex = this.options.indexOf(captured); + this.checkActiveIndex(); + this.toggleSelectedForAllCheckedOptions(); + return true; + } + /** + * @override + * @internal + */ + focusAndScrollOptionIntoView() { + super.focusAndScrollOptionIntoView(this.activeOption); + } + /** + * In multiple-selection mode: + * If any options are selected, the first selected option is checked when + * the listbox receives focus. If no options are selected, the first + * selectable option is checked. + * + * @override + * @internal + */ + focusinHandler(e) { + if (!this.multiple) { + return super.focusinHandler(e); + } + if (!this.shouldSkipFocus && e.target === e.currentTarget) { + this.uncheckAllOptions(); + if (this.activeIndex === -1) { + this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0; + } + this.checkActiveIndex(); + this.setSelectedOptions(); + this.focusAndScrollOptionIntoView(); + } + this.shouldSkipFocus = false; + } + /** + * Unchecks all options when the listbox loses focus. + * + * @internal + */ + focusoutHandler(e) { + if (this.multiple) { + this.uncheckAllOptions(); + } + } + /** + * Handles keydown actions for listbox navigation and typeahead + * + * @override + * @internal + */ + keydownHandler(e) { + if (!this.multiple) { + return super.keydownHandler(e); + } + if (this.disabled) { + return true; + } + const { key, shiftKey } = e; + this.shouldSkipFocus = false; + switch (key) { + // Select the first available option + case keyHome: { + this.checkFirstOption(shiftKey); + return; + } + // Select the next selectable option + case keyArrowDown: { + this.checkNextOption(shiftKey); + return; + } + // Select the previous selectable option + case keyArrowUp: { + this.checkPreviousOption(shiftKey); + return; + } + // Select the last available option + case keyEnd: { + this.checkLastOption(shiftKey); + return; + } + case keyTab: { + this.focusAndScrollOptionIntoView(); + return true; + } + case keyEscape: { + this.uncheckAllOptions(); + this.checkActiveIndex(); + return true; + } + case keySpace: { + e.preventDefault(); + if (this.typeAheadExpired) { + this.toggleSelectedForAllCheckedOptions(); + return; + } + } + // Send key to Typeahead handler + default: { + if (key.length === 1) { + this.handleTypeAhead(`${key}`); + } + return true; + } + } + } + /** + * Prevents `focusin` events from firing before `click` events when the + * element is unfocused. + * + * @override + * @internal + */ + mousedownHandler(e) { + if (e.offsetX >= 0 && e.offsetX <= this.scrollWidth) { + return super.mousedownHandler(e); + } + } + /** + * Switches between single-selection and multi-selection mode. + * + * @internal + */ + multipleChanged(prev, next) { + var _a; + this.ariaMultiSelectable = next ? "true" : null; + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o) => { + o.checked = next ? false : void 0; + }); + this.setSelectedOptions(); + } + /** + * Sets an option as selected and gives it focus. + * + * @override + * @public + */ + setSelectedOptions() { + if (!this.multiple) { + super.setSelectedOptions(); + return; + } + if (this.$fastController.isConnected && this.options) { + this.selectedOptions = this.options.filter((o) => o.selected); + this.focusAndScrollOptionIntoView(); + } + } + /** + * Ensures the size is a positive integer when the property is updated. + * + * @param prev - the previous size value + * @param next - the current size value + * + * @internal + */ + sizeChanged(prev, next) { + var _a; + const size = Math.max(0, parseInt((_a = next === null || next === void 0 ? void 0 : next.toFixed()) !== null && _a !== void 0 ? _a : "", 10)); + if (size !== next) { + DOM.queueUpdate(() => { + this.size = size; + }); + } + } + /** + * Toggles the selected state of the provided options. If any provided items + * are in an unselected state, all items are set to selected. If every + * provided item is selected, they are all unselected. + * + * @internal + */ + toggleSelectedForAllCheckedOptions() { + const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled); + const force = !enabledCheckedOptions.every((o) => o.selected); + enabledCheckedOptions.forEach((o) => o.selected = force); + this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]); + this.setSelectedOptions(); + } + /** + * @override + * @internal + */ + typeaheadBufferChanged(prev, next) { + if (!this.multiple) { + super.typeaheadBufferChanged(prev, next); + return; + } + if (this.$fastController.isConnected) { + const typeaheadMatches = this.getTypeaheadMatches(); + const activeIndex = this.options.indexOf(typeaheadMatches[0]); + if (activeIndex > -1) { + this.activeIndex = activeIndex; + this.uncheckAllOptions(); + this.checkActiveIndex(); + } + this.typeAheadExpired = false; + } + } + /** + * Unchecks all options. + * + * @remarks + * Multiple-selection mode only. + * + * @param preserveChecked - reset the rangeStartIndex + * + * @internal + */ + uncheckAllOptions(preserveChecked = false) { + this.options.forEach((o) => o.checked = this.multiple ? false : void 0); + if (!preserveChecked) { + this.rangeStartIndex = -1; + } + } + }; + __decorate([ + observable + ], ListboxElement.prototype, "activeIndex", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], ListboxElement.prototype, "multiple", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], ListboxElement.prototype, "size", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js + var init_listbox_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/listbox.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js + var init_listbox2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/listbox/index.js"() { + init_listbox(); + init_listbox_element(); + init_listbox_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js + var PickerMenu; + var init_picker_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.js"() { + init_tslib_es6(); + init_dist2(); + init_esm(); + init_foundation_element(); + PickerMenu = class extends FoundationElement { + constructor() { + super(...arguments); + this.optionElements = []; + } + menuElementsChanged() { + this.updateOptions(); + } + headerElementsChanged() { + this.updateOptions(); + } + footerElementsChanged() { + this.updateOptions(); + } + updateOptions() { + this.optionElements.splice(0, this.optionElements.length); + this.addSlottedListItems(this.headerElements); + this.addSlottedListItems(this.menuElements); + this.addSlottedListItems(this.footerElements); + this.$emit("optionsupdated", { bubbles: false }); + } + addSlottedListItems(slotChildren) { + if (slotChildren === void 0) { + return; + } + slotChildren.forEach((child) => { + if (child.nodeType === 1 && child.getAttribute("role") === "listitem") { + child.id = child.id || uniqueId("option-"); + this.optionElements.push(child); + } + }); + } + }; + __decorate([ + observable + ], PickerMenu.prototype, "menuElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "headerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "footerElements", void 0); + __decorate([ + observable + ], PickerMenu.prototype, "suggestionsAvailableText", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js + var defaultContentsTemplate, PickerMenuOption; + var init_picker_menu_option = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + defaultContentsTemplate = html` + +`; + PickerMenuOption = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.disconnectView(); + } + handleClick(e) { + if (e.defaultPrevented) { + return false; + } + this.handleInvoked(); + return false; + } + handleInvoked() { + this.$emit("pickeroptioninvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerMenuOption.prototype, "value", void 0); + __decorate([ + observable + ], PickerMenuOption.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js + var init_picker_list = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js + var defaultContentsTemplate2, PickerListItem; + var init_picker_list_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + defaultContentsTemplate2 = html` + +`; + PickerListItem = class extends FoundationElement { + contentsTemplateChanged() { + if (this.$fastController.isConnected) { + this.updateView(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updateView(); + } + /** + * @internal + */ + disconnectedCallback() { + this.disconnectView(); + super.disconnectedCallback(); + } + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + if (e.key === keyEnter) { + this.handleInvoke(); + return false; + } + return true; + } + handleClick(e) { + if (!e.defaultPrevented) { + this.handleInvoke(); + } + return false; + } + handleInvoke() { + this.$emit("pickeriteminvoked"); + } + updateView() { + var _a, _b; + this.disconnectView(); + this.customView = (_b = (_a = this.contentsTemplate) === null || _a === void 0 ? void 0 : _a.render(this, this)) !== null && _b !== void 0 ? _b : defaultContentsTemplate2.render(this, this); + } + disconnectView() { + var _a; + (_a = this.customView) === null || _a === void 0 ? void 0 : _a.dispose(); + this.customView = void 0; + } + }; + __decorate([ + attr({ attribute: "value" }) + ], PickerListItem.prototype, "value", void 0); + __decorate([ + observable + ], PickerListItem.prototype, "contentsTemplate", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js + var init_picker_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js + var _Picker, FormAssociatedPicker; + var init_picker_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Picker = class extends FoundationElement { + }; + FormAssociatedPicker = class extends FormAssociated(_Picker) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js + var pickerInputTemplate, Picker; + var init_picker = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_anchored_region2(); + init_picker_menu_option(); + init_picker_list_item(); + init_picker_form_associated(); + pickerInputTemplate = html` + +`; + Picker = class extends FormAssociatedPicker { + constructor() { + super(...arguments); + this.selection = ""; + this.filterSelected = true; + this.filterQuery = true; + this.noSuggestionsText = "No suggestions available"; + this.suggestionsAvailableText = "Suggestions available"; + this.loadingText = "Loading suggestions"; + this.menuPlacement = "bottom-fill"; + this.showLoading = false; + this.optionsList = []; + this.filteredOptionsList = []; + this.flyoutOpen = false; + this.menuFocusIndex = -1; + this.showNoOptions = false; + this.selectedItems = []; + this.inputElementView = null; + this.handleTextInput = (e) => { + this.query = this.inputElement.value; + }; + this.handleInputClick = (e) => { + e.preventDefault(); + this.toggleFlyout(true); + }; + this.setRegionProps = () => { + if (!this.flyoutOpen) { + return; + } + if (this.region === null || this.region === void 0) { + DOM.queueUpdate(this.setRegionProps); + return; + } + this.region.anchorElement = this.inputElement; + }; + this.configLookup = { + top: FlyoutPosTop, + bottom: FlyoutPosBottom, + tallest: FlyoutPosTallest, + "top-fill": FlyoutPosTopFill, + "bottom-fill": FlyoutPosBottomFill, + "tallest-fill": FlyoutPosTallestFill + }; + } + selectionChanged() { + if (this.$fastController.isConnected) { + this.handleSelectionChange(); + if (this.proxy instanceof HTMLInputElement) { + this.proxy.value = this.selection; + this.validate(); + } + } + } + optionsChanged() { + this.optionsList = this.options.split(",").map((opt) => opt.trim()).filter((opt) => opt !== ""); + } + menuPlacementChanged() { + if (this.$fastController.isConnected) { + this.updateMenuConfig(); + } + } + showLoadingChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + listItemTemplateChanged() { + this.updateListItemTemplate(); + } + defaultListItemTemplateChanged() { + this.updateListItemTemplate(); + } + menuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + defaultMenuOptionTemplateChanged() { + this.updateOptionTemplate(); + } + optionsListChanged() { + this.updateFilteredOptions(); + } + queryChanged() { + if (this.$fastController.isConnected) { + if (this.inputElement.value !== this.query) { + this.inputElement.value = this.query; + } + this.updateFilteredOptions(); + this.$emit("querychange", { bubbles: false }); + } + } + filteredOptionsListChanged() { + if (this.$fastController.isConnected) { + this.showNoOptions = this.filteredOptionsList.length === 0 && this.menuElement.querySelectorAll('[role="listitem"]').length === 0; + this.setFocusedOption(this.showNoOptions ? -1 : 0); + } + } + flyoutOpenChanged() { + if (this.flyoutOpen) { + DOM.queueUpdate(this.setRegionProps); + this.$emit("menuopening", { bubbles: false }); + } else { + this.$emit("menuclosing", { bubbles: false }); + } + } + showNoOptionsChanged() { + if (this.$fastController.isConnected) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + }); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.listElement = document.createElement(this.selectedListTag); + this.appendChild(this.listElement); + this.itemsPlaceholderElement = document.createComment(""); + this.listElement.append(this.itemsPlaceholderElement); + this.inputElementView = pickerInputTemplate.render(this, this.listElement); + const match = this.menuTag.toUpperCase(); + this.menuElement = Array.from(this.children).find((element) => { + return element.tagName === match; + }); + if (this.menuElement === void 0) { + this.menuElement = document.createElement(this.menuTag); + this.appendChild(this.menuElement); + } + if (this.menuElement.id === "") { + this.menuElement.id = uniqueId("listbox-"); + } + this.menuId = this.menuElement.id; + this.optionsPlaceholder = document.createComment(""); + this.menuElement.append(this.optionsPlaceholder); + this.updateMenuConfig(); + DOM.queueUpdate(() => this.initialize()); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.toggleFlyout(false); + this.inputElement.removeEventListener("input", this.handleTextInput); + this.inputElement.removeEventListener("click", this.handleInputClick); + if (this.inputElementView !== null) { + this.inputElementView.dispose(); + this.inputElementView = null; + } + } + /** + * Move focus to the input element + * @public + */ + focus() { + this.inputElement.focus(); + } + /** + * Initialize the component. This is delayed a frame to ensure children are connected as well. + */ + initialize() { + this.updateListItemTemplate(); + this.updateOptionTemplate(); + this.itemsRepeatBehavior = new RepeatDirective((x) => x.selectedItems, (x) => x.activeListItemTemplate, { positioning: true }).createBehavior(this.itemsPlaceholderElement); + this.inputElement.addEventListener("input", this.handleTextInput); + this.inputElement.addEventListener("click", this.handleInputClick); + this.$fastController.addBehaviors([this.itemsRepeatBehavior]); + this.menuElement.suggestionsAvailableText = this.suggestionsAvailableText; + this.menuElement.addEventListener("optionsupdated", this.handleMenuOptionsUpdated); + this.optionsRepeatBehavior = new RepeatDirective((x) => x.filteredOptionsList, (x) => x.activeMenuOptionTemplate, { positioning: true }).createBehavior(this.optionsPlaceholder); + this.$fastController.addBehaviors([this.optionsRepeatBehavior]); + this.handleSelectionChange(); + } + /** + * Toggles the menu flyout + */ + toggleFlyout(open) { + if (this.flyoutOpen === open) { + return; + } + if (open && document.activeElement === this.inputElement) { + this.flyoutOpen = open; + DOM.queueUpdate(() => { + if (this.menuElement !== void 0) { + this.setFocusedOption(0); + } else { + this.disableMenu(); + } + }); + return; + } + this.flyoutOpen = false; + this.disableMenu(); + return; + } + /** + * Handle the menu options updated event from the child menu + */ + handleMenuOptionsUpdated(e) { + e.preventDefault(); + if (this.flyoutOpen) { + this.setFocusedOption(0); + } + } + /** + * Handle key down events. + */ + handleKeyDown(e) { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + // TODO: what should "home" and "end" keys do, exactly? + // + // case keyHome: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.setFocusedOption(0); + // } + // } + // return false; + // } + // case keyEnd: { + // if (!this.flyoutOpen) { + // this.toggleFlyout(true); + // } else { + // if (this.menuElement.optionElements.length > 0) { + // this.toggleFlyout(true); + // this.setFocusedOption(this.menuElement.optionElements.length - 1); + // } + // } + // return false; + // } + case keyArrowDown: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const nextFocusOptionIndex = this.flyoutOpen ? Math.min(this.menuFocusIndex + 1, this.menuElement.optionElements.length - 1) : 0; + this.setFocusedOption(nextFocusOptionIndex); + } + return false; + } + case keyArrowUp: { + if (!this.flyoutOpen) { + this.toggleFlyout(true); + } else { + const previousFocusOptionIndex = this.flyoutOpen ? Math.max(this.menuFocusIndex - 1, 0) : 0; + this.setFocusedOption(previousFocusOptionIndex); + } + return false; + } + case keyEscape: { + this.toggleFlyout(false); + return false; + } + case keyEnter: { + if (this.menuFocusIndex !== -1 && this.menuElement.optionElements.length > this.menuFocusIndex) { + this.menuElement.optionElements[this.menuFocusIndex].click(); + } + return false; + } + case keyArrowRight: { + if (document.activeElement !== this.inputElement) { + this.incrementFocusedItem(1); + return false; + } + return true; + } + case keyArrowLeft: { + if (this.inputElement.selectionStart === 0) { + this.incrementFocusedItem(-1); + return false; + } + return true; + } + case keyDelete: + case keyBackspace: { + if (document.activeElement === null) { + return true; + } + if (document.activeElement === this.inputElement) { + if (this.inputElement.selectionStart === 0) { + this.selection = this.selectedItems.slice(0, this.selectedItems.length - 1).toString(); + this.toggleFlyout(false); + return false; + } + return true; + } + const selectedItems = Array.from(this.listElement.children); + const currentFocusedItemIndex = selectedItems.indexOf(document.activeElement); + if (currentFocusedItemIndex > -1) { + this.selection = this.selectedItems.splice(currentFocusedItemIndex, 1).toString(); + DOM.queueUpdate(() => { + selectedItems[Math.min(selectedItems.length, currentFocusedItemIndex)].focus(); + }); + return false; + } + return true; + } + } + this.toggleFlyout(true); + return true; + } + /** + * Handle focus in events. + */ + handleFocusIn(e) { + return false; + } + /** + * Handle focus out events. + */ + handleFocusOut(e) { + if (this.menuElement === void 0 || !this.menuElement.contains(e.relatedTarget)) { + this.toggleFlyout(false); + } + return false; + } + /** + * The list of selected items has changed + */ + handleSelectionChange() { + if (this.selectedItems.toString() === this.selection) { + return; + } + this.selectedItems = this.selection === "" ? [] : this.selection.split(","); + this.updateFilteredOptions(); + DOM.queueUpdate(() => { + this.checkMaxItems(); + }); + this.$emit("selectionchange", { bubbles: false }); + } + /** + * Anchored region is loaded, menu and options exist in the DOM. + */ + handleRegionLoaded(e) { + DOM.queueUpdate(() => { + this.setFocusedOption(0); + this.$emit("menuloaded", { bubbles: false }); + }); + } + /** + * Checks if the maximum number of items has been chosen and updates the ui. + */ + checkMaxItems() { + if (this.inputElement === void 0) { + return; + } + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + if (document.activeElement === this.inputElement) { + const selectedItemInstances = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + selectedItemInstances[selectedItemInstances.length - 1].focus(); + } + this.inputElement.hidden = true; + } else { + this.inputElement.hidden = false; + } + } + /** + * A list item has been invoked. + */ + handleItemInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerListItem) { + const listItems = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + const itemIndex = listItems.indexOf(e.target); + if (itemIndex !== -1) { + const newSelection = this.selectedItems.slice(); + newSelection.splice(itemIndex, 1); + this.selection = newSelection.toString(); + DOM.queueUpdate(() => this.incrementFocusedItem(0)); + } + return false; + } + return true; + } + /** + * A menu option has been invoked. + */ + handleOptionInvoke(e) { + if (e.defaultPrevented) { + return false; + } + if (e.target instanceof PickerMenuOption) { + if (e.target.value !== void 0) { + this.selection = `${this.selection}${this.selection === "" ? "" : ","}${e.target.value}`; + } + this.inputElement.value = ""; + this.query = ""; + this.inputElement.focus(); + this.toggleFlyout(false); + return false; + } + return true; + } + /** + * Increments the focused list item by the specified amount + */ + incrementFocusedItem(increment) { + if (this.selectedItems.length === 0) { + this.inputElement.focus(); + return; + } + const selectedItemsAsElements = Array.from(this.listElement.querySelectorAll("[role='listitem']")); + if (document.activeElement !== null) { + let currentFocusedItemIndex = selectedItemsAsElements.indexOf(document.activeElement); + if (currentFocusedItemIndex === -1) { + currentFocusedItemIndex = selectedItemsAsElements.length; + } + const newFocusedItemIndex = Math.min(selectedItemsAsElements.length, Math.max(0, currentFocusedItemIndex + increment)); + if (newFocusedItemIndex === selectedItemsAsElements.length) { + if (this.maxSelected !== void 0 && this.selectedItems.length >= this.maxSelected) { + selectedItemsAsElements[newFocusedItemIndex - 1].focus(); + } else { + this.inputElement.focus(); + } + } else { + selectedItemsAsElements[newFocusedItemIndex].focus(); + } + } + } + /** + * Disables the menu. Note that the menu can be open, just doens't have any valid options on display. + */ + disableMenu() { + var _a, _b, _c; + this.menuFocusIndex = -1; + this.menuFocusOptionId = void 0; + (_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.removeAttribute("aria-activedescendant"); + (_b = this.inputElement) === null || _b === void 0 ? void 0 : _b.removeAttribute("aria-owns"); + (_c = this.inputElement) === null || _c === void 0 ? void 0 : _c.removeAttribute("aria-expanded"); + } + /** + * Sets the currently focused menu option by index + */ + setFocusedOption(optionIndex) { + if (!this.flyoutOpen || optionIndex === -1 || this.showNoOptions || this.showLoading) { + this.disableMenu(); + return; + } + if (this.menuElement.optionElements.length === 0) { + return; + } + this.menuElement.optionElements.forEach((element) => { + element.setAttribute("aria-selected", "false"); + }); + this.menuFocusIndex = optionIndex; + if (this.menuFocusIndex > this.menuElement.optionElements.length - 1) { + this.menuFocusIndex = this.menuElement.optionElements.length - 1; + } + this.menuFocusOptionId = this.menuElement.optionElements[this.menuFocusIndex].id; + this.inputElement.setAttribute("aria-owns", this.menuId); + this.inputElement.setAttribute("aria-expanded", "true"); + this.inputElement.setAttribute("aria-activedescendant", this.menuFocusOptionId); + const focusedOption = this.menuElement.optionElements[this.menuFocusIndex]; + focusedOption.setAttribute("aria-selected", "true"); + this.menuElement.scrollTo(0, focusedOption.offsetTop); + } + /** + * Updates the template used for the list item repeat behavior + */ + updateListItemTemplate() { + var _a; + this.activeListItemTemplate = (_a = this.listItemTemplate) !== null && _a !== void 0 ? _a : this.defaultListItemTemplate; + } + /** + * Updates the template used for the menu option repeat behavior + */ + updateOptionTemplate() { + var _a; + this.activeMenuOptionTemplate = (_a = this.menuOptionTemplate) !== null && _a !== void 0 ? _a : this.defaultMenuOptionTemplate; + } + /** + * Updates the filtered options array + */ + updateFilteredOptions() { + this.filteredOptionsList = this.optionsList.slice(0); + if (this.filterSelected) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => this.selectedItems.indexOf(el2) === -1); + } + if (this.filterQuery && this.query !== "" && this.query !== void 0) { + this.filteredOptionsList = this.filteredOptionsList.filter((el2) => el2.indexOf(this.query) !== -1); + } + } + /** + * Updates the menu configuration + */ + updateMenuConfig() { + let newConfig = this.configLookup[this.menuPlacement]; + if (newConfig === null) { + newConfig = FlyoutPosBottomFill; + } + this.menuConfig = Object.assign(Object.assign({}, newConfig), { autoUpdateMode: "auto", fixedPlacement: true, horizontalViewportLock: false, verticalViewportLock: false }); + } + }; + __decorate([ + attr({ attribute: "selection" }) + ], Picker.prototype, "selection", void 0); + __decorate([ + attr({ attribute: "options" }) + ], Picker.prototype, "options", void 0); + __decorate([ + attr({ attribute: "filter-selected", mode: "boolean" }) + ], Picker.prototype, "filterSelected", void 0); + __decorate([ + attr({ attribute: "filter-query", mode: "boolean" }) + ], Picker.prototype, "filterQuery", void 0); + __decorate([ + attr({ attribute: "max-selected" }) + ], Picker.prototype, "maxSelected", void 0); + __decorate([ + attr({ attribute: "no-suggestions-text" }) + ], Picker.prototype, "noSuggestionsText", void 0); + __decorate([ + attr({ attribute: "suggestions-available-text" }) + ], Picker.prototype, "suggestionsAvailableText", void 0); + __decorate([ + attr({ attribute: "loading-text" }) + ], Picker.prototype, "loadingText", void 0); + __decorate([ + attr({ attribute: "label" }) + ], Picker.prototype, "label", void 0); + __decorate([ + attr({ attribute: "labelledby" }) + ], Picker.prototype, "labelledBy", void 0); + __decorate([ + attr({ attribute: "placeholder" }) + ], Picker.prototype, "placeholder", void 0); + __decorate([ + attr({ attribute: "menu-placement" }) + ], Picker.prototype, "menuPlacement", void 0); + __decorate([ + observable + ], Picker.prototype, "showLoading", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeListItemTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "defaultMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "activeMenuOptionTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "listItemContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "menuOptionContentsTemplate", void 0); + __decorate([ + observable + ], Picker.prototype, "optionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "query", void 0); + __decorate([ + observable + ], Picker.prototype, "filteredOptionsList", void 0); + __decorate([ + observable + ], Picker.prototype, "flyoutOpen", void 0); + __decorate([ + observable + ], Picker.prototype, "menuId", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedListTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuTag", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusIndex", void 0); + __decorate([ + observable + ], Picker.prototype, "menuFocusOptionId", void 0); + __decorate([ + observable + ], Picker.prototype, "showNoOptions", void 0); + __decorate([ + observable + ], Picker.prototype, "menuConfig", void 0); + __decorate([ + observable + ], Picker.prototype, "selectedItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js + var init_picker_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js + var init_picker_menu_option_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-menu-option.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js + var init_picker_list_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js + var init_picker_list_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/picker-list-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js + var init_picker2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/picker/index.js"() { + init_picker_template(); + init_picker(); + init_picker_menu_template(); + init_picker_menu(); + init_picker_menu_option_template(); + init_picker_menu_option(); + init_picker_list_template(); + init_picker_list(); + init_picker_list_item_template(); + init_picker_list_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js + var MenuItemRole, roleForMenuItem; + var init_menu_item_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.options.js"() { + MenuItemRole = { + /** + * The menu item has a "menuitem" role + */ + menuitem: "menuitem", + /** + * The menu item has a "menuitemcheckbox" role + */ + menuitemcheckbox: "menuitemcheckbox", + /** + * The menu item has a "menuitemradio" role + */ + menuitemradio: "menuitemradio" + }; + roleForMenuItem = { + [MenuItemRole.menuitem]: "menuitem", + [MenuItemRole.menuitemcheckbox]: "menuitemcheckbox", + [MenuItemRole.menuitemradio]: "menuitemradio" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js + var MenuItem; + var init_menu_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_foundation_element(); + init_start_end(); + init_direction(); + init_apply_mixins(); + init_menu_item_options(); + MenuItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.role = MenuItemRole.menuitem; + this.hasSubmenu = false; + this.currentDirection = Direction.ltr; + this.focusSubmenuOnLoad = false; + this.handleMenuItemKeyDown = (e) => { + if (e.defaultPrevented) { + return false; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.invoke(); + return false; + case keyArrowRight: + this.expandAndFocus(); + return false; + case keyArrowLeft: + if (this.expanded) { + this.expanded = false; + this.focus(); + return false; + } + } + return true; + }; + this.handleMenuItemClick = (e) => { + if (e.defaultPrevented || this.disabled) { + return false; + } + this.invoke(); + return false; + }; + this.submenuLoaded = () => { + if (!this.focusSubmenuOnLoad) { + return; + } + this.focusSubmenuOnLoad = false; + if (this.hasSubmenu) { + this.submenu.focus(); + this.setAttribute("tabindex", "-1"); + } + }; + this.handleMouseOver = (e) => { + if (this.disabled || !this.hasSubmenu || this.expanded) { + return false; + } + this.expanded = true; + return false; + }; + this.handleMouseOut = (e) => { + if (!this.expanded || this.contains(document.activeElement)) { + return false; + } + this.expanded = false; + return false; + }; + this.expandAndFocus = () => { + if (!this.hasSubmenu) { + return; + } + this.focusSubmenuOnLoad = true; + this.expanded = true; + }; + this.invoke = () => { + if (this.disabled) { + return; + } + switch (this.role) { + case MenuItemRole.menuitemcheckbox: + this.checked = !this.checked; + break; + case MenuItemRole.menuitem: + this.updateSubmenu(); + if (this.hasSubmenu) { + this.expandAndFocus(); + } else { + this.$emit("change"); + } + break; + case MenuItemRole.menuitemradio: + if (!this.checked) { + this.checked = true; + } + break; + } + }; + this.updateSubmenu = () => { + this.submenu = this.domChildren().find((element) => { + return element.getAttribute("role") === "menu"; + }); + this.hasSubmenu = this.submenu === void 0 ? false : true; + }; + } + expandedChanged(oldValue) { + if (this.$fastController.isConnected) { + if (this.submenu === void 0) { + return; + } + if (this.expanded === false) { + this.submenu.collapseExpandedItem(); + } else { + this.currentDirection = getDirection(this); + } + this.$emit("expanded-change", this, { bubbles: false }); + } + } + checkedChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.$emit("change"); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.updateSubmenu(); + }); + if (!this.startColumnCount) { + this.startColumnCount = 1; + } + this.observer = new MutationObserver(this.updateSubmenu); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.submenu = void 0; + if (this.observer !== void 0) { + this.observer.disconnect(); + this.observer = void 0; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "disabled", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "expanded", void 0); + __decorate([ + observable + ], MenuItem.prototype, "startColumnCount", void 0); + __decorate([ + attr + ], MenuItem.prototype, "role", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], MenuItem.prototype, "checked", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenuRegion", void 0); + __decorate([ + observable + ], MenuItem.prototype, "hasSubmenu", void 0); + __decorate([ + observable + ], MenuItem.prototype, "currentDirection", void 0); + __decorate([ + observable + ], MenuItem.prototype, "submenu", void 0); + applyMixins(MenuItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js + var init_menu_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/menu-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js + var init_menu_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu-item/index.js"() { + init_menu_item_template(); + init_menu_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js + var init_menu_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js + var Menu; + var init_menu = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/menu.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_menu_item2(); + init_foundation_element(); + Menu = class _Menu extends FoundationElement { + constructor() { + super(...arguments); + this.expandedItem = null; + this.focusIndex = -1; + this.isNestedMenu = () => { + return this.parentElement !== null && isHTMLElement(this.parentElement) && this.parentElement.getAttribute("role") === "menuitem"; + }; + this.handleFocusOut = (e) => { + if (!this.contains(e.relatedTarget) && this.menuItems !== void 0) { + this.collapseExpandedItem(); + const focusIndex = this.menuItems.findIndex(this.isFocusableElement); + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.menuItems[focusIndex].setAttribute("tabindex", "0"); + this.focusIndex = focusIndex; + } + }; + this.handleItemFocus = (e) => { + const targetItem = e.target; + if (this.menuItems !== void 0 && targetItem !== this.menuItems[this.focusIndex]) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.focusIndex = this.menuItems.indexOf(targetItem); + targetItem.setAttribute("tabindex", "0"); + } + }; + this.handleExpandedChanged = (e) => { + if (e.defaultPrevented || e.target === null || this.menuItems === void 0 || this.menuItems.indexOf(e.target) < 0) { + return; + } + e.preventDefault(); + const changedItem = e.target; + if (this.expandedItem !== null && changedItem === this.expandedItem && changedItem.expanded === false) { + this.expandedItem = null; + return; + } + if (changedItem.expanded) { + if (this.expandedItem !== null && this.expandedItem !== changedItem) { + this.expandedItem.expanded = false; + } + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + this.expandedItem = changedItem; + this.focusIndex = this.menuItems.indexOf(changedItem); + changedItem.setAttribute("tabindex", "0"); + } + }; + this.removeItemListeners = () => { + if (this.menuItems !== void 0) { + this.menuItems.forEach((item) => { + item.removeEventListener("expanded-change", this.handleExpandedChanged); + item.removeEventListener("focus", this.handleItemFocus); + }); + } + }; + this.setItems = () => { + const newItems = this.domChildren(); + this.removeItemListeners(); + this.menuItems = newItems; + const menuItems = this.menuItems.filter(this.isMenuItemElement); + if (menuItems.length) { + this.focusIndex = 0; + } + function elementIndent(el2) { + const role = el2.getAttribute("role"); + const startSlot = el2.querySelector("[slot=start]"); + if (role !== MenuItemRole.menuitem && startSlot === null) { + return 1; + } else if (role === MenuItemRole.menuitem && startSlot !== null) { + return 1; + } else if (role !== MenuItemRole.menuitem && startSlot !== null) { + return 2; + } else { + return 0; + } + } + const indent = menuItems.reduce((accum, current) => { + const elementValue = elementIndent(current); + return accum > elementValue ? accum : elementValue; + }, 0); + menuItems.forEach((item, index) => { + item.setAttribute("tabindex", index === 0 ? "0" : "-1"); + item.addEventListener("expanded-change", this.handleExpandedChanged); + item.addEventListener("focus", this.handleItemFocus); + if (item instanceof MenuItem || "startColumnCount" in item) { + item.startColumnCount = indent; + } + }); + }; + this.changeHandler = (e) => { + if (this.menuItems === void 0) { + return; + } + const changedMenuItem = e.target; + const changeItemIndex = this.menuItems.indexOf(changedMenuItem); + if (changeItemIndex === -1) { + return; + } + if (changedMenuItem.role === "menuitemradio" && changedMenuItem.checked === true) { + for (let i = changeItemIndex - 1; i >= 0; --i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + const maxIndex = this.menuItems.length - 1; + for (let i = changeItemIndex + 1; i <= maxIndex; ++i) { + const item = this.menuItems[i]; + const role = item.getAttribute("role"); + if (role === MenuItemRole.menuitemradio) { + item.checked = false; + } + if (role === "separator") { + break; + } + } + } + }; + this.isMenuItemElement = (el2) => { + return isHTMLElement(el2) && _Menu.focusableElementRoles.hasOwnProperty(el2.getAttribute("role")); + }; + this.isFocusableElement = (el2) => { + return this.isMenuItemElement(el2); + }; + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.menuItems !== void 0) { + this.setItems(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + DOM.queueUpdate(() => { + this.setItems(); + }); + this.addEventListener("change", this.changeHandler); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.removeItemListeners(); + this.menuItems = void 0; + this.removeEventListener("change", this.changeHandler); + } + /** + * Focuses the first item in the menu. + * + * @public + */ + focus() { + this.setFocus(0, 1); + } + /** + * Collapses any expanded menu items. + * + * @public + */ + collapseExpandedItem() { + if (this.expandedItem !== null) { + this.expandedItem.expanded = false; + this.expandedItem = null; + } + } + /** + * @internal + */ + handleMenuKeyDown(e) { + if (e.defaultPrevented || this.menuItems === void 0) { + return; + } + switch (e.key) { + case keyArrowDown: + this.setFocus(this.focusIndex + 1, 1); + return; + case keyArrowUp: + this.setFocus(this.focusIndex - 1, -1); + return; + case keyEnd: + this.setFocus(this.menuItems.length - 1, -1); + return; + case keyHome: + this.setFocus(0, 1); + return; + default: + return true; + } + } + /** + * get an array of valid DOM children + */ + domChildren() { + return Array.from(this.children).filter((child) => !child.hasAttribute("hidden")); + } + setFocus(focusIndex, adjustment) { + if (this.menuItems === void 0) { + return; + } + while (focusIndex >= 0 && focusIndex < this.menuItems.length) { + const child = this.menuItems[focusIndex]; + if (this.isFocusableElement(child)) { + if (this.focusIndex > -1 && this.menuItems.length >= this.focusIndex - 1) { + this.menuItems[this.focusIndex].setAttribute("tabindex", "-1"); + } + this.focusIndex = focusIndex; + child.setAttribute("tabindex", "0"); + child.focus(); + break; + } + focusIndex += adjustment; + } + } + }; + Menu.focusableElementRoles = roleForMenuItem; + __decorate([ + observable + ], Menu.prototype, "items", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js + var init_menu2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/menu/index.js"() { + init_menu_template(); + init_menu(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js + var init_number_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js + var _TextField, FormAssociatedTextField; + var init_text_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextField = class extends FoundationElement { + }; + FormAssociatedTextField = class extends FormAssociated(_TextField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js + var TextFieldType; + var init_text_field_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.options.js"() { + TextFieldType = { + /** + * An email TextField + */ + email: "email", + /** + * A password TextField + */ + password: "password", + /** + * A telephone TextField + */ + tel: "tel", + /** + * A text TextField + */ + text: "text", + /** + * A URL TextField + */ + url: "url" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js + var TextField, DelegatesARIATextbox; + var init_text_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_text_field_form_associated(); + init_text_field_options(); + TextField = class extends FormAssociatedTextField { + constructor() { + super(...arguments); + this.type = TextFieldType.text; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + typeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.type = this.type; + this.validate(); + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", this.type); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the text field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], TextField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "autofocus", void 0); + __decorate([ + attr + ], TextField.prototype, "placeholder", void 0); + __decorate([ + attr + ], TextField.prototype, "type", void 0); + __decorate([ + attr + ], TextField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "minlength", void 0); + __decorate([ + attr + ], TextField.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextField.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextField.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextField.prototype, "defaultSlottedNodes", void 0); + DelegatesARIATextbox = class { + }; + applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties); + applyMixins(TextField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js + var _NumberField, FormAssociatedNumberField; + var init_number_field_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _NumberField = class extends FoundationElement { + }; + FormAssociatedNumberField = class extends FormAssociated(_NumberField) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js + var NumberField; + var init_number_field = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/number-field.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_text_field(); + init_number_field_form_associated(); + NumberField = class extends FormAssociatedNumberField { + constructor() { + super(...arguments); + this.hideStep = false; + this.step = 1; + this.isUserInput = false; + } + /** + * Ensures that the max is greater than the min and that the value + * is less than the max + * @param previous - the previous max value + * @param next - updated max value + * + * @internal + */ + maxChanged(previous, next) { + var _a; + this.max = Math.max(next, (_a = this.min) !== null && _a !== void 0 ? _a : next); + const min = Math.min(this.min, this.max); + if (this.min !== void 0 && this.min !== min) { + this.min = min; + } + this.value = this.getValidValue(this.value); + } + /** + * Ensures that the min is less than the max and that the value + * is greater than the min + * @param previous - previous min value + * @param next - updated min value + * + * @internal + */ + minChanged(previous, next) { + var _a; + this.min = Math.min(next, (_a = this.max) !== null && _a !== void 0 ? _a : next); + const max = Math.max(this.min, this.max); + if (this.max !== void 0 && this.max !== max) { + this.max = max; + } + this.value = this.getValidValue(this.value); + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * Validates that the value is a number between the min and max + * @param previous - previous stored value + * @param next - value being updated + * @param updateControl - should the text field be updated with value, defaults to true + * @internal + */ + valueChanged(previous, next) { + this.value = this.getValidValue(next); + if (next !== this.value) { + return; + } + if (this.control && !this.isUserInput) { + this.control.value = this.value; + } + super.valueChanged(previous, this.value); + if (previous !== void 0 && !this.isUserInput) { + this.$emit("input"); + this.$emit("change"); + } + this.isUserInput = false; + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Sets the internal value to a valid number between the min and max properties + * @param value - user input + * + * @internal + */ + getValidValue(value) { + var _a, _b; + let validValue = parseFloat(parseFloat(value).toPrecision(12)); + if (isNaN(validValue)) { + validValue = ""; + } else { + validValue = Math.min(validValue, (_a = this.max) !== null && _a !== void 0 ? _a : validValue); + validValue = Math.max(validValue, (_b = this.min) !== null && _b !== void 0 ? _b : validValue).toString(); + } + return validValue; + } + /** + * Increments the value using the step value + * + * @public + */ + stepUp() { + const value = parseFloat(this.value); + const stepUpValue = !isNaN(value) ? value + this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? this.step : 0; + this.value = stepUpValue.toString(); + } + /** + * Decrements the value using the step value + * + * @public + */ + stepDown() { + const value = parseFloat(this.value); + const stepDownValue = !isNaN(value) ? value - this.step : this.min > 0 ? this.min : this.max < 0 ? this.max : !this.min ? 0 - this.step : 0; + this.value = stepDownValue.toString(); + } + /** + * Sets up the initial state of the number field + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "number"); + this.validate(); + this.control.value = this.value; + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** + * Selects all the text in the number field + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.control.value = this.control.value.replace(/[^0-9\-+e.]/g, ""); + this.isUserInput = true; + this.value = this.control.value; + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** + * Handles the internal control's `keydown` event + * @internal + */ + handleKeyDown(e) { + const key = e.key; + switch (key) { + case keyArrowUp: + this.stepUp(); + return false; + case keyArrowDown: + this.stepDown(); + return false; + } + return true; + } + /** + * Handles populating the input field with a validated value when + * leaving the input field. + * @internal + */ + handleBlur() { + this.control.value = this.value; + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], NumberField.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], NumberField.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "hide-step", mode: "boolean" }) + ], NumberField.prototype, "hideStep", void 0); + __decorate([ + attr + ], NumberField.prototype, "placeholder", void 0); + __decorate([ + attr + ], NumberField.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "minlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "size", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "step", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], NumberField.prototype, "min", void 0); + __decorate([ + observable + ], NumberField.prototype, "defaultSlottedNodes", void 0); + applyMixins(NumberField, StartEnd, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js + var init_number_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/number-field/index.js"() { + init_number_field_template(); + init_number_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js + var progressSegments, progressRingTemplate; + var init_progress_ring_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/progress-ring.template.js"() { + init_esm(); + progressSegments = 44; + progressRingTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js + var init_progress_ring = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress-ring/index.js"() { + init_progress_ring_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js + var BaseProgress; + var init_base_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/base-progress.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + BaseProgress = class extends FoundationElement { + constructor() { + super(...arguments); + this.percentComplete = 0; + } + valueChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + minChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + maxChanged() { + if (this.$fastController.isConnected) { + this.updatePercentComplete(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.updatePercentComplete(); + } + updatePercentComplete() { + const min = typeof this.min === "number" ? this.min : 0; + const max = typeof this.max === "number" ? this.max : 100; + const value = typeof this.value === "number" ? this.value : 0; + const range2 = max - min; + this.percentComplete = range2 === 0 ? 0 : Math.fround((value - min) / range2 * 100); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "value", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], BaseProgress.prototype, "max", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], BaseProgress.prototype, "paused", void 0); + __decorate([ + observable + ], BaseProgress.prototype, "percentComplete", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js + var init_progress_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/progress.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js + var init_progress = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/progress/index.js"() { + init_base_progress(); + init_progress_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js + var radioGroupTemplate; + var init_radio_group_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.template.js"() { + init_esm(); + init_dist2(); + radioGroupTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js + var RadioGroup; + var init_radio_group = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/radio-group.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + RadioGroup = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = Orientation.horizontal; + this.radioChangeHandler = (e) => { + const changedRadio = e.target; + if (changedRadio.checked) { + this.slottedRadioButtons.forEach((radio) => { + if (radio !== changedRadio) { + radio.checked = false; + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + } + }); + this.selectedRadio = changedRadio; + this.value = changedRadio.value; + changedRadio.setAttribute("tabindex", "0"); + this.focusedRadio = changedRadio; + } + e.stopPropagation(); + }; + this.moveToRadioByIndex = (group, index) => { + const radio = group[index]; + if (!this.isInsideToolbar) { + radio.setAttribute("tabindex", "0"); + if (radio.readOnly) { + this.slottedRadioButtons.forEach((nextRadio) => { + if (nextRadio !== radio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + radio.checked = true; + this.selectedRadio = radio; + } + } + this.focusedRadio = radio; + radio.focus(); + }; + this.moveRightOffGroup = () => { + var _a; + (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.moveLeftOffGroup = () => { + var _a; + (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus(); + }; + this.focusOutHandler = (e) => { + const group = this.slottedRadioButtons; + const radio = e.target; + const index = radio !== null ? group.indexOf(radio) : 0; + const focusedIndex = this.focusedRadio ? group.indexOf(this.focusedRadio) : -1; + if (focusedIndex === 0 && index === focusedIndex || focusedIndex === group.length - 1 && focusedIndex === index) { + if (!this.selectedRadio) { + this.focusedRadio = group[0]; + this.focusedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.focusedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } else { + this.focusedRadio = this.selectedRadio; + if (!this.isInsideFoundationToolbar) { + this.selectedRadio.setAttribute("tabindex", "0"); + group.forEach((nextRadio) => { + if (nextRadio !== this.selectedRadio) { + nextRadio.setAttribute("tabindex", "-1"); + } + }); + } + } + } + return true; + }; + this.clickHandler = (e) => { + const radio = e.target; + if (radio) { + const group = this.slottedRadioButtons; + if (radio.checked || group.indexOf(radio) === 0) { + radio.setAttribute("tabindex", "0"); + this.selectedRadio = radio; + } else { + radio.setAttribute("tabindex", "-1"); + this.selectedRadio = null; + } + this.focusedRadio = radio; + } + e.preventDefault(); + }; + this.shouldMoveOffGroupToTheRight = (index, group, key) => { + return index === group.length && this.isInsideToolbar && key === keyArrowRight; + }; + this.shouldMoveOffGroupToTheLeft = (group, key) => { + const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + return index < 0 && this.isInsideToolbar && key === keyArrowLeft; + }; + this.checkFocusedRadio = () => { + if (this.focusedRadio !== null && !this.focusedRadio.readOnly && !this.focusedRadio.checked) { + this.focusedRadio.checked = true; + this.focusedRadio.setAttribute("tabindex", "0"); + this.focusedRadio.focus(); + this.selectedRadio = this.focusedRadio; + } + }; + this.moveRight = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1; + if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) { + this.moveRightOffGroup(); + return; + } else if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index + 1 >= group.length) { + if (this.isInsideToolbar) { + break; + } else { + index = 0; + } + } else { + index += 1; + } + } + }; + this.moveLeft = (e) => { + const group = this.slottedRadioButtons; + let index = 0; + index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + if (this.shouldMoveOffGroupToTheLeft(group, e.key)) { + this.moveLeftOffGroup(); + return; + } + while (index >= 0 && group.length > 1) { + if (!group[index].disabled) { + this.moveToRadioByIndex(group, index); + break; + } else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) { + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.keydownHandler = (e) => { + const key = e.key; + if (key in ArrowKeys && this.isInsideFoundationToolbar) { + return true; + } + switch (key) { + case keyEnter: { + this.checkFocusedRadio(); + break; + } + case keyArrowRight: + case keyArrowDown: { + if (this.direction === Direction.ltr) { + this.moveRight(e); + } else { + this.moveLeft(e); + } + break; + } + case keyArrowLeft: + case keyArrowUp: { + if (this.direction === Direction.ltr) { + this.moveLeft(e); + } else { + this.moveRight(e); + } + break; + } + default: { + return true; + } + } + }; + } + readOnlyChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.readOnly) { + radio.readOnly = true; + } else { + radio.readOnly = false; + } + }); + } + } + disabledChanged() { + if (this.slottedRadioButtons !== void 0) { + this.slottedRadioButtons.forEach((radio) => { + if (this.disabled) { + radio.disabled = true; + } else { + radio.disabled = false; + } + }); + } + } + nameChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + radio.setAttribute("name", this.name); + }); + } + } + valueChanged() { + if (this.slottedRadioButtons) { + this.slottedRadioButtons.forEach((radio) => { + if (radio.value === this.value) { + radio.checked = true; + this.selectedRadio = radio; + } + }); + } + this.$emit("change"); + } + slottedRadioButtonsChanged(oldValue, newValue) { + if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) { + this.setupRadioButtons(); + } + } + get parentToolbar() { + return this.closest('[role="toolbar"]'); + } + get isInsideToolbar() { + var _a; + return (_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false; + } + get isInsideFoundationToolbar() { + var _a; + return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + this.setupRadioButtons(); + } + disconnectedCallback() { + this.slottedRadioButtons.forEach((radio) => { + radio.removeEventListener("change", this.radioChangeHandler); + }); + } + setupRadioButtons() { + const checkedRadios = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0; + if (numberOfCheckedRadios > 1) { + const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1]; + lastCheckedRadio.checked = true; + } + let foundMatchingVal = false; + this.slottedRadioButtons.forEach((radio) => { + if (this.name !== void 0) { + radio.setAttribute("name", this.name); + } + if (this.disabled) { + radio.disabled = true; + } + if (this.readOnly) { + radio.readOnly = true; + } + if (this.value && this.value === radio.value) { + this.selectedRadio = radio; + this.focusedRadio = radio; + radio.checked = true; + radio.setAttribute("tabindex", "0"); + foundMatchingVal = true; + } else { + if (!this.isInsideFoundationToolbar) { + radio.setAttribute("tabindex", "-1"); + } + radio.checked = false; + } + radio.addEventListener("change", this.radioChangeHandler); + }); + if (this.value === void 0 && this.slottedRadioButtons.length > 0) { + const checkedRadios2 = this.slottedRadioButtons.filter((radio) => { + return radio.hasAttribute("checked"); + }); + const numberOfCheckedRadios2 = checkedRadios2 !== null ? checkedRadios2.length : 0; + if (numberOfCheckedRadios2 > 0 && !foundMatchingVal) { + const lastCheckedRadio = checkedRadios2[numberOfCheckedRadios2 - 1]; + lastCheckedRadio.checked = true; + this.focusedRadio = lastCheckedRadio; + lastCheckedRadio.setAttribute("tabindex", "0"); + } else { + this.slottedRadioButtons[0].setAttribute("tabindex", "0"); + this.focusedRadio = this.slottedRadioButtons[0]; + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], RadioGroup.prototype, "readOnly", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], RadioGroup.prototype, "disabled", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "name", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "value", void 0); + __decorate([ + attr + ], RadioGroup.prototype, "orientation", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "childItems", void 0); + __decorate([ + observable + ], RadioGroup.prototype, "slottedRadioButtons", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js + var init_radio_group2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio-group/index.js"() { + init_radio_group_template(); + init_radio_group(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js + var radioTemplate; + var init_radio_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.template.js"() { + init_esm(); + radioTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js + var _Radio, FormAssociatedRadio; + var init_radio_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Radio = class extends FoundationElement { + }; + FormAssociatedRadio = class extends CheckableFormAssociated(_Radio) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js + var Radio; + var init_radio = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/radio.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_radio_form_associated(); + Radio = class extends FormAssociatedRadio { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + switch (e.key) { + case keySpace: + if (!this.checked && !this.readOnly) { + this.checked = true; + } + return; + } + return true; + }; + this.proxy.setAttribute("type", "radio"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * @internal + */ + defaultCheckedChanged() { + var _a; + if (this.$fastController.isConnected && !this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_a = this.defaultChecked) !== null && _a !== void 0 ? _a : false; + this.dirtyChecked = false; + } + } + } + /** + * @internal + */ + connectedCallback() { + var _a, _b; + super.connectedCallback(); + this.validate(); + if (((_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.getAttribute("role")) !== "radiogroup" && this.getAttribute("tabindex") === null) { + if (!this.disabled) { + this.setAttribute("tabindex", "0"); + } + } + if (this.checkedAttribute) { + if (!this.dirtyChecked) { + if (!this.isInsideRadioGroup()) { + this.checked = (_b = this.defaultChecked) !== null && _b !== void 0 ? _b : false; + this.dirtyChecked = false; + } + } + } + } + isInsideRadioGroup() { + const parent = this.closest("[role=radiogroup]"); + return parent !== null; + } + /** + * @internal + */ + clickHandler(e) { + if (!this.disabled && !this.readOnly && !this.checked) { + this.checked = true; + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Radio.prototype, "readOnly", void 0); + __decorate([ + observable + ], Radio.prototype, "name", void 0); + __decorate([ + observable + ], Radio.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js + var init_radio2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/radio/index.js"() { + init_radio_template(); + init_radio(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js + var HorizontalScroll; + var init_horizontal_scroll = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + HorizontalScroll = class extends FoundationElement { + constructor() { + super(...arguments); + this.framesPerSecond = 60; + this.updatingItems = false; + this.speed = 600; + this.easing = "ease-in-out"; + this.flippersHiddenFromAT = false; + this.scrolling = false; + this.resizeDetector = null; + } + /** + * The calculated duration for a frame. + * + * @internal + */ + get frameTime() { + return 1e3 / this.framesPerSecond; + } + /** + * Firing scrollstart and scrollend events + * @internal + */ + scrollingChanged(prev, next) { + if (this.scrollContainer) { + const event = this.scrolling == true ? "scrollstart" : "scrollend"; + this.$emit(event, this.scrollContainer.scrollLeft); + } + } + /** + * In RTL mode + * @internal + */ + get isRtl() { + return this.scrollItems.length > 1 && this.scrollItems[0].offsetLeft > this.scrollItems[1].offsetLeft; + } + connectedCallback() { + super.connectedCallback(); + this.initializeResizeDetector(); + } + disconnectedCallback() { + this.disconnectResizeDetector(); + super.disconnectedCallback(); + } + /** + * Updates scroll stops and flippers when scroll items change + * @param previous - current scroll items + * @param next - new updated scroll items + * @public + */ + scrollItemsChanged(previous, next) { + if (next && !this.updatingItems) { + DOM.queueUpdate(() => this.setStops()); + } + } + /** + * destroys the instance's resize observer + * @internal + */ + disconnectResizeDetector() { + if (this.resizeDetector) { + this.resizeDetector.disconnect(); + this.resizeDetector = null; + } + } + /** + * initializes the instance's resize observer + * @internal + */ + initializeResizeDetector() { + this.disconnectResizeDetector(); + this.resizeDetector = new window.ResizeObserver(this.resized.bind(this)); + this.resizeDetector.observe(this); + } + /** + * Looks for slots and uses child nodes instead + * @internal + */ + updateScrollStops() { + this.updatingItems = true; + const updatedItems = this.scrollItems.reduce((scrollItems, scrollItem) => { + if (scrollItem instanceof HTMLSlotElement) { + return scrollItems.concat(scrollItem.assignedElements()); + } + scrollItems.push(scrollItem); + return scrollItems; + }, []); + this.scrollItems = updatedItems; + this.updatingItems = false; + } + /** + * Finds all of the scroll stops between elements + * @internal + */ + setStops() { + this.updateScrollStops(); + const { scrollContainer: container } = this; + const { scrollLeft } = container; + const { width: containerWidth, left: containerLeft } = container.getBoundingClientRect(); + this.width = containerWidth; + let lastStop = 0; + let stops = this.scrollItems.map((item, index) => { + const { left, width } = item.getBoundingClientRect(); + const leftPosition = Math.round(left + scrollLeft - containerLeft); + const right = Math.round(leftPosition + width); + if (this.isRtl) { + return -right; + } + lastStop = right; + return index === 0 ? 0 : leftPosition; + }).concat(lastStop); + stops = this.fixScrollMisalign(stops); + stops.sort((a, b) => Math.abs(a) - Math.abs(b)); + this.scrollStops = stops; + this.setFlippers(); + } + /** + * Checks to see if the stops are returning values + * otherwise it will try to reinitialize them + * + * @returns boolean indicating that current scrollStops are valid non-zero values + * @internal + */ + validateStops(reinit = true) { + const hasStops = () => !!this.scrollStops.find((stop) => stop > 0); + if (!hasStops() && reinit) { + this.setStops(); + } + return hasStops(); + } + /** + * + */ + fixScrollMisalign(stops) { + if (this.isRtl && stops.some((stop) => stop > 0)) { + stops.sort((a, b) => b - a); + const offset = stops[0]; + stops = stops.map((stop) => stop - offset); + } + return stops; + } + /** + * Sets the controls view if enabled + * @internal + */ + setFlippers() { + var _a, _b; + const position = this.scrollContainer.scrollLeft; + (_a = this.previousFlipperContainer) === null || _a === void 0 ? void 0 : _a.classList.toggle("disabled", position === 0); + if (this.scrollStops) { + const lastStop = Math.abs(this.scrollStops[this.scrollStops.length - 1]); + (_b = this.nextFlipperContainer) === null || _b === void 0 ? void 0 : _b.classList.toggle("disabled", this.validateStops(false) && Math.abs(position) + this.width >= lastStop); + } + } + /** + * Function that can scroll an item into view. + * @param item - An item index, a scroll item or a child of one of the scroll items + * @param padding - Padding of the viewport where the active item shouldn't be + * @param rightPadding - Optional right padding. Uses the padding if not defined + * + * @public + */ + scrollInView(item, padding = 0, rightPadding) { + var _a; + if (typeof item !== "number" && item) { + item = this.scrollItems.findIndex((scrollItem) => scrollItem === item || scrollItem.contains(item)); + } + if (item !== void 0) { + rightPadding = rightPadding !== null && rightPadding !== void 0 ? rightPadding : padding; + const { scrollContainer: container, scrollStops, scrollItems: items } = this; + const { scrollLeft } = this.scrollContainer; + const { width: containerWidth } = container.getBoundingClientRect(); + const itemStart = scrollStops[item]; + const { width } = items[item].getBoundingClientRect(); + const itemEnd = itemStart + width; + const isBefore = scrollLeft + padding > itemStart; + if (isBefore || scrollLeft + containerWidth - rightPadding < itemEnd) { + const stops = [...scrollStops].sort((a, b) => isBefore ? b - a : a - b); + const scrollTo = (_a = stops.find((position) => isBefore ? position + padding < itemStart : position + containerWidth - (rightPadding !== null && rightPadding !== void 0 ? rightPadding : 0) > itemEnd)) !== null && _a !== void 0 ? _a : 0; + this.scrollToPosition(scrollTo); + } + } + } + /** + * Lets the user arrow left and right through the horizontal scroll + * @param e - Keyboard event + * @public + */ + keyupHandler(e) { + const key = e.key; + switch (key) { + case "ArrowLeft": + this.scrollToPrevious(); + break; + case "ArrowRight": + this.scrollToNext(); + break; + } + } + /** + * Scrolls items to the left + * @public + */ + scrollToPrevious() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop, index) => stop >= scrollPosition && (this.isRtl || index === this.scrollStops.length - 1 || this.scrollStops[index + 1] > scrollPosition)); + const right = Math.abs(this.scrollStops[current + 1]); + let nextIndex = this.scrollStops.findIndex((stop) => Math.abs(stop) + this.width > right); + if (nextIndex >= current || nextIndex === -1) { + nextIndex = current > 0 ? current - 1 : 0; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Scrolls items to the right + * @public + */ + scrollToNext() { + this.validateStops(); + const scrollPosition = this.scrollContainer.scrollLeft; + const current = this.scrollStops.findIndex((stop) => Math.abs(stop) >= Math.abs(scrollPosition)); + const outOfView = this.scrollStops.findIndex((stop) => Math.abs(scrollPosition) + this.width <= Math.abs(stop)); + let nextIndex = current; + if (outOfView > current + 2) { + nextIndex = outOfView - 2; + } else if (current < this.scrollStops.length - 2) { + nextIndex = current + 1; + } + this.scrollToPosition(this.scrollStops[nextIndex], scrollPosition); + } + /** + * Handles scrolling with easing + * @param position - starting position + * @param newPosition - position to scroll to + * @public + */ + scrollToPosition(newPosition, position = this.scrollContainer.scrollLeft) { + var _a; + if (this.scrolling) { + return; + } + this.scrolling = true; + const seconds = (_a = this.duration) !== null && _a !== void 0 ? _a : `${Math.abs(newPosition - position) / this.speed}s`; + this.content.style.setProperty("transition-duration", seconds); + const computedDuration = parseFloat(getComputedStyle(this.content).getPropertyValue("transition-duration")); + const transitionendHandler = (e) => { + if (e && e.target !== e.currentTarget) { + return; + } + this.content.style.setProperty("transition-duration", "0s"); + this.content.style.removeProperty("transform"); + this.scrollContainer.style.setProperty("scroll-behavior", "auto"); + this.scrollContainer.scrollLeft = newPosition; + this.setFlippers(); + this.content.removeEventListener("transitionend", transitionendHandler); + this.scrolling = false; + }; + if (computedDuration === 0) { + transitionendHandler(); + return; + } + this.content.addEventListener("transitionend", transitionendHandler); + const maxScrollValue = this.scrollContainer.scrollWidth - this.scrollContainer.clientWidth; + let transitionStop = this.scrollContainer.scrollLeft - Math.min(newPosition, maxScrollValue); + if (this.isRtl) { + transitionStop = this.scrollContainer.scrollLeft + Math.min(Math.abs(newPosition), maxScrollValue); + } + this.content.style.setProperty("transition-property", "transform"); + this.content.style.setProperty("transition-timing-function", this.easing); + this.content.style.setProperty("transform", `translateX(${transitionStop}px)`); + } + /** + * Monitors resize event on the horizontal-scroll element + * @public + */ + resized() { + if (this.resizeTimeout) { + this.resizeTimeout = clearTimeout(this.resizeTimeout); + } + this.resizeTimeout = setTimeout(() => { + this.width = this.scrollContainer.offsetWidth; + this.setFlippers(); + }, this.frameTime); + } + /** + * Monitors scrolled event on the content container + * @public + */ + scrolled() { + if (this.scrollTimeout) { + this.scrollTimeout = clearTimeout(this.scrollTimeout); + } + this.scrollTimeout = setTimeout(() => { + this.setFlippers(); + }, this.frameTime); + } + }; + __decorate([ + attr({ converter: nullableNumberConverter }) + ], HorizontalScroll.prototype, "speed", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "duration", void 0); + __decorate([ + attr + ], HorizontalScroll.prototype, "easing", void 0); + __decorate([ + attr({ attribute: "flippers-hidden-from-at", converter: booleanConverter }) + ], HorizontalScroll.prototype, "flippersHiddenFromAT", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrolling", void 0); + __decorate([ + observable + ], HorizontalScroll.prototype, "scrollItems", void 0); + __decorate([ + attr({ attribute: "view" }) + ], HorizontalScroll.prototype, "view", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js + var init_horizontal_scroll_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/horizontal-scroll.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js + var init_horizontal_scroll2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/horizontal-scroll/index.js"() { + init_horizontal_scroll(); + init_horizontal_scroll_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js + function whitespaceFilter(value, index, array) { + return value.nodeType !== Node.TEXT_NODE ? true : typeof value.nodeValue === "string" && !!value.nodeValue.trim().length; + } + var init_whitespace_filter = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/whitespace-filter.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js + var init_search_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js + var _Search, FormAssociatedSearch; + var init_search_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Search = class extends FoundationElement { + }; + FormAssociatedSearch = class extends FormAssociated(_Search) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/search.js + var Search, DelegatesARIASearch; + var init_search = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/search.js"() { + init_tslib_es6(); + init_esm(); + init_patterns(); + init_apply_mixins(); + init_search_form_associated(); + Search = class extends FormAssociatedSearch { + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + this.validate(); + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.autofocus = this.autofocus; + this.validate(); + } + } + placeholderChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.placeholder = this.placeholder; + } + } + listChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.setAttribute("list", this.list); + this.validate(); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.maxLength = this.maxlength; + this.validate(); + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.minLength = this.minlength; + this.validate(); + } + } + patternChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.pattern = this.pattern; + this.validate(); + } + } + sizeChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.size = this.size; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.validate(); + if (this.autofocus) { + DOM.queueUpdate(() => { + this.focus(); + }); + } + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + /** + * Handles the internal control's `input` event + * @internal + */ + handleTextInput() { + this.value = this.control.value; + } + /** + * Handles the control's clear value event + * @public + */ + handleClearInput() { + this.value = ""; + this.control.focus(); + this.handleChange(); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Search.prototype, "readOnly", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "autofocus", void 0); + __decorate([ + attr + ], Search.prototype, "placeholder", void 0); + __decorate([ + attr + ], Search.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "minlength", void 0); + __decorate([ + attr + ], Search.prototype, "pattern", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Search.prototype, "size", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Search.prototype, "spellcheck", void 0); + __decorate([ + observable + ], Search.prototype, "defaultSlottedNodes", void 0); + DelegatesARIASearch = class { + }; + applyMixins(DelegatesARIASearch, ARIAGlobalStatesAndProperties); + applyMixins(Search, StartEnd, DelegatesARIASearch); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/search/index.js + var init_search2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/search/index.js"() { + init_search_template(); + init_search(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js + var _Select, FormAssociatedSelect; + var init_select_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.form-associated.js"() { + init_listbox_element(); + init_form_associated(); + _Select = class extends ListboxElement { + }; + FormAssociatedSelect = class extends FormAssociated(_Select) { + constructor() { + super(...arguments); + this.proxy = document.createElement("select"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.js + var Select, DelegatesARIASelect; + var init_select = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_listbox(); + init_start_end(); + init_apply_mixins(); + init_select_form_associated(); + init_select_options(); + Select = class extends FormAssociatedSelect { + constructor() { + super(...arguments); + this.open = false; + this.forcedPosition = false; + this.listboxId = uniqueId("listbox-"); + this.maxHeight = 0; + } + /** + * Sets focus and synchronizes ARIA attributes when the open property changes. + * + * @param prev - the previous open value + * @param next - the current open value + * + * @internal + */ + openChanged(prev, next) { + if (!this.collapsible) { + return; + } + if (this.open) { + this.ariaControls = this.listboxId; + this.ariaExpanded = "true"; + this.setPositioning(); + this.focusAndScrollOptionIntoView(); + this.indexWhenOpened = this.selectedIndex; + DOM.queueUpdate(() => this.focus()); + return; + } + this.ariaControls = ""; + this.ariaExpanded = "false"; + } + /** + * The component is collapsible when in single-selection mode with no size attribute. + * + * @internal + */ + get collapsible() { + return !(this.multiple || typeof this.size === "number"); + } + /** + * The value property. + * + * @public + */ + get value() { + Observable.track(this, "value"); + return this._value; + } + set value(next) { + var _a, _b, _c, _d, _e, _f, _g; + const prev = `${this._value}`; + if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) { + const selectedIndex = this._options.findIndex((el2) => el2.value === next); + const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null; + const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null; + if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) { + next = ""; + this.selectedIndex = selectedIndex; + } + next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next; + } + if (prev !== next) { + this._value = next; + super.valueChanged(prev, next); + Observable.notify(this, "value"); + this.updateDisplayValue(); + } + } + /** + * Sets the value and display value to match the first selected option. + * + * @param shouldEmit - if true, the input and change events will be emitted + * + * @internal + */ + updateValue(shouldEmit) { + var _a, _b; + if (this.$fastController.isConnected) { + this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ""; + } + if (shouldEmit) { + this.$emit("input"); + this.$emit("change", this, { + bubbles: true, + composed: void 0 + }); + } + } + /** + * Updates the proxy value when the selected index changes. + * + * @param prev - the previous selected index + * @param next - the next selected index + * + * @internal + */ + selectedIndexChanged(prev, next) { + super.selectedIndexChanged(prev, next); + this.updateValue(); + } + positionChanged(prev, next) { + this.positionAttribute = next; + this.setPositioning(); + } + /** + * Calculate and apply listbox positioning based on available viewport space. + * + * @public + */ + setPositioning() { + const currentBox = this.getBoundingClientRect(); + const viewportHeight = window.innerHeight; + const availableBottom = viewportHeight - currentBox.bottom; + this.position = this.forcedPosition ? this.positionAttribute : currentBox.top > availableBottom ? SelectPosition.above : SelectPosition.below; + this.positionAttribute = this.forcedPosition ? this.positionAttribute : this.position; + this.maxHeight = this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom; + } + /** + * The value displayed on the button. + * + * @public + */ + get displayValue() { + var _a, _b; + Observable.track(this, "displayValue"); + return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : ""; + } + /** + * Synchronize the `aria-disabled` property when the `disabled` property changes. + * + * @param prev - The previous disabled value + * @param next - The next disabled value + * + * @internal + */ + disabledChanged(prev, next) { + if (super.disabledChanged) { + super.disabledChanged(prev, next); + } + this.ariaDisabled = this.disabled ? "true" : "false"; + } + /** + * Reset the element to its first selectable option when its parent form is reset. + * + * @internal + */ + formResetCallback() { + this.setProxyOptions(); + super.setDefaultSelectedOption(); + if (this.selectedIndex === -1) { + this.selectedIndex = 0; + } + } + /** + * Handle opening and closing the listbox when the select is clicked. + * + * @param e - the mouse event + * @internal + */ + clickHandler(e) { + if (this.disabled) { + return; + } + if (this.open) { + const captured = e.target.closest(`option,[role=option]`); + if (captured && captured.disabled) { + return; + } + } + super.clickHandler(e); + this.open = this.collapsible && !this.open; + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + return true; + } + /** + * Handles focus state when the element or its children lose focus. + * + * @param e - The focus event + * @internal + */ + focusoutHandler(e) { + var _a; + super.focusoutHandler(e); + if (!this.open) { + return true; + } + const focusTarget = e.relatedTarget; + if (this.isSameNode(focusTarget)) { + this.focus(); + return; + } + if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) { + this.open = false; + if (this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + } + } + } + /** + * Updates the value when an option's value changes. + * + * @param source - the source object + * @param propertyName - the property to evaluate + * + * @internal + * @override + */ + handleChange(source, propertyName) { + super.handleChange(source, propertyName); + if (propertyName === "value") { + this.updateValue(); + } + } + /** + * Synchronize the form-associated proxy and updates the value property of the element. + * + * @param prev - the previous collection of slotted option elements + * @param next - the next collection of slotted option elements + * + * @internal + */ + slottedOptionsChanged(prev, next) { + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.unsubscribe(this, "value"); + }); + super.slottedOptionsChanged(prev, next); + this.options.forEach((o) => { + const notifier = Observable.getNotifier(o); + notifier.subscribe(this, "value"); + }); + this.setProxyOptions(); + this.updateValue(); + } + /** + * Prevents focus when size is set and a scrollbar is clicked. + * + * @param e - the mouse event object + * + * @override + * @internal + */ + mousedownHandler(e) { + var _a; + if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) { + return super.mousedownHandler(e); + } + return this.collapsible; + } + /** + * Sets the multiple property on the proxy element. + * + * @param prev - the previous multiple value + * @param next - the current multiple value + */ + multipleChanged(prev, next) { + super.multipleChanged(prev, next); + if (this.proxy) { + this.proxy.multiple = next; + } + } + /** + * Updates the selectedness of each option when the list of selected options changes. + * + * @param prev - the previous list of selected options + * @param next - the current list of selected options + * + * @override + * @internal + */ + selectedOptionsChanged(prev, next) { + var _a; + super.selectedOptionsChanged(prev, next); + (_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => { + var _a2; + const proxyOption = (_a2 = this.proxy) === null || _a2 === void 0 ? void 0 : _a2.options.item(i); + if (proxyOption) { + proxyOption.selected = o.selected; + } + }); + } + /** + * Sets the selected index to match the first option with the selected attribute, or + * the first selectable option. + * + * @override + * @internal + */ + setDefaultSelectedOption() { + var _a; + const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter); + const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex((el2) => el2.hasAttribute("selected") || el2.selected || el2.value === this.value); + if (selectedIndex !== -1) { + this.selectedIndex = selectedIndex; + return; + } + this.selectedIndex = 0; + } + /** + * Resets and fills the proxy to match the component's options. + * + * @internal + */ + setProxyOptions() { + if (this.proxy instanceof HTMLSelectElement && this.options) { + this.proxy.options.length = 0; + this.options.forEach((option) => { + const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null); + if (proxyOption) { + this.proxy.options.add(proxyOption); + } + }); + } + } + /** + * Handle keyboard interaction for the select. + * + * @param e - the keyboard event + * @internal + */ + keydownHandler(e) { + super.keydownHandler(e); + const key = e.key || e.key.charCodeAt(0); + switch (key) { + case keySpace: { + e.preventDefault(); + if (this.collapsible && this.typeAheadExpired) { + this.open = !this.open; + } + break; + } + case keyHome: + case keyEnd: { + e.preventDefault(); + break; + } + case keyEnter: { + e.preventDefault(); + this.open = !this.open; + break; + } + case keyEscape: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + break; + } + case keyTab: { + if (this.collapsible && this.open) { + e.preventDefault(); + this.open = false; + } + return true; + } + } + if (!this.open && this.indexWhenOpened !== this.selectedIndex) { + this.updateValue(true); + this.indexWhenOpened = this.selectedIndex; + } + return !(key === keyArrowDown || key === keyArrowUp); + } + connectedCallback() { + super.connectedCallback(); + this.forcedPosition = !!this.positionAttribute; + this.addEventListener("contentchange", this.updateDisplayValue); + } + disconnectedCallback() { + this.removeEventListener("contentchange", this.updateDisplayValue); + super.disconnectedCallback(); + } + /** + * Updates the proxy's size property when the size attribute changes. + * + * @param prev - the previous size + * @param next - the current size + * + * @override + * @internal + */ + sizeChanged(prev, next) { + super.sizeChanged(prev, next); + if (this.proxy) { + this.proxy.size = next; + } + } + /** + * + * @internal + */ + updateDisplayValue() { + if (this.collapsible) { + Observable.notify(this, "displayValue"); + } + } + }; + __decorate([ + attr({ attribute: "open", mode: "boolean" }) + ], Select.prototype, "open", void 0); + __decorate([ + volatile + ], Select.prototype, "collapsible", null); + __decorate([ + observable + ], Select.prototype, "control", void 0); + __decorate([ + attr({ attribute: "position" }) + ], Select.prototype, "positionAttribute", void 0); + __decorate([ + observable + ], Select.prototype, "position", void 0); + __decorate([ + observable + ], Select.prototype, "maxHeight", void 0); + DelegatesARIASelect = class { + }; + __decorate([ + observable + ], DelegatesARIASelect.prototype, "ariaControls", void 0); + applyMixins(DelegatesARIASelect, DelegatesARIAListbox); + applyMixins(Select, StartEnd, DelegatesARIASelect); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js + var selectTemplate; + var init_select_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/select.template.js"() { + init_esm(); + init_listbox(); + init_start_end(); + selectTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/select/index.js + var init_select2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/select/index.js"() { + init_select(); + init_select_options(); + init_select_template(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js + var init_skeleton_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js + var Skeleton; + var init_skeleton = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/skeleton.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Skeleton = class extends FoundationElement { + constructor() { + super(...arguments); + this.shape = "rect"; + } + }; + __decorate([ + attr + ], Skeleton.prototype, "fill", void 0); + __decorate([ + attr + ], Skeleton.prototype, "shape", void 0); + __decorate([ + attr + ], Skeleton.prototype, "pattern", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Skeleton.prototype, "shimmer", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js + var init_skeleton2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/skeleton/index.js"() { + init_skeleton_template(); + init_skeleton(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js + var init_slider_label_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js + function convertPixelToPercent(pixelPos, minPosition, maxPosition, direction) { + let pct = limit(0, 1, (pixelPos - minPosition) / (maxPosition - minPosition)); + if (direction === Direction.rtl) { + pct = 1 - pct; + } + return pct; + } + var init_slider_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider-utilities.js"() { + init_dist2(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js + var defaultConfig, SliderLabel; + var init_slider_label = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/slider-label.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_slider_utilities(); + init_foundation_element(); + defaultConfig = { + min: 0, + max: 0, + direction: Direction.ltr, + orientation: Orientation.horizontal, + disabled: false + }; + SliderLabel = class extends FoundationElement { + constructor() { + super(...arguments); + this.hideMark = false; + this.sliderDirection = Direction.ltr; + this.getSliderConfiguration = () => { + if (!this.isSliderConfig(this.parentNode)) { + this.sliderDirection = defaultConfig.direction || Direction.ltr; + this.sliderOrientation = defaultConfig.orientation || Orientation.horizontal; + this.sliderMaxPosition = defaultConfig.max; + this.sliderMinPosition = defaultConfig.min; + } else { + const parentSlider = this.parentNode; + const { min, max, direction, orientation, disabled } = parentSlider; + if (disabled !== void 0) { + this.disabled = disabled; + } + this.sliderDirection = direction || Direction.ltr; + this.sliderOrientation = orientation || Orientation.horizontal; + this.sliderMaxPosition = max; + this.sliderMinPosition = min; + } + }; + this.positionAsStyle = () => { + const direction = this.sliderDirection ? this.sliderDirection : Direction.ltr; + const pct = convertPixelToPercent(Number(this.position), Number(this.sliderMinPosition), Number(this.sliderMaxPosition)); + let rightNum = Math.round((1 - pct) * 100); + let leftNum = Math.round(pct * 100); + if (Number.isNaN(leftNum) && Number.isNaN(rightNum)) { + rightNum = 50; + leftNum = 50; + } + if (this.sliderOrientation === Orientation.horizontal) { + return direction === Direction.rtl ? `right: ${leftNum}%; left: ${rightNum}%;` : `left: ${leftNum}%; right: ${rightNum}%;`; + } else { + return `top: ${leftNum}%; bottom: ${rightNum}%;`; + } + }; + } + positionChanged() { + this.positionStyle = this.positionAsStyle(); + } + /** + * @internal + */ + sliderOrientationChanged() { + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.getSliderConfiguration(); + this.positionStyle = this.positionAsStyle(); + this.notifier = Observable.getNotifier(this.parentNode); + this.notifier.subscribe(this, "orientation"); + this.notifier.subscribe(this, "direction"); + this.notifier.subscribe(this, "max"); + this.notifier.subscribe(this, "min"); + } + /** + * @internal + */ + disconnectedCallback() { + super.disconnectedCallback(); + this.notifier.unsubscribe(this, "orientation"); + this.notifier.unsubscribe(this, "direction"); + this.notifier.unsubscribe(this, "max"); + this.notifier.unsubscribe(this, "min"); + } + /** + * @internal + */ + handleChange(source, propertyName) { + switch (propertyName) { + case "direction": + this.sliderDirection = source.direction; + break; + case "orientation": + this.sliderOrientation = source.orientation; + break; + case "max": + this.sliderMaxPosition = source.max; + break; + case "min": + this.sliderMinPosition = source.min; + break; + default: + break; + } + this.positionStyle = this.positionAsStyle(); + } + isSliderConfig(node) { + return node.max !== void 0 && node.min !== void 0; + } + }; + __decorate([ + observable + ], SliderLabel.prototype, "positionStyle", void 0); + __decorate([ + attr + ], SliderLabel.prototype, "position", void 0); + __decorate([ + attr({ attribute: "hide-mark", mode: "boolean" }) + ], SliderLabel.prototype, "hideMark", void 0); + __decorate([ + attr({ attribute: "disabled", mode: "boolean" }) + ], SliderLabel.prototype, "disabled", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderOrientation", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMinPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderMaxPosition", void 0); + __decorate([ + observable + ], SliderLabel.prototype, "sliderDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js + var init_slider_label2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider-label/index.js"() { + init_slider_label_template(); + init_slider_label(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js + var init_slider_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js + var _Slider, FormAssociatedSlider; + var init_slider_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Slider = class extends FoundationElement { + }; + FormAssociatedSlider = class extends FormAssociated(_Slider) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js + var SliderMode, Slider; + var init_slider = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/slider.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_slider_utilities(); + init_slider_form_associated(); + SliderMode = { + singleValue: "single-value" + }; + Slider = class extends FormAssociatedSlider { + constructor() { + super(...arguments); + this.direction = Direction.ltr; + this.isDragging = false; + this.trackWidth = 0; + this.trackMinWidth = 0; + this.trackHeight = 0; + this.trackLeft = 0; + this.trackMinHeight = 0; + this.valueTextFormatter = () => null; + this.min = 0; + this.max = 10; + this.step = 1; + this.orientation = Orientation.horizontal; + this.mode = SliderMode.singleValue; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + if (e.key === keyHome) { + e.preventDefault(); + this.value = `${this.min}`; + } else if (e.key === keyEnd) { + e.preventDefault(); + this.value = `${this.max}`; + } else if (!e.shiftKey) { + switch (e.key) { + case keyArrowRight: + case keyArrowUp: + e.preventDefault(); + this.increment(); + break; + case keyArrowLeft: + case keyArrowDown: + e.preventDefault(); + this.decrement(); + break; + } + } + }; + this.setupTrackConstraints = () => { + const clientRect = this.track.getBoundingClientRect(); + this.trackWidth = this.track.clientWidth; + this.trackMinWidth = this.track.clientLeft; + this.trackHeight = clientRect.bottom; + this.trackMinHeight = clientRect.top; + this.trackLeft = this.getBoundingClientRect().left; + if (this.trackWidth === 0) { + this.trackWidth = 1; + } + }; + this.setupListeners = (remove = false) => { + const eventAction = `${remove ? "remove" : "add"}EventListener`; + this[eventAction]("keydown", this.keypressHandler); + this[eventAction]("mousedown", this.handleMouseDown); + this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { + passive: true + }); + this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { + passive: true + }); + if (remove) { + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + } + }; + this.initialValue = ""; + this.handleThumbMouseDown = (event) => { + if (event) { + if (this.readOnly || this.disabled || event.defaultPrevented) { + return; + } + event.target.focus(); + } + const eventAction = `${event !== null ? "add" : "remove"}EventListener`; + window[eventAction]("mouseup", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchmove", this.handleMouseMove, { passive: true }); + window[eventAction]("touchend", this.handleWindowMouseUp); + this.isDragging = event !== null; + }; + this.handleMouseMove = (e) => { + if (this.readOnly || this.disabled || e.defaultPrevented) { + return; + } + const sourceEvent = window.TouchEvent && e instanceof TouchEvent ? e.touches[0] : e; + const eventValue = this.orientation === Orientation.horizontal ? sourceEvent.pageX - document.documentElement.scrollLeft - this.trackLeft : sourceEvent.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(eventValue)}`; + }; + this.calculateNewValue = (rawValue) => { + const newPosition = convertPixelToPercent(rawValue, this.orientation === Orientation.horizontal ? this.trackMinWidth : this.trackMinHeight, this.orientation === Orientation.horizontal ? this.trackWidth : this.trackHeight, this.direction); + const newValue = (this.max - this.min) * newPosition + this.min; + return this.convertToConstrainedValue(newValue); + }; + this.handleWindowMouseUp = (event) => { + this.stopDragging(); + }; + this.stopDragging = () => { + this.isDragging = false; + this.handleMouseDown(null); + this.handleThumbMouseDown(null); + }; + this.handleMouseDown = (e) => { + const eventAction = `${e !== null ? "add" : "remove"}EventListener`; + if (e === null || !this.disabled && !this.readOnly) { + window[eventAction]("mouseup", this.handleWindowMouseUp); + window.document[eventAction]("mouseleave", this.handleWindowMouseUp); + window[eventAction]("mousemove", this.handleMouseMove); + if (e) { + e.preventDefault(); + this.setupTrackConstraints(); + e.target.focus(); + const controlValue = this.orientation === Orientation.horizontal ? e.pageX - document.documentElement.scrollLeft - this.trackLeft : e.pageY - document.documentElement.scrollTop; + this.value = `${this.calculateNewValue(controlValue)}`; + } + } + }; + this.convertToConstrainedValue = (value) => { + if (isNaN(value)) { + value = this.min; + } + let constrainedValue = value - this.min; + const roundedConstrainedValue = Math.round(constrainedValue / this.step); + const remainderValue = constrainedValue - roundedConstrainedValue * (this.stepMultiplier * this.step) / this.stepMultiplier; + constrainedValue = remainderValue >= Number(this.step) / 2 ? constrainedValue - remainderValue + Number(this.step) : constrainedValue - remainderValue; + return constrainedValue + this.min; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + } + /** + * The value property, typed as a number. + * + * @public + */ + get valueAsNumber() { + return parseFloat(super.value); + } + set valueAsNumber(next) { + this.value = next.toString(); + } + /** + * @internal + */ + valueChanged(previous, next) { + super.valueChanged(previous, next); + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + this.$emit("change"); + } + minChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.min = `${this.min}`; + } + this.validate(); + } + maxChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.max = `${this.max}`; + } + this.validate(); + } + stepChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.step = `${this.step}`; + } + this.updateStepMultiplier(); + this.validate(); + } + orientationChanged() { + if (this.$fastController.isConnected) { + this.setThumbPositionForOrientation(this.direction); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.proxy.setAttribute("type", "range"); + this.direction = getDirection(this); + this.updateStepMultiplier(); + this.setupTrackConstraints(); + this.setupListeners(); + this.setupDefaultValue(); + this.setThumbPositionForOrientation(this.direction); + } + /** + * @internal + */ + disconnectedCallback() { + this.setupListeners(true); + } + /** + * Increment the value by the step + * + * @public + */ + increment() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step); + const incrementedVal = this.convertToConstrainedValue(newVal); + const incrementedValString = incrementedVal < Number(this.max) ? `${incrementedVal}` : `${this.max}`; + this.value = incrementedValString; + } + /** + * Decrement the value by the step + * + * @public + */ + decrement() { + const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step); + const decrementedVal = this.convertToConstrainedValue(newVal); + const decrementedValString = decrementedVal > Number(this.min) ? `${decrementedVal}` : `${this.min}`; + this.value = decrementedValString; + } + /** + * Places the thumb based on the current value + * + * @public + * @param direction - writing mode + */ + setThumbPositionForOrientation(direction) { + const newPct = convertPixelToPercent(Number(this.value), Number(this.min), Number(this.max), direction); + const percentage = (1 - newPct) * 100; + if (this.orientation === Orientation.horizontal) { + this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`; + } else { + this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`; + } + } + /** + * Update the step multiplier used to ensure rounding errors from steps that + * are not whole numbers + */ + updateStepMultiplier() { + const stepString = this.step + ""; + const decimalPlacesOfStep = !!(this.step % 1) ? stepString.length - stepString.indexOf(".") - 1 : 0; + this.stepMultiplier = Math.pow(10, decimalPlacesOfStep); + } + get midpoint() { + return `${this.convertToConstrainedValue((this.max + this.min) / 2)}`; + } + setupDefaultValue() { + if (typeof this.value === "string") { + if (this.value.length === 0) { + this.initialValue = this.midpoint; + } else { + const value = parseFloat(this.value); + if (!Number.isNaN(value) && (value < this.min || value > this.max)) { + this.value = this.midpoint; + } + } + } + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Slider.prototype, "readOnly", void 0); + __decorate([ + observable + ], Slider.prototype, "direction", void 0); + __decorate([ + observable + ], Slider.prototype, "isDragging", void 0); + __decorate([ + observable + ], Slider.prototype, "position", void 0); + __decorate([ + observable + ], Slider.prototype, "trackWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinWidth", void 0); + __decorate([ + observable + ], Slider.prototype, "trackHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "trackLeft", void 0); + __decorate([ + observable + ], Slider.prototype, "trackMinHeight", void 0); + __decorate([ + observable + ], Slider.prototype, "valueTextFormatter", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "min", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "max", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], Slider.prototype, "step", void 0); + __decorate([ + attr + ], Slider.prototype, "orientation", void 0); + __decorate([ + attr + ], Slider.prototype, "mode", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js + var init_slider2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/slider/index.js"() { + init_slider_template(); + init_slider(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js + var init_switch_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js + var _Switch, FormAssociatedSwitch; + var init_switch_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _Switch = class extends FoundationElement { + }; + FormAssociatedSwitch = class extends CheckableFormAssociated(_Switch) { + constructor() { + super(...arguments); + this.proxy = document.createElement("input"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js + var Switch; + var init_switch = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/switch.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_switch_form_associated(); + Switch = class extends FormAssociatedSwitch { + constructor() { + super(); + this.initialValue = "on"; + this.keypressHandler = (e) => { + if (this.readOnly) { + return; + } + switch (e.key) { + case keyEnter: + case keySpace: + this.checked = !this.checked; + break; + } + }; + this.clickHandler = (e) => { + if (!this.disabled && !this.readOnly) { + this.checked = !this.checked; + } + }; + this.proxy.setAttribute("type", "checkbox"); + } + readOnlyChanged() { + if (this.proxy instanceof HTMLInputElement) { + this.proxy.readOnly = this.readOnly; + } + this.readOnly ? this.classList.add("readonly") : this.classList.remove("readonly"); + } + /** + * @internal + */ + checkedChanged(prev, next) { + super.checkedChanged(prev, next); + this.checked ? this.classList.add("checked") : this.classList.remove("checked"); + } + }; + __decorate([ + attr({ attribute: "readonly", mode: "boolean" }) + ], Switch.prototype, "readOnly", void 0); + __decorate([ + observable + ], Switch.prototype, "defaultSlottedNodes", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js + var init_switch2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/switch/index.js"() { + init_switch_template(); + init_switch(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js + var tabPanelTemplate; + var init_tab_panel_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.template.js"() { + init_esm(); + tabPanelTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js + var TabPanel; + var init_tab_panel = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/tab-panel.js"() { + init_foundation_element(); + TabPanel = class extends FoundationElement { + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js + var init_tab_panel2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab-panel/index.js"() { + init_tab_panel_template(); + init_tab_panel(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js + var tabTemplate; + var init_tab_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.template.js"() { + init_esm(); + tabTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js + var Tab; + var init_tab = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/tab.js"() { + init_tslib_es6(); + init_esm(); + init_foundation_element(); + Tab = class extends FoundationElement { + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tab.prototype, "disabled", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js + var init_tab2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tab/index.js"() { + init_tab_template(); + init_tab(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js + var tabsTemplate; + var init_tabs_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.template.js"() { + init_esm(); + init_start_end(); + tabsTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js + var TabsOrientation, Tabs; + var init_tabs = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/tabs.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TabsOrientation = { + vertical: "vertical", + horizontal: "horizontal" + }; + Tabs = class extends FoundationElement { + constructor() { + super(...arguments); + this.orientation = TabsOrientation.horizontal; + this.activeindicator = true; + this.showActiveIndicator = true; + this.prevActiveTabIndex = 0; + this.activeTabIndex = 0; + this.ticking = false; + this.change = () => { + this.$emit("change", this.activetab); + }; + this.isDisabledElement = (el2) => { + return el2.getAttribute("aria-disabled") === "true"; + }; + this.isHiddenElement = (el2) => { + return el2.hasAttribute("hidden"); + }; + this.isFocusableElement = (el2) => { + return !this.isDisabledElement(el2) && !this.isHiddenElement(el2); + }; + this.setTabs = () => { + const gridHorizontalProperty = "gridColumn"; + const gridVerticalProperty = "gridRow"; + const gridProperty = this.isHorizontal() ? gridHorizontalProperty : gridVerticalProperty; + this.activeTabIndex = this.getActiveIndex(); + this.showActiveIndicator = false; + this.tabs.forEach((tab, index) => { + if (tab.slot === "tab") { + const isActiveTab = this.activeTabIndex === index && this.isFocusableElement(tab); + if (this.activeindicator && this.isFocusableElement(tab)) { + this.showActiveIndicator = true; + } + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tab.setAttribute("id", tabId); + tab.setAttribute("aria-selected", isActiveTab ? "true" : "false"); + tab.setAttribute("aria-controls", tabpanelId); + tab.addEventListener("click", this.handleTabClick); + tab.addEventListener("keydown", this.handleTabKeyDown); + tab.setAttribute("tabindex", isActiveTab ? "0" : "-1"); + if (isActiveTab) { + this.activetab = tab; + this.activeid = tabId; + } + } + tab.style[gridHorizontalProperty] = ""; + tab.style[gridVerticalProperty] = ""; + tab.style[gridProperty] = `${index + 1}`; + !this.isHorizontal() ? tab.classList.add("vertical") : tab.classList.remove("vertical"); + }); + }; + this.setTabPanels = () => { + this.tabpanels.forEach((tabpanel, index) => { + const tabId = this.tabIds[index]; + const tabpanelId = this.tabpanelIds[index]; + tabpanel.setAttribute("id", tabpanelId); + tabpanel.setAttribute("aria-labelledby", tabId); + this.activeTabIndex !== index ? tabpanel.setAttribute("hidden", "") : tabpanel.removeAttribute("hidden"); + }); + }; + this.handleTabClick = (event) => { + const selectedTab = event.currentTarget; + if (selectedTab.nodeType === 1 && this.isFocusableElement(selectedTab)) { + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = this.tabs.indexOf(selectedTab); + this.setComponent(); + } + }; + this.handleTabKeyDown = (event) => { + if (this.isHorizontal()) { + switch (event.key) { + case keyArrowLeft: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowRight: + event.preventDefault(); + this.adjustForward(event); + break; + } + } else { + switch (event.key) { + case keyArrowUp: + event.preventDefault(); + this.adjustBackward(event); + break; + case keyArrowDown: + event.preventDefault(); + this.adjustForward(event); + break; + } + } + switch (event.key) { + case keyHome: + event.preventDefault(); + this.adjust(-this.activeTabIndex); + break; + case keyEnd: + event.preventDefault(); + this.adjust(this.tabs.length - this.activeTabIndex - 1); + break; + } + }; + this.adjustForward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) + 1 : 1; + if (index === group.length) { + index = 0; + } + while (index < group.length && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (this.activetab && index === group.indexOf(this.activetab)) { + break; + } else if (index + 1 >= group.length) { + index = 0; + } else { + index += 1; + } + } + }; + this.adjustBackward = (e) => { + const group = this.tabs; + let index = 0; + index = this.activetab ? group.indexOf(this.activetab) - 1 : 0; + index = index < 0 ? group.length - 1 : index; + while (index >= 0 && group.length > 1) { + if (this.isFocusableElement(group[index])) { + this.moveToTabByIndex(group, index); + break; + } else if (index - 1 < 0) { + index = group.length - 1; + } else { + index -= 1; + } + } + }; + this.moveToTabByIndex = (group, index) => { + const tab = group[index]; + this.activetab = tab; + this.prevActiveTabIndex = this.activeTabIndex; + this.activeTabIndex = index; + tab.focus(); + this.setComponent(); + }; + } + /** + * @internal + */ + orientationChanged() { + if (this.$fastController.isConnected) { + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + activeidChanged(oldValue, newValue) { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.prevActiveTabIndex = this.tabs.findIndex((item) => item.id === oldValue); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabsChanged() { + if (this.$fastController.isConnected && this.tabs.length <= this.tabpanels.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + /** + * @internal + */ + tabpanelsChanged() { + if (this.$fastController.isConnected && this.tabpanels.length <= this.tabs.length) { + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.setTabs(); + this.setTabPanels(); + this.handleActiveIndicatorPosition(); + } + } + getActiveIndex() { + const id = this.activeid; + if (id !== void 0) { + return this.tabIds.indexOf(this.activeid) === -1 ? 0 : this.tabIds.indexOf(this.activeid); + } else { + return 0; + } + } + getTabIds() { + return this.tabs.map((tab) => { + var _a; + return (_a = tab.getAttribute("id")) !== null && _a !== void 0 ? _a : `tab-${uniqueId()}`; + }); + } + getTabPanelIds() { + return this.tabpanels.map((tabPanel) => { + var _a; + return (_a = tabPanel.getAttribute("id")) !== null && _a !== void 0 ? _a : `panel-${uniqueId()}`; + }); + } + setComponent() { + if (this.activeTabIndex !== this.prevActiveTabIndex) { + this.activeid = this.tabIds[this.activeTabIndex]; + this.focusTab(); + this.change(); + } + } + isHorizontal() { + return this.orientation === TabsOrientation.horizontal; + } + handleActiveIndicatorPosition() { + if (this.showActiveIndicator && this.activeindicator && this.activeTabIndex !== this.prevActiveTabIndex) { + if (this.ticking) { + this.ticking = false; + } else { + this.ticking = true; + this.animateActiveIndicator(); + } + } + } + animateActiveIndicator() { + this.ticking = true; + const gridProperty = this.isHorizontal() ? "gridColumn" : "gridRow"; + const translateProperty = this.isHorizontal() ? "translateX" : "translateY"; + const offsetProperty = this.isHorizontal() ? "offsetLeft" : "offsetTop"; + const prev = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + const next = this.activeIndicatorRef[offsetProperty]; + this.activeIndicatorRef.style[gridProperty] = `${this.prevActiveTabIndex + 1}`; + const dif = next - prev; + this.activeIndicatorRef.style.transform = `${translateProperty}(${dif}px)`; + this.activeIndicatorRef.classList.add("activeIndicatorTransition"); + this.activeIndicatorRef.addEventListener("transitionend", () => { + this.ticking = false; + this.activeIndicatorRef.style[gridProperty] = `${this.activeTabIndex + 1}`; + this.activeIndicatorRef.style.transform = `${translateProperty}(0px)`; + this.activeIndicatorRef.classList.remove("activeIndicatorTransition"); + }); + } + /** + * The adjust method for FASTTabs + * @public + * @remarks + * This method allows the active index to be adjusted by numerical increments + */ + adjust(adjustment) { + const focusableTabs = this.tabs.filter((t) => this.isFocusableElement(t)); + const currentActiveTabIndex = focusableTabs.indexOf(this.activetab); + const nextTabIndex = limit(0, focusableTabs.length - 1, currentActiveTabIndex + adjustment); + const nextIndex = this.tabs.indexOf(focusableTabs[nextTabIndex]); + if (nextIndex > -1) { + this.moveToTabByIndex(this.tabs, nextIndex); + } + } + focusTab() { + this.tabs[this.activeTabIndex].focus(); + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.tabIds = this.getTabIds(); + this.tabpanelIds = this.getTabPanelIds(); + this.activeTabIndex = this.getActiveIndex(); + } + }; + __decorate([ + attr + ], Tabs.prototype, "orientation", void 0); + __decorate([ + attr + ], Tabs.prototype, "activeid", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabs", void 0); + __decorate([ + observable + ], Tabs.prototype, "tabpanels", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], Tabs.prototype, "activeindicator", void 0); + __decorate([ + observable + ], Tabs.prototype, "activeIndicatorRef", void 0); + __decorate([ + observable + ], Tabs.prototype, "showActiveIndicator", void 0); + applyMixins(Tabs, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js + var init_tabs2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tabs/index.js"() { + init_tabs_template(); + init_tabs(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js + var _TextArea, FormAssociatedTextArea; + var init_text_area_form_associated = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.form-associated.js"() { + init_form_associated(); + init_foundation_element(); + _TextArea = class extends FoundationElement { + }; + FormAssociatedTextArea = class extends FormAssociated(_TextArea) { + constructor() { + super(...arguments); + this.proxy = document.createElement("textarea"); + } + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js + var TextAreaResize; + var init_text_area_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.options.js"() { + TextAreaResize = { + /** + * No resize. + */ + none: "none", + /** + * Resize vertically and horizontally. + */ + both: "both", + /** + * Resize horizontally. + */ + horizontal: "horizontal", + /** + * Resize vertically. + */ + vertical: "vertical" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js + var TextArea; + var init_text_area = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.js"() { + init_tslib_es6(); + init_esm(); + init_text_field(); + init_apply_mixins(); + init_text_area_form_associated(); + init_text_area_options(); + TextArea = class extends FormAssociatedTextArea { + constructor() { + super(...arguments); + this.resize = TextAreaResize.none; + this.cols = 20; + this.handleTextInput = () => { + this.value = this.control.value; + }; + } + readOnlyChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.readOnly = this.readOnly; + } + } + autofocusChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.autofocus = this.autofocus; + } + } + listChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.setAttribute("list", this.list); + } + } + maxlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.maxLength = this.maxlength; + } + } + minlengthChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.minLength = this.minlength; + } + } + spellcheckChanged() { + if (this.proxy instanceof HTMLTextAreaElement) { + this.proxy.spellcheck = this.spellcheck; + } + } + /** + * Selects all the text in the text area + * + * @public + */ + select() { + this.control.select(); + this.$emit("select"); + } + /** + * Change event handler for inner control. + * @remarks + * "Change" events are not `composable` so they will not + * permeate the shadow DOM boundary. This fn effectively proxies + * the change event, emitting a `change` event whenever the internal + * control emits a `change` event + * @internal + */ + handleChange() { + this.$emit("change"); + } + /** {@inheritDoc (FormAssociated:interface).validate} */ + validate() { + super.validate(this.control); + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "readOnly", void 0); + __decorate([ + attr + ], TextArea.prototype, "resize", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "autofocus", void 0); + __decorate([ + attr({ attribute: "form" }) + ], TextArea.prototype, "formId", void 0); + __decorate([ + attr + ], TextArea.prototype, "list", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "maxlength", void 0); + __decorate([ + attr({ converter: nullableNumberConverter }) + ], TextArea.prototype, "minlength", void 0); + __decorate([ + attr + ], TextArea.prototype, "name", void 0); + __decorate([ + attr + ], TextArea.prototype, "placeholder", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "cols", void 0); + __decorate([ + attr({ converter: nullableNumberConverter, mode: "fromView" }) + ], TextArea.prototype, "rows", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TextArea.prototype, "spellcheck", void 0); + __decorate([ + observable + ], TextArea.prototype, "defaultSlottedNodes", void 0); + applyMixins(TextArea, DelegatesARIATextbox); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js + var textAreaTemplate; + var init_text_area_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/text-area.template.js"() { + init_esm(); + init_text_area(); + textAreaTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js + var init_text_area2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-area/index.js"() { + init_text_area_template(); + init_text_area(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js + var textFieldTemplate; + var init_text_field_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/text-field.template.js"() { + init_esm(); + init_start_end(); + init_whitespace_filter(); + textFieldTemplate = (context, definition) => html` + +`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js + var init_text_field2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/text-field/index.js"() { + init_text_field_template(); + init_text_field(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js + var init_toolbar_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js + function getRootActiveElement(element) { + const rootNode = element.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.activeElement; + } + return document.activeElement; + } + var init_root_active_element = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/root-active-element.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js + var ToolbarArrowKeyMap, Toolbar, DelegatesARIAToolbar; + var init_toolbar = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/toolbar.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_index_esm(); + init_foundation_element(); + init_aria_global(); + init_start_end(); + init_apply_mixins(); + init_direction(); + init_root_active_element(); + ToolbarArrowKeyMap = Object.freeze({ + [ArrowKeys.ArrowUp]: { + [Orientation.vertical]: -1 + }, + [ArrowKeys.ArrowDown]: { + [Orientation.vertical]: 1 + }, + [ArrowKeys.ArrowLeft]: { + [Orientation.horizontal]: { + [Direction.ltr]: -1, + [Direction.rtl]: 1 + } + }, + [ArrowKeys.ArrowRight]: { + [Orientation.horizontal]: { + [Direction.ltr]: 1, + [Direction.rtl]: -1 + } + } + }); + Toolbar = class _Toolbar extends FoundationElement { + constructor() { + super(...arguments); + this._activeIndex = 0; + this.direction = Direction.ltr; + this.orientation = Orientation.horizontal; + } + /** + * The index of the currently focused element, clamped between 0 and the last element. + * + * @internal + */ + get activeIndex() { + Observable.track(this, "activeIndex"); + return this._activeIndex; + } + set activeIndex(value) { + if (this.$fastController.isConnected) { + this._activeIndex = limit(0, this.focusableElements.length - 1, value); + Observable.notify(this, "activeIndex"); + } + } + slottedItemsChanged() { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * Set the activeIndex when a focusable element in the toolbar is clicked. + * + * @internal + */ + mouseDownHandler(e) { + var _a; + const activeIndex = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a.findIndex((x) => x.contains(e.target)); + if (activeIndex > -1 && this.activeIndex !== activeIndex) { + this.setFocusedElement(activeIndex); + } + return true; + } + childItemsChanged(prev, next) { + if (this.$fastController.isConnected) { + this.reduceFocusableElements(); + } + } + /** + * @internal + */ + connectedCallback() { + super.connectedCallback(); + this.direction = getDirection(this); + } + /** + * When the toolbar receives focus, set the currently active element as focused. + * + * @internal + */ + focusinHandler(e) { + const relatedTarget = e.relatedTarget; + if (!relatedTarget || this.contains(relatedTarget)) { + return; + } + this.setFocusedElement(); + } + /** + * Determines a value that can be used to iterate a list with the arrow keys. + * + * @param this - An element with an orientation and direction + * @param key - The event key value + * @internal + */ + getDirectionalIncrementer(key) { + var _a, _b, _c, _d, _e; + return (_e = (_c = (_b = (_a = ToolbarArrowKeyMap[key]) === null || _a === void 0 ? void 0 : _a[this.orientation]) === null || _b === void 0 ? void 0 : _b[this.direction]) !== null && _c !== void 0 ? _c : (_d = ToolbarArrowKeyMap[key]) === null || _d === void 0 ? void 0 : _d[this.orientation]) !== null && _e !== void 0 ? _e : 0; + } + /** + * Handle keyboard events for the toolbar. + * + * @internal + */ + keydownHandler(e) { + const key = e.key; + if (!(key in ArrowKeys) || e.defaultPrevented || e.shiftKey) { + return true; + } + const incrementer = this.getDirectionalIncrementer(key); + if (!incrementer) { + return !e.target.closest("[role=radiogroup]"); + } + const nextIndex = this.activeIndex + incrementer; + if (this.focusableElements[nextIndex]) { + e.preventDefault(); + } + this.setFocusedElement(nextIndex); + return true; + } + /** + * get all the slotted elements + * @internal + */ + get allSlottedItems() { + return [ + ...this.start.assignedElements(), + ...this.slottedItems, + ...this.end.assignedElements() + ]; + } + /** + * Prepare the slotted elements which can be focusable. + * + * @internal + */ + reduceFocusableElements() { + var _a; + const previousFocusedElement = (_a = this.focusableElements) === null || _a === void 0 ? void 0 : _a[this.activeIndex]; + this.focusableElements = this.allSlottedItems.reduce(_Toolbar.reduceFocusableItems, []); + const adjustedActiveIndex = this.focusableElements.indexOf(previousFocusedElement); + this.activeIndex = Math.max(0, adjustedActiveIndex); + this.setFocusableElements(); + } + /** + * Set the activeIndex and focus the corresponding control. + * + * @param activeIndex - The new index to set + * @internal + */ + setFocusedElement(activeIndex = this.activeIndex) { + this.activeIndex = activeIndex; + this.setFocusableElements(); + if (this.focusableElements[this.activeIndex] && // Don't focus the toolbar element if some event handlers moved + // the focus on another element in the page. + this.contains(getRootActiveElement(this))) { + this.focusableElements[this.activeIndex].focus(); + } + } + /** + * Reduce a collection to only its focusable elements. + * + * @param elements - Collection of elements to reduce + * @param element - The current element + * + * @internal + */ + static reduceFocusableItems(elements2, element) { + var _a, _b, _c, _d; + const isRoleRadio = element.getAttribute("role") === "radio"; + const isFocusableFastElement = (_b = (_a = element.$fastController) === null || _a === void 0 ? void 0 : _a.definition.shadowOptions) === null || _b === void 0 ? void 0 : _b.delegatesFocus; + const hasFocusableShadow = Array.from((_d = (_c = element.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelectorAll("*")) !== null && _d !== void 0 ? _d : []).some((x) => isFocusable(x)); + if (!element.hasAttribute("disabled") && !element.hasAttribute("hidden") && (isFocusable(element) || isRoleRadio || isFocusableFastElement || hasFocusableShadow)) { + elements2.push(element); + return elements2; + } + if (element.childElementCount) { + return elements2.concat(Array.from(element.children).reduce(_Toolbar.reduceFocusableItems, [])); + } + return elements2; + } + /** + * @internal + */ + setFocusableElements() { + if (this.$fastController.isConnected && this.focusableElements.length > 0) { + this.focusableElements.forEach((element, index) => { + element.tabIndex = this.activeIndex === index ? 0 : -1; + }); + } + } + }; + __decorate([ + observable + ], Toolbar.prototype, "direction", void 0); + __decorate([ + attr + ], Toolbar.prototype, "orientation", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedItems", void 0); + __decorate([ + observable + ], Toolbar.prototype, "slottedLabel", void 0); + __decorate([ + observable + ], Toolbar.prototype, "childItems", void 0); + DelegatesARIAToolbar = class { + }; + __decorate([ + attr({ attribute: "aria-labelledby" }) + ], DelegatesARIAToolbar.prototype, "ariaLabelledby", void 0); + __decorate([ + attr({ attribute: "aria-label" }) + ], DelegatesARIAToolbar.prototype, "ariaLabel", void 0); + applyMixins(DelegatesARIAToolbar, ARIAGlobalStatesAndProperties); + applyMixins(Toolbar, StartEnd, DelegatesARIAToolbar); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js + var init_toolbar2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/toolbar/index.js"() { + init_toolbar_template(); + init_toolbar(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js + var init_tooltip_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js + var TooltipPosition; + var init_tooltip_options = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.options.js"() { + TooltipPosition = { + /** + * The tooltip is positioned above the element + */ + top: "top", + /** + * The tooltip is positioned to the right of the element + */ + right: "right", + /** + * The tooltip is positioned below the element + */ + bottom: "bottom", + /** + * The tooltip is positioned to the left of the element + */ + left: "left", + /** + * The tooltip is positioned before the element + */ + start: "start", + /** + * The tooltip is positioned after the element + */ + end: "end", + /** + * The tooltip is positioned above the element and to the left + */ + topLeft: "top-left", + /** + * The tooltip is positioned above the element and to the right + */ + topRight: "top-right", + /** + * The tooltip is positioned below the element and to the left + */ + bottomLeft: "bottom-left", + /** + * The tooltip is positioned below the element and to the right + */ + bottomRight: "bottom-right", + /** + * The tooltip is positioned above the element and to the left + */ + topStart: "top-start", + /** + * The tooltip is positioned above the element and to the right + */ + topEnd: "top-end", + /** + * The tooltip is positioned below the element and to the left + */ + bottomStart: "bottom-start", + /** + * The tooltip is positioned below the element and to the right + */ + bottomEnd: "bottom-end" + }; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js + var Tooltip; + var init_tooltip = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/tooltip.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_direction(); + init_foundation_element(); + init_tooltip_options(); + Tooltip = class extends FoundationElement { + constructor() { + super(...arguments); + this.anchor = ""; + this.delay = 300; + this.autoUpdateMode = "anchor"; + this.anchorElement = null; + this.viewportElement = null; + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.horizontalInset = "false"; + this.verticalInset = "false"; + this.horizontalScaling = "content"; + this.verticalScaling = "content"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = void 0; + this.tooltipVisible = false; + this.currentDirection = Direction.ltr; + this.showDelayTimer = null; + this.hideDelayTimer = null; + this.isAnchorHoveredFocused = false; + this.isRegionHovered = false; + this.handlePositionChange = (ev) => { + this.classList.toggle("top", this.region.verticalPosition === "start"); + this.classList.toggle("bottom", this.region.verticalPosition === "end"); + this.classList.toggle("inset-top", this.region.verticalPosition === "insetStart"); + this.classList.toggle("inset-bottom", this.region.verticalPosition === "insetEnd"); + this.classList.toggle("center-vertical", this.region.verticalPosition === "center"); + this.classList.toggle("left", this.region.horizontalPosition === "start"); + this.classList.toggle("right", this.region.horizontalPosition === "end"); + this.classList.toggle("inset-left", this.region.horizontalPosition === "insetStart"); + this.classList.toggle("inset-right", this.region.horizontalPosition === "insetEnd"); + this.classList.toggle("center-horizontal", this.region.horizontalPosition === "center"); + }; + this.handleRegionMouseOver = (ev) => { + this.isRegionHovered = true; + }; + this.handleRegionMouseOut = (ev) => { + this.isRegionHovered = false; + this.startHideDelayTimer(); + }; + this.handleAnchorMouseOver = (ev) => { + if (this.tooltipVisible) { + this.isAnchorHoveredFocused = true; + return; + } + this.startShowDelayTimer(); + }; + this.handleAnchorMouseOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.handleAnchorFocusIn = (ev) => { + this.startShowDelayTimer(); + }; + this.handleAnchorFocusOut = (ev) => { + this.isAnchorHoveredFocused = false; + this.clearShowDelayTimer(); + this.startHideDelayTimer(); + }; + this.startHideDelayTimer = () => { + this.clearHideDelayTimer(); + if (!this.tooltipVisible) { + return; + } + this.hideDelayTimer = window.setTimeout(() => { + this.updateTooltipVisibility(); + }, 60); + }; + this.clearHideDelayTimer = () => { + if (this.hideDelayTimer !== null) { + clearTimeout(this.hideDelayTimer); + this.hideDelayTimer = null; + } + }; + this.startShowDelayTimer = () => { + if (this.isAnchorHoveredFocused) { + return; + } + if (this.delay > 1) { + if (this.showDelayTimer === null) + this.showDelayTimer = window.setTimeout(() => { + this.startHover(); + }, this.delay); + return; + } + this.startHover(); + }; + this.startHover = () => { + this.isAnchorHoveredFocused = true; + this.updateTooltipVisibility(); + }; + this.clearShowDelayTimer = () => { + if (this.showDelayTimer !== null) { + clearTimeout(this.showDelayTimer); + this.showDelayTimer = null; + } + }; + this.getAnchor = () => { + const rootNode = this.getRootNode(); + if (rootNode instanceof ShadowRoot) { + return rootNode.getElementById(this.anchor); + } + return document.getElementById(this.anchor); + }; + this.handleDocumentKeydown = (e) => { + if (!e.defaultPrevented && this.tooltipVisible) { + switch (e.key) { + case keyEscape: + this.isAnchorHoveredFocused = false; + this.updateTooltipVisibility(); + this.$emit("dismiss"); + break; + } + } + }; + this.updateTooltipVisibility = () => { + if (this.visible === false) { + this.hideTooltip(); + } else if (this.visible === true) { + this.showTooltip(); + return; + } else { + if (this.isAnchorHoveredFocused || this.isRegionHovered) { + this.showTooltip(); + return; + } + this.hideTooltip(); + } + }; + this.showTooltip = () => { + if (this.tooltipVisible) { + return; + } + this.currentDirection = getDirection(this); + this.tooltipVisible = true; + document.addEventListener("keydown", this.handleDocumentKeydown); + DOM.queueUpdate(this.setRegionProps); + }; + this.hideTooltip = () => { + if (!this.tooltipVisible) { + return; + } + this.clearHideDelayTimer(); + if (this.region !== null && this.region !== void 0) { + this.region.removeEventListener("positionchange", this.handlePositionChange); + this.region.viewportElement = null; + this.region.anchorElement = null; + this.region.removeEventListener("mouseover", this.handleRegionMouseOver); + this.region.removeEventListener("mouseout", this.handleRegionMouseOut); + } + document.removeEventListener("keydown", this.handleDocumentKeydown); + this.tooltipVisible = false; + }; + this.setRegionProps = () => { + if (!this.tooltipVisible) { + return; + } + this.region.viewportElement = this.viewportElement; + this.region.anchorElement = this.anchorElement; + this.region.addEventListener("positionchange", this.handlePositionChange); + this.region.addEventListener("mouseover", this.handleRegionMouseOver, { + passive: true + }); + this.region.addEventListener("mouseout", this.handleRegionMouseOut, { + passive: true + }); + }; + } + visibleChanged() { + if (this.$fastController.isConnected) { + this.updateTooltipVisibility(); + this.updateLayout(); + } + } + anchorChanged() { + if (this.$fastController.isConnected) { + this.anchorElement = this.getAnchor(); + } + } + positionChanged() { + if (this.$fastController.isConnected) { + this.updateLayout(); + } + } + anchorElementChanged(oldValue) { + if (this.$fastController.isConnected) { + if (oldValue !== null && oldValue !== void 0) { + oldValue.removeEventListener("mouseover", this.handleAnchorMouseOver); + oldValue.removeEventListener("mouseout", this.handleAnchorMouseOut); + oldValue.removeEventListener("focusin", this.handleAnchorFocusIn); + oldValue.removeEventListener("focusout", this.handleAnchorFocusOut); + } + if (this.anchorElement !== null && this.anchorElement !== void 0) { + this.anchorElement.addEventListener("mouseover", this.handleAnchorMouseOver, { passive: true }); + this.anchorElement.addEventListener("mouseout", this.handleAnchorMouseOut, { passive: true }); + this.anchorElement.addEventListener("focusin", this.handleAnchorFocusIn, { + passive: true + }); + this.anchorElement.addEventListener("focusout", this.handleAnchorFocusOut, { passive: true }); + const anchorId = this.anchorElement.id; + if (this.anchorElement.parentElement !== null) { + this.anchorElement.parentElement.querySelectorAll(":hover").forEach((element) => { + if (element.id === anchorId) { + this.startShowDelayTimer(); + } + }); + } + } + if (this.region !== null && this.region !== void 0 && this.tooltipVisible) { + this.region.anchorElement = this.anchorElement; + } + this.updateLayout(); + } + } + viewportElementChanged() { + if (this.region !== null && this.region !== void 0) { + this.region.viewportElement = this.viewportElement; + } + this.updateLayout(); + } + connectedCallback() { + super.connectedCallback(); + this.anchorElement = this.getAnchor(); + this.updateTooltipVisibility(); + } + disconnectedCallback() { + this.hideTooltip(); + this.clearShowDelayTimer(); + this.clearHideDelayTimer(); + super.disconnectedCallback(); + } + /** + * updated the properties being passed to the anchored region + */ + updateLayout() { + this.verticalPositioningMode = "locktodefault"; + this.horizontalPositioningMode = "locktodefault"; + switch (this.position) { + case TooltipPosition.top: + case TooltipPosition.bottom: + this.verticalDefaultPosition = this.position; + this.horizontalDefaultPosition = "center"; + break; + case TooltipPosition.right: + case TooltipPosition.left: + case TooltipPosition.start: + case TooltipPosition.end: + this.verticalDefaultPosition = "center"; + this.horizontalDefaultPosition = this.position; + break; + case TooltipPosition.topLeft: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.topRight: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.bottomLeft: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "left"; + break; + case TooltipPosition.bottomRight: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "right"; + break; + case TooltipPosition.topStart: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.topEnd: + this.verticalDefaultPosition = "top"; + this.horizontalDefaultPosition = "end"; + break; + case TooltipPosition.bottomStart: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "start"; + break; + case TooltipPosition.bottomEnd: + this.verticalDefaultPosition = "bottom"; + this.horizontalDefaultPosition = "end"; + break; + default: + this.verticalPositioningMode = "dynamic"; + this.horizontalPositioningMode = "dynamic"; + this.verticalDefaultPosition = void 0; + this.horizontalDefaultPosition = "center"; + break; + } + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], Tooltip.prototype, "visible", void 0); + __decorate([ + attr + ], Tooltip.prototype, "anchor", void 0); + __decorate([ + attr + ], Tooltip.prototype, "delay", void 0); + __decorate([ + attr + ], Tooltip.prototype, "position", void 0); + __decorate([ + attr({ attribute: "auto-update-mode" }) + ], Tooltip.prototype, "autoUpdateMode", void 0); + __decorate([ + attr({ attribute: "horizontal-viewport-lock" }) + ], Tooltip.prototype, "horizontalViewportLock", void 0); + __decorate([ + attr({ attribute: "vertical-viewport-lock" }) + ], Tooltip.prototype, "verticalViewportLock", void 0); + __decorate([ + observable + ], Tooltip.prototype, "anchorElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "viewportElement", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalPositioningMode", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalInset", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalScaling", void 0); + __decorate([ + observable + ], Tooltip.prototype, "verticalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "horizontalDefaultPosition", void 0); + __decorate([ + observable + ], Tooltip.prototype, "tooltipVisible", void 0); + __decorate([ + observable + ], Tooltip.prototype, "currentDirection", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js + var init_tooltip2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tooltip/index.js"() { + init_tooltip_template(); + init_tooltip(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js + var init_tree_item_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js + function isTreeItemElement(el2) { + return isHTMLElement(el2) && el2.getAttribute("role") === "treeitem"; + } + var TreeItem; + var init_tree_item = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/tree-item.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_start_end(); + init_apply_mixins(); + init_foundation_element(); + TreeItem = class extends FoundationElement { + constructor() { + super(...arguments); + this.expanded = false; + this.focusable = false; + this.isNestedItem = () => { + return isTreeItemElement(this.parentElement); + }; + this.handleExpandCollapseButtonClick = (e) => { + if (!this.disabled && !e.defaultPrevented) { + this.expanded = !this.expanded; + } + }; + this.handleFocus = (e) => { + this.setAttribute("tabindex", "0"); + }; + this.handleBlur = (e) => { + this.setAttribute("tabindex", "-1"); + }; + } + expandedChanged() { + if (this.$fastController.isConnected) { + this.$emit("expanded-change", this); + } + } + selectedChanged() { + if (this.$fastController.isConnected) { + this.$emit("selected-change", this); + } + } + itemsChanged(oldValue, newValue) { + if (this.$fastController.isConnected) { + this.items.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = true; + } + }); + } + } + /** + * Places document focus on a tree item + * + * @public + * @param el - the element to focus + */ + static focusItem(el2) { + el2.focusable = true; + el2.focus(); + } + /** + * Gets number of children + * + * @internal + */ + childItemLength() { + const treeChildren = this.childItems.filter((item) => { + return isTreeItemElement(item); + }); + return treeChildren ? treeChildren.length : 0; + } + }; + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "expanded", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "selected", void 0); + __decorate([ + attr({ mode: "boolean" }) + ], TreeItem.prototype, "disabled", void 0); + __decorate([ + observable + ], TreeItem.prototype, "focusable", void 0); + __decorate([ + observable + ], TreeItem.prototype, "childItems", void 0); + __decorate([ + observable + ], TreeItem.prototype, "items", void 0); + __decorate([ + observable + ], TreeItem.prototype, "nested", void 0); + __decorate([ + observable + ], TreeItem.prototype, "renderCollapsedChildren", void 0); + applyMixins(TreeItem, StartEnd); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js + var init_tree_item2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-item/index.js"() { + init_tree_item_template(); + init_tree_item(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js + var init_tree_view_template = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.template.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js + var TreeView; + var init_tree_view = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/tree-view.js"() { + init_tslib_es6(); + init_esm(); + init_dist2(); + init_tree_item(); + init_foundation_element(); + TreeView = class extends FoundationElement { + constructor() { + super(...arguments); + this.currentFocused = null; + this.handleFocus = (e) => { + if (this.slottedTreeItems.length < 1) { + return; + } + if (e.target === this) { + if (this.currentFocused === null) { + this.currentFocused = this.getValidFocusableItem(); + } + if (this.currentFocused !== null) { + TreeItem.focusItem(this.currentFocused); + } + return; + } + if (this.contains(e.target)) { + this.setAttribute("tabindex", "-1"); + this.currentFocused = e.target; + } + }; + this.handleBlur = (e) => { + if (e.target instanceof HTMLElement && (e.relatedTarget === null || !this.contains(e.relatedTarget))) { + this.setAttribute("tabindex", "0"); + } + }; + this.handleKeyDown = (e) => { + if (e.defaultPrevented) { + return; + } + if (this.slottedTreeItems.length < 1) { + return true; + } + const treeItems = this.getVisibleNodes(); + switch (e.key) { + case keyHome: + if (treeItems.length) { + TreeItem.focusItem(treeItems[0]); + } + return; + case keyEnd: + if (treeItems.length) { + TreeItem.focusItem(treeItems[treeItems.length - 1]); + } + return; + case keyArrowLeft: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && item.expanded) { + item.expanded = false; + } else if (item instanceof TreeItem && item.parentElement instanceof TreeItem) { + TreeItem.focusItem(item.parentElement); + } + } + return false; + case keyArrowRight: + if (e.target && this.isFocusableElement(e.target)) { + const item = e.target; + if (item instanceof TreeItem && item.childItemLength() > 0 && !item.expanded) { + item.expanded = true; + } else if (item instanceof TreeItem && item.childItemLength() > 0) { + this.focusNextNode(1, e.target); + } + } + return; + case keyArrowDown: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(1, e.target); + } + return; + case keyArrowUp: + if (e.target && this.isFocusableElement(e.target)) { + this.focusNextNode(-1, e.target); + } + return; + case keyEnter: + this.handleClick(e); + return; + } + return true; + }; + this.handleSelectedChange = (e) => { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (item.selected) { + if (this.currentSelected && this.currentSelected !== item) { + this.currentSelected.selected = false; + } + this.currentSelected = item; + } else if (!item.selected && this.currentSelected === item) { + this.currentSelected = null; + } + return; + }; + this.setItems = () => { + const selectedItem = this.treeView.querySelector("[aria-selected='true']"); + this.currentSelected = selectedItem; + if (this.currentFocused === null || !this.contains(this.currentFocused)) { + this.currentFocused = this.getValidFocusableItem(); + } + this.nested = this.checkForNestedItems(); + const treeItems = this.getVisibleNodes(); + treeItems.forEach((node) => { + if (isTreeItemElement(node)) { + node.nested = this.nested; + } + }); + }; + this.isFocusableElement = (el2) => { + return isTreeItemElement(el2); + }; + this.isSelectedElement = (el2) => { + return el2.selected; + }; + } + slottedTreeItemsChanged() { + if (this.$fastController.isConnected) { + this.setItems(); + } + } + connectedCallback() { + super.connectedCallback(); + this.setAttribute("tabindex", "0"); + DOM.queueUpdate(() => { + this.setItems(); + }); + } + /** + * Handles click events bubbling up + * + * @internal + */ + handleClick(e) { + if (e.defaultPrevented) { + return; + } + if (!(e.target instanceof Element) || !isTreeItemElement(e.target)) { + return true; + } + const item = e.target; + if (!item.disabled) { + item.selected = !item.selected; + } + return; + } + /** + * Move focus to a tree item based on its offset from the provided item + */ + focusNextNode(delta, item) { + const visibleNodes = this.getVisibleNodes(); + if (!visibleNodes) { + return; + } + const focusItem = visibleNodes[visibleNodes.indexOf(item) + delta]; + if (isHTMLElement(focusItem)) { + TreeItem.focusItem(focusItem); + } + } + /** + * checks if there are any nested tree items + */ + getValidFocusableItem() { + const treeItems = this.getVisibleNodes(); + let focusIndex = treeItems.findIndex(this.isSelectedElement); + if (focusIndex === -1) { + focusIndex = treeItems.findIndex(this.isFocusableElement); + } + if (focusIndex !== -1) { + return treeItems[focusIndex]; + } + return null; + } + /** + * checks if there are any nested tree items + */ + checkForNestedItems() { + return this.slottedTreeItems.some((node) => { + return isTreeItemElement(node) && node.querySelector("[role='treeitem']"); + }); + } + getVisibleNodes() { + return getDisplayedNodes(this, "[role='treeitem']") || []; + } + }; + __decorate([ + attr({ attribute: "render-collapsed-nodes" }) + ], TreeView.prototype, "renderCollapsedNodes", void 0); + __decorate([ + observable + ], TreeView.prototype, "currentSelected", void 0); + __decorate([ + observable + ], TreeView.prototype, "slottedTreeItems", void 0); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js + var init_tree_view2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/tree-view/index.js"() { + init_tree_view_template(); + init_tree_view(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js + var MatchMediaBehavior, MatchMediaStyleSheetBehavior, forcedColorsStylesheetBehavior, darkModeStylesheetBehavior, lightModeStylesheetBehavior; + var init_match_media_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/match-media-stylesheet-behavior.js"() { + MatchMediaBehavior = class { + /** + * + * @param query - The media query to operate from. + */ + constructor(query) { + this.listenerCache = /* @__PURE__ */ new WeakMap(); + this.query = query; + } + /** + * Binds the behavior to the element. + * @param source - The element for which the behavior is bound. + */ + bind(source) { + const { query } = this; + const listener = this.constructListener(source); + listener.bind(query)(); + query.addListener(listener); + this.listenerCache.set(source, listener); + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + */ + unbind(source) { + const listener = this.listenerCache.get(source); + if (listener) { + this.query.removeListener(listener); + this.listenerCache.delete(source); + } + } + }; + MatchMediaStyleSheetBehavior = class _MatchMediaStyleSheetBehavior extends MatchMediaBehavior { + /** + * Constructs a {@link MatchMediaStyleSheetBehavior} instance. + * @param query - The media query to operate from. + * @param styles - The styles to coordinate with the query. + */ + constructor(query, styles) { + super(query); + this.styles = styles; + } + /** + * Defines a function to construct {@link MatchMediaStyleSheetBehavior | MatchMediaStyleSheetBehaviors} for + * a provided query. + * @param query - The media query to operate from. + * + * @public + * @example + * + * ```ts + * import { css } from "@microsoft/fast-element"; + * import { MatchMediaStyleSheetBehavior } from "@microsoft/fast-foundation"; + * + * const landscapeBehavior = MatchMediaStyleSheetBehavior.with( + * window.matchMedia("(orientation: landscape)") + * ); + * const styles = css` + * :host { + * width: 200px; + * height: 400px; + * } + * ` + * .withBehaviors(landscapeBehavior(css` + * :host { + * width: 400px; + * height: 200px; + * } + * `)) + * ``` + */ + static with(query) { + return (styles) => { + return new _MatchMediaStyleSheetBehavior(query, styles); + }; + } + /** + * Constructs a match-media listener for a provided element. + * @param source - the element for which to attach or detach styles. + * @internal + */ + constructListener(source) { + let attached = false; + const styles = this.styles; + return function listener() { + const { matches: matches2 } = this; + if (matches2 && !attached) { + source.$fastController.addStyles(styles); + attached = matches2; + } else if (!matches2 && attached) { + source.$fastController.removeStyles(styles); + attached = matches2; + } + }; + } + /** + * Unbinds the behavior from the element. + * @param source - The element for which the behavior is unbinding. + * @internal + */ + unbind(source) { + super.unbind(source); + source.$fastController.removeStyles(this.styles); + } + }; + forcedColorsStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(forced-colors)")); + darkModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: dark)")); + lightModeStylesheetBehavior = MatchMediaStyleSheetBehavior.with(window.matchMedia("(prefers-color-scheme: light)")); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js + var init_property_stylesheet_behavior = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/property-stylesheet-behavior.js"() { + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js + var disabledCursor; + var init_disabled = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/disabled.js"() { + disabledCursor = "not-allowed"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js + function display(displayValue) { + return `${hidden}:host{display:${displayValue}}`; + } + var hidden; + var init_display = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/display.js"() { + hidden = `:host([hidden]){display:none}`; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js + var focusVisible; + var init_focus = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/focus.js"() { + init_dist2(); + focusVisible = canUseFocusVisible() ? "focus-visible" : "focus"; + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js + var init_style = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/style/index.js"() { + init_disabled(); + init_display(); + init_focus(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js + var init_utilities = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/utilities/index.js"() { + init_apply_mixins(); + init_composed_parent(); + init_match_media_stylesheet_behavior(); + init_property_stylesheet_behavior(); + init_style(); + init_direction(); + init_whitespace_filter(); + } + }); + + // node_modules/@microsoft/fast-foundation/dist/esm/index.js + var init_esm2 = __esm({ + "node_modules/@microsoft/fast-foundation/dist/esm/index.js"() { + init_accordion_item2(); + init_accordion2(); + init_anchor2(); + init_anchored_region2(); + init_avatar2(); + init_badge2(); + init_breadcrumb_item2(); + init_breadcrumb2(); + init_button2(); + init_calendar2(); + init_card2(); + init_checkbox2(); + init_combobox2(); + init_data_grid2(); + init_design_system2(); + init_design_token(); + init_di2(); + init_dialog2(); + init_disclosure2(); + init_divider2(); + init_flipper2(); + init_form_associated2(); + init_foundation_element2(); + init_listbox_option2(); + init_listbox2(); + init_picker2(); + init_menu_item2(); + init_menu2(); + init_number_field2(); + init_patterns(); + init_progress_ring(); + init_progress(); + init_radio_group2(); + init_radio2(); + init_horizontal_scroll2(); + init_search2(); + init_select2(); + init_skeleton2(); + init_slider_label2(); + init_slider2(); + init_switch2(); + init_tab_panel2(); + init_tab2(); + init_tabs2(); + init_text_area2(); + init_text_field2(); + init_toolbar2(); + init_tooltip2(); + init_tree_item2(); + init_tree_view2(); + init_utilities(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js + function provideVSCodeDesignSystem(element) { + return DesignSystem.getOrCreate(element).withPrefix("vscode"); + } + var init_vscode_design_system = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/vscode-design-system.js"() { + init_esm2(); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js + function initThemeChangeListener(tokenMappings2) { + window.addEventListener("load", () => { + const observer = new MutationObserver(() => { + applyCurrentTheme(tokenMappings2); + }); + observer.observe(document.body, { + attributes: true, + attributeFilter: ["class"] + }); + applyCurrentTheme(tokenMappings2); + }); + } + function applyCurrentTheme(tokenMappings2) { + const styles = getComputedStyle(document.body); + const body = document.querySelector("body"); + if (body) { + const themeKind = body.getAttribute("data-vscode-theme-kind"); + for (const [vscodeTokenName, toolkitToken] of tokenMappings2) { + let value = styles.getPropertyValue(vscodeTokenName).toString(); + if (themeKind === "vscode-high-contrast") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + value = "transparent"; + } + if (toolkitToken.name === "button-icon-hover-background") { + value = "transparent"; + } + } else if (themeKind === "vscode-high-contrast-light") { + if (value.length === 0 && toolkitToken.name.includes("background")) { + switch (toolkitToken.name) { + case "button-primary-hover-background": + value = "#0F4A85"; + break; + case "button-secondary-hover-background": + value = "transparent"; + break; + case "button-icon-hover-background": + value = "transparent"; + break; + } + } + } else { + if (toolkitToken.name === "contrast-active-border") { + value = "transparent"; + } + } + toolkitToken.setValueFor(body, value); + } + } + } + var init_applyTheme = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/theme/applyTheme.js"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js + function create2(name, vscodeThemeVar) { + const designToken = DesignToken.create(name); + if (vscodeThemeVar) { + if (vscodeThemeVar.includes("--fake-vscode-token")) { + const uniqueId2 = "id" + Math.random().toString(16).slice(2); + vscodeThemeVar = `${vscodeThemeVar}-${uniqueId2}`; + } + tokenMappings.set(vscodeThemeVar, designToken); + } + if (!isThemeListenerInitialized) { + initThemeChangeListener(tokenMappings); + isThemeListenerInitialized = true; + } + return designToken; + } + var tokenMappings, isThemeListenerInitialized; + var init_create = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/utilities/design-tokens/create.js"() { + init_esm2(); + init_applyTheme(); + tokenMappings = /* @__PURE__ */ new Map(); + isThemeListenerInitialized = false; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js + var background, borderWidth, contrastActiveBorder, contrastBorder, cornerRadius, cornerRadiusRound, designUnit, disabledOpacity, focusBorder, fontFamily, fontWeight, foreground, inputHeight, inputMinWidth, typeRampBaseFontSize, typeRampBaseLineHeight, typeRampMinus1FontSize, typeRampMinus1LineHeight, typeRampMinus2FontSize, typeRampMinus2LineHeight, typeRampPlus1FontSize, typeRampPlus1LineHeight, scrollbarWidth, scrollbarHeight, scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, badgeBackground, badgeForeground, buttonBorder, buttonIconBackground, buttonIconCornerRadius, buttonIconFocusBorderOffset, buttonIconHoverBackground, buttonIconPadding, buttonPrimaryBackground, buttonPrimaryForeground, buttonPrimaryHoverBackground, buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground, buttonPaddingHorizontal, buttonPaddingVertical, checkboxBackground, checkboxBorder, checkboxCornerRadius, checkboxForeground, listActiveSelectionBackground, listActiveSelectionForeground, listHoverBackground, dividerBackground, dropdownBackground, dropdownBorder, dropdownForeground, dropdownListMaxHeight, inputBackground, inputForeground, inputPlaceholderForeground, linkActiveForeground, linkForeground, progressBackground, panelTabActiveBorder, panelTabActiveForeground, panelTabForeground, panelViewBackground, panelViewBorder, tagCornerRadius; + var init_design_tokens = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/design-tokens.js"() { + init_create(); + background = create2("background", "--vscode-editor-background").withDefault("#1e1e1e"); + borderWidth = create2("border-width").withDefault(1); + contrastActiveBorder = create2("contrast-active-border", "--vscode-contrastActiveBorder").withDefault("#f38518"); + contrastBorder = create2("contrast-border", "--vscode-contrastBorder").withDefault("#6fc3df"); + cornerRadius = create2("corner-radius").withDefault(0); + cornerRadiusRound = create2("corner-radius-round").withDefault(2); + designUnit = create2("design-unit").withDefault(4); + disabledOpacity = create2("disabled-opacity").withDefault(0.4); + focusBorder = create2("focus-border", "--vscode-focusBorder").withDefault("#007fd4"); + fontFamily = create2("font-family", "--vscode-font-family").withDefault("-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol"); + fontWeight = create2("font-weight", "--vscode-font-weight").withDefault("400"); + foreground = create2("foreground", "--vscode-foreground").withDefault("#cccccc"); + inputHeight = create2("input-height").withDefault("26"); + inputMinWidth = create2("input-min-width").withDefault("100px"); + typeRampBaseFontSize = create2("type-ramp-base-font-size", "--vscode-font-size").withDefault("13px"); + typeRampBaseLineHeight = create2("type-ramp-base-line-height").withDefault("normal"); + typeRampMinus1FontSize = create2("type-ramp-minus1-font-size").withDefault("11px"); + typeRampMinus1LineHeight = create2("type-ramp-minus1-line-height").withDefault("16px"); + typeRampMinus2FontSize = create2("type-ramp-minus2-font-size").withDefault("9px"); + typeRampMinus2LineHeight = create2("type-ramp-minus2-line-height").withDefault("16px"); + typeRampPlus1FontSize = create2("type-ramp-plus1-font-size").withDefault("16px"); + typeRampPlus1LineHeight = create2("type-ramp-plus1-line-height").withDefault("24px"); + scrollbarWidth = create2("scrollbarWidth").withDefault("10px"); + scrollbarHeight = create2("scrollbarHeight").withDefault("10px"); + scrollbarSliderBackground = create2("scrollbar-slider-background", "--vscode-scrollbarSlider-background").withDefault("#79797966"); + scrollbarSliderHoverBackground = create2("scrollbar-slider-hover-background", "--vscode-scrollbarSlider-hoverBackground").withDefault("#646464b3"); + scrollbarSliderActiveBackground = create2("scrollbar-slider-active-background", "--vscode-scrollbarSlider-activeBackground").withDefault("#bfbfbf66"); + badgeBackground = create2("badge-background", "--vscode-badge-background").withDefault("#4d4d4d"); + badgeForeground = create2("badge-foreground", "--vscode-badge-foreground").withDefault("#ffffff"); + buttonBorder = create2("button-border", "--vscode-button-border").withDefault("transparent"); + buttonIconBackground = create2("button-icon-background").withDefault("transparent"); + buttonIconCornerRadius = create2("button-icon-corner-radius").withDefault("5px"); + buttonIconFocusBorderOffset = create2("button-icon-outline-offset").withDefault(0); + buttonIconHoverBackground = create2("button-icon-hover-background", "--fake-vscode-token").withDefault("rgba(90, 93, 94, 0.31)"); + buttonIconPadding = create2("button-icon-padding").withDefault("3px"); + buttonPrimaryBackground = create2("button-primary-background", "--vscode-button-background").withDefault("#0e639c"); + buttonPrimaryForeground = create2("button-primary-foreground", "--vscode-button-foreground").withDefault("#ffffff"); + buttonPrimaryHoverBackground = create2("button-primary-hover-background", "--vscode-button-hoverBackground").withDefault("#1177bb"); + buttonSecondaryBackground = create2("button-secondary-background", "--vscode-button-secondaryBackground").withDefault("#3a3d41"); + buttonSecondaryForeground = create2("button-secondary-foreground", "--vscode-button-secondaryForeground").withDefault("#ffffff"); + buttonSecondaryHoverBackground = create2("button-secondary-hover-background", "--vscode-button-secondaryHoverBackground").withDefault("#45494e"); + buttonPaddingHorizontal = create2("button-padding-horizontal").withDefault("11px"); + buttonPaddingVertical = create2("button-padding-vertical").withDefault("4px"); + checkboxBackground = create2("checkbox-background", "--vscode-checkbox-background").withDefault("#3c3c3c"); + checkboxBorder = create2("checkbox-border", "--vscode-checkbox-border").withDefault("#3c3c3c"); + checkboxCornerRadius = create2("checkbox-corner-radius").withDefault(3); + checkboxForeground = create2("checkbox-foreground", "--vscode-checkbox-foreground").withDefault("#f0f0f0"); + listActiveSelectionBackground = create2("list-active-selection-background", "--vscode-list-activeSelectionBackground").withDefault("#094771"); + listActiveSelectionForeground = create2("list-active-selection-foreground", "--vscode-list-activeSelectionForeground").withDefault("#ffffff"); + listHoverBackground = create2("list-hover-background", "--vscode-list-hoverBackground").withDefault("#2a2d2e"); + dividerBackground = create2("divider-background", "--vscode-settings-dropdownListBorder").withDefault("#454545"); + dropdownBackground = create2("dropdown-background", "--vscode-dropdown-background").withDefault("#3c3c3c"); + dropdownBorder = create2("dropdown-border", "--vscode-dropdown-border").withDefault("#3c3c3c"); + dropdownForeground = create2("dropdown-foreground", "--vscode-dropdown-foreground").withDefault("#f0f0f0"); + dropdownListMaxHeight = create2("dropdown-list-max-height").withDefault("200px"); + inputBackground = create2("input-background", "--vscode-input-background").withDefault("#3c3c3c"); + inputForeground = create2("input-foreground", "--vscode-input-foreground").withDefault("#cccccc"); + inputPlaceholderForeground = create2("input-placeholder-foreground", "--vscode-input-placeholderForeground").withDefault("#cccccc"); + linkActiveForeground = create2("link-active-foreground", "--vscode-textLink-activeForeground").withDefault("#3794ff"); + linkForeground = create2("link-foreground", "--vscode-textLink-foreground").withDefault("#3794ff"); + progressBackground = create2("progress-background", "--vscode-progressBar-background").withDefault("#0e70c0"); + panelTabActiveBorder = create2("panel-tab-active-border", "--vscode-panelTitle-activeBorder").withDefault("#e7e7e7"); + panelTabActiveForeground = create2("panel-tab-active-foreground", "--vscode-panelTitle-activeForeground").withDefault("#e7e7e7"); + panelTabForeground = create2("panel-tab-foreground", "--vscode-panelTitle-inactiveForeground").withDefault("#e7e7e799"); + panelViewBackground = create2("panel-view-background", "--vscode-panel-background").withDefault("#1e1e1e"); + panelViewBorder = create2("panel-view-border", "--vscode-panel-border").withDefault("#80808059"); + tagCornerRadius = create2("tag-corner-radius").withDefault("2px"); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js + var badgeStyles; + var init_badge_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/badge.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + badgeStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + text-align: center; + } + .control { + align-items: center; + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: 11px; + box-sizing: border-box; + color: ${badgeForeground}; + display: flex; + height: calc(${designUnit} * 4px); + justify-content: center; + min-width: calc(${designUnit} * 4px + 2px); + min-height: calc(${designUnit} * 4px + 2px); + padding: 3px 6px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js + var Badge2, vsCodeBadge; + var init_badge3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/badge/index.js"() { + init_esm2(); + init_badge_styles(); + Badge2 = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.circular) { + this.circular = true; + } + } + }; + vsCodeBadge = Badge2.compose({ + baseName: "badge", + template: badgeTemplate, + styles: badgeStyles + }); + } + }); + + // node_modules/tslib/tslib.es6.mjs + function __decorate2(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + } + var init_tslib_es62 = __esm({ + "node_modules/tslib/tslib.es6.mjs"() { + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js + var BaseButtonStyles, PrimaryButtonStyles, SecondaryButtonStyles, IconButtonStyles, buttonStyles; + var init_button_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/button.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + BaseButtonStyles = css` + ${display("inline-flex")} :host { + outline: none; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${buttonPrimaryForeground}; + background: ${buttonPrimaryBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + fill: currentColor; + cursor: pointer; + } + .control { + background: transparent; + height: inherit; + flex-grow: 1; + box-sizing: border-box; + display: inline-flex; + justify-content: center; + align-items: center; + padding: ${buttonPaddingVertical} ${buttonPaddingHorizontal}; + white-space: wrap; + outline: none; + text-decoration: none; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + color: inherit; + border-radius: inherit; + fill: inherit; + cursor: inherit; + font-family: inherit; + } + :host(:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host(:active) { + background: ${buttonPrimaryBackground}; + } + .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + .control::-moz-focus-inner { + border: 0; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + background: ${buttonPrimaryBackground}; + cursor: ${disabledCursor}; + } + .content { + display: flex; + } + .start { + display: flex; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-end: 8px; + } +`; + PrimaryButtonStyles = css` + :host([appearance='primary']) { + background: ${buttonPrimaryBackground}; + color: ${buttonPrimaryForeground}; + } + :host([appearance='primary']:hover) { + background: ${buttonPrimaryHoverBackground}; + } + :host([appearance='primary']:active) .control:active { + background: ${buttonPrimaryBackground}; + } + :host([appearance='primary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='primary'][disabled]) { + background: ${buttonPrimaryBackground}; + } +`; + SecondaryButtonStyles = css` + :host([appearance='secondary']) { + background: ${buttonSecondaryBackground}; + color: ${buttonSecondaryForeground}; + } + :host([appearance='secondary']:hover) { + background: ${buttonSecondaryHoverBackground}; + } + :host([appearance='secondary']:active) .control:active { + background: ${buttonSecondaryBackground}; + } + :host([appearance='secondary']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: calc(${borderWidth} * 2px); + } + :host([appearance='secondary'][disabled]) { + background: ${buttonSecondaryBackground}; + } +`; + IconButtonStyles = css` + :host([appearance='icon']) { + background: ${buttonIconBackground}; + border-radius: ${buttonIconCornerRadius}; + color: ${foreground}; + } + :host([appearance='icon']:hover) { + background: ${buttonIconHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } + :host([appearance='icon']) .control { + padding: ${buttonIconPadding}; + border: none; + } + :host([appearance='icon']:active) .control:active { + background: ${buttonIconHoverBackground}; + } + :host([appearance='icon']) .control:${focusVisible} { + outline: calc(${borderWidth} * 1px) solid ${focusBorder}; + outline-offset: ${buttonIconFocusBorderOffset}; + } + :host([appearance='icon'][disabled]) { + background: ${buttonIconBackground}; + } +`; + buttonStyles = (context, definition) => css` + ${BaseButtonStyles} + ${PrimaryButtonStyles} + ${SecondaryButtonStyles} + ${IconButtonStyles} +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/button/index.js + var Button2, vsCodeButton; + var init_button3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/button/index.js"() { + init_tslib_es62(); + init_esm(); + init_esm2(); + init_button_styles(); + Button2 = class extends Button { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (!this.appearance) { + const appearanceValue = this.getAttribute("appearance"); + this.appearance = appearanceValue; + } + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "appearance" && newVal === "icon") { + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.ariaLabel = "Icon Button"; + } + } + if (attrName === "aria-label") { + this.ariaLabel = newVal; + } + if (attrName === "disabled") { + this.disabled = newVal !== null; + } + } + }; + __decorate2([ + attr + ], Button2.prototype, "appearance", void 0); + vsCodeButton = Button2.compose({ + baseName: "button", + template: buttonTemplate, + styles: buttonStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js + var checkboxStyles; + var init_checkbox_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/checkbox.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + checkboxStyles = (context, defintiion) => css` + ${display("inline-flex")} :host { + align-items: center; + outline: none; + margin: calc(${designUnit} * 1px) 0; + user-select: none; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control { + position: relative; + width: calc(${designUnit} * 4px + 2px); + height: calc(${designUnit} * 4px + 2px); + box-sizing: border-box; + border-radius: calc(${checkboxCornerRadius} * 1px); + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + background: ${checkboxBackground}; + outline: none; + cursor: pointer; + } + .label { + font-family: ${fontFamily}; + color: ${foreground}; + padding-inline-start: calc(${designUnit} * 2px + 2px); + margin-inline-end: calc(${designUnit} * 2px + 2px); + cursor: pointer; + } + .label__hidden { + display: none; + visibility: hidden; + } + .checked-indicator { + width: 100%; + height: 100%; + display: block; + fill: ${foreground}; + opacity: 0; + pointer-events: none; + } + .indeterminate-indicator { + border-radius: 2px; + background: ${foreground}; + position: absolute; + top: 50%; + left: 50%; + width: 50%; + height: 50%; + transform: translate(-50%, -50%); + opacity: 0; + } + :host(:enabled) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:enabled) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host(.disabled) .label, + :host(.readonly) .label, + :host(.readonly) .control, + :host(.disabled) .control { + cursor: ${disabledCursor}; + } + :host(.checked:not(.indeterminate)) .checked-indicator, + :host(.indeterminate) .indeterminate-indicator { + opacity: 1; + } + :host(.disabled) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js + var Checkbox2, vsCodeCheckbox; + var init_checkbox3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/checkbox/index.js"() { + init_esm2(); + init_checkbox_styles(); + Checkbox2 = class extends Checkbox { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Checkbox"); + } + } + }; + vsCodeCheckbox = Checkbox2.compose({ + baseName: "checkbox", + template: checkboxTemplate, + styles: checkboxStyles, + checkedIndicator: ` + + + + `, + indeterminateIndicator: ` +
    + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js + var dataGridStyles; + var init_data_grid_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid.styles.js"() { + init_esm(); + dataGridStyles = (context, definition) => css` + :host { + display: flex; + position: relative; + flex-direction: column; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js + var dataGridRowStyles; + var init_data_grid_row_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-row.styles.js"() { + init_esm(); + init_design_tokens(); + dataGridRowStyles = (context, definition) => css` + :host { + display: grid; + padding: calc((${designUnit} / 4) * 1px) 0; + box-sizing: border-box; + width: 100%; + background: transparent; + } + :host(.header) { + } + :host(.sticky-header) { + background: ${background}; + position: sticky; + top: 0; + } + :host(:hover) { + background: ${listHoverBackground}; + outline: 1px dotted ${contrastActiveBorder}; + outline-offset: -1px; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js + var dataGridCellStyles; + var init_data_grid_cell_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/data-grid-cell.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dataGridCellStyles = (context, definition) => css` + :host { + padding: calc(${designUnit} * 1px) calc(${designUnit} * 3px); + color: ${foreground}; + opacity: 1; + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + font-weight: 400; + border: solid calc(${borderWidth} * 1px) transparent; + border-radius: calc(${cornerRadius} * 1px); + white-space: wrap; + overflow-wrap: anywhere; + } + :host(.column-header) { + font-weight: 600; + } + :host(:${focusVisible}), + :host(:focus), + :host(:active) { + background: ${listActiveSelectionBackground}; + border: solid calc(${borderWidth} * 1px) ${focusBorder}; + color: ${listActiveSelectionForeground}; + outline: none; + } + :host(:${focusVisible}) ::slotted(*), + :host(:focus) ::slotted(*), + :host(:active) ::slotted(*) { + color: ${listActiveSelectionForeground} !important; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js + var DataGrid2, vsCodeDataGrid, DataGridRow2, vsCodeDataGridRow, DataGridCell2, vsCodeDataGridCell; + var init_data_grid3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/data-grid/index.js"() { + init_esm2(); + init_data_grid_styles(); + init_data_grid_row_styles(); + init_data_grid_cell_styles(); + DataGrid2 = class extends DataGrid { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Data Grid"); + } + } + }; + vsCodeDataGrid = DataGrid2.compose({ + baseName: "data-grid", + baseClass: DataGrid, + template: dataGridTemplate, + styles: dataGridStyles + }); + DataGridRow2 = class extends DataGridRow { + }; + vsCodeDataGridRow = DataGridRow2.compose({ + baseName: "data-grid-row", + baseClass: DataGridRow, + template: dataGridRowTemplate, + styles: dataGridRowStyles + }); + DataGridCell2 = class extends DataGridCell { + }; + vsCodeDataGridCell = DataGridCell2.compose({ + baseName: "data-grid-cell", + baseClass: DataGridCell, + template: dataGridCellTemplate, + styles: dataGridCellStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js + var dividerStyles; + var init_divider_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/divider.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dividerStyles = (context, definition) => css` + ${display("block")} :host { + border: none; + border-top: calc(${borderWidth} * 1px) solid ${dividerBackground}; + box-sizing: content-box; + height: 0; + margin: calc(${designUnit} * 1px) 0; + width: 100%; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js + var Divider2, vsCodeDivider; + var init_divider3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/divider/index.js"() { + init_esm2(); + init_divider_styles(); + Divider2 = class extends Divider { + }; + vsCodeDivider = Divider2.compose({ + baseName: "divider", + template: dividerTemplate, + styles: dividerStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js + var dropdownStyles; + var init_dropdown_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/dropdown.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + dropdownStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: ${dropdownBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + color: ${foreground}; + contain: contents; + font-family: ${fontFamily}; + height: calc(${inputHeight} * 1px); + position: relative; + user-select: none; + min-width: ${inputMinWidth}; + outline: none; + vertical-align: top; + } + .control { + align-items: center; + box-sizing: border-box; + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + cursor: pointer; + display: flex; + font-family: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + min-height: 100%; + padding: 2px 6px 2px 8px; + width: 100%; + } + .listbox { + background: ${dropdownBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + border-radius: calc(${cornerRadiusRound} * 1px); + box-sizing: border-box; + display: inline-flex; + flex-direction: column; + left: 0; + max-height: ${dropdownListMaxHeight}; + padding: 0; + overflow-y: auto; + position: absolute; + width: 100%; + z-index: 1; + } + .listbox[hidden] { + display: none; + } + :host(:${focusVisible}) .control { + border-color: ${focusBorder}; + } + :host(:not([disabled]):hover) { + background: ${dropdownBackground}; + border-color: ${dropdownBorder}; + } + :host(:${focusVisible}) ::slotted([aria-selected="true"][role="option"]:not([disabled])) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + cursor: ${disabledCursor}; + user-select: none; + } + :host([disabled]:hover) { + background: ${dropdownBackground}; + color: ${foreground}; + fill: currentcolor; + } + :host(:not([disabled])) .control:active { + border-color: ${focusBorder}; + } + :host(:empty) .listbox { + display: none; + } + :host([open]) .control { + border-color: ${focusBorder}; + } + :host([open][position='above']) .listbox { + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + } + :host([open][position='below']) .listbox { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + :host([open][position='above']) .listbox { + bottom: calc(${inputHeight} * 1px); + } + :host([open][position='below']) .listbox { + top: calc(${inputHeight} * 1px); + } + .selected-value { + flex: 1 1 auto; + font-family: inherit; + overflow: hidden; + text-align: start; + text-overflow: ellipsis; + white-space: nowrap; + } + .indicator { + flex: 0 0 auto; + margin-inline-start: 1em; + } + slot[name='listbox'] { + display: none; + width: 100%; + } + :host([open]) slot[name='listbox'] { + display: flex; + position: absolute; + } + .end { + margin-inline-start: auto; + } + .start, + .end, + .indicator, + .select-indicator, + ::slotted(svg), + ::slotted(span) { + fill: currentcolor; + height: 1em; + min-height: calc(${designUnit} * 4px); + min-width: calc(${designUnit} * 4px); + width: 1em; + } + ::slotted([role='option']), + ::slotted(option) { + flex: 0 0 auto; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js + var Dropdown, vsCodeDropdown; + var init_dropdown = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/dropdown/index.js"() { + init_esm2(); + init_dropdown_styles(); + Dropdown = class extends Select { + }; + vsCodeDropdown = Dropdown.compose({ + baseName: "dropdown", + template: selectTemplate, + styles: dropdownStyles, + indicator: ` + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js + var linkStyles; + var init_link_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/link.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + linkStyles = (context, definition) => css` + ${display("inline-flex")} :host { + background: transparent; + box-sizing: border-box; + color: ${linkForeground}; + cursor: pointer; + fill: currentcolor; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + outline: none; + } + .control { + background: transparent; + border: calc(${borderWidth} * 1px) solid transparent; + border-radius: calc(${cornerRadius} * 1px); + box-sizing: border-box; + color: inherit; + cursor: inherit; + fill: inherit; + font-family: inherit; + height: inherit; + padding: 0; + outline: none; + text-decoration: none; + word-break: break-word; + } + .control::-moz-focus-inner { + border: 0; + } + :host(:hover) { + color: ${linkActiveForeground}; + } + :host(:hover) .content { + text-decoration: underline; + } + :host(:active) { + background: transparent; + color: ${linkActiveForeground}; + } + :host(:${focusVisible}) .control, + :host(:focus) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/link/index.js + var Link, vsCodeLink; + var init_link = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/link/index.js"() { + init_esm2(); + init_link_styles(); + Link = class extends Anchor { + }; + vsCodeLink = Link.compose({ + baseName: "link", + template: anchorTemplate, + styles: linkStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js + var optionStyles; + var init_option_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/option.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + optionStyles = (context, definition) => css` + ${display("inline-flex")} :host { + font-family: var(--body-font); + border-radius: ${cornerRadius}; + border: calc(${borderWidth} * 1px) solid transparent; + box-sizing: border-box; + color: ${foreground}; + cursor: pointer; + fill: currentcolor; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: 0; + outline: none; + overflow: hidden; + padding: 0 calc((${designUnit} / 2) * 1px) + calc((${designUnit} / 4) * 1px); + user-select: none; + white-space: nowrap; + } + :host(:${focusVisible}) { + border-color: ${focusBorder}; + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([aria-selected='true']) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:active) { + background: ${listActiveSelectionBackground}; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):hover) { + background: ${listActiveSelectionBackground}; + border: calc(${borderWidth} * 1px) solid transparent; + color: ${listActiveSelectionForeground}; + } + :host(:not([aria-selected='true']):active) { + background: ${listActiveSelectionBackground}; + color: ${foreground}; + } + :host([disabled]) { + cursor: ${disabledCursor}; + opacity: ${disabledOpacity}; + } + :host([disabled]:hover) { + background-color: inherit; + } + .content { + grid-column-start: 2; + justify-self: start; + overflow: hidden; + text-overflow: ellipsis; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/option/index.js + var Option2, vsCodeOption; + var init_option = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/option/index.js"() { + init_esm2(); + init_option_styles(); + Option2 = class extends ListboxOption { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Option"); + } + } + }; + vsCodeOption = Option2.compose({ + baseName: "option", + template: listboxOptionTemplate, + styles: optionStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js + var panelsStyles; + var init_panels_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panels.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelsStyles = (context, definition) => css` + ${display("grid")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + color: ${foreground}; + grid-template-columns: auto 1fr auto; + grid-template-rows: auto 1fr; + overflow-x: auto; + } + .tablist { + display: grid; + grid-template-rows: auto auto; + grid-template-columns: auto; + column-gap: calc(${designUnit} * 8px); + position: relative; + width: max-content; + align-self: end; + padding: calc(${designUnit} * 1px) calc(${designUnit} * 1px) 0; + box-sizing: border-box; + } + .start, + .end { + align-self: center; + } + .activeIndicator { + grid-row: 2; + grid-column: 1; + width: 100%; + height: calc((${designUnit} / 4) * 1px); + justify-self: center; + background: ${panelTabActiveForeground}; + margin: 0; + border-radius: calc(${cornerRadius} * 1px); + } + .activeIndicatorTransition { + transition: transform 0.01s linear; + } + .tabpanel { + grid-row: 2; + grid-column-start: 1; + grid-column-end: 4; + position: relative; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js + var panelTabStyles; + var init_panel_tab_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-tab.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelTabStyles = (context, definition) => css` + ${display("inline-flex")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + height: calc(${designUnit} * 7px); + padding: calc(${designUnit} * 1px) 0; + color: ${panelTabForeground}; + fill: currentcolor; + border-radius: calc(${cornerRadius} * 1px); + border: solid calc(${borderWidth} * 1px) transparent; + align-items: center; + justify-content: center; + grid-row: 1; + cursor: pointer; + } + :host(:hover) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:active) { + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:hover) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host([aria-selected='true']:active) { + background: transparent; + color: ${panelTabActiveForeground}; + fill: currentcolor; + } + :host(:${focusVisible}) { + outline: none; + border: solid calc(${borderWidth} * 1px) ${panelTabActiveBorder}; + } + :host(:focus) { + outline: none; + } + ::slotted(vscode-badge) { + margin-inline-start: calc(${designUnit} * 2px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js + var panelViewStyles; + var init_panel_view_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/panel-view.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + panelViewStyles = (context, definition) => css` + ${display("flex")} :host { + color: inherit; + background-color: transparent; + border: solid calc(${borderWidth} * 1px) transparent; + box-sizing: border-box; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: 10px calc((${designUnit} + 2) * 1px); + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js + var Panels, vsCodePanels, PanelTab, vsCodePanelTab, PanelView, vsCodePanelView; + var init_panels = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/panels/index.js"() { + init_esm2(); + init_panels_styles(); + init_panel_tab_styles(); + init_panel_view_styles(); + Panels = class extends Tabs { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.orientation) { + this.orientation = TabsOrientation.horizontal; + } + const ariaLabelValue = this.getAttribute("aria-label"); + if (!ariaLabelValue) { + this.setAttribute("aria-label", "Panels"); + } + } + }; + vsCodePanels = Panels.compose({ + baseName: "panels", + template: tabsTemplate, + styles: panelsStyles + }); + PanelTab = class extends Tab { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.disabled) { + this.disabled = false; + } + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } + } + }; + vsCodePanelTab = PanelTab.compose({ + baseName: "panel-tab", + template: tabTemplate, + styles: panelTabStyles + }); + PanelView = class extends TabPanel { + }; + vsCodePanelView = PanelView.compose({ + baseName: "panel-view", + template: tabPanelTemplate, + styles: panelViewStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js + var progressRingStyles; + var init_progress_ring_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/progress-ring.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + progressRingStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: center; + outline: none; + height: calc(${designUnit} * 7px); + width: calc(${designUnit} * 7px); + margin: 0; + } + .progress { + height: 100%; + width: 100%; + } + .background { + fill: none; + stroke: transparent; + stroke-width: calc(${designUnit} / 2 * 1px); + } + .indeterminate-indicator-1 { + fill: none; + stroke: ${progressBackground}; + stroke-width: calc(${designUnit} / 2 * 1px); + stroke-linecap: square; + transform-origin: 50% 50%; + transform: rotate(-90deg); + transition: all 0.2s ease-in-out; + animation: spin-infinite 2s linear infinite; + } + @keyframes spin-infinite { + 0% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(0deg); + } + 50% { + stroke-dasharray: 21.99px 21.99px; + transform: rotate(450deg); + } + 100% { + stroke-dasharray: 0.01px 43.97px; + transform: rotate(1080deg); + } + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js + var ProgressRing, vsCodeProgressRing; + var init_progress_ring2 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/progress-ring/index.js"() { + init_esm2(); + init_progress_ring_styles(); + ProgressRing = class extends BaseProgress { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.paused) { + this.paused = false; + } + this.setAttribute("aria-label", "Loading"); + this.setAttribute("aria-live", "assertive"); + this.setAttribute("role", "alert"); + } + /** + * Component lifecycle method that runs when an attribute of the + * element is changed. + * + * @param attrName - The attribute that was changed + * @param oldVal - The old value of the attribute + * @param newVal - The new value of the attribute + * + * @internal + */ + attributeChangedCallback(attrName, oldVal, newVal) { + if (attrName === "value") { + this.removeAttribute("value"); + } + } + }; + vsCodeProgressRing = ProgressRing.compose({ + baseName: "progress-ring", + template: progressRingTemplate, + styles: progressRingStyles, + indeterminateIndicator: ` + + + + + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js + var radioGroupStyles; + var init_radio_group_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/radio-group.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioGroupStyles = (context, definition) => css` + ${display("flex")} :host { + align-items: flex-start; + margin: calc(${designUnit} * 1px) 0; + flex-direction: column; + } + .positioning-region { + display: flex; + flex-wrap: wrap; + } + :host([orientation='vertical']) .positioning-region { + flex-direction: column; + } + :host([orientation='horizontal']) .positioning-region { + flex-direction: row; + } + ::slotted([slot='label']) { + color: ${foreground}; + font-size: ${typeRampBaseFontSize}; + margin: calc(${designUnit} * 1px) 0; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js + var RadioGroup2, vsCodeRadioGroup; + var init_radio_group3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio-group/index.js"() { + init_dist2(); + init_esm2(); + init_radio_group_styles(); + RadioGroup2 = class extends RadioGroup { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + const label = this.querySelector("label"); + if (label) { + const id = "radio-group-" + Math.random().toString(16).slice(2); + label.setAttribute("id", id); + this.setAttribute("aria-labelledby", id); + } + } + }; + vsCodeRadioGroup = RadioGroup2.compose({ + baseName: "radio-group", + template: radioGroupTemplate, + styles: radioGroupStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js + var radioStyles; + var init_radio_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/radio.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + radioStyles = (context, definition) => css` + ${display("inline-flex")} :host { + align-items: center; + flex-direction: row; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin: calc(${designUnit} * 1px) 0; + outline: none; + position: relative; + transition: all 0.2s ease-in-out; + user-select: none; + } + .control { + background: ${checkboxBackground}; + border-radius: 999px; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + box-sizing: border-box; + cursor: pointer; + height: calc(${designUnit} * 4px); + position: relative; + outline: none; + width: calc(${designUnit} * 4px); + } + .label { + color: ${foreground}; + cursor: pointer; + font-family: ${fontFamily}; + margin-inline-end: calc(${designUnit} * 2px + 2px); + padding-inline-start: calc(${designUnit} * 2px + 2px); + } + .label__hidden { + display: none; + visibility: hidden; + } + .control, + .checked-indicator { + flex-shrink: 0; + } + .checked-indicator { + background: ${foreground}; + border-radius: 999px; + display: inline-block; + inset: calc(${designUnit} * 1px); + opacity: 0; + pointer-events: none; + position: absolute; + } + :host(:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border-color: ${checkboxBorder}; + } + :host(:not([disabled])) .control:active { + background: ${checkboxBackground}; + border-color: ${focusBorder}; + } + :host(:${focusVisible}) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked='true']) .control { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:hover { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${checkboxBorder}; + } + :host([aria-checked='true']:not([disabled])) .control:active { + background: ${checkboxBackground}; + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([aria-checked="true"]:${focusVisible}:not([disabled])) .control { + border: calc(${borderWidth} * 1px) solid ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([aria-checked='true']) .checked-indicator { + opacity: 1; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js + var Radio2, vsCodeRadio; + var init_radio3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/radio/index.js"() { + init_esm2(); + init_radio_styles(); + Radio2 = class extends Radio { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Radio"); + } + } + }; + vsCodeRadio = Radio2.compose({ + baseName: "radio", + template: radioTemplate, + styles: radioStyles, + checkedIndicator: ` +
    + ` + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js + var tagStyles; + var init_tag_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/tag.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + tagStyles = (context, definition) => css` + ${display("inline-block")} :host { + box-sizing: border-box; + font-family: ${fontFamily}; + font-size: ${typeRampMinus1FontSize}; + line-height: ${typeRampMinus1LineHeight}; + } + .control { + background-color: ${badgeBackground}; + border: calc(${borderWidth} * 1px) solid ${buttonBorder}; + border-radius: ${tagCornerRadius}; + color: ${badgeForeground}; + padding: calc(${designUnit} * 0.5px) calc(${designUnit} * 1px); + text-transform: uppercase; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js + var Tag, vsCodeTag; + var init_tag = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/tag/index.js"() { + init_esm2(); + init_tag_styles(); + Tag = class extends Badge { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.circular) { + this.circular = false; + } + } + }; + vsCodeTag = Tag.compose({ + baseName: "tag", + template: badgeTemplate, + styles: tagStyles + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js + var textAreaStyles; + var init_text_area_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/text-area.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textAreaStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .control { + box-sizing: border-box; + position: relative; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + font: inherit; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + padding: calc(${designUnit} * 2px + 1px); + width: 100%; + min-width: ${inputMinWidth}; + resize: none; + } + .control:hover:enabled { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + .control:active:enabled { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .control::-webkit-scrollbar { + width: ${scrollbarWidth}; + height: ${scrollbarHeight}; + } + .control::-webkit-scrollbar-corner { + background: ${inputBackground}; + } + .control::-webkit-scrollbar-thumb { + background: ${scrollbarSliderBackground}; + } + .control::-webkit-scrollbar-thumb:hover { + background: ${scrollbarSliderHoverBackground}; + } + .control::-webkit-scrollbar-thumb:active { + background: ${scrollbarSliderActiveBackground}; + } + :host(:focus-within:not([disabled])) .control { + border-color: ${focusBorder}; + } + :host([resize='both']) .control { + resize: both; + } + :host([resize='horizontal']) .control { + resize: horizontal; + } + :host([resize='vertical']) .control { + resize: vertical; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js + var TextArea2, vsCodeTextArea; + var init_text_area3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-area/index.js"() { + init_esm2(); + init_text_area_styles(); + TextArea2 = class extends TextArea { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text area"); + } + } + }; + vsCodeTextArea = TextArea2.compose({ + baseName: "text-area", + template: textAreaTemplate, + styles: textAreaStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js + var textFieldStyles; + var init_text_field_styles = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/text-field.styles.js"() { + init_esm(); + init_esm2(); + init_design_tokens(); + textFieldStyles = (context, definition) => css` + ${display("inline-block")} :host { + font-family: ${fontFamily}; + outline: none; + user-select: none; + } + .root { + box-sizing: border-box; + position: relative; + display: flex; + flex-direction: row; + color: ${inputForeground}; + background: ${inputBackground}; + border-radius: calc(${cornerRadiusRound} * 1px); + border: calc(${borderWidth} * 1px) solid ${dropdownBorder}; + height: calc(${inputHeight} * 1px); + min-width: ${inputMinWidth}; + } + .control { + -webkit-appearance: none; + font: inherit; + background: transparent; + border: 0; + color: inherit; + height: calc(100% - (${designUnit} * 1px)); + width: 100%; + margin-top: auto; + margin-bottom: auto; + border: none; + padding: 0 calc(${designUnit} * 2px + 1px); + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + } + .control:hover, + .control:${focusVisible}, + .control:disabled, + .control:active { + outline: none; + } + .label { + display: block; + color: ${foreground}; + cursor: pointer; + font-size: ${typeRampBaseFontSize}; + line-height: ${typeRampBaseLineHeight}; + margin-bottom: 2px; + } + .label__hidden { + display: none; + visibility: hidden; + } + .start, + .end { + display: flex; + margin: auto; + fill: currentcolor; + } + ::slotted(svg), + ::slotted(span) { + width: calc(${designUnit} * 4px); + height: calc(${designUnit} * 4px); + } + .start { + margin-inline-start: calc(${designUnit} * 2px); + } + .end { + margin-inline-end: calc(${designUnit} * 2px); + } + :host(:hover:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${dropdownBorder}; + } + :host(:active:not([disabled])) .root { + background: ${inputBackground}; + border-color: ${focusBorder}; + } + :host(:focus-within:not([disabled])) .root { + border-color: ${focusBorder}; + } + :host([disabled]) .label, + :host([readonly]) .label, + :host([readonly]) .control, + :host([disabled]) .control { + cursor: ${disabledCursor}; + } + :host([disabled]) { + opacity: ${disabledOpacity}; + } + :host([disabled]) .control { + border-color: ${dropdownBorder}; + } +`; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js + var TextField2, vsCodeTextField; + var init_text_field3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/text-field/index.js"() { + init_esm2(); + init_text_field_styles(); + TextField2 = class extends TextField { + /** + * Component lifecycle method that runs when the component is inserted + * into the DOM. + * + * @internal + */ + connectedCallback() { + super.connectedCallback(); + if (this.textContent) { + this.setAttribute("aria-label", this.textContent); + } else { + this.setAttribute("aria-label", "Text field"); + } + } + }; + vsCodeTextField = TextField2.compose({ + baseName: "text-field", + template: textFieldTemplate, + styles: textFieldStyles, + shadowOptions: { + delegatesFocus: true + } + }); + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js + var allComponents; + var init_custom_elements = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/custom-elements.js"() { + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + allComponents = { + vsCodeBadge, + vsCodeButton, + vsCodeCheckbox, + vsCodeDataGrid, + vsCodeDataGridCell, + vsCodeDataGridRow, + vsCodeDivider, + vsCodeDropdown, + vsCodeLink, + vsCodeOption, + vsCodePanels, + vsCodePanelTab, + vsCodePanelView, + vsCodeProgressRing, + vsCodeRadioGroup, + vsCodeRadio, + vsCodeTag, + vsCodeTextArea, + vsCodeTextField, + register(container, ...rest) { + if (!container) { + return; + } + for (const key in this) { + if (key === "register") { + continue; + } + this[key]().register(container, ...rest); + } + } + }; + } + }); + + // node_modules/@vscode/webview-ui-toolkit/dist/index.js + var dist_exports = {}; + __export(dist_exports, { + Badge: () => Badge2, + Button: () => Button2, + Checkbox: () => Checkbox2, + DataGrid: () => DataGrid2, + DataGridCell: () => DataGridCell2, + DataGridCellTypes: () => DataGridCellTypes, + DataGridRow: () => DataGridRow2, + DataGridRowTypes: () => DataGridRowTypes, + Divider: () => Divider2, + DividerRole: () => DividerRole, + Dropdown: () => Dropdown, + DropdownPosition: () => SelectPosition, + GenerateHeaderOptions: () => GenerateHeaderOptions, + Link: () => Link, + Option: () => Option2, + PanelTab: () => PanelTab, + PanelView: () => PanelView, + Panels: () => Panels, + ProgressRing: () => ProgressRing, + Radio: () => Radio2, + RadioGroup: () => RadioGroup2, + RadioGroupOrientation: () => Orientation, + Tag: () => Tag, + TextArea: () => TextArea2, + TextAreaResize: () => TextAreaResize, + TextField: () => TextField2, + TextFieldType: () => TextFieldType, + allComponents: () => allComponents, + provideVSCodeDesignSystem: () => provideVSCodeDesignSystem, + vsCodeBadge: () => vsCodeBadge, + vsCodeButton: () => vsCodeButton, + vsCodeCheckbox: () => vsCodeCheckbox, + vsCodeDataGrid: () => vsCodeDataGrid, + vsCodeDataGridCell: () => vsCodeDataGridCell, + vsCodeDataGridRow: () => vsCodeDataGridRow, + vsCodeDivider: () => vsCodeDivider, + vsCodeDropdown: () => vsCodeDropdown, + vsCodeLink: () => vsCodeLink, + vsCodeOption: () => vsCodeOption, + vsCodePanelTab: () => vsCodePanelTab, + vsCodePanelView: () => vsCodePanelView, + vsCodePanels: () => vsCodePanels, + vsCodeProgressRing: () => vsCodeProgressRing, + vsCodeRadio: () => vsCodeRadio, + vsCodeRadioGroup: () => vsCodeRadioGroup, + vsCodeTag: () => vsCodeTag, + vsCodeTextArea: () => vsCodeTextArea, + vsCodeTextField: () => vsCodeTextField + }); + var init_dist3 = __esm({ + "node_modules/@vscode/webview-ui-toolkit/dist/index.js"() { + init_vscode_design_system(); + init_custom_elements(); + init_badge3(); + init_button3(); + init_checkbox3(); + init_data_grid3(); + init_divider3(); + init_dropdown(); + init_link(); + init_option(); + init_panels(); + init_progress_ring2(); + init_radio_group3(); + init_radio3(); + init_tag(); + init_text_area3(); + init_text_field3(); + } + }); + + // src/webview/shared/domUtils.ts + function el(tag, className, text) { + const node = document.createElement(tag); + if (className) { + node.className = className; + } + if (text !== void 0) { + node.textContent = text; + } + return node; + } + + // src/webview/shared/buttonConfig.ts + var BUTTONS = { + "btn-refresh": { + id: "btn-refresh", + label: "\u{1F504} Refresh", + appearance: "primary" + }, + "btn-details": { + id: "btn-details", + label: "\u{1F916} Details" + }, + "btn-chart": { + id: "btn-chart", + label: "\u{1F4C8} Chart" + }, + "btn-usage": { + id: "btn-usage", + label: "\u{1F4CA} Usage Analysis" + }, + "btn-diagnostics": { + id: "btn-diagnostics", + label: "\u{1F50D} Diagnostics" + }, + "btn-maturity": { + id: "btn-maturity", + label: "\u{1F3AF} Fluency Score" + }, + "btn-dashboard": { + id: "btn-dashboard", + label: "\u{1F4CA} Team Dashboard" + }, + "btn-level-viewer": { + id: "btn-level-viewer", + label: "\u{1F50D} Level Viewer" + }, + "btn-environmental": { + id: "btn-environmental", + label: "\u{1F33F} Environmental Impact" + } + }; + function buttonHtml(id) { + const config = BUTTONS[id]; + const appearance = config.appearance ? ` appearance="${config.appearance}"` : ""; + return `${config.label}`; + } + + // src/webview/shared/contextRefUtils.ts + function getTotalContextRefs(refs) { + return refs.file + refs.selection + refs.implicitSelection + refs.symbol + refs.codebase + refs.workspace + refs.terminal + refs.vscode + refs.copilotInstructions + refs.agentsMd + (refs.terminalLastCommand || 0) + (refs.terminalSelection || 0) + (refs.clipboard || 0) + (refs.changes || 0) + (refs.outputPanel || 0) + (refs.problemsPanel || 0); + } + + // src/tokenEstimators.json + var tokenEstimators_default = { + $schema: "http://json-schema.org/draft-07/schema#", + description: "Character-to-token ratio estimators for different AI models. Used to estimate token counts from text length.", + estimators: { + "gpt-4": 0.25, + "gpt-4.1": 0.25, + "gpt-4.1-mini": 0.25, + "gpt-4o": 0.25, + "gpt-4o-mini": 0.25, + "gpt-4-turbo": 0.25, + "gpt-3.5-turbo": 0.25, + "gpt-5": 0.25, + "gpt-5-codex": 0.25, + "gpt-5-mini": 0.25, + "gpt-5.1": 0.25, + "gpt-5.1-codex": 0.25, + "gpt-5.1-codex-max": 0.25, + "gpt-5.1-codex-mini": 0.25, + "gpt-5.2": 0.25, + "gpt-5.2-codex": 0.25, + "gpt-5.2-pro": 0.25, + "gpt-5.3-codex": 0.25, + "gpt-5.4": 0.25, + "gpt-4.1-nano": 0.25, + "gemini-2.0-flash": 0.25, + "gemini-2.0-flash-lite": 0.25, + "gemini-2.5-flash": 0.25, + "gemini-2.5-flash-lite": 0.25, + "claude-sonnet-3.5": 0.24, + "claude-sonnet-3.7": 0.24, + "claude-sonnet-4": 0.24, + "claude-sonnet-4.5": 0.24, + "claude-sonnet-4.6": 0.24, + "claude-haiku": 0.24, + "claude-haiku-4.5": 0.24, + "claude-opus-4.1": 0.24, + "claude-opus-4.5": 0.24, + "claude-opus-4.6": 0.24, + "claude-opus-4.6-(fast-mode)-(preview)": 0.24, + "claude-opus-4.6-fast": 0.24, + "gemini-2.5-pro": 0.25, + "gemini-3-flash": 0.25, + "gemini-3-pro": 0.25, + "gemini-3-pro-preview": 0.25, + "gemini-3.1-pro": 0.25, + "grok-code-fast-1": 0.25, + "raptor-mini": 0.25, + goldeneye: 0.25, + "o1-preview": 0.25, + "o1-mini": 0.25, + "o3-mini": 0.25, + "o4-mini": 0.25 + } + }; + + // src/webview/shared/formatUtils.ts + var tokenEstimators = tokenEstimators_default.estimators; + var currentLocale; + function setFormatLocale(locale) { + currentLocale = locale; + } + function formatFixed(value, digits) { + return new Intl.NumberFormat(currentLocale, { + minimumFractionDigits: digits, + maximumFractionDigits: digits + }).format(value); + } + function formatPercent(value, digits = 1) { + return `${formatFixed(value, digits)}%`; + } + function formatNumber(value) { + return value.toLocaleString(currentLocale); + } + + // src/webview/shared/theme.css + var theme_default = '/**\n * Shared theme variables for all webview panels\n * Uses VS Code theme tokens for automatic light/dark theme support\n */\n\n:root {\n /* VS Code base colors */\n --bg-primary: var(--vscode-editor-background);\n --bg-secondary: var(--vscode-sideBar-background);\n --bg-tertiary: var(--vscode-editorWidget-background);\n --text-primary: var(--vscode-editor-foreground);\n --text-secondary: var(--vscode-descriptionForeground);\n --text-muted: var(--vscode-disabledForeground);\n --border-color: var(--vscode-panel-border);\n --border-subtle: var(--vscode-widget-border);\n \n /* Button colors */\n --button-bg: var(--vscode-button-background);\n --button-fg: var(--vscode-button-foreground);\n --button-hover-bg: var(--vscode-button-hoverBackground);\n --button-secondary-bg: var(--vscode-button-secondaryBackground);\n --button-secondary-fg: var(--vscode-button-secondaryForeground);\n --button-secondary-hover-bg: var(--vscode-button-secondaryHoverBackground);\n \n /* Input colors */\n --input-bg: var(--vscode-input-background);\n --input-fg: var(--vscode-input-foreground);\n --input-border: var(--vscode-input-border);\n \n /* List/card colors */\n --list-hover-bg: var(--vscode-list-hoverBackground);\n --list-active-bg: var(--vscode-list-activeSelectionBackground);\n --list-active-fg: var(--vscode-list-activeSelectionForeground);\n --list-inactive-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Alternating row colors for better readability */\n --row-alternate-bg: var(--vscode-list-inactiveSelectionBackground);\n \n /* Badge colors */\n --badge-bg: var(--vscode-badge-background);\n --badge-fg: var(--vscode-badge-foreground);\n \n /* Focus colors */\n --focus-border: var(--vscode-focusBorder);\n \n /* Link colors */\n --link-color: var(--vscode-textLink-foreground);\n --link-hover-color: var(--vscode-textLink-activeForeground);\n \n /* Status colors */\n --error-fg: var(--vscode-errorForeground);\n --warning-fg: var(--vscode-editorWarning-foreground);\n --success-fg: var(--vscode-terminal-ansiGreen);\n \n /* Shadow for cards */\n --shadow-color: rgb(0, 0, 0, 0.16);\n --shadow-hover-color: rgb(0, 0, 0, 0.24);\n}\n\n/* Light theme adjustments */\nbody[data-vscode-theme-kind="vscode-light"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --shadow-color: rgb(0, 0, 0, 0.08);\n --shadow-hover-color: rgb(0, 0, 0, 0.12);\n}\n\n/* High contrast mode adjustments */\nbody[data-vscode-theme-kind="vscode-high-contrast"],\nbody[data-vscode-theme-kind="vscode-high-contrast-light"] {\n --border-color: var(--vscode-contrastBorder);\n --border-subtle: var(--vscode-contrastBorder);\n}\n'; + + // src/webview/usage/styles.css + var styles_default = "* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n background: var(--bg-primary);\n color: var(--text-primary);\n padding: 16px;\n line-height: 1.5;\n min-width: 320px;\n}\n\n.container {\n background: var(--bg-secondary);\n border: 1px solid var(--border-color);\n border-radius: 10px;\n padding: 16px;\n box-shadow: 0 4px 10px var(--shadow-color);\n max-width: 1200px;\n margin: 0 auto;\n}\n\n.header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 12px;\n margin-bottom: 14px;\n padding-bottom: 4px;\n}\n\n.header-left {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.header-icon {\n font-size: 20px;\n}\n\n.header-title {\n font-size: 16px;\n font-weight: 700;\n color: var(--text-primary);\n letter-spacing: 0.2px;\n}\n\n.button-row {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n\n.nav-button {\n background: var(--button-secondary-bg);\n border: 1px solid var(--border-subtle);\n color: var(--text-primary);\n padding: 8px 12px;\n border-radius: 6px;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.15s ease;\n}\n\n.nav-button:hover {\n background: var(--button-secondary-hover-bg);\n}\n\n.nav-button.primary {\n background: var(--button-bg);\n border-color: var(--button-bg);\n color: var(--button-fg);\n}\n\n.nav-button.primary:hover {\n background: var(--button-hover-bg);\n}\n\n.section {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-color);\n border-radius: 8px;\n padding: 12px;\n margin-bottom: 16px;\n box-shadow: 0 2px 6px var(--shadow-color);\n}\n\n.section-title {\n font-size: 14px;\n font-weight: 700;\n color: var(--text-primary);\n margin-bottom: 10px;\n display: flex;\n align-items: center;\n gap: 6px;\n letter-spacing: 0.2px;\n}\n\n.section-subtitle {\n font-size: 12px;\n color: var(--text-secondary);\n margin-bottom: 12px;\n}\n\n.stats-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));\n gap: 12px;\n margin-bottom: 16px;\n}\n\n.stat-card {\n background: var(--list-hover-bg);\n border: 1px solid var(--border-color);\n border-radius: 6px;\n padding: 12px;\n box-shadow: 0 2px 4px var(--shadow-color);\n}\n\n.stat-card[title] {\n cursor: help;\n}\n\n.stat-label {\n font-size: 11px;\n color: var(--text-secondary);\n margin-bottom: 4px;\n}\n\n.stat-value {\n font-size: 20px;\n font-weight: 700;\n color: var(--text-primary);\n}\n\n.bar-chart {\n background: var(--list-hover-bg);\n border: 1px solid var(--border-color);\n border-radius: 6px;\n padding: 12px;\n margin-bottom: 12px;\n}\n\n.bar-item {\n margin-bottom: 8px;\n}\n\n.bar-label {\n display: flex;\n justify-content: space-between;\n font-size: 12px;\n margin-bottom: 4px;\n color: var(--text-primary);\n}\n\n.bar-track {\n background: var(--row-alternate-bg);\n height: 8px;\n border-radius: 4px;\n overflow: hidden;\n}\n\n.bar-fill {\n height: 100%;\n border-radius: 4px;\n transition: width 0.3s ease;\n}\n\n.list {\n background: var(--list-hover-bg);\n border: 1px solid var(--border-color);\n border-radius: 6px;\n padding: 12px 16px;\n}\n\n.list ul {\n list-style: none;\n padding: 0;\n}\n\n.list li {\n padding: 4px 0;\n font-size: 13px;\n}\n\n/* Customization matrix styles */\n.customization-matrix-container {\n overflow-x: auto;\n max-width: 100%;\n}\n\n.customization-matrix {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n color: var(--text-primary);\n}\n\n.customization-matrix th {\n background: var(--list-hover-bg);\n color: var(--text-primary);\n font-weight: 600;\n font-size: 11px;\n white-space: nowrap;\n}\n\n.customization-matrix td {\n background: var(--bg-tertiary);\n}\n\n.customization-matrix tbody tr:hover td {\n background: var(--list-hover-bg);\n}\n\n.stale-warning {\n color: #f59e0b;\n font-weight: 600;\n}\n\n.two-column {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n}\n\n.three-column {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n gap: 16px;\n align-items: stretch;\n}\n\n.three-column > div {\n display: flex;\n flex-direction: column;\n}\n\n.three-column > div > .list {\n flex: 1;\n}\n\n.info-box {\n background: var(--bg-tertiary);\n border: 1px solid var(--border-color);\n border-radius: 6px;\n padding: 12px;\n margin-bottom: 16px;\n font-size: 12px;\n color: var(--text-secondary);\n}\n\n.info-box-title {\n font-weight: 600;\n color: var(--text-primary);\n margin-bottom: 6px;\n}\n\n\n.repo-hygiene-results {\n margin-top: 4px;\n}\n\n.repo-analysis-card {\n margin: 0;\n}\n\n.repo-hygiene-pane {\n border: 1px solid var(--border-color);\n border-radius: 6px;\n margin-bottom: 12px;\n background: var(--bg-secondary);\n}\n\n.repo-hygiene-pane-header {\n padding: 8px 12px;\n font-size: 12px;\n font-weight: 600;\n color: var(--text-primary);\n border-bottom: 1px solid var(--border-color);\n background: var(--list-hover-bg);\n}\n\n.repo-hygiene-pane-body {\n display: block;\n}\n\n.repo-hygiene-pane-collapsed {\n display: none;\n}\n\n.repo-hygiene-pane-collapsed .repo-hygiene-pane-body {\n display: none;\n}\n\n.btn-repo-action[disabled] {\n opacity: 0.7;\n}\n\n.footer {\n margin-top: 6px;\n padding-top: 12px;\n border-top: 1px solid var(--border-subtle);\n text-align: left;\n font-size: 11px;\n color: var(--text-muted);\n}\n\n@media (width <= 768px) {\n .two-column {\n grid-template-columns: 1fr;\n }\n\n .three-column {\n grid-template-columns: 1fr;\n }\n}\n"; + + // src/toolNames.json + var toolNames_default = { + unknown: "Unknown", + run_in_terminal: "Run In Terminal", + "mcp.io.github.git.assign_copilot_to_issue": "GitHub MCP (Local): Assign Copilot to Issue", + "mcp.io.github.git.create_or_update_file": "GitHub MCP (Local): Create/Update File", + mcp_io_github_git_create_or_update_file: "GitHub MCP (Local): Create/Update File", + mcp_io_github_git_assign_copilot_to_issue: "GitHub MCP (Local): Assign Copilot to Issue", + mcp_io_github_git_pull_request_read: "GitHub MCP (Local): Pull Request Read", + mcp_io_github_git_issue_read: "GitHub MCP (Local): Issue Read", + mcp_io_github_git_issue_write: "GitHub MCP (Local): Issue Write", + mcp_io_github_git_list_issues: "GitHub MCP (Local): List Issues", + mcp_io_github_git_create_pull_request: "GitHub MCP (Local): Create Pull Request", + mcp_io_github_git_get_file_contents: "GitHub MCP (Local): Get File Contents", + mcp_io_github_git_search_code: "GitHub MCP (Local): Search Code", + mcp_io_github_git_search_pull_requests: "GitHub MCP (Local): Search Pull Requests", + mcp_io_github_git_get_release_by_tag: "GitHub MCP (Local): Get Release By Tag", + mcp_io_github_git_search_issues: "GitHub MCP (Local): Search Issues", + mcp_io_github_git_add_issue_comment: "GitHub MCP (Local): Add Issue Comment", + mcp_io_github_git_list_pull_requests: "GitHub MCP (Local): List Pull Requests", + mcp_io_github_git_list_code_scanning_alerts: "GitHub MCP (Local): List Code Scanning Alerts", + mcp_github_github_assign_copilot_to_issue: "GitHub MCP (Remote): Assign Copilot to Issue", + mcp_github_github_issue_read: "GitHub MCP (Remote): Issue Read", + mcp_github_github_issue_write: "GitHub MCP (Remote): Issue Write", + mcp_github_github_list_issues: "GitHub MCP (Remote): List Issues", + mcp_github_get_file_contents: "GitHub MCP (Remote): Get File Contents", + mcp_github_get_latest_release: "GitHub MCP (Remote): Get Latest Release", + mcp_github_get_release_by_tag: "GitHub MCP (Remote): Get Release By Tag", + mcp_github_list_releases: "GitHub MCP (Remote): List Releases", + mcp_github_list_tags: "GitHub MCP (Remote): List Tags", + mcp_github_search_code: "GitHub MCP (Remote): Search Code", + mcp_github_search_issues: "GitHub MCP (Remote): Search Issues", + mcp_github_create_pull_request: "GitHub MCP (Remote): Create Pull Request", + "mcp_github-code-s_get_code_scanning_alert": "GitHub MCP (Code Scanning): Get Alert", + "mcp_github-code-s_list_code_scanning_alerts": "GitHub MCP (Code Scanning): List Alerts", + mcp_com_microsoft_get_bestpractices: "GitHub MCP: Get Best Practices", + mcp_microsoft_doc_microsoft_code_sample_search: "Microsoft Docs MCP: Code Sample Search", + mcp_microsoft_doc_microsoft_docs_search: "Microsoft Docs MCP: Docs Search", + mcp_gitkraken_git_add_or_commit: "GitKraken MCP: Git Add or Commit", + mcp_gitkraken_git_status: "GitKraken MCP: Git Status", + mcp_gitkraken_git_branch: "GitKraken MCP: Git Branch", + mcp_gitkraken_git_checkout: "GitKraken MCP: Git Checkout", + mcp_gitkraken_gitkraken_workspace_list: "GitKraken MCP: List Workspaces", + mcp_pencil_batch_design: "Pencil MCP: Batch Design", + mcp_pencil_get_editor_state: "Pencil MCP: Get Editor State", + mcp_pencil_get_guidelines: "Pencil MCP: Get Guidelines", + mcp_pencil_get_screenshot: "Pencil MCP: Get Screenshot", + mcp_pencil_snapshot_layout: "Pencil MCP: Snapshot Layout", + mcp_azure_aks: "Azure MCP: AKS", + mcp_azure_mcp_azureterraformbestpractices: "Azure MCP: Azure Terraform Best Practices", + mcp_azure_mcp_documentation: "Azure MCP: Documentation", + mcp_bicep_format_bicep_file: "Bicep MCP: Format Bicep File", + mcp_bicep_get_az_resource_type_schema: "Bicep MCP: Get Az Resource Type Schema", + mcp_bicep_get_bicep_best_practices: "Bicep MCP: Get Bicep Best Practices", + mcp_bicep_get_bicep_file_diagnostics: "Bicep MCP: Get Bicep File Diagnostics", + mcp_bicep_list_az_resource_types_for_provider: "Bicep MCP: List Az Resource Types For Provider", + "azure_bicep-get_azure_verified_module": "Azure Bicep: Get Azure Verified Module", + "azure_development-recommend_custom_modes": "Azure Development: Recommend Custom Modes", + "azure_resources-query_azure_resource_graph": "Azure Resources: Query Azure Resource Graph", + manage_todo_list: "Manage TODO List", + copilot_readFile: "Read File", + copilot_viewImage: "Copilot View Image", + opilot_findFiles: "Find Files", + copilot_writeFile: "Write File", + copilot_applyPatch: "Apply Patch", + copilot_findTextInFiles: "Find Text In Files", + copilot_findFiles: "Find Files", + copilot_replaceString: "Replace String", + copilot_createFile: "Create File", + copilot_listDirectory: "List Directory", + copilot_fetchWebPage: "Fetch Web Page", + copilot_getErrors: "Get Errors", + copilot_multiReplaceString: "Multi Replace String", + copilot_searchCodebase: "Search Codebase", + get_terminal_output: "Get Terminal Output", + run_task: "Run Task: Investigate", + await_terminal: "Await Terminal command", + "github.copilot.editsAgent": "GitHub Copilot Edits Agent", + todoList: "TODO List", + terminal: "Terminal", + terminal_last_command: "Terminal Last Command", + github_pull_request: "GitHub Pull Request", + github_repo: "GitHub Repository", + editFiles: "Edit Files", + listFiles: "List Files", + search_subagent: "Search Subagent", + execution_subagent: "Execution Subagent", + apply_patch: "Apply Patch", + ask_questions: "Ask Questions", + copilot_askQuestions: "Ask Questions", + copilot_createAndRunTask: "Create And Run Task", + copilot_createDirectory: "Create Directory", + copilot_createNewJupyterNotebook: "Create New Jupyter Notebook", + copilot_createNewWorkspace: "Create New Workspace", + copilot_editFiles: "Edit Files", + copilot_editNotebook: "Edit Notebook", + copilot_findTestFiles: "Find Test Files", + copilot_getChangedFiles: "Get Changed Files", + copilot_getDocInfo: "Get Doc Info", + copilot_getNotebookSummary: "Get Notebook Summary", + copilot_getProjectSetupInfo: "Get Project Setup Info", + copilot_getSearchResults: "Get Search Results", + copilot_getVSCodeAPI: "Get VSCode API", + copilot_githubRepo: "GitHub Repository", + copilot_insertEdit: "Insert Edit", + copilot_installExtension: "Install Extension", + copilot_memory: "Memory", + copilot_openIntegratedBrowser: "Open Integrated Browser", + copilot_openSimpleBrowser: "Open Simple Browser", + copilot_readNotebookCellOutput: "Read Notebook Cell Output", + copilot_readProjectStructure: "Read Project Structure", + copilot_runNotebookCell: "Run Notebook Cell", + copilot_runTests1: "Run Tests", + copilot_runVscodeCommand: "Run VSCode Command", + copilot_searchWorkspaceSymbols: "Search Workspace Symbols", + copilot_switchAgent: "Switch Agent", + copilot_testFailure: "Test Failure", + copilot_toolReplay: "Tool Replay", + create_and_run_task: "Create And Run Task", + create_directory: "Create Directory", + create_file: "Create File", + create_new_jupyter_notebook: "Create New Jupyter Notebook", + create_new_workspace: "Create New Workspace", + create_virtual_environment: "Create Virtual Environment", + edit_files: "Edit Files", + edit_notebook_file: "Edit Notebook File", + fetch_webpage: "Fetch Webpage", + file_search: "File Search", + get_changed_files: "Get Changed Files", + get_doc_info: "Get Doc Info", + get_errors: "Get Errors", + get_project_setup_info: "Get Project Setup Info", + configure_python_environment: "Configure Python Environment", + get_search_view_results: "Get Search View Results", + get_task_output: "Get Task Output", + job_output: "Job Output", + get_vscode_api: "Get VSCode API", + grep_search: "Grep Search", + insert_edit_into_file: "Insert Edit Into File", + install_extension: "Install Extension", + install_python_packages: "Install Python Packages", + list_dir: "List Dir", + ls: "Ls", + memory: "Memory", + multi_replace_string_in_file: "Multi Replace String In File", + open_integrated_browser: "Open Integrated Browser", + open_simple_browser: "Open Simple Browser", + read_file: "Read File", + view_image: "View Image", + read_notebook_cell_output: "Read Notebook Cell Output", + read_project_structure: "Read Project Structure", + replace_string_in_file: "Replace String In File", + "setup.agent": "Setup Agent", + selectEnvironment: "Select Environment", + run_notebook_cell: "Run Notebook Cell", + run_vscode_command: "Run VSCode Command", + runSubagent: "Run Subagent", + renderMermaidDiagram: "Render Mermaid Diagram", + runTests: "Run Tests", + search_workspace_symbols: "Search Workspace Symbols", + semantic_search: "Semantic Search", + switch_agent: "Switch Agent", + terminal_selection: "Terminal Selection", + test_failure: "Test Failure", + test_search: "Test Search", + tool_replay: "Tool Replay", + tool_search: "Tool Search", + vscode_askQuestions: "VSCode Ask Questions", + vscode_get_confirmation: "VSCode Get Confirmation", + vscode_get_confirmation_with_options: "VSCode Get Confirmation With Options", + vscode_get_terminal_confirmation: "VSCode Get Terminal Confirmation", + vscode_listCodeUsages: "VSCode List Code Usages", + vscode_renameSymbol: "VSCode Rename Symbol", + "mcp_io_github_ups_get-library-docs": "Context7 MCP: Get Library Docs", + "mcp_io_github_ups_query-docs": "Context7 MCP: Query Docs", + "mcp_io_github_ups_resolve-library-id": "Context7 MCP: Resolve Library ID", + "mcp_context7_query-docs": "Context7 MCP: Query Docs", + "mcp_context7_resolve-library-id": "Context7 MCP: Resolve Library ID", + mcp_microsoft_pla_browser_evaluate: "Playwright MCP: Browser Evaluate", + mcp_microsoft_pla_browser_install: "Playwright MCP: Browser Install", + mcp_microsoft_pla_browser_navigate: "Playwright MCP: Browser Navigate", + mcp_microsoft_pla_browser_run_code: "Playwright MCP: Browser Run Code", + mcp_microsoft_pla_browser_click: "Playwright MCP: Browser Click", + mcp_microsoft_pla_browser_fill_form: "Playwright MCP: Browser Fill Form", + mcp_microsoft_pla_browser_press_key: "Playwright MCP: Browser Press Key", + mcp_microsoft_pla_browser_resize: "Playwright MCP: Browser Resize", + mcp_microsoft_pla_browser_snapshot: "Playwright MCP: Browser Snapshot", + mcp_microsoft_pla_browser_tabs: "Playwright MCP: Browser Tabs", + mcp_microsoft_pla_browser_take_screenshot: "Playwright MCP: Browser Take Screenshot", + mcp_microsoft_pla_browser_type: "Playwright MCP: Browser Type", + mcp_playwright_browser_click: "Playwright MCP: Browser Click", + mcp_playwright_browser_navigate: "Playwright MCP: Browser Navigate", + mcp_playwright_browser_snapshot: "Playwright MCP: Browser Snapshot", + mcp_playwright_browser_take_screenshot: "Playwright MCP: Browser Take Screenshot", + mcp_pylance_mcp_s_pylanceDocString: "Pylance MCP: Pylance Doc String", + "mcp_chrome-devtoo_click": "Chrome DevTools MCP: Click", + "mcp_chrome-devtoo_evaluate_script": "Chrome DevTools MCP: Evaluate Script", + "mcp_chrome-devtoo_fill": "Chrome DevTools MCP: Fill", + "mcp_chrome-devtoo_get_network_request": "Chrome DevTools MCP: Get Network Request", + "mcp_chrome-devtoo_list_console_messages": "Chrome DevTools MCP: List Console Messages", + "mcp_chrome-devtoo_list_pages": "Chrome DevTools MCP: List Pages", + "mcp_chrome-devtoo_navigate_page": "Chrome DevTools MCP: Navigate Page", + "mcp_chrome-devtoo_new_page": "Chrome DevTools MCP: New Page", + "mcp_chrome-devtoo_select_page": "Chrome DevTools MCP: Select Page", + "mcp_chrome-devtoo_take_screenshot": "Chrome DevTools MCP: Take Screenshot", + "mcp_chrome-devtoo_fill_form": "Chrome DevTools MCP: Fill Form", + "mcp_chrome-devtoo_hover": "Chrome DevTools MCP: Hover", + "mcp_chrome-devtoo_list_network_requests": "Chrome DevTools MCP: List Network Requests", + "mcp_chrome-devtoo_press_key": "Chrome DevTools MCP: Press Key", + "mcp_chrome-devtoo_take_snapshot": "Chrome DevTools MCP: Take Snapshot", + "mcp_chrome-devtoo_wait_for": "Chrome DevTools MCP: Wait For", + mcp_chrome_devtoo_click: "Chrome DevTools MCP: Click", + mcp_chrome_devtoo_evaluate_script: "Chrome DevTools MCP: Evaluate Script", + mcp_chrome_devtoo_fill: "Chrome DevTools MCP: Fill", + mcp_chrome_devtoo_get_console_message: "Chrome DevTools MCP: Get Console Message", + mcp_chrome_devtoo_get_network_request: "Chrome DevTools MCP: Get Network Request", + mcp_chrome_devtoo_list_console_messages: "Chrome DevTools MCP: List Console Messages", + mcp_chrome_devtoo_list_network_requests: "Chrome DevTools MCP: List Network Requests", + mcp_chrome_devtoo_list_pages: "Chrome DevTools MCP: List Pages", + mcp_chrome_devtoo_navigate_page: "Chrome DevTools MCP: Navigate Page", + mcp_chrome_devtoo_new_page: "Chrome DevTools MCP: New Page", + mcp_chrome_devtoo_take_snapshot: "Chrome DevTools MCP: Take Snapshot", + mcp_chrome_devtoo_wait_for: "Chrome DevTools MCP: Wait For", + mcp_io_github_chr_click: "Chrome DevTools MCP: Click", + mcp_io_github_chr_emulate: "Chrome DevTools MCP: Emulate", + mcp_io_github_chr_evaluate_script: "Chrome DevTools MCP: Evaluate Script", + mcp_io_github_chr_list_network_requests: "Chrome DevTools MCP: List Network Requests", + mcp_io_github_chr_list_pages: "Chrome DevTools MCP: List Pages", + mcp_io_github_chr_navigate_page: "Chrome DevTools MCP: Navigate Page", + mcp_io_github_chr_new_page: "Chrome DevTools MCP: New Page", + mcp_io_github_chr_resize_page: "Chrome DevTools MCP: Resize Page", + mcp_io_github_chr_select_page: "Chrome DevTools MCP: Select Page", + mcp_io_github_chr_take_snapshot: "Chrome DevTools MCP: Take Snapshot", + mcp_oraios_serena_activate_project: "Serena: Activate Project", + mcp_oraios_serena_check_onboarding_performed: "Serena: Check Onboarding Performed", + mcp_oraios_serena_create_text_file: "Serena: Create Text File", + mcp_oraios_serena_delete_lines: "Serena: Delete Lines", + mcp_oraios_serena_delete_memory: "Serena: Delete Memory", + mcp_oraios_serena_edit_memory: "Serena: Edit Memory", + mcp_oraios_serena_execute_shell_command: "Serena: Execute Shell Command", + mcp_oraios_serena_find_file: "Serena: Find File", + mcp_oraios_serena_find_referencing_symbols: "Serena: Find Referencing Symbols", + mcp_oraios_serena_find_symbol: "Serena: Find Symbol", + mcp_oraios_serena_get_current_config: "Serena: Get Current Config", + mcp_oraios_serena_get_symbols_overview: "Serena: Get Symbols Overview", + mcp_oraios_serena_initial_instructions: "Serena: Initial Instructions", + mcp_oraios_serena_insert_after_symbol: "Serena: Insert After Symbol", + mcp_oraios_serena_insert_at_line: "Serena: Insert At Line", + mcp_oraios_serena_insert_before_symbol: "Serena: Insert Before Symbol", + mcp_oraios_serena_jet_brains_find_referencing_symbols: "Serena: JetBrains Find Referencing Symbols", + mcp_oraios_serena_jet_brains_find_symbol: "Serena: JetBrains Find Symbol", + mcp_oraios_serena_jet_brains_get_symbols_overview: "Serena: JetBrains Get Symbols Overview", + mcp_oraios_serena_jet_brains_type_hierarchy: "Serena: JetBrains Type Hierarchy", + mcp_oraios_serena_list_dir: "Serena: List Dir", + mcp_oraios_serena_list_memories: "Serena: List Memories", + mcp_oraios_serena_onboarding: "Serena: Onboarding", + mcp_oraios_serena_open_dashboard: "Serena: Open Dashboard", + mcp_oraios_serena_prepare_for_new_conversation: "Serena: Prepare For New Conversation", + mcp_oraios_serena_read_file: "Serena: Read File", + mcp_oraios_serena_read_memory: "Serena: Read Memory", + mcp_oraios_serena_remove_project: "Serena: Remove Project", + mcp_oraios_serena_rename_symbol: "Serena: Rename Symbol", + mcp_oraios_serena_replace_content: "Serena: Replace Content", + mcp_oraios_serena_replace_lines: "Serena: Replace Lines", + mcp_oraios_serena_replace_symbol_body: "Serena: Replace Symbol Body", + mcp_oraios_serena_restart_language_server: "Serena: Restart Language Server", + mcp_oraios_serena_search_for_pattern: "Serena: Search For Pattern", + mcp_oraios_serena_summarize_changes: "Serena: Summarize Changes", + mcp_oraios_serena_switch_modes: "Serena: Switch Modes", + mcp_oraios_serena_think_about_collected_information: "Serena: Think About Collected Information", + mcp_oraios_serena_think_about_task_adherence: "Serena: Think About Task Adherence", + mcp_oraios_serena_think_about_whether_you_are_done: "Serena: Think About Whether You Are Done", + mcp_oraios_serena_write_memory: "Serena: Write Memory", + "mcp_visuals-mcp_display_image": "Visuals MCP: Display Image", + bash: "Bash", + "claude-code": "Claude Code", + "copilot-cloud-agent": "Copilot Cloud Agent", + agent: "Agent", + copilotcli: "Copilot CLI", + "github.copilot.default": "GitHub Copilot Default", + "github.copilot.workspace": "GitHub Copilot Workspace", + "github.copilot.vscode": "GitHub Copilot VSCode", + glob: "Glob", + file_glob_search: "File Glob Search", + grep: "Grep", + kill_terminal: "Kill Terminal", + read: "Read", + view: "View", + vscode_editFile_internal: "VSCode Edit File (Internal)", + vscode_fetchWebPage_internal: "VSCode Fetch Web Page (Internal)", + vscode_searchExtensions_internal: "VSCode Search Extensions (Internal)", + "vscode-websearchforcopilot_webSearch": "VSCode WebSearch for Copilot: Web Search", + webfetch: "Web Fetch", + write: "Write", + edit: "Edit", + multiedit: "Multi Edit", + question: "Question", + skill: "Skill", + read_skill: "Read Skill", + task: "Task", + todowrite: "Todo Write", + todos: "Todos", + websearch: "Web Search", + navigate_page: "Navigate Page", + open_browser_page: "Open Browser Page", + read_page: "Read Page", + run_playwright_code: "Run Playwright Code", + screenshot_page: "Screenshot Page", + task_complete: "Task Complete", + "pdf-utilities.pdf": "PDF Utilities: PDF" + }; + + // src/webview/usage/main.ts + var vscode = acquireVsCodeApi(); + var initialData = window.__INITIAL_USAGE__; + var hygieneMatrixState = null; + var repoAnalysisState = /* @__PURE__ */ new Map(); + var selectedRepoPath = null; + var isSwitchingRepository = false; + var isBatchAnalysisInProgress = false; + var currentWorkspacePaths = []; + function escapeHtml(text) { + return text.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); + } + var TOOL_NAME_MAP = toolNames_default || null; + function lookupToolName(id) { + if (!TOOL_NAME_MAP) { + return id; + } + return TOOL_NAME_MAP[id] || id; + } + function lookupMcpToolName(id) { + const full = lookupToolName(id); + const colonIdx = full.indexOf(":"); + if (colonIdx !== -1) { + return full.substring(colonIdx + 1).trim(); + } + return full; + } + function getUnknownMcpTools(stats) { + const allTools = /* @__PURE__ */ new Set(); + Object.entries(stats.today.mcpTools.byTool).forEach(([tool]) => allTools.add(tool)); + Object.entries(stats.last30Days.mcpTools.byTool).forEach(([tool]) => allTools.add(tool)); + Object.entries(stats.month.mcpTools.byTool).forEach(([tool]) => allTools.add(tool)); + Object.entries(stats.today.toolCalls.byTool).forEach(([tool]) => allTools.add(tool)); + Object.entries(stats.last30Days.toolCalls.byTool).forEach(([tool]) => allTools.add(tool)); + Object.entries(stats.month.toolCalls.byTool).forEach(([tool]) => allTools.add(tool)); + return Array.from(allTools).filter((tool) => lookupToolName(tool) === tool).sort(); + } + function createMcpToolIssueUrl(unknownTools) { + const repoUrl = "https://github.com/rajbos/github-copilot-token-usage"; + const title = encodeURIComponent("Add missing friendly names for tools"); + const toolList = unknownTools.map((tool) => `- \`${tool}\``).join("\n"); + const body = encodeURIComponent( + `## Unknown Tools Found + +The following tools were detected but don't have friendly display names: + +${toolList} + +Please add friendly names for these tools to improve the user experience.` + ); + const labels = encodeURIComponent("MCP Toolnames"); + return `${repoUrl}/issues/new?title=${title}&body=${body}&labels=${labels}`; + } + function renderMissedPotential(stats) { + const missed = stats.missedPotential || window.__INITIAL_USAGE__?.missedPotential || []; + if (missed.length === 0) { + return ` +
    +
    + \u2705 No other AI tool configs missing a Copilot counterpart +
    +
    + All active workspaces that contain instruction files for other AI tools (e.g. .cursorrules, CLAUDE.md, AGENTS.md) also have Copilot customization files configured. +
    +
    + A workspace appears here when it has instruction files for other AI tools but no Copilot customization files \u2014 indicating Copilot may be under-configured compared to other tools. Learn how to add Copilot instructions. +
    +
    + `; + } + return ` +
    +
    + \u26A0\uFE0F Missed Potential: Non-Copilot Instruction Files +
    +
    + These active workspaces use other AI tools but lack Copilot customizations. Learn how to add Copilot instructions. +
    +
    + + + + + + + + + + + ${missed.map((ws) => ` + + + + + + + `).join("")} + +
    \u{1F4C2} WorkspaceSessionsInteractionsNon-Copilot Files Found
    + ${escapeHtml(ws.workspaceName)} + + ${formatNumber(ws.sessionCount)} + + ${formatNumber(ws.interactionCount)} + +
    + ${ws.nonCopilotFiles.map((f) => ` +
    + ${f.icon || "\u{1F4C4}"} + ${escapeHtml(f.label || "")}: + ${escapeHtml(f.relativePath)} +
    + `).join("")} +
    +
    +
    +
    + `; + } + function renderToolsTable(byTool, limit2 = 10, nameResolver = lookupToolName) { + const sortedTools = Object.entries(byTool).sort(([, a], [, b]) => b - a).slice(0, limit2); + if (sortedTools.length === 0) { + return '
    No tools used yet
    '; + } + const rows = sortedTools.map(([tool, count], idx) => { + const friendly = escapeHtml(nameResolver(tool)); + const idEscaped = escapeHtml(tool); + return ` + + ${idx + 1} + ${friendly} + ${formatNumber(count)} + `; + }).join(""); + return ` + + + + + + + + + + ${rows} + +
    #ToolCalls
    `; + } + function unionFill(map, keys) { + const result = { ...map }; + for (const k of keys) { + if (!(k in result)) { + result[k] = 0; + } + } + return result; + } + function sanitizeStats(raw) { + if (!raw || typeof raw !== "object") { + return null; + } + const coerceNumber = (value) => { + const n = Number(value); + return Number.isFinite(n) ? n : 0; + }; + const sanitizeModeUsage = (mode) => ({ + ask: coerceNumber(mode?.ask), + edit: coerceNumber(mode?.edit), + agent: coerceNumber(mode?.agent), + plan: coerceNumber(mode?.plan), + customAgent: coerceNumber(mode?.customAgent) + }); + const sanitizeContextRefs = (refs) => ({ + file: coerceNumber(refs?.file), + selection: coerceNumber(refs?.selection), + implicitSelection: coerceNumber(refs?.implicitSelection), + symbol: coerceNumber(refs?.symbol), + codebase: coerceNumber(refs?.codebase), + workspace: coerceNumber(refs?.workspace), + terminal: coerceNumber(refs?.terminal), + vscode: coerceNumber(refs?.vscode), + terminalLastCommand: coerceNumber(refs?.terminalLastCommand), + terminalSelection: coerceNumber(refs?.terminalSelection), + clipboard: coerceNumber(refs?.clipboard), + changes: coerceNumber(refs?.changes), + outputPanel: coerceNumber(refs?.outputPanel), + problemsPanel: coerceNumber(refs?.problemsPanel), + byKind: refs?.byKind ?? {}, + copilotInstructions: coerceNumber(refs?.copilotInstructions), + agentsMd: coerceNumber(refs?.agentsMd), + byPath: refs?.byPath ?? {} + }); + const sanitizePeriod = (period) => ({ + sessions: coerceNumber(period?.sessions), + modeUsage: sanitizeModeUsage(period?.modeUsage ?? {}), + contextReferences: sanitizeContextRefs(period?.contextReferences ?? {}), + toolCalls: { + total: coerceNumber(period?.toolCalls?.total), + byTool: period?.toolCalls?.byTool ?? {} + }, + mcpTools: { + total: coerceNumber(period?.mcpTools?.total), + byServer: period?.mcpTools?.byServer ?? {}, + byTool: period?.mcpTools?.byTool ?? {} + }, + modelSwitching: period?.modelSwitching ?? { + modelsPerSession: [], + totalSessions: 0, + averageModelsPerSession: 0, + maxModelsPerSession: 0, + minModelsPerSession: 0, + switchingFrequency: 0, + standardModels: [], + premiumModels: [], + unknownModels: [], + mixedTierSessions: 0, + standardRequests: 0, + premiumRequests: 0, + unknownRequests: 0, + totalRequests: 0 + } + }); + try { + const sanitized = { + today: sanitizePeriod(raw.today), + last30Days: sanitizePeriod(raw.last30Days), + month: sanitizePeriod(raw.month), + lastUpdated: typeof raw.lastUpdated === "string" ? raw.lastUpdated : "", + backendConfigured: !!raw.backendConfigured + }; + return sanitized; + } catch { + return null; + } + } + function renderLayout(stats) { + const root = document.getElementById("root"); + if (!root) { + return; + } + const matrix = stats?.customizationMatrix ?? window.__INITIAL_USAGE__?.customizationMatrix; + hygieneMatrixState = matrix ?? null; + if (!hygieneMatrixState || hygieneMatrixState.workspaces.length === 0) { + selectedRepoPath = null; + } + if (Array.isArray(stats.currentWorkspacePaths)) { + currentWorkspacePaths = stats.currentWorkspacePaths; + } + let customizationHtml = ""; + if (!matrix || !matrix.workspaces || matrix.workspaces.length === 0) { + customizationHtml = ` +
    +
    \u{1F6E0}\uFE0FCopilot Customization Files
    +
    Showing workspace customization status for active workspaces
    +
    No workspaces with customization files detected in the last 30 days.
    +
    `; + } else { + customizationHtml = ` +
    +
    + \u{1F6E0}\uFE0F Copilot Customization Files +
    +
    + Showing ${matrix.totalWorkspaces} workspace(s) with Copilot activity in the last 30 days. + ${matrix.workspacesWithIssues > 0 ? `\u26A0\uFE0F ${matrix.workspacesWithIssues} workspace(s) have no customization files.` : "\u2705 All workspaces have up-to-date customizations."} +
    +
    + + + + + + ${matrix.customizationTypes.map((type) => ` + + `).join("")} + + + + ${matrix.workspaces.map((ws) => { + const hasNoCustomization = Object.values(ws.typeStatuses).every((s) => s === "\u274C"); + return ` + + + + ${matrix.customizationTypes.map((type) => { + const status = ws.typeStatuses[type.id] || "\u2753"; + const statusLabel = status === "\u2705" ? "Present and fresh" : status === "\u26A0\uFE0F" ? "Present but stale" : status === "\u274C" ? "Missing" : "Status unknown"; + return ` + + `; + }).join("")} + + `; + }).join("")} + +
    \u{1F4C2} WorkspaceSessions + ${escapeHtml(type.icon)} +
    + ${escapeHtml(ws.workspaceName)}${hasNoCustomization ? ' \u26A0\uFE0F' : ""} + + ${ws.sessionCount} + + + ${statusLabel} +
    +
    +
    +
    + ${matrix.customizationTypes.map((type) => ` + ${escapeHtml(type.icon)} ${escapeHtml(type.label)} + `).join("")} +
    +
    + \u2705 = Present & Fresh  \u2022  \u26A0\uFE0F = Present but Stale  \u2022  \u274C = Missing +
    +
    +
    `; + } + const allToolKeys = [.../* @__PURE__ */ new Set([ + ...Object.keys(stats.today.toolCalls.byTool), + ...Object.keys(stats.last30Days.toolCalls.byTool), + ...Object.keys(stats.month.toolCalls.byTool) + ])]; + const allMcpToolKeys = [.../* @__PURE__ */ new Set([ + ...Object.keys(stats.today.mcpTools.byTool), + ...Object.keys(stats.last30Days.mcpTools.byTool), + ...Object.keys(stats.month.mcpTools.byTool) + ])]; + const allMcpServerKeys = [.../* @__PURE__ */ new Set([ + ...Object.keys(stats.today.mcpTools.byServer), + ...Object.keys(stats.last30Days.mcpTools.byServer), + ...Object.keys(stats.month.mcpTools.byServer) + ])]; + const allStandardModels = [.../* @__PURE__ */ new Set([ + ...stats.today.modelSwitching.standardModels, + ...stats.last30Days.modelSwitching.standardModels, + ...stats.month.modelSwitching.standardModels + ])]; + const allPremiumModels = [.../* @__PURE__ */ new Set([ + ...stats.today.modelSwitching.premiumModels, + ...stats.last30Days.modelSwitching.premiumModels, + ...stats.month.modelSwitching.premiumModels + ])]; + const allUnknownModels = [.../* @__PURE__ */ new Set([ + ...stats.today.modelSwitching.unknownModels, + ...stats.last30Days.modelSwitching.unknownModels, + ...stats.month.modelSwitching.unknownModels + ])]; + const todayTotalRefs = getTotalContextRefs(stats.today.contextReferences); + const last30DaysTotalRefs = getTotalContextRefs(stats.last30Days.contextReferences); + const todayTotalModes = stats.today.modeUsage.ask + stats.today.modeUsage.edit + stats.today.modeUsage.agent + stats.today.modeUsage.plan + stats.today.modeUsage.customAgent; + const last30DaysTotalModes = stats.last30Days.modeUsage.ask + stats.last30Days.modeUsage.edit + stats.last30Days.modeUsage.agent + stats.last30Days.modeUsage.plan + stats.last30Days.modeUsage.customAgent; + root.innerHTML = ` + + +
    +
    +
    + \u{1F4CA} + Usage Analysis +
    +
    + ${buttonHtml("btn-refresh")} + ${buttonHtml("btn-details")} + ${buttonHtml("btn-chart")} + ${buttonHtml("btn-environmental")} + ${buttonHtml("btn-diagnostics")} + ${buttonHtml("btn-maturity")} + ${stats.backendConfigured ? buttonHtml("btn-dashboard") : ""} +
    +
    + +
    +
    \u{1F4CB} About This Dashboard
    +
    + This dashboard analyzes your GitHub Copilot usage patterns by examining session log files. + It tracks modes (ask/edit/agent), tool usage, context references (#file, @workspace, etc.), + and MCP (Model Context Protocol) tools to help you understand how you interact with Copilot. +
    +
    + + +
    +
    \u{1F3AF}Interaction Modes
    +
    How you're using Copilot: Ask (chat), Edit (code edits), or Agent (autonomous tasks)
    +
    +
    +

    \u{1F4C5} Today

    +
    +
    +
    \u{1F4AC} Ask Mode${formatNumber(stats.today.modeUsage.ask)} (${formatPercent(todayTotalModes > 0 ? stats.today.modeUsage.ask / todayTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    \u270F\uFE0F Edit Mode${formatNumber(stats.today.modeUsage.edit)} (${formatPercent(todayTotalModes > 0 ? stats.today.modeUsage.edit / todayTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    \u{1F916} Agent Mode${formatNumber(stats.today.modeUsage.agent)} (${formatPercent(todayTotalModes > 0 ? stats.today.modeUsage.agent / todayTotalModes * 100 : 0, 0)})
    +
    +
    +
    \u{1F4CB} Plan Mode${formatNumber(stats.today.modeUsage.plan)} (${formatPercent(todayTotalModes > 0 ? stats.today.modeUsage.plan / todayTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    \u26A1 Custom Agent${formatNumber(stats.today.modeUsage.customAgent)} (${formatPercent(todayTotalModes > 0 ? stats.today.modeUsage.customAgent / todayTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    +

    \u{1F4CA} Last 30 Days

    +
    +
    +
    \u{1F4AC} Ask Mode${formatNumber(stats.last30Days.modeUsage.ask)} (${formatPercent(last30DaysTotalModes > 0 ? stats.last30Days.modeUsage.ask / last30DaysTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    \u270F\uFE0F Edit Mode${formatNumber(stats.last30Days.modeUsage.edit)} (${formatPercent(last30DaysTotalModes > 0 ? stats.last30Days.modeUsage.edit / last30DaysTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    \u{1F916} Agent Mode${formatNumber(stats.last30Days.modeUsage.agent)} (${formatPercent(last30DaysTotalModes > 0 ? stats.last30Days.modeUsage.agent / last30DaysTotalModes * 100 : 0, 0)})
    +
    +
    +
    \u{1F4CB} Plan Mode${formatNumber(stats.last30Days.modeUsage.plan)} (${formatPercent(last30DaysTotalModes > 0 ? stats.last30Days.modeUsage.plan / last30DaysTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    \u26A1 Custom Agent${formatNumber(stats.last30Days.modeUsage.customAgent)} (${formatPercent(last30DaysTotalModes > 0 ? stats.last30Days.modeUsage.customAgent / last30DaysTotalModes * 100 : 0, 0)})
    +
    +
    +
    +
    +
    + + +
    +
    \u{1F517}Context References
    +
    How often you reference files, selections, symbols, and workspace context
    +
    +
    \u{1F4C4} #file
    ${stats.last30Days.contextReferences.file}
    Today: ${stats.today.contextReferences.file}
    +
    \u2702\uFE0F #selection
    ${stats.last30Days.contextReferences.selection}
    Today: ${stats.today.contextReferences.selection}
    +
    \u2728 Implicit Selection
    ${stats.last30Days.contextReferences.implicitSelection}
    Today: ${stats.today.contextReferences.implicitSelection}
    +
    \u{1F524} #symbol
    ${stats.last30Days.contextReferences.symbol}
    Today: ${stats.today.contextReferences.symbol}
    +
    \u{1F5C2}\uFE0F #codebase
    ${stats.last30Days.contextReferences.codebase}
    Today: ${stats.today.contextReferences.codebase}
    +
    \u{1F4C1} @workspace
    ${stats.last30Days.contextReferences.workspace}
    Today: ${stats.today.contextReferences.workspace}
    +
    \u{1F4BB} @terminal
    ${stats.last30Days.contextReferences.terminal}
    Today: ${stats.today.contextReferences.terminal}
    +
    \u{1F527} @vscode
    ${stats.last30Days.contextReferences.vscode}
    Today: ${stats.today.contextReferences.vscode}
    +
    \u2328\uFE0F #terminalLastCommand
    ${stats.last30Days.contextReferences.terminalLastCommand || 0}
    Today: ${stats.today.contextReferences.terminalLastCommand || 0}
    +
    \u{1F5B1}\uFE0F #terminalSelection
    ${stats.last30Days.contextReferences.terminalSelection || 0}
    Today: ${stats.today.contextReferences.terminalSelection || 0}
    +
    \u{1F4CB} #clipboard
    ${stats.last30Days.contextReferences.clipboard || 0}
    Today: ${stats.today.contextReferences.clipboard || 0}
    +
    \u{1F4DD} #changes
    ${stats.last30Days.contextReferences.changes || 0}
    Today: ${stats.today.contextReferences.changes || 0}
    +
    \u{1F4E4} #outputPanel
    ${stats.last30Days.contextReferences.outputPanel || 0}
    Today: ${stats.today.contextReferences.outputPanel || 0}
    +
    \u26A0\uFE0F #problemsPanel
    ${stats.last30Days.contextReferences.problemsPanel || 0}
    Today: ${stats.today.contextReferences.problemsPanel || 0}
    +
    \u{1F4CB} Copilot Instructions
    ${stats.last30Days.contextReferences.copilotInstructions}
    Today: ${stats.today.contextReferences.copilotInstructions}
    +
    \u{1F916} Agents.md
    ${stats.last30Days.contextReferences.agentsMd}
    Today: ${stats.today.contextReferences.agentsMd}
    +
    \u{1F4CA} Total References
    ${last30DaysTotalRefs}
    Today: ${todayTotalRefs}
    +
    + ${Object.keys(stats.last30Days.contextReferences.byKind).length > 0 ? ` +
    +
    \u{1F4CE} Attached Files by Type (Last 30 Days)
    +
    + ${Object.entries(stats.last30Days.contextReferences.byKind).sort(([, a], [, b]) => b - a).slice(0, 5).map(([kind, count]) => `
    ${escapeHtml(kind)}: ${count}
    `).join("")} +
    +
    + ` : ""} + ${Object.keys(stats.last30Days.contextReferences.byPath).length > 0 ? ` +
    +
    \u{1F4C1} Most Referenced Files (Last 30 Days)
    +
    + ${Object.entries(stats.last30Days.contextReferences.byPath).sort(([, a], [, b]) => b - a).slice(0, 10).map(([path, count]) => `
    ${count}\xD7 ${escapeHtml(path)}
    `).join("")} +
    +
    + ` : ""} +
    + + ${customizationHtml} + ${renderMissedPotential(stats)} + + +
    +
    + \u{1F3D7}\uFE0F Repository Hygiene Analysis +
    +
    + Analyze repository hygiene and structure to identify missing configuration files and best practices. +
    + ${matrix && matrix.workspaces && matrix.workspaces.length > 0 ? ` +
    + Analyze All Repositories (${matrix.workspaces.length}) +
    +
    +
    \u{1F4C1} Repository List
    +
    +
    +
    +
    \u{1F4CA} Repository Details
    +
    +
    + ` : ` + Analyze Repo for Best Practices +
    + `} +
    + + +
    +
    \u{1F527}Tool Usage
    +
    Functions and tools invoked by Copilot during interactions
    +
    +
    +

    \u{1F4C5} Today

    +
    +
    Total Tool Calls: ${formatNumber(stats.today.toolCalls.total)}
    + ${renderToolsTable(unionFill(stats.today.toolCalls.byTool, allToolKeys), 10)} +
    +
    +
    +

    \u{1F4C6} Last 30 Days

    +
    +
    Total Tool Calls: ${formatNumber(stats.last30Days.toolCalls.total)}
    + ${renderToolsTable(unionFill(stats.last30Days.toolCalls.byTool, allToolKeys), 10)} +
    +
    +
    +

    \u{1F4C5} Previous Month

    +
    +
    Total Tool Calls: ${formatNumber(stats.month.toolCalls.total)}
    + ${renderToolsTable(unionFill(stats.month.toolCalls.byTool, allToolKeys), 10)} +
    +
    +
    +
    + + +
    +
    \u{1F50C}MCP Tools
    +
    Model Context Protocol (MCP) server and tool usage
    + ${(() => { + const unknownTools = getUnknownMcpTools(stats); + if (unknownTools.length > 0) { + const issueUrl = createMcpToolIssueUrl(unknownTools); + const toolListHtml = unknownTools.map((tool) => { + const todayCount = (stats.today.toolCalls.byTool[tool] || 0) + (stats.today.mcpTools.byTool[tool] || 0); + const last30Count = (stats.last30Days.toolCalls.byTool[tool] || 0) + (stats.last30Days.mcpTools.byTool[tool] || 0); + const monthCount = (stats.month.toolCalls.byTool[tool] || 0) + (stats.month.mcpTools.byTool[tool] || 0); + const countParts = []; + if (todayCount > 0) { + countParts.push(`${todayCount} today`); + } + if (last30Count > todayCount) { + countParts.push(`${last30Count} in the last 30d`); + } + if (monthCount > last30Count) { + countParts.push(`${monthCount} this month`); + } + const countHtml = countParts.length > 0 ? ` (${countParts.join(" | ")})` : ""; + return `${escapeHtml(tool)}${countHtml}`; + }).join(" "); + return ` +
    +
    + ${toolListHtml} +
    + + \u{1F4DD} + Report Unknown Tools + +
    + `; + } + return ""; + })()} +
    +
    +

    \u{1F4C5} Today

    +
    +
    Total MCP Calls: ${formatNumber(stats.today.mcpTools.total)}
    + ${allMcpServerKeys.length > 0 ? ` +
    By Server:
    ${renderToolsTable(unionFill(stats.today.mcpTools.byServer, allMcpServerKeys), 200)}
    + ` : '
    No MCP tools used yet
    '} +
    +
    +
    +

    \u{1F4C6} Last 30 Days

    +
    +
    Total MCP Calls: ${formatNumber(stats.last30Days.mcpTools.total)}
    + ${allMcpServerKeys.length > 0 ? ` +
    By Server:
    ${renderToolsTable(unionFill(stats.last30Days.mcpTools.byServer, allMcpServerKeys), 200)}
    + ` : '
    No MCP tools used yet
    '} +
    +
    +
    +

    \u{1F4C5} Previous Month

    +
    +
    Total MCP Calls: ${formatNumber(stats.month.mcpTools.total)}
    + ${allMcpServerKeys.length > 0 ? ` +
    By Server:
    ${renderToolsTable(unionFill(stats.month.mcpTools.byServer, allMcpServerKeys), 200)}
    + ` : '
    No MCP tools used yet
    '} +
    +
    +
    +
    +
    + ${allMcpToolKeys.length > 0 ? ` +
    +
    By Tool:
    ${renderToolsTable(unionFill(stats.today.mcpTools.byTool, allMcpToolKeys), 10, lookupMcpToolName)}
    +
    + ` : ""} +
    +
    + ${allMcpToolKeys.length > 0 ? ` +
    +
    By Tool:
    ${renderToolsTable(unionFill(stats.last30Days.mcpTools.byTool, allMcpToolKeys), 10, lookupMcpToolName)}
    +
    + ` : ""} +
    +
    + ${allMcpToolKeys.length > 0 ? ` +
    +
    By Tool:
    ${renderToolsTable(unionFill(stats.month.mcpTools.byTool, allMcpToolKeys), 10, lookupMcpToolName)}
    +
    + ` : ""} +
    +
    +
    + + +
    +
    \u{1F500}Multi-Model Usage
    +
    Track model diversity and switching patterns in your conversations
    +
    +
    +

    \u{1F4C5} Today

    +
    +
    +
    \u{1F4CA} Avg Models per Conversation
    +
    ${formatFixed(stats.today.modelSwitching.averageModelsPerSession, 1)}
    +
    +
    +
    \u{1F504} Switching Frequency
    +
    ${formatPercent(stats.today.modelSwitching.switchingFrequency, 0)}
    +
    Sessions with >1 model
    +
    +
    +
    \u{1F4C8} Max Models in Session
    +
    ${formatNumber(stats.today.modelSwitching.maxModelsPerSession || 0)}
    +
    +
    +
    +
    Models by Tier:
    +
    + ${allStandardModels.length > 0 ? ` +
    + \u{1F535} Standard: + ${allStandardModels.map(escapeHtml).join(", ")} +
    + ` : '
    '} + ${allPremiumModels.length > 0 ? ` +
    + \u2B50 Premium: + ${allPremiumModels.map(escapeHtml).join(", ")} +
    + ` : '
    '} + ${allUnknownModels.length > 0 ? ` +
    + \u2753 Unknown: + ${allUnknownModels.map(escapeHtml).join(", ")} +
    + ` : ""} +
    + ${stats.today.modelSwitching.totalRequests > 0 ? ` +
    +
    Request Count:
    + ${stats.today.modelSwitching.standardRequests > 0 ? ` +
    + \u{1F535} Standard: + ${formatNumber(stats.today.modelSwitching.standardRequests)} (${formatPercent(stats.today.modelSwitching.standardRequests / stats.today.modelSwitching.totalRequests * 100)}) +
    + ` : ""} + ${stats.today.modelSwitching.premiumRequests > 0 ? ` +
    + \u2B50 Premium: + ${formatNumber(stats.today.modelSwitching.premiumRequests)} (${formatPercent(stats.today.modelSwitching.premiumRequests / stats.today.modelSwitching.totalRequests * 100)}) +
    + ` : ""} + ${stats.today.modelSwitching.unknownRequests > 0 ? ` +
    + \u2753 Unknown: + ${formatNumber(stats.today.modelSwitching.unknownRequests)} (${formatPercent(stats.today.modelSwitching.unknownRequests / stats.today.modelSwitching.totalRequests * 100)}) +
    + ` : ""} +
    + ` : ""} + ${stats.today.modelSwitching.mixedTierSessions > 0 ? ` +
    + \u{1F500} Mixed tier sessions: ${formatNumber(stats.today.modelSwitching.mixedTierSessions)} +
    + ` : ""} +
    +
    +
    +

    \u{1F4C6} Last 30 Days

    +
    +
    +
    \u{1F4CA} Avg Models per Conversation
    +
    ${formatFixed(stats.last30Days.modelSwitching.averageModelsPerSession, 1)}
    +
    +
    +
    \u{1F504} Switching Frequency
    +
    ${formatPercent(stats.last30Days.modelSwitching.switchingFrequency, 0)}
    +
    Sessions with >1 model
    +
    +
    +
    \u{1F4C8} Max Models in Session
    +
    ${formatNumber(stats.last30Days.modelSwitching.maxModelsPerSession || 0)}
    +
    +
    +
    +
    Models by Tier:
    +
    + ${allStandardModels.length > 0 ? ` +
    + \u{1F535} Standard: + ${allStandardModels.map(escapeHtml).join(", ")} +
    + ` : '
    '} + ${allPremiumModels.length > 0 ? ` +
    + \u2B50 Premium: + ${allPremiumModels.map(escapeHtml).join(", ")} +
    + ` : '
    '} + ${allUnknownModels.length > 0 ? ` +
    + \u2753 Unknown: + ${allUnknownModels.map(escapeHtml).join(", ")} +
    + ` : ""} +
    + ${stats.last30Days.modelSwitching.totalRequests > 0 ? ` +
    +
    Request Count:
    + ${stats.last30Days.modelSwitching.standardRequests > 0 ? ` +
    + \u{1F535} Standard: + ${formatNumber(stats.last30Days.modelSwitching.standardRequests)} (${formatPercent(stats.last30Days.modelSwitching.standardRequests / stats.last30Days.modelSwitching.totalRequests * 100)}) +
    + ` : ""} + ${stats.last30Days.modelSwitching.premiumRequests > 0 ? ` +
    + \u2B50 Premium: + ${formatNumber(stats.last30Days.modelSwitching.premiumRequests)} (${formatPercent(stats.last30Days.modelSwitching.premiumRequests / stats.last30Days.modelSwitching.totalRequests * 100)}) +
    + ` : ""} + ${stats.last30Days.modelSwitching.unknownRequests > 0 ? ` +
    + \u2753 Unknown: + ${formatNumber(stats.last30Days.modelSwitching.unknownRequests)} (${formatPercent(stats.last30Days.modelSwitching.unknownRequests / stats.last30Days.modelSwitching.totalRequests * 100)}) +
    + ` : ""} +
    + ` : ""} + ${stats.last30Days.modelSwitching.mixedTierSessions > 0 ? ` +
    + \u{1F500} Mixed tier sessions: ${formatNumber(stats.last30Days.modelSwitching.mixedTierSessions)} +
    + ` : ""} +
    +
    +
    +

    \u{1F4C5} Previous Month

    +
    +
    +
    \u{1F4CA} Avg Models per Conversation
    +
    ${formatFixed(stats.month.modelSwitching.averageModelsPerSession, 1)}
    +
    +
    +
    \u{1F504} Switching Frequency
    +
    ${formatPercent(stats.month.modelSwitching.switchingFrequency, 0)}
    +
    Sessions with >1 model
    +
    +
    +
    \u{1F4C8} Max Models in Session
    +
    ${formatNumber(stats.month.modelSwitching.maxModelsPerSession || 0)}
    +
    +
    +
    +
    Models by Tier:
    +
    + ${allStandardModels.length > 0 ? ` +
    + \u{1F535} Standard: + ${allStandardModels.map(escapeHtml).join(", ")} +
    + ` : '
    '} + ${allPremiumModels.length > 0 ? ` +
    + \u2B50 Premium: + ${allPremiumModels.map(escapeHtml).join(", ")} +
    + ` : '
    '} + ${allUnknownModels.length > 0 ? ` +
    + \u2753 Unknown: + ${allUnknownModels.map(escapeHtml).join(", ")} +
    + ` : ""} +
    + ${stats.month.modelSwitching.totalRequests > 0 ? ` +
    +
    Request Count:
    + ${stats.month.modelSwitching.standardRequests > 0 ? ` +
    + \u{1F535} Standard: + ${formatNumber(stats.month.modelSwitching.standardRequests)} (${formatPercent(stats.month.modelSwitching.standardRequests / stats.month.modelSwitching.totalRequests * 100)}) +
    + ` : ""} + ${stats.month.modelSwitching.premiumRequests > 0 ? ` +
    + \u2B50 Premium: + ${formatNumber(stats.month.modelSwitching.premiumRequests)} (${formatPercent(stats.month.modelSwitching.premiumRequests / stats.month.modelSwitching.totalRequests * 100)}) +
    + ` : ""} + ${stats.month.modelSwitching.unknownRequests > 0 ? ` +
    + \u2753 Unknown: + ${formatNumber(stats.month.modelSwitching.unknownRequests)} (${formatPercent(stats.month.modelSwitching.unknownRequests / stats.month.modelSwitching.totalRequests * 100)}) +
    + ` : ""} +
    + ` : ""} + ${stats.month.modelSwitching.mixedTierSessions > 0 ? ` +
    + \u{1F500} Mixed tier sessions: ${formatNumber(stats.month.modelSwitching.mixedTierSessions)} +
    + ` : ""} +
    +
    +
    +
    + + +
    +
    \u{1F4C8}Sessions Summary
    +
    +
    \u{1F4C5} Today Sessions
    ${formatNumber(stats.today.sessions)}
    +
    \u{1F4C6} Last 30 Days Sessions
    ${formatNumber(stats.last30Days.sessions)}
    +
    \u{1F4C5} Previous Month Sessions
    ${formatNumber(stats.month.sessions)}
    +
    +
    + + +
    + `; + document.getElementById("btn-refresh")?.addEventListener("click", () => { + vscode.postMessage({ command: "refresh" }); + }); + document.getElementById("btn-details")?.addEventListener("click", () => { + vscode.postMessage({ command: "showDetails" }); + }); + document.getElementById("btn-chart")?.addEventListener("click", () => { + vscode.postMessage({ command: "showChart" }); + }); + document.getElementById("btn-diagnostics")?.addEventListener("click", () => { + vscode.postMessage({ command: "showDiagnostics" }); + }); + document.getElementById("btn-maturity")?.addEventListener("click", () => { + vscode.postMessage({ command: "showMaturity" }); + }); + document.getElementById("btn-dashboard")?.addEventListener("click", () => { + vscode.postMessage({ command: "showDashboard" }); + }); + document.getElementById("btn-environmental")?.addEventListener("click", () => { + vscode.postMessage({ command: "showEnvironmental" }); + }); + document.getElementById("btn-analyse-repo")?.addEventListener("click", () => { + const btn = document.getElementById("btn-analyse-repo"); + if (btn) { + btn.disabled = true; + btn.textContent = "Analyzing..."; + } + vscode.postMessage({ command: "analyseRepository" }); + }); + document.getElementById("btn-analyse-all")?.addEventListener("click", () => { + const btn = document.getElementById("btn-analyse-all"); + if (btn) { + btn.disabled = true; + btn.textContent = "Analyzing All..."; + } + isBatchAnalysisInProgress = true; + isSwitchingRepository = true; + selectedRepoPath = null; + renderRepositoryHygienePanels(); + vscode.postMessage({ command: "analyseAllRepositories" }); + }); + document.getElementById("repo-list-pane")?.addEventListener("click", (e) => { + const target = e.target; + const actionButton = target.closest(".btn-repo-action"); + if (!actionButton) { + return; + } + const workspacePath = actionButton.getAttribute("data-workspace-path"); + const action = actionButton.getAttribute("data-action"); + if (!workspacePath || !action) { + return; + } + if (action === "details") { + selectedRepoPath = workspacePath; + isSwitchingRepository = false; + renderRepositoryHygienePanels(); + return; + } + if (action === "analyze") { + actionButton.disabled = true; + actionButton.textContent = "Analyzing..."; + isBatchAnalysisInProgress = false; + vscode.postMessage({ command: "analyseRepository", workspacePath }); + } + }); + document.getElementById("repo-details-pane")?.addEventListener("click", (e) => { + const target = e.target; + if (target.closest("#btn-switch-repository")) { + isSwitchingRepository = true; + renderRepositoryHygienePanels(); + } + }); + renderRepositoryHygienePanels(); + Array.from(document.getElementsByClassName("cf-copy")).forEach((el2) => { + el2.addEventListener("click", (ev) => { + const target = ev.currentTarget; + const path = target.getAttribute("data-path") || ""; + if (navigator.clipboard && path) { + navigator.clipboard.writeText(path).then(() => { + target.textContent = "Copied"; + setTimeout(() => { + target.textContent = "Copy"; + }, 1200); + }).catch(() => { + vscode.postMessage({ command: "copyFailed", path }); + }); + } + }); + }); + } + window.addEventListener("message", (event) => { + const message = event.data; + switch (message.command) { + case "repoAnalysisResults": + displayRepoAnalysisResults(message.data, message.workspacePath); + break; + case "repoAnalysisError": + displayRepoAnalysisError(message.error, message.workspacePath); + break; + case "repoAnalysisBatchComplete": + handleBatchAnalysisComplete(); + break; + case "updateStats": + if (message.data?.locale) { + setFormatLocale(message.data.locale); + } + { + const sanitized = sanitizeStats(message.data); + if (sanitized) { + renderLayout(sanitized); + renderRepositoryHygienePanels(); + } + } + break; + case "highlightUnknownTools": { + const el2 = document.getElementById("unknown-mcp-tools-section"); + if (el2) { + el2.scrollIntoView({ behavior: "smooth", block: "center" }); + el2.style.transition = "box-shadow 0.3s ease"; + el2.style.boxShadow = "0 0 0 3px var(--vscode-focusBorder)"; + setTimeout(() => { + el2.style.boxShadow = ""; + }, 2e3); + } + break; + } + } + }); + function getWorkspaceName(workspacePath) { + const workspace = hygieneMatrixState?.workspaces.find((ws) => ws.workspacePath === workspacePath); + return workspace?.workspaceName || workspacePath; + } + function getScoreLabel(workspacePath) { + const record = repoAnalysisState.get(workspacePath); + if (record?.data?.summary) { + const percentage = toFiniteNumber(record.data.summary.percentage); + return `${Math.round(percentage)}%`; + } + if (record?.error) { + return "Error"; + } + return "\u2014"; + } + function toFiniteNumber(value) { + const numeric = typeof value === "number" ? value : Number(value); + return Number.isFinite(numeric) ? numeric : 0; + } + function buildRepoAnalysisBodyElement(data, workspacePath) { + const summary = data?.summary || {}; + const checks = Array.isArray(data?.checks) ? data.checks : []; + const recommendations = Array.isArray(data?.recommendations) ? [...data.recommendations] : []; + const docsLinks = { + "git-repo": "https://docs.github.com/en/get-started/using-git/about-git", + "gitignore": "https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files", + "env-example": "https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions", + "editorconfig": "https://editorconfig.org/", + "linter": "https://docs.github.com/en/code-security/code-scanning/introduction-to-code-scanning/about-code-scanning", + "formatter": "https://docs.github.com/en/contributing/style-guide-and-content-model/style-guide", + "type-safety": "https://docs.github.com/en/code-security/code-scanning/reference/code-ql-built-in-queries/javascript-typescript-built-in-queries", + "commit-messages": "https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/about-commits", + "conventional-commits": "https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets", + "ci-config": "https://docs.github.com/en/actions/about-github-actions/understanding-github-actions", + "scripts": "https://docs.github.com/en/actions/tutorials/build-and-test-code/nodejs", + "task-runner": "https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/add-scripts", + "devcontainer": "https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration", + "dockerfile": "https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry", + "version-pinning": "https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/setting-up-your-nodejs-project-for-codespaces", + "license": "https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository" + }; + const container = el("div"); + const header = el("div"); + header.setAttribute("style", "display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;"); + const title = el("div"); + title.setAttribute("style", "font-size: 14px; font-weight: 600; color: var(--text-primary);"); + title.textContent = "\u{1F4CA} Repository Hygiene Score"; + const score = el("div"); + score.setAttribute("style", "font-size: 24px; font-weight: 700; color: var(--link-color);"); + score.textContent = `${Math.round(toFiniteNumber(summary.percentage))}%`; + header.append(title, score); + container.appendChild(header); + const statsGrid = el("div"); + statsGrid.setAttribute("style", "display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px;"); + const statCards = [ + { + count: summary.passedChecks, + label: "Passed", + cardStyle: "text-align: center; padding: 8px; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); border-radius: 4px;", + countStyle: "font-size: 18px; font-weight: 600; color: var(--success-fg);" + }, + { + count: summary.warningChecks, + label: "Warnings", + cardStyle: "text-align: center; padding: 8px; background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); border-radius: 4px;", + countStyle: "font-size: 18px; font-weight: 600; color: var(--warning-fg);" + }, + { + count: summary.failedChecks, + label: "Failed", + cardStyle: "text-align: center; padding: 8px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 4px;", + countStyle: "font-size: 18px; font-weight: 600; color: #ef4444;" + } + ]; + for (const statCard of statCards) { + const card = el("div"); + card.setAttribute("style", statCard.cardStyle); + const count = el("div"); + count.setAttribute("style", statCard.countStyle); + count.textContent = String(toFiniteNumber(statCard.count)); + const label = el("div"); + label.setAttribute("style", "font-size: 10px; color: var(--text-secondary);"); + label.textContent = statCard.label; + card.append(count, label); + statsGrid.appendChild(card); + } + container.appendChild(statsGrid); + const scoreSummary = el("div"); + scoreSummary.setAttribute("style", "font-size: 11px; color: var(--text-muted); text-align: center; margin-bottom: 16px;"); + scoreSummary.textContent = `Score: ${toFiniteNumber(summary.totalScore)} / ${toFiniteNumber(summary.maxScore)} points`; + container.appendChild(scoreSummary); + const priorityOrder = { high: 1, medium: 2, low: 3 }; + recommendations.sort((a, b) => (priorityOrder[a?.priority] || 99) - (priorityOrder[b?.priority] || 99)); + const categories = {}; + for (const check of checks) { + const categoryId = typeof check?.category === "string" && check.category.length > 0 ? check.category : "other"; + if (!categories[categoryId]) { + categories[categoryId] = []; + } + categories[categoryId].push(check); + } + const categoryLabels = { + versionControl: "\u{1F504} Version Control", + codeQuality: "\u2728 Code Quality", + cicd: "\u{1F680} CI/CD", + environment: "\u{1F527} Environment", + documentation: "\u{1F4DA} Documentation" + }; + for (const [categoryId, categoryChecks] of Object.entries(categories)) { + const section = el("div"); + section.setAttribute("style", "margin-bottom: 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden;"); + const sectionHeader = el("div"); + sectionHeader.setAttribute("style", "padding: 8px 12px; background: var(--list-hover-bg); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center;"); + const categoryName = el("span"); + categoryName.setAttribute("style", "font-size: 12px; font-weight: 600; color: var(--text-primary);"); + categoryName.textContent = categoryLabels[categoryId] || categoryId; + const categorySummary = summary?.categories?.[categoryId]; + const categoryPct = el("span"); + categoryPct.setAttribute("style", "font-size: 11px; color: var(--link-color); font-weight: 600;"); + categoryPct.textContent = `${Math.round(toFiniteNumber(categorySummary?.percentage))}%`; + sectionHeader.append(categoryName, categoryPct); + section.appendChild(sectionHeader); + for (const check of categoryChecks) { + const status = check?.status === "pass" || check?.status === "warning" ? check.status : "fail"; + const statusIcon = status === "pass" ? "\u2705" : status === "warning" ? "\u26A0\uFE0F" : "\u274C"; + const statusColor = status === "pass" ? "#22c55e" : status === "warning" ? "#f59e0b" : "#ef4444"; + const checkRow = el("div"); + checkRow.setAttribute("style", "padding: 8px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: flex-start; gap: 8px;"); + const icon = el("span"); + icon.setAttribute("style", "font-size: 16px;"); + icon.textContent = statusIcon; + const content = el("div"); + content.setAttribute("style", "flex: 1;"); + const checkLabel = el("div"); + checkLabel.setAttribute("style", `font-size: 12px; font-weight: 600; color: ${statusColor};`); + checkLabel.textContent = typeof check?.label === "string" ? check.label : ""; + const checkDetail = el("div"); + checkDetail.setAttribute("style", "font-size: 11px; color: var(--text-secondary); margin-top: 2px;"); + checkDetail.textContent = typeof check?.detail === "string" ? check.detail : ""; + content.append(checkLabel, checkDetail); + if (typeof check?.hint === "string" && check.hint.length > 0) { + const hint = el("div"); + hint.setAttribute("style", "font-size: 10px; color: var(--link-color); margin-top: 4px; font-style: italic;"); + hint.textContent = `\u{1F4A1} ${check.hint}`; + content.appendChild(hint); + } + const checkId = typeof check?.id === "string" ? check.id : ""; + const docUrl = docsLinks[checkId]; + if (docUrl) { + const docLink = el("a"); + docLink.setAttribute("href", docUrl); + docLink.setAttribute("style", "font-size: 10px; color: var(--link-color); margin-top: 4px; display: inline-block;"); + docLink.setAttribute("title", "View official documentation"); + docLink.textContent = "\u{1F4D6} View documentation"; + content.appendChild(docLink); + } + const weight = el("span"); + weight.setAttribute("style", "font-size: 10px; color: var(--text-muted); min-width: 30px; text-align: right;"); + weight.textContent = `+${toFiniteNumber(check?.weight)}`; + checkRow.append(icon, content, weight); + section.appendChild(checkRow); + } + container.appendChild(section); + } + if (recommendations.length > 0) { + const recommendationsSection = el("div"); + recommendationsSection.setAttribute("style", "margin-top: 16px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden;"); + const recommendationsHeader = el("div"); + recommendationsHeader.setAttribute("style", "padding: 8px 12px; background: var(--list-hover-bg); border-bottom: 1px solid var(--border-color);"); + const recommendationsTitle = el("span"); + recommendationsTitle.setAttribute("style", "font-size: 12px; font-weight: 600; color: var(--text-primary);"); + recommendationsTitle.textContent = "\u{1F4A1} Top Recommendations"; + recommendationsHeader.appendChild(recommendationsTitle); + recommendationsSection.appendChild(recommendationsHeader); + for (const recommendation of recommendations.slice(0, 5)) { + const priority = recommendation?.priority === "high" || recommendation?.priority === "medium" ? recommendation.priority : "low"; + const priorityColor = priority === "high" ? "#ef4444" : priority === "medium" ? "#f59e0b" : "#60a5fa"; + const row = el("div"); + row.setAttribute("style", "padding: 8px; border-bottom: 1px solid var(--border-subtle); display: flex; gap: 8px;"); + const priorityLabel = el("span"); + priorityLabel.setAttribute("style", `font-size: 10px; font-weight: 600; color: ${priorityColor}; min-width: 50px;`); + priorityLabel.textContent = String(priority).toUpperCase(); + const content = el("div"); + content.setAttribute("style", "flex: 1;"); + const action = el("div"); + action.setAttribute("style", "font-size: 11px; color: var(--text-primary);"); + action.textContent = typeof recommendation?.action === "string" ? recommendation.action : ""; + const impact = el("div"); + impact.setAttribute("style", "font-size: 10px; color: var(--text-muted); margin-top: 2px;"); + impact.textContent = typeof recommendation?.impact === "string" ? recommendation.impact : ""; + content.append(action, impact); + const weight = el("span"); + weight.setAttribute("style", "font-size: 10px; color: var(--text-muted); min-width: 30px; text-align: right;"); + weight.textContent = `+${toFiniteNumber(recommendation?.weight)}`; + row.append(priorityLabel, content, weight); + recommendationsSection.appendChild(row); + } + container.appendChild(recommendationsSection); + } + const failedChecks = checks.filter((c) => c?.status === "fail" || c?.status === "warning"); + if (failedChecks.length > 0) { + const copilotSection = el("div"); + copilotSection.setAttribute("style", "margin-top: 16px; padding: 12px; background: rgba(96, 165, 250, 0.07); border: 1px solid rgba(96, 165, 250, 0.3); border-radius: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px;"); + const copilotText = el("div"); + copilotText.setAttribute("style", "font-size: 11px; color: var(--text-secondary); flex: 1;"); + copilotText.textContent = "Let Copilot help you fix the identified issues in this repository."; + const copilotBtn = document.createElement("vscode-button"); + copilotBtn.setAttribute("style", "min-width: 180px;"); + copilotBtn.textContent = "\u{1F916} Ask Copilot to Improve"; + copilotBtn.addEventListener("click", () => { + const failedLines = failedChecks.map((c) => `- ${c.label}: ${c.detail || ""}${c.hint ? ` (${c.hint})` : ""}`).join("\n"); + const prompt = `Please help me improve this repository by addressing the following best practice issues: + +${failedLines} + +For each issue, please provide specific steps or code changes to fix it.`; + const isRepoOpen = !workspacePath || currentWorkspacePaths.some( + (p) => p.toLowerCase() === workspacePath.toLowerCase() + ); + if (isRepoOpen) { + vscode.postMessage({ command: "openCopilotChatWithPrompt", prompt }); + } else { + const repoFolderName = workspacePath.split(/[/\\]/).filter(Boolean).pop() ?? workspacePath; + copilotSection.replaceChildren(); + copilotSection.setAttribute("style", "margin-top: 16px; padding: 12px; background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.4); border-radius: 4px; display: flex; flex-direction: column; gap: 8px;"); + const instructions = el("div"); + instructions.setAttribute("style", "font-size: 11px; color: var(--warning-fg);"); + instructions.textContent = `\u26A0\uFE0F Open "${repoFolderName}" in VS Code first, then paste this prompt into Copilot Chat:`; + const promptBox = el("pre"); + promptBox.setAttribute("style", "font-size: 10px; color: var(--text-secondary); background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 4px; padding: 8px; white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow-y: auto; font-family: monospace; margin: 0;"); + promptBox.textContent = prompt; + const copyBtn = document.createElement("vscode-button"); + copyBtn.setAttribute("appearance", "secondary"); + copyBtn.textContent = "\u{1F4CB} Copy prompt"; + copyBtn.addEventListener("click", () => { + navigator.clipboard.writeText(prompt).then(() => { + copyBtn.textContent = "\u2705 Copied!"; + setTimeout(() => { + copyBtn.textContent = "\u{1F4CB} Copy prompt"; + }, 2e3); + }); + }); + copilotSection.append(instructions, promptBox, copyBtn); + } + }); + copilotSection.append(copilotText, copilotBtn); + container.appendChild(copilotSection); + } + return container; + } + function renderRepositoryHygienePanels() { + const listPane = document.getElementById("repo-list-pane"); + const listContainer = document.getElementById("repo-list-pane-container"); + const detailsPane = document.getElementById("repo-details-pane"); + const detailsContainer = document.getElementById("repo-details-pane-container"); + if (!listPane || !listContainer || !detailsPane || !detailsContainer || !hygieneMatrixState) { + return; + } + const hasSelectedRepository = !!selectedRepoPath && !isSwitchingRepository; + const visibleWorkspaces = hasSelectedRepository ? hygieneMatrixState.workspaces.filter((ws) => ws.workspacePath === selectedRepoPath) : hygieneMatrixState.workspaces; + listContainer.classList.remove("repo-hygiene-pane-collapsed"); + detailsContainer.classList.toggle("repo-hygiene-pane-collapsed", !hasSelectedRepository); + listPane.innerHTML = visibleWorkspaces.map((ws, idx) => { + const record2 = repoAnalysisState.get(ws.workspacePath); + const hasResult = !!record2?.data?.summary; + const scoreLabel = getScoreLabel(ws.workspacePath); + const buttonLabel = hasResult ? "Details" : "Analyze"; + const buttonAction = hasResult ? "details" : "analyze"; + const isCurrentSelection = selectedRepoPath === ws.workspacePath && hasSelectedRepository; + return ` +
    +
    +
    + ${escapeHtml(ws.workspaceName)} +
    +
    + ${Number(ws.sessionCount) || 0} ${ws.sessionCount === 1 ? "session" : "sessions"} \xB7 ${Number(ws.interactionCount) || 0} ${ws.interactionCount === 1 ? "interaction" : "interactions"} \xB7 Score: ${escapeHtml(scoreLabel)} +
    +
    + + ${buttonLabel} + +
    + `; + }).join(""); + if (!hasSelectedRepository || !selectedRepoPath) { + detailsPane.replaceChildren(); + return; + } + const workspaceName = getWorkspaceName(selectedRepoPath); + const record = repoAnalysisState.get(selectedRepoPath); + if (record?.data) { + detailsPane.replaceChildren(); + const card = el("div", "repo-details-card"); + card.setAttribute("style", "padding: 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px;"); + const header = el("div", "repo-details-card-header"); + header.setAttribute("style", "display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px;"); + const label = el("div"); + label.setAttribute("style", "font-size: 12px; color: var(--text-secondary);"); + label.textContent = "Repository: "; + const repoName = el("span"); + repoName.setAttribute("style", "color: var(--text-primary); font-weight: 600; font-family: 'Courier New', monospace;"); + repoName.textContent = workspaceName; + label.appendChild(repoName); + const switchButton = document.createElement("vscode-button"); + switchButton.id = "btn-switch-repository"; + switchButton.setAttribute("style", "min-width: 120px;"); + switchButton.textContent = "Switch Repository"; + header.append(label, switchButton); + card.append(header, buildRepoAnalysisBodyElement(record.data, selectedRepoPath ?? void 0)); + detailsPane.appendChild(card); + return; + } + if (record?.error) { + detailsPane.innerHTML = ` +
    +
    +
    Repository: ${escapeHtml(workspaceName)}
    + Switch Repository +
    +
    \u274C Analysis Failed
    +
    ${escapeHtml(record.error)}
    +
    + `; + return; + } + detailsPane.innerHTML = ` +
    +
    +
    Repository: ${escapeHtml(workspaceName)}
    + Switch Repository +
    +
    No analysis data yet. Click Analyze in the list.
    +
    + `; + } + function displayRepoAnalysisResults(data, workspacePath) { + if (workspacePath) { + repoAnalysisState.set(workspacePath, { data, error: void 0 }); + if (!isBatchAnalysisInProgress) { + selectedRepoPath = workspacePath; + isSwitchingRepository = false; + } + renderRepositoryHygienePanels(); + return; + } + const btn = document.getElementById("btn-analyse-repo"); + if (btn) { + btn.disabled = false; + btn.textContent = "Analyze Repo for Best Practices"; + } + const resultsHost = document.getElementById("repo-analysis-results"); + if (resultsHost) { + resultsHost.replaceChildren(); + const card = el("div", "repo-analysis-card"); + card.setAttribute("style", "padding: 12px; background: var(--bg-secondary); border: 1px solid var(--border-color); border-radius: 6px; margin-bottom: 12px;"); + card.appendChild(buildRepoAnalysisBodyElement(data, workspacePath)); + resultsHost.appendChild(card); + } + } + function displayRepoAnalysisError(error, workspacePath) { + if (workspacePath) { + repoAnalysisState.set(workspacePath, { data: void 0, error }); + if (!isBatchAnalysisInProgress) { + selectedRepoPath = workspacePath; + isSwitchingRepository = false; + } + renderRepositoryHygienePanels(); + return; + } + const btn = document.getElementById("btn-analyse-repo"); + if (btn) { + btn.disabled = false; + btn.textContent = "Analyze Repo for Best Practices"; + } + const resultsHost = document.getElementById("repo-analysis-results"); + if (resultsHost) { + resultsHost.innerHTML = ` +
    +
    \u274C Analysis Failed
    +
    ${escapeHtml(error)}
    +
    + `; + } + } + function handleBatchAnalysisComplete() { + isBatchAnalysisInProgress = false; + isSwitchingRepository = true; + selectedRepoPath = null; + renderRepositoryHygienePanels(); + const btn = document.getElementById("btn-analyse-all"); + if (btn) { + btn.disabled = false; + const matrix = initialData?.customizationMatrix; + const count = matrix?.workspaces?.length || 0; + btn.textContent = `Analyze All Repositories (${count})`; + } + } + async function bootstrap() { + const { provideVSCodeDesignSystem: provideVSCodeDesignSystem2, vsCodeButton: vsCodeButton2 } = await Promise.resolve().then(() => (init_dist3(), dist_exports)); + provideVSCodeDesignSystem2().register(vsCodeButton2()); + if (!initialData) { + const root = document.getElementById("root"); + if (root) { + root.textContent = "No data available."; + } + return; + } + console.log("[Usage Analysis] Browser default locale:", Intl.DateTimeFormat().resolvedOptions().locale); + console.log("[Usage Analysis] Received locale from extension:", initialData.locale); + console.log("[Usage Analysis] Test format 1234567.89 with received locale:", new Intl.NumberFormat(initialData.locale).format(123456789e-2)); + setFormatLocale(initialData.locale); + renderLayout(initialData); + } + void bootstrap(); +})(); +/*! Bundled license information: + +tslib/tslib.es6.js: + (*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + 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. + ***************************************************************************** *) + +tabbable/dist/index.esm.js: + (*! + * tabbable 5.3.3 + * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE + *) +*/ +//# sourceMappingURL=usage.js.map diff --git a/visualstudio-extension/src/CopilotTokenTrackerRunner/CopilotTokenTrackerRunner.csproj b/visualstudio-extension/src/CopilotTokenTrackerRunner/CopilotTokenTrackerRunner.csproj new file mode 100644 index 00000000..1dbcdd83 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTrackerRunner/CopilotTokenTrackerRunner.csproj @@ -0,0 +1,16 @@ + + + + Exe + net472 + latest + enable + CopilotTokenTrackerRunner + CopilotTokenTrackerRunner + + + + + + + diff --git a/visualstudio-extension/src/CopilotTokenTrackerRunner/Program.cs b/visualstudio-extension/src/CopilotTokenTrackerRunner/Program.cs new file mode 100644 index 00000000..d1096d67 --- /dev/null +++ b/visualstudio-extension/src/CopilotTokenTrackerRunner/Program.cs @@ -0,0 +1,17 @@ +using System; + +namespace CopilotTokenTrackerRunner +{ + internal static class Program + { + private static int Main(string[] args) + { + Console.WriteLine( + "CopilotTokenTracker is a Visual Studio extension (VSIX)." + Environment.NewLine + + "Build the solution, then run/debug the extension via Visual Studio experimental instance." + Environment.NewLine + + "This runner project exists only so the solution can be started without errors."); + + return 0; + } + } +} diff --git a/.npmrc b/vscode-extension/.npmrc similarity index 100% rename from .npmrc rename to vscode-extension/.npmrc diff --git a/.vscode-test.mjs b/vscode-extension/.vscode-test.mjs similarity index 100% rename from .vscode-test.mjs rename to vscode-extension/.vscode-test.mjs diff --git a/.vscodeignore b/vscode-extension/.vscodeignore similarity index 100% rename from .vscodeignore rename to vscode-extension/.vscodeignore diff --git a/esbuild.js b/vscode-extension/esbuild.js similarity index 100% rename from esbuild.js rename to vscode-extension/esbuild.js diff --git a/eslint.config.mjs b/vscode-extension/eslint.config.mjs similarity index 100% rename from eslint.config.mjs rename to vscode-extension/eslint.config.mjs diff --git a/package-lock.json b/vscode-extension/package-lock.json similarity index 100% rename from package-lock.json rename to vscode-extension/package-lock.json diff --git a/package.json b/vscode-extension/package.json similarity index 97% rename from package.json rename to vscode-extension/package.json index 386369e8..e2f3379e 100644 --- a/package.json +++ b/vscode-extension/package.json @@ -281,14 +281,14 @@ "check-types": "tsc --noEmit", "lint": "eslint src", "lint:css": "stylelint \"src/webview/**/*.css\"", - "lint:json": "node scripts/validate-json.js", + "lint:json": "node ../scripts/validate-json.js", "test": "vscode-test", "test:node": "npm run compile-tests && node --require ./out/test/unit/vscode-shim-register.js --test --test-force-exit out/test/unit/*.test.js", "test:coverage": "npm run compile-tests && node --require ./out/test/unit/vscode-shim-register.js --experimental-test-coverage --test --test-force-exit --test-coverage-lines=80 --test-coverage-functions=80 --test-coverage-branches=60 --test-coverage-include=out/src/backend/**/*.js --test-coverage-include=out/src/utils/**/*.js out/test/unit/*.test.js", - "pre-release": "node scripts/pre-release.js", - "capture-screenshots": "pwsh -File scripts/capture-screenshots.ps1", - "sync-changelog": "node scripts/sync-changelog.js", - "sync-changelog:test": "node scripts/sync-changelog.js --test", + "pre-release": "node ../scripts/pre-release.js", + "capture-screenshots": "pwsh -File ../scripts/capture-screenshots.ps1", + "sync-changelog": "node ../scripts/sync-changelog.js", + "sync-changelog:test": "node ../scripts/sync-changelog.js --test", "cli:build": "cd cli && npm install && npm run build", "cli:build:production": "cd cli && npm install && npm run build:production", "cli:stats": "cd cli && node dist/cli.js stats", diff --git a/publish.ps1 b/vscode-extension/publish.ps1 similarity index 100% rename from publish.ps1 rename to vscode-extension/publish.ps1 diff --git a/src/README.md b/vscode-extension/src/README.md similarity index 100% rename from src/README.md rename to vscode-extension/src/README.md diff --git a/src/backend/commands.ts b/vscode-extension/src/backend/commands.ts similarity index 100% rename from src/backend/commands.ts rename to vscode-extension/src/backend/commands.ts diff --git a/src/backend/configPanel.ts b/vscode-extension/src/backend/configPanel.ts similarity index 100% rename from src/backend/configPanel.ts rename to vscode-extension/src/backend/configPanel.ts diff --git a/src/backend/configurationFlow.ts b/vscode-extension/src/backend/configurationFlow.ts similarity index 100% rename from src/backend/configurationFlow.ts rename to vscode-extension/src/backend/configurationFlow.ts diff --git a/src/backend/constants.ts b/vscode-extension/src/backend/constants.ts similarity index 100% rename from src/backend/constants.ts rename to vscode-extension/src/backend/constants.ts diff --git a/src/backend/copyConfig.ts b/vscode-extension/src/backend/copyConfig.ts similarity index 100% rename from src/backend/copyConfig.ts rename to vscode-extension/src/backend/copyConfig.ts diff --git a/src/backend/displayNames.ts b/vscode-extension/src/backend/displayNames.ts similarity index 100% rename from src/backend/displayNames.ts rename to vscode-extension/src/backend/displayNames.ts diff --git a/src/backend/facade.ts b/vscode-extension/src/backend/facade.ts similarity index 100% rename from src/backend/facade.ts rename to vscode-extension/src/backend/facade.ts diff --git a/src/backend/identity.ts b/vscode-extension/src/backend/identity.ts similarity index 100% rename from src/backend/identity.ts rename to vscode-extension/src/backend/identity.ts diff --git a/src/backend/integration.ts b/vscode-extension/src/backend/integration.ts similarity index 100% rename from src/backend/integration.ts rename to vscode-extension/src/backend/integration.ts diff --git a/src/backend/repoHygieneSkill.ts b/vscode-extension/src/backend/repoHygieneSkill.ts similarity index 100% rename from src/backend/repoHygieneSkill.ts rename to vscode-extension/src/backend/repoHygieneSkill.ts diff --git a/src/backend/rollups.ts b/vscode-extension/src/backend/rollups.ts similarity index 100% rename from src/backend/rollups.ts rename to vscode-extension/src/backend/rollups.ts diff --git a/src/backend/services/azureResourceService.ts b/vscode-extension/src/backend/services/azureResourceService.ts similarity index 100% rename from src/backend/services/azureResourceService.ts rename to vscode-extension/src/backend/services/azureResourceService.ts diff --git a/src/backend/services/blobUploadService.ts b/vscode-extension/src/backend/services/blobUploadService.ts similarity index 100% rename from src/backend/services/blobUploadService.ts rename to vscode-extension/src/backend/services/blobUploadService.ts diff --git a/src/backend/services/credentialService.ts b/vscode-extension/src/backend/services/credentialService.ts similarity index 100% rename from src/backend/services/credentialService.ts rename to vscode-extension/src/backend/services/credentialService.ts diff --git a/src/backend/services/dataPlaneService.ts b/vscode-extension/src/backend/services/dataPlaneService.ts similarity index 100% rename from src/backend/services/dataPlaneService.ts rename to vscode-extension/src/backend/services/dataPlaneService.ts diff --git a/src/backend/services/queryService.ts b/vscode-extension/src/backend/services/queryService.ts similarity index 100% rename from src/backend/services/queryService.ts rename to vscode-extension/src/backend/services/queryService.ts diff --git a/src/backend/services/syncService.ts b/vscode-extension/src/backend/services/syncService.ts similarity index 100% rename from src/backend/services/syncService.ts rename to vscode-extension/src/backend/services/syncService.ts diff --git a/src/backend/services/utilityService.ts b/vscode-extension/src/backend/services/utilityService.ts similarity index 100% rename from src/backend/services/utilityService.ts rename to vscode-extension/src/backend/services/utilityService.ts diff --git a/src/backend/settings.ts b/vscode-extension/src/backend/settings.ts similarity index 100% rename from src/backend/settings.ts rename to vscode-extension/src/backend/settings.ts diff --git a/src/backend/sharingProfile.ts b/vscode-extension/src/backend/sharingProfile.ts similarity index 100% rename from src/backend/sharingProfile.ts rename to vscode-extension/src/backend/sharingProfile.ts diff --git a/src/backend/storageTables.ts b/vscode-extension/src/backend/storageTables.ts similarity index 100% rename from src/backend/storageTables.ts rename to vscode-extension/src/backend/storageTables.ts diff --git a/src/backend/types.ts b/vscode-extension/src/backend/types.ts similarity index 100% rename from src/backend/types.ts rename to vscode-extension/src/backend/types.ts diff --git a/src/backend/ui/messages.ts b/vscode-extension/src/backend/ui/messages.ts similarity index 100% rename from src/backend/ui/messages.ts rename to vscode-extension/src/backend/ui/messages.ts diff --git a/src/cacheManager.ts b/vscode-extension/src/cacheManager.ts similarity index 100% rename from src/cacheManager.ts rename to vscode-extension/src/cacheManager.ts diff --git a/src/continue.ts b/vscode-extension/src/continue.ts similarity index 100% rename from src/continue.ts rename to vscode-extension/src/continue.ts diff --git a/src/crush.ts b/vscode-extension/src/crush.ts similarity index 100% rename from src/crush.ts rename to vscode-extension/src/crush.ts diff --git a/src/customizationPatterns.json b/vscode-extension/src/customizationPatterns.json similarity index 100% rename from src/customizationPatterns.json rename to vscode-extension/src/customizationPatterns.json diff --git a/src/extension.ts b/vscode-extension/src/extension.ts similarity index 100% rename from src/extension.ts rename to vscode-extension/src/extension.ts diff --git a/src/maturityScoring.ts b/vscode-extension/src/maturityScoring.ts similarity index 100% rename from src/maturityScoring.ts rename to vscode-extension/src/maturityScoring.ts diff --git a/src/modelPricing.json b/vscode-extension/src/modelPricing.json similarity index 100% rename from src/modelPricing.json rename to vscode-extension/src/modelPricing.json diff --git a/src/opencode.ts b/vscode-extension/src/opencode.ts similarity index 100% rename from src/opencode.ts rename to vscode-extension/src/opencode.ts diff --git a/src/sessionDiscovery.ts b/vscode-extension/src/sessionDiscovery.ts similarity index 100% rename from src/sessionDiscovery.ts rename to vscode-extension/src/sessionDiscovery.ts diff --git a/src/sessionParser.ts b/vscode-extension/src/sessionParser.ts similarity index 89% rename from src/sessionParser.ts rename to vscode-extension/src/sessionParser.ts index a0e6b05d..5b7d62a9 100644 --- a/src/sessionParser.ts +++ b/vscode-extension/src/sessionParser.ts @@ -201,6 +201,7 @@ export function parseSessionFileContent( let totalInputTokens = 0; let totalOutputTokens = 0; let totalThinkingTokens = 0; + let totalActualTokens = 0; let sessionJson: any | undefined; @@ -298,7 +299,8 @@ export function parseSessionFileContent( tokens: totalInputTokens + totalOutputTokens + totalThinkingTokens, interactions, modelUsage, - thinkingTokens: totalThinkingTokens + thinkingTokens: totalThinkingTokens, + actualTokens: 0, // delta-based JSONL: no result.usage fields to read }; } @@ -306,7 +308,7 @@ export function parseSessionFileContent( try { sessionJson = JSON.parse(fileContent.trim()); } catch { - return { tokens: 0, interactions: 0, modelUsage: {}, thinkingTokens: 0 }; + return { tokens: 0, interactions: 0, modelUsage: {}, thinkingTokens: 0, actualTokens: 0 }; } } @@ -315,7 +317,7 @@ export function parseSessionFileContent( try { sessionJson = JSON.parse(fileContent); } catch { - return { tokens: 0, interactions: 0, modelUsage: {}, thinkingTokens: 0 }; + return { tokens: 0, interactions: 0, modelUsage: {}, thinkingTokens: 0, actualTokens: 0 }; } } @@ -362,13 +364,29 @@ export function parseSessionFileContent( } } } + + // Extract actual token counts from LLM API usage data (mirrors extension's estimateTokensFromSession logic) + if (request?.result?.usage) { + // OLD FORMAT (pre-Feb 2026) + const u = request.result.usage; + const prompt = typeof u.promptTokens === 'number' ? u.promptTokens : 0; + const completion = typeof u.completionTokens === 'number' ? u.completionTokens : 0; + totalActualTokens += prompt + completion; + } else if (typeof request?.result?.promptTokens === 'number' && typeof request?.result?.outputTokens === 'number') { + // NEW FORMAT (Feb 2026+) + totalActualTokens += request.result.promptTokens + request.result.outputTokens; + } else if (request?.result?.metadata && typeof request?.result?.metadata?.promptTokens === 'number' && typeof request?.result?.metadata?.outputTokens === 'number') { + // INSIDERS FORMAT (Feb 2026+): Tokens nested under result.metadata + totalActualTokens += request.result.metadata.promptTokens + request.result.metadata.outputTokens; + } } return { tokens: totalInputTokens + totalOutputTokens + totalThinkingTokens, interactions, modelUsage, - thinkingTokens: totalThinkingTokens + thinkingTokens: totalThinkingTokens, + actualTokens: totalActualTokens, }; } diff --git a/src/tokenEstimation.ts b/vscode-extension/src/tokenEstimation.ts similarity index 100% rename from src/tokenEstimation.ts rename to vscode-extension/src/tokenEstimation.ts diff --git a/src/tokenEstimators.json b/vscode-extension/src/tokenEstimators.json similarity index 100% rename from src/tokenEstimators.json rename to vscode-extension/src/tokenEstimators.json diff --git a/src/toolNames.json b/vscode-extension/src/toolNames.json similarity index 100% rename from src/toolNames.json rename to vscode-extension/src/toolNames.json diff --git a/src/types.ts b/vscode-extension/src/types.ts similarity index 100% rename from src/types.ts rename to vscode-extension/src/types.ts diff --git a/src/types/css.d.ts b/vscode-extension/src/types/css.d.ts similarity index 100% rename from src/types/css.d.ts rename to vscode-extension/src/types/css.d.ts diff --git a/src/types/jsdom.d.ts b/vscode-extension/src/types/jsdom.d.ts similarity index 100% rename from src/types/jsdom.d.ts rename to vscode-extension/src/types/jsdom.d.ts diff --git a/src/types/json.d.ts b/vscode-extension/src/types/json.d.ts similarity index 100% rename from src/types/json.d.ts rename to vscode-extension/src/types/json.d.ts diff --git a/src/usageAnalysis.ts b/vscode-extension/src/usageAnalysis.ts similarity index 95% rename from src/usageAnalysis.ts rename to vscode-extension/src/usageAnalysis.ts index 82c2c47d..f168e919 100644 --- a/src/usageAnalysis.ts +++ b/vscode-extension/src/usageAnalysis.ts @@ -495,6 +495,41 @@ export function analyzeRequestContext(request: any, refs: ContextReferenceUsage) } } +/** + * Classifies unique models by tier and counts requests per tier. + * Called before each early return in analyzeSessionUsage so that all session + * formats (OpenCode, Visual Studio, Crush, Continue) populate the tier-breakdown + * shown by the Multi-Model Usage section in the usage analysis view. + */ +function applyModelTierClassification( + deps: Pick, + uniqueModels: string[], + allModelRequests: string[], + analysis: SessionUsageAnalysis +): void { + const standard: string[] = []; + const premium: string[] = []; + const unknown: string[] = []; + for (const model of uniqueModels) { + const tier = getModelTier(model, deps.modelPricing); + if (tier === 'standard') { standard.push(model); } + else if (tier === 'premium') { premium.push(model); } + else { unknown.push(model); } + } + analysis.modelSwitching.tiers = { standard, premium, unknown }; + analysis.modelSwitching.hasMixedTiers = standard.length > 0 && premium.length > 0; + let stdReq = 0, premReq = 0, unkReq = 0; + for (const model of allModelRequests) { + const tier = getModelTier(model, deps.modelPricing); + if (tier === 'standard') { stdReq++; } + else if (tier === 'premium') { premReq++; } + else { unkReq++; } + } + analysis.modelSwitching.standardRequests = stdReq; + analysis.modelSwitching.premiumRequests = premReq; + analysis.modelSwitching.unknownRequests = unkReq; +} + /** * Calculate model switching statistics for a session file. * This method updates the analysis.modelSwitching field in place. @@ -969,52 +1004,30 @@ export async function analyzeSessionUsage(deps: UsageAnalysisDeps, sessionFile: const models: string[] = []; for (let i = 1; i < objects.length; i++) { const isRequest = i % 2 === 1; + // VS session objects are [version, innerData] tuples; inner data is at index [1] + const objData = objects[i]?.[1]; if (isRequest) { analysis.modeUsage.ask++; } else { - const model = deps.visualStudio.getModelId(objects[i], false); + const model = deps.visualStudio.getModelId(objData, false); if (model) { models.push(model); } - // Count tool calls from response content - for (const c of (objects[i]?.Content || [])) { - const inner = Array.isArray(c) ? c[1] : null; + // Count tool calls from response content (at objData.Content, not objects[i].Content) + for (const c of ((objData?.Content ?? []) as any[])) { + const inner: any = Array.isArray(c) ? c[1] : null; if (inner?.Function) { analysis.toolCalls.total++; - const toolName = String(inner.Function.Description || 'tool'); - analysis.toolCalls.byTool[toolName] = (analysis.toolCalls.byTool[toolName] || 0) + 1; - } - } - } - } - const uniqueModels = [...new Set(models)]; - analysis.modelSwitching.uniqueModels = uniqueModels; - analysis.modelSwitching.modelCount = uniqueModels.length; - analysis.modelSwitching.totalRequests = models.length; - let switchCount = 0; - for (let i = 1; i < models.length; i++) { - if (models[i] !== models[i - 1]) { switchCount++; } - } - analysis.modelSwitching.switchCount = switchCount; - return analysis; - } - - // Handle Visual Studio sessions - if (deps.visualStudio?.isVSSessionFile(sessionFile)) { - const objects = deps.visualStudio.decodeSessionFile(sessionFile); - const models: string[] = []; - for (let i = 1; i < objects.length; i++) { - const isRequest = i % 2 === 1; - if (isRequest) { - analysis.modeUsage.ask++; - } else { - const model = deps.visualStudio.getModelId(objects[i], false); - if (model) { models.push(model); } - // Count tool calls from response content - for (const c of (objects[i]?.Content || [])) { - const inner = Array.isArray(c) ? c[1] : null; - if (inner?.Function) { - analysis.toolCalls.total++; - const toolName = String(inner.Function.Description || 'tool'); - analysis.toolCalls.byTool[toolName] = (analysis.toolCalls.byTool[toolName] || 0) + 1; + const toolName = String(inner.Function.Name || inner.Function.Description || 'tool'); + if (isMcpTool(toolName)) { + analysis.mcpTools.total++; + const serverName = extractMcpServerName(toolName, deps.toolNameMap); + analysis.mcpTools.byServer[serverName] = (analysis.mcpTools.byServer[serverName] || 0) + 1; + const normalizedTool = normalizeMcpToolName(toolName); + analysis.mcpTools.byTool[normalizedTool] = (analysis.mcpTools.byTool[normalizedTool] || 0) + 1; + // Don't count as regular tool call + analysis.toolCalls.total--; + } else { + analysis.toolCalls.byTool[toolName] = (analysis.toolCalls.byTool[toolName] || 0) + 1; + } } } } @@ -1028,6 +1041,7 @@ export async function analyzeSessionUsage(deps: UsageAnalysisDeps, sessionFile: if (models[i] !== models[i - 1]) { switchCount++; } } analysis.modelSwitching.switchCount = switchCount; + applyModelTierClassification(deps, uniqueModels, models, analysis); return analysis; } @@ -1062,6 +1076,7 @@ export async function analyzeSessionUsage(deps: UsageAnalysisDeps, sessionFile: if (models[i] !== models[i - 1]) { switchCount++; } } analysis.modelSwitching.switchCount = switchCount; + applyModelTierClassification(deps, uniqueModels, models, analysis); return analysis; } @@ -1094,6 +1109,7 @@ export async function analyzeSessionUsage(deps: UsageAnalysisDeps, sessionFile: if (models[ki] !== models[ki - 1]) { switchCount++; } } analysis.modelSwitching.switchCount = switchCount; + applyModelTierClassification(deps, uniqueModels, models, analysis); return analysis; } diff --git a/src/utils/clipboard.ts b/vscode-extension/src/utils/clipboard.ts similarity index 100% rename from src/utils/clipboard.ts rename to vscode-extension/src/utils/clipboard.ts diff --git a/src/utils/dayKeys.ts b/vscode-extension/src/utils/dayKeys.ts similarity index 100% rename from src/utils/dayKeys.ts rename to vscode-extension/src/utils/dayKeys.ts diff --git a/src/utils/errors.ts b/vscode-extension/src/utils/errors.ts similarity index 100% rename from src/utils/errors.ts rename to vscode-extension/src/utils/errors.ts diff --git a/src/utils/html.ts b/vscode-extension/src/utils/html.ts similarity index 100% rename from src/utils/html.ts rename to vscode-extension/src/utils/html.ts diff --git a/src/visualstudio.ts b/vscode-extension/src/visualstudio.ts similarity index 100% rename from src/visualstudio.ts rename to vscode-extension/src/visualstudio.ts diff --git a/src/webview/chart/main.ts b/vscode-extension/src/webview/chart/main.ts similarity index 100% rename from src/webview/chart/main.ts rename to vscode-extension/src/webview/chart/main.ts diff --git a/src/webview/chart/styles.css b/vscode-extension/src/webview/chart/styles.css similarity index 100% rename from src/webview/chart/styles.css rename to vscode-extension/src/webview/chart/styles.css diff --git a/src/webview/dashboard/main.ts b/vscode-extension/src/webview/dashboard/main.ts similarity index 100% rename from src/webview/dashboard/main.ts rename to vscode-extension/src/webview/dashboard/main.ts diff --git a/src/webview/dashboard/styles.css b/vscode-extension/src/webview/dashboard/styles.css similarity index 100% rename from src/webview/dashboard/styles.css rename to vscode-extension/src/webview/dashboard/styles.css diff --git a/src/webview/details/main.ts b/vscode-extension/src/webview/details/main.ts similarity index 100% rename from src/webview/details/main.ts rename to vscode-extension/src/webview/details/main.ts diff --git a/src/webview/details/styles.css b/vscode-extension/src/webview/details/styles.css similarity index 100% rename from src/webview/details/styles.css rename to vscode-extension/src/webview/details/styles.css diff --git a/src/webview/diagnostics/main.ts b/vscode-extension/src/webview/diagnostics/main.ts similarity index 100% rename from src/webview/diagnostics/main.ts rename to vscode-extension/src/webview/diagnostics/main.ts diff --git a/src/webview/diagnostics/styles.css b/vscode-extension/src/webview/diagnostics/styles.css similarity index 100% rename from src/webview/diagnostics/styles.css rename to vscode-extension/src/webview/diagnostics/styles.css diff --git a/src/webview/environmental/main.ts b/vscode-extension/src/webview/environmental/main.ts similarity index 100% rename from src/webview/environmental/main.ts rename to vscode-extension/src/webview/environmental/main.ts diff --git a/src/webview/environmental/styles.css b/vscode-extension/src/webview/environmental/styles.css similarity index 100% rename from src/webview/environmental/styles.css rename to vscode-extension/src/webview/environmental/styles.css diff --git a/src/webview/fluency-level-viewer/main.ts b/vscode-extension/src/webview/fluency-level-viewer/main.ts similarity index 100% rename from src/webview/fluency-level-viewer/main.ts rename to vscode-extension/src/webview/fluency-level-viewer/main.ts diff --git a/src/webview/fluency-level-viewer/styles.css b/vscode-extension/src/webview/fluency-level-viewer/styles.css similarity index 100% rename from src/webview/fluency-level-viewer/styles.css rename to vscode-extension/src/webview/fluency-level-viewer/styles.css diff --git a/src/webview/logviewer/main.ts b/vscode-extension/src/webview/logviewer/main.ts similarity index 100% rename from src/webview/logviewer/main.ts rename to vscode-extension/src/webview/logviewer/main.ts diff --git a/src/webview/logviewer/styles.css b/vscode-extension/src/webview/logviewer/styles.css similarity index 100% rename from src/webview/logviewer/styles.css rename to vscode-extension/src/webview/logviewer/styles.css diff --git a/src/webview/maturity/main.ts b/vscode-extension/src/webview/maturity/main.ts similarity index 100% rename from src/webview/maturity/main.ts rename to vscode-extension/src/webview/maturity/main.ts diff --git a/src/webview/maturity/styles.css b/vscode-extension/src/webview/maturity/styles.css similarity index 100% rename from src/webview/maturity/styles.css rename to vscode-extension/src/webview/maturity/styles.css diff --git a/src/webview/shared/buttonConfig.ts b/vscode-extension/src/webview/shared/buttonConfig.ts similarity index 100% rename from src/webview/shared/buttonConfig.ts rename to vscode-extension/src/webview/shared/buttonConfig.ts diff --git a/src/webview/shared/contextRefUtils.ts b/vscode-extension/src/webview/shared/contextRefUtils.ts similarity index 100% rename from src/webview/shared/contextRefUtils.ts rename to vscode-extension/src/webview/shared/contextRefUtils.ts diff --git a/src/webview/shared/domUtils.ts b/vscode-extension/src/webview/shared/domUtils.ts similarity index 100% rename from src/webview/shared/domUtils.ts rename to vscode-extension/src/webview/shared/domUtils.ts diff --git a/src/webview/shared/formatUtils.ts b/vscode-extension/src/webview/shared/formatUtils.ts similarity index 100% rename from src/webview/shared/formatUtils.ts rename to vscode-extension/src/webview/shared/formatUtils.ts diff --git a/src/webview/shared/modelUtils.ts b/vscode-extension/src/webview/shared/modelUtils.ts similarity index 100% rename from src/webview/shared/modelUtils.ts rename to vscode-extension/src/webview/shared/modelUtils.ts diff --git a/src/webview/shared/theme.css b/vscode-extension/src/webview/shared/theme.css similarity index 100% rename from src/webview/shared/theme.css rename to vscode-extension/src/webview/shared/theme.css diff --git a/src/webview/usage/main.ts b/vscode-extension/src/webview/usage/main.ts similarity index 95% rename from src/webview/usage/main.ts rename to vscode-extension/src/webview/usage/main.ts index da7ef73c..6aefee61 100644 --- a/src/webview/usage/main.ts +++ b/vscode-extension/src/webview/usage/main.ts @@ -1,4 +1,4 @@ -// Usage Analysis webview +// Usage Analysis webview import { el } from '../shared/domUtils'; import { buttonHtml } from '../shared/buttonConfig'; import { ContextReferenceUsage, getTotalContextRefs } from '../shared/contextRefUtils'; @@ -279,6 +279,18 @@ function renderToolsTable(byTool: { [key: string]: number }, limit = 10, nameRes `; } +/** + * Return a copy of `map` with every key from `keys` present (defaulting to 0). + * Used to build cross-period tables where every item found in any period is shown in all. + */ +function unionFill(map: { [key: string]: number }, keys: string[]): { [key: string]: number } { + const result: { [key: string]: number } = { ...map }; + for (const k of keys) { + if (!(k in result)) { result[k] = 0; } + } + return result; +} + function sanitizeStats(raw: any): UsageAnalysisStats | null { if (!raw || typeof raw !== 'object') { return null; @@ -459,6 +471,38 @@ function renderLayout(stats: UsageAnalysisStats): void { `; } + // Compute union of keys across all periods so every column shows every known item + const allToolKeys = [...new Set([ + ...Object.keys(stats.today.toolCalls.byTool), + ...Object.keys(stats.last30Days.toolCalls.byTool), + ...Object.keys(stats.month.toolCalls.byTool), + ])]; + const allMcpToolKeys = [...new Set([ + ...Object.keys(stats.today.mcpTools.byTool), + ...Object.keys(stats.last30Days.mcpTools.byTool), + ...Object.keys(stats.month.mcpTools.byTool), + ])]; + const allMcpServerKeys = [...new Set([ + ...Object.keys(stats.today.mcpTools.byServer), + ...Object.keys(stats.last30Days.mcpTools.byServer), + ...Object.keys(stats.month.mcpTools.byServer), + ])]; + const allStandardModels = [...new Set([ + ...stats.today.modelSwitching.standardModels, + ...stats.last30Days.modelSwitching.standardModels, + ...stats.month.modelSwitching.standardModels, + ])]; + const allPremiumModels = [...new Set([ + ...stats.today.modelSwitching.premiumModels, + ...stats.last30Days.modelSwitching.premiumModels, + ...stats.month.modelSwitching.premiumModels, + ])]; + const allUnknownModels = [...new Set([ + ...stats.today.modelSwitching.unknownModels, + ...stats.last30Days.modelSwitching.unknownModels, + ...stats.month.modelSwitching.unknownModels, + ])]; + const todayTotalRefs = getTotalContextRefs(stats.today.contextReferences); const last30DaysTotalRefs = getTotalContextRefs(stats.last30Days.contextReferences); const todayTotalModes = stats.today.modeUsage.ask + stats.today.modeUsage.edit + stats.today.modeUsage.agent + stats.today.modeUsage.plan + stats.today.modeUsage.customAgent; @@ -634,21 +678,21 @@ function renderLayout(stats: UsageAnalysisStats): void {

    📅 Today

    Total Tool Calls: ${formatNumber(stats.today.toolCalls.total)}
    - ${renderToolsTable(stats.today.toolCalls.byTool, 10)} + ${renderToolsTable(unionFill(stats.today.toolCalls.byTool, allToolKeys), 10)}

    📆 Last 30 Days

    Total Tool Calls: ${formatNumber(stats.last30Days.toolCalls.total)}
    - ${renderToolsTable(stats.last30Days.toolCalls.byTool, 10)} + ${renderToolsTable(unionFill(stats.last30Days.toolCalls.byTool, allToolKeys), 10)}

    📅 Previous Month

    Total Tool Calls: ${formatNumber(stats.month.toolCalls.total)}
    - ${renderToolsTable(stats.month.toolCalls.byTool, 10)} + ${renderToolsTable(unionFill(stats.month.toolCalls.byTool, allToolKeys), 10)}
    @@ -675,9 +719,6 @@ function renderLayout(stats: UsageAnalysisStats): void { }).join(' '); return `
    -
    - Found ${unknownTools.length} tool${unknownTools.length > 1 ? 's' : ''} without friendly names — might not be included in the top-10 tables above -
    ${toolListHtml}
    @@ -695,8 +736,8 @@ function renderLayout(stats: UsageAnalysisStats): void {

    📅 Today

    Total MCP Calls: ${formatNumber(stats.today.mcpTools.total)}
    - ${stats.today.mcpTools.total > 0 ? ` -
    By Server:
    ${renderToolsTable(stats.today.mcpTools.byServer, 8)}
    + ${allMcpServerKeys.length > 0 ? ` +
    By Server:
    ${renderToolsTable(unionFill(stats.today.mcpTools.byServer, allMcpServerKeys), 200)}
    ` : '
    No MCP tools used yet
    '}
    @@ -704,8 +745,8 @@ function renderLayout(stats: UsageAnalysisStats): void {

    📆 Last 30 Days

    Total MCP Calls: ${formatNumber(stats.last30Days.mcpTools.total)}
    - ${stats.last30Days.mcpTools.total > 0 ? ` -
    By Server:
    ${renderToolsTable(stats.last30Days.mcpTools.byServer, 8)}
    + ${allMcpServerKeys.length > 0 ? ` +
    By Server:
    ${renderToolsTable(unionFill(stats.last30Days.mcpTools.byServer, allMcpServerKeys), 200)}
    ` : '
    No MCP tools used yet
    '}
    @@ -713,31 +754,31 @@ function renderLayout(stats: UsageAnalysisStats): void {

    📅 Previous Month

    Total MCP Calls: ${formatNumber(stats.month.mcpTools.total)}
    - ${stats.month.mcpTools.total > 0 ? ` -
    By Server:
    ${renderToolsTable(stats.month.mcpTools.byServer, 8)}
    + ${allMcpServerKeys.length > 0 ? ` +
    By Server:
    ${renderToolsTable(unionFill(stats.month.mcpTools.byServer, allMcpServerKeys), 200)}
    ` : '
    No MCP tools used yet
    '}
    - ${stats.today.mcpTools.total > 0 ? ` + ${allMcpToolKeys.length > 0 ? `
    -
    By Tool:
    ${renderToolsTable(stats.today.mcpTools.byTool, 8, lookupMcpToolName)}
    +
    By Tool:
    ${renderToolsTable(unionFill(stats.today.mcpTools.byTool, allMcpToolKeys), 10, lookupMcpToolName)}
    ` : ''}
    - ${stats.last30Days.mcpTools.total > 0 ? ` + ${allMcpToolKeys.length > 0 ? `
    -
    By Tool:
    ${renderToolsTable(stats.last30Days.mcpTools.byTool, 8, lookupMcpToolName)}
    +
    By Tool:
    ${renderToolsTable(unionFill(stats.last30Days.mcpTools.byTool, allMcpToolKeys), 10, lookupMcpToolName)}
    ` : ''}
    - ${stats.month.mcpTools.total > 0 ? ` + ${allMcpToolKeys.length > 0 ? `
    -
    By Tool:
    ${renderToolsTable(stats.month.mcpTools.byTool, 8, lookupMcpToolName)}
    +
    By Tool:
    ${renderToolsTable(unionFill(stats.month.mcpTools.byTool, allMcpToolKeys), 10, lookupMcpToolName)}
    ` : ''}
    @@ -769,22 +810,22 @@ function renderLayout(stats: UsageAnalysisStats): void {
    Models by Tier:
    - ${stats.today.modelSwitching.standardModels.length > 0 ? ` + ${allStandardModels.length > 0 ? `
    🔵 Standard: - ${stats.today.modelSwitching.standardModels.map(escapeHtml).join(', ')} + ${allStandardModels.map(escapeHtml).join(', ')}
    ` : '
    '} - ${stats.today.modelSwitching.premiumModels.length > 0 ? ` + ${allPremiumModels.length > 0 ? `
    ⭐ Premium: - ${stats.today.modelSwitching.premiumModels.map(escapeHtml).join(', ')} + ${allPremiumModels.map(escapeHtml).join(', ')}
    ` : '
    '} - ${stats.today.modelSwitching.unknownModels.length > 0 ? ` + ${allUnknownModels.length > 0 ? `
    ❓ Unknown: - ${stats.today.modelSwitching.unknownModels.map(escapeHtml).join(', ')} + ${allUnknownModels.map(escapeHtml).join(', ')}
    ` : ''}
    @@ -838,22 +879,22 @@ function renderLayout(stats: UsageAnalysisStats): void {
    Models by Tier:
    - ${stats.last30Days.modelSwitching.standardModels.length > 0 ? ` + ${allStandardModels.length > 0 ? `
    🔵 Standard: - ${stats.last30Days.modelSwitching.standardModels.map(escapeHtml).join(', ')} + ${allStandardModels.map(escapeHtml).join(', ')}
    ` : '
    '} - ${stats.last30Days.modelSwitching.premiumModels.length > 0 ? ` + ${allPremiumModels.length > 0 ? `
    ⭐ Premium: - ${stats.last30Days.modelSwitching.premiumModels.map(escapeHtml).join(', ')} + ${allPremiumModels.map(escapeHtml).join(', ')}
    ` : '
    '} - ${stats.last30Days.modelSwitching.unknownModels.length > 0 ? ` + ${allUnknownModels.length > 0 ? `
    ❓ Unknown: - ${stats.last30Days.modelSwitching.unknownModels.map(escapeHtml).join(', ')} + ${allUnknownModels.map(escapeHtml).join(', ')}
    ` : ''}
    @@ -907,22 +948,22 @@ function renderLayout(stats: UsageAnalysisStats): void {
    Models by Tier:
    - ${stats.month.modelSwitching.standardModels.length > 0 ? ` + ${allStandardModels.length > 0 ? `
    🔵 Standard: - ${stats.month.modelSwitching.standardModels.map(escapeHtml).join(', ')} + ${allStandardModels.map(escapeHtml).join(', ')}
    ` : '
    '} - ${stats.month.modelSwitching.premiumModels.length > 0 ? ` + ${allPremiumModels.length > 0 ? `
    ⭐ Premium: - ${stats.month.modelSwitching.premiumModels.map(escapeHtml).join(', ')} + ${allPremiumModels.map(escapeHtml).join(', ')}
    ` : '
    '} - ${stats.month.modelSwitching.unknownModels.length > 0 ? ` + ${allUnknownModels.length > 0 ? `
    ❓ Unknown: - ${stats.month.modelSwitching.unknownModels.map(escapeHtml).join(', ')} + ${allUnknownModels.map(escapeHtml).join(', ')}
    ` : ''}
    diff --git a/src/webview/usage/styles.css b/vscode-extension/src/webview/usage/styles.css similarity index 100% rename from src/webview/usage/styles.css rename to vscode-extension/src/webview/usage/styles.css diff --git a/src/workspaceHelpers.ts b/vscode-extension/src/workspaceHelpers.ts similarity index 100% rename from src/workspaceHelpers.ts rename to vscode-extension/src/workspaceHelpers.ts diff --git a/test/fixtures/sample-session-data/chatSessions/session-01-today.json b/vscode-extension/test/fixtures/sample-session-data/chatSessions/session-01-today.json similarity index 100% rename from test/fixtures/sample-session-data/chatSessions/session-01-today.json rename to vscode-extension/test/fixtures/sample-session-data/chatSessions/session-01-today.json diff --git a/test/fixtures/sample-session-data/chatSessions/session-02-five-days-ago.json b/vscode-extension/test/fixtures/sample-session-data/chatSessions/session-02-five-days-ago.json similarity index 100% rename from test/fixtures/sample-session-data/chatSessions/session-02-five-days-ago.json rename to vscode-extension/test/fixtures/sample-session-data/chatSessions/session-02-five-days-ago.json diff --git a/test/fixtures/sample-session-data/chatSessions/session-03-twelve-days-ago.json b/vscode-extension/test/fixtures/sample-session-data/chatSessions/session-03-twelve-days-ago.json similarity index 100% rename from test/fixtures/sample-session-data/chatSessions/session-03-twelve-days-ago.json rename to vscode-extension/test/fixtures/sample-session-data/chatSessions/session-03-twelve-days-ago.json diff --git a/test/fixtures/sample-session-data/chatSessions/session-04-twenty-days-ago.json b/vscode-extension/test/fixtures/sample-session-data/chatSessions/session-04-twenty-days-ago.json similarity index 100% rename from test/fixtures/sample-session-data/chatSessions/session-04-twenty-days-ago.json rename to vscode-extension/test/fixtures/sample-session-data/chatSessions/session-04-twenty-days-ago.json diff --git a/test/fixtures/sample-session-data/chatSessions/session-05-twenty-seven-days-ago.json b/vscode-extension/test/fixtures/sample-session-data/chatSessions/session-05-twenty-seven-days-ago.json similarity index 100% rename from test/fixtures/sample-session-data/chatSessions/session-05-twenty-seven-days-ago.json rename to vscode-extension/test/fixtures/sample-session-data/chatSessions/session-05-twenty-seven-days-ago.json diff --git a/test/integration/backend.test.ts b/vscode-extension/test/integration/backend.test.ts similarity index 100% rename from test/integration/backend.test.ts rename to vscode-extension/test/integration/backend.test.ts diff --git a/test/integration/extension.test.ts b/vscode-extension/test/integration/extension.test.ts similarity index 100% rename from test/integration/extension.test.ts rename to vscode-extension/test/integration/extension.test.ts diff --git a/test/unit/azureResourceService.test.ts b/vscode-extension/test/unit/azureResourceService.test.ts similarity index 100% rename from test/unit/azureResourceService.test.ts rename to vscode-extension/test/unit/azureResourceService.test.ts diff --git a/test/unit/backend-blobUploadService.test.ts b/vscode-extension/test/unit/backend-blobUploadService.test.ts similarity index 100% rename from test/unit/backend-blobUploadService.test.ts rename to vscode-extension/test/unit/backend-blobUploadService.test.ts diff --git a/test/unit/backend-cache-integration.test.ts b/vscode-extension/test/unit/backend-cache-integration.test.ts similarity index 100% rename from test/unit/backend-cache-integration.test.ts rename to vscode-extension/test/unit/backend-cache-integration.test.ts diff --git a/test/unit/backend-commands.test.ts b/vscode-extension/test/unit/backend-commands.test.ts similarity index 100% rename from test/unit/backend-commands.test.ts rename to vscode-extension/test/unit/backend-commands.test.ts diff --git a/test/unit/backend-configPanel-webview.test.ts b/vscode-extension/test/unit/backend-configPanel-webview.test.ts similarity index 100% rename from test/unit/backend-configPanel-webview.test.ts rename to vscode-extension/test/unit/backend-configPanel-webview.test.ts diff --git a/test/unit/backend-configPanel.test.ts b/vscode-extension/test/unit/backend-configPanel.test.ts similarity index 100% rename from test/unit/backend-configPanel.test.ts rename to vscode-extension/test/unit/backend-configPanel.test.ts diff --git a/test/unit/backend-configurationFlow.test.ts b/vscode-extension/test/unit/backend-configurationFlow.test.ts similarity index 100% rename from test/unit/backend-configurationFlow.test.ts rename to vscode-extension/test/unit/backend-configurationFlow.test.ts diff --git a/test/unit/backend-configurator.test.ts b/vscode-extension/test/unit/backend-configurator.test.ts similarity index 100% rename from test/unit/backend-configurator.test.ts rename to vscode-extension/test/unit/backend-configurator.test.ts diff --git a/test/unit/backend-copyConfig.test.ts b/vscode-extension/test/unit/backend-copyConfig.test.ts similarity index 100% rename from test/unit/backend-copyConfig.test.ts rename to vscode-extension/test/unit/backend-copyConfig.test.ts diff --git a/test/unit/backend-dataPlaneService.test.ts b/vscode-extension/test/unit/backend-dataPlaneService.test.ts similarity index 100% rename from test/unit/backend-dataPlaneService.test.ts rename to vscode-extension/test/unit/backend-dataPlaneService.test.ts diff --git a/test/unit/backend-displayNames.test.ts b/vscode-extension/test/unit/backend-displayNames.test.ts similarity index 100% rename from test/unit/backend-displayNames.test.ts rename to vscode-extension/test/unit/backend-displayNames.test.ts diff --git a/test/unit/backend-facade-helpers.test.ts b/vscode-extension/test/unit/backend-facade-helpers.test.ts similarity index 100% rename from test/unit/backend-facade-helpers.test.ts rename to vscode-extension/test/unit/backend-facade-helpers.test.ts diff --git a/test/unit/backend-facade-methods.test.ts b/vscode-extension/test/unit/backend-facade-methods.test.ts similarity index 100% rename from test/unit/backend-facade-methods.test.ts rename to vscode-extension/test/unit/backend-facade-methods.test.ts diff --git a/test/unit/backend-facade-query.test.ts b/vscode-extension/test/unit/backend-facade-query.test.ts similarity index 100% rename from test/unit/backend-facade-query.test.ts rename to vscode-extension/test/unit/backend-facade-query.test.ts diff --git a/test/unit/backend-facade-rollups.test.ts b/vscode-extension/test/unit/backend-facade-rollups.test.ts similarity index 100% rename from test/unit/backend-facade-rollups.test.ts rename to vscode-extension/test/unit/backend-facade-rollups.test.ts diff --git a/test/unit/backend-identity.test.ts b/vscode-extension/test/unit/backend-identity.test.ts similarity index 100% rename from test/unit/backend-identity.test.ts rename to vscode-extension/test/unit/backend-identity.test.ts diff --git a/test/unit/backend-integration.test.ts b/vscode-extension/test/unit/backend-integration.test.ts similarity index 100% rename from test/unit/backend-integration.test.ts rename to vscode-extension/test/unit/backend-integration.test.ts diff --git a/test/unit/backend-queryService.test.ts b/vscode-extension/test/unit/backend-queryService.test.ts similarity index 100% rename from test/unit/backend-queryService.test.ts rename to vscode-extension/test/unit/backend-queryService.test.ts diff --git a/test/unit/backend-redaction.test.ts b/vscode-extension/test/unit/backend-redaction.test.ts similarity index 100% rename from test/unit/backend-redaction.test.ts rename to vscode-extension/test/unit/backend-redaction.test.ts diff --git a/test/unit/backend-rollups.test.ts b/vscode-extension/test/unit/backend-rollups.test.ts similarity index 100% rename from test/unit/backend-rollups.test.ts rename to vscode-extension/test/unit/backend-rollups.test.ts diff --git a/test/unit/backend-settings.test.ts b/vscode-extension/test/unit/backend-settings.test.ts similarity index 100% rename from test/unit/backend-settings.test.ts rename to vscode-extension/test/unit/backend-settings.test.ts diff --git a/test/unit/backend-sharingProfile.test.ts b/vscode-extension/test/unit/backend-sharingProfile.test.ts similarity index 100% rename from test/unit/backend-sharingProfile.test.ts rename to vscode-extension/test/unit/backend-sharingProfile.test.ts diff --git a/test/unit/backend-storageTables.test.ts b/vscode-extension/test/unit/backend-storageTables.test.ts similarity index 100% rename from test/unit/backend-storageTables.test.ts rename to vscode-extension/test/unit/backend-storageTables.test.ts diff --git a/test/unit/backend-sync-profiles.test.ts b/vscode-extension/test/unit/backend-sync-profiles.test.ts similarity index 100% rename from test/unit/backend-sync-profiles.test.ts rename to vscode-extension/test/unit/backend-sync-profiles.test.ts diff --git a/test/unit/backend-syncService.test.ts b/vscode-extension/test/unit/backend-syncService.test.ts similarity index 100% rename from test/unit/backend-syncService.test.ts rename to vscode-extension/test/unit/backend-syncService.test.ts diff --git a/test/unit/backend-ui-messages.test.ts b/vscode-extension/test/unit/backend-ui-messages.test.ts similarity index 100% rename from test/unit/backend-ui-messages.test.ts rename to vscode-extension/test/unit/backend-ui-messages.test.ts diff --git a/test/unit/backend-utilityService.test.ts b/vscode-extension/test/unit/backend-utilityService.test.ts similarity index 100% rename from test/unit/backend-utilityService.test.ts rename to vscode-extension/test/unit/backend-utilityService.test.ts diff --git a/test/unit/credentialService.test.ts b/vscode-extension/test/unit/credentialService.test.ts similarity index 100% rename from test/unit/credentialService.test.ts rename to vscode-extension/test/unit/credentialService.test.ts diff --git a/test/unit/logging-redaction.test.ts b/vscode-extension/test/unit/logging-redaction.test.ts similarity index 100% rename from test/unit/logging-redaction.test.ts rename to vscode-extension/test/unit/logging-redaction.test.ts diff --git a/test/unit/sessionParser-integration.test.ts b/vscode-extension/test/unit/sessionParser-integration.test.ts similarity index 100% rename from test/unit/sessionParser-integration.test.ts rename to vscode-extension/test/unit/sessionParser-integration.test.ts diff --git a/test/unit/sessionParser.test.ts b/vscode-extension/test/unit/sessionParser.test.ts similarity index 85% rename from test/unit/sessionParser.test.ts rename to vscode-extension/test/unit/sessionParser.test.ts index 42d0b2f7..95227266 100644 --- a/test/unit/sessionParser.test.ts +++ b/vscode-extension/test/unit/sessionParser.test.ts @@ -380,3 +380,81 @@ test('delta-based JSONL: invalid JSON lines are silently skipped', () => { assert.equal(result.interactions, 1); assert.equal(result.tokens, 'hi'.length + 'yo'.length); }); + +// ── actualTokens extraction tests ────────────────────────────────────────── + +test('JSON session: extracts actualTokens from old result.usage format', () => { + const content = JSON.stringify({ + requests: [ + { + model: 'gpt-4o', + message: { text: 'hello' }, + response: [{ value: 'world' }], + result: { usage: { promptTokens: 100, completionTokens: 50 } } + } + ] + }); + const result = parseSessionFileContent('s.json', content, estimateTokensByLength); + assert.equal(result.actualTokens, 150); +}); + +test('JSON session: extracts actualTokens from new result.promptTokens/outputTokens format', () => { + const content = JSON.stringify({ + requests: [ + { + model: 'gpt-4o', + message: { text: 'hello' }, + response: [{ value: 'world' }], + result: { promptTokens: 200, outputTokens: 80 } + } + ] + }); + const result = parseSessionFileContent('s.json', content, estimateTokensByLength); + assert.equal(result.actualTokens, 280); +}); + +test('JSON session: extracts actualTokens from insiders result.metadata format', () => { + const content = JSON.stringify({ + requests: [ + { + model: 'gpt-4o', + message: { text: 'hello' }, + response: [{ value: 'world' }], + result: { metadata: { promptTokens: 300, outputTokens: 120 } } + } + ] + }); + const result = parseSessionFileContent('s.json', content, estimateTokensByLength); + assert.equal(result.actualTokens, 420); +}); + +test('JSON session: accumulates actualTokens across multiple requests', () => { + const content = JSON.stringify({ + requests: [ + { + model: 'gpt-4o', + message: { text: 'a' }, + response: [{ value: 'b' }], + result: { usage: { promptTokens: 100, completionTokens: 50 } } + }, + { + model: 'gpt-4o', + message: { text: 'c' }, + response: [{ value: 'd' }], + result: { promptTokens: 200, outputTokens: 80 } + } + ] + }); + const result = parseSessionFileContent('s.json', content, estimateTokensByLength); + assert.equal(result.actualTokens, 430); +}); + +test('JSON session: actualTokens is 0 when no result usage fields present', () => { + const content = JSON.stringify({ + requests: [ + { model: 'gpt-4o', message: { text: 'hello' }, response: [{ value: 'world' }] } + ] + }); + const result = parseSessionFileContent('s.json', content, estimateTokensByLength); + assert.equal(result.actualTokens, 0); +}); diff --git a/test/unit/utils-dayKeys.test.ts b/vscode-extension/test/unit/utils-dayKeys.test.ts similarity index 100% rename from test/unit/utils-dayKeys.test.ts rename to vscode-extension/test/unit/utils-dayKeys.test.ts diff --git a/test/unit/utils-errors.test.ts b/vscode-extension/test/unit/utils-errors.test.ts similarity index 100% rename from test/unit/utils-errors.test.ts rename to vscode-extension/test/unit/utils-errors.test.ts diff --git a/test/unit/utils-html.test.ts b/vscode-extension/test/unit/utils-html.test.ts similarity index 100% rename from test/unit/utils-html.test.ts rename to vscode-extension/test/unit/utils-html.test.ts diff --git a/test/unit/vscode-shim-register.ts b/vscode-extension/test/unit/vscode-shim-register.ts similarity index 100% rename from test/unit/vscode-shim-register.ts rename to vscode-extension/test/unit/vscode-shim-register.ts diff --git a/test/unit/webview-utils.test.ts b/vscode-extension/test/unit/webview-utils.test.ts similarity index 100% rename from test/unit/webview-utils.test.ts rename to vscode-extension/test/unit/webview-utils.test.ts diff --git a/tsconfig.json b/vscode-extension/tsconfig.json similarity index 100% rename from tsconfig.json rename to vscode-extension/tsconfig.json diff --git a/tsconfig.tests.json b/vscode-extension/tsconfig.tests.json similarity index 100% rename from tsconfig.tests.json rename to vscode-extension/tsconfig.tests.json diff --git a/vscode-extension/vs-session-sample.json b/vscode-extension/vs-session-sample.json new file mode 100644 index 00000000..e69de29b