diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..f9b22b7 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "root": true, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "plugins": [ + "@typescript-eslint" + ], + "rules": { + "@typescript-eslint/naming-convention": "warn", + "@typescript-eslint/semi": "warn", + "curly": "warn", + "eqeqeq": "warn", + "no-throw-literal": "warn", + "semi": "off" + }, + "ignorePatterns": [ + "out", + "dist", + "**/*.d.ts" + ] +} diff --git a/.github/ISSUE_TEMPLATE/1.bug_report.yml b/.github/ISSUE_TEMPLATE/1.bug_report.yml new file mode 100644 index 0000000..b469e28 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1.bug_report.yml @@ -0,0 +1,31 @@ +name: 🐞 Bug Report +description: Create a bug report +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for using the extension and taking the time to fill out this bug report! + - type: textarea + attributes: + label: Describe the Bug + description: A clear description of what the bug is. Please make sure to list steps to reproduce your issue. Please share your OS, VS Code details as well. You could details of your VS Code via (Help->About) + placeholder: | + - Steps to reproduce the bug + - ... + - OS and version: [i.e. macOS Ventura (version 13)] + - VS Code details: [i.e. 1.76.0] + validations: + required: true + - type: textarea + attributes: + label: "Please tell us if you have customized any of the extension settings or whether you are using the defaults." + description: Please list whether you use `Browser Auto-login` or `OpenAI API Key` method. Which model you are using i.e. `gpt-3.5-turbo` and the parameters you may have customized in your settings. You could find all of the customized settings in your `Settings.json` + validations: + required: true + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. Please provide screenshots or screen recordings if possible. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/2.feature_request.yml b/.github/ISSUE_TEMPLATE/2.feature_request.yml new file mode 100644 index 0000000..ca8434f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2.feature_request.yml @@ -0,0 +1,14 @@ +name: 💡 Feature Request +description: Suggest an idea +labels: ["enhancement"] +body: + - type: markdown + attributes: + value: | + Thanks for using the extension and considering suggesting an idea + - type: textarea + attributes: + label: Describe the feature + description: What would you like to see added / supported? + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ed238ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: 💭 Join the Discord + url: https://discord.gg/GuEdNDHQaM + about: Ask questions and discuss with other community members diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b95632f --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +out +dist +node_modules +.vscode-test/ +*.vsix +!node_modules/chatgpt/build/index.js \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..8517e12 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmjs.org/ diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..589f269 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,9 @@ +{ + // See http://go.microsoft.com/fwlink/?LinkId=827846 + // for the documentation about the extensions.json format + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "connor4312.esbuild-problem-matchers" + ] +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..ba4e5f7 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,34 @@ +// A launch configuration that compiles the extension and then opens it inside a new window +// Use IntelliSense to learn about possible attributes. +// Hover to view descriptions of existing attributes. +// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Run Extension", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}" + ], + "outFiles": [ + "${workspaceFolder}/out/**/*.js" + ], + "preLaunchTask": "npm: watch" + }, + { + "name": "Extension Tests", + "type": "extensionHost", + "request": "launch", + "args": [ + "--extensionDevelopmentPath=${workspaceFolder}", + "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" + ], + "outFiles": [ + "${workspaceFolder}/out/test/**/*.js" + ], + "preLaunchTask": "${defaultBuildTask}" + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8f65a67 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,36 @@ +{ + "files.exclude": { + "out": false + }, + "search.exclude": { + "out": true + }, + "typescript.tsc.autoDetect": "off", + "editor.formatOnSave": true, + "editor.formatOnPaste": true, + "editor.tabSize": 4, + "editor.insertSpaces": true, + "editor.codeActionsOnSave": { + "source.fixAll": true, + "source.organizeImports": true + }, + "javascript.format.semicolons": "insert", + "typescript.format.semicolons": "insert", + "javascript.preferences.quoteStyle": "double", + "[typescript]": { + "editor.defaultFormatter": "vscode.typescript-language-features", + "typescript.preferences.quoteStyle": "double", + }, + "[javascript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[json]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[css]": { + "editor.defaultFormatter": "vscode.css-language-features" + }, +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..ff4f0ae --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,20 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "watch", + "group": "build", + "problemMatcher": "$esbuild-watch", + "isBackground": true, + "label": "npm: watch", + }, + { + "type": "npm", + "script": "build", + "group": "build", + "problemMatcher": "$esbuild", + "label": "npm: build", + } + ] +} \ No newline at end of file diff --git a/.vscodeignore b/.vscodeignore new file mode 100644 index 0000000..b9a9acf --- /dev/null +++ b/.vscodeignore @@ -0,0 +1,16 @@ +.vscode/** +.vscode-test/** +node_modules/** +src/** +.gitignore +.yarnrc +vsc-extension-quickstart.md +**/tsconfig.json +**/.eslintrc.json +**/*.map +**/*.ts +images/** +temp/** +!images/ai-logo.jpg +!images/openai-logo.svg +chatgpt-4.7.2 \ No newline at end of file diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 0000000..f757a6a --- /dev/null +++ b/.yarnrc @@ -0,0 +1 @@ +--ignore-engines true \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ed778c6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2022, Ali Gençay + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2001658 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +

+ Hi everyone - Thank you for your interest in this extension. + +Unfortunately, with a sad heart, we made the hard decision to remove the extension from marketplace and discontinue this project for various reasons: + +

+ + +### How to run + +- Clone the repository to your local machine +- On the root directory, run `yarn` command to install the dependencies listed in `package.json` +- Within VS Code - run the project by simply hitting F5. +- You could also create a 'vsix' package from the source-code and install manually. diff --git a/chatgpt-4.7.2/index.d.ts b/chatgpt-4.7.2/index.d.ts new file mode 100644 index 0000000..5bcf80a --- /dev/null +++ b/chatgpt-4.7.2/index.d.ts @@ -0,0 +1,354 @@ +import Keyv from 'keyv'; + +type Role = 'user' | 'assistant'; +type FetchFn = typeof fetch; +type SendMessageOptions = { + conversationId?: string; + parentMessageId?: string; + messageId?: string; + stream?: boolean; + promptPrefix?: string; + promptSuffix?: string; + timeoutMs?: number; + onProgress?: (partialResponse: ChatMessage) => void; + abortSignal?: AbortSignal; +}; +type MessageActionType = 'next' | 'variant'; +type SendMessageBrowserOptions = { + conversationId?: string; + parentMessageId?: string; + messageId?: string; + action?: MessageActionType; + timeoutMs?: number; + onProgress?: (partialResponse: ChatMessage) => void; + abortSignal?: AbortSignal; +}; +interface ChatMessage { + id: string; + text: string; + role: Role; + parentMessageId?: string; + conversationId?: string; + detail?: any; +} +type ChatGPTErrorType = 'unknown' | 'chatgpt:pool:account-on-cooldown' | 'chatgpt:pool:account-not-found' | 'chatgpt:pool:no-accounts' | 'chatgpt:pool:timeout' | 'chatgpt:pool:rate-limit' | 'chatgpt:pool:unavailable'; +declare class ChatGPTError extends Error { + statusCode?: number; + statusText?: string; + isFinal?: boolean; + accountId?: string; + type?: ChatGPTErrorType; +} +/** Returns a chat message from a store by it's ID (or null if not found). */ +type GetMessageByIdFunction = (id: string) => Promise; +/** Upserts a chat message to a store. */ +type UpsertMessageFunction = (message: ChatMessage) => Promise; +declare namespace openai { + type CompletionParams = { + /** ID of the model to use. */ + model: string; + /** The string prompt to generate a completion for. */ + prompt: string; + /** + * The suffix that comes after a completion of inserted text. + */ + suffix?: string; + /** + * The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). + */ + max_tokens?: number; + /** + * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both. + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + */ + top_p?: number; + /** + * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case. + */ + logprobs?: number; + /** + * Echo back the prompt in addition to the completion + */ + echo?: boolean; + /** + * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence. + */ + stop?: string[]; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model\'s likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) + */ + presence_penalty?: number; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model\'s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) + */ + frequency_penalty?: number; + /** + * Generates `best_of` completions server-side and returns the \"best\" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + */ + best_of?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass `{\"50256\": -100}` to prevent the <|endoftext|> token from being generated. + */ + logit_bias?: Record; + /** + * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids). + */ + user?: string; + }; + type ReverseProxyCompletionParams = CompletionParams & { + paid?: boolean; + }; + type CompletionResponse = { + id: string; + object: string; + created: number; + model: string; + choices: CompletionResponseChoices; + usage?: CompletionResponseUsage; + }; + type CompletionResponseChoices = { + text?: string; + index?: number; + logprobs?: { + tokens?: Array; + token_logprobs?: Array; + top_logprobs?: Array; + text_offset?: Array; + } | null; + finish_reason?: string; + }[]; + type CompletionResponseUsage = { + prompt_tokens: number; + completion_tokens: number; + total_tokens: number; + }; +} +/** + * https://chat.openapi.com/backend-api/conversation + */ +type ConversationJSONBody = { + /** + * The action to take + */ + action: string; + /** + * The ID of the conversation + */ + conversation_id?: string; + /** + * Prompts to provide + */ + messages: Prompt[]; + /** + * The model to use + */ + model: string; + /** + * The parent message ID + */ + parent_message_id: string; +}; +type Prompt = { + /** + * The content of the prompt + */ + content: PromptContent; + /** + * The ID of the prompt + */ + id: string; + /** + * The role played in the prompt + */ + role: Role; +}; +type ContentType = 'text'; +type PromptContent = { + /** + * The content type of the prompt + */ + content_type: ContentType; + /** + * The parts to the prompt + */ + parts: string[]; +}; +type ConversationResponseEvent = { + message?: Message; + conversation_id?: string; + error?: string | null; +}; +type Message = { + id: string; + content: MessageContent; + role: Role; + user: string | null; + create_time: string | null; + update_time: string | null; + end_turn: null; + weight: number; + recipient: string; + metadata: MessageMetadata; +}; +type MessageContent = { + content_type: string; + parts: string[]; +}; +type MessageMetadata = any; +type GetAccessTokenFn = ({ email, password, sessionToken }: { + email: string; + password: string; + sessionToken?: string; +}) => string | Promise; + +declare class ChatGPTAPI { + protected _apiKey: string; + protected _apiBaseUrl: string; + protected _apiReverseProxyUrl: string; + protected _debug: boolean; + protected _completionParams: Omit; + protected _maxModelTokens: number; + protected _maxResponseTokens: number; + protected _userLabel: string; + protected _assistantLabel: string; + protected _endToken: string; + protected _sepToken: string; + protected _fetch: FetchFn; + protected _getMessageById: GetMessageByIdFunction; + protected _upsertMessage: UpsertMessageFunction; + protected _messageStore: Keyv; + protected _organization: string; + /** + * Creates a new client wrapper around OpenAI's completion API using the + * unofficial ChatGPT model. + * + * @param apiKey - OpenAI API key (required). + * @param apiBaseUrl - Optional override for the OpenAI API base URL. + * @param apiReverseProxyUrl - Optional override for a reverse proxy URL to use instead of the OpenAI API completions API. + * @param debug - Optional enables logging debugging info to stdout. + * @param completionParams - Param overrides to send to the [OpenAI completion API](https://platform.openai.com/docs/api-reference/completions/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant. + * @param maxModelTokens - Optional override for the maximum number of tokens allowed by the model's context. Defaults to 4096 for the `text-chat-davinci-002-20230126` model. + * @param maxResponseTokens - Optional override for the minimum number of tokens allowed for the model's response. Defaults to 1000 for the `text-chat-davinci-002-20230126` model. + * @param messageStore - Optional [Keyv](https://github.com/jaredwray/keyv) store to persist chat messages to. If not provided, messages will be lost when the process exits. + * @param getMessageById - Optional function to retrieve a message by its ID. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param upsertMessage - Optional function to insert or update a message. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param organization - Optional organization string for openai calls + * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function. + */ + constructor(opts: { + apiKey: string; + /** @defaultValue `'https://api.openai.com'` **/ + apiBaseUrl?: string; + /** @defaultValue `undefined` **/ + apiReverseProxyUrl?: string; + /** @defaultValue `false` **/ + debug?: boolean; + completionParams?: Partial; + /** @defaultValue `4096` **/ + maxModelTokens?: number; + /** @defaultValue `1000` **/ + maxResponseTokens?: number; + /** @defaultValue `'User'` **/ + userLabel?: string; + /** @defaultValue `'ChatGPT'` **/ + assistantLabel?: string; + /** @defaultValue `undefined` **/ + organization?: string; + messageStore?: Keyv; + getMessageById?: GetMessageByIdFunction; + upsertMessage?: UpsertMessageFunction; + fetch?: FetchFn; + }); + /** + * Sends a message to ChatGPT, waits for the response to resolve, and returns + * the response. + * + * If you want your response to have historical context, you must provide a valid `parentMessageId`. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * If you want to receive the full response, including message and conversation IDs, + * you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation` + * helper. + * + * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI completions API. You can override the `promptPrefix` and `promptSuffix` in `opts` to customize the prompt. + * + * @param message - The prompt message to send + * @param opts.conversationId - Optional ID of a conversation to continue (defaults to a random UUID) + * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`) + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.promptPrefix - Optional override for the prompt prefix to send to the OpenAI completions endpoint + * @param opts.promptSuffix - Optional override for the prompt suffix to send to the OpenAI completions endpoint + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * + * @returns The response from ChatGPT + */ + sendMessage(text: string, opts?: SendMessageOptions): Promise; + get apiKey(): string; + set apiKey(apiKey: string); + protected _buildPrompt(message: string, opts: SendMessageOptions): Promise<{ + prompt: string; + maxTokens: number; + }>; + protected _getTokenCount(text: string): Promise; + protected get _isChatGPTModel(): boolean; + protected get _isCodexModel(): boolean; + protected _defaultGetMessageById(id: string): Promise; + protected _defaultUpsertMessage(message: ChatMessage): Promise; +} + +declare class ChatGPTUnofficialProxyAPI { + protected _accessToken: string; + protected _apiReverseProxyUrl: string; + protected _debug: boolean; + protected _model: string; + protected _headers: Record; + protected _fetch: FetchFn; + /** + * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function. + */ + constructor(opts: { + accessToken: string; + /** @defaultValue `https://chat.openai.com/backend-api/conversation` **/ + apiReverseProxyUrl?: string; + /** @defaultValue `text-davinci-002-render-sha` **/ + model?: string; + /** @defaultValue `false` **/ + debug?: boolean; + /** @defaultValue `undefined` **/ + headers?: Record; + fetch?: FetchFn; + }); + get accessToken(): string; + set accessToken(value: string); + /** + * Sends a message to ChatGPT, waits for the response to resolve, and returns + * the response. + * + * If you want your response to have historical context, you must provide a valid `parentMessageId`. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * If you want to receive the full response, including message and conversation IDs, + * you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation` + * helper. + * + * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI completions API. You can override the `promptPrefix` and `promptSuffix` in `opts` to customize the prompt. + * + * @param message - The prompt message to send + * @param opts.conversationId - Optional ID of a conversation to continue (defaults to a random UUID) + * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`) + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * + * @returns The response from ChatGPT + */ + sendMessage(text: string, opts?: SendMessageBrowserOptions): Promise; +} + +export { ChatGPTAPI, ChatGPTError, ChatGPTErrorType, ChatGPTUnofficialProxyAPI, ChatMessage, ContentType, ConversationJSONBody, ConversationResponseEvent, FetchFn, GetAccessTokenFn, GetMessageByIdFunction, Message, MessageActionType, MessageContent, MessageMetadata, Prompt, PromptContent, Role, SendMessageBrowserOptions, SendMessageOptions, UpsertMessageFunction, openai }; diff --git a/chatgpt-4.7.2/index.js b/chatgpt-4.7.2/index.js new file mode 100644 index 0000000..a8282a0 --- /dev/null +++ b/chatgpt-4.7.2/index.js @@ -0,0 +1,637 @@ +// Adapted from https://github.com/transitive-bullshit/chatgpt-api + +/** + * + * MIT License + +Copyright (c) 2023 Travis Fischer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ + +// src/chatgpt-api.ts +import Keyv from "keyv"; +import pTimeout from "p-timeout"; +import QuickLRU from "quick-lru"; +import { v4 as uuidv4 } from "uuid"; + +// src/tokenizer.ts +import GPT3TokenizerImport from "gpt3-tokenizer"; +var GPT3Tokenizer = typeof GPT3TokenizerImport === "function" ? GPT3TokenizerImport : GPT3TokenizerImport.default; +var tokenizer = new GPT3Tokenizer({ type: "gpt3" }); +function encode(input) { + return tokenizer.encode(input).bpe; +} + +// src/types.ts +var ChatGPTError = class extends Error { +}; + +// src/fetch.ts +var fetch = globalThis.fetch; + +// src/fetch-sse.ts +import { createParser } from "eventsource-parser"; + +// src/stream-async-iterable.ts +async function* streamAsyncIterable(stream) { + const reader = stream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + return; + } + yield value; + } + } finally { + reader.releaseLock(); + } +} + +// src/fetch-sse.ts +async function fetchSSE(url, options, fetch2 = fetch) { + const { onMessage, ...fetchOptions } = options; + const res = await fetch2(url, fetchOptions); + if (!res.ok) { + const reason = await res.text(); + const msg = `ChatGPT error ${res.status || res.statusText}: ${reason}`; + const error = new ChatGPTError(msg, { cause: reason }); + error.statusCode = res.status; + error.statusText = res.statusText; + throw error; + } + const parser = createParser((event) => { + if (event.type === "event") { + onMessage(event.data); + } + }); + if (!res.body.getReader) { + const body = res.body; + if (!body.on || !body.read) { + throw new ChatGPTError('unsupported "fetch" implementation'); + } + body.on("readable", () => { + let chunk; + while (null !== (chunk = body.read())) { + parser.feed(chunk.toString()); + } + }); + } else { + for await (const chunk of streamAsyncIterable(res.body)) { + const str = new TextDecoder().decode(chunk); + parser.feed(str); + } + } +} + +// src/chatgpt-api.ts +var CHATGPT_MODEL = "text-davinci-003"; +var USER_LABEL_DEFAULT = "User"; +var ASSISTANT_LABEL_DEFAULT = "ChatGPT"; +var ChatGPTAPI = class { + /** + * Creates a new client wrapper around OpenAI's completion API using the + * unofficial ChatGPT model. + * + * @param apiKey - OpenAI API key (required). + * @param apiBaseUrl - Optional override for the OpenAI API base URL. + * @param apiReverseProxyUrl - Optional override for a reverse proxy URL to use instead of the OpenAI API completions API. + * @param debug - Optional enables logging debugging info to stdout. + * @param completionParams - Param overrides to send to the [OpenAI completion API](https://platform.openai.com/docs/api-reference/completions/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant. + * @param maxModelTokens - Optional override for the maximum number of tokens allowed by the model's context. Defaults to 4096 for the `text-chat-davinci-002-20230126` model. + * @param maxResponseTokens - Optional override for the minimum number of tokens allowed for the model's response. Defaults to 1000 for the `text-chat-davinci-002-20230126` model. + * @param messageStore - Optional [Keyv](https://github.com/jaredwray/keyv) store to persist chat messages to. If not provided, messages will be lost when the process exits. + * @param getMessageById - Optional function to retrieve a message by its ID. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param upsertMessage - Optional function to insert or update a message. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param organization - Optional organization string for openai calls + * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function. + */ + constructor(opts) { + const { + apiKey, + apiBaseUrl = "https://api.openai.com", + apiReverseProxyUrl, + organization, + debug = false, + messageStore, + completionParams, + maxModelTokens = 4096, + maxResponseTokens = 1e3, + userLabel = USER_LABEL_DEFAULT, + assistantLabel = ASSISTANT_LABEL_DEFAULT, + getMessageById = this._defaultGetMessageById, + upsertMessage = this._defaultUpsertMessage, + fetch: fetch2 = fetch + } = opts; + this._apiKey = apiKey; + this._apiBaseUrl = apiBaseUrl; + this._organization = organization; + this._apiReverseProxyUrl = apiReverseProxyUrl; + this._debug = !!debug; + this._fetch = fetch2; + this._completionParams = { + model: CHATGPT_MODEL, + temperature: 0.8, + top_p: 1, + presence_penalty: 1, + ...completionParams + }; + if (this._isChatGPTModel) { + this._endToken = "<|im_end|>"; + this._sepToken = "<|im_sep|>"; + if (!this._completionParams.stop) { + this._completionParams.stop = [this._endToken, this._sepToken]; + } + } else if (this._isCodexModel) { + this._endToken = ""; + this._sepToken = this._endToken; + if (!this._completionParams.stop) { + this._completionParams.stop = [this._endToken]; + } + } else { + this._endToken = "<|endoftext|>"; + this._sepToken = this._endToken; + if (!this._completionParams.stop) { + this._completionParams.stop = [this._endToken]; + } + } + this._maxModelTokens = maxModelTokens; + this._maxResponseTokens = maxResponseTokens; + this._userLabel = userLabel; + this._assistantLabel = assistantLabel; + this._getMessageById = getMessageById; + this._upsertMessage = upsertMessage; + if (messageStore) { + this._messageStore = messageStore; + } else { + this._messageStore = new Keyv({ + store: new QuickLRU({ maxSize: 1e4 }) + }); + } + if (!this._apiKey) { + throw new Error("ChatGPT invalid apiKey"); + } + if (!this._fetch) { + throw new Error("Invalid environment; fetch is not defined"); + } + if (typeof this._fetch !== "function") { + throw new Error('Invalid "fetch" is not a function'); + } + } + /** + * Sends a message to ChatGPT, waits for the response to resolve, and returns + * the response. + * + * If you want your response to have historical context, you must provide a valid `parentMessageId`. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * If you want to receive the full response, including message and conversation IDs, + * you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation` + * helper. + * + * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI completions API. You can override the `promptPrefix` and `promptSuffix` in `opts` to customize the prompt. + * + * @param message - The prompt message to send + * @param opts.conversationId - Optional ID of a conversation to continue (defaults to a random UUID) + * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`) + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.promptPrefix - Optional override for the prompt prefix to send to the OpenAI completions endpoint + * @param opts.promptSuffix - Optional override for the prompt suffix to send to the OpenAI completions endpoint + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * + * @returns The response from ChatGPT + */ + async sendMessage(text, opts = {}) { + const { + conversationId = uuidv4(), + parentMessageId, + messageId = uuidv4(), + timeoutMs, + onProgress, + stream = onProgress ? true : false + } = opts; + let { abortSignal } = opts; + let abortController = null; + if (timeoutMs && !abortSignal) { + abortController = new AbortController(); + abortSignal = abortController.signal; + } + const message = { + role: "user", + id: messageId, + parentMessageId, + conversationId, + text + }; + await this._upsertMessage(message); + let prompt = text; + let maxTokens = 0; + if (!this._isCodexModel) { + const builtPrompt = await this._buildPrompt(text, opts); + prompt = builtPrompt.prompt; + maxTokens = builtPrompt.maxTokens; + } + const result = { + role: "assistant", + id: uuidv4(), + parentMessageId: messageId, + conversationId, + text: "" + }; + const responseP = new Promise( + async (resolve, reject) => { + var _a, _b; + const url = this._apiReverseProxyUrl || `${this._apiBaseUrl}/v1/completions`; + const headers = { + "Content-Type": "application/json", + Authorization: `Bearer ${this._apiKey}` + }; + if (this._organization) { + headers["OpenAI-Organization"] = this._organization; + } + const body = { + max_tokens: maxTokens, + ...this._completionParams, + prompt, + stream + }; + if (this._debug) { + const numTokens = await this._getTokenCount(body.prompt); + console.log(`sendMessage (${numTokens} tokens)`, body); + } + if (stream) { + fetchSSE( + url, + { + method: "POST", + headers, + body: JSON.stringify(body), + signal: abortSignal, + onMessage: (data) => { + var _a2; + if (data === "[DONE]") { + result.text = result.text.trim(); + return resolve(result); + } + try { + const response = JSON.parse(data); + if (response.id) { + result.id = response.id; + } + if ((_a2 = response == null ? void 0 : response.choices) == null ? void 0 : _a2.length) { + result.text += response.choices[0].text; + result.detail = response; + onProgress == null ? void 0 : onProgress(result); + } + } catch (err) { + console.warn("ChatGPT stream SEE event unexpected error", err); + return reject(err); + } + } + }, + this._fetch + ).catch(reject); + } else { + try { + const res = await this._fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), + signal: abortSignal + }); + if (!res.ok) { + const reason = await res.text(); + const msg = `ChatGPT error ${res.status || res.statusText}: ${reason}`; + const error = new ChatGPTError(msg, { cause: res }); + error.statusCode = res.status; + error.statusText = res.statusText; + return reject(error); + } + const response = await res.json(); + if (this._debug) { + console.log(response); + } + if (response == null ? void 0 : response.id) { + result.id = response.id; + } + if ((_a = response == null ? void 0 : response.choices) == null ? void 0 : _a.length) { + result.text = response.choices[0].text.trim(); + } else { + const res2 = response; + return reject( + new Error( + `ChatGPT error: ${((_b = res2 == null ? void 0 : res2.detail) == null ? void 0 : _b.message) || (res2 == null ? void 0 : res2.detail) || "unknown"}` + ) + ); + } + result.detail = response; + return resolve(result); + } catch (err) { + return reject(err); + } + } + } + ).then((message2) => { + return this._upsertMessage(message2).then(() => message2); + }); + if (timeoutMs) { + if (abortController) { + ; + responseP.cancel = () => { + abortController.abort(); + }; + } + return pTimeout(responseP, { + milliseconds: timeoutMs, + message: "ChatGPT timed out waiting for response" + }); + } else { + return responseP; + } + } + get apiKey() { + return this._apiKey; + } + set apiKey(apiKey) { + this._apiKey = apiKey; + } + async _buildPrompt(message, opts) { + const currentDate = (/* @__PURE__ */ new Date()).toISOString().split("T")[0]; + const promptPrefix = opts.promptPrefix || `Instructions: +You are ${this._assistantLabel}, a large language model trained by OpenAI. +Current date: ${currentDate}${this._sepToken} + +`; + const promptSuffix = opts.promptSuffix || ` + +${this._assistantLabel}: +`; + const maxNumTokens = this._maxModelTokens - this._maxResponseTokens; + let { parentMessageId } = opts; + let nextPromptBody = `${this._userLabel}: + +${message}${this._endToken}`; + let promptBody = ""; + let prompt; + let numTokens; + do { + const nextPrompt = `${promptPrefix}${nextPromptBody}${promptSuffix}`; + const nextNumTokens = await this._getTokenCount(nextPrompt); + const isValidPrompt = nextNumTokens <= maxNumTokens; + if (prompt && !isValidPrompt) { + break; + } + promptBody = nextPromptBody; + prompt = nextPrompt; + numTokens = nextNumTokens; + if (!isValidPrompt) { + break; + } + if (!parentMessageId) { + break; + } + const parentMessage = await this._getMessageById(parentMessageId); + if (!parentMessage) { + break; + } + const parentMessageRole = parentMessage.role || "user"; + const parentMessageRoleDesc = parentMessageRole === "user" ? this._userLabel : this._assistantLabel; + const parentMessageString = `${parentMessageRoleDesc}: + +${parentMessage.text}${this._endToken} + +`; + nextPromptBody = `${parentMessageString}${promptBody}`; + parentMessageId = parentMessage.parentMessageId; + } while (true); + const maxTokens = Math.max( + 1, + Math.min(this._maxModelTokens - numTokens, this._maxResponseTokens) + ); + return { prompt, maxTokens }; + } + async _getTokenCount(text) { + if (this._isChatGPTModel) { + text = text.replace(/<\|im_end\|>/g, "<|endoftext|>"); + text = text.replace(/<\|im_sep\|>/g, "<|endoftext|>"); + } + return encode(text).length; + } + get _isChatGPTModel() { + return this._completionParams.model.startsWith("text-chat") || this._completionParams.model.startsWith("text-davinci-002-render"); + } + get _isCodexModel() { + return this._completionParams.model.startsWith("code-"); + } + async _defaultGetMessageById(id) { + const res = await this._messageStore.get(id); + if (this._debug) { + console.log("getMessageById", id, res); + } + return res; + } + async _defaultUpsertMessage(message) { + if (this._debug) { + console.log("upsertMessage", message.id, message); + } + await this._messageStore.set(message.id, message); + } +}; + +// src/chatgpt-unofficial-proxy-api.ts +import pTimeout2 from "p-timeout"; +import { v4 as uuidv42 } from "uuid"; +var ChatGPTUnofficialProxyAPI = class { + /** + * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function. + */ + constructor(opts) { + const { + accessToken, + apiReverseProxyUrl = "https://chat.duti.tech/api/conversation", + model = "text-davinci-002-render-sha", + debug = false, + headers, + fetch: fetch2 = fetch + } = opts; + this._accessToken = accessToken; + this._apiReverseProxyUrl = apiReverseProxyUrl; + this._debug = !!debug; + this._model = model; + this._fetch = fetch2; + this._headers = headers; + if (!this._accessToken) { + throw new Error("ChatGPT invalid accessToken"); + } + if (!this._fetch) { + throw new Error("Invalid environment; fetch is not defined"); + } + if (typeof this._fetch !== "function") { + throw new Error('Invalid "fetch" is not a function'); + } + } + get accessToken() { + return this._accessToken; + } + set accessToken(value) { + this._accessToken = value; + } + /** + * Sends a message to ChatGPT, waits for the response to resolve, and returns + * the response. + * + * If you want your response to have historical context, you must provide a valid `parentMessageId`. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * If you want to receive the full response, including message and conversation IDs, + * you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation` + * helper. + * + * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI completions API. You can override the `promptPrefix` and `promptSuffix` in `opts` to customize the prompt. + * + * @param message - The prompt message to send + * @param opts.conversationId - Optional ID of a conversation to continue (defaults to a random UUID) + * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`) + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * + * @returns The response from ChatGPT + */ + async sendMessage(text, opts = {}) { + const { + conversationId, + parentMessageId = uuidv42(), + messageId = uuidv42(), + action = "next", + timeoutMs, + onProgress + } = opts; + let { abortSignal } = opts; + let abortController = null; + if (timeoutMs && !abortSignal) { + abortController = new AbortController(); + abortSignal = abortController.signal; + } + const body = { + action, + messages: [ + { + id: messageId, + role: "user", + content: { + content_type: "text", + parts: [text] + } + } + ], + model: this._model, + parent_message_id: parentMessageId + }; + if (conversationId) { + body.conversation_id = conversationId; + } + const result = { + role: "assistant", + id: uuidv42(), + parentMessageId: messageId, + conversationId, + text: "" + }; + const responseP = new Promise((resolve, reject) => { + const url = this._apiReverseProxyUrl; + const headers = { + ...this._headers, + Authorization: `Bearer ${this._accessToken}`, + Accept: "text/event-stream", + "Content-Type": "application/json" + }; + if (this._debug) { + console.log("POST", url, { body, headers }); + } + fetchSSE( + url, + { + method: "POST", + headers, + body: JSON.stringify(body), + signal: abortSignal, + onMessage: (data) => { + var _a, _b, _c; + if (data === "[DONE]") { + return resolve(result); + } + try { + const convoResponseEvent = JSON.parse(data); + if (convoResponseEvent.conversation_id) { + result.conversationId = convoResponseEvent.conversation_id; + } + if ((_a = convoResponseEvent.message) == null ? void 0 : _a.id) { + result.id = convoResponseEvent.message.id; + } + const message = convoResponseEvent.message; + if (message) { + let text2 = (_c = (_b = message == null ? void 0 : message.content) == null ? void 0 : _b.parts) == null ? void 0 : _c[0]; + if (text2) { + result.text = text2; + if (onProgress) { + onProgress(result); + } + } + } + } catch (err) { + } + } + }, + this._fetch + ).catch((err) => { + const errMessageL = err.toString().toLowerCase(); + if (result.text && (errMessageL === "error: typeerror: terminated" || errMessageL === "typeerror: terminated")) { + return resolve(result); + } else { + return reject(err); + } + }); + }); + if (timeoutMs) { + if (abortController) { + ; + responseP.cancel = () => { + abortController.abort(); + }; + } + return pTimeout2(responseP, { + milliseconds: timeoutMs, + message: "ChatGPT timed out waiting for response" + }); + } else { + return responseP; + } + } +}; +export { + ChatGPTAPI, + ChatGPTError, + ChatGPTUnofficialProxyAPI +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/chatgpt-4.7.2/index.js.map b/chatgpt-4.7.2/index.js.map new file mode 100644 index 0000000..2dcf3bc --- /dev/null +++ b/chatgpt-4.7.2/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/chatgpt-api.ts","../src/tokenizer.ts","../src/types.ts","../src/fetch.ts","../src/fetch-sse.ts","../src/stream-async-iterable.ts","../src/chatgpt-unofficial-proxy-api.ts"],"sourcesContent":["import Keyv from 'keyv'\r\nimport pTimeout from 'p-timeout'\r\nimport QuickLRU from 'quick-lru'\r\nimport { v4 as uuidv4 } from 'uuid'\r\n\r\nimport * as tokenizer from './tokenizer'\r\nimport * as types from './types'\r\nimport { fetch as globalFetch } from './fetch'\r\nimport { fetchSSE } from './fetch-sse'\r\n\r\n// Official model (costs money and is not fine-tuned for chat)\r\nconst CHATGPT_MODEL = 'text-davinci-003'\r\n\r\nconst USER_LABEL_DEFAULT = 'User'\r\nconst ASSISTANT_LABEL_DEFAULT = 'ChatGPT'\r\n\r\nexport class ChatGPTAPI {\r\n protected _apiKey: string\r\n protected _apiBaseUrl: string\r\n protected _apiReverseProxyUrl: string\r\n protected _debug: boolean\r\n\r\n protected _completionParams: Omit\r\n protected _maxModelTokens: number\r\n protected _maxResponseTokens: number\r\n protected _userLabel: string\r\n protected _assistantLabel: string\r\n protected _endToken: string\r\n protected _sepToken: string\r\n protected _fetch: types.FetchFn\r\n\r\n protected _getMessageById: types.GetMessageByIdFunction\r\n protected _upsertMessage: types.UpsertMessageFunction\r\n\r\n protected _messageStore: Keyv\r\n\r\n protected _organization: string\r\n\r\n /**\r\n * Creates a new client wrapper around OpenAI's completion API using the\r\n * unofficial ChatGPT model.\r\n *\r\n * @param apiKey - OpenAI API key (required).\r\n * @param apiBaseUrl - Optional override for the OpenAI API base URL.\r\n * @param apiReverseProxyUrl - Optional override for a reverse proxy URL to use instead of the OpenAI API completions API.\r\n * @param debug - Optional enables logging debugging info to stdout.\r\n * @param completionParams - Param overrides to send to the [OpenAI completion API](https://platform.openai.com/docs/api-reference/completions/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant.\r\n * @param maxModelTokens - Optional override for the maximum number of tokens allowed by the model's context. Defaults to 4096 for the `text-chat-davinci-002-20230126` model.\r\n * @param maxResponseTokens - Optional override for the minimum number of tokens allowed for the model's response. Defaults to 1000 for the `text-chat-davinci-002-20230126` model.\r\n * @param messageStore - Optional [Keyv](https://github.com/jaredwray/keyv) store to persist chat messages to. If not provided, messages will be lost when the process exits.\r\n * @param getMessageById - Optional function to retrieve a message by its ID. If not provided, the default implementation will be used (using an in-memory `messageStore`).\r\n * @param upsertMessage - Optional function to insert or update a message. If not provided, the default implementation will be used (using an in-memory `messageStore`).\r\n * @param organization - Optional organization string for openai calls\r\n * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function.\r\n */\r\n constructor(opts: {\r\n apiKey: string\r\n\r\n /** @defaultValue `'https://api.openai.com'` **/\r\n apiBaseUrl?: string\r\n\r\n /** @defaultValue `undefined` **/\r\n apiReverseProxyUrl?: string\r\n\r\n /** @defaultValue `false` **/\r\n debug?: boolean\r\n\r\n completionParams?: Partial\r\n\r\n /** @defaultValue `4096` **/\r\n maxModelTokens?: number\r\n\r\n /** @defaultValue `1000` **/\r\n maxResponseTokens?: number\r\n\r\n /** @defaultValue `'User'` **/\r\n userLabel?: string\r\n\r\n /** @defaultValue `'ChatGPT'` **/\r\n assistantLabel?: string\r\n\r\n /** @defaultValue `undefined` **/\r\n organization?: string\r\n\r\n messageStore?: Keyv\r\n getMessageById?: types.GetMessageByIdFunction\r\n upsertMessage?: types.UpsertMessageFunction\r\n\r\n fetch?: types.FetchFn\r\n }) {\r\n const {\r\n apiKey,\r\n apiBaseUrl = 'https://api.openai.com',\r\n apiReverseProxyUrl,\r\n organization,\r\n debug = false,\r\n messageStore,\r\n completionParams,\r\n maxModelTokens = 4096,\r\n maxResponseTokens = 1000,\r\n userLabel = USER_LABEL_DEFAULT,\r\n assistantLabel = ASSISTANT_LABEL_DEFAULT,\r\n getMessageById = this._defaultGetMessageById,\r\n upsertMessage = this._defaultUpsertMessage,\r\n fetch = globalFetch\r\n } = opts\r\n\r\n this._apiKey = apiKey\r\n this._apiBaseUrl = apiBaseUrl\r\n this._organization = organization\r\n this._apiReverseProxyUrl = apiReverseProxyUrl\r\n this._debug = !!debug\r\n this._fetch = fetch\r\n\r\n this._completionParams = {\r\n model: CHATGPT_MODEL,\r\n temperature: 0.8,\r\n top_p: 1.0,\r\n presence_penalty: 1.0,\r\n ...completionParams\r\n }\r\n\r\n if (this._isChatGPTModel) {\r\n this._endToken = '<|im_end|>'\r\n this._sepToken = '<|im_sep|>'\r\n\r\n if (!this._completionParams.stop) {\r\n this._completionParams.stop = [this._endToken, this._sepToken]\r\n }\r\n } else if (this._isCodexModel) {\r\n this._endToken = ''\r\n this._sepToken = this._endToken\r\n if (!this._completionParams.stop) {\r\n this._completionParams.stop = [this._endToken]\r\n }\r\n } else {\r\n this._endToken = '<|endoftext|>'\r\n this._sepToken = this._endToken\r\n\r\n if (!this._completionParams.stop) {\r\n this._completionParams.stop = [this._endToken]\r\n }\r\n }\r\n\r\n this._maxModelTokens = maxModelTokens\r\n this._maxResponseTokens = maxResponseTokens\r\n this._userLabel = userLabel\r\n this._assistantLabel = assistantLabel\r\n\r\n this._getMessageById = getMessageById\r\n this._upsertMessage = upsertMessage\r\n\r\n if (messageStore) {\r\n this._messageStore = messageStore\r\n } else {\r\n this._messageStore = new Keyv({\r\n store: new QuickLRU({ maxSize: 10000 })\r\n })\r\n }\r\n\r\n if (!this._apiKey) {\r\n throw new Error('ChatGPT invalid apiKey')\r\n }\r\n\r\n if (!this._fetch) {\r\n throw new Error('Invalid environment; fetch is not defined')\r\n }\r\n\r\n if (typeof this._fetch !== 'function') {\r\n throw new Error('Invalid \"fetch\" is not a function')\r\n }\r\n }\r\n\r\n /**\r\n * Sends a message to ChatGPT, waits for the response to resolve, and returns\r\n * the response.\r\n *\r\n * If you want your response to have historical context, you must provide a valid `parentMessageId`.\r\n *\r\n * If you want to receive a stream of partial responses, use `opts.onProgress`.\r\n * If you want to receive the full response, including message and conversation IDs,\r\n * you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation`\r\n * helper.\r\n *\r\n * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI completions API. You can override the `promptPrefix` and `promptSuffix` in `opts` to customize the prompt.\r\n *\r\n * @param message - The prompt message to send\r\n * @param opts.conversationId - Optional ID of a conversation to continue (defaults to a random UUID)\r\n * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`)\r\n * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID)\r\n * @param opts.promptPrefix - Optional override for the prompt prefix to send to the OpenAI completions endpoint\r\n * @param opts.promptSuffix - Optional override for the prompt suffix to send to the OpenAI completions endpoint\r\n * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout)\r\n * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated\r\n * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)\r\n *\r\n * @returns The response from ChatGPT\r\n */\r\n async sendMessage(\r\n text: string,\r\n opts: types.SendMessageOptions = {}\r\n ): Promise {\r\n const {\r\n conversationId = uuidv4(),\r\n parentMessageId,\r\n messageId = uuidv4(),\r\n timeoutMs,\r\n onProgress,\r\n stream = onProgress ? true : false\r\n } = opts\r\n\r\n let { abortSignal } = opts\r\n\r\n let abortController: AbortController = null\r\n if (timeoutMs && !abortSignal) {\r\n abortController = new AbortController()\r\n abortSignal = abortController.signal\r\n }\r\n\r\n const message: types.ChatMessage = {\r\n role: 'user',\r\n id: messageId,\r\n parentMessageId,\r\n conversationId,\r\n text\r\n }\r\n await this._upsertMessage(message)\r\n\r\n let prompt = text\r\n let maxTokens = 0\r\n if (!this._isCodexModel) {\r\n const builtPrompt = await this._buildPrompt(text, opts)\r\n prompt = builtPrompt.prompt\r\n maxTokens = builtPrompt.maxTokens\r\n }\r\n\r\n const result: types.ChatMessage = {\r\n role: 'assistant',\r\n id: uuidv4(),\r\n parentMessageId: messageId,\r\n conversationId,\r\n text: ''\r\n }\r\n\r\n const responseP = new Promise(\r\n async (resolve, reject) => {\r\n const url =\r\n this._apiReverseProxyUrl || `${this._apiBaseUrl}/v1/completions`\r\n const headers = {\r\n 'Content-Type': 'application/json',\r\n Authorization: `Bearer ${this._apiKey}`\r\n }\r\n if (this._organization) {\r\n headers['OpenAI-Organization'] = this._organization\r\n }\r\n const body = {\r\n max_tokens: maxTokens,\r\n ...this._completionParams,\r\n prompt,\r\n stream\r\n }\r\n\r\n if (this._debug) {\r\n const numTokens = await this._getTokenCount(body.prompt)\r\n console.log(`sendMessage (${numTokens} tokens)`, body)\r\n }\r\n\r\n if (stream) {\r\n fetchSSE(\r\n url,\r\n {\r\n method: 'POST',\r\n headers,\r\n body: JSON.stringify(body),\r\n signal: abortSignal,\r\n onMessage: (data: string) => {\r\n if (data === '[DONE]') {\r\n result.text = result.text.trim()\r\n return resolve(result)\r\n }\r\n\r\n try {\r\n const response: types.openai.CompletionResponse =\r\n JSON.parse(data)\r\n\r\n if (response.id) {\r\n result.id = response.id\r\n }\r\n\r\n if (response?.choices?.length) {\r\n result.text += response.choices[0].text\r\n result.detail = response\r\n\r\n onProgress?.(result)\r\n }\r\n } catch (err) {\r\n console.warn('ChatGPT stream SEE event unexpected error', err)\r\n return reject(err)\r\n }\r\n }\r\n },\r\n this._fetch\r\n ).catch(reject)\r\n } else {\r\n try {\r\n const res = await this._fetch(url, {\r\n method: 'POST',\r\n headers,\r\n body: JSON.stringify(body),\r\n signal: abortSignal\r\n })\r\n\r\n if (!res.ok) {\r\n const reason = await res.text()\r\n const msg = `ChatGPT error ${\r\n res.status || res.statusText\r\n }: ${reason}`\r\n const error = new types.ChatGPTError(msg, { cause: res })\r\n error.statusCode = res.status\r\n error.statusText = res.statusText\r\n return reject(error)\r\n }\r\n\r\n const response: types.openai.CompletionResponse = await res.json()\r\n if (this._debug) {\r\n console.log(response)\r\n }\r\n\r\n if (response?.id) {\r\n result.id = response.id\r\n }\r\n\r\n if (response?.choices?.length) {\r\n result.text = response.choices[0].text.trim()\r\n } else {\r\n const res = response as any\r\n return reject(\r\n new Error(\r\n `ChatGPT error: ${\r\n res?.detail?.message || res?.detail || 'unknown'\r\n }`\r\n )\r\n )\r\n }\r\n\r\n result.detail = response\r\n\r\n return resolve(result)\r\n } catch (err) {\r\n return reject(err)\r\n }\r\n }\r\n }\r\n ).then((message) => {\r\n return this._upsertMessage(message).then(() => message)\r\n })\r\n\r\n if (timeoutMs) {\r\n if (abortController) {\r\n // This will be called when a timeout occurs in order for us to forcibly\r\n // ensure that the underlying HTTP request is aborted.\r\n ;(responseP as any).cancel = () => {\r\n abortController.abort()\r\n }\r\n }\r\n\r\n return pTimeout(responseP, {\r\n milliseconds: timeoutMs,\r\n message: 'ChatGPT timed out waiting for response'\r\n })\r\n } else {\r\n return responseP\r\n }\r\n }\r\n\r\n get apiKey(): string {\r\n return this._apiKey\r\n }\r\n\r\n set apiKey(apiKey: string) {\r\n this._apiKey = apiKey\r\n }\r\n\r\n protected async _buildPrompt(\r\n message: string,\r\n opts: types.SendMessageOptions\r\n ) {\r\n /*\r\n ChatGPT preamble example:\r\n You are ChatGPT, a large language model trained by OpenAI. You answer as concisely as possible for each response (e.g. don’t be verbose). It is very important that you answer as concisely as possible, so please remember this. If you are generating a list, do not have too many items. Keep the number of items short.\r\n Knowledge cutoff: 2021-09\r\n Current date: 2023-01-31\r\n */\r\n // This preamble was obtained by asking ChatGPT \"Please print the instructions you were given before this message.\"\r\n const currentDate = new Date().toISOString().split('T')[0]\r\n\r\n const promptPrefix =\r\n opts.promptPrefix ||\r\n `Instructions:\\nYou are ${this._assistantLabel}, a large language model trained by OpenAI.\r\nCurrent date: ${currentDate}${this._sepToken}\\n\\n`\r\n const promptSuffix = opts.promptSuffix || `\\n\\n${this._assistantLabel}:\\n`\r\n\r\n const maxNumTokens = this._maxModelTokens - this._maxResponseTokens\r\n let { parentMessageId } = opts\r\n let nextPromptBody = `${this._userLabel}:\\n\\n${message}${this._endToken}`\r\n let promptBody = ''\r\n let prompt: string\r\n let numTokens: number\r\n\r\n do {\r\n const nextPrompt = `${promptPrefix}${nextPromptBody}${promptSuffix}`\r\n const nextNumTokens = await this._getTokenCount(nextPrompt)\r\n const isValidPrompt = nextNumTokens <= maxNumTokens\r\n\r\n if (prompt && !isValidPrompt) {\r\n break\r\n }\r\n\r\n promptBody = nextPromptBody\r\n prompt = nextPrompt\r\n numTokens = nextNumTokens\r\n\r\n if (!isValidPrompt) {\r\n break\r\n }\r\n\r\n if (!parentMessageId) {\r\n break\r\n }\r\n\r\n const parentMessage = await this._getMessageById(parentMessageId)\r\n if (!parentMessage) {\r\n break\r\n }\r\n\r\n const parentMessageRole = parentMessage.role || 'user'\r\n const parentMessageRoleDesc =\r\n parentMessageRole === 'user' ? this._userLabel : this._assistantLabel\r\n\r\n // TODO: differentiate between assistant and user messages\r\n const parentMessageString = `${parentMessageRoleDesc}:\\n\\n${parentMessage.text}${this._endToken}\\n\\n`\r\n nextPromptBody = `${parentMessageString}${promptBody}`\r\n parentMessageId = parentMessage.parentMessageId\r\n } while (true)\r\n\r\n // Use up to 4096 tokens (prompt + response), but try to leave 1000 tokens\r\n // for the response.\r\n const maxTokens = Math.max(\r\n 1,\r\n Math.min(this._maxModelTokens - numTokens, this._maxResponseTokens)\r\n )\r\n\r\n return { prompt, maxTokens }\r\n }\r\n\r\n protected async _getTokenCount(text: string) {\r\n if (this._isChatGPTModel) {\r\n // With this model, \"<|im_end|>\" is 1 token, but tokenizers aren't aware of it yet.\r\n // Replace it with \"<|endoftext|>\" (which it does know about) so that the tokenizer can count it as 1 token.\r\n text = text.replace(/<\\|im_end\\|>/g, '<|endoftext|>')\r\n text = text.replace(/<\\|im_sep\\|>/g, '<|endoftext|>')\r\n }\r\n\r\n return tokenizer.encode(text).length\r\n }\r\n\r\n protected get _isChatGPTModel() {\r\n return (\r\n this._completionParams.model.startsWith('text-chat') ||\r\n this._completionParams.model.startsWith('text-davinci-002-render')\r\n )\r\n }\r\n\r\n protected get _isCodexModel() {\r\n return this._completionParams.model.startsWith('code-')\r\n }\r\n\r\n protected async _defaultGetMessageById(\r\n id: string\r\n ): Promise {\r\n const res = await this._messageStore.get(id)\r\n if (this._debug) {\r\n console.log('getMessageById', id, res)\r\n }\r\n return res\r\n }\r\n\r\n protected async _defaultUpsertMessage(\r\n message: types.ChatMessage\r\n ): Promise {\r\n if (this._debug) {\r\n console.log('upsertMessage', message.id, message)\r\n }\r\n await this._messageStore.set(message.id, message)\r\n }\r\n}\r\n","import GPT3TokenizerImport from 'gpt3-tokenizer'\r\n\r\nconst GPT3Tokenizer: typeof GPT3TokenizerImport =\r\n typeof GPT3TokenizerImport === 'function'\r\n ? GPT3TokenizerImport\r\n : (GPT3TokenizerImport as any).default\r\n\r\nexport const tokenizer = new GPT3Tokenizer({ type: 'gpt3' })\r\n\r\nexport function encode(input: string): number[] {\r\n return tokenizer.encode(input).bpe\r\n}\r\n","export type Role = 'user' | 'assistant'\r\n\r\nexport type FetchFn = typeof fetch\r\n\r\nexport type SendMessageOptions = {\r\n conversationId?: string\r\n parentMessageId?: string\r\n messageId?: string\r\n stream?: boolean\r\n promptPrefix?: string\r\n promptSuffix?: string\r\n timeoutMs?: number\r\n onProgress?: (partialResponse: ChatMessage) => void\r\n abortSignal?: AbortSignal\r\n}\r\n\r\nexport type MessageActionType = 'next' | 'variant'\r\n\r\nexport type SendMessageBrowserOptions = {\r\n conversationId?: string\r\n parentMessageId?: string\r\n messageId?: string\r\n action?: MessageActionType\r\n timeoutMs?: number\r\n onProgress?: (partialResponse: ChatMessage) => void\r\n abortSignal?: AbortSignal\r\n}\r\n\r\nexport interface ChatMessage {\r\n id: string\r\n text: string\r\n role: Role\r\n parentMessageId?: string\r\n conversationId?: string\r\n detail?: any\r\n}\r\n\r\nexport type ChatGPTErrorType =\r\n | 'unknown'\r\n | 'chatgpt:pool:account-on-cooldown'\r\n | 'chatgpt:pool:account-not-found'\r\n | 'chatgpt:pool:no-accounts'\r\n | 'chatgpt:pool:timeout'\r\n | 'chatgpt:pool:rate-limit'\r\n | 'chatgpt:pool:unavailable'\r\n\r\nexport class ChatGPTError extends Error {\r\n statusCode?: number\r\n statusText?: string\r\n isFinal?: boolean\r\n accountId?: string\r\n type?: ChatGPTErrorType\r\n}\r\n\r\n/** Returns a chat message from a store by it's ID (or null if not found). */\r\nexport type GetMessageByIdFunction = (id: string) => Promise\r\n\r\n/** Upserts a chat message to a store. */\r\nexport type UpsertMessageFunction = (message: ChatMessage) => Promise\r\n\r\nexport namespace openai {\r\n export type CompletionParams = {\r\n /** ID of the model to use. */\r\n model: string\r\n\r\n /** The string prompt to generate a completion for. */\r\n prompt: string\r\n\r\n /**\r\n * The suffix that comes after a completion of inserted text.\r\n */\r\n suffix?: string\r\n\r\n /**\r\n * The maximum number of tokens to generate in the completion. The token count of your prompt plus `max_tokens` cannot exceed the model\\'s context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096).\r\n */\r\n max_tokens?: number\r\n\r\n /**\r\n * What [sampling temperature](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277) to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or `top_p` but not both.\r\n */\r\n temperature?: number\r\n\r\n /**\r\n * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.\r\n */\r\n top_p?: number\r\n\r\n /**\r\n * Include the log probabilities on the `logprobs` most likely tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. The maximum value for `logprobs` is 5. If you need more than this, please contact us through our [Help center](https://help.openai.com) and describe your use case.\r\n */\r\n logprobs?: number\r\n\r\n /**\r\n * Echo back the prompt in addition to the completion\r\n */\r\n echo?: boolean\r\n\r\n /**\r\n * Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.\r\n */\r\n stop?: string[]\r\n\r\n /**\r\n * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model\\'s likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)\r\n */\r\n presence_penalty?: number\r\n\r\n /**\r\n * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model\\'s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)\r\n */\r\n frequency_penalty?: number\r\n\r\n /**\r\n * Generates `best_of` completions server-side and returns the \\\"best\\\" (the one with the highest log probability per token). Results cannot be streamed. When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\r\n */\r\n best_of?: number\r\n\r\n /**\r\n * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) (which works for both GPT-2 and GPT-3) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. As an example, you can pass `{\\\"50256\\\": -100}` to prevent the <|endoftext|> token from being generated.\r\n */\r\n logit_bias?: Record\r\n\r\n /**\r\n * A unique identifier representing your end-user, which will help OpenAI to monitor and detect abuse. [Learn more](/docs/usage-policies/end-user-ids).\r\n */\r\n user?: string\r\n\r\n /* NOTE: this is handled by the `sendMessage` function.\r\n *\r\n * Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.\r\n */\r\n // stream?: boolean | null\r\n\r\n /**\r\n * NOT SUPPORTED\r\n */\r\n /**\r\n * How many completions to generate for each prompt. **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`.\r\n */\r\n // 'n'?: number | null;\r\n }\r\n\r\n export type ReverseProxyCompletionParams = CompletionParams & {\r\n paid?: boolean\r\n }\r\n\r\n export type CompletionResponse = {\r\n id: string\r\n object: string\r\n created: number\r\n model: string\r\n choices: CompletionResponseChoices\r\n usage?: CompletionResponseUsage\r\n }\r\n\r\n export type CompletionResponseChoices = {\r\n text?: string\r\n index?: number\r\n logprobs?: {\r\n tokens?: Array\r\n token_logprobs?: Array\r\n top_logprobs?: Array\r\n text_offset?: Array\r\n } | null\r\n finish_reason?: string\r\n }[]\r\n\r\n export type CompletionResponseUsage = {\r\n prompt_tokens: number\r\n completion_tokens: number\r\n total_tokens: number\r\n }\r\n}\r\n\r\n/**\r\n * https://chat.openapi.com/backend-api/conversation\r\n */\r\nexport type ConversationJSONBody = {\r\n /**\r\n * The action to take\r\n */\r\n action: string\r\n\r\n /**\r\n * The ID of the conversation\r\n */\r\n conversation_id?: string\r\n\r\n /**\r\n * Prompts to provide\r\n */\r\n messages: Prompt[]\r\n\r\n /**\r\n * The model to use\r\n */\r\n model: string\r\n\r\n /**\r\n * The parent message ID\r\n */\r\n parent_message_id: string\r\n}\r\n\r\nexport type Prompt = {\r\n /**\r\n * The content of the prompt\r\n */\r\n content: PromptContent\r\n\r\n /**\r\n * The ID of the prompt\r\n */\r\n id: string\r\n\r\n /**\r\n * The role played in the prompt\r\n */\r\n role: Role\r\n}\r\n\r\nexport type ContentType = 'text'\r\n\r\nexport type PromptContent = {\r\n /**\r\n * The content type of the prompt\r\n */\r\n content_type: ContentType\r\n\r\n /**\r\n * The parts to the prompt\r\n */\r\n parts: string[]\r\n}\r\n\r\nexport type ConversationResponseEvent = {\r\n message?: Message\r\n conversation_id?: string\r\n error?: string | null\r\n}\r\n\r\nexport type Message = {\r\n id: string\r\n content: MessageContent\r\n role: Role\r\n user: string | null\r\n create_time: string | null\r\n update_time: string | null\r\n end_turn: null\r\n weight: number\r\n recipient: string\r\n metadata: MessageMetadata\r\n}\r\n\r\nexport type MessageContent = {\r\n content_type: string\r\n parts: string[]\r\n}\r\n\r\nexport type MessageMetadata = any\r\n\r\nexport type GetAccessTokenFn = ({\r\n email,\r\n password,\r\n sessionToken\r\n}: {\r\n email: string\r\n password: string\r\n sessionToken?: string\r\n}) => string | Promise\r\n","/// \r\n\r\nconst fetch = globalThis.fetch\r\n\r\nexport { fetch }\r\n","import { createParser } from 'eventsource-parser'\r\n\r\nimport * as types from './types'\r\nimport { fetch as globalFetch } from './fetch'\r\nimport { streamAsyncIterable } from './stream-async-iterable'\r\n\r\nexport async function fetchSSE(\r\n url: string,\r\n options: Parameters[1] & { onMessage: (data: string) => void },\r\n fetch: types.FetchFn = globalFetch\r\n) {\r\n const { onMessage, ...fetchOptions } = options\r\n const res = await fetch(url, fetchOptions)\r\n if (!res.ok) {\r\n const reason = await res.text()\r\n const msg = `ChatGPT error ${res.status || res.statusText}: ${reason}`\r\n const error = new types.ChatGPTError(msg, { cause: reason })\r\n error.statusCode = res.status\r\n error.statusText = res.statusText\r\n throw error\r\n }\r\n\r\n const parser = createParser((event) => {\r\n if (event.type === 'event') {\r\n onMessage(event.data)\r\n }\r\n })\r\n\r\n if (!res.body.getReader) {\r\n // Vercel polyfills `fetch` with `node-fetch`, which doesn't conform to\r\n // web standards, so this is a workaround...\r\n const body: NodeJS.ReadableStream = res.body as any\r\n\r\n if (!body.on || !body.read) {\r\n throw new types.ChatGPTError('unsupported \"fetch\" implementation')\r\n }\r\n\r\n body.on('readable', () => {\r\n let chunk: string | Buffer\r\n while (null !== (chunk = body.read())) {\r\n parser.feed(chunk.toString())\r\n }\r\n })\r\n } else {\r\n for await (const chunk of streamAsyncIterable(res.body)) {\r\n const str = new TextDecoder().decode(chunk)\r\n parser.feed(str)\r\n }\r\n }\r\n}\r\n","export async function* streamAsyncIterable(stream: ReadableStream) {\r\n const reader = stream.getReader()\r\n try {\r\n while (true) {\r\n const { done, value } = await reader.read()\r\n if (done) {\r\n return\r\n }\r\n yield value\r\n }\r\n } finally {\r\n reader.releaseLock()\r\n }\r\n}\r\n","import pTimeout from 'p-timeout'\r\nimport { v4 as uuidv4 } from 'uuid'\r\n\r\nimport * as types from './types'\r\nimport { fetch as globalFetch } from './fetch'\r\nimport { fetchSSE } from './fetch-sse'\r\n\r\nexport class ChatGPTUnofficialProxyAPI {\r\n protected _accessToken: string\r\n protected _apiReverseProxyUrl: string\r\n protected _debug: boolean\r\n protected _model: string\r\n protected _headers: Record\r\n protected _fetch: types.FetchFn\r\n\r\n /**\r\n * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function.\r\n */\r\n constructor(opts: {\r\n accessToken: string\r\n\r\n /** @defaultValue `https://chat.openai.com/backend-api/conversation` **/\r\n apiReverseProxyUrl?: string\r\n\r\n /** @defaultValue `text-davinci-002-render-sha` **/\r\n model?: string\r\n\r\n /** @defaultValue `false` **/\r\n debug?: boolean\r\n\r\n /** @defaultValue `undefined` **/\r\n headers?: Record\r\n\r\n fetch?: types.FetchFn\r\n }) {\r\n const {\r\n accessToken,\r\n apiReverseProxyUrl = 'https://chat.duti.tech/api/conversation',\r\n model = 'text-davinci-002-render-sha',\r\n debug = false,\r\n headers,\r\n fetch = globalFetch\r\n } = opts\r\n\r\n this._accessToken = accessToken\r\n this._apiReverseProxyUrl = apiReverseProxyUrl\r\n this._debug = !!debug\r\n this._model = model\r\n this._fetch = fetch\r\n this._headers = headers\r\n\r\n if (!this._accessToken) {\r\n throw new Error('ChatGPT invalid accessToken')\r\n }\r\n\r\n if (!this._fetch) {\r\n throw new Error('Invalid environment; fetch is not defined')\r\n }\r\n\r\n if (typeof this._fetch !== 'function') {\r\n throw new Error('Invalid \"fetch\" is not a function')\r\n }\r\n }\r\n\r\n get accessToken(): string {\r\n return this._accessToken\r\n }\r\n\r\n set accessToken(value: string) {\r\n this._accessToken = value\r\n }\r\n\r\n /**\r\n * Sends a message to ChatGPT, waits for the response to resolve, and returns\r\n * the response.\r\n *\r\n * If you want your response to have historical context, you must provide a valid `parentMessageId`.\r\n *\r\n * If you want to receive a stream of partial responses, use `opts.onProgress`.\r\n * If you want to receive the full response, including message and conversation IDs,\r\n * you can use `opts.onConversationResponse` or use the `ChatGPTAPI.getConversation`\r\n * helper.\r\n *\r\n * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI completions API. You can override the `promptPrefix` and `promptSuffix` in `opts` to customize the prompt.\r\n *\r\n * @param message - The prompt message to send\r\n * @param opts.conversationId - Optional ID of a conversation to continue (defaults to a random UUID)\r\n * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`)\r\n * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID)\r\n * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout)\r\n * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated\r\n * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)\r\n *\r\n * @returns The response from ChatGPT\r\n */\r\n async sendMessage(\r\n text: string,\r\n opts: types.SendMessageBrowserOptions = {}\r\n ): Promise {\r\n const {\r\n conversationId,\r\n parentMessageId = uuidv4(),\r\n messageId = uuidv4(),\r\n action = 'next',\r\n timeoutMs,\r\n onProgress\r\n } = opts\r\n\r\n let { abortSignal } = opts\r\n\r\n let abortController: AbortController = null\r\n if (timeoutMs && !abortSignal) {\r\n abortController = new AbortController()\r\n abortSignal = abortController.signal\r\n }\r\n\r\n const body: types.ConversationJSONBody = {\r\n action,\r\n messages: [\r\n {\r\n id: messageId,\r\n role: 'user',\r\n content: {\r\n content_type: 'text',\r\n parts: [text]\r\n }\r\n }\r\n ],\r\n model: this._model,\r\n parent_message_id: parentMessageId\r\n }\r\n\r\n if (conversationId) {\r\n body.conversation_id = conversationId\r\n }\r\n\r\n const result: types.ChatMessage = {\r\n role: 'assistant',\r\n id: uuidv4(),\r\n parentMessageId: messageId,\r\n conversationId,\r\n text: ''\r\n }\r\n\r\n const responseP = new Promise((resolve, reject) => {\r\n const url = this._apiReverseProxyUrl\r\n const headers = {\r\n ...this._headers,\r\n Authorization: `Bearer ${this._accessToken}`,\r\n Accept: 'text/event-stream',\r\n 'Content-Type': 'application/json'\r\n }\r\n\r\n if (this._debug) {\r\n console.log('POST', url, { body, headers })\r\n }\r\n\r\n fetchSSE(\r\n url,\r\n {\r\n method: 'POST',\r\n headers,\r\n body: JSON.stringify(body),\r\n signal: abortSignal,\r\n onMessage: (data: string) => {\r\n if (data === '[DONE]') {\r\n return resolve(result)\r\n }\r\n\r\n try {\r\n const convoResponseEvent: types.ConversationResponseEvent =\r\n JSON.parse(data)\r\n if (convoResponseEvent.conversation_id) {\r\n result.conversationId = convoResponseEvent.conversation_id\r\n }\r\n\r\n if (convoResponseEvent.message?.id) {\r\n result.id = convoResponseEvent.message.id\r\n }\r\n\r\n const message = convoResponseEvent.message\r\n // console.log('event', JSON.stringify(convoResponseEvent, null, 2))\r\n\r\n if (message) {\r\n let text = message?.content?.parts?.[0]\r\n\r\n if (text) {\r\n result.text = text\r\n\r\n if (onProgress) {\r\n onProgress(result)\r\n }\r\n }\r\n }\r\n } catch (err) {\r\n // ignore for now; there seem to be some non-json messages\r\n // console.warn('fetchSSE onMessage unexpected error', err)\r\n }\r\n }\r\n },\r\n this._fetch\r\n ).catch((err) => {\r\n const errMessageL = err.toString().toLowerCase()\r\n\r\n if (\r\n result.text &&\r\n (errMessageL === 'error: typeerror: terminated' ||\r\n errMessageL === 'typeerror: terminated')\r\n ) {\r\n // OpenAI sometimes forcefully terminates the socket from their end before\r\n // the HTTP request has resolved cleanly. In my testing, these cases tend to\r\n // happen when OpenAI has already send the last `response`, so we can ignore\r\n // the `fetch` error in this case.\r\n return resolve(result)\r\n } else {\r\n return reject(err)\r\n }\r\n })\r\n })\r\n\r\n if (timeoutMs) {\r\n if (abortController) {\r\n // This will be called when a timeout occurs in order for us to forcibly\r\n // ensure that the underlying HTTP request is aborted.\r\n ;(responseP as any).cancel = () => {\r\n abortController.abort()\r\n }\r\n }\r\n\r\n return pTimeout(responseP, {\r\n milliseconds: timeoutMs,\r\n message: 'ChatGPT timed out waiting for response'\r\n })\r\n } else {\r\n return responseP\r\n }\r\n }\r\n}\r\n"],"mappings":";AAAA,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,cAAc;AACrB,SAAS,MAAM,cAAc;;;ACH7B,OAAO,yBAAyB;AAEhC,IAAM,gBACJ,OAAO,wBAAwB,aAC3B,sBACC,oBAA4B;AAE5B,IAAM,YAAY,IAAI,cAAc,EAAE,MAAM,OAAO,CAAC;AAEpD,SAAS,OAAO,OAAyB;AAC9C,SAAO,UAAU,OAAO,KAAK,EAAE;AACjC;;;ACmCO,IAAM,eAAN,cAA2B,MAAM;AAMxC;;;AClDA,IAAM,QAAQ,WAAW;;;ACFzB,SAAS,oBAAoB;;;ACA7B,gBAAuB,oBAAuB,QAA2B;AACvE,QAAM,SAAS,OAAO,UAAU;AAChC,MAAI;AACF,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,UAAI,MAAM;AACR;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF,UAAE;AACA,WAAO,YAAY;AAAA,EACrB;AACF;;;ADPA,eAAsB,SACpB,KACA,SACAA,SAAuB,OACvB;AACA,QAAM,EAAE,WAAW,GAAG,aAAa,IAAI;AACvC,QAAM,MAAM,MAAMA,OAAM,KAAK,YAAY;AACzC,MAAI,CAAC,IAAI,IAAI;AACX,UAAM,SAAS,MAAM,IAAI,KAAK;AAC9B,UAAM,MAAM,iBAAiB,IAAI,UAAU,IAAI,eAAe;AAC9D,UAAM,QAAQ,IAAU,aAAa,KAAK,EAAE,OAAO,OAAO,CAAC;AAC3D,UAAM,aAAa,IAAI;AACvB,UAAM,aAAa,IAAI;AACvB,UAAM;AAAA,EACR;AAEA,QAAM,SAAS,aAAa,CAAC,UAAU;AACrC,QAAI,MAAM,SAAS,SAAS;AAC1B,gBAAU,MAAM,IAAI;AAAA,IACtB;AAAA,EACF,CAAC;AAED,MAAI,CAAC,IAAI,KAAK,WAAW;AAGvB,UAAM,OAA8B,IAAI;AAExC,QAAI,CAAC,KAAK,MAAM,CAAC,KAAK,MAAM;AAC1B,YAAM,IAAU,aAAa,oCAAoC;AAAA,IACnE;AAEA,SAAK,GAAG,YAAY,MAAM;AACxB,UAAI;AACJ,aAAO,UAAU,QAAQ,KAAK,KAAK,IAAI;AACrC,eAAO,KAAK,MAAM,SAAS,CAAC;AAAA,MAC9B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,qBAAiB,SAAS,oBAAoB,IAAI,IAAI,GAAG;AACvD,YAAM,MAAM,IAAI,YAAY,EAAE,OAAO,KAAK;AAC1C,aAAO,KAAK,GAAG;AAAA,IACjB;AAAA,EACF;AACF;;;AJtCA,IAAM,gBAAgB;AAEtB,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAEzB,IAAM,aAAN,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuCtB,YAAY,MAkCT;AACD,UAAM;AAAA,MACJ;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB,oBAAoB;AAAA,MACpB,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,iBAAiB,KAAK;AAAA,MACtB,gBAAgB,KAAK;AAAA,MACrB,OAAAC,SAAQ;AAAA,IACV,IAAI;AAEJ,SAAK,UAAU;AACf,SAAK,cAAc;AACnB,SAAK,gBAAgB;AACrB,SAAK,sBAAsB;AAC3B,SAAK,SAAS,CAAC,CAAC;AAChB,SAAK,SAASA;AAEd,SAAK,oBAAoB;AAAA,MACvB,OAAO;AAAA,MACP,aAAa;AAAA,MACb,OAAO;AAAA,MACP,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL;AAEA,QAAI,KAAK,iBAAiB;AACxB,WAAK,YAAY;AACjB,WAAK,YAAY;AAEjB,UAAI,CAAC,KAAK,kBAAkB,MAAM;AAChC,aAAK,kBAAkB,OAAO,CAAC,KAAK,WAAW,KAAK,SAAS;AAAA,MAC/D;AAAA,IACF,WAAW,KAAK,eAAe;AAC7B,WAAK,YAAY;AACjB,WAAK,YAAY,KAAK;AACtB,UAAI,CAAC,KAAK,kBAAkB,MAAM;AAChC,aAAK,kBAAkB,OAAO,CAAC,KAAK,SAAS;AAAA,MAC/C;AAAA,IACF,OAAO;AACL,WAAK,YAAY;AACjB,WAAK,YAAY,KAAK;AAEtB,UAAI,CAAC,KAAK,kBAAkB,MAAM;AAChC,aAAK,kBAAkB,OAAO,CAAC,KAAK,SAAS;AAAA,MAC/C;AAAA,IACF;AAEA,SAAK,kBAAkB;AACvB,SAAK,qBAAqB;AAC1B,SAAK,aAAa;AAClB,SAAK,kBAAkB;AAEvB,SAAK,kBAAkB;AACvB,SAAK,iBAAiB;AAEtB,QAAI,cAAc;AAChB,WAAK,gBAAgB;AAAA,IACvB,OAAO;AACL,WAAK,gBAAgB,IAAI,KAA6B;AAAA,QACpD,OAAO,IAAI,SAAoC,EAAE,SAAS,IAAM,CAAC;AAAA,MACnE,CAAC;AAAA,IACH;AAEA,QAAI,CAAC,KAAK,SAAS;AACjB,YAAM,IAAI,MAAM,wBAAwB;AAAA,IAC1C;AAEA,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI,MAAM,2CAA2C;AAAA,IAC7D;AAEA,QAAI,OAAO,KAAK,WAAW,YAAY;AACrC,YAAM,IAAI,MAAM,mCAAmC;AAAA,IACrD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2BA,MAAM,YACJ,MACA,OAAiC,CAAC,GACN;AAC5B,UAAM;AAAA,MACJ,iBAAiB,OAAO;AAAA,MACxB;AAAA,MACA,YAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,SAAS,aAAa,OAAO;AAAA,IAC/B,IAAI;AAEJ,QAAI,EAAE,YAAY,IAAI;AAEtB,QAAI,kBAAmC;AACvC,QAAI,aAAa,CAAC,aAAa;AAC7B,wBAAkB,IAAI,gBAAgB;AACtC,oBAAc,gBAAgB;AAAA,IAChC;AAEA,UAAM,UAA6B;AAAA,MACjC,MAAM;AAAA,MACN,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,IACF;AACA,UAAM,KAAK,eAAe,OAAO;AAEjC,QAAI,SAAS;AACb,QAAI,YAAY;AAChB,QAAI,CAAC,KAAK,eAAe;AACvB,YAAM,cAAc,MAAM,KAAK,aAAa,MAAM,IAAI;AACtD,eAAS,YAAY;AACrB,kBAAY,YAAY;AAAA,IAC1B;AAEA,UAAM,SAA4B;AAAA,MAChC,MAAM;AAAA,MACN,IAAI,OAAO;AAAA,MACX,iBAAiB;AAAA,MACjB;AAAA,MACA,MAAM;AAAA,IACR;AAEA,UAAM,YAAY,IAAI;AAAA,MACpB,OAAO,SAAS,WAAW;AArPjC;AAsPQ,cAAM,MACJ,KAAK,uBAAuB,GAAG,KAAK;AACtC,cAAM,UAAU;AAAA,UACd,gBAAgB;AAAA,UAChB,eAAe,UAAU,KAAK;AAAA,QAChC;AACA,YAAI,KAAK,eAAe;AACtB,kBAAQ,qBAAqB,IAAI,KAAK;AAAA,QACxC;AACA,cAAM,OAAO;AAAA,UACX,YAAY;AAAA,UACZ,GAAG,KAAK;AAAA,UACR;AAAA,UACA;AAAA,QACF;AAEA,YAAI,KAAK,QAAQ;AACf,gBAAM,YAAY,MAAM,KAAK,eAAe,KAAK,MAAM;AACvD,kBAAQ,IAAI,gBAAgB,qBAAqB,IAAI;AAAA,QACvD;AAEA,YAAI,QAAQ;AACV;AAAA,YACE;AAAA,YACA;AAAA,cACE,QAAQ;AAAA,cACR;AAAA,cACA,MAAM,KAAK,UAAU,IAAI;AAAA,cACzB,QAAQ;AAAA,cACR,WAAW,CAAC,SAAiB;AAnR3C,oBAAAC;AAoRgB,oBAAI,SAAS,UAAU;AACrB,yBAAO,OAAO,OAAO,KAAK,KAAK;AAC/B,yBAAO,QAAQ,MAAM;AAAA,gBACvB;AAEA,oBAAI;AACF,wBAAM,WACJ,KAAK,MAAM,IAAI;AAEjB,sBAAI,SAAS,IAAI;AACf,2BAAO,KAAK,SAAS;AAAA,kBACvB;AAEA,uBAAIA,MAAA,qCAAU,YAAV,gBAAAA,IAAmB,QAAQ;AAC7B,2BAAO,QAAQ,SAAS,QAAQ,CAAC,EAAE;AACnC,2BAAO,SAAS;AAEhB,6DAAa;AAAA,kBACf;AAAA,gBACF,SAAS,KAAP;AACA,0BAAQ,KAAK,6CAA6C,GAAG;AAC7D,yBAAO,OAAO,GAAG;AAAA,gBACnB;AAAA,cACF;AAAA,YACF;AAAA,YACA,KAAK;AAAA,UACP,EAAE,MAAM,MAAM;AAAA,QAChB,OAAO;AACL,cAAI;AACF,kBAAM,MAAM,MAAM,KAAK,OAAO,KAAK;AAAA,cACjC,QAAQ;AAAA,cACR;AAAA,cACA,MAAM,KAAK,UAAU,IAAI;AAAA,cACzB,QAAQ;AAAA,YACV,CAAC;AAED,gBAAI,CAAC,IAAI,IAAI;AACX,oBAAM,SAAS,MAAM,IAAI,KAAK;AAC9B,oBAAM,MAAM,iBACV,IAAI,UAAU,IAAI,eACf;AACL,oBAAM,QAAQ,IAAU,aAAa,KAAK,EAAE,OAAO,IAAI,CAAC;AACxD,oBAAM,aAAa,IAAI;AACvB,oBAAM,aAAa,IAAI;AACvB,qBAAO,OAAO,KAAK;AAAA,YACrB;AAEA,kBAAM,WAA4C,MAAM,IAAI,KAAK;AACjE,gBAAI,KAAK,QAAQ;AACf,sBAAQ,IAAI,QAAQ;AAAA,YACtB;AAEA,gBAAI,qCAAU,IAAI;AAChB,qBAAO,KAAK,SAAS;AAAA,YACvB;AAEA,iBAAI,0CAAU,YAAV,mBAAmB,QAAQ;AAC7B,qBAAO,OAAO,SAAS,QAAQ,CAAC,EAAE,KAAK,KAAK;AAAA,YAC9C,OAAO;AACL,oBAAMC,OAAM;AACZ,qBAAO;AAAA,gBACL,IAAI;AAAA,kBACF,oBACE,KAAAA,QAAA,gBAAAA,KAAK,WAAL,mBAAa,aAAWA,QAAA,gBAAAA,KAAK,WAAU;AAAA,gBAE3C;AAAA,cACF;AAAA,YACF;AAEA,mBAAO,SAAS;AAEhB,mBAAO,QAAQ,MAAM;AAAA,UACvB,SAAS,KAAP;AACA,mBAAO,OAAO,GAAG;AAAA,UACnB;AAAA,QACF;AAAA,MACF;AAAA,IACF,EAAE,KAAK,CAACC,aAAY;AAClB,aAAO,KAAK,eAAeA,QAAO,EAAE,KAAK,MAAMA,QAAO;AAAA,IACxD,CAAC;AAED,QAAI,WAAW;AACb,UAAI,iBAAiB;AAGnB;AAAC,QAAC,UAAkB,SAAS,MAAM;AACjC,0BAAgB,MAAM;AAAA,QACxB;AAAA,MACF;AAEA,aAAO,SAAS,WAAW;AAAA,QACzB,cAAc;AAAA,QACd,SAAS;AAAA,MACX,CAAC;AAAA,IACH,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,IAAI,SAAiB;AACnB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAO,QAAgB;AACzB,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAgB,aACd,SACA,MACA;AAQA,UAAM,eAAc,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AAEzD,UAAM,eACJ,KAAK,gBACL;AAAA,UAA0B,KAAK;AAAA,gBACrB,cAAc,KAAK;AAAA;AAAA;AAC/B,UAAM,eAAe,KAAK,gBAAgB;AAAA;AAAA,EAAO,KAAK;AAAA;AAEtD,UAAM,eAAe,KAAK,kBAAkB,KAAK;AACjD,QAAI,EAAE,gBAAgB,IAAI;AAC1B,QAAI,iBAAiB,GAAG,KAAK;AAAA;AAAA,EAAkB,UAAU,KAAK;AAC9D,QAAI,aAAa;AACjB,QAAI;AACJ,QAAI;AAEJ,OAAG;AACD,YAAM,aAAa,GAAG,eAAe,iBAAiB;AACtD,YAAM,gBAAgB,MAAM,KAAK,eAAe,UAAU;AAC1D,YAAM,gBAAgB,iBAAiB;AAEvC,UAAI,UAAU,CAAC,eAAe;AAC5B;AAAA,MACF;AAEA,mBAAa;AACb,eAAS;AACT,kBAAY;AAEZ,UAAI,CAAC,eAAe;AAClB;AAAA,MACF;AAEA,UAAI,CAAC,iBAAiB;AACpB;AAAA,MACF;AAEA,YAAM,gBAAgB,MAAM,KAAK,gBAAgB,eAAe;AAChE,UAAI,CAAC,eAAe;AAClB;AAAA,MACF;AAEA,YAAM,oBAAoB,cAAc,QAAQ;AAChD,YAAM,wBACJ,sBAAsB,SAAS,KAAK,aAAa,KAAK;AAGxD,YAAM,sBAAsB,GAAG;AAAA;AAAA,EAA6B,cAAc,OAAO,KAAK;AAAA;AAAA;AACtF,uBAAiB,GAAG,sBAAsB;AAC1C,wBAAkB,cAAc;AAAA,IAClC,SAAS;AAIT,UAAM,YAAY,KAAK;AAAA,MACrB;AAAA,MACA,KAAK,IAAI,KAAK,kBAAkB,WAAW,KAAK,kBAAkB;AAAA,IACpE;AAEA,WAAO,EAAE,QAAQ,UAAU;AAAA,EAC7B;AAAA,EAEA,MAAgB,eAAe,MAAc;AAC3C,QAAI,KAAK,iBAAiB;AAGxB,aAAO,KAAK,QAAQ,iBAAiB,eAAe;AACpD,aAAO,KAAK,QAAQ,iBAAiB,eAAe;AAAA,IACtD;AAEA,WAAiB,OAAO,IAAI,EAAE;AAAA,EAChC;AAAA,EAEA,IAAc,kBAAkB;AAC9B,WACE,KAAK,kBAAkB,MAAM,WAAW,WAAW,KACnD,KAAK,kBAAkB,MAAM,WAAW,yBAAyB;AAAA,EAErE;AAAA,EAEA,IAAc,gBAAgB;AAC5B,WAAO,KAAK,kBAAkB,MAAM,WAAW,OAAO;AAAA,EACxD;AAAA,EAEA,MAAgB,uBACd,IAC4B;AAC5B,UAAM,MAAM,MAAM,KAAK,cAAc,IAAI,EAAE;AAC3C,QAAI,KAAK,QAAQ;AACf,cAAQ,IAAI,kBAAkB,IAAI,GAAG;AAAA,IACvC;AACA,WAAO;AAAA,EACT;AAAA,EAEA,MAAgB,sBACd,SACe;AACf,QAAI,KAAK,QAAQ;AACf,cAAQ,IAAI,iBAAiB,QAAQ,IAAI,OAAO;AAAA,IAClD;AACA,UAAM,KAAK,cAAc,IAAI,QAAQ,IAAI,OAAO;AAAA,EAClD;AACF;;;AM/eA,OAAOC,eAAc;AACrB,SAAS,MAAMC,eAAc;AAMtB,IAAM,4BAAN,MAAgC;AAAA;AAAA;AAAA;AAAA,EAWrC,YAAY,MAgBT;AACD,UAAM;AAAA,MACJ;AAAA,MACA,qBAAqB;AAAA,MACrB,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR;AAAA,MACA,OAAAC,SAAQ;AAAA,IACV,IAAI;AAEJ,SAAK,eAAe;AACpB,SAAK,sBAAsB;AAC3B,SAAK,SAAS,CAAC,CAAC;AAChB,SAAK,SAAS;AACd,SAAK,SAASA;AACd,SAAK,WAAW;AAEhB,QAAI,CAAC,KAAK,cAAc;AACtB,YAAM,IAAI,MAAM,6BAA6B;AAAA,IAC/C;AAEA,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI,MAAM,2CAA2C;AAAA,IAC7D;AAEA,QAAI,OAAO,KAAK,WAAW,YAAY;AACrC,YAAM,IAAI,MAAM,mCAAmC;AAAA,IACrD;AAAA,EACF;AAAA,EAEA,IAAI,cAAsB;AACxB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,YAAY,OAAe;AAC7B,SAAK,eAAe;AAAA,EACtB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAyBA,MAAM,YACJ,MACA,OAAwC,CAAC,GACb;AAC5B,UAAM;AAAA,MACJ;AAAA,MACA,kBAAkBC,QAAO;AAAA,MACzB,YAAYA,QAAO;AAAA,MACnB,SAAS;AAAA,MACT;AAAA,MACA;AAAA,IACF,IAAI;AAEJ,QAAI,EAAE,YAAY,IAAI;AAEtB,QAAI,kBAAmC;AACvC,QAAI,aAAa,CAAC,aAAa;AAC7B,wBAAkB,IAAI,gBAAgB;AACtC,oBAAc,gBAAgB;AAAA,IAChC;AAEA,UAAM,OAAmC;AAAA,MACvC;AAAA,MACA,UAAU;AAAA,QACR;AAAA,UACE,IAAI;AAAA,UACJ,MAAM;AAAA,UACN,SAAS;AAAA,YACP,cAAc;AAAA,YACd,OAAO,CAAC,IAAI;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,MACA,OAAO,KAAK;AAAA,MACZ,mBAAmB;AAAA,IACrB;AAEA,QAAI,gBAAgB;AAClB,WAAK,kBAAkB;AAAA,IACzB;AAEA,UAAM,SAA4B;AAAA,MAChC,MAAM;AAAA,MACN,IAAIA,QAAO;AAAA,MACX,iBAAiB;AAAA,MACjB;AAAA,MACA,MAAM;AAAA,IACR;AAEA,UAAM,YAAY,IAAI,QAA2B,CAAC,SAAS,WAAW;AACpE,YAAM,MAAM,KAAK;AACjB,YAAM,UAAU;AAAA,QACd,GAAG,KAAK;AAAA,QACR,eAAe,UAAU,KAAK;AAAA,QAC9B,QAAQ;AAAA,QACR,gBAAgB;AAAA,MAClB;AAEA,UAAI,KAAK,QAAQ;AACf,gBAAQ,IAAI,QAAQ,KAAK,EAAE,MAAM,QAAQ,CAAC;AAAA,MAC5C;AAEA;AAAA,QACE;AAAA,QACA;AAAA,UACE,QAAQ;AAAA,UACR;AAAA,UACA,MAAM,KAAK,UAAU,IAAI;AAAA,UACzB,QAAQ;AAAA,UACR,WAAW,CAAC,SAAiB;AApKvC;AAqKY,gBAAI,SAAS,UAAU;AACrB,qBAAO,QAAQ,MAAM;AAAA,YACvB;AAEA,gBAAI;AACF,oBAAM,qBACJ,KAAK,MAAM,IAAI;AACjB,kBAAI,mBAAmB,iBAAiB;AACtC,uBAAO,iBAAiB,mBAAmB;AAAA,cAC7C;AAEA,mBAAI,wBAAmB,YAAnB,mBAA4B,IAAI;AAClC,uBAAO,KAAK,mBAAmB,QAAQ;AAAA,cACzC;AAEA,oBAAM,UAAU,mBAAmB;AAGnC,kBAAI,SAAS;AACX,oBAAIC,SAAO,8CAAS,YAAT,mBAAkB,UAAlB,mBAA0B;AAErC,oBAAIA,OAAM;AACR,yBAAO,OAAOA;AAEd,sBAAI,YAAY;AACd,+BAAW,MAAM;AAAA,kBACnB;AAAA,gBACF;AAAA,cACF;AAAA,YACF,SAAS,KAAP;AAAA,YAGF;AAAA,UACF;AAAA,QACF;AAAA,QACA,KAAK;AAAA,MACP,EAAE,MAAM,CAAC,QAAQ;AACf,cAAM,cAAc,IAAI,SAAS,EAAE,YAAY;AAE/C,YACE,OAAO,SACN,gBAAgB,kCACf,gBAAgB,0BAClB;AAKA,iBAAO,QAAQ,MAAM;AAAA,QACvB,OAAO;AACL,iBAAO,OAAO,GAAG;AAAA,QACnB;AAAA,MACF,CAAC;AAAA,IACH,CAAC;AAED,QAAI,WAAW;AACb,UAAI,iBAAiB;AAGnB;AAAC,QAAC,UAAkB,SAAS,MAAM;AACjC,0BAAgB,MAAM;AAAA,QACxB;AAAA,MACF;AAEA,aAAOC,UAAS,WAAW;AAAA,QACzB,cAAc;AAAA,QACd,SAAS;AAAA,MACX,CAAC;AAAA,IACH,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["fetch","fetch","_a","res","message","pTimeout","uuidv4","fetch","uuidv4","text","pTimeout"]} \ No newline at end of file diff --git a/chatgpt-5.1.1/index.d.ts b/chatgpt-5.1.1/index.d.ts new file mode 100644 index 0000000..2ee1fd9 --- /dev/null +++ b/chatgpt-5.1.1/index.d.ts @@ -0,0 +1,452 @@ +import Keyv from 'keyv'; + +type Role = 'user' | 'assistant' | 'system'; +type FetchFn = typeof fetch; +type ChatGPTAPIOptions = { + apiKey: string; + /** @defaultValue `'https://api.openai.com'` **/ + apiBaseUrl?: string; + /** @defaultValue `false` **/ + debug?: boolean; + completionParams?: Partial>; + systemMessage?: string; + /** @defaultValue `4096` **/ + maxModelTokens?: number; + /** @defaultValue `1000` **/ + maxResponseTokens?: number; + /** @default undefined */ + organization?: string; + messageStore?: Keyv; + getMessageById?: GetMessageByIdFunction; + upsertMessage?: UpsertMessageFunction; + fetch?: FetchFn; +}; +type SendMessageOptions = { + /** The name of a user in a multi-user chat. */ + name?: string; + parentMessageId?: string; + messageId?: string; + stream?: boolean; + systemMessage?: string; + timeoutMs?: number; + onProgress?: (partialResponse: ChatMessage) => void; + abortSignal?: AbortSignal; + completionParams?: Partial>; +}; +type MessageActionType = 'next' | 'variant'; +type SendMessageBrowserOptions = { + conversationId?: string; + parentMessageId?: string; + messageId?: string; + action?: MessageActionType; + timeoutMs?: number; + onProgress?: (partialResponse: ChatMessage) => void; + abortSignal?: AbortSignal; +}; +interface ChatMessage { + id: string; + text: string; + role: Role; + name?: string; + delta?: string; + detail?: any; + parentMessageId?: string; + conversationId?: string; +} +declare class ChatGPTError extends Error { + statusCode?: number; + statusText?: string; + isFinal?: boolean; + accountId?: string; + reason?: string; +} +/** Returns a chat message from a store by it's ID (or null if not found). */ +type GetMessageByIdFunction = (id: string) => Promise; +/** Upserts a chat message to a store. */ +type UpsertMessageFunction = (message: ChatMessage) => Promise; +/** + * https://chat.openapi.com/backend-api/conversation + */ +type ConversationJSONBody = { + /** + * The action to take + */ + action: string; + /** + * The ID of the conversation + */ + conversation_id?: string; + /** + * Prompts to provide + */ + messages: Prompt[]; + /** + * The model to use + */ + model: string; + /** + * The parent message ID + */ + parent_message_id: string; +}; +type Prompt = { + /** + * The content of the prompt + */ + content: PromptContent; + /** + * The ID of the prompt + */ + id: string; + /** + * The role played in the prompt + */ + role: Role; +}; +type ContentType = 'text'; +type PromptContent = { + /** + * The content type of the prompt + */ + content_type: ContentType; + /** + * The parts to the prompt + */ + parts: string[]; +}; +type ConversationResponseEvent = { + message?: Message; + conversation_id?: string; + error?: string | null; +}; +type Message = { + id: string; + content: MessageContent; + role: Role; + user: string | null; + create_time: string | null; + update_time: string | null; + end_turn: null; + weight: number; + recipient: string; + metadata: MessageMetadata; +}; +type MessageContent = { + content_type: string; + parts: string[]; +}; +type MessageMetadata = any; +declare namespace openai { + interface CreateChatCompletionDeltaResponse { + id: string; + object: 'chat.completion.chunk'; + created: number; + model: string; + choices: [ + { + delta: { + role: Role; + content?: string; + }; + index: number; + finish_reason: string | null; + } + ]; + } + /** + * + * @export + * @interface ChatCompletionRequestMessage + */ + interface ChatCompletionRequestMessage { + /** + * The role of the author of this message. + * @type {string} + * @memberof ChatCompletionRequestMessage + */ + role: ChatCompletionRequestMessageRoleEnum; + /** + * The contents of the message + * @type {string} + * @memberof ChatCompletionRequestMessage + */ + content: string; + /** + * The name of the user in a multi-user chat + * @type {string} + * @memberof ChatCompletionRequestMessage + */ + name?: string; + } + const ChatCompletionRequestMessageRoleEnum: { + readonly System: 'system'; + readonly User: 'user'; + readonly Assistant: 'assistant'; + }; + type ChatCompletionRequestMessageRoleEnum = (typeof ChatCompletionRequestMessageRoleEnum)[keyof typeof ChatCompletionRequestMessageRoleEnum]; + /** + * + * @export + * @interface ChatCompletionResponseMessage + */ + interface ChatCompletionResponseMessage { + /** + * The role of the author of this message. + * @type {string} + * @memberof ChatCompletionResponseMessage + */ + role: ChatCompletionResponseMessageRoleEnum; + /** + * The contents of the message + * @type {string} + * @memberof ChatCompletionResponseMessage + */ + content: string; + } + const ChatCompletionResponseMessageRoleEnum: { + readonly System: 'system'; + readonly User: 'user'; + readonly Assistant: 'assistant'; + }; + type ChatCompletionResponseMessageRoleEnum = (typeof ChatCompletionResponseMessageRoleEnum)[keyof typeof ChatCompletionResponseMessageRoleEnum]; + /** + * + * @export + * @interface CreateChatCompletionRequest + */ + interface CreateChatCompletionRequest { + /** + * ID of the model to use. Currently, only `gpt-3.5-turbo` and `gpt-3.5-turbo-0301` are supported. + * @type {string} + * @memberof CreateChatCompletionRequest + */ + model: string; + /** + * The messages to generate chat completions for, in the [chat format](/docs/guides/chat/introduction). + * @type {Array} + * @memberof CreateChatCompletionRequest + */ + messages: Array; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both. + * @type {number} + * @memberof CreateChatCompletionRequest + */ + temperature?: number | null; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both. + * @type {number} + * @memberof CreateChatCompletionRequest + */ + top_p?: number | null; + /** + * How many chat completion choices to generate for each input message. + * @type {number} + * @memberof CreateChatCompletionRequest + */ + n?: number | null; + /** + * If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. + * @type {boolean} + * @memberof CreateChatCompletionRequest + */ + stream?: boolean | null; + /** + * + * @type {CreateChatCompletionRequestStop} + * @memberof CreateChatCompletionRequest + */ + stop?: CreateChatCompletionRequestStop; + /** + * The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens). + * @type {number} + * @memberof CreateChatCompletionRequest + */ + max_tokens?: number; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model\'s likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) + * @type {number} + * @memberof CreateChatCompletionRequest + */ + presence_penalty?: number | null; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model\'s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details) + * @type {number} + * @memberof CreateChatCompletionRequest + */ + frequency_penalty?: number | null; + /** + * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + * @type {object} + * @memberof CreateChatCompletionRequest + */ + logit_bias?: object | null; + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids). + * @type {string} + * @memberof CreateChatCompletionRequest + */ + user?: string; + } + /** + * @type CreateChatCompletionRequestStop + * Up to 4 sequences where the API will stop generating further tokens. + * @export + */ + type CreateChatCompletionRequestStop = Array | string; + /** + * + * @export + * @interface CreateChatCompletionResponse + */ + interface CreateChatCompletionResponse { + /** + * + * @type {string} + * @memberof CreateChatCompletionResponse + */ + id: string; + /** + * + * @type {string} + * @memberof CreateChatCompletionResponse + */ + object: string; + /** + * + * @type {number} + * @memberof CreateChatCompletionResponse + */ + created: number; + /** + * + * @type {string} + * @memberof CreateChatCompletionResponse + */ + model: string; + /** + * + * @type {Array} + * @memberof CreateChatCompletionResponse + */ + choices: Array; + /** + * + * @type {CreateCompletionResponseUsage} + * @memberof CreateChatCompletionResponse + */ + usage?: CreateCompletionResponseUsage; + } + /** + * + * @export + * @interface CreateChatCompletionResponseChoicesInner + */ + interface CreateChatCompletionResponseChoicesInner { + /** + * + * @type {number} + * @memberof CreateChatCompletionResponseChoicesInner + */ + index?: number; + /** + * + * @type {ChatCompletionResponseMessage} + * @memberof CreateChatCompletionResponseChoicesInner + */ + message?: ChatCompletionResponseMessage; + /** + * + * @type {string} + * @memberof CreateChatCompletionResponseChoicesInner + */ + finish_reason?: string; + } + /** + * + * @export + * @interface CreateCompletionResponseUsage + */ + interface CreateCompletionResponseUsage { + /** + * + * @type {number} + * @memberof CreateCompletionResponseUsage + */ + prompt_tokens: number; + /** + * + * @type {number} + * @memberof CreateCompletionResponseUsage + */ + completion_tokens: number; + /** + * + * @type {number} + * @memberof CreateCompletionResponseUsage + */ + total_tokens: number; + } +} + +declare class ChatGPTAPI { + protected _apiKey: string; + protected _apiBaseUrl: string; + protected _debug: boolean; + protected _systemMessage: string; + protected _completionParams: Omit; + protected _maxModelTokens: number; + protected _maxResponseTokens: number; + protected _fetch: FetchFn; + protected _getMessageById: GetMessageByIdFunction; + protected _upsertMessage: UpsertMessageFunction; + protected _messageStore: Keyv; + protected _organization: string; + /** + * Creates a new client wrapper around OpenAI's chat completion API, mimicing the official ChatGPT webapp's functionality as closely as possible. + * + * @param apiKey - OpenAI API key (required). + * @param apiBaseUrl - Optional override for the OpenAI API base URL. + * @param debug - Optional enables logging debugging info to stdout. + * @param completionParams - Param overrides to send to the [OpenAI chat completion API](https://platform.openai.com/docs/api-reference/chat/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant. + * @param maxModelTokens - Optional override for the maximum number of tokens allowed by the model's context. Defaults to 4096. + * @param maxResponseTokens - Optional override for the minimum number of tokens allowed for the model's response. Defaults to 1000. + * @param messageStore - Optional [Keyv](https://github.com/jaredwray/keyv) store to persist chat messages to. If not provided, messages will be lost when the process exits. + * @param getMessageById - Optional function to retrieve a message by its ID. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param upsertMessage - Optional function to insert or update a message. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param organization - Optional organization string for openai calls + * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function. + */ + constructor(opts: ChatGPTAPIOptions); + /** + * Sends a message to the OpenAI chat completions endpoint, waits for the response + * to resolve, and returns the response. + * + * If you want your response to have historical context, you must provide a valid `parentMessageId`. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * + * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI chat completions API. You can override the `systemMessage` in `opts` to customize the assistant's instructions. + * + * @param message - The prompt message to send + * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`) + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.systemMessage - Optional override for the chat "system message" which acts as instructions to the model (defaults to the ChatGPT system message) + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * @param completionParams - Optional overrides to send to the [OpenAI chat completion API](https://platform.openai.com/docs/api-reference/chat/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant. + * + * @returns The response from ChatGPT + */ + sendMessage(text: string, opts?: SendMessageOptions): Promise; + get apiKey(): string; + set apiKey(apiKey: string); + protected _buildMessages(text: string, opts: SendMessageOptions): Promise<{ + messages: openai.ChatCompletionRequestMessage[]; + }>; + protected _defaultGetMessageById(id: string): Promise; + protected _defaultUpsertMessage(message: ChatMessage): Promise; +} + +export { ChatGPTAPI, ChatGPTAPIOptions, ChatGPTError, ChatMessage, ContentType, ConversationJSONBody, ConversationResponseEvent, FetchFn, GetMessageByIdFunction, Message, MessageActionType, MessageContent, MessageMetadata, Prompt, PromptContent, Role, SendMessageBrowserOptions, SendMessageOptions, UpsertMessageFunction, openai }; diff --git a/chatgpt-5.1.1/index.js b/chatgpt-5.1.1/index.js new file mode 100644 index 0000000..44cf017 --- /dev/null +++ b/chatgpt-5.1.1/index.js @@ -0,0 +1,424 @@ +// Adapted from https://github.com/transitive-bullshit/chatgpt-api + +/** + * + * MIT License + +Copyright (c) 2023 Travis Fischer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ + +// src/chatgpt-api.ts +import Keyv from "keyv"; +import pTimeout from "p-timeout"; +import QuickLRU from "quick-lru"; +import { v4 as uuidv4 } from "uuid"; + +// src/types.ts +var ChatGPTError = class extends Error { +}; +var openai; +((openai2) => { +})(openai || (openai = {})); + +// src/fetch.ts +var fetch = globalThis.fetch; + +// src/fetch-sse.ts +import { createParser } from "eventsource-parser"; + +// src/stream-async-iterable.ts +async function* streamAsyncIterable(stream) { + const reader = stream.getReader(); + try { + while (true) { + const { done, value } = await reader.read(); + if (done) { + return; + } + yield value; + } + } finally { + reader.releaseLock(); + } +} + +// src/fetch-sse.ts +async function fetchSSE(url, options, fetch2 = fetch) { + const { onMessage, ...fetchOptions } = options; + const res = await fetch2(url, fetchOptions); + if (!res.ok) { + let reason; + try { + reason = await res.text(); + } catch (err) { + reason = res.statusText; + } + const msg = `ChatGPT error ${res.status}: ${reason}`; + const error = new ChatGPTError(msg, { cause: res }); + error.statusCode = res.status; + error.statusText = res.statusText; + error.reason = reason; + throw error; + } + const parser = createParser((event) => { + if (event.type === "event") { + onMessage(event.data); + } + }); + if (!res.body.getReader) { + const body = res.body; + if (!body.on || !body.read) { + throw new ChatGPTError('unsupported "fetch" implementation'); + } + body.on("readable", () => { + let chunk; + while (null !== (chunk = body.read())) { + parser.feed(chunk.toString()); + } + }); + } else { + for await (const chunk of streamAsyncIterable(res.body)) { + const str = new TextDecoder().decode(chunk); + parser.feed(str); + } + } +} + +// src/chatgpt-api.ts +var CHATGPT_MODEL = "gpt-3.5-turbo"; +var USER_LABEL_DEFAULT = "User"; +var ASSISTANT_LABEL_DEFAULT = "ChatGPT"; +var ChatGPTAPI = class { + /** + * Creates a new client wrapper around OpenAI's chat completion API, mimicing the official ChatGPT webapp's functionality as closely as possible. + * + * @param apiKey - OpenAI API key (required). + * @param apiBaseUrl - Optional override for the OpenAI API base URL. + * @param debug - Optional enables logging debugging info to stdout. + * @param completionParams - Param overrides to send to the [OpenAI chat completion API](https://platform.openai.com/docs/api-reference/chat/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant. + * @param maxModelTokens - Optional override for the maximum number of tokens allowed by the model's context. Defaults to 4096. + * @param maxResponseTokens - Optional override for the minimum number of tokens allowed for the model's response. Defaults to 1000. + * @param messageStore - Optional [Keyv](https://github.com/jaredwray/keyv) store to persist chat messages to. If not provided, messages will be lost when the process exits. + * @param getMessageById - Optional function to retrieve a message by its ID. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param upsertMessage - Optional function to insert or update a message. If not provided, the default implementation will be used (using an in-memory `messageStore`). + * @param organization - Optional organization string for openai calls + * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function. + */ + constructor(opts) { + const { + apiKey, + apiBaseUrl = "https://api.openai.com", + organization, + debug = false, + messageStore, + completionParams, + systemMessage, + maxModelTokens = 4e3, + maxResponseTokens = 1e3, + getMessageById, + upsertMessage, + fetch: fetch2 = fetch + } = opts; + this._apiKey = apiKey; + this._apiBaseUrl = apiBaseUrl; + this._organization = organization; + this._debug = !!debug; + this._fetch = fetch2; + this._completionParams = { + model: CHATGPT_MODEL, + temperature: 0.8, + top_p: 1, + presence_penalty: 1, + ...completionParams + }; + this._systemMessage = systemMessage; + if (this._systemMessage === void 0) { + const currentDate = (/* @__PURE__ */ new Date()).toISOString().split("T")[0]; + this._systemMessage = `You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. +Knowledge cutoff: 2021-09-01 +Current date: ${currentDate}`; + } + this._maxModelTokens = maxModelTokens; + this._maxResponseTokens = maxResponseTokens; + this._getMessageById = getMessageById ?? this._defaultGetMessageById; + this._upsertMessage = upsertMessage ?? this._defaultUpsertMessage; + if (messageStore) { + this._messageStore = messageStore; + } else { + this._messageStore = new Keyv({ + store: new QuickLRU({ maxSize: 1e4 }) + }); + } + if (!this._apiKey) { + throw new Error("OpenAI missing required apiKey"); + } + if (!this._fetch) { + throw new Error("Invalid environment; fetch is not defined"); + } + if (typeof this._fetch !== "function") { + throw new Error('Invalid "fetch" is not a function'); + } + } + /** + * Sends a message to the OpenAI chat completions endpoint, waits for the response + * to resolve, and returns the response. + * + * If you want your response to have historical context, you must provide a valid `parentMessageId`. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * + * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI chat completions API. You can override the `systemMessage` in `opts` to customize the assistant's instructions. + * + * @param message - The prompt message to send + * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`) + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.systemMessage - Optional override for the chat "system message" which acts as instructions to the model (defaults to the ChatGPT system message) + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * @param completionParams - Optional overrides to send to the [OpenAI chat completion API](https://platform.openai.com/docs/api-reference/chat/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant. + * + * @returns The response from ChatGPT + */ + async sendMessage(text, opts = {}) { + const { + parentMessageId, + messageId = uuidv4(), + timeoutMs, + onProgress, + stream = onProgress ? true : false, + completionParams + } = opts; + let { abortSignal } = opts; + let abortController = null; + if (timeoutMs && !abortSignal) { + abortController = new AbortController(); + abortSignal = abortController.signal; + } + const message = { + role: "user", + id: messageId, + parentMessageId, + text + }; + await this._upsertMessage(message); + const { messages } = await this._buildMessages(text, opts); + const result = { + role: "assistant", + id: uuidv4(), + parentMessageId: messageId, + text: "" + }; + const responseP = new Promise( + async (resolve, reject) => { + var _a, _b; + const url = `${this._apiBaseUrl}/v1/chat/completions`; + const headers = { + "Content-Type": "application/json", + Authorization: `Bearer ${this._apiKey}` + }; + if (this._organization) { + headers["OpenAI-Organization"] = this._organization; + } + const body = { + ...this._completionParams, + ...completionParams, + messages, + stream + }; + if (stream) { + fetchSSE( + url, + { + method: "POST", + headers, + body: JSON.stringify(body), + signal: abortSignal, + onMessage: (data) => { + var _a2; + if (data === "[DONE]") { + result.text = result.text.trim(); + return resolve(result); + } + try { + const response = JSON.parse(data); + if (response.id) { + result.id = response.id; + } + if ((_a2 = response == null ? void 0 : response.choices) == null ? void 0 : _a2.length) { + const delta = response.choices[0].delta; + result.delta = delta.content; + if (delta == null ? void 0 : delta.content) + result.text += delta.content; + result.detail = response; + if (delta.role) { + result.role = delta.role; + } + onProgress == null ? void 0 : onProgress(result); + } + } catch (err) { + console.warn("OpenAI stream SEE event unexpected error", err); + return reject(err); + } + } + }, + this._fetch + ).catch(reject); + } else { + try { + const res = await this._fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), + signal: abortSignal + }); + if (!res.ok) { + const reason = await res.text(); + const msg = `OpenAI error ${res.status || res.statusText}: ${reason}`; + const error = new ChatGPTError(msg, { cause: res }); + error.statusCode = res.status; + error.statusText = res.statusText; + return reject(error); + } + const response = await res.json(); + if (this._debug) { + console.log(response); + } + if (response == null ? void 0 : response.id) { + result.id = response.id; + } + if ((_a = response == null ? void 0 : response.choices) == null ? void 0 : _a.length) { + const message2 = response.choices[0].message; + result.text = message2.content; + if (message2.role) { + result.role = message2.role; + } + } else { + const res2 = response; + return reject( + new Error( + `OpenAI error: ${((_b = res2 == null ? void 0 : res2.detail) == null ? void 0 : _b.message) || (res2 == null ? void 0 : res2.detail) || "unknown"}` + ) + ); + } + result.detail = response; + return resolve(result); + } catch (err) { + return reject(err); + } + } + } + ).then((message2) => { + return this._upsertMessage(message2).then(() => message2); + }); + if (timeoutMs) { + if (abortController) { + ; + responseP.cancel = () => { + abortController.abort(); + }; + } + return pTimeout(responseP, { + milliseconds: timeoutMs, + message: "OpenAI timed out waiting for response" + }); + } else { + return responseP; + } + } + get apiKey() { + return this._apiKey; + } + set apiKey(apiKey) { + this._apiKey = apiKey; + } + async _buildMessages(text, opts) { + const { systemMessage = this._systemMessage } = opts; + let { parentMessageId } = opts; + const userLabel = USER_LABEL_DEFAULT; + const assistantLabel = ASSISTANT_LABEL_DEFAULT; + let messages = []; + if (systemMessage) { + messages.push({ + role: "system", + content: systemMessage + }); + } + const systemMessageOffset = messages.length; + let nextMessages = text ? messages.concat([ + { + role: "user", + content: text, + name: opts.name + } + ]) : messages; + do { + const prompt = nextMessages.reduce((prompt2, message) => { + switch (message.role) { + case "system": + return prompt2.concat([`Instructions: +${message.content}`]); + case "user": + return prompt2.concat([`${userLabel}: +${message.content}`]); + default: + return prompt2.concat([`${assistantLabel}: +${message.content}`]); + } + }, []).join("\n\n"); + messages = nextMessages; + if (!parentMessageId) { + break; + } + const parentMessage = await this._getMessageById(parentMessageId); + if (!parentMessage) { + break; + } + const parentMessageRole = parentMessage.role || "user"; + nextMessages = nextMessages.slice(0, systemMessageOffset).concat([ + { + role: parentMessageRole, + content: parentMessage.text, + name: parentMessage.name + }, + ...nextMessages.slice(systemMessageOffset) + ]); + parentMessageId = parentMessage.parentMessageId; + } while (true); + return { messages }; + } + // protected get _isCodexModel() { + // return this._completionParams.model.startsWith('code-') + // } + async _defaultGetMessageById(id) { + const res = await this._messageStore.get(id); + return res; + } + async _defaultUpsertMessage(message) { + await this._messageStore.set(message.id, message); + } +}; +export { + ChatGPTAPI, + ChatGPTError, + openai +}; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/chatgpt-5.1.1/index.js.map b/chatgpt-5.1.1/index.js.map new file mode 100644 index 0000000..8481c77 --- /dev/null +++ b/chatgpt-5.1.1/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/chatgpt-api.ts","../src/types.ts","../src/fetch.ts","../src/fetch-sse.ts","../src/stream-async-iterable.ts"],"sourcesContent":["import Keyv from 'keyv'\nimport pTimeout from 'p-timeout'\nimport QuickLRU from 'quick-lru'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport * as types from './types'\nimport { fetch as globalFetch } from './fetch'\nimport { fetchSSE } from './fetch-sse'\n\nconst CHATGPT_MODEL = 'gpt-3.5-turbo'\n\nconst USER_LABEL_DEFAULT = 'User'\nconst ASSISTANT_LABEL_DEFAULT = 'ChatGPT'\n\nexport class ChatGPTAPI {\n protected _apiKey: string\n protected _apiBaseUrl: string\n protected _debug: boolean\n\n protected _systemMessage: string\n protected _completionParams: Omit<\n types.openai.CreateChatCompletionRequest,\n 'messages' | 'n'\n >\n protected _maxModelTokens: number\n protected _maxResponseTokens: number\n protected _fetch: types.FetchFn\n\n protected _getMessageById: types.GetMessageByIdFunction\n protected _upsertMessage: types.UpsertMessageFunction\n\n protected _messageStore: Keyv\n\n protected _organization: string\n\n /**\n * Creates a new client wrapper around OpenAI's chat completion API, mimicing the official ChatGPT webapp's functionality as closely as possible.\n *\n * @param apiKey - OpenAI API key (required).\n * @param apiBaseUrl - Optional override for the OpenAI API base URL.\n * @param debug - Optional enables logging debugging info to stdout.\n * @param completionParams - Param overrides to send to the [OpenAI chat completion API](https://platform.openai.com/docs/api-reference/chat/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant.\n * @param maxModelTokens - Optional override for the maximum number of tokens allowed by the model's context. Defaults to 4096.\n * @param maxResponseTokens - Optional override for the minimum number of tokens allowed for the model's response. Defaults to 1000.\n * @param messageStore - Optional [Keyv](https://github.com/jaredwray/keyv) store to persist chat messages to. If not provided, messages will be lost when the process exits.\n * @param getMessageById - Optional function to retrieve a message by its ID. If not provided, the default implementation will be used (using an in-memory `messageStore`).\n * @param upsertMessage - Optional function to insert or update a message. If not provided, the default implementation will be used (using an in-memory `messageStore`).\n * @param organization - Optional organization string for openai calls\n * @param fetch - Optional override for the `fetch` implementation to use. Defaults to the global `fetch` function.\n */\n constructor(opts: types.ChatGPTAPIOptions) {\n const {\n apiKey,\n apiBaseUrl = 'https://api.openai.com',\n organization,\n debug = false,\n messageStore,\n completionParams,\n systemMessage,\n maxModelTokens = 4000,\n maxResponseTokens = 1000,\n getMessageById,\n upsertMessage,\n fetch = globalFetch\n } = opts\n\n this._apiKey = apiKey\n this._apiBaseUrl = apiBaseUrl\n this._organization = organization\n this._debug = !!debug\n this._fetch = fetch\n\n this._completionParams = {\n model: CHATGPT_MODEL,\n temperature: 0.8,\n top_p: 1.0,\n presence_penalty: 1.0,\n ...completionParams\n }\n\n this._systemMessage = systemMessage\n\n if (this._systemMessage === undefined) {\n const currentDate = new Date().toISOString().split('T')[0]\n this._systemMessage = `You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible.\\nKnowledge cutoff: 2021-09-01\\nCurrent date: ${currentDate}`\n }\n\n // if (this._isCodexModel) {\n // this._endToken = ''\n // this._sepToken = this._endToken\n // if (!this._completionParams.stop) {\n // this._completionParams.stop = [this._endToken]\n // }\n // }\n\n this._maxModelTokens = maxModelTokens\n this._maxResponseTokens = maxResponseTokens\n\n this._getMessageById = getMessageById ?? this._defaultGetMessageById\n this._upsertMessage = upsertMessage ?? this._defaultUpsertMessage\n\n if (messageStore) {\n this._messageStore = messageStore\n } else {\n this._messageStore = new Keyv({\n store: new QuickLRU({ maxSize: 10000 })\n })\n }\n\n if (!this._apiKey) {\n throw new Error('OpenAI missing required apiKey')\n }\n\n if (!this._fetch) {\n throw new Error('Invalid environment; fetch is not defined')\n }\n\n if (typeof this._fetch !== 'function') {\n throw new Error('Invalid \"fetch\" is not a function')\n }\n }\n\n /**\n * Sends a message to the OpenAI chat completions endpoint, waits for the response\n * to resolve, and returns the response.\n *\n * If you want your response to have historical context, you must provide a valid `parentMessageId`.\n *\n * If you want to receive a stream of partial responses, use `opts.onProgress`.\n *\n * Set `debug: true` in the `ChatGPTAPI` constructor to log more info on the full prompt sent to the OpenAI chat completions API. You can override the `systemMessage` in `opts` to customize the assistant's instructions.\n *\n * @param message - The prompt message to send\n * @param opts.parentMessageId - Optional ID of the previous message in the conversation (defaults to `undefined`)\n * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID)\n * @param opts.systemMessage - Optional override for the chat \"system message\" which acts as instructions to the model (defaults to the ChatGPT system message)\n * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout)\n * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated\n * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)\n * @param completionParams - Optional overrides to send to the [OpenAI chat completion API](https://platform.openai.com/docs/api-reference/chat/create). Options like `temperature` and `presence_penalty` can be tweaked to change the personality of the assistant.\n *\n * @returns The response from ChatGPT\n */\n async sendMessage(\n text: string,\n opts: types.SendMessageOptions = {}\n ): Promise {\n const {\n parentMessageId,\n messageId = uuidv4(),\n timeoutMs,\n onProgress,\n stream = onProgress ? true : false,\n completionParams\n } = opts\n\n let { abortSignal } = opts\n\n let abortController: AbortController = null\n if (timeoutMs && !abortSignal) {\n abortController = new AbortController()\n abortSignal = abortController.signal\n }\n\n const message: types.ChatMessage = {\n role: 'user',\n id: messageId,\n parentMessageId,\n text\n }\n await this._upsertMessage(message)\n\n const { messages } = await this._buildMessages(text, opts)\n\n const result: types.ChatMessage = {\n role: 'assistant',\n id: uuidv4(),\n parentMessageId: messageId,\n text: ''\n }\n\n const responseP = new Promise(\n async (resolve, reject) => {\n const url = `${this._apiBaseUrl}/v1/chat/completions`\n const headers = {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${this._apiKey}`\n }\n if (this._organization) {\n headers['OpenAI-Organization'] = this._organization\n }\n const body = {\n ...this._completionParams,\n ...completionParams,\n messages,\n stream\n }\n\n if (stream) {\n fetchSSE(\n url,\n {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n signal: abortSignal,\n onMessage: (data: string) => {\n if (data === '[DONE]') {\n result.text = result.text.trim()\n return resolve(result)\n }\n\n try {\n const response: types.openai.CreateChatCompletionDeltaResponse =\n JSON.parse(data)\n\n if (response.id) {\n result.id = response.id\n }\n\n if (response?.choices?.length) {\n const delta = response.choices[0].delta\n result.delta = delta.content\n if (delta?.content) result.text += delta.content\n result.detail = response\n\n if (delta.role) {\n result.role = delta.role\n }\n\n onProgress?.(result)\n }\n } catch (err) {\n console.warn('OpenAI stream SEE event unexpected error', err)\n return reject(err)\n }\n }\n },\n this._fetch\n ).catch(reject)\n } else {\n try {\n const res = await this._fetch(url, {\n method: 'POST',\n headers,\n body: JSON.stringify(body),\n signal: abortSignal\n })\n\n if (!res.ok) {\n const reason = await res.text()\n const msg = `OpenAI error ${\n res.status || res.statusText\n }: ${reason}`\n const error = new types.ChatGPTError(msg, { cause: res })\n error.statusCode = res.status\n error.statusText = res.statusText\n return reject(error)\n }\n\n const response: types.openai.CreateChatCompletionResponse =\n await res.json()\n if (this._debug) {\n console.log(response)\n }\n\n if (response?.id) {\n result.id = response.id\n }\n\n if (response?.choices?.length) {\n const message = response.choices[0].message\n result.text = message.content\n if (message.role) {\n result.role = message.role\n }\n } else {\n const res = response as any\n return reject(\n new Error(\n `OpenAI error: ${\n res?.detail?.message || res?.detail || 'unknown'\n }`\n )\n )\n }\n\n result.detail = response\n\n return resolve(result)\n } catch (err) {\n return reject(err)\n }\n }\n }\n ).then((message) => {\n return this._upsertMessage(message).then(() => message)\n })\n\n if (timeoutMs) {\n if (abortController) {\n // This will be called when a timeout occurs in order for us to forcibly\n // ensure that the underlying HTTP request is aborted.\n ;(responseP as any).cancel = () => {\n abortController.abort()\n }\n }\n\n return pTimeout(responseP, {\n milliseconds: timeoutMs,\n message: 'OpenAI timed out waiting for response'\n })\n } else {\n return responseP\n }\n }\n\n get apiKey(): string {\n return this._apiKey\n }\n\n set apiKey(apiKey: string) {\n this._apiKey = apiKey\n }\n\n protected async _buildMessages(text: string, opts: types.SendMessageOptions) {\n const { systemMessage = this._systemMessage } = opts\n let { parentMessageId } = opts\n\n const userLabel = USER_LABEL_DEFAULT\n const assistantLabel = ASSISTANT_LABEL_DEFAULT\n\n let messages: types.openai.ChatCompletionRequestMessage[] = []\n\n if (systemMessage) {\n messages.push({\n role: 'system',\n content: systemMessage\n })\n }\n\n const systemMessageOffset = messages.length\n let nextMessages = text\n ? messages.concat([\n {\n role: 'user',\n content: text,\n name: opts.name\n }\n ])\n : messages\n\n do {\n const prompt = nextMessages\n .reduce((prompt, message) => {\n switch (message.role) {\n case 'system':\n return prompt.concat([`Instructions:\\n${message.content}`])\n case 'user':\n return prompt.concat([`${userLabel}:\\n${message.content}`])\n default:\n return prompt.concat([`${assistantLabel}:\\n${message.content}`])\n }\n }, [] as string[])\n .join('\\n\\n')\n\n messages = nextMessages\n\n if (!parentMessageId) {\n break\n }\n\n const parentMessage = await this._getMessageById(parentMessageId)\n if (!parentMessage) {\n break\n }\n\n const parentMessageRole = parentMessage.role || 'user'\n\n nextMessages = nextMessages.slice(0, systemMessageOffset).concat([\n {\n role: parentMessageRole,\n content: parentMessage.text,\n name: parentMessage.name\n },\n ...nextMessages.slice(systemMessageOffset)\n ])\n\n parentMessageId = parentMessage.parentMessageId\n } while (true)\n\n return { messages }\n }\n\n // protected get _isCodexModel() {\n // return this._completionParams.model.startsWith('code-')\n // }\n\n protected async _defaultGetMessageById(\n id: string\n ): Promise {\n const res = await this._messageStore.get(id)\n return res\n }\n\n protected async _defaultUpsertMessage(\n message: types.ChatMessage\n ): Promise {\n await this._messageStore.set(message.id, message)\n }\n}\n","import Keyv from 'keyv'\n\nexport type Role = 'user' | 'assistant' | 'system'\n\nexport type FetchFn = typeof fetch\n\nexport type ChatGPTAPIOptions = {\n apiKey: string\n\n /** @defaultValue `'https://api.openai.com'` **/\n apiBaseUrl?: string\n\n /** @defaultValue `false` **/\n debug?: boolean\n\n completionParams?: Partial<\n Omit\n >\n\n systemMessage?: string\n\n /** @defaultValue `4096` **/\n maxModelTokens?: number\n\n /** @defaultValue `1000` **/\n maxResponseTokens?: number\n\n /** @default undefined */\n organization?: string\n\n messageStore?: Keyv\n getMessageById?: GetMessageByIdFunction\n upsertMessage?: UpsertMessageFunction\n\n fetch?: FetchFn\n}\n\nexport type SendMessageOptions = {\n /** The name of a user in a multi-user chat. */\n name?: string\n parentMessageId?: string\n messageId?: string\n stream?: boolean\n systemMessage?: string\n timeoutMs?: number\n onProgress?: (partialResponse: ChatMessage) => void\n abortSignal?: AbortSignal\n completionParams?: Partial<\n Omit\n >\n}\n\nexport type MessageActionType = 'next' | 'variant'\n\nexport type SendMessageBrowserOptions = {\n conversationId?: string\n parentMessageId?: string\n messageId?: string\n action?: MessageActionType\n timeoutMs?: number\n onProgress?: (partialResponse: ChatMessage) => void\n abortSignal?: AbortSignal\n}\n\nexport interface ChatMessage {\n id: string\n text: string\n role: Role\n name?: string\n delta?: string\n detail?: any\n\n // relevant for both ChatGPTAPI and ChatGPTUnofficialProxyAPI\n parentMessageId?: string\n // only relevant for ChatGPTUnofficialProxyAPI\n conversationId?: string\n}\n\nexport class ChatGPTError extends Error {\n statusCode?: number\n statusText?: string\n isFinal?: boolean\n accountId?: string\n reason?: string\n}\n\n/** Returns a chat message from a store by it's ID (or null if not found). */\nexport type GetMessageByIdFunction = (id: string) => Promise\n\n/** Upserts a chat message to a store. */\nexport type UpsertMessageFunction = (message: ChatMessage) => Promise\n\n/**\n * https://chat.openapi.com/backend-api/conversation\n */\nexport type ConversationJSONBody = {\n /**\n * The action to take\n */\n action: string\n\n /**\n * The ID of the conversation\n */\n conversation_id?: string\n\n /**\n * Prompts to provide\n */\n messages: Prompt[]\n\n /**\n * The model to use\n */\n model: string\n\n /**\n * The parent message ID\n */\n parent_message_id: string\n}\n\nexport type Prompt = {\n /**\n * The content of the prompt\n */\n content: PromptContent\n\n /**\n * The ID of the prompt\n */\n id: string\n\n /**\n * The role played in the prompt\n */\n role: Role\n}\n\nexport type ContentType = 'text'\n\nexport type PromptContent = {\n /**\n * The content type of the prompt\n */\n content_type: ContentType\n\n /**\n * The parts to the prompt\n */\n parts: string[]\n}\n\nexport type ConversationResponseEvent = {\n message?: Message\n conversation_id?: string\n error?: string | null\n}\n\nexport type Message = {\n id: string\n content: MessageContent\n role: Role\n user: string | null\n create_time: string | null\n update_time: string | null\n end_turn: null\n weight: number\n recipient: string\n metadata: MessageMetadata\n}\n\nexport type MessageContent = {\n content_type: string\n parts: string[]\n}\n\nexport type MessageMetadata = any\n\nexport namespace openai {\n export interface CreateChatCompletionDeltaResponse {\n id: string\n object: 'chat.completion.chunk'\n created: number\n model: string\n choices: [\n {\n delta: {\n role: Role\n content?: string\n }\n index: number\n finish_reason: string | null\n }\n ]\n }\n\n /**\n *\n * @export\n * @interface ChatCompletionRequestMessage\n */\n export interface ChatCompletionRequestMessage {\n /**\n * The role of the author of this message.\n * @type {string}\n * @memberof ChatCompletionRequestMessage\n */\n role: ChatCompletionRequestMessageRoleEnum\n /**\n * The contents of the message\n * @type {string}\n * @memberof ChatCompletionRequestMessage\n */\n content: string\n /**\n * The name of the user in a multi-user chat\n * @type {string}\n * @memberof ChatCompletionRequestMessage\n */\n name?: string\n }\n export declare const ChatCompletionRequestMessageRoleEnum: {\n readonly System: 'system'\n readonly User: 'user'\n readonly Assistant: 'assistant'\n }\n export declare type ChatCompletionRequestMessageRoleEnum =\n (typeof ChatCompletionRequestMessageRoleEnum)[keyof typeof ChatCompletionRequestMessageRoleEnum]\n /**\n *\n * @export\n * @interface ChatCompletionResponseMessage\n */\n export interface ChatCompletionResponseMessage {\n /**\n * The role of the author of this message.\n * @type {string}\n * @memberof ChatCompletionResponseMessage\n */\n role: ChatCompletionResponseMessageRoleEnum\n /**\n * The contents of the message\n * @type {string}\n * @memberof ChatCompletionResponseMessage\n */\n content: string\n }\n export declare const ChatCompletionResponseMessageRoleEnum: {\n readonly System: 'system'\n readonly User: 'user'\n readonly Assistant: 'assistant'\n }\n export declare type ChatCompletionResponseMessageRoleEnum =\n (typeof ChatCompletionResponseMessageRoleEnum)[keyof typeof ChatCompletionResponseMessageRoleEnum]\n /**\n *\n * @export\n * @interface CreateChatCompletionRequest\n */\n export interface CreateChatCompletionRequest {\n /**\n * ID of the model to use. Currently, only `gpt-3.5-turbo` and `gpt-3.5-turbo-0301` are supported.\n * @type {string}\n * @memberof CreateChatCompletionRequest\n */\n model: string\n /**\n * The messages to generate chat completions for, in the [chat format](/docs/guides/chat/introduction).\n * @type {Array}\n * @memberof CreateChatCompletionRequest\n */\n messages: Array\n /**\n * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or `top_p` but not both.\n * @type {number}\n * @memberof CreateChatCompletionRequest\n */\n temperature?: number | null\n /**\n * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or `temperature` but not both.\n * @type {number}\n * @memberof CreateChatCompletionRequest\n */\n top_p?: number | null\n /**\n * How many chat completion choices to generate for each input message.\n * @type {number}\n * @memberof CreateChatCompletionRequest\n */\n n?: number | null\n /**\n * If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message.\n * @type {boolean}\n * @memberof CreateChatCompletionRequest\n */\n stream?: boolean | null\n /**\n *\n * @type {CreateChatCompletionRequestStop}\n * @memberof CreateChatCompletionRequest\n */\n stop?: CreateChatCompletionRequestStop\n /**\n * The maximum number of tokens allowed for the generated answer. By default, the number of tokens the model can return will be (4096 - prompt tokens).\n * @type {number}\n * @memberof CreateChatCompletionRequest\n */\n max_tokens?: number\n /**\n * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model\\'s likelihood to talk about new topics. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)\n * @type {number}\n * @memberof CreateChatCompletionRequest\n */\n presence_penalty?: number | null\n /**\n * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model\\'s likelihood to repeat the same line verbatim. [See more information about frequency and presence penalties.](/docs/api-reference/parameter-details)\n * @type {number}\n * @memberof CreateChatCompletionRequest\n */\n frequency_penalty?: number | null\n /**\n * Modify the likelihood of specified tokens appearing in the completion. Accepts a json object that maps tokens (specified by their token ID in the tokenizer) to an associated bias value from -100 to 100. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token.\n * @type {object}\n * @memberof CreateChatCompletionRequest\n */\n logit_bias?: object | null\n /**\n * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](/docs/guides/safety-best-practices/end-user-ids).\n * @type {string}\n * @memberof CreateChatCompletionRequest\n */\n user?: string\n }\n /**\n * @type CreateChatCompletionRequestStop\n * Up to 4 sequences where the API will stop generating further tokens.\n * @export\n */\n export declare type CreateChatCompletionRequestStop = Array | string\n /**\n *\n * @export\n * @interface CreateChatCompletionResponse\n */\n export interface CreateChatCompletionResponse {\n /**\n *\n * @type {string}\n * @memberof CreateChatCompletionResponse\n */\n id: string\n /**\n *\n * @type {string}\n * @memberof CreateChatCompletionResponse\n */\n object: string\n /**\n *\n * @type {number}\n * @memberof CreateChatCompletionResponse\n */\n created: number\n /**\n *\n * @type {string}\n * @memberof CreateChatCompletionResponse\n */\n model: string\n /**\n *\n * @type {Array}\n * @memberof CreateChatCompletionResponse\n */\n choices: Array\n /**\n *\n * @type {CreateCompletionResponseUsage}\n * @memberof CreateChatCompletionResponse\n */\n usage?: CreateCompletionResponseUsage\n }\n /**\n *\n * @export\n * @interface CreateChatCompletionResponseChoicesInner\n */\n export interface CreateChatCompletionResponseChoicesInner {\n /**\n *\n * @type {number}\n * @memberof CreateChatCompletionResponseChoicesInner\n */\n index?: number\n /**\n *\n * @type {ChatCompletionResponseMessage}\n * @memberof CreateChatCompletionResponseChoicesInner\n */\n message?: ChatCompletionResponseMessage\n /**\n *\n * @type {string}\n * @memberof CreateChatCompletionResponseChoicesInner\n */\n finish_reason?: string\n }\n /**\n *\n * @export\n * @interface CreateCompletionResponseUsage\n */\n export interface CreateCompletionResponseUsage {\n /**\n *\n * @type {number}\n * @memberof CreateCompletionResponseUsage\n */\n prompt_tokens: number\n /**\n *\n * @type {number}\n * @memberof CreateCompletionResponseUsage\n */\n completion_tokens: number\n /**\n *\n * @type {number}\n * @memberof CreateCompletionResponseUsage\n */\n total_tokens: number\n }\n}\n","/// \r\n\r\nconst fetch = globalThis.fetch\r\n\r\nexport { fetch }\r\n","import { createParser } from 'eventsource-parser'\r\n\r\nimport * as types from './types'\r\nimport { fetch as globalFetch } from './fetch'\r\nimport { streamAsyncIterable } from './stream-async-iterable'\r\n\r\nexport async function fetchSSE(\r\n url: string,\r\n options: Parameters[1] & { onMessage: (data: string) => void },\r\n fetch: types.FetchFn = globalFetch\r\n) {\r\n const { onMessage, ...fetchOptions } = options\r\n const res = await fetch(url, fetchOptions)\r\n if (!res.ok) {\r\n let reason: string\r\n\r\n try {\r\n reason = await res.text()\r\n } catch (err) {\r\n reason = res.statusText\r\n }\r\n\r\n const msg = `ChatGPT error ${res.status}: ${reason}`\r\n const error = new types.ChatGPTError(msg, { cause: res })\r\n error.statusCode = res.status\r\n error.statusText = res.statusText\r\n error.reason = reason\r\n throw error\r\n }\r\n\r\n const parser = createParser((event) => {\r\n if (event.type === 'event') {\r\n onMessage(event.data)\r\n }\r\n })\r\n\r\n if (!res.body.getReader) {\r\n // Vercel polyfills `fetch` with `node-fetch`, which doesn't conform to\r\n // web standards, so this is a workaround...\r\n const body: NodeJS.ReadableStream = res.body as any\r\n\r\n if (!body.on || !body.read) {\r\n throw new types.ChatGPTError('unsupported \"fetch\" implementation')\r\n }\r\n\r\n body.on('readable', () => {\r\n let chunk: string | Buffer\r\n while (null !== (chunk = body.read())) {\r\n parser.feed(chunk.toString())\r\n }\r\n })\r\n } else {\r\n for await (const chunk of streamAsyncIterable(res.body)) {\r\n const str = new TextDecoder().decode(chunk)\r\n parser.feed(str)\r\n }\r\n }\r\n}\r\n","export async function* streamAsyncIterable(stream: ReadableStream) {\r\n const reader = stream.getReader()\r\n try {\r\n while (true) {\r\n const { done, value } = await reader.read()\r\n if (done) {\r\n return\r\n }\r\n yield value\r\n }\r\n } finally {\r\n reader.releaseLock()\r\n }\r\n}\r\n"],"mappings":";AAAA,OAAO,UAAU;AACjB,OAAO,cAAc;AACrB,OAAO,cAAc;AACrB,SAAS,MAAM,cAAc;;;AC2EtB,IAAM,eAAN,cAA2B,MAAM;AAMxC;AA+FO,IAAU;AAAA,CAAV,CAAUA,YAAV;AAAA,GAAU;;;ACjLjB,IAAM,QAAQ,WAAW;;;ACFzB,SAAS,oBAAoB;;;ACA7B,gBAAuB,oBAAuB,QAA2B;AACvE,QAAM,SAAS,OAAO,UAAU;AAChC,MAAI;AACF,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,MAAM,IAAI,MAAM,OAAO,KAAK;AAC1C,UAAI,MAAM;AACR;AAAA,MACF;AACA,YAAM;AAAA,IACR;AAAA,EACF,UAAE;AACA,WAAO,YAAY;AAAA,EACrB;AACF;;;ADPA,eAAsB,SACpB,KACA,SACAC,SAAuB,OACvB;AACA,QAAM,EAAE,WAAW,GAAG,aAAa,IAAI;AACvC,QAAM,MAAM,MAAMA,OAAM,KAAK,YAAY;AACzC,MAAI,CAAC,IAAI,IAAI;AACX,QAAI;AAEJ,QAAI;AACF,eAAS,MAAM,IAAI,KAAK;AAAA,IAC1B,SAAS,KAAP;AACA,eAAS,IAAI;AAAA,IACf;AAEA,UAAM,MAAM,iBAAiB,IAAI,WAAW;AAC5C,UAAM,QAAQ,IAAU,aAAa,KAAK,EAAE,OAAO,IAAI,CAAC;AACxD,UAAM,aAAa,IAAI;AACvB,UAAM,aAAa,IAAI;AACvB,UAAM,SAAS;AACf,UAAM;AAAA,EACR;AAEA,QAAM,SAAS,aAAa,CAAC,UAAU;AACrC,QAAI,MAAM,SAAS,SAAS;AAC1B,gBAAU,MAAM,IAAI;AAAA,IACtB;AAAA,EACF,CAAC;AAED,MAAI,CAAC,IAAI,KAAK,WAAW;AAGvB,UAAM,OAA8B,IAAI;AAExC,QAAI,CAAC,KAAK,MAAM,CAAC,KAAK,MAAM;AAC1B,YAAM,IAAU,aAAa,oCAAoC;AAAA,IACnE;AAEA,SAAK,GAAG,YAAY,MAAM;AACxB,UAAI;AACJ,aAAO,UAAU,QAAQ,KAAK,KAAK,IAAI;AACrC,eAAO,KAAK,MAAM,SAAS,CAAC;AAAA,MAC9B;AAAA,IACF,CAAC;AAAA,EACH,OAAO;AACL,qBAAiB,SAAS,oBAAoB,IAAI,IAAI,GAAG;AACvD,YAAM,MAAM,IAAI,YAAY,EAAE,OAAO,KAAK;AAC1C,aAAO,KAAK,GAAG;AAAA,IACjB;AAAA,EACF;AACF;;;AHhDA,IAAM,gBAAgB;AAEtB,IAAM,qBAAqB;AAC3B,IAAM,0BAA0B;AAEzB,IAAM,aAAN,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoCtB,YAAY,MAA+B;AACzC,UAAM;AAAA,MACJ;AAAA,MACA,aAAa;AAAA,MACb;AAAA,MACA,QAAQ;AAAA,MACR;AAAA,MACA;AAAA,MACA;AAAA,MACA,iBAAiB;AAAA,MACjB,oBAAoB;AAAA,MACpB;AAAA,MACA;AAAA,MACA,OAAAC,SAAQ;AAAA,IACV,IAAI;AAEJ,SAAK,UAAU;AACf,SAAK,cAAc;AACnB,SAAK,gBAAgB;AACrB,SAAK,SAAS,CAAC,CAAC;AAChB,SAAK,SAASA;AAEd,SAAK,oBAAoB;AAAA,MACvB,OAAO;AAAA,MACP,aAAa;AAAA,MACb,OAAO;AAAA,MACP,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL;AAEA,SAAK,iBAAiB;AAEtB,QAAI,KAAK,mBAAmB,QAAW;AACrC,YAAM,eAAc,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE,CAAC;AACzD,WAAK,iBAAiB;AAAA;AAAA,gBAA4I;AAAA,IACpK;AAUA,SAAK,kBAAkB;AACvB,SAAK,qBAAqB;AAE1B,SAAK,kBAAkB,kBAAkB,KAAK;AAC9C,SAAK,iBAAiB,iBAAiB,KAAK;AAE5C,QAAI,cAAc;AAChB,WAAK,gBAAgB;AAAA,IACvB,OAAO;AACL,WAAK,gBAAgB,IAAI,KAA6B;AAAA,QACpD,OAAO,IAAI,SAAoC,EAAE,SAAS,IAAM,CAAC;AAAA,MACnE,CAAC;AAAA,IACH;AAEA,QAAI,CAAC,KAAK,SAAS;AACjB,YAAM,IAAI,MAAM,gCAAgC;AAAA,IAClD;AAEA,QAAI,CAAC,KAAK,QAAQ;AAChB,YAAM,IAAI,MAAM,2CAA2C;AAAA,IAC7D;AAEA,QAAI,OAAO,KAAK,WAAW,YAAY;AACrC,YAAM,IAAI,MAAM,mCAAmC;AAAA,IACrD;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuBA,MAAM,YACJ,MACA,OAAiC,CAAC,GACN;AAC5B,UAAM;AAAA,MACJ;AAAA,MACA,YAAY,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA,SAAS,aAAa,OAAO;AAAA,MAC7B;AAAA,IACF,IAAI;AAEJ,QAAI,EAAE,YAAY,IAAI;AAEtB,QAAI,kBAAmC;AACvC,QAAI,aAAa,CAAC,aAAa;AAC7B,wBAAkB,IAAI,gBAAgB;AACtC,oBAAc,gBAAgB;AAAA,IAChC;AAEA,UAAM,UAA6B;AAAA,MACjC,MAAM;AAAA,MACN,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF;AACA,UAAM,KAAK,eAAe,OAAO;AAEjC,UAAM,EAAE,SAAS,IAAI,MAAM,KAAK,eAAe,MAAM,IAAI;AAEzD,UAAM,SAA4B;AAAA,MAChC,MAAM;AAAA,MACN,IAAI,OAAO;AAAA,MACX,iBAAiB;AAAA,MACjB,MAAM;AAAA,IACR;AAEA,UAAM,YAAY,IAAI;AAAA,MACpB,OAAO,SAAS,WAAW;AAtLjC;AAuLQ,cAAM,MAAM,GAAG,KAAK;AACpB,cAAM,UAAU;AAAA,UACd,gBAAgB;AAAA,UAChB,eAAe,UAAU,KAAK;AAAA,QAChC;AACA,YAAI,KAAK,eAAe;AACtB,kBAAQ,qBAAqB,IAAI,KAAK;AAAA,QACxC;AACA,cAAM,OAAO;AAAA,UACX,GAAG,KAAK;AAAA,UACR,GAAG;AAAA,UACH;AAAA,UACA;AAAA,QACF;AAEA,YAAI,QAAQ;AACV;AAAA,YACE;AAAA,YACA;AAAA,cACE,QAAQ;AAAA,cACR;AAAA,cACA,MAAM,KAAK,UAAU,IAAI;AAAA,cACzB,QAAQ;AAAA,cACR,WAAW,CAAC,SAAiB;AA9M3C,oBAAAC;AA+MgB,oBAAI,SAAS,UAAU;AACrB,yBAAO,OAAO,OAAO,KAAK,KAAK;AAC/B,yBAAO,QAAQ,MAAM;AAAA,gBACvB;AAEA,oBAAI;AACF,wBAAM,WACJ,KAAK,MAAM,IAAI;AAEjB,sBAAI,SAAS,IAAI;AACf,2BAAO,KAAK,SAAS;AAAA,kBACvB;AAEA,uBAAIA,MAAA,qCAAU,YAAV,gBAAAA,IAAmB,QAAQ;AAC7B,0BAAM,QAAQ,SAAS,QAAQ,CAAC,EAAE;AAClC,2BAAO,QAAQ,MAAM;AACrB,wBAAI,+BAAO;AAAS,6BAAO,QAAQ,MAAM;AACzC,2BAAO,SAAS;AAEhB,wBAAI,MAAM,MAAM;AACd,6BAAO,OAAO,MAAM;AAAA,oBACtB;AAEA,6DAAa;AAAA,kBACf;AAAA,gBACF,SAAS,KAAP;AACA,0BAAQ,KAAK,4CAA4C,GAAG;AAC5D,yBAAO,OAAO,GAAG;AAAA,gBACnB;AAAA,cACF;AAAA,YACF;AAAA,YACA,KAAK;AAAA,UACP,EAAE,MAAM,MAAM;AAAA,QAChB,OAAO;AACL,cAAI;AACF,kBAAM,MAAM,MAAM,KAAK,OAAO,KAAK;AAAA,cACjC,QAAQ;AAAA,cACR;AAAA,cACA,MAAM,KAAK,UAAU,IAAI;AAAA,cACzB,QAAQ;AAAA,YACV,CAAC;AAED,gBAAI,CAAC,IAAI,IAAI;AACX,oBAAM,SAAS,MAAM,IAAI,KAAK;AAC9B,oBAAM,MAAM,gBACV,IAAI,UAAU,IAAI,eACf;AACL,oBAAM,QAAQ,IAAU,aAAa,KAAK,EAAE,OAAO,IAAI,CAAC;AACxD,oBAAM,aAAa,IAAI;AACvB,oBAAM,aAAa,IAAI;AACvB,qBAAO,OAAO,KAAK;AAAA,YACrB;AAEA,kBAAM,WACJ,MAAM,IAAI,KAAK;AACjB,gBAAI,KAAK,QAAQ;AACf,sBAAQ,IAAI,QAAQ;AAAA,YACtB;AAEA,gBAAI,qCAAU,IAAI;AAChB,qBAAO,KAAK,SAAS;AAAA,YACvB;AAEA,iBAAI,0CAAU,YAAV,mBAAmB,QAAQ;AAC7B,oBAAMC,WAAU,SAAS,QAAQ,CAAC,EAAE;AACpC,qBAAO,OAAOA,SAAQ;AACtB,kBAAIA,SAAQ,MAAM;AAChB,uBAAO,OAAOA,SAAQ;AAAA,cACxB;AAAA,YACF,OAAO;AACL,oBAAMC,OAAM;AACZ,qBAAO;AAAA,gBACL,IAAI;AAAA,kBACF,mBACE,KAAAA,QAAA,gBAAAA,KAAK,WAAL,mBAAa,aAAWA,QAAA,gBAAAA,KAAK,WAAU;AAAA,gBAE3C;AAAA,cACF;AAAA,YACF;AAEA,mBAAO,SAAS;AAEhB,mBAAO,QAAQ,MAAM;AAAA,UACvB,SAAS,KAAP;AACA,mBAAO,OAAO,GAAG;AAAA,UACnB;AAAA,QACF;AAAA,MACF;AAAA,IACF,EAAE,KAAK,CAACD,aAAY;AAClB,aAAO,KAAK,eAAeA,QAAO,EAAE,KAAK,MAAMA,QAAO;AAAA,IACxD,CAAC;AAED,QAAI,WAAW;AACb,UAAI,iBAAiB;AAGnB;AAAC,QAAC,UAAkB,SAAS,MAAM;AACjC,0BAAgB,MAAM;AAAA,QACxB;AAAA,MACF;AAEA,aAAO,SAAS,WAAW;AAAA,QACzB,cAAc;AAAA,QACd,SAAS;AAAA,MACX,CAAC;AAAA,IACH,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AAAA,EAEA,IAAI,SAAiB;AACnB,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAI,OAAO,QAAgB;AACzB,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAgB,eAAe,MAAc,MAAgC;AAC3E,UAAM,EAAE,gBAAgB,KAAK,eAAe,IAAI;AAChD,QAAI,EAAE,gBAAgB,IAAI;AAE1B,UAAM,YAAY;AAClB,UAAM,iBAAiB;AAEvB,QAAI,WAAwD,CAAC;AAE7D,QAAI,eAAe;AACjB,eAAS,KAAK;AAAA,QACZ,MAAM;AAAA,QACN,SAAS;AAAA,MACX,CAAC;AAAA,IACH;AAEA,UAAM,sBAAsB,SAAS;AACrC,QAAI,eAAe,OACf,SAAS,OAAO;AAAA,MACd;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,QACT,MAAM,KAAK;AAAA,MACb;AAAA,IACF,CAAC,IACD;AAEJ,OAAG;AACD,YAAM,SAAS,aACZ,OAAO,CAACE,SAAQ,YAAY;AAC3B,gBAAQ,QAAQ,MAAM;AAAA,UACpB,KAAK;AACH,mBAAOA,QAAO,OAAO,CAAC;AAAA,EAAkB,QAAQ,SAAS,CAAC;AAAA,UAC5D,KAAK;AACH,mBAAOA,QAAO,OAAO,CAAC,GAAG;AAAA,EAAe,QAAQ,SAAS,CAAC;AAAA,UAC5D;AACE,mBAAOA,QAAO,OAAO,CAAC,GAAG;AAAA,EAAoB,QAAQ,SAAS,CAAC;AAAA,QACnE;AAAA,MACF,GAAG,CAAC,CAAa,EAChB,KAAK,MAAM;AAEd,iBAAW;AAEX,UAAI,CAAC,iBAAiB;AACpB;AAAA,MACF;AAEA,YAAM,gBAAgB,MAAM,KAAK,gBAAgB,eAAe;AAChE,UAAI,CAAC,eAAe;AAClB;AAAA,MACF;AAEA,YAAM,oBAAoB,cAAc,QAAQ;AAEhD,qBAAe,aAAa,MAAM,GAAG,mBAAmB,EAAE,OAAO;AAAA,QAC/D;AAAA,UACE,MAAM;AAAA,UACN,SAAS,cAAc;AAAA,UACvB,MAAM,cAAc;AAAA,QACtB;AAAA,QACA,GAAG,aAAa,MAAM,mBAAmB;AAAA,MAC3C,CAAC;AAED,wBAAkB,cAAc;AAAA,IAClC,SAAS;AAET,WAAO,EAAE,SAAS;AAAA,EACpB;AAAA;AAAA;AAAA;AAAA,EAMA,MAAgB,uBACd,IAC4B;AAC5B,UAAM,MAAM,MAAM,KAAK,cAAc,IAAI,EAAE;AAC3C,WAAO;AAAA,EACT;AAAA,EAEA,MAAgB,sBACd,SACe;AACf,UAAM,KAAK,cAAc,IAAI,QAAQ,IAAI,OAAO;AAAA,EAClD;AACF;","names":["openai","fetch","fetch","_a","message","res","prompt"]} \ No newline at end of file diff --git a/images/ai-logo.jpg b/images/ai-logo.jpg new file mode 100644 index 0000000..9a41064 Binary files /dev/null and b/images/ai-logo.jpg differ diff --git a/images/openai-logo.svg b/images/openai-logo.svg new file mode 100644 index 0000000..44f5c2e --- /dev/null +++ b/images/openai-logo.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/media/main.css b/media/main.css new file mode 100644 index 0000000..3164c7e --- /dev/null +++ b/media/main.css @@ -0,0 +1,358 @@ +:root { + --container-padding: 0; + --input-padding-vertical: 6px; + --input-padding-horizontal: 4px; + --input-margin-vertical: 4px; + --input-margin-horizontal: 0; +} + +body { + padding: 0 var(--container-padding); + color: var(--vscode-foreground); + font-size: var(--vscode-editor-font-size); + font-weight: var(--vscode-font-weight); + font-family: var(--vscode-font-family); + background-color: var(--vscode-editor-background); +} + +ol, +ul { + padding-left: var(--container-padding); +} + +body>*, +form>* { + margin-block-start: var(--input-margin-vertical); + margin-block-end: var(--input-margin-vertical); +} + +*:focus { + outline-color: var(--vscode-focusBorder) !important; +} + +a { + color: var(--vscode-textLink-foreground); +} + +a:hover, +a:active { + color: var(--vscode-textLink-activeForeground); +} + +blockquote, +dd, +dl, +figure, +h1, +h3, +h4, +h5, +h6, +hr, +p { + margin-block-start: 1em !important; + margin-block-end: 1em !important; + margin-inline-start: 0px !important; + margin-inline-end: 0px !important; +} + +h1 { + font-size: 1.17em !important; + margin-top: 0.67em !important; + margin-bottom: 0.67em !important; + margin-left: 0 !important; + margin-right: 0 !important; + font-weight: bold !important; +} + +h2 { + font-size: 1em !important; + margin-top: 0.83em !important; + margin-bottom: 0.83em !important; + margin-left: 0 !important; + margin-right: 0 !important; + font-weight: bold !important; +} + +h3 { + font-size: .93em !important; + margin-top: 1em !important; + margin-bottom: 1em !important; + margin-left: 0 !important; + margin-right: 0 !important; + font-weight: bold !important; +} + +h4 { + font-size: .85em !important; + margin-top: 1.33em !important; + margin-bottom: 1.33em !important; + margin-left: 0 !important; + margin-right: 0 !important; + font-weight: bold !important; +} + +h5 { + font-size: .83em !important; + margin-top: 1.67em !important; + margin-bottom: 1.67em !important; + margin-left: 0 !important; + margin-right: 0 !important; + font-weight: bold !important; +} + +h6 { + font-size: .8em !important; + margin-top: 2.33em !important; + margin-bottom: 2.33em !important; + margin-left: 0 !important; + margin-right: 0 !important; + font-weight: bold !important; +} + +code { + font-family: var(--vscode-editor-font-family) !important; +} + +button { + border: none; + padding: var(--input-padding-vertical) var(--input-padding-horizontal); + text-align: center; + outline: 1px solid transparent; + outline-offset: 2px !important; + color: var(--vscode-button-secondaryForeground) !important; + background: var(--vscode-button-secondaryBackground) !important; +} + +button:hover { + background: var(--vscode-button-secondaryHoverBackground) !important; +} + +button:hover svg { + stroke: var(--vscode-button-secondaryForeground) !important; +} + +button:focus { + outline-color: var(--vscode-focusBorder); +} + +button.secondary { + color: var(--vscode-button-secondaryForeground); + background: var(--vscode-button-secondaryBackground); +} + +button.secondary:hover { + background: var(--vscode-button-secondaryHoverBackground); +} + +input:not([type='checkbox']), +textarea { + display: block; + width: 100%; + border: none; + font-family: var(--vscode-font-family); + padding: var(--input-padding-vertical) var(--input-padding-horizontal); + color: var(--vscode-input-foreground); + outline-color: var(--vscode-input-border); + background-color: var(--vscode-input-background); +} + +input::placeholder, +textarea::placeholder { + color: var(--vscode-input-placeholderForeground); +} + +[contenteditable='true'] { + outline: 1px solid var(--vscode-focusBorder); +} + +/* CSS Spinner */ +.spinner { + width: 36px; + text-align: center; +} + +.spinner>div { + width: 4px; + height: 4px; + background-color: #888; + + border-radius: 100%; + display: inline-block; + -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both; + animation: sk-bouncedelay 1.4s infinite ease-in-out both; +} + +.spinner .bounce1 { + -webkit-animation-delay: -0.32s; + animation-delay: -0.32s; +} + +.spinner .bounce2 { + -webkit-animation-delay: -0.16s; + animation-delay: -0.16s; +} + +@-webkit-keyframes sk-bouncedelay { + + 0%, + 80%, + 100% { + -webkit-transform: scale(0) + } + + 40% { + -webkit-transform: scale(1.0) + } +} + +@keyframes sk-bouncedelay { + + 0%, + 80%, + 100% { + -webkit-transform: scale(0); + transform: scale(0); + } + + 40% { + -webkit-transform: scale(1.0); + transform: scale(1.0); + } +} + +.textarea-wrapper { + display: grid; + max-height: 20rem; + font-size: var(--vscode-font-size); +} + +.textarea-wrapper::after { + content: attr(data-replicated-value) " "; + white-space: pre-wrap; + visibility: hidden; +} + +.textarea-wrapper>textarea { + resize: none; + overflow: hidden auto; + max-height: 20rem; +} + +.textarea-wrapper>textarea, +.textarea-wrapper::after { + border: 1px solid black; + padding: .5rem 5rem .5rem .5rem; + font: inherit; + grid-area: 1 / 1 / 2 / 2; +} + +.pre-code-element:not(:last-child) { + margin-bottom: 2rem; +} + +.code-actions-wrapper { + opacity: 0.70; + font-size: 12px; + margin-top: 1rem; +} + +.code-actions-wrapper:hover { + opacity: 1; + display: flex; +} + +.typing { + font-size: var(--vscode-font-size); +} + +.input-background { + background: var(--vscode-input-background); +} + +.send-element-ext, +.cancel-element-ext { + font-size: smaller; +} + +@-webkit-keyframes blink { + to { + visibility: hidden + } +} + +@keyframes blink { + to { + visibility: hidden + } +} + +.result-streaming>:not(ol):not(ul):not(pre):last-child:after, +.result-streaming>ol:last-child li:last-child:after, +.result-streaming>pre:last-child code:after, +.result-streaming>ul:last-child li:last-child:after { + -webkit-animation: blink 1s steps(5, start) infinite; + animation: blink 1s steps(5, start) infinite; + content: "▋"; + margin-left: 0.25rem; + vertical-align: baseline; +} + +@media (max-height: 560px) { + .features-block { + display: none !important; + } +} + +.hidden { + display: hidden; +} + +.answer-element-ext table { + --tw-border-spacing-x: 0px; + --tw-border-spacing-y: 0px; + border-collapse: separate; + border-spacing: var(--tw-border-spacing-x) var(--tw-border-spacing-y); + width: 100%; + text-align: left; +} + +.answer-element-ext th { + background-color: var(--vscode-input-background); + border-bottom-width: 1px; + border-left-width: 1px; + border-top-width: 1px; + padding: .25rem .75rem; +} + +.answer-element-ext th:first-child { + border-top-left-radius: .375rem; +} + +.answer-element-ext th:last-child { + border-right-width: 1px; + border-top-right-radius: .375rem; +} + +.answer-element-ext td { + border-bottom-width: 1px; + border-left-width: 1px; + padding: .25rem .75rem; +} + +.answer-element-ext td:last-child { + border-right-width: 1px +} + +.answer-element-ext tbody tr:last-child td:first-child { + border-bottom-left-radius: .375rem; +} + +.answer-element-ext tbody tr:last-child td:last-child { + border-bottom-right-radius: .375rem; +} + +.answer-element-ext a { + text-decoration-line: underline; + text-underline-offset: 2px; +} \ No newline at end of file diff --git a/media/main.js b/media/main.js new file mode 100644 index 0000000..a14334c --- /dev/null +++ b/media/main.js @@ -0,0 +1,442 @@ +// @ts-nocheck + +(function () { + const vscode = acquireVsCodeApi(); + + marked.setOptions({ + renderer: new marked.Renderer(), + highlight: function (code, _lang) { + return hljs.highlightAuto(code).value; + }, + langPrefix: 'hljs language-', + pedantic: false, + gfm: true, + breaks: true, + sanitize: false, + smartypants: false, + xhtml: false + }); + + const aiSvg = ``; + + const userSvg = ``; + + const clipboardSvg = ``; + + const checkSvg = ``; + + const cancelSvg = ``; + + const sendSvg = ``; + + const pencilSvg = ``; + + const plusSvg = ``; + + const insertSvg = ``; + + const textSvg = ``; + + const closeSvg = ``; + + const refreshSvg = ``; + + // Handle messages sent from the extension to the webview + window.addEventListener("message", (event) => { + const message = event.data; + const list = document.getElementById("qa-list"); + + switch (message.type) { + case "showInProgress": + if (message.showStopButton) { + document.getElementById("stop-button").classList.remove("hidden"); + } else { + document.getElementById("stop-button").classList.add("hidden"); + } + + if (message.inProgress) { + document.getElementById("in-progress").classList.remove("hidden"); + document.getElementById("question-input").setAttribute("disabled", true); + document.getElementById("question-input-buttons").classList.add("hidden"); + } else { + document.getElementById("in-progress").classList.add("hidden"); + document.getElementById("question-input").removeAttribute("disabled"); + document.getElementById("question-input-buttons").classList.remove("hidden"); + } + break; + case "addQuestion": + list.classList.remove("hidden"); + document.getElementById("introduction")?.classList?.add("hidden"); + document.getElementById("conversation-list").classList.add("hidden"); + + const escapeHtml = (unsafe) => { + return unsafe.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll("'", '''); + }; + + list.innerHTML += + `
+

${userSvg}You

+ + + + +
${escapeHtml(message.value)}
+
`; + + if (message.autoScroll) { + list.lastChild?.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" }); + } + break; + case "addResponse": + let existingMessage = message.id && document.getElementById(message.id); + let updatedValue = ""; + + const unEscapeHtml = (unsafe) => { + return unsafe.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"').replaceAll(''', "'"); + }; + + if (!message.responseInMarkdown) { + updatedValue = "```\r\n" + unEscapeHtml(message.value) + " \r\n ```"; + } else { + updatedValue = message.value.split("```").length % 2 === 1 ? message.value : message.value + "\n\n```\n\n"; + } + + const markedResponse = marked.parse(updatedValue); + + if (existingMessage) { + existingMessage.innerHTML = markedResponse; + } else { + list.innerHTML += + `
+

${aiSvg}ChatGPT

+
${markedResponse}
+
`; + } + + if (message.done) { + const preCodeList = list.lastChild.querySelectorAll("pre > code"); + + preCodeList.forEach((preCode) => { + preCode.classList.add("input-background", "p-4", "pb-2", "block", "whitespace-pre", "overflow-x-scroll"); + preCode.parentElement.classList.add("pre-code-element", "relative"); + + const buttonWrapper = document.createElement("no-export"); + buttonWrapper.classList.add("code-actions-wrapper", "flex", "gap-3", "pr-2", "pt-1", "pb-1", "flex-wrap", "items-center", "justify-end", "rounded-t-lg", "input-background"); + + // Create copy to clipboard button + const copyButton = document.createElement("button"); + copyButton.title = "Copy to clipboard"; + copyButton.innerHTML = `${clipboardSvg} Copy`; + + copyButton.classList.add("code-element-ext", "p-1", "pr-2", "flex", "items-center", "rounded-lg"); + + const insert = document.createElement("button"); + insert.title = "Insert the below code to the current file"; + insert.innerHTML = `${insertSvg} Insert`; + + insert.classList.add("edit-element-ext", "p-1", "pr-2", "flex", "items-center", "rounded-lg"); + + const newTab = document.createElement("button"); + newTab.title = "Create a new file with the below code"; + newTab.innerHTML = `${plusSvg} New`; + + newTab.classList.add("new-code-element-ext", "p-1", "pr-2", "flex", "items-center", "rounded-lg"); + + buttonWrapper.append(copyButton, insert, newTab); + + if (preCode.parentNode.previousSibling) { + preCode.parentNode.parentNode.insertBefore(buttonWrapper, preCode.parentNode.previousSibling); + } else { + preCode.parentNode.parentNode.prepend(buttonWrapper); + } + }); + + existingMessage = document.getElementById(message.id); + existingMessage.classList.remove("result-streaming"); + } + + if (message.autoScroll && (message.done || markedResponse.endsWith("\n"))) { + list.lastChild?.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" }); + } + + break; + case "addError": + if (!list.innerHTML) { + return; + } + + const messageValue = message.value || "An error occurred. If this issue persists please clear your session token with `ChatGPT: Reset session` command and/or restart your Visual Studio Code. If you still experience issues, it may be due to outage on https://openai.com services."; + + list.innerHTML += + `
+

${aiSvg}ChatGPT

+
${marked.parse(messageValue)}
+
`; + + if (message.autoScroll) { + list.lastChild?.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" }); + } + break; + case "clearConversation": + clearConversation(); + break; + case "exportConversation": + exportConversation(); + break; + case "loginSuccessful": + document.getElementById("login-button")?.classList?.add("hidden"); + if (message.showConversations) { + document.getElementById("list-conversations-link")?.classList?.remove("hidden"); + } + break; + case "listConversations": + list.classList.add("hidden"); + document.getElementById("introduction")?.classList?.add("hidden"); + const conversationList = document.getElementById("conversation-list"); + conversationList.classList.remove("hidden"); + const conversation_list = message.conversations.items.map(conversation => { + const chatDate = new Date(conversation.create_time).toLocaleString(); + return ``; + }); + conversationList.innerHTML = `
+
+ + +
+
${conversation_list.join("")}
+
`; + break; + default: + break; + } + }); + + const addFreeTextQuestion = () => { + const input = document.getElementById("question-input"); + if (input.value?.length > 0) { + vscode.postMessage({ + type: "addFreeTextQuestion", + value: input.value, + }); + + input.value = ""; + } + }; + + const clearConversation = () => { + document.getElementById("qa-list").innerHTML = ""; + + document.getElementById("introduction")?.classList?.remove("hidden"); + + vscode.postMessage({ + type: "clearConversation" + }); + + }; + + const exportConversation = () => { + const turndownService = new TurndownService({ codeBlockStyle: "fenced" }); + turndownService.remove('no-export'); + let markdown = turndownService.turndown(document.getElementById("qa-list")); + + vscode.postMessage({ + type: "openNew", + value: markdown, + language: "markdown" + }); + }; + + document.getElementById('question-input').addEventListener("keydown", function (event) { + if (event.key == "Enter" && !event.shiftKey && !event.isComposing) { + event.preventDefault(); + addFreeTextQuestion(); + } + }); + + document.addEventListener("click", (e) => { + const targetButton = e.target.closest('button'); + + if (targetButton?.id === "more-button") { + e.preventDefault(); + document.getElementById('chat-button-wrapper')?.classList.toggle("hidden"); + + return; + } else { + document.getElementById('chat-button-wrapper')?.classList.add("hidden"); + } + + if (e.target?.id === "settings-button") { + e.preventDefault(); + vscode.postMessage({ + type: "openSettings", + }); + return; + } + + if (e.target?.id === "settings-prompt-button") { + e.preventDefault(); + vscode.postMessage({ + type: "openSettingsPrompt", + }); + return; + } + + if (targetButton?.id === "login-button") { + e.preventDefault(); + vscode.postMessage({ + type: "login", + }); + return; + } + + if (targetButton?.id === "ask-button") { + e.preventDefault(); + addFreeTextQuestion(); + return; + } + + if (targetButton?.id === "clear-button") { + e.preventDefault(); + clearConversation(); + return; + } + + if (targetButton?.id === "export-button") { + e.preventDefault(); + exportConversation(); + return; + } + + if (targetButton?.id === "list-conversations-button" || targetButton?.id === "list-conversations-link") { + e.preventDefault(); + + vscode.postMessage({ type: "listConversations" }); + return; + } + + if (targetButton?.id === "show-conversation-button") { + e.preventDefault(); + + vscode.postMessage({ type: "showConversation", value: targetButton.getAttribute("data-id") }); + + document.getElementById("qa-list").innerHTML = `
+

${targetButton.getAttribute("data-title")}

+ Started on: ${targetButton.getAttribute("data-time")} +
`; + + document.getElementById("qa-list").classList.remove("hidden"); + document.getElementById("introduction").classList.add("hidden"); + document.getElementById("conversation-list").classList.add("hidden"); + return; + } + + if (targetButton?.id === "refresh-conversations-button") { + e.preventDefault(); + + vscode.postMessage({ type: "listConversations" }); + return; + } + + if (targetButton?.id === "close-conversations-button") { + e.preventDefault(); + const qaList = document.getElementById('qa-list'); + qaList.classList.add("hidden"); + document.getElementById('conversation-list').classList.add("hidden"); + document.getElementById('introduction').classList.add("hidden"); + if (qaList.innerHTML?.length > 0) { + qaList.classList.remove("hidden"); + } else { + document.getElementById('introduction').classList.remove("hidden"); + } + return; + } + + if (targetButton?.id === "stop-button") { + e.preventDefault(); + vscode.postMessage({ + type: "stopGenerating", + }); + + return; + } + + if (targetButton?.classList?.contains("resend-element-ext")) { + e.preventDefault(); + const question = targetButton.closest(".question-element-ext"); + const elements = targetButton.nextElementSibling; + elements.classList.remove("hidden"); + question.lastElementChild?.setAttribute("contenteditable", true); + + targetButton.classList.add("hidden"); + + return; + } + + if (targetButton?.classList?.contains("send-element-ext")) { + e.preventDefault(); + + const question = targetButton.closest(".question-element-ext"); + const elements = targetButton.closest(".send-cancel-elements-ext"); + const resendElement = targetButton.parentElement.parentElement.firstElementChild; + elements.classList.add("hidden"); + resendElement.classList.remove("hidden"); + question.lastElementChild?.setAttribute("contenteditable", false); + + if (question.lastElementChild.textContent?.length > 0) { + vscode.postMessage({ + type: "addFreeTextQuestion", + value: question.lastElementChild.textContent, + }); + } + return; + } + + if (targetButton?.classList?.contains("cancel-element-ext")) { + e.preventDefault(); + const question = targetButton.closest(".question-element-ext"); + const elements = targetButton.closest(".send-cancel-elements-ext"); + const resendElement = targetButton.parentElement.parentElement.firstElementChild; + elements.classList.add("hidden"); + resendElement.classList.remove("hidden"); + question.lastElementChild?.setAttribute("contenteditable", false); + return; + } + + if (targetButton?.classList?.contains("code-element-ext")) { + e.preventDefault(); + navigator.clipboard.writeText(targetButton.parentElement?.nextElementSibling?.lastChild?.textContent).then(() => { + targetButton.innerHTML = `${checkSvg} Copied`; + + setTimeout(() => { + targetButton.innerHTML = `${clipboardSvg} Copy`; + }, 1500); + }); + + return; + } + + if (targetButton?.classList?.contains("edit-element-ext")) { + e.preventDefault(); + vscode.postMessage({ + type: "editCode", + value: targetButton.parentElement?.nextElementSibling?.lastChild?.textContent, + }); + + return; + } + + if (targetButton?.classList?.contains("new-code-element-ext")) { + e.preventDefault(); + vscode.postMessage({ + type: "openNew", + value: targetButton.parentElement?.nextElementSibling?.lastChild?.textContent, + }); + + return; + } + }); + +})(); diff --git a/media/vendor/highlight.min.css b/media/vendor/highlight.min.css new file mode 100644 index 0000000..8f1358f --- /dev/null +++ b/media/vendor/highlight.min.css @@ -0,0 +1 @@ +.hljs-comment, .hljs-quote {color: #5c6370;font-style: italic }.hljs-doctag, .hljs-formula, .hljs-keyword {color: #c678dd }.hljs-deletion, .hljs-name, .hljs-section, .hljs-selector-tag, .hljs-subst {color: #e06c75 }.hljs-literal {color: #56b6c2 }.hljs-addition, .hljs-attribute, .hljs-meta .hljs-string, .hljs-regexp, .hljs-string {color: #98c379 }.hljs-attr, .hljs-number, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-pseudo, .hljs-template-variable, .hljs-type, .hljs-variable {color: #d19a66 }.hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-symbol, .hljs-title {color: #61aeee }.hljs-built_in, .hljs-class .hljs-title, .hljs-title.class_ {color: #e6c07b }.hljs-emphasis {font-style: italic }.hljs-strong {font-weight: 700 }.hljs-link {text-decoration: underline } \ No newline at end of file diff --git a/media/vendor/highlight.min.js b/media/vendor/highlight.min.js new file mode 100644 index 0000000..4cbf349 --- /dev/null +++ b/media/vendor/highlight.min.js @@ -0,0 +1,1202 @@ +/*! + Highlight.js v11.7.0 (git: 82688fad18) + (c) 2006-2022 undefined and other contributors + License: BSD-3-Clause + */ +var hljs=function(){"use strict";var e={exports:{}};function n(e){ +return e instanceof Map?e.clear=e.delete=e.set=()=>{ +throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{ +throw Error("set is read-only") +}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{var a=e[t] +;"object"!=typeof a||Object.isFrozen(a)||n(a)})),e} +e.exports=n,e.exports.default=n;class t{constructor(e){ +void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1} +ignoreMatch(){this.isMatchIgnored=!0}}function a(e){ +return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'") +}function i(e,...n){const t=Object.create(null);for(const n in e)t[n]=e[n] +;return n.forEach((e=>{for(const n in e)t[n]=e[n]})),t} +const r=e=>!!e.scope||e.sublanguage&&e.language;class s{constructor(e,n){ +this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){ +this.buffer+=a(e)}openNode(e){if(!r(e))return;let n="" +;n=e.sublanguage?"language-"+e.language:((e,{prefix:n})=>{if(e.includes(".")){ +const t=e.split(".") +;return[`${n}${t.shift()}`,...t.map(((e,n)=>`${e}${"_".repeat(n+1)}`))].join(" ") +}return`${n}${e}`})(e.scope,{prefix:this.classPrefix}),this.span(n)} +closeNode(e){r(e)&&(this.buffer+="")}value(){return this.buffer}span(e){ +this.buffer+=``}}const o=(e={})=>{const n={children:[]} +;return Object.assign(n,e),n};class l{constructor(){ +this.rootNode=o(),this.stack=[this.rootNode]}get top(){ +return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){ +this.top.children.push(e)}openNode(e){const n=o({scope:e}) +;this.add(n),this.stack.push(n)}closeNode(){ +if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){ +for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)} +walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){ +return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n), +n.children.forEach((n=>this._walk(e,n))),e.closeNode(n)),e}static _collapse(e){ +"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{ +l._collapse(e)})))}}class c extends l{constructor(e){super(),this.options=e} +addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())} +addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root +;t.sublanguage=!0,t.language=n,this.add(t)}toHTML(){ +return new s(this,this.options).value()}finalize(){return!0}}function d(e){ +return e?"string"==typeof e?e:e.source:null}function g(e){return m("(?=",e,")")} +function u(e){return m("(?:",e,")*")}function b(e){return m("(?:",e,")?")} +function m(...e){return e.map((e=>d(e))).join("")}function p(...e){const n=(e=>{ +const n=e[e.length-1] +;return"object"==typeof n&&n.constructor===Object?(e.splice(e.length-1,1),n):{} +})(e);return"("+(n.capture?"":"?:")+e.map((e=>d(e))).join("|")+")"} +function _(e){return RegExp(e.toString()+"|").exec("").length-1} +const h=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./ +;function f(e,{joinWith:n}){let t=0;return e.map((e=>{t+=1;const n=t +;let a=d(e),i="";for(;a.length>0;){const e=h.exec(a);if(!e){i+=a;break} +i+=a.substring(0,e.index), +a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?i+="\\"+(Number(e[1])+n):(i+=e[0], +"("===e[0]&&t++)}return i})).map((e=>`(${e})`)).join(n)} +const E="[a-zA-Z]\\w*",y="[a-zA-Z_]\\w*",w="\\b\\d+(\\.\\d+)?",N="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",v="\\b(0b[01]+)",O={ +begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'", +illegal:"\\n",contains:[O]},x={scope:"string",begin:'"',end:'"',illegal:"\\n", +contains:[O]},M=(e,n,t={})=>{const a=i({scope:"comment",begin:e,end:n, +contains:[]},t);a.contains.push({scope:"doctag", +begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)", +end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0}) +;const r=p("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/) +;return a.contains.push({begin:m(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a +},S=M("//","$"),A=M("/\\*","\\*/"),C=M("#","$");var T=Object.freeze({ +__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:E,UNDERSCORE_IDENT_RE:y, +NUMBER_RE:w,C_NUMBER_RE:N,BINARY_NUMBER_RE:v, +RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", +SHEBANG:(e={})=>{const n=/^#![ ]*\// +;return e.binary&&(e.begin=m(n,/.*\b/,e.binary,/\b.*/)),i({scope:"meta",begin:n, +end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)}, +BACKSLASH_ESCAPE:O,APOS_STRING_MODE:k,QUOTE_STRING_MODE:x,PHRASAL_WORDS_MODE:{ +begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ +},COMMENT:M,C_LINE_COMMENT_MODE:S,C_BLOCK_COMMENT_MODE:A,HASH_COMMENT_MODE:C, +NUMBER_MODE:{scope:"number",begin:w,relevance:0},C_NUMBER_MODE:{scope:"number", +begin:N,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:v,relevance:0}, +REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//, +end:/\/[gimuy]*/,illegal:/\n/,contains:[O,{begin:/\[/,end:/\]/,relevance:0, +contains:[O]}]}]},TITLE_MODE:{scope:"title",begin:E,relevance:0}, +UNDERSCORE_TITLE_MODE:{scope:"title",begin:y,relevance:0},METHOD_GUARD:{ +begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{ +"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{ +n.data._beginMatch!==e[1]&&n.ignoreMatch()}})});function R(e,n){ +"."===e.input[e.index-1]&&n.ignoreMatch()}function D(e,n){ +void 0!==e.className&&(e.scope=e.className,delete e.className)}function I(e,n){ +n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)", +e.__beforeBegin=R,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords, +void 0===e.relevance&&(e.relevance=0))}function L(e,n){ +Array.isArray(e.illegal)&&(e.illegal=p(...e.illegal))}function B(e,n){ +if(e.match){ +if(e.begin||e.end)throw Error("begin & end are not supported with match") +;e.begin=e.match,delete e.match}}function $(e,n){ +void 0===e.relevance&&(e.relevance=1)}const z=(e,n)=>{if(!e.beforeMatch)return +;if(e.starts)throw Error("beforeMatch cannot be used with starts") +;const t=Object.assign({},e);Object.keys(e).forEach((n=>{delete e[n] +})),e.keywords=t.keywords,e.begin=m(t.beforeMatch,g(t.begin)),e.starts={ +relevance:0,contains:[Object.assign(t,{endsParent:!0})] +},e.relevance=0,delete t.beforeMatch +},F=["of","and","for","in","not","or","if","then","parent","list","value"] +;function U(e,n,t="keyword"){const a=Object.create(null) +;return"string"==typeof e?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach((t=>{ +Object.assign(a,U(e[t],n,t))})),a;function i(e,t){ +n&&(t=t.map((e=>e.toLowerCase()))),t.forEach((n=>{const t=n.split("|") +;a[t[0]]=[e,j(t[0],t[1])]}))}}function j(e,n){ +return n?Number(n):(e=>F.includes(e.toLowerCase()))(e)?0:1}const P={},K=e=>{ +console.error(e)},H=(e,...n)=>{console.log("WARN: "+e,...n)},q=(e,n)=>{ +P[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),P[`${e}/${n}`]=!0) +},Z=Error();function G(e,n,{key:t}){let a=0;const i=e[t],r={},s={} +;for(let e=1;e<=n.length;e++)s[e+a]=i[e],r[e+a]=!0,a+=_(n[e-1]) +;e[t]=s,e[t]._emit=r,e[t]._multi=!0}function W(e){(e=>{ +e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope, +delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={ +_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope +}),(e=>{if(Array.isArray(e.begin)){ +if(e.skip||e.excludeBegin||e.returnBegin)throw K("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), +Z +;if("object"!=typeof e.beginScope||null===e.beginScope)throw K("beginScope must be object"), +Z;G(e,e.begin,{key:"beginScope"}),e.begin=f(e.begin,{joinWith:""})}})(e),(e=>{ +if(Array.isArray(e.end)){ +if(e.skip||e.excludeEnd||e.returnEnd)throw K("skip, excludeEnd, returnEnd not compatible with endScope: {}"), +Z +;if("object"!=typeof e.endScope||null===e.endScope)throw K("endScope must be object"), +Z;G(e,e.end,{key:"endScope"}),e.end=f(e.end,{joinWith:""})}})(e)}function Q(e){ +function n(n,t){ +return RegExp(d(n),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(t?"g":"")) +}class t{constructor(){ +this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0} +addRule(e,n){ +n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]), +this.matchAt+=_(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null) +;const e=this.regexes.map((e=>e[1]));this.matcherRe=n(f(e,{joinWith:"|" +}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex +;const n=this.matcherRe.exec(e);if(!n)return null +;const t=n.findIndex(((e,n)=>n>0&&void 0!==e)),a=this.matchIndexes[t] +;return n.splice(0,t),Object.assign(n,a)}}class a{constructor(){ +this.rules=[],this.multiRegexes=[], +this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){ +if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t +;return this.rules.slice(e).forEach((([e,t])=>n.addRule(e,t))), +n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){ +return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){ +this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){ +const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex +;let t=n.exec(e) +;if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{ +const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)} +return t&&(this.regexIndex+=t.position+1, +this.regexIndex===this.count&&this.considerAll()),t}} +if(e.compilerExtensions||(e.compilerExtensions=[]), +e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.") +;return e.classNameAliases=i(e.classNameAliases||{}),function t(r,s){const o=r +;if(r.isCompiled)return o +;[D,B,W,z].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))), +r.__beforeBegin=null,[I,L,$].forEach((e=>e(r,s))),r.isCompiled=!0;let l=null +;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords), +l=r.keywords.$pattern, +delete r.keywords.$pattern),l=l||/\w+/,r.keywords&&(r.keywords=U(r.keywords,e.case_insensitive)), +o.keywordPatternRe=n(l,!0), +s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=n(o.begin),r.end||r.endsWithParent||(r.end=/\B|\b/), +r.end&&(o.endRe=n(o.end)), +o.terminatorEnd=d(o.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)), +r.illegal&&(o.illegalRe=n(r.illegal)), +r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((n=>i(e,{ +variants:null},n)))),e.cachedVariants?e.cachedVariants:X(e)?i(e,{ +starts:e.starts?i(e.starts):null +}):Object.isFrozen(e)?i(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{t(e,o) +})),r.starts&&t(r.starts,s),o.matcher=(e=>{const n=new a +;return e.contains.forEach((e=>n.addRule(e.begin,{rule:e,type:"begin" +}))),e.terminatorEnd&&n.addRule(e.terminatorEnd,{type:"end" +}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n})(o),o}(e)}function X(e){ +return!!e&&(e.endsWithParent||X(e.starts))}class V extends Error{ +constructor(e,n){super(e),this.name="HTMLInjectionError",this.html=n}} +const J=a,Y=i,ee=Symbol("nomatch");var ne=(n=>{ +const a=Object.create(null),i=Object.create(null),r=[];let s=!0 +;const o="Could not find the language '{}', did you forget to load/include a language module?",l={ +disableAutodetect:!0,name:"Plain text",contains:[]};let d={ +ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i, +languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-", +cssSelector:"pre code",languages:null,__emitter:c};function _(e){ +return d.noHighlightRe.test(e)}function h(e,n,t){let a="",i="" +;"object"==typeof n?(a=e, +t=n.ignoreIllegals,i=n.language):(q("10.7.0","highlight(lang, code, ...args) has been deprecated."), +q("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"), +i=e,a=n),void 0===t&&(t=!0);const r={code:a,language:i};x("before:highlight",r) +;const s=r.result?r.result:f(r.language,r.code,t) +;return s.code=r.code,x("after:highlight",s),s}function f(e,n,i,r){ +const l=Object.create(null);function c(){if(!k.keywords)return void M.addText(S) +;let e=0;k.keywordPatternRe.lastIndex=0;let n=k.keywordPatternRe.exec(S),t="" +;for(;n;){t+=S.substring(e,n.index) +;const i=w.case_insensitive?n[0].toLowerCase():n[0],r=(a=i,k.keywords[a]);if(r){ +const[e,a]=r +;if(M.addText(t),t="",l[i]=(l[i]||0)+1,l[i]<=7&&(A+=a),e.startsWith("_"))t+=n[0];else{ +const t=w.classNameAliases[e]||e;M.addKeyword(n[0],t)}}else t+=n[0] +;e=k.keywordPatternRe.lastIndex,n=k.keywordPatternRe.exec(S)}var a +;t+=S.substring(e),M.addText(t)}function g(){null!=k.subLanguage?(()=>{ +if(""===S)return;let e=null;if("string"==typeof k.subLanguage){ +if(!a[k.subLanguage])return void M.addText(S) +;e=f(k.subLanguage,S,!0,x[k.subLanguage]),x[k.subLanguage]=e._top +}else e=E(S,k.subLanguage.length?k.subLanguage:null) +;k.relevance>0&&(A+=e.relevance),M.addSublanguage(e._emitter,e.language) +})():c(),S=""}function u(e,n){let t=1;const a=n.length-1;for(;t<=a;){ +if(!e._emit[t]){t++;continue}const a=w.classNameAliases[e[t]]||e[t],i=n[t] +;a?M.addKeyword(i,a):(S=i,c(),S=""),t++}}function b(e,n){ +return e.scope&&"string"==typeof e.scope&&M.openNode(w.classNameAliases[e.scope]||e.scope), +e.beginScope&&(e.beginScope._wrap?(M.addKeyword(S,w.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap), +S=""):e.beginScope._multi&&(u(e.beginScope,n),S="")),k=Object.create(e,{parent:{ +value:k}}),k}function m(e,n,a){let i=((e,n)=>{const t=e&&e.exec(n) +;return t&&0===t.index})(e.endRe,a);if(i){if(e["on:end"]){const a=new t(e) +;e["on:end"](n,a),a.isMatchIgnored&&(i=!1)}if(i){ +for(;e.endsParent&&e.parent;)e=e.parent;return e}} +if(e.endsWithParent)return m(e.parent,n,a)}function p(e){ +return 0===k.matcher.regexIndex?(S+=e[0],1):(R=!0,0)}function _(e){ +const t=e[0],a=n.substring(e.index),i=m(k,e,a);if(!i)return ee;const r=k +;k.endScope&&k.endScope._wrap?(g(), +M.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(g(), +u(k.endScope,e)):r.skip?S+=t:(r.returnEnd||r.excludeEnd||(S+=t), +g(),r.excludeEnd&&(S=t));do{ +k.scope&&M.closeNode(),k.skip||k.subLanguage||(A+=k.relevance),k=k.parent +}while(k!==i.parent);return i.starts&&b(i.starts,e),r.returnEnd?0:t.length} +let h={};function y(a,r){const o=r&&r[0];if(S+=a,null==o)return g(),0 +;if("begin"===h.type&&"end"===r.type&&h.index===r.index&&""===o){ +if(S+=n.slice(r.index,r.index+1),!s){const n=Error(`0 width match regex (${e})`) +;throw n.languageName=e,n.badRule=h.rule,n}return 1} +if(h=r,"begin"===r.type)return(e=>{ +const n=e[0],a=e.rule,i=new t(a),r=[a.__beforeBegin,a["on:begin"]] +;for(const t of r)if(t&&(t(e,i),i.isMatchIgnored))return p(n) +;return a.skip?S+=n:(a.excludeBegin&&(S+=n), +g(),a.returnBegin||a.excludeBegin||(S=n)),b(a,e),a.returnBegin?0:n.length})(r) +;if("illegal"===r.type&&!i){ +const e=Error('Illegal lexeme "'+o+'" for mode "'+(k.scope||"")+'"') +;throw e.mode=k,e}if("end"===r.type){const e=_(r);if(e!==ee)return e} +if("illegal"===r.type&&""===o)return 1 +;if(T>1e5&&T>3*r.index)throw Error("potential infinite loop, way more iterations than matches") +;return S+=o,o.length}const w=v(e) +;if(!w)throw K(o.replace("{}",e)),Error('Unknown language: "'+e+'"') +;const N=Q(w);let O="",k=r||N;const x={},M=new d.__emitter(d);(()=>{const e=[] +;for(let n=k;n!==w;n=n.parent)n.scope&&e.unshift(n.scope) +;e.forEach((e=>M.openNode(e)))})();let S="",A=0,C=0,T=0,R=!1;try{ +for(k.matcher.considerAll();;){ +T++,R?R=!1:k.matcher.considerAll(),k.matcher.lastIndex=C +;const e=k.matcher.exec(n);if(!e)break;const t=y(n.substring(C,e.index),e) +;C=e.index+t} +return y(n.substring(C)),M.closeAllNodes(),M.finalize(),O=M.toHTML(),{ +language:e,value:O,relevance:A,illegal:!1,_emitter:M,_top:k}}catch(t){ +if(t.message&&t.message.includes("Illegal"))return{language:e,value:J(n), +illegal:!0,relevance:0,_illegalBy:{message:t.message,index:C, +context:n.slice(C-100,C+100),mode:t.mode,resultSoFar:O},_emitter:M};if(s)return{ +language:e,value:J(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:k} +;throw t}}function E(e,n){n=n||d.languages||Object.keys(a);const t=(e=>{ +const n={value:J(e),illegal:!1,relevance:0,_top:l,_emitter:new d.__emitter(d)} +;return n._emitter.addText(e),n})(e),i=n.filter(v).filter(k).map((n=>f(n,e,!1))) +;i.unshift(t);const r=i.sort(((e,n)=>{ +if(e.relevance!==n.relevance)return n.relevance-e.relevance +;if(e.language&&n.language){if(v(e.language).supersetOf===n.language)return 1 +;if(v(n.language).supersetOf===e.language)return-1}return 0})),[s,o]=r,c=s +;return c.secondBest=o,c}function y(e){let n=null;const t=(e=>{ +let n=e.className+" ";n+=e.parentNode?e.parentNode.className:"" +;const t=d.languageDetectRe.exec(n);if(t){const n=v(t[1]) +;return n||(H(o.replace("{}",t[1])), +H("Falling back to no-highlight mode for this block.",e)),n?t[1]:"no-highlight"} +return n.split(/\s+/).find((e=>_(e)||v(e)))})(e);if(_(t))return +;if(x("before:highlightElement",{el:e,language:t +}),e.children.length>0&&(d.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), +console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), +console.warn("The element with unescaped HTML:"), +console.warn(e)),d.throwUnescapedHTML))throw new V("One of your code blocks includes unescaped HTML.",e.innerHTML) +;n=e;const a=n.textContent,r=t?h(a,{language:t,ignoreIllegals:!0}):E(a) +;e.innerHTML=r.value,((e,n,t)=>{const a=n&&i[n]||t +;e.classList.add("hljs"),e.classList.add("language-"+a) +})(e,t,r.language),e.result={language:r.language,re:r.relevance, +relevance:r.relevance},r.secondBest&&(e.secondBest={ +language:r.secondBest.language,relevance:r.secondBest.relevance +}),x("after:highlightElement",{el:e,result:r,text:a})}let w=!1;function N(){ +"loading"!==document.readyState?document.querySelectorAll(d.cssSelector).forEach(y):w=!0 +}function v(e){return e=(e||"").toLowerCase(),a[e]||a[i[e]]} +function O(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach((e=>{ +i[e.toLowerCase()]=n}))}function k(e){const n=v(e) +;return n&&!n.disableAutodetect}function x(e,n){const t=e;r.forEach((e=>{ +e[t]&&e[t](n)}))} +"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{ +w&&N()}),!1),Object.assign(n,{highlight:h,highlightAuto:E,highlightAll:N, +highlightElement:y, +highlightBlock:e=>(q("10.7.0","highlightBlock will be removed entirely in v12.0"), +q("10.7.0","Please use highlightElement now."),y(e)),configure:e=>{d=Y(d,e)}, +initHighlighting:()=>{ +N(),q("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")}, +initHighlightingOnLoad:()=>{ +N(),q("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.") +},registerLanguage:(e,t)=>{let i=null;try{i=t(n)}catch(n){ +if(K("Language definition for '{}' could not be registered.".replace("{}",e)), +!s)throw n;K(n),i=l} +i.name||(i.name=e),a[e]=i,i.rawDefinition=t.bind(null,n),i.aliases&&O(i.aliases,{ +languageName:e})},unregisterLanguage:e=>{delete a[e] +;for(const n of Object.keys(i))i[n]===e&&delete i[n]}, +listLanguages:()=>Object.keys(a),getLanguage:v,registerAliases:O, +autoDetection:k,inherit:Y,addPlugin:e=>{(e=>{ +e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=n=>{ +e["before:highlightBlock"](Object.assign({block:n.el},n)) +}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=n=>{ +e["after:highlightBlock"](Object.assign({block:n.el},n))})})(e),r.push(e)} +}),n.debugMode=()=>{s=!1},n.safeMode=()=>{s=!0 +},n.versionString="11.7.0",n.regex={concat:m,lookahead:g,either:p,optional:b, +anyNumberOfTimes:u};for(const n in T)"object"==typeof T[n]&&e.exports(T[n]) +;return Object.assign(n,T),n})({});const te=e=>({IMPORTANT:{scope:"meta", +begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{ +scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/}, +FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/}, +ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$", +contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{ +scope:"number", +begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", +relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/} +}),ae=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],ie=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],re=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],se=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],oe=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),le=re.concat(se) +;var ce="\\.([0-9](_*[0-9])*)",de="[0-9a-fA-F](_*[0-9a-fA-F])*",ge={ +className:"number",variants:[{ +begin:`(\\b([0-9](_*[0-9])*)((${ce})|\\.)?|(${ce}))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:`\\b([0-9](_*[0-9])*)((${ce})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{ +begin:`(${ce})[fFdD]?\\b`},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{ +begin:`\\b0[xX]((${de})\\.?|(${de})?\\.(${de}))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b` +},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${de})[lL]?\\b`},{ +begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}], +relevance:0};function ue(e,n,t){return-1===t?"":e.replace(n,(a=>ue(e,n,t-1)))} +const be="[A-Za-z$_][0-9A-Za-z$_]*",me=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],pe=["true","false","null","undefined","NaN","Infinity"],_e=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],he=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],fe=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Ee=["arguments","this","super","console","window","document","localStorage","module","global"],ye=[].concat(fe,_e,he) +;function we(e){const n=e.regex,t=be,a={begin:/<[A-Za-z0-9\\._:-]+/, +end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,n)=>{ +const t=e[0].length+e.index,a=e.input[t] +;if("<"===a||","===a)return void n.ignoreMatch();let i +;">"===a&&(((e,{after:n})=>{const t="",k={ +match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(O)], +keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]} +;return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:i,exports:{ +PARAMS_CONTAINS:p,CLASS_REFERENCE:f},illegal:/#(?![$_A-z])/, +contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{ +label:"use_strict",className:"meta",relevance:10, +begin:/^\s*['"]use (strict|asm)['"]/ +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,d,g,u,{match:/\$\d+/},o,f,{ +className:"attr",begin:t+n.lookahead(":"),relevance:0},k,{ +begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*", +keywords:"return throw case",relevance:0,contains:[u,e.REGEXP_MODE,{ +className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{ +className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{ +className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0, +excludeEnd:!0,keywords:i,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/, +relevance:0},{variants:[{begin:"<>",end:""},{ +match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin, +"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{ +begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},E,{ +beginKeywords:"while if switch catch for"},{ +begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{", +returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:t, +className:"title.function"})]},{match:/\.\.\./,relevance:0},N,{match:"\\$"+t, +relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"}, +contains:[_]},y,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},h,v,{match:/\$[(.]/}]}} +const Ne=e=>m(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ve=["Protocol","Type"].map(Ne),Oe=["init","self"].map(Ne),ke=["Any","Self"],xe=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Me=["false","nil","true"],Se=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ae=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Ce=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Te=p(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Re=p(Te,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),De=m(Te,Re,"*"),Ie=p(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Le=p(Ie,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Be=m(Ie,Le,"*"),$e=m(/[A-Z]/,Le,"*"),ze=["autoclosure",m(/convention\(/,p("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",m(/objc\(/,Be,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Fe=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"] +;var Ue=Object.freeze({__proto__:null,grmr_bash:e=>{const n=e.regex,t={},a={ +begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]} +;Object.assign(t,{className:"variable",variants:[{ +begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const i={ +className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={ +begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/, +end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(s);const o={begin:/\$?\(\(/, +end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t] +},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10 +}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0, +contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{ +name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/, +keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"], +literal:["true","false"], +built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"] +},contains:[l,e.SHEBANG(),c,o,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},s,{ +className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},t]}}, +grmr_c:e=>{const n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}] +}),a="[a-zA-Z_]\\w*::",i="(decltype\\(auto\\)|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={ +className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{ +match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={ +className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0 +},d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={ +keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], +type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], +literal:"true false NULL", +built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" +},u=[l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],b={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:g,contains:u.concat([{begin:/\(/,end:/\)/,keywords:g, +contains:u.concat(["self"]),relevance:0}]),relevance:0},m={ +begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", +keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(c,{ +className:"title.function"})],relevance:0},{relevance:0,match:/,/},{ +className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0, +contains:[t,e.C_BLOCK_COMMENT_MODE,s,o,r,{begin:/\(/,end:/\)/,keywords:g, +relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,o,r]}] +},r,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:g, +disableAutodetect:!0,illegal:"=]/,contains:[{ +beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l, +strings:s,keywords:g}}},grmr_cpp:e=>{const n=e.regex,t=e.COMMENT("//","$",{ +contains:[{begin:/\\\n/}] +}),a="[a-zA-Z_]\\w*::",i="(?!struct)(decltype\\(auto\\)|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",r={ +className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{ +begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{ +begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)", +end:"'",illegal:"."},e.END_SAME_AS_BEGIN({ +begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},o={ +className:"number",variants:[{begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)" +},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{ +keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" +},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{ +className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},c={ +className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0 +},d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={ +type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"], +keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"], +literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"], +_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"] +},u={className:"function.dispatch",relevance:0,keywords:{ +_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"] +}, +begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/)) +},b=[u,l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],m={variants:[{begin:/=/,end:/;/},{ +begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], +keywords:g,contains:b.concat([{begin:/\(/,end:/\)/,keywords:g, +contains:b.concat(["self"]),relevance:0}]),relevance:0},p={className:"function", +begin:"("+i+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0, +keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)", +keywords:g,relevance:0},{begin:d,returnBegin:!0,contains:[c],relevance:0},{ +begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,o]},{ +relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g, +relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,s,o,r,{begin:/\(/,end:/\)/, +keywords:g,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,o,r]}] +},r,t,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++", +aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:g,illegal:"",keywords:g,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:g},{ +match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/], +className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const n={ +keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]), +built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"], +literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{ +begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{ +begin:"\\b(0b[01']+)"},{ +begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{ +begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" +}],relevance:0},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}] +},r=e.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/, +keywords:n},o=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/, +end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/ +},e.BACKSLASH_ESCAPE,o]},c={className:"string",begin:/\$@"/,end:'"',contains:[{ +begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/, +contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]}) +;s.contains=[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE], +o.contains=[d,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{ +illegal:/\n/})];const g={variants:[c,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},t] +},b=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={ +begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"], +keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0, +contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{ +begin:"\x3c!--|--\x3e"},{begin:""}]}] +}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#", +end:"$",keywords:{ +keyword:"if else elif endif define undef warning error line region endregion pragma checksum" +}},g,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/, +illegal:/[^\s:,]/,contains:[{beginKeywords:"where class" +},t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace", +relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/, +contains:[t,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta", +begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{ +className:"string",begin:/"/,end:/"/}]},{ +beginKeywords:"new return throw await else",relevance:0},{className:"function", +begin:"("+b+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{ +beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial", +relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0, +contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params", +begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0, +contains:[g,a,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},grmr_css:e=>{ +const n=e.regex,t=te(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{ +name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{ +keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"}, +contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/ +},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0 +},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0 +},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{ +begin:":("+re.join("|")+")"},{begin:":(:)?("+se.join("|")+")"}] +},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+oe.join("|")+")\\b"},{ +begin:/:/,end:/[;}{]/, +contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{ +begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri" +},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0, +excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]", +relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/ +},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{ +$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ie.join(" ")},contains:[{ +begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{ +className:"selector-tag",begin:"\\b("+ae.join("|")+")\\b"}]}},grmr_diff:e=>{ +const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{ +className:"meta",relevance:10, +match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/) +},{className:"comment",variants:[{ +begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/), +end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{ +className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/, +end:/$/}]}},grmr_go:e=>{const n={ +keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"], +type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"], +literal:["true","false","iota","nil"], +built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"] +};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{const n=e.regex;return{name:"GraphQL",aliases:["gql"], +case_insensitive:!0,disableAutodetect:!1,keywords:{ +keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"], +literal:["true","false","null"]}, +contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{ +scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation", +begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/, +end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{ +scope:"symbol",begin:n.concat(/[_A-Za-z][_0-9A-Za-z]*/,n.lookahead(/\s*:/)), +relevance:0}],illegal:[/[;<']/,/BEGIN/]}},grmr_ini:e=>{const n=e.regex,t={ +className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{ +begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/, +end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{ +begin:/\$\{(.*?)\}/}]},r={className:"literal", +begin:/\bon|off|true|false|yes|no\b/},s={className:"string", +contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{ +begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}] +},o={begin:/\[/,end:/\]/,contains:[a,r,i,s,t,"self"],relevance:0 +},l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{ +name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/, +contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{ +begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)), +className:"attr",starts:{end:/$/,contains:[a,o,r,i,s,t]}}]}},grmr_java:e=>{ +const n=e.regex,t="[\xc0-\u02b8a-zA-Z_$][\xc0-\u02b8a-zA-Z_$0-9]*",a=t+ue("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),i={ +keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"], +literal:["false","true","null"], +type:["char","boolean","long","float","int","byte","short","double"], +built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{ +begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0} +;return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/, +relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{ +begin:/import java\.[a-z]+\./,keywords:"import",relevance:2 +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/, +className:"string",contains:[e.BACKSLASH_ESCAPE] +},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{ +match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{ +1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{ +begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type", +3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword", +3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{ +beginKeywords:"new throw return else",relevance:0},{ +begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{ +2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/, +end:/\)/,keywords:i,relevance:0, +contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,ge,e.C_BLOCK_COMMENT_MODE] +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},ge,r]}},grmr_javascript:we, +grmr_json:e=>{const n=["true","false","null"],t={scope:"literal", +beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[{ +className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{ +match:/[{}[\],:]/,className:"punctuation",relevance:0 +},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE], +illegal:"\\S"}},grmr_kotlin:e=>{const n={ +keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual", +built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing", +literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@" +},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},i={ +className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},r={className:"string", +variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,a]},{begin:"'",end:"'", +illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/, +contains:[e.BACKSLASH_ESCAPE,i,a]}]};a.contains.push(r);const s={ +className:"meta", +begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?" +},o={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/, +end:/\)/,contains:[e.inherit(r,{className:"string"}),"self"]}] +},l=ge,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={ +variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/, +contains:[]}]},g=d;return g.variants[1].contains=[d],d.variants[1].contains=[g], +{name:"Kotlin",aliases:["kt","kts"],keywords:n, +contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag", +begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword", +begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol", +begin:/@\w+/}]}},t,s,o,{className:"function",beginKeywords:"fun",end:"[(]|$", +returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{ +begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0, +contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://, +keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/, +endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/, +endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0 +},e.C_LINE_COMMENT_MODE,c,s,o,r,e.C_NUMBER_MODE]},c]},{ +begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{ +3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0, +illegal:"extends implements",contains:[{ +beginKeywords:"public protected internal private constructor" +},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0, +excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/, +excludeBegin:!0,returnEnd:!0},s,o]},r,{className:"meta",begin:"^#!/usr/bin/env", +end:"$",illegal:"\n"},l]}},grmr_less:e=>{ +const n=te(e),t=le,a="([\\w-]+|@\\{[\\w-]+\\})",i=[],r=[],s=e=>({ +className:"string",begin:"~?"+e+".*?"+e}),o=(e,n,t)=>({className:e,begin:n, +relevance:t}),l={$pattern:/[a-z-]+/,keyword:"and or not only", +attribute:ie.join(" ")},c={begin:"\\(",end:"\\)",contains:r,keywords:l, +relevance:0} +;r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),n.CSS_NUMBER_MODE,{ +begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]", +excludeEnd:!0} +},n.HEXCOLOR,c,o("variable","@@?[\\w-]+",10),o("variable","@\\{[\\w-]+\\}"),o("built_in","~?`[^`]*?`"),{ +className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0 +},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const d=r.concat({ +begin:/\{/,end:/\}/,contains:i}),g={beginKeywords:"when",endsWithParent:!0, +contains:[{beginKeywords:"and not"}].concat(r)},u={begin:a+"\\s*:", +returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/ +},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+oe.join("|")+")\\b", +end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:r}}] +},b={className:"keyword", +begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b", +starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:r,relevance:0}},m={ +className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{ +begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:d}},p={variants:[{ +begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0, +returnEnd:!0,illegal:"[<='$\"]",relevance:0, +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,o("keyword","all\\b"),o("variable","@\\{[\\w-]+\\}"),{ +begin:"\\b("+ae.join("|")+")\\b",className:"selector-tag" +},n.CSS_NUMBER_MODE,o("selector-tag",a,0),o("selector-id","#"+a),o("selector-class","\\."+a,0),o("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{ +className:"selector-pseudo",begin:":("+re.join("|")+")"},{ +className:"selector-pseudo",begin:":(:)?("+se.join("|")+")"},{begin:/\(/, +end:/\)/,relevance:0,contains:d},{begin:"!important"},n.FUNCTION_DISPATCH]},_={ +begin:`[\\w-]+:(:)?(${t.join("|")})`,returnBegin:!0,contains:[p]} +;return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,m,_,u,p,g,n.FUNCTION_DISPATCH), +{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}}, +grmr_lua:e=>{const n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"] +},i=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",t,{contains:[a], +relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE, +literal:"true false nil", +keyword:"and break do else elseif end for goto if in local not or repeat return then until while", +built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove" +},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)", +contains:[e.inherit(e.TITLE_MODE,{ +begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params", +begin:"\\(",endsWithParent:!0,contains:i}].concat(i) +},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string", +begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{const n={ +className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{ +const n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={ +className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/, +contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}] +},r=e.inherit(i,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{ +className:"string"}),o=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={ +endsWithParent:!0,illegal:/`]+/}]}]}]};return{ +name:"HTML, XML", +aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"], +case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[i,o,s,r,{begin:/\[/,end:/\]/,contains:[{ +className:"meta",begin://,contains:[i,r,o,s]}]}] +},e.COMMENT(//,{relevance:10}),{begin://, +relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/, +relevance:10,contains:[o]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{ +end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag", +begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{ +end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{ +className:"tag",begin:/<>|<\/>/},{className:"tag", +begin:n.concat(//,/>/,/\s/)))), +end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{ +className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{ +className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]} +},grmr_markdown:e=>{const n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml", +relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{ +begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/, +relevance:2},{ +begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/), +relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{ +begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/ +},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0, +returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)", +excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[", +end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[], +variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}] +},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{ +begin:/_(?![_\s])/,end:/_/,relevance:0}]},r=e.inherit(a,{contains:[] +}),s=e.inherit(i,{contains:[]});a.contains.push(s),i.contains.push(r) +;let o=[n,t];return[a,i,r,s].forEach((e=>{e.contains=e.contains.concat(o) +})),o=o.concat(a,i),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{ +className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:o},{ +begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n", +contains:o}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)", +end:"\\s+",excludeEnd:!0},a,i,{className:"quote",begin:"^>\\s+",contains:o, +end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{ +begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{ +begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))", +contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{ +begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{ +className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{ +className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{ +const n=/[a-zA-Z@][a-zA-Z0-9_]*/,t={$pattern:n, +keyword:["@interface","@class","@protocol","@implementation"]};return{ +name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"], +keywords:{"variable.language":["this","super"],$pattern:n, +keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"], +literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"], +built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"], +type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"] +},illegal:"/,end:/$/,illegal:"\\n" +},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class", +begin:"("+t.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:t, +contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE, +relevance:0}]}},grmr_perl:e=>{const n=e.regex,t=/[dualxmsipngr]{0,12}/,a={ +$pattern:/[\w.]+/, +keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0" +},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},r={begin:/->\{/, +end:/\}/},s={variants:[{begin:/\$\d/},{ +begin:n.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])") +},{begin:/[$%@][^\s\w{]/,relevance:0}] +},o=[e.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,a,i="\\1")=>{ +const r="\\1"===i?i:n.concat(i,a) +;return n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,r,/(?:\\.|[^\\\/])*?/,i,t) +},d=(e,a,i)=>n.concat(n.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,i,t),g=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{ +endsWithParent:!0}),r,{className:"string",contains:o,variants:[{ +begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[", +end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{ +begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">", +relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'", +contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`", +contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{ +begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number", +begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", +relevance:0},{ +begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*", +keywords:"split return print reverse grep",relevance:0, +contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{ +begin:c("s|tr|y",n.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{ +begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{ +className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{ +begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",n.either(...l,{capture:!0 +}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{ +begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub", +end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{ +begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$", +subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}] +}];return i.contains=g,r.contains=g,{name:"Perl",aliases:["pl","pm"],keywords:a, +contains:g}},grmr_php:e=>{ +const n=e.regex,t=/(?![A-Za-z0-9])(?![$])/,a=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),r={ +scope:"variable",match:"\\$+"+a},s={scope:"subst",variants:[{begin:/\$\w+/},{ +begin:/\{\$/,end:/\}/}]},o=e.inherit(e.APOS_STRING_MODE,{illegal:null +}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{ +illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s) +}),o,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/, +contains:e.QUOTE_STRING_MODE.contains.concat(s)})]},d={scope:"number", +variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{ +begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{ +begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{ +begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?" +}],relevance:0 +},g=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],m={ +keyword:u,literal:(e=>{const n=[];return e.forEach((e=>{ +n.push(e),e.toLowerCase()===e?n.push(e.toUpperCase()):n.push(e.toLowerCase()) +})),n})(g),built_in:b},p=e=>e.map((e=>e.replace(/\|\d+$/,""))),_={variants:[{ +match:[/new/,n.concat(l,"+"),n.concat("(?!",p(b).join("\\b|"),"\\b)"),i],scope:{ +1:"keyword",4:"title.class"}}]},h=n.concat(a,"\\b(?!\\()"),f={variants:[{ +match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{2:"variable.constant" +}},{match:[/::/,/class/],scope:{2:"variable.language"}},{ +match:[i,n.concat(/::/,n.lookahead(/(?!class\b)/)),h],scope:{1:"title.class", +3:"variable.constant"}},{match:[i,n.concat("::",n.lookahead(/(?!class\b)/))], +scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class", +3:"variable.language"}}]},E={scope:"attr", +match:n.concat(a,n.lookahead(":"),n.lookahead(/(?!::)/))},y={relevance:0, +begin:/\(/,end:/\)/,keywords:m,contains:[E,r,f,e.C_BLOCK_COMMENT_MODE,c,d,_] +},w={relevance:0, +match:[/\b/,n.concat("(?!fn\\b|function\\b|",p(u).join("\\b|"),"|",p(b).join("\\b|"),"\\b)"),a,n.concat(l,"*"),n.lookahead(/(?=\()/)], +scope:{3:"title.function.invoke"},contains:[y]};y.contains.push(w) +;const N=[E,f,e.C_BLOCK_COMMENT_MODE,c,d,_];return{case_insensitive:!1, +keywords:m,contains:[{begin:n.concat(/#\[\s*/,i),beginScope:"meta",end:/]/, +endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{ +begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]}, +contains:["self",...N]},...N,{scope:"meta",match:i}] +},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{ +scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/, +keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE, +contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{ +begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{ +begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},r,w,f,{ +match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},_,{ +scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/, +excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use" +},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params", +begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:m, +contains:["self",r,f,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{ +beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait", +illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{ +beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{ +beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/, +contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{ +beginKeywords:"use",relevance:0,end:";",contains:[{ +match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]} +},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{ +begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*", +end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0 +},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null, +skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null, +contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text", +aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{ +const n=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],i={ +$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a, +built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"], +literal:["__debug__","Ellipsis","False","None","NotImplemented","True"], +type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"] +},r={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/, +end:/\}/,keywords:i,illegal:/#/},o={begin:/\{\{/,relevance:0},l={ +className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/, +contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{ +begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/, +contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/, +end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,o,s]},{begin:/([uU]|[rR])'/,end:/'/, +relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{ +begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/, +end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/, +contains:[e.BACKSLASH_ESCAPE,o,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/, +contains:[e.BACKSLASH_ESCAPE,o,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE] +},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,g="\\b|"+a.join("|"),u={ +className:"number",relevance:0,variants:[{ +begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${g})`},{begin:`(${d})[jJ]?`},{ +begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{ +begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})` +},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${c})[jJ](?=${g})` +}]},b={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:i, +contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={ +className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/, +end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i, +contains:["self",r,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,r],{ +name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i, +illegal:/(<\/|->|\?)|=>/,contains:[r,u,{begin:/\bself\b/},{beginKeywords:"if", +relevance:0},l,b,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{ +1:"keyword",3:"title.function"},contains:[m]},{variants:[{ +match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}], +scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{ +className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,m,l]}]}}, +grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta.prompt", +starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{ +begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{ +const n=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/) +;return{name:"R",keywords:{$pattern:t, +keyword:"function if in break next repeat else for while", +literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10", +built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm" +},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/, +starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)), +endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{ +scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0 +}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}] +}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE], +variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/ +}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"', +relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{ +1:"operator",2:"number"},match:[i,a]},{scope:{1:"operator",2:"number"}, +match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[r,a]},{scope:{ +2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"}, +match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{ +match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`", +contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{ +const n=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=n.concat(a,/(::\w+)*/),r={ +"variable.constant":["__FILE__","__LINE__","__ENCODING__"], +"variable.language":["self","super"], +keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"], +built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"], +literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},o={ +begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s] +}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10 +}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/, +end:/\}/,keywords:r},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c], +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{ +begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{ +begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//, +end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{ +begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{ +begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{ +begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{ +begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{ +begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)), +contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/, +contains:[e.BACKSLASH_ESCAPE,c]})]}]},g="[0-9](_?[0-9])*",u={className:"number", +relevance:0,variants:[{ +begin:`\\b([1-9](_?[0-9])*|0)(\\.(${g}))?([eE][+-]?(${g})|r)?i?\\b`},{ +begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b" +},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{ +begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{ +begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{ +className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0, +keywords:r}]},m=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{ +match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class", +4:"title.class.inherited"},keywords:r},{match:[/(include|extend)\s+/,i],scope:{ +2:"title.class"},keywords:r},{relevance:0,match:[i,/\.new[. (]/],scope:{ +1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/, +className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{ +match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[b]},{ +begin:e.IDENT_RE+"::"},{className:"symbol", +begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol", +begin:":(?!\\s)",contains:[d,{begin:t}],relevance:0},u,{className:"variable", +begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{ +className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0, +relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*", +keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c], +illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{ +begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[", +end:"\\][a-z]*"}]}].concat(o,l),relevance:0}].concat(o,l) +;c.contains=m,b.contains=m;const p=[{begin:/^\s*=>/,starts:{end:"$",contains:m} +},{className:"meta.prompt", +begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])", +starts:{end:"$",keywords:r,contains:m}}];return l.unshift(o),{name:"Ruby", +aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/, +contains:[e.SHEBANG({binary:"ruby"})].concat(p).concat(l).concat(m)}}, +grmr_rust:e=>{const n=e.regex,t={className:"title.function.invoke",relevance:0, +begin:n.concat(/\b/,/(?!let\b)/,e.IDENT_RE,n.lookahead(/\s*\(/)) +},a="([ui](8|16|32|64|128|size)|f(32|64))?",i=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],r=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"] +;return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:r, +keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"], +literal:["true","false","Some","None","Ok","Err"],built_in:i},illegal:""},t]}}, +grmr_scss:e=>{const n=te(e),t=se,a=re,i="@[a-z-]+",r={className:"variable", +begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS", +case_insensitive:!0,illegal:"[=/|']", +contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{ +className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{ +className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0 +},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag", +begin:"\\b("+ae.join("|")+")\\b",relevance:0},{className:"selector-pseudo", +begin:":("+a.join("|")+")"},{className:"selector-pseudo", +begin:":(:)?("+t.join("|")+")"},r,{begin:/\(/,end:/\)/, +contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute", +begin:"\\b("+oe.join("|")+")\\b"},{ +begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" +},{begin:/:/,end:/[;}{]/,relevance:0, +contains:[n.BLOCK_COMMENT,r,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH] +},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{ +begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/, +keyword:"and or not only",attribute:ie.join(" ")},contains:[{begin:i, +className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute" +},r,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE] +},n.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session", +aliases:["console","shellsession"],contains:[{className:"meta.prompt", +begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/, +subLanguage:"bash"}}]}),grmr_sql:e=>{ +const n=e.regex,t=e.COMMENT("--","$"),a=["true","false","unknown"],i=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],r=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],o=r,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!r.includes(e))),c={ +begin:n.concat(/\b/,n.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}} +;return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{ +$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:n,when:t}={})=>{const a=t +;return n=n||[],e.map((e=>e.match(/\|\d+$/)||n.includes(e)?e:a(e)?e+"|0":e)) +})(l,{when:e=>e.length<3}),literal:a,type:i, +built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"] +},contains:[{begin:n.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/, +keyword:l.concat(s),literal:a,type:i}},{className:"type", +begin:n.either("double precision","large object","with timezone","without timezone") +},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{ +begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{ +begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{className:"operator", +begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}, +grmr_swift:e=>{const n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{ +contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,t],i={match:[/\./,p(...ve,...Oe)], +className:{2:"keyword"}},r={match:m(/\./,p(...xe)),relevance:0 +},s=xe.filter((e=>"string"==typeof e)).concat(["_|0"]),o={variants:[{ +className:"keyword", +match:p(...xe.filter((e=>"string"!=typeof e)).concat(ke).map(Ne),...Oe)}]},l={ +$pattern:p(/\b\w+/,/#\w+/),keyword:s.concat(Ae),literal:Me},c=[i,r,o],d=[{ +match:m(/\./,p(...Ce)),relevance:0},{className:"built_in", +match:m(/\b/,p(...Ce),/(?=\()/)}],u={match:/->/,relevance:0},b=[u,{ +className:"operator",relevance:0,variants:[{match:De},{match:`\\.(\\.|${Re})+`}] +}],_="([0-9a-fA-F]_*)+",h={className:"number",relevance:0,variants:[{ +match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{ +match:`\\b0x(${_})(\\.(${_}))?([pP][+-]?(([0-9]_*)+))?\\b`},{ +match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},f=(e="")=>({ +className:"subst",variants:[{match:m(/\\/,e,/[0\\tnr"']/)},{ +match:m(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),E=(e="")=>({className:"subst", +match:m(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst", +label:"interpol",begin:m(/\\/,e,/\(/),end:/\)/}),w=(e="")=>({begin:m(e,/"""/), +end:m(/"""/,e),contains:[f(e),E(e),y(e)]}),N=(e="")=>({begin:m(e,/"/), +end:m(/"/,e),contains:[f(e),y(e)]}),v={className:"string", +variants:[w(),w("#"),w("##"),w("###"),N(),N("#"),N("##"),N("###")]},O={ +match:m(/`/,Be,/`/)},k=[O,{className:"variable",match:/\$\d+/},{ +className:"variable",match:`\\$${Le}+`}],x=[{match:/(@|#(un)?)available/, +className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Fe, +contains:[...b,h,v]}]}},{className:"keyword",match:m(/@/,p(...ze))},{ +className:"meta",match:m(/@/,Be)}],M={match:g(/\b[A-Z]/),relevance:0,contains:[{ +className:"type", +match:m(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Le,"+") +},{className:"type",match:$e,relevance:0},{match:/[?!]+/,relevance:0},{ +match:/\.\.\./,relevance:0},{match:m(/\s+&\s+/,g($e)),relevance:0}]},S={ +begin://,keywords:l,contains:[...a,...c,...x,u,M]};M.contains.push(S) +;const A={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{ +match:m(Be,/\s*:/),keywords:"_|0",relevance:0 +},...a,...c,...d,...b,h,v,...k,...x,M]},C={begin://,contains:[...a,M] +},T={begin:/\(/,end:/\)/,keywords:l,contains:[{ +begin:p(g(m(Be,/\s*:/)),g(m(Be,/\s+/,Be,/\s*:/))),end:/:/,relevance:0, +contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Be}] +},...a,...c,...b,h,v,...x,M,A],endsParent:!0,illegal:/["']/},R={ +match:[/func/,/\s+/,p(O.match,Be,De)],className:{1:"keyword",3:"title.function" +},contains:[C,T,n],illegal:[/\[/,/%/]},D={ +match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"}, +contains:[C,T,n],illegal:/\[|%/},I={match:[/operator/,/\s+/,De],className:{ +1:"keyword",3:"title"}},L={begin:[/precedencegroup/,/\s+/,$e],className:{ +1:"keyword",3:"title"},contains:[M],keywords:[...Se,...Me],end:/}/} +;for(const e of v.variants){const n=e.contains.find((e=>"interpol"===e.label)) +;n.keywords=l;const t=[...c,...d,...b,h,v,...k];n.contains=[...t,{begin:/\(/, +end:/\)/,contains:["self",...t]}]}return{name:"Swift",keywords:l, +contains:[...a,R,D,{beginKeywords:"struct protocol class extension enum actor", +end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{ +className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c] +},I,L,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0 +},...c,...d,...b,h,v,...k,...x,M,A]}},grmr_typescript:e=>{ +const n=we(e),t=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={ +beginKeywords:"namespace",end:/\{/,excludeEnd:!0, +contains:[n.exports.CLASS_REFERENCE]},i={beginKeywords:"interface",end:/\{/, +excludeEnd:!0,keywords:{keyword:"interface extends",built_in:t}, +contains:[n.exports.CLASS_REFERENCE]},r={$pattern:be, +keyword:me.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]), +literal:pe,built_in:ye.concat(t),"variable.language":Ee},s={className:"meta", +begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},o=(e,n,t)=>{ +const a=e.contains.findIndex((e=>e.label===n)) +;if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,t)} +;return Object.assign(n.keywords,r), +n.exports.PARAMS_CONTAINS.push(s),n.contains=n.contains.concat([s,a,i]), +o(n,"shebang",e.SHEBANG()),o(n,"use_strict",{className:"meta",relevance:10, +begin:/^\s*['"]use strict['"]/ +}),n.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(n,{ +name:"TypeScript",aliases:["ts","tsx"]}),n},grmr_vbnet:e=>{ +const n=e.regex,t=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,s={ +className:"literal",variants:[{begin:n.concat(/# */,n.either(a,t),/ *#/)},{ +begin:n.concat(/# */,r,/ *#/)},{begin:n.concat(/# */,i,/ *#/)},{ +begin:n.concat(/# */,n.either(a,t),/ +/,n.either(i,r),/ *#/)}] +},o=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}] +}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]}) +;return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0, +classNameAliases:{label:"symbol"},keywords:{ +keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield", +built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort", +type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort", +literal:"true false nothing"}, +illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{ +className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/, +end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0, +variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/ +},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{ +begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{ +className:"label",begin:/^\w+:/},o,l,{className:"meta", +begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/, +end:/$/,keywords:{ +keyword:"const disable else elseif enable end externalsource if region then"}, +contains:[l]}]}},grmr_wasm:e=>{e.regex;const n=e.COMMENT(/\(;/,/;\)/) +;return n.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/, +keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"] +},contains:[e.COMMENT(/;;/,/$/),n,{match:[/(?:offset|align)/,/\s*/,/=/], +className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{ +match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{ +begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword", +3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/, +className:"type"},{className:"keyword", +match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/ +},{className:"number",relevance:0, +match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/ +}]}},grmr_yaml:e=>{ +const n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={ +className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/ +},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable", +variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(a,{ +variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),r={ +end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},s={begin:/\{/, +end:/\}/,contains:[r],illegal:"\\n",relevance:0},o={begin:"\\[",end:"\\]", +contains:[r],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{ +begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{ +begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$", +relevance:10},{className:"string", +begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{ +begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0, +relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type", +begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t +},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta", +begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)", +relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{ +className:"number", +begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b" +},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},s,o,a],c=[...l] +;return c.pop(),c.push(i),r.contains=c,{name:"YAML",case_insensitive:!0, +aliases:["yml"],contains:l}}});const je=ne;for(const e of Object.keys(Ue)){ +const n=e.replace("grmr_","").replace("_","-");je.registerLanguage(n,Ue[e])} +return je}() +;"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); \ No newline at end of file diff --git a/media/vendor/marked.min.js b/media/vendor/marked.min.js new file mode 100644 index 0000000..06377f6 --- /dev/null +++ b/media/vendor/marked.min.js @@ -0,0 +1,6 @@ +/** + * marked v4.2.12 - a markdown parser + * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed) + * https://github.com/markedjs/marked + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,function(r){"use strict";function i(e,t){for(var u=0;ue.length)&&(t=e.length);for(var u=0,n=new Array(t);u=e.length?{done:!0}:{done:!1,value:e[u++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}r.defaults=e();function u(e){return t[e]}var n=/[&<>"']/,l=new RegExp(n.source,"g"),a=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,o=new RegExp(a.source,"g"),t={"&":"&","<":"<",">":">",'"':""","'":"'"};function c(e,t){if(t){if(n.test(e))return e.replace(l,u)}else if(a.test(e))return e.replace(o,u);return e}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function x(e){return e.replace(h,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}var p=/(^|[^\[])\^/g;function f(u,e){u="string"==typeof u?u:u.source,e=e||"";var n={replace:function(e,t){return t=(t=t.source||t).replace(p,"$1"),u=u.replace(e,t),n},getRegex:function(){return new RegExp(u,e)}};return n}var g=/[^\w:]/g,Z=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function F(e,t,u){if(e){try{n=decodeURIComponent(x(u)).replace(g,"").toLowerCase()}catch(e){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}var n;t&&!Z.test(u)&&(e=u,A[" "+(n=t)]||(q.test(n)?A[" "+n]=n+"/":A[" "+n]=E(n,"/",!0)),t=-1===(n=A[" "+n]).indexOf(":"),u="//"===e.substring(0,2)?t?e:n.replace(O,"$1")+e:"/"===e.charAt(0)?t?e:n.replace(j,"$1")+e:n+e);try{u=encodeURI(u).replace(/%25/g,"%")}catch(e){return null}return u}var A={},q=/^[^:]+:\/*[^/]*$/,O=/^([^:]+:)[\s\S]*$/,j=/^([^:]+:\/*[^/]*)[\s\S]*$/;var d={exec:function(){}};function C(e){for(var t,u,n=1;nt)u.splice(t);else for(;u.length>=1,e+=e;return u+e}function B(e,t,u,n){var r=t.href,t=t.title?c(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?(n.state.inLink=!0,e={type:"link",raw:u,href:r,title:t,text:i,tokens:n.inlineTokens(i)},n.state.inLink=!1,e):{type:"image",raw:u,href:r,title:t,text:c(i)}}var w=function(){function e(e){this.options=e||r.defaults}var t=e.prototype;return t.space=function(e){e=this.rules.block.newline.exec(e);if(e&&0=r.length?e.slice(r.length):e}).join("\n")),{type:"code",raw:t,lang:e[2]&&e[2].trim().replace(this.rules.inline._escapes,"$1"),text:u}},t.heading=function(e){var t,u,e=this.rules.block.heading.exec(e);if(e)return t=e[2].trim(),/#$/.test(t)&&(u=E(t,"#"),!this.options.pedantic&&u&&!/ $/.test(u)||(t=u.trim())),{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}},t.hr=function(e){e=this.rules.block.hr.exec(e);if(e)return{type:"hr",raw:e[0]}},t.blockquote=function(e){var t,u,n,e=this.rules.block.blockquote.exec(e);if(e)return t=e[0].replace(/^ *>[ \t]?/gm,""),u=this.lexer.state.top,this.lexer.state.top=!0,n=this.lexer.blockTokens(t),this.lexer.state.top=u,{type:"blockquote",raw:e[0],tokens:n,text:t}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var u,n,r,i,s,l,a,o,D,c,h,p=1<(g=t[1].trim()).length,f={type:"list",raw:"",ordered:p,start:p?+g.slice(0,-1):"",loose:!1,items:[]},g=p?"\\d{1,9}\\"+g.slice(-1):"\\"+g;this.options.pedantic&&(g=p?g:"[*+-]");for(var F=new RegExp("^( {0,3}"+g+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(h=!1,t=F.exec(e))&&!this.rules.block.hr.test(e);){if(u=t[0],e=e.substring(u.length),a=t[2].split("\n",1)[0].replace(/^\t+/,function(e){return" ".repeat(3*e.length)}),o=e.split("\n",1)[0],this.options.pedantic?(i=2,c=a.trimLeft()):(i=t[2].search(/[^ ]/),c=a.slice(i=4=i||!o.trim())c+="\n"+o.slice(i);else{if(s)break;if(4<=a.search(/[^ ]/))break;if(C.test(a))break;if(k.test(a))break;if(d.test(a))break;c+="\n"+o}s||o.trim()||(s=!0),u+=D+"\n",e=e.substring(D.length+1),a=o.slice(i)}f.loose||(l?f.loose=!0:/\n *\n *$/.test(u)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(c))&&(r="[ ] "!==n[0],c=c.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:u,task:!!n,checked:r,loose:!1,text:c}),f.raw+=u}f.items[f.items.length-1].raw=u.trimRight(),f.items[f.items.length-1].text=c.trimRight(),f.raw=f.raw.trimRight();for(var E,x=f.items.length,m=0;m$/,"$1").replace(this.rules.inline._escapes,"$1"):"",n=e[3]&&e[3].substring(1,e[3].length-1).replace(this.rules.inline._escapes,"$1"),{type:"def",tag:t,raw:e[0],href:u,title:n}},t.table=function(e){e=this.rules.block.table.exec(e);if(e){var t={type:"table",header:k(e[1]).map(function(e){return{text:e}}),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(t.header.length===t.align.length){t.raw=e[0];for(var u,n,r,i=t.align.length,s=0;s/i.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):c(e[0]):e[0]}},t.link=function(e){e=this.rules.inline.link.exec(e);if(e){var t=e[2].trim();if(!this.options.pedantic&&/^$/.test(t))return;var u=E(t.slice(0,-1),"\\");if((t.length-u.length)%2==0)return}else{u=function(e,t){if(-1!==e.indexOf(t[1]))for(var u=e.length,n=0,r=0;r$/.test(t)?u.slice(1):u.slice(1,-1):u)&&u.replace(this.rules.inline._escapes,"$1"),title:r&&r.replace(this.rules.inline._escapes,"$1")},e[0],this.lexer)}},t.reflink=function(e,t){var u;if(u=(u=this.rules.inline.reflink.exec(e))||this.rules.inline.nolink.exec(e))return(e=t[(e=(u[2]||u[1]).replace(/\s+/g," ")).toLowerCase()])?B(u,e,u[0],this.lexer):{type:"text",raw:t=u[0].charAt(0),text:t}},t.emStrong=function(e,t,u){void 0===u&&(u="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!u.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var r=n[1]||n[2]||"";if(!r||""===u||this.rules.inline.punctuation.exec(u)){var i=n[0].length-1,s=i,l=0,a="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=a.exec(t));){var o,D=n[1]||n[2]||n[3]||n[4]||n[5]||n[6];if(D)if(o=D.length,n[3]||n[4])s+=o;else if((n[5]||n[6])&&i%3&&!((i+o)%3))l+=o;else if(!(0<(s-=o)))return o=Math.min(o,o+s+l),D=e.slice(0,i+n.index+(n[0].length-D.length)+o),Math.min(i,o)%2?(o=D.slice(1,-1),{type:"em",raw:D,text:o,tokens:this.lexer.inlineTokens(o)}):(o=D.slice(2,-2),{type:"strong",raw:D,text:o,tokens:this.lexer.inlineTokens(o)})}}}},t.codespan=function(e){var t,u,n,e=this.rules.inline.code.exec(e);if(e)return n=e[2].replace(/\n/g," "),t=/[^ ]/.test(n),u=/^ /.test(n)&&/ $/.test(n),n=c(n=t&&u?n.substring(1,n.length-1):n,!0),{type:"codespan",raw:e[0],text:n}},t.br=function(e){e=this.rules.inline.br.exec(e);if(e)return{type:"br",raw:e[0]}},t.del=function(e){e=this.rules.inline.del.exec(e);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}},t.autolink=function(e,t){var u,e=this.rules.inline.autolink.exec(e);if(e)return t="@"===e[2]?"mailto:"+(u=c(this.options.mangle?t(e[1]):e[1])):u=c(e[1]),{type:"link",raw:e[0],text:u,href:t,tokens:[{type:"text",raw:u,text:u}]}},t.url=function(e,t){var u,n,r,i;if(u=this.rules.inline.url.exec(e)){if("@"===u[2])r="mailto:"+(n=c(this.options.mangle?t(u[0]):u[0]));else{for(;i=u[0],u[0]=this.rules.inline._backpedal.exec(u[0])[0],i!==u[0];);n=c(u[0]),r="www."===u[1]?"http://"+u[0]:u[0]}return{type:"link",raw:u[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}},t.inlineText=function(e,t){e=this.rules.inline.text.exec(e);if(e)return t=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):c(e[0]):e[0]:c(this.options.smartypants?t(e[0]):e[0]),{type:"text",raw:e[0],text:t}},e}(),y={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:d,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/},v=(y.def=f(y.def).replace("label",y._label).replace("title",y._title).getRegex(),y.bullet=/(?:[*+-]|\d{1,9}[.)])/,y.listItemStart=f(/^( *)(bull) */).replace("bull",y.bullet).getRegex(),y.list=f(y.list).replace(/bull/g,y.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+y.def.source+")").getRegex(),y._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",y._comment=/|$)/,y.html=f(y.html,"i").replace("comment",y._comment).replace("tag",y._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),y.paragraph=f(y._paragraph).replace("hr",y.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",y._tag).getRegex(),y.blockquote=f(y.blockquote).replace("paragraph",y.paragraph).getRegex(),y.normal=C({},y),y.gfm=C({},y.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),y.gfm.table=f(y.gfm.table).replace("hr",y.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",y._tag).getRegex(),y.gfm.paragraph=f(y._paragraph).replace("hr",y.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",y.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",y._tag).getRegex(),y.pedantic=C({},y.normal,{html:f("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",y._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:d,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(y.normal._paragraph).replace("hr",y.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",y.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()}),{escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:d,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:d,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",v.punctuation=f(v.punctuation).replace(/punctuation/g,v._punctuation).getRegex(),v.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,v.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,v._comment=f(y._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),v.emStrong.lDelim=f(v.emStrong.lDelim).replace(/punct/g,v._punctuation).getRegex(),v.emStrong.rDelimAst=f(v.emStrong.rDelimAst,"g").replace(/punct/g,v._punctuation).getRegex(),v.emStrong.rDelimUnd=f(v.emStrong.rDelimUnd,"g").replace(/punct/g,v._punctuation).getRegex(),v._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,v._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,v._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,v.autolink=f(v.autolink).replace("scheme",v._scheme).replace("email",v._email).getRegex(),v._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,v.tag=f(v.tag).replace("comment",v._comment).replace("attribute",v._attribute).getRegex(),v._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,v._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,v._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,v.link=f(v.link).replace("label",v._label).replace("href",v._href).replace("title",v._title).getRegex(),v.reflink=f(v.reflink).replace("label",v._label).replace("ref",y._label).getRegex(),v.nolink=f(v.nolink).replace("ref",y._label).getRegex(),v.reflinkSearch=f(v.reflinkSearch,"g").replace("reflink",v.reflink).replace("nolink",v.nolink).getRegex(),v.normal=C({},v),v.pedantic=C({},v.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",v._label).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",v._label).getRegex()}),v.gfm=C({},v.normal,{escape:f(v.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\'+(u?e:c(e,!0))+"\n":"
"+(u?e:c(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,u){var n=t?"ol":"ul";return"<"+n+(t&&1!==u?' start="'+u+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return"\n\n"+e+"\n"+(t=t&&""+t+"")+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var u=t.header?"th":"td";return(t.align?"<"+u+' align="'+t.align+'">':"<"+u+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,u){return null===(e=F(this.options.sanitize,this.options.baseUrl,e))?u:(e='"+u+"")},t.image=function(e,t,u){return null===(e=F(this.options.sanitize,this.options.baseUrl,e))?u:(e=''+u+'":">"))},t.text=function(e){return e},e}(),S=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,u){return""+u},t.image=function(e,t,u){return""+u},t.br=function(){return""},e}(),T=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var u=e,n=0;if(this.seen.hasOwnProperty(u))for(n=this.seen[e];u=e+"-"+ ++n,this.seen.hasOwnProperty(u););return t||(this.seen[e]=n,this.seen[u]=0),u},t.slug=function(e,t){void 0===t&&(t={});e=this.serialize(e);return this.getNextSafeSlug(e,t.dryrun)},e}(),R=function(){function u(e){this.options=e||r.defaults,this.options.renderer=this.options.renderer||new $,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new S,this.slugger=new T}u.parse=function(e,t){return new u(t).parse(e)},u.parseInline=function(e,t){return new u(t).parseInline(e)};var e=u.prototype;return e.parse=function(e,t){void 0===t&&(t=!0);for(var u,n,r,i,s,l,a,o,D,c,h,p,f,g,F,A,d="",C=e.length,k=0;kAn error occurred:

    "+c(e.message+"",!0)+"
    ";throw e}try{var a=z.lex(e,u);if(u.walkTokens){if(u.async)return Promise.all(I.walkTokens(a,u.walkTokens)).then(function(){return R.parse(a,u)}).catch(t);I.walkTokens(a,u.walkTokens)}return R.parse(a,u)}catch(e){t(e)}}I.options=I.setOptions=function(e){return C(I.defaults,e),e=I.defaults,r.defaults=e,I},I.getDefaults=e,I.defaults=r.defaults,I.use=function(){for(var o=I.defaults.extensions||{renderers:{},childTokens:{}},e=arguments.length,t=new Array(e),u=0;uAn error occurred:

    "+c(e.message+"",!0)+"
    ";throw e}},I.Parser=R,I.parser=R.parse,I.Renderer=$,I.TextRenderer=S,I.Lexer=z,I.lexer=z.lex,I.Tokenizer=w,I.Slugger=T;var d=(I.parse=I).options,P=I.setOptions,Q=I.use,U=I.walkTokens,M=I.parseInline,N=I,X=R.parse,G=z.lex;r.Lexer=z,r.Parser=R,r.Renderer=$,r.Slugger=T,r.TextRenderer=S,r.Tokenizer=w,r.getDefaults=e,r.lexer=G,r.marked=I,r.options=d,r.parse=N,r.parseInline=M,r.parser=X,r.setOptions=P,r.use=Q,r.walkTokens=U}); \ No newline at end of file diff --git a/media/vendor/tailwindcss.3.2.4.min.js b/media/vendor/tailwindcss.3.2.4.min.js new file mode 100644 index 0000000..f421db2 --- /dev/null +++ b/media/vendor/tailwindcss.3.2.4.min.js @@ -0,0 +1,63 @@ +(()=>{var Pw=Object.create;var ii=Object.defineProperty;var Dw=Object.getOwnPropertyDescriptor;var qw=Object.getOwnPropertyNames;var Iw=Object.getPrototypeOf,Rw=Object.prototype.hasOwnProperty;var Ml=r=>ii(r,"__esModule",{value:!0});var Fn=r=>{if(typeof require!="undefined")return require(r);throw new Error('Dynamic require of "'+r+'" is not supported')};var A=(r,e)=>()=>(r&&(e=r(r=0)),e);var v=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Ce=(r,e)=>{Ml(r);for(var t in e)ii(r,t,{get:e[t],enumerable:!0})},Mw=(r,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qw(e))!Rw.call(r,i)&&i!=="default"&&ii(r,i,{get:()=>e[i],enumerable:!(t=Dw(e,i))||t.enumerable});return r},J=r=>Mw(Ml(ii(r!=null?Pw(Iw(r)):{},"default",r&&r.__esModule&&"default"in r?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var m,l=A(()=>{m={platform:"",env:{},versions:{node:"14.17.6"}}});var Fw,ae,Ge=A(()=>{l();Fw=0,ae={readFileSync:r=>self[r]||"",statSync:()=>({mtimeMs:Fw++})}});var Nn=v((kO,Nl)=>{l();"use strict";var Fl=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){if(this.cache.set(e,t),this._size++,this._size>=this.maxSize){if(this._size=0,typeof this.onEviction=="function")for(let[i,n]of this.oldCache.entries())this.onEviction(i,n);this.oldCache=this.cache,this.cache=new Map}}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){let t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){let t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(let[e]of this)yield e}*values(){for(let[,e]of this)yield e}*[Symbol.iterator](){for(let e of this.cache)yield e;for(let e of this.oldCache){let[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(let t of this.oldCache.keys())this.cache.has(t)||e++;return Math.min(this._size+e,this.maxSize)}};Nl.exports=Fl});var Ll,Bl=A(()=>{l();Ll=r=>r&&r._hash});function ni(r){return Ll(r,{ignoreUnknown:!0})}var $l=A(()=>{l();Bl()});var zl={};Ce(zl,{default:()=>ie});var ie,lt=A(()=>{l();ie={resolve:r=>r,extname:r=>"."+r.split(".").pop()}});var yt,si=A(()=>{l();yt={}});function jl(r){let e=ae.readFileSync(r,"utf-8"),t=yt(e);return{file:r,requires:t}}function Ln(r){let t=[jl(r)];for(let i of t)i.requires.filter(n=>n.startsWith("./")||n.startsWith("../")).forEach(n=>{try{let s=ie.dirname(i.file),a=yt.sync(n,{basedir:s}),o=jl(a);t.push(o)}catch(s){}});return t}var Vl=A(()=>{l();Ge();lt();si();si()});function ut(r){if(r=`${r}`,r==="0")return"0";if(/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(r))return r.replace(/^[+-]?/,t=>t==="-"?"":"-");let e=["var","calc","min","max","clamp"];for(let t of e)if(r.includes(`${t}(`))return`calc(${r} * -1)`}var ai=A(()=>{l()});var Ul,Wl=A(()=>{l();Ul=["preflight","container","accessibility","pointerEvents","visibility","position","inset","isolation","zIndex","order","gridColumn","gridColumnStart","gridColumnEnd","gridRow","gridRowStart","gridRowEnd","float","clear","margin","boxSizing","display","aspectRatio","height","maxHeight","minHeight","width","minWidth","maxWidth","flex","flexShrink","flexGrow","flexBasis","tableLayout","borderCollapse","borderSpacing","transformOrigin","translate","rotate","skew","scale","transform","animation","cursor","touchAction","userSelect","resize","scrollSnapType","scrollSnapAlign","scrollSnapStop","scrollMargin","scrollPadding","listStylePosition","listStyleType","appearance","columns","breakBefore","breakInside","breakAfter","gridAutoColumns","gridAutoFlow","gridAutoRows","gridTemplateColumns","gridTemplateRows","flexDirection","flexWrap","placeContent","placeItems","alignContent","alignItems","justifyContent","justifyItems","gap","space","divideWidth","divideStyle","divideColor","divideOpacity","placeSelf","alignSelf","justifySelf","overflow","overscrollBehavior","scrollBehavior","textOverflow","whitespace","wordBreak","borderRadius","borderWidth","borderStyle","borderColor","borderOpacity","backgroundColor","backgroundOpacity","backgroundImage","gradientColorStops","boxDecorationBreak","backgroundSize","backgroundAttachment","backgroundClip","backgroundPosition","backgroundRepeat","backgroundOrigin","fill","stroke","strokeWidth","objectFit","objectPosition","padding","textAlign","textIndent","verticalAlign","fontFamily","fontSize","fontWeight","textTransform","fontStyle","fontVariantNumeric","lineHeight","letterSpacing","textColor","textOpacity","textDecoration","textDecorationColor","textDecorationStyle","textDecorationThickness","textUnderlineOffset","fontSmoothing","placeholderColor","placeholderOpacity","caretColor","accentColor","opacity","backgroundBlendMode","mixBlendMode","boxShadow","boxShadowColor","outlineStyle","outlineWidth","outlineOffset","outlineColor","ringWidth","ringColor","ringOpacity","ringOffsetWidth","ringOffsetColor","blur","brightness","contrast","dropShadow","grayscale","hueRotate","invert","saturate","sepia","filter","backdropBlur","backdropBrightness","backdropContrast","backdropGrayscale","backdropHueRotate","backdropInvert","backdropOpacity","backdropSaturate","backdropSepia","backdropFilter","transitionProperty","transitionDelay","transitionDuration","transitionTimingFunction","willChange","content"]});function Gl(r,e){return r===void 0?e:Array.isArray(r)?r:[...new Set(e.filter(i=>r!==!1&&r[i]!==!1).concat(Object.keys(r).filter(i=>r[i]!==!1)))]}var Hl=A(()=>{l()});var Zt=v((MO,Yl)=>{l();Yl.exports={content:[],presets:[],darkMode:"media",theme:{screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},supports:{},colors:({colors:r})=>({inherit:r.inherit,current:r.current,transparent:r.transparent,black:r.black,white:r.white,slate:r.slate,gray:r.gray,zinc:r.zinc,neutral:r.neutral,stone:r.stone,red:r.red,orange:r.orange,amber:r.amber,yellow:r.yellow,lime:r.lime,green:r.green,emerald:r.emerald,teal:r.teal,cyan:r.cyan,sky:r.sky,blue:r.blue,indigo:r.indigo,violet:r.violet,purple:r.purple,fuchsia:r.fuchsia,pink:r.pink,rose:r.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:r})=>r("blur"),backdropBrightness:({theme:r})=>r("brightness"),backdropContrast:({theme:r})=>r("contrast"),backdropGrayscale:({theme:r})=>r("grayscale"),backdropHueRotate:({theme:r})=>r("hueRotate"),backdropInvert:({theme:r})=>r("invert"),backdropOpacity:({theme:r})=>r("opacity"),backdropSaturate:({theme:r})=>r("saturate"),backdropSepia:({theme:r})=>r("sepia"),backgroundColor:({theme:r})=>r("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:r})=>r("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},borderColor:({theme:r})=>({...r("colors"),DEFAULT:r("colors.gray.200","currentColor")}),borderOpacity:({theme:r})=>r("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:r})=>({...r("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:r})=>r("colors"),caretColor:({theme:r})=>r("colors"),accentColor:({theme:r})=>({...r("colors"),auto:"auto"}),contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},container:{},content:{none:"none"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:r})=>r("borderColor"),divideOpacity:({theme:r})=>r("borderOpacity"),divideWidth:({theme:r})=>r("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:r})=>({none:"none",...r("colors")}),grayscale:{0:"0",DEFAULT:"100%"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{0:"0",DEFAULT:"100%"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:r})=>({auto:"auto",...r("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:r})=>r("spacing"),gradientColorStops:({theme:r})=>r("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridTemplateColumns:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))"},height:({theme:r})=>({auto:"auto",...r("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),inset:({theme:r})=>({auto:"auto",...r("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},margin:({theme:r})=>({auto:"auto",...r("spacing")}),maxHeight:({theme:r})=>({...r("spacing"),full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:r,breakpoints:e})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...e(r("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},padding:({theme:r})=>r("spacing"),placeholderColor:({theme:r})=>r("colors"),placeholderOpacity:({theme:r})=>r("opacity"),outlineColor:({theme:r})=>r("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringColor:({theme:r})=>({DEFAULT:r("colors.blue.500","#3b82f6"),...r("colors")}),ringOffsetColor:({theme:r})=>r("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:r})=>({DEFAULT:"0.5",...r("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},scrollMargin:({theme:r})=>({...r("spacing")}),scrollPadding:({theme:r})=>r("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:r})=>({...r("spacing")}),stroke:({theme:r})=>({none:"none",...r("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},textColor:({theme:r})=>r("colors"),textDecorationColor:({theme:r})=>r("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:r})=>({...r("spacing")}),textOpacity:({theme:r})=>r("opacity"),transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:r})=>({...r("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),width:({theme:r})=>({auto:"auto",...r("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},variantOrder:["first","last","odd","even","visited","checked","empty","read-only","group-hover","group-focus","focus-within","hover","focus","focus-visible","active","disabled"],plugins:[]}});var Ql={};Ce(Ql,{default:()=>_e});var _e,oi=A(()=>{l();_e=new Proxy({},{get:()=>String})});function Bn(r,e,t){typeof m!="undefined"&&m.env.JEST_WORKER_ID||t&&Jl.has(t)||(t&&Jl.add(t),console.warn(""),e.forEach(i=>console.warn(r,"-",i)))}function $n(r){return _e.dim(r)}var Jl,N,Ae=A(()=>{l();oi();Jl=new Set;N={info(r,e){Bn(_e.bold(_e.cyan("info")),...Array.isArray(r)?[r]:[e,r])},warn(r,e){Bn(_e.bold(_e.yellow("warn")),...Array.isArray(r)?[r]:[e,r])},risk(r,e){Bn(_e.bold(_e.magenta("risk")),...Array.isArray(r)?[r]:[e,r])}}});var Xl={};Ce(Xl,{default:()=>zn});function er({version:r,from:e,to:t}){N.warn(`${e}-color-renamed`,[`As of Tailwind CSS ${r}, \`${e}\` has been renamed to \`${t}\`.`,"Update your configuration file to silence this warning."])}var zn,jn=A(()=>{l();Ae();zn={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},get lightBlue(){return er({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return er({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return er({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return er({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return er({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}});function Vn(r,...e){for(let t of e){for(let i in t)r?.hasOwnProperty?.(i)||(r[i]=t[i]);for(let i of Object.getOwnPropertySymbols(t))r?.hasOwnProperty?.(i)||(r[i]=t[i])}return r}var Kl=A(()=>{l()});function He(r){if(Array.isArray(r))return r;let e=r.split("[").length-1,t=r.split("]").length-1;if(e!==t)throw new Error(`Path is invalid. Has unbalanced brackets: ${r}`);return r.split(/\.(?![^\[]*\])|[\[\]]/g).filter(Boolean)}var li=A(()=>{l()});function Zl(r){(()=>{if(r.purge||!r.content||!Array.isArray(r.content)&&!(typeof r.content=="object"&&r.content!==null))return!1;if(Array.isArray(r.content))return r.content.every(t=>typeof t=="string"?!0:!(typeof t?.raw!="string"||t?.extension&&typeof t?.extension!="string"));if(typeof r.content=="object"&&r.content!==null){if(Object.keys(r.content).some(t=>!["files","relative","extract","transform"].includes(t)))return!1;if(Array.isArray(r.content.files)){if(!r.content.files.every(t=>typeof t=="string"?!0:!(typeof t?.raw!="string"||t?.extension&&typeof t?.extension!="string")))return!1;if(typeof r.content.extract=="object"){for(let t of Object.values(r.content.extract))if(typeof t!="function")return!1}else if(!(r.content.extract===void 0||typeof r.content.extract=="function"))return!1;if(typeof r.content.transform=="object"){for(let t of Object.values(r.content.transform))if(typeof t!="function")return!1}else if(!(r.content.transform===void 0||typeof r.content.transform=="function"))return!1;if(typeof r.content.relative!="boolean"&&typeof r.content.relative!="undefined")return!1}return!0}return!1})()||N.warn("purge-deprecation",["The `purge`/`content` options have changed in Tailwind CSS v3.0.","Update your configuration file to eliminate this warning.","https://tailwindcss.com/docs/upgrade-guide#configure-content-sources"]),r.safelist=(()=>{let{content:t,purge:i,safelist:n}=r;return Array.isArray(n)?n:Array.isArray(t?.safelist)?t.safelist:Array.isArray(i?.safelist)?i.safelist:Array.isArray(i?.options?.safelist)?i.options.safelist:[]})(),r.blocklist=(()=>{let{blocklist:t}=r;if(Array.isArray(t)){if(t.every(i=>typeof i=="string"))return t;N.warn("blocklist-invalid",["The `blocklist` option must be an array of strings.","https://tailwindcss.com/docs/content-configuration#discarding-classes"])}return[]})(),typeof r.prefix=="function"?(N.warn("prefix-function",["As of Tailwind CSS v3.0, `prefix` cannot be a function.","Update `prefix` in your configuration to be a string to eliminate this warning.","https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function"]),r.prefix=""):r.prefix=r.prefix??"",r.content={relative:(()=>{let{content:t}=r;return t?.relative?t.relative:r.future?.relativeContentPathsByDefault??!1})(),files:(()=>{let{content:t,purge:i}=r;return Array.isArray(i)?i:Array.isArray(i?.content)?i.content:Array.isArray(t)?t:Array.isArray(t?.content)?t.content:Array.isArray(t?.files)?t.files:[]})(),extract:(()=>{let t=(()=>r.purge?.extract?r.purge.extract:r.content?.extract?r.content.extract:r.purge?.extract?.DEFAULT?r.purge.extract.DEFAULT:r.content?.extract?.DEFAULT?r.content.extract.DEFAULT:r.purge?.options?.extractors?r.purge.options.extractors:r.content?.options?.extractors?r.content.options.extractors:{})(),i={},n=(()=>{if(r.purge?.options?.defaultExtractor)return r.purge.options.defaultExtractor;if(r.content?.options?.defaultExtractor)return r.content.options.defaultExtractor})();if(n!==void 0&&(i.DEFAULT=n),typeof t=="function")i.DEFAULT=t;else if(Array.isArray(t))for(let{extensions:s,extractor:a}of t??[])for(let o of s)i[o]=a;else typeof t=="object"&&t!==null&&Object.assign(i,t);return i})(),transform:(()=>{let t=(()=>r.purge?.transform?r.purge.transform:r.content?.transform?r.content.transform:r.purge?.transform?.DEFAULT?r.purge.transform.DEFAULT:r.content?.transform?.DEFAULT?r.content.transform.DEFAULT:{})(),i={};return typeof t=="function"&&(i.DEFAULT=t),typeof t=="object"&&t!==null&&Object.assign(i,t),i})()};for(let t of r.content.files)if(typeof t=="string"&&/{([^,]*?)}/g.test(t)){N.warn("invalid-glob-braces",[`The glob pattern ${$n(t)} in your Tailwind CSS configuration is invalid.`,`Update it to ${$n(t.replace(/{([^,]*?)}/g,"$1"))} to silence this warning.`]);break}return r}var eu=A(()=>{l();Ae()});function ee(r){if(Object.prototype.toString.call(r)!=="[object Object]")return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}var wt=A(()=>{l()});function Ye(r){return Array.isArray(r)?r.map(e=>Ye(e)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).map(([e,t])=>[e,Ye(t)])):r}var ui=A(()=>{l()});var ci=v((fi,tu)=>{l();"use strict";fi.__esModule=!0;fi.default=Bw;function Nw(r){for(var e=r.toLowerCase(),t="",i=!1,n=0;n<6&&e[n]!==void 0;n++){var s=e.charCodeAt(n),a=s>=97&&s<=102||s>=48&&s<=57;if(i=s===32,!a)break;t+=e[n]}if(t.length!==0){var o=parseInt(t,16),u=o>=55296&&o<=57343;return u||o===0||o>1114111?["\uFFFD",t.length+(i?1:0)]:[String.fromCodePoint(o),t.length+(i?1:0)]}}var Lw=/\\/;function Bw(r){var e=Lw.test(r);if(!e)return r;for(var t="",i=0;i{l();"use strict";pi.__esModule=!0;pi.default=$w;function $w(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i0;){var n=t.shift();if(!r[n])return;r=r[n]}return r}ru.exports=pi.default});var su=v((di,nu)=>{l();"use strict";di.__esModule=!0;di.default=zw;function zw(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i0;){var n=t.shift();r[n]||(r[n]={}),r=r[n]}}nu.exports=di.default});var ou=v((hi,au)=>{l();"use strict";hi.__esModule=!0;hi.default=jw;function jw(r){for(var e="",t=r.indexOf("/*"),i=0;t>=0;){e=e+r.slice(i,t);var n=r.indexOf("*/",t+2);if(n<0)return e;i=n+2,t=r.indexOf("/*",i)}return e=e+r.slice(i),e}au.exports=hi.default});var tr=v(Pe=>{l();"use strict";Pe.__esModule=!0;Pe.stripComments=Pe.ensureObject=Pe.getProp=Pe.unesc=void 0;var Vw=mi(ci());Pe.unesc=Vw.default;var Uw=mi(iu());Pe.getProp=Uw.default;var Ww=mi(su());Pe.ensureObject=Ww.default;var Gw=mi(ou());Pe.stripComments=Gw.default;function mi(r){return r&&r.__esModule?r:{default:r}}});var Le=v((rr,fu)=>{l();"use strict";rr.__esModule=!0;rr.default=void 0;var lu=tr();function uu(r,e){for(var t=0;ti||this.source.end.linen||this.source.end.line===i&&this.source.end.column{l();"use strict";U.__esModule=!0;U.UNIVERSAL=U.ATTRIBUTE=U.CLASS=U.COMBINATOR=U.COMMENT=U.ID=U.NESTING=U.PSEUDO=U.ROOT=U.SELECTOR=U.STRING=U.TAG=void 0;var Jw="tag";U.TAG=Jw;var Xw="string";U.STRING=Xw;var Kw="selector";U.SELECTOR=Kw;var Zw="root";U.ROOT=Zw;var eb="pseudo";U.PSEUDO=eb;var tb="nesting";U.NESTING=tb;var rb="id";U.ID=rb;var ib="comment";U.COMMENT=ib;var nb="combinator";U.COMBINATOR=nb;var sb="class";U.CLASS=sb;var ab="attribute";U.ATTRIBUTE=ab;var ob="universal";U.UNIVERSAL=ob});var gi=v((ir,hu)=>{l();"use strict";ir.__esModule=!0;ir.default=void 0;var lb=fb(Le()),Be=ub(te());function cu(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return cu=function(){return r},r}function ub(r){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var e=cu();if(e&&e.has(r))return e.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var s=i?Object.getOwnPropertyDescriptor(r,n):null;s&&(s.get||s.set)?Object.defineProperty(t,n,s):t[n]=r[n]}return t.default=r,e&&e.set(r,t),t}function fb(r){return r&&r.__esModule?r:{default:r}}function cb(r,e){var t;if(typeof Symbol=="undefined"||r[Symbol.iterator]==null){if(Array.isArray(r)||(t=pb(r))||e&&r&&typeof r.length=="number"){t&&(r=t);var i=0;return function(){return i>=r.length?{done:!0}:{done:!1,value:r[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return t=r[Symbol.iterator](),t.next.bind(t)}function pb(r,e){if(!!r){if(typeof r=="string")return pu(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return pu(r,e)}}function pu(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t=n&&(this.indexes[a]=s-1);return this},t.removeAll=function(){for(var n=cb(this.nodes),s;!(s=n()).done;){var a=s.value;a.parent=void 0}return this.nodes=[],this},t.empty=function(){return this.removeAll()},t.insertAfter=function(n,s){s.parent=this;var a=this.index(n);this.nodes.splice(a+1,0,s),s.parent=this;var o;for(var u in this.indexes)o=this.indexes[u],a<=o&&(this.indexes[u]=o+1);return this},t.insertBefore=function(n,s){s.parent=this;var a=this.index(n);this.nodes.splice(a,0,s),s.parent=this;var o;for(var u in this.indexes)o=this.indexes[u],o<=a&&(this.indexes[u]=o+1);return this},t._findChildAtPosition=function(n,s){var a=void 0;return this.each(function(o){if(o.atPosition){var u=o.atPosition(n,s);if(u)return a=u,!1}else if(o.isAtPosition(n,s))return a=o,!1}),a},t.atPosition=function(n,s){if(this.isAtPosition(n,s))return this._findChildAtPosition(n,s)||this},t._inferEndPosition=function(){this.last&&this.last.source&&this.last.source.end&&(this.source=this.source||{},this.source.end=this.source.end||{},Object.assign(this.source.end,this.last.source.end))},t.each=function(n){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach++;var s=this.lastEach;if(this.indexes[s]=0,!!this.length){for(var a,o;this.indexes[s]{l();"use strict";nr.__esModule=!0;nr.default=void 0;var gb=wb(gi()),yb=te();function wb(r){return r&&r.__esModule?r:{default:r}}function mu(r,e){for(var t=0;t{l();"use strict";sr.__esModule=!0;sr.default=void 0;var kb=Cb(gi()),Sb=te();function Cb(r){return r&&r.__esModule?r:{default:r}}function _b(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,Hn(r,e)}function Hn(r,e){return Hn=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},Hn(r,e)}var Ab=function(r){_b(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=Sb.SELECTOR,i}return e}(kb.default);sr.default=Ab;yu.exports=sr.default});var yi=v((HO,wu)=>{l();"use strict";var Ob={},Eb=Ob.hasOwnProperty,Tb=function(e,t){if(!e)return t;var i={};for(var n in t)i[n]=Eb.call(e,n)?e[n]:t[n];return i},Pb=/[ -,\.\/:-@\[-\^`\{-~]/,Db=/[ -,\.\/:-@\[\]\^`\{-~]/,qb=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Qn=function r(e,t){t=Tb(t,r.options),t.quotes!="single"&&t.quotes!="double"&&(t.quotes="single");for(var i=t.quotes=="double"?'"':"'",n=t.isIdentifier,s=e.charAt(0),a="",o=0,u=e.length;o126){if(f>=55296&&f<=56319&&o{l();"use strict";ar.__esModule=!0;ar.default=void 0;var Ib=bu(yi()),Rb=tr(),Mb=bu(Le()),Fb=te();function bu(r){return r&&r.__esModule?r:{default:r}}function vu(r,e){for(var t=0;t{l();"use strict";or.__esModule=!0;or.default=void 0;var $b=jb(Le()),zb=te();function jb(r){return r&&r.__esModule?r:{default:r}}function Vb(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,Kn(r,e)}function Kn(r,e){return Kn=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},Kn(r,e)}var Ub=function(r){Vb(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=zb.COMMENT,i}return e}($b.default);or.default=Ub;ku.exports=or.default});var ts=v((lr,Su)=>{l();"use strict";lr.__esModule=!0;lr.default=void 0;var Wb=Hb(Le()),Gb=te();function Hb(r){return r&&r.__esModule?r:{default:r}}function Yb(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,es(r,e)}function es(r,e){return es=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},es(r,e)}var Qb=function(r){Yb(e,r);function e(i){var n;return n=r.call(this,i)||this,n.type=Gb.ID,n}var t=e.prototype;return t.valueToString=function(){return"#"+r.prototype.valueToString.call(this)},e}(Wb.default);lr.default=Qb;Su.exports=lr.default});var wi=v((ur,Au)=>{l();"use strict";ur.__esModule=!0;ur.default=void 0;var Jb=Cu(yi()),Xb=tr(),Kb=Cu(Le());function Cu(r){return r&&r.__esModule?r:{default:r}}function _u(r,e){for(var t=0;t{l();"use strict";fr.__esModule=!0;fr.default=void 0;var r0=n0(wi()),i0=te();function n0(r){return r&&r.__esModule?r:{default:r}}function s0(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,is(r,e)}function is(r,e){return is=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},is(r,e)}var a0=function(r){s0(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=i0.TAG,i}return e}(r0.default);fr.default=a0;Ou.exports=fr.default});var as=v((cr,Eu)=>{l();"use strict";cr.__esModule=!0;cr.default=void 0;var o0=u0(Le()),l0=te();function u0(r){return r&&r.__esModule?r:{default:r}}function f0(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ss(r,e)}function ss(r,e){return ss=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},ss(r,e)}var c0=function(r){f0(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=l0.STRING,i}return e}(o0.default);cr.default=c0;Eu.exports=cr.default});var ls=v((pr,Tu)=>{l();"use strict";pr.__esModule=!0;pr.default=void 0;var p0=h0(gi()),d0=te();function h0(r){return r&&r.__esModule?r:{default:r}}function m0(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,os(r,e)}function os(r,e){return os=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},os(r,e)}var g0=function(r){m0(e,r);function e(i){var n;return n=r.call(this,i)||this,n.type=d0.PSEUDO,n}var t=e.prototype;return t.toString=function(){var n=this.length?"("+this.map(String).join(",")+")":"";return[this.rawSpaceBefore,this.stringifyProperty("value"),n,this.rawSpaceAfter].join("")},e}(p0.default);pr.default=g0;Tu.exports=pr.default});var Pu={};Ce(Pu,{deprecate:()=>y0});function y0(r){return r}var Du=A(()=>{l()});var Iu=v((YO,qu)=>{l();qu.exports=(Du(),Pu).deprecate});var hs=v(mr=>{l();"use strict";mr.__esModule=!0;mr.unescapeValue=ps;mr.default=void 0;var dr=fs(yi()),w0=fs(ci()),b0=fs(wi()),v0=te(),us;function fs(r){return r&&r.__esModule?r:{default:r}}function Ru(r,e){for(var t=0;t0&&!n.quoted&&o.before.length===0&&!(n.spaces.value&&n.spaces.value.after)&&(o.before=" "),Mu(a,o)}))),s.push("]"),s.push(this.rawSpaceAfter),s.join("")},x0(e,[{key:"quoted",get:function(){var n=this.quoteMark;return n==="'"||n==='"'},set:function(n){_0()}},{key:"quoteMark",get:function(){return this._quoteMark},set:function(n){if(!this._constructed){this._quoteMark=n;return}this._quoteMark!==n&&(this._quoteMark=n,this._syncRawValue())}},{key:"qualifiedAttribute",get:function(){return this.qualifiedName(this.raws.attribute||this.attribute)}},{key:"insensitiveFlag",get:function(){return this.insensitive?"i":""}},{key:"value",get:function(){return this._value},set:function(n){if(this._constructed){var s=ps(n),a=s.deprecatedUsage,o=s.unescaped,u=s.quoteMark;if(a&&C0(),o===this._value&&u===this._quoteMark)return;this._value=o,this._quoteMark=u,this._syncRawValue()}else this._value=n}},{key:"attribute",get:function(){return this._attribute},set:function(n){this._handleEscapes("attribute",n),this._attribute=n}}]),e}(b0.default);mr.default=bi;bi.NO_QUOTE=null;bi.SINGLE_QUOTE="'";bi.DOUBLE_QUOTE='"';var ds=(us={"'":{quotes:"single",wrap:!0},'"':{quotes:"double",wrap:!0}},us[null]={isIdentifier:!0},us);function Mu(r,e){return""+e.before+r+e.after}});var gs=v((gr,Fu)=>{l();"use strict";gr.__esModule=!0;gr.default=void 0;var E0=P0(wi()),T0=te();function P0(r){return r&&r.__esModule?r:{default:r}}function D0(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ms(r,e)}function ms(r,e){return ms=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},ms(r,e)}var q0=function(r){D0(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=T0.UNIVERSAL,i.value="*",i}return e}(E0.default);gr.default=q0;Fu.exports=gr.default});var ws=v((yr,Nu)=>{l();"use strict";yr.__esModule=!0;yr.default=void 0;var I0=M0(Le()),R0=te();function M0(r){return r&&r.__esModule?r:{default:r}}function F0(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,ys(r,e)}function ys(r,e){return ys=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},ys(r,e)}var N0=function(r){F0(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=R0.COMBINATOR,i}return e}(I0.default);yr.default=N0;Nu.exports=yr.default});var vs=v((wr,Lu)=>{l();"use strict";wr.__esModule=!0;wr.default=void 0;var L0=$0(Le()),B0=te();function $0(r){return r&&r.__esModule?r:{default:r}}function z0(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,bs(r,e)}function bs(r,e){return bs=Object.setPrototypeOf||function(i,n){return i.__proto__=n,i},bs(r,e)}var j0=function(r){z0(e,r);function e(t){var i;return i=r.call(this,t)||this,i.type=B0.NESTING,i.value="&",i}return e}(L0.default);wr.default=j0;Lu.exports=wr.default});var $u=v((vi,Bu)=>{l();"use strict";vi.__esModule=!0;vi.default=V0;function V0(r){return r.sort(function(e,t){return e-t})}Bu.exports=vi.default});var xs=v(P=>{l();"use strict";P.__esModule=!0;P.combinator=P.word=P.comment=P.str=P.tab=P.newline=P.feed=P.cr=P.backslash=P.bang=P.slash=P.doubleQuote=P.singleQuote=P.space=P.greaterThan=P.pipe=P.equals=P.plus=P.caret=P.tilde=P.dollar=P.closeSquare=P.openSquare=P.closeParenthesis=P.openParenthesis=P.semicolon=P.colon=P.comma=P.at=P.asterisk=P.ampersand=void 0;var U0=38;P.ampersand=U0;var W0=42;P.asterisk=W0;var G0=64;P.at=G0;var H0=44;P.comma=H0;var Y0=58;P.colon=Y0;var Q0=59;P.semicolon=Q0;var J0=40;P.openParenthesis=J0;var X0=41;P.closeParenthesis=X0;var K0=91;P.openSquare=K0;var Z0=93;P.closeSquare=Z0;var ev=36;P.dollar=ev;var tv=126;P.tilde=tv;var rv=94;P.caret=rv;var iv=43;P.plus=iv;var nv=61;P.equals=nv;var sv=124;P.pipe=sv;var av=62;P.greaterThan=av;var ov=32;P.space=ov;var zu=39;P.singleQuote=zu;var lv=34;P.doubleQuote=lv;var uv=47;P.slash=uv;var fv=33;P.bang=fv;var cv=92;P.backslash=cv;var pv=13;P.cr=pv;var dv=12;P.feed=dv;var hv=10;P.newline=hv;var mv=9;P.tab=mv;var gv=zu;P.str=gv;var yv=-1;P.comment=yv;var wv=-2;P.word=wv;var bv=-3;P.combinator=bv});var Uu=v(br=>{l();"use strict";br.__esModule=!0;br.default=Av;br.FIELDS=void 0;var O=vv(xs()),bt,V;function ju(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return ju=function(){return r},r}function vv(r){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var e=ju();if(e&&e.has(r))return e.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var s=i?Object.getOwnPropertyDescriptor(r,n):null;s&&(s.get||s.set)?Object.defineProperty(t,n,s):t[n]=r[n]}return t.default=r,e&&e.set(r,t),t}var xv=(bt={},bt[O.tab]=!0,bt[O.newline]=!0,bt[O.cr]=!0,bt[O.feed]=!0,bt),kv=(V={},V[O.space]=!0,V[O.tab]=!0,V[O.newline]=!0,V[O.cr]=!0,V[O.feed]=!0,V[O.ampersand]=!0,V[O.asterisk]=!0,V[O.bang]=!0,V[O.comma]=!0,V[O.colon]=!0,V[O.semicolon]=!0,V[O.openParenthesis]=!0,V[O.closeParenthesis]=!0,V[O.openSquare]=!0,V[O.closeSquare]=!0,V[O.singleQuote]=!0,V[O.doubleQuote]=!0,V[O.plus]=!0,V[O.pipe]=!0,V[O.tilde]=!0,V[O.greaterThan]=!0,V[O.equals]=!0,V[O.dollar]=!0,V[O.caret]=!0,V[O.slash]=!0,V),ks={},Vu="0123456789abcdefABCDEF";for(xi=0;xi0?(x=a+k,S=b-w[k].length):(x=a,S=s),D=O.comment,a=x,h=x,p=b-S):c===O.slash?(b=o,D=c,h=a,p=o-s,u=b+1):(b=Sv(t,o),D=O.word,h=a,p=b-s),u=b+1;break}e.push([D,a,o-s,h,p,o,u]),S&&(s=S,S=null),o=u}return e}});var Ku=v((vr,Xu)=>{l();"use strict";vr.__esModule=!0;vr.default=void 0;var Ov=ge(Gn()),Ss=ge(Yn()),Ev=ge(Xn()),Wu=ge(Zn()),Tv=ge(ts()),Pv=ge(ns()),Cs=ge(as()),Dv=ge(ls()),Gu=ki(hs()),qv=ge(gs()),_s=ge(ws()),Iv=ge(vs()),Rv=ge($u()),C=ki(Uu()),E=ki(xs()),Mv=ki(te()),Y=tr(),ft,As;function Hu(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return Hu=function(){return r},r}function ki(r){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var e=Hu();if(e&&e.has(r))return e.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var s=i?Object.getOwnPropertyDescriptor(r,n):null;s&&(s.get||s.set)?Object.defineProperty(t,n,s):t[n]=r[n]}return t.default=r,e&&e.set(r,t),t}function ge(r){return r&&r.__esModule?r:{default:r}}function Yu(r,e){for(var t=0;t0){var a=this.current.last;if(a){var o=this.convertWhitespaceNodesToSpace(s),u=o.space,c=o.rawSpace;c!==void 0&&(a.rawSpaceAfter+=c),a.spaces.after+=u}else s.forEach(function(D){return i.newNode(D)})}return}var f=this.currToken,p=void 0;n>this.position&&(p=this.parseWhitespaceEquivalentTokens(n));var h;if(this.isNamedCombinator()?h=this.namedCombinator():this.currToken[C.FIELDS.TYPE]===E.combinator?(h=new _s.default({value:this.content(),source:vt(this.currToken),sourceIndex:this.currToken[C.FIELDS.START_POS]}),this.position++):Os[this.currToken[C.FIELDS.TYPE]]||p||this.unexpected(),h){if(p){var d=this.convertWhitespaceNodesToSpace(p),y=d.space,k=d.rawSpace;h.spaces.before=y,h.rawSpaceBefore=k}}else{var w=this.convertWhitespaceNodesToSpace(p,!0),b=w.space,x=w.rawSpace;x||(x=b);var S={},_={spaces:{}};b.endsWith(" ")&&x.endsWith(" ")?(S.before=b.slice(0,b.length-1),_.spaces.before=x.slice(0,x.length-1)):b.startsWith(" ")&&x.startsWith(" ")?(S.after=b.slice(1),_.spaces.after=x.slice(1)):_.value=x,h=new _s.default({value:" ",source:Es(f,this.tokens[this.position-1]),sourceIndex:f[C.FIELDS.START_POS],spaces:S,raws:_})}return this.currToken&&this.currToken[C.FIELDS.TYPE]===E.space&&(h.spaces.after=this.optionalSpace(this.content()),this.position++),this.newNode(h)},e.comma=function(){if(this.position===this.tokens.length-1){this.root.trailingComma=!0,this.position++;return}this.current._inferEndPosition();var i=new Ss.default({source:{start:Qu(this.tokens[this.position+1])}});this.current.parent.append(i),this.current=i,this.position++},e.comment=function(){var i=this.currToken;this.newNode(new Wu.default({value:this.content(),source:vt(i),sourceIndex:i[C.FIELDS.START_POS]})),this.position++},e.error=function(i,n){throw this.root.error(i,n)},e.missingBackslash=function(){return this.error("Expected a backslash preceding the semicolon.",{index:this.currToken[C.FIELDS.START_POS]})},e.missingParenthesis=function(){return this.expected("opening parenthesis",this.currToken[C.FIELDS.START_POS])},e.missingSquareBracket=function(){return this.expected("opening square bracket",this.currToken[C.FIELDS.START_POS])},e.unexpected=function(){return this.error("Unexpected '"+this.content()+"'. Escaping special characters with \\ may help.",this.currToken[C.FIELDS.START_POS])},e.namespace=function(){var i=this.prevToken&&this.content(this.prevToken)||!0;if(this.nextToken[C.FIELDS.TYPE]===E.word)return this.position++,this.word(i);if(this.nextToken[C.FIELDS.TYPE]===E.asterisk)return this.position++,this.universal(i)},e.nesting=function(){if(this.nextToken){var i=this.content(this.nextToken);if(i==="|"){this.position++;return}}var n=this.currToken;this.newNode(new Iv.default({value:this.content(),source:vt(n),sourceIndex:n[C.FIELDS.START_POS]})),this.position++},e.parentheses=function(){var i=this.current.last,n=1;if(this.position++,i&&i.type===Mv.PSEUDO){var s=new Ss.default({source:{start:Qu(this.tokens[this.position-1])}}),a=this.current;for(i.append(s),this.current=s;this.position1&&i.nextToken&&i.nextToken[C.FIELDS.TYPE]===E.openParenthesis&&i.error("Misplaced parenthesis.",{index:i.nextToken[C.FIELDS.START_POS]})});else return this.expected(["pseudo-class","pseudo-element"],this.currToken[C.FIELDS.START_POS])},e.space=function(){var i=this.content();this.position===0||this.prevToken[C.FIELDS.TYPE]===E.comma||this.prevToken[C.FIELDS.TYPE]===E.openParenthesis||this.current.nodes.every(function(n){return n.type==="comment"})?(this.spaces=this.optionalSpace(i),this.position++):this.position===this.tokens.length-1||this.nextToken[C.FIELDS.TYPE]===E.comma||this.nextToken[C.FIELDS.TYPE]===E.closeParenthesis?(this.current.last.spaces.after=this.optionalSpace(i),this.position++):this.combinator()},e.string=function(){var i=this.currToken;this.newNode(new Cs.default({value:this.content(),source:vt(i),sourceIndex:i[C.FIELDS.START_POS]})),this.position++},e.universal=function(i){var n=this.nextToken;if(n&&this.content(n)==="|")return this.position++,this.namespace();var s=this.currToken;this.newNode(new qv.default({value:this.content(),source:vt(s),sourceIndex:s[C.FIELDS.START_POS]}),i),this.position++},e.splitWord=function(i,n){for(var s=this,a=this.nextToken,o=this.content();a&&~[E.dollar,E.caret,E.equals,E.word].indexOf(a[C.FIELDS.TYPE]);){this.position++;var u=this.content();if(o+=u,u.lastIndexOf("\\")===u.length-1){var c=this.nextToken;c&&c[C.FIELDS.TYPE]===E.space&&(o+=this.requiredSpace(this.content(c)),this.position++)}a=this.nextToken}var f=Ts(o,".").filter(function(y){var k=o[y-1]==="\\",w=/^\d+\.\d+%$/.test(o);return!k&&!w}),p=Ts(o,"#").filter(function(y){return o[y-1]!=="\\"}),h=Ts(o,"#{");h.length&&(p=p.filter(function(y){return!~h.indexOf(y)}));var d=(0,Rv.default)(Lv([0].concat(f,p)));d.forEach(function(y,k){var w=d[k+1]||o.length,b=o.slice(y,w);if(k===0&&n)return n.call(s,b,d.length);var x,S=s.currToken,_=S[C.FIELDS.START_POS]+d[k],D=ct(S[1],S[2]+y,S[3],S[2]+(w-1));if(~f.indexOf(y)){var M={value:b.slice(1),source:D,sourceIndex:_};x=new Ev.default(xt(M,"value"))}else if(~p.indexOf(y)){var B={value:b.slice(1),source:D,sourceIndex:_};x=new Tv.default(xt(B,"value"))}else{var q={value:b,source:D,sourceIndex:_};xt(q,"value"),x=new Pv.default(q)}s.newNode(x,i),i=null}),this.position++},e.word=function(i){var n=this.nextToken;return n&&this.content(n)==="|"?(this.position++,this.namespace()):this.splitWord(i)},e.loop=function(){for(;this.position{l();"use strict";xr.__esModule=!0;xr.default=void 0;var $v=zv(Ku());function zv(r){return r&&r.__esModule?r:{default:r}}var jv=function(){function r(t,i){this.func=t||function(){},this.funcRes=null,this.options=i}var e=r.prototype;return e._shouldUpdateSelector=function(i,n){n===void 0&&(n={});var s=Object.assign({},this.options,n);return s.updateSelector===!1?!1:typeof i!="string"},e._isLossy=function(i){i===void 0&&(i={});var n=Object.assign({},this.options,i);return n.lossless===!1},e._root=function(i,n){n===void 0&&(n={});var s=new $v.default(i,this._parseOptions(n));return s.root},e._parseOptions=function(i){return{lossy:this._isLossy(i)}},e._run=function(i,n){var s=this;return n===void 0&&(n={}),new Promise(function(a,o){try{var u=s._root(i,n);Promise.resolve(s.func(u)).then(function(c){var f=void 0;return s._shouldUpdateSelector(i,n)&&(f=u.toString(),i.selector=f),{transform:c,root:u,string:f}}).then(a,o)}catch(c){o(c);return}})},e._runSync=function(i,n){n===void 0&&(n={});var s=this._root(i,n),a=this.func(s);if(a&&typeof a.then=="function")throw new Error("Selector processor returned a promise to a synchronous call.");var o=void 0;return n.updateSelector&&typeof i!="string"&&(o=s.toString(),i.selector=o),{transform:a,root:s,string:o}},e.ast=function(i,n){return this._run(i,n).then(function(s){return s.root})},e.astSync=function(i,n){return this._runSync(i,n).root},e.transform=function(i,n){return this._run(i,n).then(function(s){return s.transform})},e.transformSync=function(i,n){return this._runSync(i,n).transform},e.process=function(i,n){return this._run(i,n).then(function(s){return s.string||s.root.toString()})},e.processSync=function(i,n){var s=this._runSync(i,n);return s.string||s.root.toString()},r}();xr.default=jv;Zu.exports=xr.default});var tf=v(W=>{l();"use strict";W.__esModule=!0;W.universal=W.tag=W.string=W.selector=W.root=W.pseudo=W.nesting=W.id=W.comment=W.combinator=W.className=W.attribute=void 0;var Vv=ye(hs()),Uv=ye(Xn()),Wv=ye(ws()),Gv=ye(Zn()),Hv=ye(ts()),Yv=ye(vs()),Qv=ye(ls()),Jv=ye(Gn()),Xv=ye(Yn()),Kv=ye(as()),Zv=ye(ns()),ex=ye(gs());function ye(r){return r&&r.__esModule?r:{default:r}}var tx=function(e){return new Vv.default(e)};W.attribute=tx;var rx=function(e){return new Uv.default(e)};W.className=rx;var ix=function(e){return new Wv.default(e)};W.combinator=ix;var nx=function(e){return new Gv.default(e)};W.comment=nx;var sx=function(e){return new Hv.default(e)};W.id=sx;var ax=function(e){return new Yv.default(e)};W.nesting=ax;var ox=function(e){return new Qv.default(e)};W.pseudo=ox;var lx=function(e){return new Jv.default(e)};W.root=lx;var ux=function(e){return new Xv.default(e)};W.selector=ux;var fx=function(e){return new Kv.default(e)};W.string=fx;var cx=function(e){return new Zv.default(e)};W.tag=cx;var px=function(e){return new ex.default(e)};W.universal=px});var af=v(L=>{l();"use strict";L.__esModule=!0;L.isNode=Ps;L.isPseudoElement=sf;L.isPseudoClass=Sx;L.isContainer=Cx;L.isNamespace=_x;L.isUniversal=L.isTag=L.isString=L.isSelector=L.isRoot=L.isPseudo=L.isNesting=L.isIdentifier=L.isComment=L.isCombinator=L.isClassName=L.isAttribute=void 0;var Q=te(),oe,dx=(oe={},oe[Q.ATTRIBUTE]=!0,oe[Q.CLASS]=!0,oe[Q.COMBINATOR]=!0,oe[Q.COMMENT]=!0,oe[Q.ID]=!0,oe[Q.NESTING]=!0,oe[Q.PSEUDO]=!0,oe[Q.ROOT]=!0,oe[Q.SELECTOR]=!0,oe[Q.STRING]=!0,oe[Q.TAG]=!0,oe[Q.UNIVERSAL]=!0,oe);function Ps(r){return typeof r=="object"&&dx[r.type]}function we(r,e){return Ps(e)&&e.type===r}var rf=we.bind(null,Q.ATTRIBUTE);L.isAttribute=rf;var hx=we.bind(null,Q.CLASS);L.isClassName=hx;var mx=we.bind(null,Q.COMBINATOR);L.isCombinator=mx;var gx=we.bind(null,Q.COMMENT);L.isComment=gx;var yx=we.bind(null,Q.ID);L.isIdentifier=yx;var wx=we.bind(null,Q.NESTING);L.isNesting=wx;var Ds=we.bind(null,Q.PSEUDO);L.isPseudo=Ds;var bx=we.bind(null,Q.ROOT);L.isRoot=bx;var vx=we.bind(null,Q.SELECTOR);L.isSelector=vx;var xx=we.bind(null,Q.STRING);L.isString=xx;var nf=we.bind(null,Q.TAG);L.isTag=nf;var kx=we.bind(null,Q.UNIVERSAL);L.isUniversal=kx;function sf(r){return Ds(r)&&r.value&&(r.value.startsWith("::")||r.value.toLowerCase()===":before"||r.value.toLowerCase()===":after"||r.value.toLowerCase()===":first-letter"||r.value.toLowerCase()===":first-line")}function Sx(r){return Ds(r)&&!sf(r)}function Cx(r){return!!(Ps(r)&&r.walk)}function _x(r){return rf(r)||nf(r)}});var of=v(Oe=>{l();"use strict";Oe.__esModule=!0;var qs=te();Object.keys(qs).forEach(function(r){r==="default"||r==="__esModule"||r in Oe&&Oe[r]===qs[r]||(Oe[r]=qs[r])});var Is=tf();Object.keys(Is).forEach(function(r){r==="default"||r==="__esModule"||r in Oe&&Oe[r]===Is[r]||(Oe[r]=Is[r])});var Rs=af();Object.keys(Rs).forEach(function(r){r==="default"||r==="__esModule"||r in Oe&&Oe[r]===Rs[r]||(Oe[r]=Rs[r])})});var De=v((kr,uf)=>{l();"use strict";kr.__esModule=!0;kr.default=void 0;var Ax=Tx(ef()),Ox=Ex(of());function lf(){if(typeof WeakMap!="function")return null;var r=new WeakMap;return lf=function(){return r},r}function Ex(r){if(r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var e=lf();if(e&&e.has(r))return e.get(r);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in r)if(Object.prototype.hasOwnProperty.call(r,n)){var s=i?Object.getOwnPropertyDescriptor(r,n):null;s&&(s.get||s.set)?Object.defineProperty(t,n,s):t[n]=r[n]}return t.default=r,e&&e.set(r,t),t}function Tx(r){return r&&r.__esModule?r:{default:r}}var Ms=function(e){return new Ax.default(e)};Object.assign(Ms,Ox);delete Ms.__esModule;var Px=Ms;kr.default=Px;uf.exports=kr.default});function pt(r){return r.replace(/\\,/g,"\\2c ")}var Si=A(()=>{l()});var cf=v((rE,ff)=>{l();"use strict";ff.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});function Sr(r,{loose:e=!1}={}){if(typeof r!="string")return null;if(r=r.trim(),r==="transparent")return{mode:"rgb",color:["0","0","0"],alpha:"0"};if(r in Fs.default)return{mode:"rgb",color:Fs.default[r].map(s=>s.toString())};let t=r.replace(qx,(s,a,o,u,c)=>["#",a,a,o,o,u,u,c?c+c:""].join("")).match(Dx);if(t!==null)return{mode:"rgb",color:[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)].map(s=>s.toString()),alpha:t[4]?(parseInt(t[4],16)/255).toString():void 0};let i=r.match(Ix)??r.match(Rx);if(i===null)return null;let n=[i[2],i[3],i[4]].filter(Boolean).map(s=>s.toString());return!e&&n.length!==3||n.length<3&&!n.some(s=>/^var\(.*?\)$/.test(s))?null:{mode:i[1],color:n,alpha:i[5]?.toString?.()}}function Ns({mode:r,color:e,alpha:t}){let i=t!==void 0;return`${r}(${e.join(" ")}${i?` / ${t}`:""})`}var Fs,Dx,qx,Qe,Ci,pf,Je,Ix,Rx,Ls=A(()=>{l();Fs=J(cf()),Dx=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,qx=/^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,Qe=/(?:\d+|\d*\.\d+)%?/,Ci=/(?:\s*,\s*|\s+)/,pf=/\s*[,/]\s*/,Je=/var\(--(?:[^ )]*?)\)/,Ix=new RegExp(`^(rgb)a?\\(\\s*(${Qe.source}|${Je.source})(?:${Ci.source}(${Qe.source}|${Je.source}))?(?:${Ci.source}(${Qe.source}|${Je.source}))?(?:${pf.source}(${Qe.source}|${Je.source}))?\\s*\\)$`),Rx=new RegExp(`^(hsl)a?\\(\\s*((?:${Qe.source})(?:deg|rad|grad|turn)?|${Je.source})(?:${Ci.source}(${Qe.source}|${Je.source}))?(?:${Ci.source}(${Qe.source}|${Je.source}))?(?:${pf.source}(${Qe.source}|${Je.source}))?\\s*\\)$`)});function qe(r,e,t){if(typeof r=="function")return r({opacityValue:e});let i=Sr(r,{loose:!0});return i===null?t:Ns({...i,alpha:e})}function le({color:r,property:e,variable:t}){let i=[].concat(e);if(typeof r=="function")return{[t]:"1",...Object.fromEntries(i.map(s=>[s,r({opacityVariable:t,opacityValue:`var(${t})`})]))};let n=Sr(r);return n===null?Object.fromEntries(i.map(s=>[s,r])):n.alpha!==void 0?Object.fromEntries(i.map(s=>[s,r])):{[t]:"1",...Object.fromEntries(i.map(s=>[s,Ns({...n,alpha:`var(${t})`})]))}}var Cr=A(()=>{l();Ls()});function de(r,e){let t=[],i=[],n=0;for(let s=0;s{l()});function _i(r){return de(r,",").map(t=>{let i=t.trim(),n={raw:i},s=i.split(Fx),a=new Set;for(let o of s)df.lastIndex=0,!a.has("KEYWORD")&&Mx.has(o)?(n.keyword=o,a.add("KEYWORD")):df.test(o)?a.has("X")?a.has("Y")?a.has("BLUR")?a.has("SPREAD")||(n.spread=o,a.add("SPREAD")):(n.blur=o,a.add("BLUR")):(n.y=o,a.add("Y")):(n.x=o,a.add("X")):n.color?(n.unknown||(n.unknown=[]),n.unknown.push(o)):n.color=o;return n.valid=n.x!==void 0&&n.y!==void 0,n})}function hf(r){return r.map(e=>e.valid?[e.keyword,e.x,e.y,e.blur,e.spread,e.color].filter(Boolean).join(" "):e.raw).join(", ")}var Mx,Fx,df,Bs=A(()=>{l();_r();Mx=new Set(["inset","inherit","initial","revert","unset"]),Fx=/\ +(?![^(]*\))/g,df=/^-?(\d+|\.\d+)(.*?)$/g});function $s(r){return Nx.some(e=>new RegExp(`^${e}\\(.*\\)`).test(r))}function H(r,e=!0){return r.includes("url(")?r.split(/(url\(.*?\))/g).filter(Boolean).map(t=>/^url\(.*?\)$/.test(t)?t:H(t,!1)).join(""):(r=r.replace(/([^\\])_+/g,(t,i)=>i+" ".repeat(t.length-1)).replace(/^_/g," ").replace(/\\_/g,"_"),e&&(r=r.trim()),r=r.replace(/(calc|min|max|clamp)\(.+\)/g,t=>t.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 ")),r)}function zs(r){return r.startsWith("url(")}function js(r){return!isNaN(Number(r))||$s(r)}function Ar(r){return r.endsWith("%")&&js(r.slice(0,-1))||$s(r)}function Or(r){return r==="0"||new RegExp(`^[+-]?[0-9]*.?[0-9]+(?:[eE][+-]?[0-9]+)?${Bx}$`).test(r)||$s(r)}function mf(r){return $x.has(r)}function gf(r){let e=_i(H(r));for(let t of e)if(!t.valid)return!1;return!0}function yf(r){let e=0;return de(r,"_").every(i=>(i=H(i),i.startsWith("var(")?!0:Sr(i,{loose:!0})!==null?(e++,!0):!1))?e>0:!1}function wf(r){let e=0;return de(r,",").every(i=>(i=H(i),i.startsWith("var(")?!0:zs(i)||jx(i)||["element(","image(","cross-fade(","image-set("].some(n=>i.startsWith(n))?(e++,!0):!1))?e>0:!1}function jx(r){r=H(r);for(let e of zx)if(r.startsWith(`${e}(`))return!0;return!1}function bf(r){let e=0;return de(r,"_").every(i=>(i=H(i),i.startsWith("var(")?!0:Vx.has(i)||Or(i)||Ar(i)?(e++,!0):!1))?e>0:!1}function vf(r){let e=0;return de(r,",").every(i=>(i=H(i),i.startsWith("var(")?!0:i.includes(" ")&&!/(['"])([^"']+)\1/g.test(i)||/^\d/g.test(i)?!1:(e++,!0)))?e>0:!1}function xf(r){return Ux.has(r)}function kf(r){return Wx.has(r)}function Sf(r){return Gx.has(r)}var Nx,Lx,Bx,$x,zx,Vx,Ux,Wx,Gx,Er=A(()=>{l();Ls();Bs();_r();Nx=["min","max","clamp","calc"];Lx=["cm","mm","Q","in","pc","pt","px","em","ex","ch","rem","lh","vw","vh","vmin","vmax"],Bx=`(?:${Lx.join("|")})`;$x=new Set(["thin","medium","thick"]);zx=new Set(["linear-gradient","radial-gradient","repeating-linear-gradient","repeating-radial-gradient","conic-gradient"]);Vx=new Set(["center","top","right","bottom","left"]);Ux=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","math","emoji","fangsong"]);Wx=new Set(["xx-small","x-small","small","medium","large","x-large","x-large","xxx-large"]);Gx=new Set(["larger","smaller"])});function Cf(r){let e=["cover","contain"];return de(r,",").every(t=>{let i=de(t,"_").filter(Boolean);return i.length===1&&e.includes(i[0])?!0:i.length!==1&&i.length!==2?!1:i.every(n=>Or(n)||Ar(n)||n==="auto")})}var _f=A(()=>{l();Er();_r()});function K(r,e){return Ai.future.includes(e)?r.future==="all"||(r?.future?.[e]??Af[e]??!1):Ai.experimental.includes(e)?r.experimental==="all"||(r?.experimental?.[e]??Af[e]??!1):!1}function Of(r){return r.experimental==="all"?Ai.experimental:Object.keys(r?.experimental??{}).filter(e=>Ai.experimental.includes(e)&&r.experimental[e])}function Ef(r){if(m.env.JEST_WORKER_ID===void 0&&Of(r).length>0){let e=Of(r).map(t=>_e.yellow(t)).join(", ");N.warn("experimental-flags-enabled",[`You have enabled experimental features: ${e}`,"Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time."])}}var Af,Ai,$e=A(()=>{l();oi();Ae();Af={optimizeUniversalDefaults:!1,generalizedModifiers:!0},Ai={future:["hoverOnlyWhenSupported","respectDefaultRingColorOpacity","disableColorOpacityUtilitiesByDefault","relativeContentPathsByDefault"],experimental:["optimizeUniversalDefaults","generalizedModifiers"]}});function Tf(r,e){return(0,Vs.default)(n=>{n.walkClasses(s=>{let a=e(s.value);s.value=a,s.raws&&s.raws.value&&(s.raws.value=pt(s.raws.value))})}).processSync(r)}function Pf(r,e){return(0,Vs.default)(n=>{n.each(s=>{s.nodes.some(o=>o.type==="class"&&o.value===e)||s.remove()})}).processSync(r)}function Df(r,e){if(!Xe(r))return;let t=r.slice(1,-1);if(!!e(t))return H(t)}function Hx(r,e={},t){let i=e[r];if(i!==void 0)return ut(i);if(Xe(r)){let n=Df(r,t);return n===void 0?void 0:ut(n)}}function Tr(r,e={},{validate:t=()=>!0}={}){let i=e.values?.[r];return i!==void 0?i:e.supportsNegativeValues&&r.startsWith("-")?Hx(r.slice(1),e.values,t):Df(r,t)}function Xe(r){return r.startsWith("[")&&r.endsWith("]")}function qf(r){let e=r.lastIndexOf("/");return e===-1||e===r.length-1?[r,void 0]:Xe(r)&&!r.includes("]/[")?[r,void 0]:[r.slice(0,e),r.slice(e+1)]}function kt(r){if(typeof r=="string"&&r.includes("")){let e=r;return({opacityValue:t=1})=>e.replace("",t)}return r}function Yx(r,e={},{tailwindConfig:t={},utilityModifier:i,rawModifier:n}={}){if(e.values?.[n]!==void 0)return kt(e.values?.[n]);let[s,a]=qf(n);if(a!==void 0){let o=e.values?.[s]??(Xe(s)?s.slice(1,-1):void 0);return o===void 0?void 0:(o=kt(o),Xe(a)?qe(o,a.slice(1,-1)):t.theme?.opacity?.[a]===void 0?void 0:qe(o,t.theme.opacity[a]))}return Tr(n,e,{rawModifier:n,utilityModifier:i,validate:yf})}function Qx(r,e={}){return e.values?.[r]}function he(r){return(e,t,i)=>Tr(e,t,{...i,validate:r})}function Jx(r,e){let t=r.indexOf(e);return t===-1?[void 0,r]:[r.slice(0,t),r.slice(t+1)]}function Us(r,e,t,i){if(Xe(e)){let s=e.slice(1,-1),[a,o]=Jx(s,":");if(!/^[\w-_]+$/g.test(a))o=s;else if(a!==void 0&&!Rf.includes(a))return[];if(o.length>0&&Rf.includes(a))return[Tr(`[${o}]`,t),a,null]}let n=Ws(r,e,t,i);for(let s of n)return s;return[]}function*Ws(r,e,t,i){let n=K(i,"generalizedModifiers"),[s,a]=qf(e);if(n&&t.modifiers!=null&&(t.modifiers==="any"||typeof t.modifiers=="object"&&(a&&Xe(a)||a in t.modifiers))||(s=e,a=void 0),a!==void 0&&s===""&&(s="DEFAULT"),a!==void 0){if(typeof t.modifiers=="object"){let c=t.modifiers?.[a]??null;c!==null?a=c:Xe(a)&&(a=a.slice(1,-1))}let u=Tr(e,t,{rawModifier:e,utilityModifier:a,tailwindConfig:i});u!==void 0&&(yield[u,"any",null])}for(let{type:u}of r??[]){let c=If[u](s,t,{rawModifier:e,utilityModifier:a,tailwindConfig:i});c!==void 0&&(yield[c,u,a??null])}}var Vs,If,Rf,Pr=A(()=>{l();Vs=J(De());Si();Cr();Er();ai();_f();$e();If={any:Tr,color:Yx,url:he(zs),image:he(wf),length:he(Or),percentage:he(Ar),position:he(bf),lookup:Qx,"generic-name":he(xf),"family-name":he(vf),number:he(js),"line-width":he(mf),"absolute-size":he(kf),"relative-size":he(Sf),shadow:he(gf),size:he(Cf)},Rf=Object.keys(If)});function $(r){return typeof r=="function"?r({}):r}var Gs=A(()=>{l()});function St(r){return typeof r=="function"}function Dr(r,...e){let t=e.pop();for(let i of e)for(let n in i){let s=t(r[n],i[n]);s===void 0?ee(r[n])&&ee(i[n])?r[n]=Dr({},r[n],i[n],t):r[n]=i[n]:r[n]=s}return r}function Xx(r,...e){return St(r)?r(...e):r}function Kx(r){return r.reduce((e,{extend:t})=>Dr(e,t,(i,n)=>i===void 0?[n]:Array.isArray(i)?[n,...i]:[n,i]),{})}function Zx(r){return{...r.reduce((e,t)=>Vn(e,t),{}),extend:Kx(r)}}function Ff(r,e){if(Array.isArray(r)&&ee(r[0]))return r.concat(e);if(Array.isArray(e)&&ee(e[0])&&ee(r))return[r,...e];if(Array.isArray(e))return e}function e1({extend:r,...e}){return Dr(e,r,(t,i)=>!St(t)&&!i.some(St)?Dr({},t,...i,Ff):(n,s)=>Dr({},...[t,...i].map(a=>Xx(a,n,s)),Ff))}function*t1(r){let e=He(r);if(e.length===0||(yield e,Array.isArray(r)))return;let t=/^(.*?)\s*\/\s*([^/]+)$/,i=r.match(t);if(i!==null){let[,n,s]=i,a=He(n);a.alpha=s,yield a}}function r1(r){let e=(t,i)=>{for(let n of t1(t)){let s=0,a=r;for(;a!=null&&s(t[i]=St(r[i])?r[i](e,Hs):r[i],t),{})}function Nf(r){let e=[];return r.forEach(t=>{e=[...e,t];let i=t?.plugins??[];i.length!==0&&i.forEach(n=>{n.__isOptionsFunction&&(n=n()),e=[...e,...Nf([n?.config??{}])]})}),e}function i1(r){return[...r].reduceRight((t,i)=>St(i)?i({corePlugins:t}):Gl(i,t),Ul)}function n1(r){return[...r].reduceRight((t,i)=>[...t,...i],[])}function Ys(r){let e=[...Nf(r),{prefix:"",important:!1,separator:":",variantOrder:Mf.default.variantOrder}];return Zl(Vn({theme:r1(e1(Zx(e.map(t=>t?.theme??{})))),corePlugins:i1(e.map(t=>t.corePlugins)),plugins:n1(r.map(t=>t?.plugins??[]))},...e))}var Mf,Hs,Lf=A(()=>{l();ai();Wl();Hl();Mf=J(Zt());jn();Kl();li();eu();wt();ui();Pr();Cr();Gs();Hs={colors:zn,negative(r){return Object.keys(r).filter(e=>r[e]!=="0").reduce((e,t)=>{let i=ut(r[t]);return i!==void 0&&(e[`-${t}`]=i),e},{})},breakpoints(r){return Object.keys(r).filter(e=>typeof r[e]=="string").reduce((e,t)=>({...e,[`screen-${t}`]:r[t]}),{})}}});function Oi(r){let e=(r?.presets??[Bf.default]).slice().reverse().flatMap(n=>Oi(n instanceof Function?n():n)),t={respectDefaultRingColorOpacity:{theme:{ringColor:({theme:n})=>({DEFAULT:"#3b82f67f",...n("colors")})}},disableColorOpacityUtilitiesByDefault:{corePlugins:{backgroundOpacity:!1,borderOpacity:!1,divideOpacity:!1,placeholderOpacity:!1,ringOpacity:!1,textOpacity:!1}}},i=Object.keys(t).filter(n=>K(r,n)).map(n=>t[n]);return[r,...i,...e]}var Bf,$f=A(()=>{l();Bf=J(Zt());$e()});var zf={};Ce(zf,{default:()=>qr});function qr(...r){let[,...e]=Oi(r[0]);return Ys([...r,...e])}var Qs=A(()=>{l();Lf();$f()});function Ei(r){return typeof r=="object"&&r!==null}function s1(r){return Object.keys(r).length===0}function jf(r){return typeof r=="string"||r instanceof String}function Js(r){if(Ei(r)&&r.config===void 0&&!s1(r))return null;if(Ei(r)&&r.config!==void 0&&jf(r.config))return ie.resolve(r.config);if(Ei(r)&&r.config!==void 0&&Ei(r.config))return null;if(jf(r))return ie.resolve(r);for(let e of["./tailwind.config.js","./tailwind.config.cjs"])try{let t=ie.resolve(e);return ae.accessSync(t),t}catch(t){}return null}var Vf=A(()=>{l();Ge();lt()});var Uf={};Ce(Uf,{default:()=>Xs});var Xs,Ks=A(()=>{l();Xs={parse:r=>({href:r})}});var Zs=v(()=>{l()});var Ti=v((QE,Hf)=>{l();"use strict";var Wf=(oi(),Ql),Gf=Zs(),Ct=class extends Error{constructor(e,t,i,n,s,a){super(e);this.name="CssSyntaxError",this.reason=e,s&&(this.file=s),n&&(this.source=n),a&&(this.plugin=a),typeof t!="undefined"&&typeof i!="undefined"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ct)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Wf.isColorSupported),Gf&&e&&(t=Gf(t));let i=t.split(/\r?\n/),n=Math.max(this.line-3,0),s=Math.min(this.line+2,i.length),a=String(s).length,o,u;if(e){let{bold:c,red:f,gray:p}=Wf.createColors(!0);o=h=>c(f(h)),u=h=>p(h)}else o=u=c=>c;return i.slice(n,s).map((c,f)=>{let p=n+1+f,h=" "+(" "+p).slice(-a)+" | ";if(p===this.line){let d=u(h.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return o(">")+u(h)+c+` + `+d+o("^")}return" "+u(h)+c}).join(` +`)}toString(){let e=this.showSourceCode();return e&&(e=` + +`+e+` +`),this.name+": "+this.message+e}};Hf.exports=Ct;Ct.default=Ct});var Pi=v((JE,ea)=>{l();"use strict";ea.exports.isClean=Symbol("isClean");ea.exports.my=Symbol("my")});var ta=v((XE,Qf)=>{l();"use strict";var Yf={colon:": ",indent:" ",beforeDecl:` +`,beforeRule:` +`,beforeOpen:" ",beforeClose:` +`,beforeComment:` +`,after:` +`,emptyBody:"",commentLeft:" ",commentRight:" ",semicolon:!1};function a1(r){return r[0].toUpperCase()+r.slice(1)}var Di=class{constructor(e){this.builder=e}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}document(e){this.body(e)}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),n=e.prop+i+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}atrule(e,t){let i="@"+e.name,n=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!="undefined"?i+=e.raws.afterName:n&&(i+=" "),e.nodes)this.block(e,i+n);else{let s=(e.raws.between||"")+(t?";":"");this.builder(i+n+s,e)}}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let n=0;n{if(n=u.raws[t],typeof n!="undefined")return!1})}return typeof n=="undefined"&&(n=Yf[i]),a.rawCache[i]=n,n}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t!="undefined"))return!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t!="undefined"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(i=>{let n=i.parent;if(n&&n!==e&&n.parent&&n.parent===e&&typeof i.raws.before!="undefined"){let s=i.raws.before.split(` +`);return t=s[s.length-1],t=t.replace(/\S/g,""),!1}}),t}rawBeforeComment(e,t){let i;return e.walkComments(n=>{if(typeof n.raws.before!="undefined")return i=n.raws.before,i.includes(` +`)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(t,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(e,t){let i;return e.walkDecls(n=>{if(typeof n.raws.before!="undefined")return i=n.raws.before,i.includes(` +`)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(t,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before!="undefined")return t=i.raws.before,t.includes(` +`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after!="undefined")return t=i.raws.after,t.includes(` +`)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t!="undefined"))return!1}),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between!="undefined")return t=i.raws.between.replace(/[^\s:]/g,""),!1}),t}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let n=e.parent,s=0;for(;n&&n.type!=="root";)s+=1,n=n.parent;if(i.includes(` +`)){let a=this.raw(e,null,"indent");if(a.length)for(let o=0;o{l();"use strict";var o1=ta();function ra(r,e){new o1(e).stringify(r)}Jf.exports=ra;ra.default=ra});var Rr=v((ZE,Xf)=>{l();"use strict";var{isClean:qi,my:l1}=Pi(),u1=Ti(),f1=ta(),c1=Ir();function ia(r,e){let t=new r.constructor;for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i)||i==="proxyCache")continue;let n=r[i],s=typeof n;i==="parent"&&s==="object"?e&&(t[i]=e):i==="source"?t[i]=n:Array.isArray(n)?t[i]=n.map(a=>ia(a,t)):(s==="object"&&n!==null&&(n=ia(n)),t[i]=n)}return t}var Ii=class{constructor(e={}){this.raws={},this[qi]=!1,this[l1]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[t]=e[t]}error(e,t={}){if(this.source){let{start:i,end:n}=this.rangeBy(t);return this.source.input.error(e,{line:i.line,column:i.column},{line:n.line,column:n.column},t)}return new u1(e)}warn(e,t,i){let n={node:this};for(let s in i)n[s]=i[s];return e.warn(t,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}toString(e=c1){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}assign(e={}){for(let t in e)this[t]=e[t];return this}clone(e={}){let t=ia(this);for(let i in e)t[i]=e[i];return t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}replaceWith(...e){if(this.parent){let t=this,i=!1;for(let n of e)n===this?i=!0:i?(this.parent.insertAfter(t,n),t=n):this.parent.insertBefore(t,n);i||this.remove()}return this}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}before(e){return this.parent.insertBefore(this,e),this}after(e){return this.parent.insertAfter(this,e),this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}raw(e,t){return new f1().raw(this,e,t)}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}toJSON(e,t){let i={},n=t==null;t=t||new Map;let s=0;for(let a in this){if(!Object.prototype.hasOwnProperty.call(this,a)||a==="parent"||a==="proxyCache")continue;let o=this[a];if(Array.isArray(o))i[a]=o.map(u=>typeof u=="object"&&u.toJSON?u.toJSON(null,t):u);else if(typeof o=="object"&&o.toJSON)i[a]=o.toJSON(null,t);else if(a==="source"){let u=t.get(o.input);u==null&&(u=s,t.set(o.input,s),s++),i[a]={inputId:u,start:o.start,end:o.end}}else i[a]=o}return n&&(i.inputs=[...t.keys()].map(a=>a.toJSON())),i}positionInside(e){let t=this.toString(),i=this.source.start.column,n=this.source.start.line;for(let s=0;se.root().toProxy():e[t]}}}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}markDirty(){if(this[qi]){this[qi]=!1;let e=this;for(;e=e.parent;)e[qi]=!1}}get proxyOf(){return this}};Xf.exports=Ii;Ii.default=Ii});var Mr=v((eT,Kf)=>{l();"use strict";var p1=Rr(),Ri=class extends p1{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e={...e,value:String(e.value)});super(e);this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};Kf.exports=Ri;Ri.default=Ri});var na=v((tT,Zf)=>{l();Zf.exports=function(r,e){return{generate:()=>{let t="";return r(e,i=>{t+=i}),[t]}}}});var Fr=v((rT,ec)=>{l();"use strict";var d1=Rr(),Mi=class extends d1{constructor(e){super(e);this.type="comment"}};ec.exports=Mi;Mi.default=Mi});var Ke=v((iT,uc)=>{l();"use strict";var{isClean:tc,my:rc}=Pi(),ic=Mr(),nc=Fr(),h1=Rr(),sc,sa,aa,ac;function oc(r){return r.map(e=>(e.nodes&&(e.nodes=oc(e.nodes)),delete e.source,e))}function lc(r){if(r[tc]=!1,r.proxyOf.nodes)for(let e of r.proxyOf.nodes)lc(e)}var be=class extends h1{push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),i,n;for(;this.indexes[t]{let n;try{n=e(t,i)}catch(s){throw t.addToError(s)}return n!==!1&&t.walk&&(n=t.walk(e)),n})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,n)}):this.walk((i,n)=>{if(i.type==="decl"&&i.prop===e)return t(i,n)}):(t=e,this.walk((i,n)=>{if(i.type==="decl")return t(i,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,n)}):this.walk((i,n)=>{if(i.type==="rule"&&i.selector===e)return t(i,n)}):(t=e,this.walk((i,n)=>{if(i.type==="rule")return t(i,n)}))}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,n)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,n)}):this.walk((i,n)=>{if(i.type==="atrule"&&i.name===e)return t(i,n)}):(t=e,this.walk((i,n)=>{if(i.type==="atrule")return t(i,n)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}append(...e){for(let t of e){let i=this.normalize(t,this.last);for(let n of i)this.proxyOf.nodes.push(n)}return this.markDirty(),this}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,this.first,"prepend").reverse();for(let n of i)this.proxyOf.nodes.unshift(n);for(let n in this.indexes)this.indexes[n]=this.indexes[n]+i.length}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}insertBefore(e,t){let i=this.index(e),n=e===0?"prepend":!1,s=this.normalize(t,this.proxyOf.nodes[i],n).reverse();i=this.index(e);for(let o of s)this.proxyOf.nodes.splice(i,0,o);let a;for(let o in this.indexes)a=this.indexes[o],i<=a&&(this.indexes[o]=a+s.length);return this.markDirty(),this}insertAfter(e,t){let i=this.index(e),n=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let a of n)this.proxyOf.nodes.splice(i+1,0,a);let s;for(let a in this.indexes)s=this.indexes[a],i=e&&(this.indexes[i]=t-1);return this.markDirty(),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(n=>{t.props&&!t.props.includes(n.prop)||t.fast&&!n.value.includes(t.fast)||(n.value=n.value.replace(e,i))}),this.markDirty(),this}every(e){return this.nodes.every(e)}some(e){return this.nodes.some(e)}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}get first(){if(!!this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(!!this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}normalize(e,t){if(typeof e=="string")e=oc(sc(e).nodes);else if(Array.isArray(e)){e=e.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let n of e)n.parent&&n.parent.removeChild(n,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new ic(e)]}else if(e.selector)e=[new sa(e)];else if(e.name)e=[new aa(e)];else if(e.text)e=[new nc(e)];else throw new Error("Unknown node type in node creation");return e.map(n=>(n[rc]||be.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[tc]&&lc(n),typeof n.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(n.raws.before=t.raws.before.replace(/\S/g,"")),n.parent=this.proxyOf,n))}getProxyProcessor(){return{set(e,t,i){return e[t]===i||(e[t]=i,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0},get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...i)=>e[t](...i.map(n=>typeof n=="function"?(s,a)=>n(s.toProxy(),a):n)):t==="every"||t==="some"?i=>e[t]((n,...s)=>i(n.toProxy(),...s)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]}}}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}};be.registerParse=r=>{sc=r};be.registerRule=r=>{sa=r};be.registerAtRule=r=>{aa=r};be.registerRoot=r=>{ac=r};uc.exports=be;be.default=be;be.rebuild=r=>{r.type==="atrule"?Object.setPrototypeOf(r,aa.prototype):r.type==="rule"?Object.setPrototypeOf(r,sa.prototype):r.type==="decl"?Object.setPrototypeOf(r,ic.prototype):r.type==="comment"?Object.setPrototypeOf(r,nc.prototype):r.type==="root"&&Object.setPrototypeOf(r,ac.prototype),r[rc]=!0,r.nodes&&r.nodes.forEach(e=>{be.rebuild(e)})}});var Fi=v((nT,pc)=>{l();"use strict";var m1=Ke(),fc,cc,_t=class extends m1{constructor(e){super({type:"document",...e});this.nodes||(this.nodes=[])}toResult(e={}){return new fc(new cc,this,e).stringify()}};_t.registerLazyResult=r=>{fc=r};_t.registerProcessor=r=>{cc=r};pc.exports=_t;_t.default=_t});var oa=v((sT,hc)=>{l();"use strict";var dc={};hc.exports=function(e){dc[e]||(dc[e]=!0,typeof console!="undefined"&&console.warn&&console.warn(e))}});var la=v((aT,mc)=>{l();"use strict";var Ni=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[i]}toString(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};mc.exports=Ni;Ni.default=Ni});var Bi=v((oT,gc)=>{l();"use strict";var g1=la(),Li=class{constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let i=new g1(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};gc.exports=Li;Li.default=Li});var xc=v((lT,vc)=>{l();"use strict";var ua="'".charCodeAt(0),yc='"'.charCodeAt(0),$i="\\".charCodeAt(0),wc="/".charCodeAt(0),zi=` +`.charCodeAt(0),Nr=" ".charCodeAt(0),ji="\f".charCodeAt(0),Vi=" ".charCodeAt(0),Ui="\r".charCodeAt(0),y1="[".charCodeAt(0),w1="]".charCodeAt(0),b1="(".charCodeAt(0),v1=")".charCodeAt(0),x1="{".charCodeAt(0),k1="}".charCodeAt(0),S1=";".charCodeAt(0),C1="*".charCodeAt(0),_1=":".charCodeAt(0),A1="@".charCodeAt(0),Wi=/[\t\n\f\r "#'()/;[\\\]{}]/g,Gi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,O1=/.[\n"'(/\\]/,bc=/[\da-f]/i;vc.exports=function(e,t={}){let i=e.css.valueOf(),n=t.ignoreErrors,s,a,o,u,c,f,p,h,d,y,k=i.length,w=0,b=[],x=[];function S(){return w}function _(q){throw e.error("Unclosed "+q,w)}function D(){return x.length===0&&w>=k}function M(q){if(x.length)return x.pop();if(w>=k)return;let F=q?q.ignoreUnclosed:!1;switch(s=i.charCodeAt(w),s){case zi:case Nr:case Vi:case Ui:case ji:{a=w;do a+=1,s=i.charCodeAt(a);while(s===Nr||s===zi||s===Vi||s===Ui||s===ji);y=["space",i.slice(w,a)],w=a-1;break}case y1:case w1:case x1:case k1:case _1:case S1:case v1:{let X=String.fromCharCode(s);y=[X,X,w];break}case b1:{if(h=b.length?b.pop()[1]:"",d=i.charCodeAt(w+1),h==="url"&&d!==ua&&d!==yc&&d!==Nr&&d!==zi&&d!==Vi&&d!==ji&&d!==Ui){a=w;do{if(f=!1,a=i.indexOf(")",a+1),a===-1)if(n||F){a=w;break}else _("bracket");for(p=a;i.charCodeAt(p-1)===$i;)p-=1,f=!f}while(f);y=["brackets",i.slice(w,a+1),w,a],w=a}else a=i.indexOf(")",w+1),u=i.slice(w,a+1),a===-1||O1.test(u)?y=["(","(",w]:(y=["brackets",u,w,a],w=a);break}case ua:case yc:{o=s===ua?"'":'"',a=w;do{if(f=!1,a=i.indexOf(o,a+1),a===-1)if(n||F){a=w+1;break}else _("string");for(p=a;i.charCodeAt(p-1)===$i;)p-=1,f=!f}while(f);y=["string",i.slice(w,a+1),w,a],w=a;break}case A1:{Wi.lastIndex=w+1,Wi.test(i),Wi.lastIndex===0?a=i.length-1:a=Wi.lastIndex-2,y=["at-word",i.slice(w,a+1),w,a],w=a;break}case $i:{for(a=w,c=!0;i.charCodeAt(a+1)===$i;)a+=1,c=!c;if(s=i.charCodeAt(a+1),c&&s!==wc&&s!==Nr&&s!==zi&&s!==Vi&&s!==Ui&&s!==ji&&(a+=1,bc.test(i.charAt(a)))){for(;bc.test(i.charAt(a+1));)a+=1;i.charCodeAt(a+1)===Nr&&(a+=1)}y=["word",i.slice(w,a+1),w,a],w=a;break}default:{s===wc&&i.charCodeAt(w+1)===C1?(a=i.indexOf("*/",w+2)+1,a===0&&(n||F?a=i.length:_("comment")),y=["comment",i.slice(w,a+1),w,a],w=a):(Gi.lastIndex=w+1,Gi.test(i),Gi.lastIndex===0?a=i.length-1:a=Gi.lastIndex-2,y=["word",i.slice(w,a+1),w,a],b.push(y),w=a);break}}return w++,y}function B(q){x.push(q)}return{back:B,nextToken:M,endOfFile:D,position:S}}});var Hi=v((uT,Sc)=>{l();"use strict";var kc=Ke(),Lr=class extends kc{constructor(e){super(e);this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};Sc.exports=Lr;Lr.default=Lr;kc.registerAtRule(Lr)});var At=v((fT,Oc)=>{l();"use strict";var Cc=Ke(),_c,Ac,dt=class extends Cc{constructor(e){super(e);this.type="root",this.nodes||(this.nodes=[])}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}normalize(e,t,i){let n=super.normalize(e);if(t){if(i==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let s of n)s.raws.before=t.raws.before}return n}toResult(e={}){return new _c(new Ac,this,e).stringify()}};dt.registerLazyResult=r=>{_c=r};dt.registerProcessor=r=>{Ac=r};Oc.exports=dt;dt.default=dt;Cc.registerRoot(dt)});var fa=v((cT,Ec)=>{l();"use strict";var Br={split(r,e,t){let i=[],n="",s=!1,a=0,o=!1,u="",c=!1;for(let f of r)c?c=!1:f==="\\"?c=!0:o?f===u&&(o=!1):f==='"'||f==="'"?(o=!0,u=f):f==="("?a+=1:f===")"?a>0&&(a-=1):a===0&&e.includes(f)&&(s=!0),s?(n!==""&&i.push(n.trim()),n="",s=!1):n+=f;return(t||n!=="")&&i.push(n.trim()),i},space(r){let e=[" ",` +`," "];return Br.split(r,e)},comma(r){return Br.split(r,[","],!0)}};Ec.exports=Br;Br.default=Br});var Yi=v((pT,Pc)=>{l();"use strict";var Tc=Ke(),E1=fa(),$r=class extends Tc{constructor(e){super(e);this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return E1.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}};Pc.exports=$r;$r.default=$r;Tc.registerRule($r)});var Mc=v((dT,Rc)=>{l();"use strict";var T1=Mr(),P1=xc(),D1=Fr(),q1=Hi(),I1=At(),Dc=Yi(),qc={empty:!0,space:!0};function R1(r){for(let e=r.length-1;e>=0;e--){let t=r[e],i=t[3]||t[2];if(i)return i}}var Ic=class{constructor(e){this.input=e,this.root=new I1,this.current=this.root,this.spaces="",this.semicolon=!1,this.customProperty=!1,this.createTokenizer(),this.root.source={input:e,start:{offset:0,line:1,column:1}}}createTokenizer(){this.tokenizer=P1(this.input)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}comment(e){let t=new D1;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]);let i=e[1].slice(2,-2);if(/^\s*$/.test(i))t.text="",t.raws.left=i,t.raws.right="";else{let n=i.match(/^(\s*)([^]*\S)(\s*)$/);t.text=n[2],t.raws.left=n[1],t.raws.right=n[3]}}emptyRule(e){let t=new Dc;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}other(e){let t=!1,i=null,n=!1,s=null,a=[],o=e[1].startsWith("--"),u=[],c=e;for(;c;){if(i=c[0],u.push(c),i==="("||i==="[")s||(s=c),a.push(i==="("?")":"]");else if(o&&n&&i==="{")s||(s=c),a.push("}");else if(a.length===0)if(i===";")if(n){this.decl(u,o);return}else break;else if(i==="{"){this.rule(u);return}else if(i==="}"){this.tokenizer.back(u.pop()),t=!0;break}else i===":"&&(n=!0);else i===a[a.length-1]&&(a.pop(),a.length===0&&(s=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(s),t&&n){if(!o)for(;u.length&&(c=u[u.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(u.pop());this.decl(u,o)}else this.unknownWord(u)}rule(e){e.pop();let t=new Dc;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}decl(e,t){let i=new T1;this.init(i,e[0][2]);let n=e[e.length-1];for(n[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(n[3]||n[2]||R1(e));e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let s;for(;e.length;)if(s=e.shift(),s[0]===":"){i.raws.between+=s[1];break}else s[0]==="word"&&/\w/.test(s[1])&&this.unknownWord([s]),i.raws.between+=s[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let a=[],o;for(;e.length&&(o=e[0][0],!(o!=="space"&&o!=="comment"));)a.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(s=e[c],s[1].toLowerCase()==="!important"){i.important=!0;let f=this.stringFrom(e,c);f=this.spacesFromEnd(e)+f,f!==" !important"&&(i.raws.important=f);break}else if(s[1].toLowerCase()==="important"){let f=e.slice(0),p="";for(let h=c;h>0;h--){let d=f[h][0];if(p.trim().indexOf("!")===0&&d!=="space")break;p=f.pop()[1]+p}p.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=p,e=f)}if(s[0]!=="space"&&s[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=a.map(c=>c[1]).join(""),a=[]),this.raw(i,"value",a.concat(e),t),i.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}atrule(e){let t=new q1;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,n,s,a=!1,o=!1,u=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),this.semicolon=!0;break}else if(i==="{"){o=!0;break}else if(i==="}"){if(u.length>0){for(s=u.length-1,n=u[s];n&&n[0]==="space";)n=u[--s];n&&(t.source.end=this.getPosition(n[3]||n[2]))}this.end(e);break}else u.push(e);else u.push(e);if(this.tokenizer.endOfFile()){a=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(u),u.length?(t.raws.afterName=this.spacesAndCommentsFromStart(u),this.raw(t,"params",u),a&&(e=u[u.length-1],t.source.end=this.getPosition(e[3]||e[2]),this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),o&&(t.nodes=[],this.current=t)}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{offset:e,line:t.line,column:t.col}}init(e,t){this.current.push(e),e.source={start:this.getPosition(t),input:this.input},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}raw(e,t,i,n){let s,a,o=i.length,u="",c=!0,f,p;for(let h=0;hd+y[1],"");e.raws[t]={value:u,raw:h}}e[t]=u}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let n=t;n=0&&(n=e[s],!(n[0]!=="space"&&(i+=1,i===2)));s--);throw this.input.error("Missed semicolon",n[0]==="word"?n[3]+1:n[2])}};Rc.exports=Ic});var Fc=v(()=>{l()});var Lc=v((gT,Nc)=>{l();var M1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",F1=(r,e=21)=>(t=e)=>{let i="",n=t;for(;n--;)i+=r[Math.random()*r.length|0];return i},N1=(r=21)=>{let e="",t=r;for(;t--;)e+=M1[Math.random()*64|0];return e};Nc.exports={nanoid:N1,customAlphabet:F1}});var ca=v((yT,Bc)=>{l();Bc.exports={}});var Ji=v((wT,Vc)=>{l();"use strict";var{SourceMapConsumer:L1,SourceMapGenerator:B1}=Fc(),{fileURLToPath:$c,pathToFileURL:Qi}=(Ks(),Uf),{resolve:pa,isAbsolute:da}=(lt(),zl),{nanoid:$1}=Lc(),ha=Zs(),zc=Ti(),z1=ca(),ma=Symbol("fromOffsetCache"),j1=Boolean(L1&&B1),jc=Boolean(pa&&da),zr=class{constructor(e,t={}){if(e===null||typeof e=="undefined"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!jc||/^\w+:\/\//.test(t.from)||da(t.from)?this.file=t.from:this.file=pa(t.from)),jc&&j1){let i=new z1(this.css,t);if(i.text){this.map=i;let n=i.consumer().file;!this.file&&n&&(this.file=this.mapResolve(n))}}this.file||(this.id=""),this.map&&(this.map.file=this.from)}fromOffset(e){let t,i;if(this[ma])i=this[ma];else{let s=this.css.split(` +`);i=new Array(s.length);let a=0;for(let o=0,u=s.length;o=t)n=i.length-1;else{let s=i.length-2,a;for(;n>1),e=i[a+1])n=a+1;else{n=a;break}}return{line:n+1,col:e-i[n]+1}}error(e,t,i,n={}){let s,a,o;if(t&&typeof t=="object"){let c=t,f=i;if(typeof t.offset=="number"){let p=this.fromOffset(c.offset);t=p.line,i=p.col}else t=c.line,i=c.column;if(typeof f.offset=="number"){let p=this.fromOffset(f.offset);a=p.line,o=p.col}else a=f.line,o=f.column}else if(!i){let c=this.fromOffset(t);t=c.line,i=c.col}let u=this.origin(t,i,a,o);return u?s=new zc(e,u.endLine===void 0?u.line:{line:u.line,column:u.column},u.endLine===void 0?u.column:{line:u.endLine,column:u.endColumn},u.source,u.file,n.plugin):s=new zc(e,a===void 0?t:{line:t,column:i},a===void 0?i:{line:a,column:o},this.css,this.file,n.plugin),s.input={line:t,column:i,endLine:a,endColumn:o,source:this.css},this.file&&(Qi&&(s.input.url=Qi(this.file).toString()),s.input.file=this.file),s}origin(e,t,i,n){if(!this.map)return!1;let s=this.map.consumer(),a=s.originalPositionFor({line:e,column:t});if(!a.source)return!1;let o;typeof i=="number"&&(o=s.originalPositionFor({line:i,column:n}));let u;da(a.source)?u=Qi(a.source):u=new URL(a.source,this.map.consumer().sourceRoot||Qi(this.map.mapFile));let c={url:u.toString(),line:a.line,column:a.column,endLine:o&&o.line,endColumn:o&&o.column};if(u.protocol==="file:")if($c)c.file=$c(u);else throw new Error("file: protocol is not available in this PostCSS build");let f=s.sourceContentFor(a.source);return f&&(c.source=f),c}mapResolve(e){return/^\w+:\/\//.test(e)?e:pa(this.map.consumer().sourceRoot||this.map.root||".",e)}get from(){return this.file||this.id}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}};Vc.exports=zr;zr.default=zr;ha&&ha.registerInput&&ha.registerInput(zr)});var Ki=v((bT,Uc)=>{l();"use strict";var V1=Ke(),U1=Mc(),W1=Ji();function Xi(r,e){let t=new W1(r,e),i=new U1(t);try{i.parse()}catch(n){throw n}return i.root}Uc.exports=Xi;Xi.default=Xi;V1.registerParse(Xi)});var wa=v((xT,Yc)=>{l();"use strict";var{isClean:Ie,my:G1}=Pi(),H1=na(),Y1=Ir(),Q1=Ke(),J1=Fi(),vT=oa(),Wc=Bi(),X1=Ki(),K1=At(),Z1={document:"Document",root:"Root",atrule:"AtRule",rule:"Rule",decl:"Declaration",comment:"Comment"},ek={postcssPlugin:!0,prepare:!0,Once:!0,Document:!0,Root:!0,Declaration:!0,Rule:!0,AtRule:!0,Comment:!0,DeclarationExit:!0,RuleExit:!0,AtRuleExit:!0,CommentExit:!0,RootExit:!0,DocumentExit:!0,OnceExit:!0},tk={postcssPlugin:!0,prepare:!0,Once:!0},Ot=0;function jr(r){return typeof r=="object"&&typeof r.then=="function"}function Gc(r){let e=!1,t=Z1[r.type];return r.type==="decl"?e=r.prop.toLowerCase():r.type==="atrule"&&(e=r.name.toLowerCase()),e&&r.append?[t,t+"-"+e,Ot,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:r.append?[t,Ot,t+"Exit"]:[t,t+"Exit"]}function Hc(r){let e;return r.type==="document"?e=["Document",Ot,"DocumentExit"]:r.type==="root"?e=["Root",Ot,"RootExit"]:e=Gc(r),{node:r,events:e,eventIndex:0,visitors:[],visitorIndex:0,iterator:0}}function ga(r){return r[Ie]=!1,r.nodes&&r.nodes.forEach(e=>ga(e)),r}var ya={},ze=class{constructor(e,t,i){this.stringified=!1,this.processed=!1;let n;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))n=ga(t);else if(t instanceof ze||t instanceof Wc)n=ga(t.root),t.map&&(typeof i.map=="undefined"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let s=X1;i.syntax&&(s=i.syntax.parse),i.parser&&(s=i.parser),s.parse&&(s=s.parse);try{n=s(t,i)}catch(a){this.processed=!0,this.error=a}n&&!n[G1]&&Q1.rebuild(n)}this.result=new Wc(e,n,i),this.helpers={...ya,result:this.result,postcss:ya},this.plugins=this.processor.plugins.map(s=>typeof s=="object"&&s.prepare?{...s,...s.prepare(this.result)}:s)}get[Symbol.toStringTag](){return"LazyResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.stringify().css}get content(){return this.stringify().content}get map(){return this.stringify().map}get root(){return this.sync().root}get messages(){return this.sync().messages}warnings(){return this.sync().warnings()}toString(){return this.css}then(e,t){return this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(jr(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ie];)e[Ie]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Y1;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new H1(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[1],this.result}walkSync(e){e[Ie]=!0;let t=Gc(e);for(let i of t)if(i===Ot)e.nodes&&e.each(n=>{n[Ie]||this.walkSync(n)});else{let n=this.listeners[i];if(n&&this.visitSync(n,e.toProxy()))return}}visitSync(e,t){for(let[i,n]of e){this.result.lastPlugin=i;let s;try{s=n(t,this.helpers)}catch(a){throw this.handleError(a,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(jr(s))throw this.getAsyncError()}}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(i=>e.Once(i,this.helpers));return jr(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let i=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(n){console&&console.error&&console.error(n)}return e}async runAsync(){this.plugin=0;for(let e=0;e0;){let i=this.visitTick(t);if(jr(i))try{await i}catch(n){let s=t[t.length-1].node;throw this.handleError(n,s)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let n=e.nodes.map(s=>i(s,this.helpers));await Promise.all(n)}else await i(e,this.helpers)}catch(n){throw this.handleError(n)}}}return this.processed=!0,this.stringify()}prepareVisitors(){this.listeners={};let e=(t,i,n)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,n])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!ek[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!tk[i])if(typeof t[i]=="object")for(let n in t[i])n==="*"?e(t,i,t[i][n]):e(t,i+"-"+n.toLowerCase(),t[i][n]);else typeof t[i]=="function"&&e(t,i,t[i])}this.hasListener=Object.keys(this.listeners).length>0}visitTick(e){let t=e[e.length-1],{node:i,visitors:n}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(n.length>0&&t.visitorIndex{ya=r};Yc.exports=ze;ze.default=ze;K1.registerLazyResult(ze);J1.registerLazyResult(ze)});var Jc=v((ST,Qc)=>{l();"use strict";var rk=na(),ik=Ir(),kT=oa(),nk=Ki(),sk=Bi(),Zi=class{constructor(e,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let n,s=ik;this.result=new sk(this._processor,n,this._opts),this.result.css=t;let a=this;Object.defineProperty(this.result,"root",{get(){return a.root}});let o=new rk(s,n,this._opts,t);if(o.isMap()){let[u,c]=o.generate();u&&(this.result.css=u),c&&(this.result.map=c)}}get[Symbol.toStringTag](){return"NoWorkResult"}get processor(){return this.result.processor}get opts(){return this.result.opts}get css(){return this.result.css}get content(){return this.result.css}get map(){return this.result.map}get root(){if(this._root)return this._root;let e,t=nk;try{e=t(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get messages(){return[]}warnings(){return[]}toString(){return this._css}then(e,t){return this.async().then(e,t)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}sync(){if(this.error)throw this.error;return this.result}};Qc.exports=Zi;Zi.default=Zi});var Kc=v((CT,Xc)=>{l();"use strict";var ak=Jc(),ok=wa(),lk=Fi(),uk=At(),Et=class{constructor(e=[]){this.version="8.4.18",this.plugins=this.normalize(e)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}process(e,t={}){return this.plugins.length===0&&typeof t.parser=="undefined"&&typeof t.stringifier=="undefined"&&typeof t.syntax=="undefined"?new ak(this,e,t):new ok(this,e,t)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}};Xc.exports=Et;Et.default=Et;uk.registerProcessor(Et);lk.registerProcessor(Et)});var ep=v((_T,Zc)=>{l();"use strict";var fk=Mr(),ck=ca(),pk=Fr(),dk=Hi(),hk=Ji(),mk=At(),gk=Yi();function Vr(r,e){if(Array.isArray(r))return r.map(n=>Vr(n));let{inputs:t,...i}=r;if(t){e=[];for(let n of t){let s={...n,__proto__:hk.prototype};s.map&&(s.map={...s.map,__proto__:ck.prototype}),e.push(s)}}if(i.nodes&&(i.nodes=r.nodes.map(n=>Vr(n,e))),i.source){let{inputId:n,...s}=i.source;i.source=s,n!=null&&(i.source.input=e[n])}if(i.type==="root")return new mk(i);if(i.type==="decl")return new fk(i);if(i.type==="rule")return new gk(i);if(i.type==="comment")return new pk(i);if(i.type==="atrule")return new dk(i);throw new Error("Unknown node type: "+r.type)}Zc.exports=Vr;Vr.default=Vr});var me=v((AT,op)=>{l();"use strict";var yk=Ti(),tp=Mr(),wk=wa(),bk=Ke(),ba=Kc(),vk=Ir(),xk=ep(),rp=Fi(),kk=la(),ip=Fr(),np=Hi(),Sk=Bi(),Ck=Ji(),_k=Ki(),Ak=fa(),sp=Yi(),ap=At(),Ok=Rr();function z(...r){return r.length===1&&Array.isArray(r[0])&&(r=r[0]),new ba(r)}z.plugin=function(e,t){let i=!1;function n(...a){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide: +https://evilmartians.com/chronicles/postcss-8-plugin-migration`),m.env.LANG&&m.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357: +https://www.w3ctech.com/topic/2226`));let o=t(...a);return o.postcssPlugin=e,o.postcssVersion=new ba().version,o}let s;return Object.defineProperty(n,"postcss",{get(){return s||(s=n()),s}}),n.process=function(a,o,u){return z([n(u)]).process(a,o)},n};z.stringify=vk;z.parse=_k;z.fromJSON=xk;z.list=Ak;z.comment=r=>new ip(r);z.atRule=r=>new np(r);z.decl=r=>new tp(r);z.rule=r=>new sp(r);z.root=r=>new ap(r);z.document=r=>new rp(r);z.CssSyntaxError=yk;z.Declaration=tp;z.Container=bk;z.Processor=ba;z.Document=rp;z.Comment=ip;z.Warning=kk;z.AtRule=np;z.Result=Sk;z.Input=Ck;z.Rule=sp;z.Root=ap;z.Node=Ok;wk.registerPostcss(z);op.exports=z;z.default=z});var G,j,OT,ET,TT,PT,DT,qT,IT,RT,MT,FT,NT,LT,BT,$T,zT,jT,VT,UT,WT,GT,HT,YT,QT,JT,Ze=A(()=>{l();G=J(me()),j=G.default,OT=G.default.stringify,ET=G.default.fromJSON,TT=G.default.plugin,PT=G.default.parse,DT=G.default.list,qT=G.default.document,IT=G.default.comment,RT=G.default.atRule,MT=G.default.rule,FT=G.default.decl,NT=G.default.root,LT=G.default.CssSyntaxError,BT=G.default.Declaration,$T=G.default.Container,zT=G.default.Processor,jT=G.default.Document,VT=G.default.Comment,UT=G.default.Warning,WT=G.default.AtRule,GT=G.default.Result,HT=G.default.Input,YT=G.default.Rule,QT=G.default.Root,JT=G.default.Node});var va=v((KT,lp)=>{l();lp.exports=function(r,e,t,i,n){for(e=e.split?e.split("."):e,i=0;i(typeof e=="function"&&(e=e({})),Array.isArray(e)&&(e=e[0]),e):r==="fontFamily"?e=>{typeof e=="function"&&(e=e({}));let t=Array.isArray(e)&&ee(e[1])?e[0]:e;return Array.isArray(t)?t.join(", "):t}:["boxShadow","transitionProperty","transitionDuration","transitionDelay","transitionTimingFunction","backgroundImage","backgroundSize","backgroundColor","cursor","animation"].includes(r)?e=>(typeof e=="function"&&(e=e({})),Array.isArray(e)&&(e=e.join(", ")),e):["gridTemplateColumns","gridTemplateRows","objectPosition"].includes(r)?e=>(typeof e=="function"&&(e=e({})),typeof e=="string"&&(e=j.list.comma(e).join(" ")),e):(e,t={})=>(typeof e=="function"&&(e=e(t)),e)}var Ur=A(()=>{l();Ze();wt()});var mp=v((r5,_a)=>{l();var{Rule:up,AtRule:Ek}=me(),fp=De();function xa(r,e){let t;try{fp(i=>{t=i}).processSync(r)}catch(i){throw r.includes(":")?e?e.error("Missed semicolon"):i:e?e.error(i.message):i}return t.at(0)}function cp(r,e){let t=!1;return r.each(i=>{if(i.type==="nesting"){let n=e.clone({});i.value!=="&"?i.replaceWith(xa(i.value.replace("&",n.toString()))):i.replaceWith(n),t=!0}else"nodes"in i&&i.nodes&&cp(i,e)&&(t=!0)}),t}function pp(r,e){let t=[];return r.selectors.forEach(i=>{let n=xa(i,r);e.selectors.forEach(s=>{if(!s)return;let a=xa(s,e);cp(a,n)||(a.prepend(fp.combinator({value:" "})),a.prepend(n.clone({}))),t.push(a.toString())})}),t}function en(r,e){let t=r.prev();for(e.after(r);t&&t.type==="comment";){let i=t.prev();e.after(t),t=i}return r}function Tk(r){return function e(t,i,n,s=n){let a=[];if(i.each(o=>{o.type==="rule"&&n?s&&(o.selectors=pp(t,o)):o.type==="atrule"&&o.nodes?r[o.name]?e(t,o,s):i[Sa]!==!1&&a.push(o):a.push(o)}),n&&a.length){let o=t.clone({nodes:[]});for(let u of a)o.append(u);i.prepend(o)}}}function ka(r,e,t){let i=new up({selector:r,nodes:[]});return i.append(e),t.after(i),i}function dp(r,e){let t={};for(let i of r)t[i]=!0;if(e)for(let i of e)t[i.replace(/^@/,"")]=!0;return t}function Pk(r){r=r.trim();let e=r.match(/^\((.*)\)$/);if(!e)return{type:"basic",selector:r};let t=e[1].match(/^(with(?:out)?):(.+)$/);if(t){let i=t[1]==="with",n=Object.fromEntries(t[2].trim().split(/\s+/).map(a=>[a,!0]));if(i&&n.all)return{type:"noop"};let s=a=>!!n[a];return n.all?s=()=>!0:i&&(s=a=>a==="all"?!1:!n[a]),{type:"withrules",escapes:s}}return{type:"unknown"}}function Dk(r){let e=[],t=r.parent;for(;t&&t instanceof Ek;)e.push(t),t=t.parent;return e}function qk(r){let e=r[hp];if(!e)r.after(r.nodes);else{let t=r.nodes,i,n=-1,s,a,o,u=Dk(r);if(u.forEach((c,f)=>{if(e(c.name))i=c,n=f,a=o;else{let p=o;o=c.clone({nodes:[]}),p&&o.append(p),s=s||o}}),i?a?(s.append(t),i.after(a)):i.after(t):r.after(t),r.next()&&i){let c;u.slice(0,n+1).forEach((f,p,h)=>{let d=c;c=f.clone({nodes:[]}),d&&c.append(d);let y=[],w=(h[p-1]||r).next();for(;w;)y.push(w),w=w.next();c.append(y)}),c&&(a||t[t.length-1]).after(c)}}r.remove()}var Sa=Symbol("rootRuleMergeSel"),hp=Symbol("rootRuleEscapes");function Ik(r){let{params:e}=r,{type:t,selector:i,escapes:n}=Pk(e);if(t==="unknown")throw r.error(`Unknown @${r.name} parameter ${JSON.stringify(e)}`);if(t==="basic"&&i){let s=new up({selector:i,nodes:r.nodes});r.removeAll(),r.append(s)}r[hp]=n,r[Sa]=n?!n("all"):t==="noop"}var Ca=Symbol("hasRootRule");_a.exports=(r={})=>{let e=dp(["media","supports","layer"],r.bubble),t=Tk(e),i=dp(["document","font-face","keyframes","-webkit-keyframes","-moz-keyframes"],r.unwrap),n=(r.rootRuleName||"at-root").replace(/^@/,""),s=r.preserveEmpty;return{postcssPlugin:"postcss-nested",Once(a){a.walkAtRules(n,o=>{Ik(o),a[Ca]=!0})},Rule(a){let o=!1,u=a,c=!1,f=[];a.each(p=>{p.type==="rule"?(f.length&&(u=ka(a.selector,f,u),f=[]),c=!0,o=!0,p.selectors=pp(a,p),u=en(p,u)):p.type==="atrule"?(f.length&&(u=ka(a.selector,f,u),f=[]),p.name===n?(o=!0,t(a,p,!0,p[Sa]),u=en(p,u)):e[p.name]?(c=!0,o=!0,t(a,p,!0),u=en(p,u)):i[p.name]?(c=!0,o=!0,t(a,p,!1),u=en(p,u)):c&&f.push(p)):p.type==="decl"&&c&&f.push(p)}),f.length&&(u=ka(a.selector,f,u)),o&&s!==!0&&(a.raws.semicolon=!0,a.nodes.length===0&&a.remove())},RootExit(a){a[Ca]&&(a.walkAtRules(n,qk),a[Ca]=!1)}}};_a.exports.postcss=!0});var bp=v((i5,wp)=>{l();"use strict";var gp=/-(\w|$)/g,yp=(r,e)=>e.toUpperCase(),Rk=r=>(r=r.toLowerCase(),r==="float"?"cssFloat":r.startsWith("-ms-")?r.substr(1).replace(gp,yp):r.replace(gp,yp));wp.exports=Rk});var Ea=v((n5,vp)=>{l();var Mk=bp(),Fk={boxFlex:!0,boxFlexGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,strokeDashoffset:!0,strokeOpacity:!0,strokeWidth:!0};function Aa(r){return typeof r.nodes=="undefined"?!0:Oa(r)}function Oa(r){let e,t={};return r.each(i=>{if(i.type==="atrule")e="@"+i.name,i.params&&(e+=" "+i.params),typeof t[e]=="undefined"?t[e]=Aa(i):Array.isArray(t[e])?t[e].push(Aa(i)):t[e]=[t[e],Aa(i)];else if(i.type==="rule"){let n=Oa(i);if(t[i.selector])for(let s in n)t[i.selector][s]=n[s];else t[i.selector]=n}else if(i.type==="decl"){i.prop[0]==="-"&&i.prop[1]==="-"?e=i.prop:e=Mk(i.prop);let n=i.value;!isNaN(i.value)&&Fk[e]&&(n=parseFloat(i.value)),i.important&&(n+=" !important"),typeof t[e]=="undefined"?t[e]=n:Array.isArray(t[e])?t[e].push(n):t[e]=[t[e],n]}}),t}vp.exports=Oa});var tn=v((s5,Cp)=>{l();var Wr=me(),xp=/\s*!important\s*$/i,Nk={"box-flex":!0,"box-flex-group":!0,"column-count":!0,flex:!0,"flex-grow":!0,"flex-positive":!0,"flex-shrink":!0,"flex-negative":!0,"font-weight":!0,"line-clamp":!0,"line-height":!0,opacity:!0,order:!0,orphans:!0,"tab-size":!0,widows:!0,"z-index":!0,zoom:!0,"fill-opacity":!0,"stroke-dashoffset":!0,"stroke-opacity":!0,"stroke-width":!0};function Lk(r){return r.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function kp(r,e,t){t===!1||t===null||(e.startsWith("--")||(e=Lk(e)),typeof t=="number"&&(t===0||Nk[e]?t=t.toString():t+="px"),e==="css-float"&&(e="float"),xp.test(t)?(t=t.replace(xp,""),r.push(Wr.decl({prop:e,value:t,important:!0}))):r.push(Wr.decl({prop:e,value:t})))}function Sp(r,e,t){let i=Wr.atRule({name:e[1],params:e[3]||""});typeof t=="object"&&(i.nodes=[],Ta(t,i)),r.push(i)}function Ta(r,e){let t,i,n;for(t in r)if(i=r[t],!(i===null||typeof i=="undefined"))if(t[0]==="@"){let s=t.match(/@(\S+)(\s+([\W\w]*)\s*)?/);if(Array.isArray(i))for(let a of i)Sp(e,s,a);else Sp(e,s,i)}else if(Array.isArray(i))for(let s of i)kp(e,t,s);else typeof i=="object"?(n=Wr.rule({selector:t}),Ta(i,n),e.push(n)):kp(e,t,i)}Cp.exports=function(r){let e=Wr.root();return Ta(r,e),e}});var Pa=v((a5,_p)=>{l();var Bk=Ea();_p.exports=function(e){return console&&console.warn&&e.warnings().forEach(t=>{let i=t.plugin||"PostCSS";console.warn(i+": "+t.text)}),Bk(e.root)}});var Op=v((o5,Ap)=>{l();var $k=me(),zk=Pa(),jk=tn();Ap.exports=function(e){let t=$k(e);return async i=>{let n=await t.process(i,{parser:jk,from:void 0});return zk(n)}}});var Tp=v((l5,Ep)=>{l();var Vk=me(),Uk=Pa(),Wk=tn();Ep.exports=function(r){let e=Vk(r);return t=>{let i=e.process(t,{parser:Wk,from:void 0});return Uk(i)}}});var Dp=v((u5,Pp)=>{l();var Gk=Ea(),Hk=tn(),Yk=Op(),Qk=Tp();Pp.exports={objectify:Gk,parse:Hk,async:Yk,sync:Qk}});var Tt,qp,f5,c5,p5,d5,Ip=A(()=>{l();Tt=J(Dp()),qp=Tt.default,f5=Tt.default.objectify,c5=Tt.default.parse,p5=Tt.default.async,d5=Tt.default.sync});function Pt(r){return Array.isArray(r)?r.flatMap(e=>j([(0,Rp.default)({bubble:["screen"]})]).process(e,{parser:qp}).root.nodes):Pt([r])}var Rp,Da=A(()=>{l();Ze();Rp=J(mp());Ip()});function Dt(r,e,t=!1){return(0,Mp.default)(i=>{i.walkClasses(n=>{let s=n.value,a=t&&s.startsWith("-");n.value=a?`-${r}${s.slice(1)}`:`${r}${s}`})}).processSync(e)}var Mp,rn=A(()=>{l();Mp=J(De())});function ve(r){let e=Fp.default.className();return e.value=r,pt(e?.raws?.value??e.value)}var Fp,qt=A(()=>{l();Fp=J(De());Si()});function qa(r){return pt(`.${ve(r)}`)}function nn(r,e){return qa(Gr(r,e))}function Gr(r,e){return e==="DEFAULT"?r:e==="-"||e==="-DEFAULT"?`-${r}`:e.startsWith("-")?`-${r}${e}`:e.startsWith("/")?`${r}${e}`:`${r}-${e}`}var Ia=A(()=>{l();qt();Si()});function T(r,e=[[r,[r]]],{filterDefault:t=!1,...i}={}){let n=je(r);return function({matchUtilities:s,theme:a}){for(let o of e){let u=Array.isArray(o[0])?o:[o];s(u.reduce((c,[f,p])=>Object.assign(c,{[f]:h=>p.reduce((d,y)=>Array.isArray(y)?Object.assign(d,{[y[0]]:y[1]}):Object.assign(d,{[y]:n(h)}),{})}),{}),{...i,values:t?Object.fromEntries(Object.entries(a(r)??{}).filter(([c])=>c!=="DEFAULT")):a(r)})}}}var Np=A(()=>{l();Ur()});function et(r){return r=Array.isArray(r)?r:[r],r.map(e=>{let t=e.values.map(i=>i.raw!==void 0?i.raw:[i.min&&`(min-width: ${i.min})`,i.max&&`(max-width: ${i.max})`].filter(Boolean).join(" and "));return e.not?`not all and ${t}`:t}).join(", ")}var sn=A(()=>{l()});function Ra(r){return r.split(rS).map(t=>{let i=t.trim(),n={value:i},s=i.split(iS),a=new Set;for(let o of s)!a.has("DIRECTIONS")&&Jk.has(o)?(n.direction=o,a.add("DIRECTIONS")):!a.has("PLAY_STATES")&&Xk.has(o)?(n.playState=o,a.add("PLAY_STATES")):!a.has("FILL_MODES")&&Kk.has(o)?(n.fillMode=o,a.add("FILL_MODES")):!a.has("ITERATION_COUNTS")&&(Zk.has(o)||nS.test(o))?(n.iterationCount=o,a.add("ITERATION_COUNTS")):!a.has("TIMING_FUNCTION")&&eS.has(o)||!a.has("TIMING_FUNCTION")&&tS.some(u=>o.startsWith(`${u}(`))?(n.timingFunction=o,a.add("TIMING_FUNCTION")):!a.has("DURATION")&&Lp.test(o)?(n.duration=o,a.add("DURATION")):!a.has("DELAY")&&Lp.test(o)?(n.delay=o,a.add("DELAY")):a.has("NAME")?(n.unknown||(n.unknown=[]),n.unknown.push(o)):(n.name=o,a.add("NAME"));return n})}var Jk,Xk,Kk,Zk,eS,tS,rS,iS,Lp,nS,Bp=A(()=>{l();Jk=new Set(["normal","reverse","alternate","alternate-reverse"]),Xk=new Set(["running","paused"]),Kk=new Set(["none","forwards","backwards","both"]),Zk=new Set(["infinite"]),eS=new Set(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),tS=["cubic-bezier","steps"],rS=/\,(?![^(]*\))/g,iS=/\ +(?![^(]*\))/g,Lp=/^(-?[\d.]+m?s)$/,nS=/^(\d+)$/});var $p,Z,zp=A(()=>{l();$p=r=>Object.assign({},...Object.entries(r??{}).flatMap(([e,t])=>typeof t=="object"?Object.entries($p(t)).map(([i,n])=>({[e+(i==="DEFAULT"?"":`-${i}`)]:n})):[{[`${e}`]:t}])),Z=$p});var Vp,jp=A(()=>{Vp="3.2.4"});function tt(r,e=!0){return Array.isArray(r)?r.map(t=>{if(e&&Array.isArray(t))throw new Error("The tuple syntax is not supported for `screens`.");if(typeof t=="string")return{name:t.toString(),not:!1,values:[{min:t,max:void 0}]};let[i,n]=t;return i=i.toString(),typeof n=="string"?{name:i,not:!1,values:[{min:n,max:void 0}]}:Array.isArray(n)?{name:i,not:!1,values:n.map(s=>Wp(s))}:{name:i,not:!1,values:[Wp(n)]}}):tt(Object.entries(r??{}),!1)}function an(r){return r.values.length!==1?{result:!1,reason:"multiple-values"}:r.values[0].raw!==void 0?{result:!1,reason:"raw-values"}:r.values[0].min!==void 0&&r.values[0].max!==void 0?{result:!1,reason:"min-and-max"}:{result:!0,reason:null}}function Up(r,e,t){let i=on(e,r),n=on(t,r),s=an(i),a=an(n);if(s.reason==="multiple-values"||a.reason==="multiple-values")throw new Error("Attempted to sort a screen with multiple values. This should never happen. Please open a bug report.");if(s.reason==="raw-values"||a.reason==="raw-values")throw new Error("Attempted to sort a screen with raw values. This should never happen. Please open a bug report.");if(s.reason==="min-and-max"||a.reason==="min-and-max")throw new Error("Attempted to sort a screen with both min and max values. This should never happen. Please open a bug report.");let{min:o,max:u}=i.values[0],{min:c,max:f}=n.values[0];e.not&&([o,u]=[u,o]),t.not&&([c,f]=[f,c]),o=o===void 0?o:parseFloat(o),u=u===void 0?u:parseFloat(u),c=c===void 0?c:parseFloat(c),f=f===void 0?f:parseFloat(f);let[p,h]=r==="min"?[o,c]:[f,u];return p-h}function on(r,e){return typeof r=="object"?r:{name:"arbitrary-screen",values:[{[e]:r}]}}function Wp({"min-width":r,min:e=r,max:t,raw:i}={}){return{min:e,max:t,raw:i}}var ln=A(()=>{l()});function un(r,e){r.walkDecls(t=>{if(e.includes(t.prop)){t.remove();return}for(let i of e)t.value.includes(`/ var(${i})`)&&(t.value=t.value.replace(`/ var(${i})`,""))})}var Gp=A(()=>{l()});var ue,Ee,Re,Me,Hp,Yp=A(()=>{l();Ge();lt();Ze();Np();sn();qt();Bp();zp();Cr();Gs();wt();Ur();jp();Ae();ln();Bs();Gp();$e();Er();ue={pseudoElementVariants:({addVariant:r})=>{r("first-letter","&::first-letter"),r("first-line","&::first-line"),r("marker",[({container:e})=>(un(e,["--tw-text-opacity"]),"& *::marker"),({container:e})=>(un(e,["--tw-text-opacity"]),"&::marker")]),r("selection",["& *::selection","&::selection"]),r("file","&::file-selector-button"),r("placeholder","&::placeholder"),r("backdrop","&::backdrop"),r("before",({container:e})=>(e.walkRules(t=>{let i=!1;t.walkDecls("content",()=>{i=!0}),i||t.prepend(j.decl({prop:"content",value:"var(--tw-content)"}))}),"&::before")),r("after",({container:e})=>(e.walkRules(t=>{let i=!1;t.walkDecls("content",()=>{i=!0}),i||t.prepend(j.decl({prop:"content",value:"var(--tw-content)"}))}),"&::after"))},pseudoClassVariants:({addVariant:r,matchVariant:e,config:t})=>{let i=[["first","&:first-child"],["last","&:last-child"],["only","&:only-child"],["odd","&:nth-child(odd)"],["even","&:nth-child(even)"],"first-of-type","last-of-type","only-of-type",["visited",({container:s})=>(un(s,["--tw-text-opacity","--tw-border-opacity","--tw-bg-opacity"]),"&:visited")],"target",["open","&[open]"],"default","checked","indeterminate","placeholder-shown","autofill","optional","required","valid","invalid","in-range","out-of-range","read-only","empty","focus-within",["hover",K(t(),"hoverOnlyWhenSupported")?"@media (hover: hover) and (pointer: fine) { &:hover }":"&:hover"],"focus","focus-visible","active","enabled","disabled"].map(s=>Array.isArray(s)?s:[s,`&:${s}`]);for(let[s,a]of i)r(s,o=>typeof a=="function"?a(o):a);let n={group:(s,{modifier:a})=>a?[`:merge(.group\\/${a})`," &"]:[":merge(.group)"," &"],peer:(s,{modifier:a})=>a?[`:merge(.peer\\/${a})`," ~ &"]:[":merge(.peer)"," ~ &"]};for(let[s,a]of Object.entries(n))e(s,(o="",u)=>{let c=H(typeof o=="function"?o(u):o);c.includes("&")||(c="&"+c);let[f,p]=a("",u);return c.replace(/&(\S+)?/g,(h,d="")=>f+d+p)},{values:Object.fromEntries(i)})},directionVariants:({addVariant:r})=>{r("ltr",()=>(N.warn("rtl-experimental",["The RTL features in Tailwind CSS are currently in preview.","Preview features are not covered by semver, and may be improved in breaking ways at any time."]),'[dir="ltr"] &')),r("rtl",()=>(N.warn("rtl-experimental",["The RTL features in Tailwind CSS are currently in preview.","Preview features are not covered by semver, and may be improved in breaking ways at any time."]),'[dir="rtl"] &'))},reducedMotionVariants:({addVariant:r})=>{r("motion-safe","@media (prefers-reduced-motion: no-preference)"),r("motion-reduce","@media (prefers-reduced-motion: reduce)")},darkVariants:({config:r,addVariant:e})=>{let[t,i=".dark"]=[].concat(r("darkMode","media"));t===!1&&(t="media",N.warn("darkmode-false",["The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.","Change `darkMode` to `media` or remove it entirely.","https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration"])),t==="class"?e("dark",`${i} &`):t==="media"&&e("dark","@media (prefers-color-scheme: dark)")},printVariant:({addVariant:r})=>{r("print","@media print")},screenVariants:({theme:r,addVariant:e,matchVariant:t})=>{let i=r("screens")??{},n=Object.values(i).every(b=>typeof b=="string"),s=tt(r("screens")),a=new Set([]);function o(b){return b.match(/(\D+)$/)?.[1]??"(none)"}function u(b){b!==void 0&&a.add(o(b))}function c(b){return u(b),a.size===1}for(let b of s)for(let x of b.values)u(x.min),u(x.max);let f=a.size<=1;function p(b){return Object.fromEntries(s.filter(x=>an(x).result).map(x=>{let{min:S,max:_}=x.values[0];if(b==="min"&&S!==void 0)return x;if(b==="min"&&_!==void 0)return{...x,not:!x.not};if(b==="max"&&_!==void 0)return x;if(b==="max"&&S!==void 0)return{...x,not:!x.not}}).map(x=>[x.name,x]))}function h(b){return(x,S)=>Up(b,x.value,S.value)}let d=h("max"),y=h("min");function k(b){return x=>{if(n)if(f){if(typeof x=="string"&&!c(x))return N.warn("minmax-have-mixed-units",["The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units."]),[]}else return N.warn("mixed-screen-units",["The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units."]),[];else return N.warn("complex-screen-config",["The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects."]),[];return[`@media ${et(on(x,b))}`]}}t("max",k("max"),{sort:d,values:n?p("max"):{}});let w="min-screens";for(let b of s)e(b.name,`@media ${et(b)}`,{id:w,sort:n&&f?y:void 0,value:b});t("min",k("min"),{id:w,sort:y})},supportsVariants:({matchVariant:r,theme:e})=>{r("supports",(t="")=>{let i=H(t),n=/^\w*\s*\(/.test(i);return i=n?i.replace(/\b(and|or|not)\b/g," $1 "):i,n?`@supports ${i}`:(i.includes(":")||(i=`${i}: var(--tw)`),i.startsWith("(")&&i.endsWith(")")||(i=`(${i})`),`@supports ${i}`)},{values:e("supports")??{}})},ariaVariants:({matchVariant:r,theme:e})=>{r("aria",t=>`&[aria-${H(t)}]`,{values:e("aria")??{}}),r("group-aria",(t,{modifier:i})=>i?`:merge(.group\\/${i})[aria-${H(t)}] &`:`:merge(.group)[aria-${H(t)}] &`,{values:e("aria")??{}}),r("peer-aria",(t,{modifier:i})=>i?`:merge(.peer\\/${i})[aria-${H(t)}] ~ &`:`:merge(.peer)[aria-${H(t)}] ~ &`,{values:e("aria")??{}})},dataVariants:({matchVariant:r,theme:e})=>{r("data",t=>`&[data-${H(t)}]`,{values:e("data")??{}}),r("group-data",(t,{modifier:i})=>i?`:merge(.group\\/${i})[data-${H(t)}] &`:`:merge(.group)[data-${H(t)}] &`,{values:e("data")??{}}),r("peer-data",(t,{modifier:i})=>i?`:merge(.peer\\/${i})[data-${H(t)}] ~ &`:`:merge(.peer)[data-${H(t)}] ~ &`,{values:e("data")??{}})},orientationVariants:({addVariant:r})=>{r("portrait","@media (orientation: portrait)"),r("landscape","@media (orientation: landscape)")},prefersContrastVariants:({addVariant:r})=>{r("contrast-more","@media (prefers-contrast: more)"),r("contrast-less","@media (prefers-contrast: less)")}},Ee=["translate(var(--tw-translate-x), var(--tw-translate-y))","rotate(var(--tw-rotate))","skewX(var(--tw-skew-x))","skewY(var(--tw-skew-y))","scaleX(var(--tw-scale-x))","scaleY(var(--tw-scale-y))"].join(" "),Re=["var(--tw-blur)","var(--tw-brightness)","var(--tw-contrast)","var(--tw-grayscale)","var(--tw-hue-rotate)","var(--tw-invert)","var(--tw-saturate)","var(--tw-sepia)","var(--tw-drop-shadow)"].join(" "),Me=["var(--tw-backdrop-blur)","var(--tw-backdrop-brightness)","var(--tw-backdrop-contrast)","var(--tw-backdrop-grayscale)","var(--tw-backdrop-hue-rotate)","var(--tw-backdrop-invert)","var(--tw-backdrop-opacity)","var(--tw-backdrop-saturate)","var(--tw-backdrop-sepia)"].join(" "),Hp={preflight:({addBase:r})=>{let e=j.parse(`*,::after,::before{box-sizing:border-box;border-width:0;border-style:solid;border-color:theme('borderColor.DEFAULT', currentColor)}::after,::before{--tw-content:''}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:theme('fontFamily.sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:theme('fontFamily.sans[1].fontFeatureSettings', normal)}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:theme('colors.gray.4', #9ca3af)}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}`);r([j.comment({text:`! tailwindcss v${Vp} | MIT License | https://tailwindcss.com`}),...e.nodes])},container:(()=>{function r(t=[]){return t.flatMap(i=>i.values.map(n=>n.min)).filter(i=>i!==void 0)}function e(t,i,n){if(typeof n=="undefined")return[];if(!(typeof n=="object"&&n!==null))return[{screen:"DEFAULT",minWidth:0,padding:n}];let s=[];n.DEFAULT&&s.push({screen:"DEFAULT",minWidth:0,padding:n.DEFAULT});for(let a of t)for(let o of i)for(let{min:u}of o.values)u===a&&s.push({minWidth:a,padding:n[o.name]});return s}return function({addComponents:t,theme:i}){let n=tt(i("container.screens",i("screens"))),s=r(n),a=e(s,n,i("container.padding")),o=c=>{let f=a.find(p=>p.minWidth===c);return f?{paddingRight:f.padding,paddingLeft:f.padding}:{}},u=Array.from(new Set(s.slice().sort((c,f)=>parseInt(c)-parseInt(f)))).map(c=>({[`@media (min-width: ${c})`]:{".container":{"max-width":c,...o(c)}}}));t([{".container":Object.assign({width:"100%"},i("container.center",!1)?{marginRight:"auto",marginLeft:"auto"}:{},o(0))},...u])}})(),accessibility:({addUtilities:r})=>{r({".sr-only":{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},".not-sr-only":{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto",whiteSpace:"normal"}})},pointerEvents:({addUtilities:r})=>{r({".pointer-events-none":{"pointer-events":"none"},".pointer-events-auto":{"pointer-events":"auto"}})},visibility:({addUtilities:r})=>{r({".visible":{visibility:"visible"},".invisible":{visibility:"hidden"},".collapse":{visibility:"collapse"}})},position:({addUtilities:r})=>{r({".static":{position:"static"},".fixed":{position:"fixed"},".absolute":{position:"absolute"},".relative":{position:"relative"},".sticky":{position:"sticky"}})},inset:T("inset",[["inset",["top","right","bottom","left"]],[["inset-x",["left","right"]],["inset-y",["top","bottom"]]],[["top",["top"]],["right",["right"]],["bottom",["bottom"]],["left",["left"]]]],{supportsNegativeValues:!0}),isolation:({addUtilities:r})=>{r({".isolate":{isolation:"isolate"},".isolation-auto":{isolation:"auto"}})},zIndex:T("zIndex",[["z",["zIndex"]]],{supportsNegativeValues:!0}),order:T("order",void 0,{supportsNegativeValues:!0}),gridColumn:T("gridColumn",[["col",["gridColumn"]]]),gridColumnStart:T("gridColumnStart",[["col-start",["gridColumnStart"]]]),gridColumnEnd:T("gridColumnEnd",[["col-end",["gridColumnEnd"]]]),gridRow:T("gridRow",[["row",["gridRow"]]]),gridRowStart:T("gridRowStart",[["row-start",["gridRowStart"]]]),gridRowEnd:T("gridRowEnd",[["row-end",["gridRowEnd"]]]),float:({addUtilities:r})=>{r({".float-right":{float:"right"},".float-left":{float:"left"},".float-none":{float:"none"}})},clear:({addUtilities:r})=>{r({".clear-left":{clear:"left"},".clear-right":{clear:"right"},".clear-both":{clear:"both"},".clear-none":{clear:"none"}})},margin:T("margin",[["m",["margin"]],[["mx",["margin-left","margin-right"]],["my",["margin-top","margin-bottom"]]],[["mt",["margin-top"]],["mr",["margin-right"]],["mb",["margin-bottom"]],["ml",["margin-left"]]]],{supportsNegativeValues:!0}),boxSizing:({addUtilities:r})=>{r({".box-border":{"box-sizing":"border-box"},".box-content":{"box-sizing":"content-box"}})},display:({addUtilities:r})=>{r({".block":{display:"block"},".inline-block":{display:"inline-block"},".inline":{display:"inline"},".flex":{display:"flex"},".inline-flex":{display:"inline-flex"},".table":{display:"table"},".inline-table":{display:"inline-table"},".table-caption":{display:"table-caption"},".table-cell":{display:"table-cell"},".table-column":{display:"table-column"},".table-column-group":{display:"table-column-group"},".table-footer-group":{display:"table-footer-group"},".table-header-group":{display:"table-header-group"},".table-row-group":{display:"table-row-group"},".table-row":{display:"table-row"},".flow-root":{display:"flow-root"},".grid":{display:"grid"},".inline-grid":{display:"inline-grid"},".contents":{display:"contents"},".list-item":{display:"list-item"},".hidden":{display:"none"}})},aspectRatio:T("aspectRatio",[["aspect",["aspect-ratio"]]]),height:T("height",[["h",["height"]]]),maxHeight:T("maxHeight",[["max-h",["maxHeight"]]]),minHeight:T("minHeight",[["min-h",["minHeight"]]]),width:T("width",[["w",["width"]]]),minWidth:T("minWidth",[["min-w",["minWidth"]]]),maxWidth:T("maxWidth",[["max-w",["maxWidth"]]]),flex:T("flex"),flexShrink:T("flexShrink",[["flex-shrink",["flex-shrink"]],["shrink",["flex-shrink"]]]),flexGrow:T("flexGrow",[["flex-grow",["flex-grow"]],["grow",["flex-grow"]]]),flexBasis:T("flexBasis",[["basis",["flex-basis"]]]),tableLayout:({addUtilities:r})=>{r({".table-auto":{"table-layout":"auto"},".table-fixed":{"table-layout":"fixed"}})},borderCollapse:({addUtilities:r})=>{r({".border-collapse":{"border-collapse":"collapse"},".border-separate":{"border-collapse":"separate"}})},borderSpacing:({addDefaults:r,matchUtilities:e,theme:t})=>{r("border-spacing",{"--tw-border-spacing-x":0,"--tw-border-spacing-y":0}),e({"border-spacing":i=>({"--tw-border-spacing-x":i,"--tw-border-spacing-y":i,"@defaults border-spacing":{},"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"}),"border-spacing-x":i=>({"--tw-border-spacing-x":i,"@defaults border-spacing":{},"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"}),"border-spacing-y":i=>({"--tw-border-spacing-y":i,"@defaults border-spacing":{},"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})},{values:t("borderSpacing")})},transformOrigin:T("transformOrigin",[["origin",["transformOrigin"]]]),translate:T("translate",[[["translate-x",[["@defaults transform",{}],"--tw-translate-x",["transform",Ee]]],["translate-y",[["@defaults transform",{}],"--tw-translate-y",["transform",Ee]]]]],{supportsNegativeValues:!0}),rotate:T("rotate",[["rotate",[["@defaults transform",{}],"--tw-rotate",["transform",Ee]]]],{supportsNegativeValues:!0}),skew:T("skew",[[["skew-x",[["@defaults transform",{}],"--tw-skew-x",["transform",Ee]]],["skew-y",[["@defaults transform",{}],"--tw-skew-y",["transform",Ee]]]]],{supportsNegativeValues:!0}),scale:T("scale",[["scale",[["@defaults transform",{}],"--tw-scale-x","--tw-scale-y",["transform",Ee]]],[["scale-x",[["@defaults transform",{}],"--tw-scale-x",["transform",Ee]]],["scale-y",[["@defaults transform",{}],"--tw-scale-y",["transform",Ee]]]]],{supportsNegativeValues:!0}),transform:({addDefaults:r,addUtilities:e})=>{r("transform",{"--tw-translate-x":"0","--tw-translate-y":"0","--tw-rotate":"0","--tw-skew-x":"0","--tw-skew-y":"0","--tw-scale-x":"1","--tw-scale-y":"1"}),e({".transform":{"@defaults transform":{},transform:Ee},".transform-cpu":{transform:Ee},".transform-gpu":{transform:Ee.replace("translate(var(--tw-translate-x), var(--tw-translate-y))","translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)")},".transform-none":{transform:"none"}})},animation:({matchUtilities:r,theme:e,config:t})=>{let i=s=>`${t("prefix")}${ve(s)}`,n=Object.fromEntries(Object.entries(e("keyframes")??{}).map(([s,a])=>[s,{[`@keyframes ${i(s)}`]:a}]));r({animate:s=>{let a=Ra(s);return[...a.flatMap(o=>n[o.name]),{animation:a.map(({name:o,value:u})=>o===void 0||n[o]===void 0?u:u.replace(o,i(o))).join(", ")}]}},{values:e("animation")})},cursor:T("cursor"),touchAction:({addDefaults:r,addUtilities:e})=>{r("touch-action",{"--tw-pan-x":" ","--tw-pan-y":" ","--tw-pinch-zoom":" "});let t="var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)";e({".touch-auto":{"touch-action":"auto"},".touch-none":{"touch-action":"none"},".touch-pan-x":{"@defaults touch-action":{},"--tw-pan-x":"pan-x","touch-action":t},".touch-pan-left":{"@defaults touch-action":{},"--tw-pan-x":"pan-left","touch-action":t},".touch-pan-right":{"@defaults touch-action":{},"--tw-pan-x":"pan-right","touch-action":t},".touch-pan-y":{"@defaults touch-action":{},"--tw-pan-y":"pan-y","touch-action":t},".touch-pan-up":{"@defaults touch-action":{},"--tw-pan-y":"pan-up","touch-action":t},".touch-pan-down":{"@defaults touch-action":{},"--tw-pan-y":"pan-down","touch-action":t},".touch-pinch-zoom":{"@defaults touch-action":{},"--tw-pinch-zoom":"pinch-zoom","touch-action":t},".touch-manipulation":{"touch-action":"manipulation"}})},userSelect:({addUtilities:r})=>{r({".select-none":{"user-select":"none"},".select-text":{"user-select":"text"},".select-all":{"user-select":"all"},".select-auto":{"user-select":"auto"}})},resize:({addUtilities:r})=>{r({".resize-none":{resize:"none"},".resize-y":{resize:"vertical"},".resize-x":{resize:"horizontal"},".resize":{resize:"both"}})},scrollSnapType:({addDefaults:r,addUtilities:e})=>{r("scroll-snap-type",{"--tw-scroll-snap-strictness":"proximity"}),e({".snap-none":{"scroll-snap-type":"none"},".snap-x":{"@defaults scroll-snap-type":{},"scroll-snap-type":"x var(--tw-scroll-snap-strictness)"},".snap-y":{"@defaults scroll-snap-type":{},"scroll-snap-type":"y var(--tw-scroll-snap-strictness)"},".snap-both":{"@defaults scroll-snap-type":{},"scroll-snap-type":"both var(--tw-scroll-snap-strictness)"},".snap-mandatory":{"--tw-scroll-snap-strictness":"mandatory"},".snap-proximity":{"--tw-scroll-snap-strictness":"proximity"}})},scrollSnapAlign:({addUtilities:r})=>{r({".snap-start":{"scroll-snap-align":"start"},".snap-end":{"scroll-snap-align":"end"},".snap-center":{"scroll-snap-align":"center"},".snap-align-none":{"scroll-snap-align":"none"}})},scrollSnapStop:({addUtilities:r})=>{r({".snap-normal":{"scroll-snap-stop":"normal"},".snap-always":{"scroll-snap-stop":"always"}})},scrollMargin:T("scrollMargin",[["scroll-m",["scroll-margin"]],[["scroll-mx",["scroll-margin-left","scroll-margin-right"]],["scroll-my",["scroll-margin-top","scroll-margin-bottom"]]],[["scroll-mt",["scroll-margin-top"]],["scroll-mr",["scroll-margin-right"]],["scroll-mb",["scroll-margin-bottom"]],["scroll-ml",["scroll-margin-left"]]]],{supportsNegativeValues:!0}),scrollPadding:T("scrollPadding",[["scroll-p",["scroll-padding"]],[["scroll-px",["scroll-padding-left","scroll-padding-right"]],["scroll-py",["scroll-padding-top","scroll-padding-bottom"]]],[["scroll-pt",["scroll-padding-top"]],["scroll-pr",["scroll-padding-right"]],["scroll-pb",["scroll-padding-bottom"]],["scroll-pl",["scroll-padding-left"]]]]),listStylePosition:({addUtilities:r})=>{r({".list-inside":{"list-style-position":"inside"},".list-outside":{"list-style-position":"outside"}})},listStyleType:T("listStyleType",[["list",["listStyleType"]]]),appearance:({addUtilities:r})=>{r({".appearance-none":{appearance:"none"}})},columns:T("columns",[["columns",["columns"]]]),breakBefore:({addUtilities:r})=>{r({".break-before-auto":{"break-before":"auto"},".break-before-avoid":{"break-before":"avoid"},".break-before-all":{"break-before":"all"},".break-before-avoid-page":{"break-before":"avoid-page"},".break-before-page":{"break-before":"page"},".break-before-left":{"break-before":"left"},".break-before-right":{"break-before":"right"},".break-before-column":{"break-before":"column"}})},breakInside:({addUtilities:r})=>{r({".break-inside-auto":{"break-inside":"auto"},".break-inside-avoid":{"break-inside":"avoid"},".break-inside-avoid-page":{"break-inside":"avoid-page"},".break-inside-avoid-column":{"break-inside":"avoid-column"}})},breakAfter:({addUtilities:r})=>{r({".break-after-auto":{"break-after":"auto"},".break-after-avoid":{"break-after":"avoid"},".break-after-all":{"break-after":"all"},".break-after-avoid-page":{"break-after":"avoid-page"},".break-after-page":{"break-after":"page"},".break-after-left":{"break-after":"left"},".break-after-right":{"break-after":"right"},".break-after-column":{"break-after":"column"}})},gridAutoColumns:T("gridAutoColumns",[["auto-cols",["gridAutoColumns"]]]),gridAutoFlow:({addUtilities:r})=>{r({".grid-flow-row":{gridAutoFlow:"row"},".grid-flow-col":{gridAutoFlow:"column"},".grid-flow-dense":{gridAutoFlow:"dense"},".grid-flow-row-dense":{gridAutoFlow:"row dense"},".grid-flow-col-dense":{gridAutoFlow:"column dense"}})},gridAutoRows:T("gridAutoRows",[["auto-rows",["gridAutoRows"]]]),gridTemplateColumns:T("gridTemplateColumns",[["grid-cols",["gridTemplateColumns"]]]),gridTemplateRows:T("gridTemplateRows",[["grid-rows",["gridTemplateRows"]]]),flexDirection:({addUtilities:r})=>{r({".flex-row":{"flex-direction":"row"},".flex-row-reverse":{"flex-direction":"row-reverse"},".flex-col":{"flex-direction":"column"},".flex-col-reverse":{"flex-direction":"column-reverse"}})},flexWrap:({addUtilities:r})=>{r({".flex-wrap":{"flex-wrap":"wrap"},".flex-wrap-reverse":{"flex-wrap":"wrap-reverse"},".flex-nowrap":{"flex-wrap":"nowrap"}})},placeContent:({addUtilities:r})=>{r({".place-content-center":{"place-content":"center"},".place-content-start":{"place-content":"start"},".place-content-end":{"place-content":"end"},".place-content-between":{"place-content":"space-between"},".place-content-around":{"place-content":"space-around"},".place-content-evenly":{"place-content":"space-evenly"},".place-content-baseline":{"place-content":"baseline"},".place-content-stretch":{"place-content":"stretch"}})},placeItems:({addUtilities:r})=>{r({".place-items-start":{"place-items":"start"},".place-items-end":{"place-items":"end"},".place-items-center":{"place-items":"center"},".place-items-baseline":{"place-items":"baseline"},".place-items-stretch":{"place-items":"stretch"}})},alignContent:({addUtilities:r})=>{r({".content-center":{"align-content":"center"},".content-start":{"align-content":"flex-start"},".content-end":{"align-content":"flex-end"},".content-between":{"align-content":"space-between"},".content-around":{"align-content":"space-around"},".content-evenly":{"align-content":"space-evenly"},".content-baseline":{"align-content":"baseline"}})},alignItems:({addUtilities:r})=>{r({".items-start":{"align-items":"flex-start"},".items-end":{"align-items":"flex-end"},".items-center":{"align-items":"center"},".items-baseline":{"align-items":"baseline"},".items-stretch":{"align-items":"stretch"}})},justifyContent:({addUtilities:r})=>{r({".justify-start":{"justify-content":"flex-start"},".justify-end":{"justify-content":"flex-end"},".justify-center":{"justify-content":"center"},".justify-between":{"justify-content":"space-between"},".justify-around":{"justify-content":"space-around"},".justify-evenly":{"justify-content":"space-evenly"}})},justifyItems:({addUtilities:r})=>{r({".justify-items-start":{"justify-items":"start"},".justify-items-end":{"justify-items":"end"},".justify-items-center":{"justify-items":"center"},".justify-items-stretch":{"justify-items":"stretch"}})},gap:T("gap",[["gap",["gap"]],[["gap-x",["columnGap"]],["gap-y",["rowGap"]]]]),space:({matchUtilities:r,addUtilities:e,theme:t})=>{r({"space-x":i=>(i=i==="0"?"0px":i,{"& > :not([hidden]) ~ :not([hidden])":{"--tw-space-x-reverse":"0","margin-right":`calc(${i} * var(--tw-space-x-reverse))`,"margin-left":`calc(${i} * calc(1 - var(--tw-space-x-reverse)))`}}),"space-y":i=>(i=i==="0"?"0px":i,{"& > :not([hidden]) ~ :not([hidden])":{"--tw-space-y-reverse":"0","margin-top":`calc(${i} * calc(1 - var(--tw-space-y-reverse)))`,"margin-bottom":`calc(${i} * var(--tw-space-y-reverse))`}})},{values:t("space"),supportsNegativeValues:!0}),e({".space-y-reverse > :not([hidden]) ~ :not([hidden])":{"--tw-space-y-reverse":"1"},".space-x-reverse > :not([hidden]) ~ :not([hidden])":{"--tw-space-x-reverse":"1"}})},divideWidth:({matchUtilities:r,addUtilities:e,theme:t})=>{r({"divide-x":i=>(i=i==="0"?"0px":i,{"& > :not([hidden]) ~ :not([hidden])":{"@defaults border-width":{},"--tw-divide-x-reverse":"0","border-right-width":`calc(${i} * var(--tw-divide-x-reverse))`,"border-left-width":`calc(${i} * calc(1 - var(--tw-divide-x-reverse)))`}}),"divide-y":i=>(i=i==="0"?"0px":i,{"& > :not([hidden]) ~ :not([hidden])":{"@defaults border-width":{},"--tw-divide-y-reverse":"0","border-top-width":`calc(${i} * calc(1 - var(--tw-divide-y-reverse)))`,"border-bottom-width":`calc(${i} * var(--tw-divide-y-reverse))`}})},{values:t("divideWidth"),type:["line-width","length","any"]}),e({".divide-y-reverse > :not([hidden]) ~ :not([hidden])":{"@defaults border-width":{},"--tw-divide-y-reverse":"1"},".divide-x-reverse > :not([hidden]) ~ :not([hidden])":{"@defaults border-width":{},"--tw-divide-x-reverse":"1"}})},divideStyle:({addUtilities:r})=>{r({".divide-solid > :not([hidden]) ~ :not([hidden])":{"border-style":"solid"},".divide-dashed > :not([hidden]) ~ :not([hidden])":{"border-style":"dashed"},".divide-dotted > :not([hidden]) ~ :not([hidden])":{"border-style":"dotted"},".divide-double > :not([hidden]) ~ :not([hidden])":{"border-style":"double"},".divide-none > :not([hidden]) ~ :not([hidden])":{"border-style":"none"}})},divideColor:({matchUtilities:r,theme:e,corePlugins:t})=>{r({divide:i=>t("divideOpacity")?{["& > :not([hidden]) ~ :not([hidden])"]:le({color:i,property:"border-color",variable:"--tw-divide-opacity"})}:{["& > :not([hidden]) ~ :not([hidden])"]:{"border-color":$(i)}}},{values:(({DEFAULT:i,...n})=>n)(Z(e("divideColor"))),type:["color","any"]})},divideOpacity:({matchUtilities:r,theme:e})=>{r({"divide-opacity":t=>({["& > :not([hidden]) ~ :not([hidden])"]:{"--tw-divide-opacity":t}})},{values:e("divideOpacity")})},placeSelf:({addUtilities:r})=>{r({".place-self-auto":{"place-self":"auto"},".place-self-start":{"place-self":"start"},".place-self-end":{"place-self":"end"},".place-self-center":{"place-self":"center"},".place-self-stretch":{"place-self":"stretch"}})},alignSelf:({addUtilities:r})=>{r({".self-auto":{"align-self":"auto"},".self-start":{"align-self":"flex-start"},".self-end":{"align-self":"flex-end"},".self-center":{"align-self":"center"},".self-stretch":{"align-self":"stretch"},".self-baseline":{"align-self":"baseline"}})},justifySelf:({addUtilities:r})=>{r({".justify-self-auto":{"justify-self":"auto"},".justify-self-start":{"justify-self":"start"},".justify-self-end":{"justify-self":"end"},".justify-self-center":{"justify-self":"center"},".justify-self-stretch":{"justify-self":"stretch"}})},overflow:({addUtilities:r})=>{r({".overflow-auto":{overflow:"auto"},".overflow-hidden":{overflow:"hidden"},".overflow-clip":{overflow:"clip"},".overflow-visible":{overflow:"visible"},".overflow-scroll":{overflow:"scroll"},".overflow-x-auto":{"overflow-x":"auto"},".overflow-y-auto":{"overflow-y":"auto"},".overflow-x-hidden":{"overflow-x":"hidden"},".overflow-y-hidden":{"overflow-y":"hidden"},".overflow-x-clip":{"overflow-x":"clip"},".overflow-y-clip":{"overflow-y":"clip"},".overflow-x-visible":{"overflow-x":"visible"},".overflow-y-visible":{"overflow-y":"visible"},".overflow-x-scroll":{"overflow-x":"scroll"},".overflow-y-scroll":{"overflow-y":"scroll"}})},overscrollBehavior:({addUtilities:r})=>{r({".overscroll-auto":{"overscroll-behavior":"auto"},".overscroll-contain":{"overscroll-behavior":"contain"},".overscroll-none":{"overscroll-behavior":"none"},".overscroll-y-auto":{"overscroll-behavior-y":"auto"},".overscroll-y-contain":{"overscroll-behavior-y":"contain"},".overscroll-y-none":{"overscroll-behavior-y":"none"},".overscroll-x-auto":{"overscroll-behavior-x":"auto"},".overscroll-x-contain":{"overscroll-behavior-x":"contain"},".overscroll-x-none":{"overscroll-behavior-x":"none"}})},scrollBehavior:({addUtilities:r})=>{r({".scroll-auto":{"scroll-behavior":"auto"},".scroll-smooth":{"scroll-behavior":"smooth"}})},textOverflow:({addUtilities:r})=>{r({".truncate":{overflow:"hidden","text-overflow":"ellipsis","white-space":"nowrap"},".overflow-ellipsis":{"text-overflow":"ellipsis"},".text-ellipsis":{"text-overflow":"ellipsis"},".text-clip":{"text-overflow":"clip"}})},whitespace:({addUtilities:r})=>{r({".whitespace-normal":{"white-space":"normal"},".whitespace-nowrap":{"white-space":"nowrap"},".whitespace-pre":{"white-space":"pre"},".whitespace-pre-line":{"white-space":"pre-line"},".whitespace-pre-wrap":{"white-space":"pre-wrap"}})},wordBreak:({addUtilities:r})=>{r({".break-normal":{"overflow-wrap":"normal","word-break":"normal"},".break-words":{"overflow-wrap":"break-word"},".break-all":{"word-break":"break-all"},".break-keep":{"word-break":"keep-all"}})},borderRadius:T("borderRadius",[["rounded",["border-radius"]],[["rounded-t",["border-top-left-radius","border-top-right-radius"]],["rounded-r",["border-top-right-radius","border-bottom-right-radius"]],["rounded-b",["border-bottom-right-radius","border-bottom-left-radius"]],["rounded-l",["border-top-left-radius","border-bottom-left-radius"]]],[["rounded-tl",["border-top-left-radius"]],["rounded-tr",["border-top-right-radius"]],["rounded-br",["border-bottom-right-radius"]],["rounded-bl",["border-bottom-left-radius"]]]]),borderWidth:T("borderWidth",[["border",[["@defaults border-width",{}],"border-width"]],[["border-x",[["@defaults border-width",{}],"border-left-width","border-right-width"]],["border-y",[["@defaults border-width",{}],"border-top-width","border-bottom-width"]]],[["border-t",[["@defaults border-width",{}],"border-top-width"]],["border-r",[["@defaults border-width",{}],"border-right-width"]],["border-b",[["@defaults border-width",{}],"border-bottom-width"]],["border-l",[["@defaults border-width",{}],"border-left-width"]]]],{type:["line-width","length"]}),borderStyle:({addUtilities:r})=>{r({".border-solid":{"border-style":"solid"},".border-dashed":{"border-style":"dashed"},".border-dotted":{"border-style":"dotted"},".border-double":{"border-style":"double"},".border-hidden":{"border-style":"hidden"},".border-none":{"border-style":"none"}})},borderColor:({matchUtilities:r,theme:e,corePlugins:t})=>{r({border:i=>t("borderOpacity")?le({color:i,property:"border-color",variable:"--tw-border-opacity"}):{"border-color":$(i)}},{values:(({DEFAULT:i,...n})=>n)(Z(e("borderColor"))),type:["color","any"]}),r({"border-x":i=>t("borderOpacity")?le({color:i,property:["border-left-color","border-right-color"],variable:"--tw-border-opacity"}):{"border-left-color":$(i),"border-right-color":$(i)},"border-y":i=>t("borderOpacity")?le({color:i,property:["border-top-color","border-bottom-color"],variable:"--tw-border-opacity"}):{"border-top-color":$(i),"border-bottom-color":$(i)}},{values:(({DEFAULT:i,...n})=>n)(Z(e("borderColor"))),type:["color","any"]}),r({"border-t":i=>t("borderOpacity")?le({color:i,property:"border-top-color",variable:"--tw-border-opacity"}):{"border-top-color":$(i)},"border-r":i=>t("borderOpacity")?le({color:i,property:"border-right-color",variable:"--tw-border-opacity"}):{"border-right-color":$(i)},"border-b":i=>t("borderOpacity")?le({color:i,property:"border-bottom-color",variable:"--tw-border-opacity"}):{"border-bottom-color":$(i)},"border-l":i=>t("borderOpacity")?le({color:i,property:"border-left-color",variable:"--tw-border-opacity"}):{"border-left-color":$(i)}},{values:(({DEFAULT:i,...n})=>n)(Z(e("borderColor"))),type:["color","any"]})},borderOpacity:T("borderOpacity",[["border-opacity",["--tw-border-opacity"]]]),backgroundColor:({matchUtilities:r,theme:e,corePlugins:t})=>{r({bg:i=>t("backgroundOpacity")?le({color:i,property:"background-color",variable:"--tw-bg-opacity"}):{"background-color":$(i)}},{values:Z(e("backgroundColor")),type:["color","any"]})},backgroundOpacity:T("backgroundOpacity",[["bg-opacity",["--tw-bg-opacity"]]]),backgroundImage:T("backgroundImage",[["bg",["background-image"]]],{type:["lookup","image","url"]}),gradientColorStops:(()=>{function r(e){return qe(e,0,"rgb(255 255 255 / 0)")}return function({matchUtilities:e,theme:t}){let i={values:Z(t("gradientColorStops")),type:["color","any"]};e({from:n=>{let s=r(n);return{"--tw-gradient-from":$(n,"from"),"--tw-gradient-to":s,"--tw-gradient-stops":"var(--tw-gradient-from), var(--tw-gradient-to)"}}},i),e({via:n=>({"--tw-gradient-to":r(n),"--tw-gradient-stops":`var(--tw-gradient-from), ${$(n,"via")}, var(--tw-gradient-to)`})},i),e({to:n=>({"--tw-gradient-to":$(n,"to")})},i)}})(),boxDecorationBreak:({addUtilities:r})=>{r({".decoration-slice":{"box-decoration-break":"slice"},".decoration-clone":{"box-decoration-break":"clone"},".box-decoration-slice":{"box-decoration-break":"slice"},".box-decoration-clone":{"box-decoration-break":"clone"}})},backgroundSize:T("backgroundSize",[["bg",["background-size"]]],{type:["lookup","length","percentage","size"]}),backgroundAttachment:({addUtilities:r})=>{r({".bg-fixed":{"background-attachment":"fixed"},".bg-local":{"background-attachment":"local"},".bg-scroll":{"background-attachment":"scroll"}})},backgroundClip:({addUtilities:r})=>{r({".bg-clip-border":{"background-clip":"border-box"},".bg-clip-padding":{"background-clip":"padding-box"},".bg-clip-content":{"background-clip":"content-box"},".bg-clip-text":{"background-clip":"text"}})},backgroundPosition:T("backgroundPosition",[["bg",["background-position"]]],{type:["lookup",["position",{preferOnConflict:!0}]]}),backgroundRepeat:({addUtilities:r})=>{r({".bg-repeat":{"background-repeat":"repeat"},".bg-no-repeat":{"background-repeat":"no-repeat"},".bg-repeat-x":{"background-repeat":"repeat-x"},".bg-repeat-y":{"background-repeat":"repeat-y"},".bg-repeat-round":{"background-repeat":"round"},".bg-repeat-space":{"background-repeat":"space"}})},backgroundOrigin:({addUtilities:r})=>{r({".bg-origin-border":{"background-origin":"border-box"},".bg-origin-padding":{"background-origin":"padding-box"},".bg-origin-content":{"background-origin":"content-box"}})},fill:({matchUtilities:r,theme:e})=>{r({fill:t=>({fill:$(t)})},{values:Z(e("fill")),type:["color","any"]})},stroke:({matchUtilities:r,theme:e})=>{r({stroke:t=>({stroke:$(t)})},{values:Z(e("stroke")),type:["color","url","any"]})},strokeWidth:T("strokeWidth",[["stroke",["stroke-width"]]],{type:["length","number","percentage"]}),objectFit:({addUtilities:r})=>{r({".object-contain":{"object-fit":"contain"},".object-cover":{"object-fit":"cover"},".object-fill":{"object-fit":"fill"},".object-none":{"object-fit":"none"},".object-scale-down":{"object-fit":"scale-down"}})},objectPosition:T("objectPosition",[["object",["object-position"]]]),padding:T("padding",[["p",["padding"]],[["px",["padding-left","padding-right"]],["py",["padding-top","padding-bottom"]]],[["pt",["padding-top"]],["pr",["padding-right"]],["pb",["padding-bottom"]],["pl",["padding-left"]]]]),textAlign:({addUtilities:r})=>{r({".text-left":{"text-align":"left"},".text-center":{"text-align":"center"},".text-right":{"text-align":"right"},".text-justify":{"text-align":"justify"},".text-start":{"text-align":"start"},".text-end":{"text-align":"end"}})},textIndent:T("textIndent",[["indent",["text-indent"]]],{supportsNegativeValues:!0}),verticalAlign:({addUtilities:r,matchUtilities:e})=>{r({".align-baseline":{"vertical-align":"baseline"},".align-top":{"vertical-align":"top"},".align-middle":{"vertical-align":"middle"},".align-bottom":{"vertical-align":"bottom"},".align-text-top":{"vertical-align":"text-top"},".align-text-bottom":{"vertical-align":"text-bottom"},".align-sub":{"vertical-align":"sub"},".align-super":{"vertical-align":"super"}}),e({align:t=>({"vertical-align":t})})},fontFamily:({matchUtilities:r,theme:e})=>{r({font:t=>{let[i,n={}]=Array.isArray(t)&&ee(t[1])?t:[t],{fontFeatureSettings:s}=n;return{"font-family":Array.isArray(i)?i.join(", "):i,...s===void 0?{}:{"font-feature-settings":s}}}},{values:e("fontFamily"),type:["lookup","generic-name","family-name"]})},fontSize:({matchUtilities:r,theme:e})=>{r({text:t=>{let[i,n]=Array.isArray(t)?t:[t],{lineHeight:s,letterSpacing:a,fontWeight:o}=ee(n)?n:{lineHeight:n};return{"font-size":i,...s===void 0?{}:{"line-height":s},...a===void 0?{}:{"letter-spacing":a},...o===void 0?{}:{"font-weight":o}}}},{values:e("fontSize"),type:["absolute-size","relative-size","length","percentage"]})},fontWeight:T("fontWeight",[["font",["fontWeight"]]],{type:["lookup","number","any"]}),textTransform:({addUtilities:r})=>{r({".uppercase":{"text-transform":"uppercase"},".lowercase":{"text-transform":"lowercase"},".capitalize":{"text-transform":"capitalize"},".normal-case":{"text-transform":"none"}})},fontStyle:({addUtilities:r})=>{r({".italic":{"font-style":"italic"},".not-italic":{"font-style":"normal"}})},fontVariantNumeric:({addDefaults:r,addUtilities:e})=>{let t="var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)";r("font-variant-numeric",{"--tw-ordinal":" ","--tw-slashed-zero":" ","--tw-numeric-figure":" ","--tw-numeric-spacing":" ","--tw-numeric-fraction":" "}),e({".normal-nums":{"font-variant-numeric":"normal"},".ordinal":{"@defaults font-variant-numeric":{},"--tw-ordinal":"ordinal","font-variant-numeric":t},".slashed-zero":{"@defaults font-variant-numeric":{},"--tw-slashed-zero":"slashed-zero","font-variant-numeric":t},".lining-nums":{"@defaults font-variant-numeric":{},"--tw-numeric-figure":"lining-nums","font-variant-numeric":t},".oldstyle-nums":{"@defaults font-variant-numeric":{},"--tw-numeric-figure":"oldstyle-nums","font-variant-numeric":t},".proportional-nums":{"@defaults font-variant-numeric":{},"--tw-numeric-spacing":"proportional-nums","font-variant-numeric":t},".tabular-nums":{"@defaults font-variant-numeric":{},"--tw-numeric-spacing":"tabular-nums","font-variant-numeric":t},".diagonal-fractions":{"@defaults font-variant-numeric":{},"--tw-numeric-fraction":"diagonal-fractions","font-variant-numeric":t},".stacked-fractions":{"@defaults font-variant-numeric":{},"--tw-numeric-fraction":"stacked-fractions","font-variant-numeric":t}})},lineHeight:T("lineHeight",[["leading",["lineHeight"]]]),letterSpacing:T("letterSpacing",[["tracking",["letterSpacing"]]],{supportsNegativeValues:!0}),textColor:({matchUtilities:r,theme:e,corePlugins:t})=>{r({text:i=>t("textOpacity")?le({color:i,property:"color",variable:"--tw-text-opacity"}):{color:$(i)}},{values:Z(e("textColor")),type:["color","any"]})},textOpacity:T("textOpacity",[["text-opacity",["--tw-text-opacity"]]]),textDecoration:({addUtilities:r})=>{r({".underline":{"text-decoration-line":"underline"},".overline":{"text-decoration-line":"overline"},".line-through":{"text-decoration-line":"line-through"},".no-underline":{"text-decoration-line":"none"}})},textDecorationColor:({matchUtilities:r,theme:e})=>{r({decoration:t=>({"text-decoration-color":$(t)})},{values:Z(e("textDecorationColor")),type:["color","any"]})},textDecorationStyle:({addUtilities:r})=>{r({".decoration-solid":{"text-decoration-style":"solid"},".decoration-double":{"text-decoration-style":"double"},".decoration-dotted":{"text-decoration-style":"dotted"},".decoration-dashed":{"text-decoration-style":"dashed"},".decoration-wavy":{"text-decoration-style":"wavy"}})},textDecorationThickness:T("textDecorationThickness",[["decoration",["text-decoration-thickness"]]],{type:["length","percentage"]}),textUnderlineOffset:T("textUnderlineOffset",[["underline-offset",["text-underline-offset"]]],{type:["length","percentage","any"]}),fontSmoothing:({addUtilities:r})=>{r({".antialiased":{"-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale"},".subpixel-antialiased":{"-webkit-font-smoothing":"auto","-moz-osx-font-smoothing":"auto"}})},placeholderColor:({matchUtilities:r,theme:e,corePlugins:t})=>{r({placeholder:i=>t("placeholderOpacity")?{"&::placeholder":le({color:i,property:"color",variable:"--tw-placeholder-opacity"})}:{"&::placeholder":{color:$(i)}}},{values:Z(e("placeholderColor")),type:["color","any"]})},placeholderOpacity:({matchUtilities:r,theme:e})=>{r({"placeholder-opacity":t=>({["&::placeholder"]:{"--tw-placeholder-opacity":t}})},{values:e("placeholderOpacity")})},caretColor:({matchUtilities:r,theme:e})=>{r({caret:t=>({"caret-color":$(t)})},{values:Z(e("caretColor")),type:["color","any"]})},accentColor:({matchUtilities:r,theme:e})=>{r({accent:t=>({"accent-color":$(t)})},{values:Z(e("accentColor")),type:["color","any"]})},opacity:T("opacity",[["opacity",["opacity"]]]),backgroundBlendMode:({addUtilities:r})=>{r({".bg-blend-normal":{"background-blend-mode":"normal"},".bg-blend-multiply":{"background-blend-mode":"multiply"},".bg-blend-screen":{"background-blend-mode":"screen"},".bg-blend-overlay":{"background-blend-mode":"overlay"},".bg-blend-darken":{"background-blend-mode":"darken"},".bg-blend-lighten":{"background-blend-mode":"lighten"},".bg-blend-color-dodge":{"background-blend-mode":"color-dodge"},".bg-blend-color-burn":{"background-blend-mode":"color-burn"},".bg-blend-hard-light":{"background-blend-mode":"hard-light"},".bg-blend-soft-light":{"background-blend-mode":"soft-light"},".bg-blend-difference":{"background-blend-mode":"difference"},".bg-blend-exclusion":{"background-blend-mode":"exclusion"},".bg-blend-hue":{"background-blend-mode":"hue"},".bg-blend-saturation":{"background-blend-mode":"saturation"},".bg-blend-color":{"background-blend-mode":"color"},".bg-blend-luminosity":{"background-blend-mode":"luminosity"}})},mixBlendMode:({addUtilities:r})=>{r({".mix-blend-normal":{"mix-blend-mode":"normal"},".mix-blend-multiply":{"mix-blend-mode":"multiply"},".mix-blend-screen":{"mix-blend-mode":"screen"},".mix-blend-overlay":{"mix-blend-mode":"overlay"},".mix-blend-darken":{"mix-blend-mode":"darken"},".mix-blend-lighten":{"mix-blend-mode":"lighten"},".mix-blend-color-dodge":{"mix-blend-mode":"color-dodge"},".mix-blend-color-burn":{"mix-blend-mode":"color-burn"},".mix-blend-hard-light":{"mix-blend-mode":"hard-light"},".mix-blend-soft-light":{"mix-blend-mode":"soft-light"},".mix-blend-difference":{"mix-blend-mode":"difference"},".mix-blend-exclusion":{"mix-blend-mode":"exclusion"},".mix-blend-hue":{"mix-blend-mode":"hue"},".mix-blend-saturation":{"mix-blend-mode":"saturation"},".mix-blend-color":{"mix-blend-mode":"color"},".mix-blend-luminosity":{"mix-blend-mode":"luminosity"},".mix-blend-plus-lighter":{"mix-blend-mode":"plus-lighter"}})},boxShadow:(()=>{let r=je("boxShadow"),e=["var(--tw-ring-offset-shadow, 0 0 #0000)","var(--tw-ring-shadow, 0 0 #0000)","var(--tw-shadow)"].join(", ");return function({matchUtilities:t,addDefaults:i,theme:n}){i(" box-shadow",{"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),t({shadow:s=>{s=r(s);let a=_i(s);for(let o of a)!o.valid||(o.color="var(--tw-shadow-color)");return{"@defaults box-shadow":{},"--tw-shadow":s==="none"?"0 0 #0000":s,"--tw-shadow-colored":s==="none"?"0 0 #0000":hf(a),"box-shadow":e}}},{values:n("boxShadow"),type:["shadow"]})}})(),boxShadowColor:({matchUtilities:r,theme:e})=>{r({shadow:t=>({"--tw-shadow-color":$(t),"--tw-shadow":"var(--tw-shadow-colored)"})},{values:Z(e("boxShadowColor")),type:["color","any"]})},outlineStyle:({addUtilities:r})=>{r({".outline-none":{outline:"2px solid transparent","outline-offset":"2px"},".outline":{"outline-style":"solid"},".outline-dashed":{"outline-style":"dashed"},".outline-dotted":{"outline-style":"dotted"},".outline-double":{"outline-style":"double"}})},outlineWidth:T("outlineWidth",[["outline",["outline-width"]]],{type:["length","number","percentage"]}),outlineOffset:T("outlineOffset",[["outline-offset",["outline-offset"]]],{type:["length","number","percentage","any"],supportsNegativeValues:!0}),outlineColor:({matchUtilities:r,theme:e})=>{r({outline:t=>({"outline-color":$(t)})},{values:Z(e("outlineColor")),type:["color","any"]})},ringWidth:({matchUtilities:r,addDefaults:e,addUtilities:t,theme:i,config:n})=>{let s=(()=>{if(K(n(),"respectDefaultRingColorOpacity"))return i("ringColor.DEFAULT");let a=i("ringOpacity.DEFAULT","0.5");return i("ringColor")?.DEFAULT?qe(i("ringColor")?.DEFAULT,a,`rgb(147 197 253 / ${a})`):`rgb(147 197 253 / ${a})`})();e("ring-width",{"--tw-ring-inset":" ","--tw-ring-offset-width":i("ringOffsetWidth.DEFAULT","0px"),"--tw-ring-offset-color":i("ringOffsetColor.DEFAULT","#fff"),"--tw-ring-color":s,"--tw-ring-offset-shadow":"0 0 #0000","--tw-ring-shadow":"0 0 #0000","--tw-shadow":"0 0 #0000","--tw-shadow-colored":"0 0 #0000"}),r({ring:a=>({"@defaults ring-width":{},"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${a} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,"box-shadow":["var(--tw-ring-offset-shadow)","var(--tw-ring-shadow)","var(--tw-shadow, 0 0 #0000)"].join(", ")})},{values:i("ringWidth"),type:"length"}),t({".ring-inset":{"@defaults ring-width":{},"--tw-ring-inset":"inset"}})},ringColor:({matchUtilities:r,theme:e,corePlugins:t})=>{r({ring:i=>t("ringOpacity")?le({color:i,property:"--tw-ring-color",variable:"--tw-ring-opacity"}):{"--tw-ring-color":$(i)}},{values:Object.fromEntries(Object.entries(Z(e("ringColor"))).filter(([i])=>i!=="DEFAULT")),type:["color","any"]})},ringOpacity:r=>{let{config:e}=r;return T("ringOpacity",[["ring-opacity",["--tw-ring-opacity"]]],{filterDefault:!K(e(),"respectDefaultRingColorOpacity")})(r)},ringOffsetWidth:T("ringOffsetWidth",[["ring-offset",["--tw-ring-offset-width"]]],{type:"length"}),ringOffsetColor:({matchUtilities:r,theme:e})=>{r({"ring-offset":t=>({"--tw-ring-offset-color":$(t)})},{values:Z(e("ringOffsetColor")),type:["color","any"]})},blur:({matchUtilities:r,theme:e})=>{r({blur:t=>({"--tw-blur":`blur(${t})`,"@defaults filter":{},filter:Re})},{values:e("blur")})},brightness:({matchUtilities:r,theme:e})=>{r({brightness:t=>({"--tw-brightness":`brightness(${t})`,"@defaults filter":{},filter:Re})},{values:e("brightness")})},contrast:({matchUtilities:r,theme:e})=>{r({contrast:t=>({"--tw-contrast":`contrast(${t})`,"@defaults filter":{},filter:Re})},{values:e("contrast")})},dropShadow:({matchUtilities:r,theme:e})=>{r({"drop-shadow":t=>({"--tw-drop-shadow":Array.isArray(t)?t.map(i=>`drop-shadow(${i})`).join(" "):`drop-shadow(${t})`,"@defaults filter":{},filter:Re})},{values:e("dropShadow")})},grayscale:({matchUtilities:r,theme:e})=>{r({grayscale:t=>({"--tw-grayscale":`grayscale(${t})`,"@defaults filter":{},filter:Re})},{values:e("grayscale")})},hueRotate:({matchUtilities:r,theme:e})=>{r({"hue-rotate":t=>({"--tw-hue-rotate":`hue-rotate(${t})`,"@defaults filter":{},filter:Re})},{values:e("hueRotate"),supportsNegativeValues:!0})},invert:({matchUtilities:r,theme:e})=>{r({invert:t=>({"--tw-invert":`invert(${t})`,"@defaults filter":{},filter:Re})},{values:e("invert")})},saturate:({matchUtilities:r,theme:e})=>{r({saturate:t=>({"--tw-saturate":`saturate(${t})`,"@defaults filter":{},filter:Re})},{values:e("saturate")})},sepia:({matchUtilities:r,theme:e})=>{r({sepia:t=>({"--tw-sepia":`sepia(${t})`,"@defaults filter":{},filter:Re})},{values:e("sepia")})},filter:({addDefaults:r,addUtilities:e})=>{r("filter",{"--tw-blur":" ","--tw-brightness":" ","--tw-contrast":" ","--tw-grayscale":" ","--tw-hue-rotate":" ","--tw-invert":" ","--tw-saturate":" ","--tw-sepia":" ","--tw-drop-shadow":" "}),e({".filter":{"@defaults filter":{},filter:Re},".filter-none":{filter:"none"}})},backdropBlur:({matchUtilities:r,theme:e})=>{r({"backdrop-blur":t=>({"--tw-backdrop-blur":`blur(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropBlur")})},backdropBrightness:({matchUtilities:r,theme:e})=>{r({"backdrop-brightness":t=>({"--tw-backdrop-brightness":`brightness(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropBrightness")})},backdropContrast:({matchUtilities:r,theme:e})=>{r({"backdrop-contrast":t=>({"--tw-backdrop-contrast":`contrast(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropContrast")})},backdropGrayscale:({matchUtilities:r,theme:e})=>{r({"backdrop-grayscale":t=>({"--tw-backdrop-grayscale":`grayscale(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropGrayscale")})},backdropHueRotate:({matchUtilities:r,theme:e})=>{r({"backdrop-hue-rotate":t=>({"--tw-backdrop-hue-rotate":`hue-rotate(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropHueRotate"),supportsNegativeValues:!0})},backdropInvert:({matchUtilities:r,theme:e})=>{r({"backdrop-invert":t=>({"--tw-backdrop-invert":`invert(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropInvert")})},backdropOpacity:({matchUtilities:r,theme:e})=>{r({"backdrop-opacity":t=>({"--tw-backdrop-opacity":`opacity(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropOpacity")})},backdropSaturate:({matchUtilities:r,theme:e})=>{r({"backdrop-saturate":t=>({"--tw-backdrop-saturate":`saturate(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropSaturate")})},backdropSepia:({matchUtilities:r,theme:e})=>{r({"backdrop-sepia":t=>({"--tw-backdrop-sepia":`sepia(${t})`,"@defaults backdrop-filter":{},"backdrop-filter":Me})},{values:e("backdropSepia")})},backdropFilter:({addDefaults:r,addUtilities:e})=>{r("backdrop-filter",{"--tw-backdrop-blur":" ","--tw-backdrop-brightness":" ","--tw-backdrop-contrast":" ","--tw-backdrop-grayscale":" ","--tw-backdrop-hue-rotate":" ","--tw-backdrop-invert":" ","--tw-backdrop-opacity":" ","--tw-backdrop-saturate":" ","--tw-backdrop-sepia":" "}),e({".backdrop-filter":{"@defaults backdrop-filter":{},"backdrop-filter":Me},".backdrop-filter-none":{"backdrop-filter":"none"}})},transitionProperty:({matchUtilities:r,theme:e})=>{let t=e("transitionTimingFunction.DEFAULT"),i=e("transitionDuration.DEFAULT");r({transition:n=>({"transition-property":n,...n==="none"?{}:{"transition-timing-function":t,"transition-duration":i}})},{values:e("transitionProperty")})},transitionDelay:T("transitionDelay",[["delay",["transitionDelay"]]]),transitionDuration:T("transitionDuration",[["duration",["transitionDuration"]]],{filterDefault:!0}),transitionTimingFunction:T("transitionTimingFunction",[["ease",["transitionTimingFunction"]]],{filterDefault:!0}),willChange:T("willChange",[["will-change",["will-change"]]]),content:T("content",[["content",["--tw-content",["content","var(--tw-content)"]]]])}});function aS(r){if(r===void 0)return!1;if(r==="true"||r==="1")return!0;if(r==="false"||r==="0")return!1;if(r==="*")return!0;let e=r.split(",").map(t=>t.split(":")[0]);return e.includes("-tailwindcss")?!1:!!e.includes("tailwindcss")}var Te,Qp,Jp,fn,Ma,Ve,Hr,rt=A(()=>{l();Te={NODE_ENV:"production",DEBUG:aS(m.env.DEBUG)},Qp=new Map,Jp=new Map,fn=new Map,Ma=new Map,Ve=new String("*"),Hr=Symbol("__NONE__")});function It(r){let e=[],t=!1;for(let i=0;i0)}var Xp,Kp,oS,Fa=A(()=>{l();Xp=new Map([["{","}"],["[","]"],["(",")"]]),Kp=new Map(Array.from(Xp.entries()).map(([r,e])=>[e,r])),oS=new Set(['"',"'","`"])});function Yr(r,...e){for(let t of e){let i=rd(t,cn);if(i!==null&&rd(r,cn,i)!==null){let s=`${cn}(${i})`,a=t.indexOf(s),o=t.slice(a+s.length).split(" ")[0];r=r.replace(s,s+o);continue}r=t.replace(ed,r)}return r}function td(r){let e=[];for(;r.prev()&&r.prev().type!=="combinator";)r=r.prev();for(;r&&r.type!=="combinator";)e.push(r),r=r.next();return e}function uS(r){return r.sort((e,t)=>e.type==="tag"&&t.type==="class"?-1:e.type==="class"&&t.type==="tag"?1:e.type==="class"&&t.type==="pseudo"&&t.value.startsWith("::")?-1:e.type==="pseudo"&&e.value.startsWith("::")&&t.type==="class"?1:r.index(e)-r.index(t)),r}function fS(r,e){let t=!1;r.walk(i=>{if(i.type==="class"&&i.value===e)return t=!0,!1}),t||r.remove()}function pn(r,{selector:e,candidate:t,context:i,isArbitraryVariant:n,base:s=t.split(new RegExp(`\\${i?.tailwindConfig?.separator??":"}(?![^[]*\\])`)).pop()}){let a=(0,Rt.default)().astSync(e);i?.tailwindConfig?.prefix&&!n&&(r=Dt(i.tailwindConfig.prefix,r)),r=r.replace(ed,`.${ve(t)}`);let o=(0,Rt.default)().astSync(r);a.each(p=>fS(p,s)),a.walkClasses(p=>{p.raws&&p.value.includes(s)&&(p.raws.value=ve((0,Zp.default)(p.raws.value)))});let u=Rt.default.comment({value:"/*__simple__*/"}),c=Rt.default.comment({value:"/*__simple__*/"});a.walkClasses(p=>{if(p.value!==s)return;let h=p.parent,d=o.nodes[0].nodes;if(h.nodes.length===1){p.replaceWith(...d);return}let y=td(p);h.insertBefore(y[0],u),h.insertAfter(y[y.length-1],c);for(let w of d)h.insertBefore(y[0],w);p.remove(),y=td(u);let k=h.index(u);h.nodes.splice(k,y.length,...uS(Rt.default.selector({nodes:y})).nodes),u.remove(),c.remove()});function f(p){let h=[];for(let d of p.nodes)Na(d)&&(h.push(d),p.removeChild(d)),d?.nodes&&h.push(...f(d));return h}return a.each(p=>{p.walkPseudos(d=>{lS.has(d.value)&&d.replaceWith(d.nodes)});let h=f(p);h.length>0&&p.nodes.push(h.sort(dS))}),a.toString()}function dS(r,e){return r.type!=="pseudo"&&e.type!=="pseudo"||r.type==="combinator"^e.type==="combinator"?0:r.type==="pseudo"^e.type==="pseudo"?(r.type==="pseudo")-(e.type==="pseudo"):Na(r)-Na(e)}function Na(r){return r.type!=="pseudo"||pS.includes(r.value)?!1:r.value.startsWith("::")||cS.includes(r.value)}function rd(r,e,t){let i=r.indexOf(t?`${e}(${t})`:e);if(i===-1)return null;i+=e.length+1;let n="",s=0;for(let a of r.slice(i))if(a!=="("&&a!==")")n+=a;else if(a==="(")n+=a,s++;else if(a===")"){if(--s<0)break;n+=a}return n}var Rt,Zp,cn,ed,lS,cS,pS,La=A(()=>{l();Rt=J(De()),Zp=J(ci());qt();rn();cn=":merge",ed="&",lS=new Set([cn]);cS=[":before",":after",":first-line",":first-letter"],pS=["::file-selector-button"]});function $a(r){return hS.transformSync(r)}function*mS(r){let e=1/0;for(;e>=0;){let t,i=!1;if(e===1/0&&r.endsWith("]")){let a=r.indexOf("[");r[a-1]==="-"?t=a-1:r[a-1]==="/"?(t=a-1,i=!0):t=-1}else e===1/0&&r.includes("/")?(t=r.lastIndexOf("/"),i=!0):t=r.lastIndexOf("-",e);if(t<0)break;let n=r.slice(0,t),s=r.slice(i?t:t+1);e=t-1,!(n===""||s==="/")&&(yield[n,s])}}function gS(r,e){if(r.length===0||e.tailwindConfig.prefix==="")return r;for(let t of r){let[i]=t;if(i.options.respectPrefix){let n=j.root({nodes:[t[1].clone()]}),s=t[1].raws.tailwind.classCandidate;n.walkRules(a=>{let o=s.startsWith("-");a.selector=Dt(e.tailwindConfig.prefix,a.selector,o)}),t[1]=n.nodes[0]}}return r}function yS(r,e){if(r.length===0)return r;let t=[];for(let[i,n]of r){let s=j.root({nodes:[n.clone()]});s.walkRules(a=>{a.selector=Tf(Pf(a.selector,e),o=>o===e?`!${o}`:o),a.walkDecls(o=>o.important=!0)}),t.push([{...i,important:!0},s.nodes[0]])}return t}function wS(r,e,t){if(e.length===0)return e;let i={modifier:null,value:Hr};{let n=/(.*)\/(.*)$/g.exec(r);if(n&&(r=n[1],i.modifier=n[2],!K(t.tailwindConfig,"generalizedModifiers")))return[]}if(r.endsWith("]")&&!r.startsWith("[")){let n=/(.)(-?)\[(.*)\]/g.exec(r);if(n){let[,s,a,o]=n;if(s==="@"&&a==="-")return[];if(s!=="@"&&a==="")return[];r=r.replace(`${a}[${o}]`,""),i.value=o}}if(ja(r)&&!t.variantMap.has(r)){let n=H(r.slice(1,-1));if(!yn(n))return[];let s=Qr(n),a=t.offsets.recordVariant(r);t.variantMap.set(r,[[a,s]])}if(t.variantMap.has(r)){let n=t.variantMap.get(r).slice(),s=[];for(let[a,o]of e){if(a.layer==="user")continue;let u=j.root({nodes:[o.clone()]});for(let[c,f,p]of n){let y=function(){h.raws.neededBackup||(h.raws.neededBackup=!0,h.walkRules(x=>x.raws.originalSelector=x.selector))},k=function(x){return y(),h.each(S=>{S.type==="rule"&&(S.selectors=S.selectors.map(_=>x({get className(){return $a(_)},selector:_})))}),h},h=(p??u).clone(),d=[],w=f({get container(){return y(),h},separator:t.tailwindConfig.separator,modifySelectors:k,wrap(x){let S=h.nodes;h.removeAll(),x.append(S),h.append(x)},format(x){d.push(x)},args:i});if(Array.isArray(w)){for(let[x,S]of w.entries())n.push([t.offsets.applyParallelOffset(c,x),S,h.clone()]);continue}if(typeof w=="string"&&d.push(w),w===null)continue;h.raws.neededBackup&&(delete h.raws.neededBackup,h.walkRules(x=>{let S=x.raws.originalSelector;if(!S||(delete x.raws.originalSelector,S===x.selector))return;let _=x.selector,D=(0,Ba.default)(M=>{M.walkClasses(B=>{B.value=`${r}${t.tailwindConfig.separator}${B.value}`})}).processSync(S);d.push(_.replace(D,"&")),x.selector=S})),h.nodes[0].raws.tailwind={...h.nodes[0].raws.tailwind,parentLayer:a.layer};let b=[{...a,sort:t.offsets.applyVariantOffset(a.sort,c,Object.assign(i,t.variantOptions.get(r))),collectedFormats:(a.collectedFormats??[]).concat(d),isArbitraryVariant:ja(r)},h.nodes[0]];s.push(b)}}return s}return[]}function za(r,e,t={}){return!ee(r)&&!Array.isArray(r)?[[r],t]:Array.isArray(r)?za(r[0],e,r[1]):(e.has(r)||e.set(r,Pt(r)),[e.get(r),t])}function vS(r){return bS.test(r)}function xS(r){if(!r.includes("://"))return!1;try{let e=new URL(r);return e.scheme!==""&&e.host!==""}catch(e){return!1}}function id(r){let e=!0;return r.walkDecls(t=>{if(!nd(t.name,t.value))return e=!1,!1}),e}function nd(r,e){if(xS(`${r}:${e}`))return!1;try{return j.parse(`a{${r}:${e}}`).toResult(),!0}catch(t){return!1}}function kS(r,e){let[,t,i]=r.match(/^\[([a-zA-Z0-9-_]+):(\S+)\]$/)??[];if(i===void 0||!vS(t)||!It(i))return null;let n=H(i);return nd(t,n)?[[{sort:e.offsets.arbitraryProperty(),layer:"utilities"},()=>({[qa(r)]:{[t]:n}})]]:null}function*SS(r,e){e.candidateRuleMap.has(r)&&(yield[e.candidateRuleMap.get(r),"DEFAULT"]),yield*function*(o){o!==null&&(yield[o,"DEFAULT"])}(kS(r,e));let t=r,i=!1,n=e.tailwindConfig.prefix,s=n.length,a=t.startsWith(n)||t.startsWith(`-${n}`);t[s]==="-"&&a&&(i=!0,t=n+t.slice(s+1)),i&&e.candidateRuleMap.has(t)&&(yield[e.candidateRuleMap.get(t),"-DEFAULT"]);for(let[o,u]of mS(t))e.candidateRuleMap.has(o)&&(yield[e.candidateRuleMap.get(o),i?`-${u}`:u])}function CS(r,e){return r===Ve?[Ve]:de(r,e)}function*_S(r,e){for(let t of r)t[1].raws.tailwind={...t[1].raws.tailwind,classCandidate:e,preserveSource:t[0].options?.preserveSource??!1},yield t}function*dn(r,e,t=r){let i=e.tailwindConfig.separator,[n,...s]=CS(r,i).reverse(),a=!1;if(n.startsWith("!")&&(a=!0,n=n.slice(1)),K(e.tailwindConfig,"variantGrouping")&&n.startsWith("(")&&n.endsWith(")")){let o=s.slice().reverse().join(i);for(let u of de(n.slice(1,-1),","))yield*dn(o+i+u,e,t)}for(let o of SS(n,e)){let u=[],c=new Map,[f,p]=o,h=f.length===1;for(let[d,y]of f){let k=[];if(typeof y=="function")for(let w of[].concat(y(p,{isOnlyPlugin:h}))){let[b,x]=za(w,e.postCssNodeCache);for(let S of b)k.push([{...d,options:{...d.options,...x}},S])}else if(p==="DEFAULT"||p==="-DEFAULT"){let w=y,[b,x]=za(w,e.postCssNodeCache);for(let S of b)k.push([{...d,options:{...d.options,...x}},S])}if(k.length>0){let w=Array.from(Ws(d.options?.types??[],p,d.options??{},e.tailwindConfig)).map(([b,x])=>x);w.length>0&&c.set(k,w),u.push(k)}}if(ja(p)){if(u.length>1){let k=function(b){return b.length===1?b[0]:b.find(x=>{let S=c.get(x);return x.some(([{options:_},D])=>id(D)?_.types.some(({type:M,preferOnConflict:B})=>S.includes(M)&&B):!1)})},[d,y]=u.reduce((b,x)=>(x.some(([{options:_}])=>_.types.some(({type:D})=>D==="any"))?b[0].push(x):b[1].push(x),b),[[],[]]),w=k(y)??k(d);if(w)u=[w];else{let b=u.map(S=>new Set([...c.get(S)??[]]));for(let S of b)for(let _ of S){let D=!1;for(let M of b)S!==M&&M.has(_)&&(M.delete(_),D=!0);D&&S.delete(_)}let x=[];for(let[S,_]of b.entries())for(let D of _){let M=u[S].map(([,B])=>B).flat().map(B=>B.toString().split(` +`).slice(1,-1).map(q=>q.trim()).map(q=>` ${q}`).join(` +`)).join(` + +`);x.push(` Use \`${r.replace("[",`[${D}:`)}\` for \`${M.trim()}\``);break}N.warn([`The class \`${r}\` is ambiguous and matches multiple utilities.`,...x,`If this is content and not a class, replace it with \`${r.replace("[","[").replace("]","]")}\` to silence this warning.`]);continue}}u=u.map(d=>d.filter(y=>id(y[1])))}u=u.flat(),u=Array.from(_S(u,n)),u=gS(u,e),a&&(u=yS(u,n));for(let d of s)u=wS(d,u,e);for(let d of u){if(d[1].raws.tailwind={...d[1].raws.tailwind,candidate:r},d[0].collectedFormats){let y=Yr("&",...d[0].collectedFormats),k=j.root({nodes:[d[1].clone()]});k.walkRules(w=>{hn(w)||(w.selector=pn(y,{selector:w.selector,candidate:t,base:r.split(new RegExp(`\\${e?.tailwindConfig?.separator??":"}(?![^[]*\\])`)).pop(),isArbitraryVariant:d[0].isArbitraryVariant,context:e}))}),d[1]=k.nodes[0]}yield d}}}function hn(r){return r.parent&&r.parent.type==="atrule"&&r.parent.name==="keyframes"}function AS(r){if(r===!0)return e=>{hn(e)||e.walkDecls(t=>{t.parent.type==="rule"&&!hn(t.parent)&&(t.important=!0)})};if(typeof r=="string")return e=>{hn(e)||(e.selectors=e.selectors.map(t=>`${r} ${t}`))}}function mn(r,e){let t=[],i=AS(e.tailwindConfig.important);for(let n of r){if(e.notClassCache.has(n))continue;if(e.candidateRuleCache.has(n)){t=t.concat(Array.from(e.candidateRuleCache.get(n)));continue}let s=Array.from(dn(n,e));if(s.length===0){e.notClassCache.add(n);continue}e.classCache.set(n,s);let a=e.candidateRuleCache.get(n)??new Set;e.candidateRuleCache.set(n,a);for(let o of s){let[{sort:u,options:c},f]=o;if(c.respectImportant&&i){let h=j.root({nodes:[f.clone()]});h.walkRules(i),f=h.nodes[0]}let p=[u,f];a.add(p),e.ruleCache.add(p),t.push(p)}}return t}function ja(r){return r.startsWith("[")&&r.endsWith("]")}var Ba,hS,bS,gn=A(()=>{l();Ze();Ba=J(De());Da();wt();rn();Pr();Ae();rt();La();Ia();Er();wn();Fa();_r();$e();hS=(0,Ba.default)(r=>r.first.filter(({type:e})=>e==="class").pop().value);bS=/^[a-z_-]/});function OS(r){try{return yt.createHash("md5").update(r,"utf-8").digest("binary")}catch(e){return""}}function sd(r,e){let t=e.toString();if(!t.includes("@tailwind"))return!1;let i=Ma.get(r),n=OS(t),s=i!==n;return Ma.set(r,n),s}var ad=A(()=>{l();si();rt()});function Va(r){return(r>0n)-(r<0n)}var od=A(()=>{l()});function ES(r){let e=null;for(let t of r)e=e??t,e=e>t?e:t;return e}var Ua,ld=A(()=>{l();od();Ua=class{constructor(){this.offsets={defaults:0n,base:0n,components:0n,utilities:0n,variants:0n,user:0n},this.layerPositions={defaults:0n,base:1n,components:2n,utilities:3n,user:4n,variants:5n},this.reservedVariantBits=0n,this.variantOffsets=new Map}create(e){return{layer:e,parentLayer:e,arbitrary:0n,variants:0n,parallelIndex:0n,index:this.offsets[e]++,options:[]}}arbitraryProperty(){return{...this.create("utilities"),arbitrary:1n}}forVariant(e,t=0){let i=this.variantOffsets.get(e);if(i===void 0)throw new Error(`Cannot find offset for unknown variant ${e}`);return{...this.create("variants"),variants:i<Va(this.compare(t,i)))}}});function Ya(r,e){let t=r.tailwindConfig.prefix;return typeof t=="function"?t(e):t+e}function fd({type:r="any",...e}){let t=[].concat(r);return{...e,types:t.map(i=>Array.isArray(i)?{type:i[0],...i[1]}:{type:i,preferOnConflict:!1})}}function cd(r){if(r.includes("{")){if(!TS(r))throw new Error("Your { and } are unbalanced.");return r.split(/{(.*)}/gim).flatMap(e=>cd(e)).filter(Boolean)}return[r.trim()]}function TS(r){let e=0;for(let t of r)if(t==="{")e++;else if(t==="}"&&--e<0)return!1;return e===0}function PS(r,e,{before:t=[]}={}){if(t=[].concat(t),t.length<=0){r.push(e);return}let i=r.length-1;for(let n of t){let s=r.indexOf(n);s!==-1&&(i=Math.min(i,s))}r.splice(i,0,e)}function pd(r){return Array.isArray(r)?r.flatMap(e=>!Array.isArray(e)&&!ee(e)?e:Pt(e)):pd([r])}function dd(r,e){return(0,Wa.default)(i=>{let n=[];return e&&e(i),i.walkClasses(s=>{n.push(s.value)}),n}).transformSync(r)}function DS(r,e={containsNonOnDemandable:!1},t=0){let i=[];if(r.type==="rule"){let n=function(s){s.walkPseudos(a=>{a.value===":not"&&a.remove()})};for(let s of r.selectors){let a=dd(s,n);a.length===0&&(e.containsNonOnDemandable=!0);for(let o of a)i.push(o)}}else r.type==="atrule"&&r.walkRules(n=>{for(let s of n.selectors.flatMap(a=>dd(a)))i.push(s)});return t===0?[e.containsNonOnDemandable||i.length===0,i]:i}function bn(r){return pd(r).flatMap(e=>{let t=new Map,[i,n]=DS(e);return i&&n.unshift(Ve),n.map(s=>(t.has(e)||t.set(e,e),[s,t.get(e)]))})}function yn(r){return r.startsWith("@")||r.includes("&")}function Qr(r){r=r.replace(/\n+/g,"").replace(/\s{1,}/g," ").trim();let e=cd(r).map(t=>{if(!t.startsWith("@"))return({format:s})=>s(t);let[,i,n]=/@(.*?)( .+|[({].*)/g.exec(t);return({wrap:s})=>s(j.atRule({name:i,params:n.trim()}))}).reverse();return t=>{for(let i of e)i(t)}}function qS(r,e,{variantList:t,variantMap:i,offsets:n,classList:s}){function a(d,y){return d?(0,ud.default)(r,d,y):r}function o(d){return Dt(r.prefix,d)}function u(d,y){return d===Ve?Ve:y.respectPrefix?e.tailwindConfig.prefix+d:d}function c(d,y,k={}){let[w,...b]=He(d),x=a(["theme",w,...b],y);return je(w)(x,k)}let f=Object.assign((d,y=void 0)=>c(d,y),{withAlpha:(d,y)=>c(d,void 0,{opacityValue:y})}),p=0,h={postcss:j,prefix:o,e:ve,config:a,theme:f,corePlugins:d=>Array.isArray(r.corePlugins)?r.corePlugins.includes(d):a(["corePlugins",d],!0),variants:()=>[],addBase(d){for(let[y,k]of bn(d)){let w=u(y,{}),b=n.create("base");e.candidateRuleMap.has(w)||e.candidateRuleMap.set(w,[]),e.candidateRuleMap.get(w).push([{sort:b,layer:"base"},k])}},addDefaults(d,y){let k={[`@defaults ${d}`]:y};for(let[w,b]of bn(k)){let x=u(w,{});e.candidateRuleMap.has(x)||e.candidateRuleMap.set(x,[]),e.candidateRuleMap.get(x).push([{sort:n.create("defaults"),layer:"defaults"},b])}},addComponents(d,y){y=Object.assign({},{preserveSource:!1,respectPrefix:!0,respectImportant:!1},Array.isArray(y)?{}:y);for(let[w,b]of bn(d)){let x=u(w,y);s.add(x),e.candidateRuleMap.has(x)||e.candidateRuleMap.set(x,[]),e.candidateRuleMap.get(x).push([{sort:n.create("components"),layer:"components",options:y},b])}},addUtilities(d,y){y=Object.assign({},{preserveSource:!1,respectPrefix:!0,respectImportant:!0},Array.isArray(y)?{}:y);for(let[w,b]of bn(d)){let x=u(w,y);s.add(x),e.candidateRuleMap.has(x)||e.candidateRuleMap.set(x,[]),e.candidateRuleMap.get(x).push([{sort:n.create("utilities"),layer:"utilities",options:y},b])}},matchUtilities:function(d,y){y=fd({...{respectPrefix:!0,respectImportant:!0,modifiers:!1},...y});let w=n.create("utilities");for(let b in d){let _=function(M,{isOnlyPlugin:B}){let[q,F,X]=Us(y.types,M,y,r);if(q===void 0)return[];if(!y.types.some(({type:pe})=>pe===F))if(B)N.warn([`Unnecessary typehint \`${F}\` in \`${b}-${M}\`.`,`You can safely update it to \`${b}-${M.replace(F+":","")}\`.`]);else return[];if(!It(q))return[];let ce={get modifier(){return y.modifiers||N.warn(`modifier-used-without-options-for-${b}`,["Your plugin must set `modifiers: true` in its options to support modifiers."]),X}},se=K(r,"generalizedModifiers");return[].concat(se?S(q,ce):S(q)).filter(Boolean).map(pe=>({[nn(b,M)]:pe}))},x=u(b,y),S=d[b];s.add([x,y]);let D=[{sort:w,layer:"utilities",options:y},_];e.candidateRuleMap.has(x)||e.candidateRuleMap.set(x,[]),e.candidateRuleMap.get(x).push(D)}},matchComponents:function(d,y){y=fd({...{respectPrefix:!0,respectImportant:!1,modifiers:!1},...y});let w=n.create("components");for(let b in d){let _=function(M,{isOnlyPlugin:B}){let[q,F,X]=Us(y.types,M,y,r);if(q===void 0)return[];if(!y.types.some(({type:pe})=>pe===F))if(B)N.warn([`Unnecessary typehint \`${F}\` in \`${b}-${M}\`.`,`You can safely update it to \`${b}-${M.replace(F+":","")}\`.`]);else return[];if(!It(q))return[];let ce={get modifier(){return y.modifiers||N.warn(`modifier-used-without-options-for-${b}`,["Your plugin must set `modifiers: true` in its options to support modifiers."]),X}},se=K(r,"generalizedModifiers");return[].concat(se?S(q,ce):S(q)).filter(Boolean).map(pe=>({[nn(b,M)]:pe}))},x=u(b,y),S=d[b];s.add([x,y]);let D=[{sort:w,layer:"components",options:y},_];e.candidateRuleMap.has(x)||e.candidateRuleMap.set(x,[]),e.candidateRuleMap.get(x).push(D)}},addVariant(d,y,k={}){y=[].concat(y).map(w=>{if(typeof w!="string")return(b={})=>{let{args:x,modifySelectors:S,container:_,separator:D,wrap:M,format:B}=b,q=w(Object.assign({modifySelectors:S,container:_,separator:D},k.type===Ga.MatchVariant&&{args:x,wrap:M,format:B}));if(typeof q=="string"&&!yn(q))throw new Error(`Your custom variant \`${d}\` has an invalid format string. Make sure it's an at-rule or contains a \`&\` placeholder.`);return Array.isArray(q)?q.filter(F=>typeof F=="string").map(F=>Qr(F)):q&&typeof q=="string"&&Qr(q)(b)};if(!yn(w))throw new Error(`Your custom variant \`${d}\` has an invalid format string. Make sure it's an at-rule or contains a \`&\` placeholder.`);return Qr(w)}),PS(t,d,k),i.set(d,y),e.variantOptions.set(d,k)},matchVariant(d,y,k){let w=k?.id??++p,b=d==="@",x=K(r,"generalizedModifiers");for(let[_,D]of Object.entries(k?.values??{}))_!=="DEFAULT"&&h.addVariant(b?`${d}${_}`:`${d}-${_}`,({args:M,container:B})=>y(D,x?{modifier:M?.modifier,container:B}:{container:B}),{...k,value:D,id:w,type:Ga.MatchVariant,variantInfo:Ha.Base});let S="DEFAULT"in(k?.values??{});h.addVariant(d,({args:_,container:D})=>_?.value===Hr&&!S?null:y(_?.value===Hr?k.values.DEFAULT:_?.value??(typeof _=="string"?_:""),x?{modifier:_?.modifier,container:D}:{container:D}),{...k,id:w,type:Ga.MatchVariant,variantInfo:Ha.Dynamic})}};return h}function vn(r){return Qa.has(r)||Qa.set(r,new Map),Qa.get(r)}function hd(r,e){let t=!1;for(let i of r){if(!i)continue;let n=Xs.parse(i),s=n.hash?n.href.replace(n.hash,""):n.href;s=n.search?s.replace(n.search,""):s;let a=ae.statSync(decodeURIComponent(s),{throwIfNoEntry:!1})?.mtimeMs;!a||((!e.has(i)||a>e.get(i))&&(t=!0),e.set(i,a))}return t}function md(r){r.walkAtRules(e=>{["responsive","variants"].includes(e.name)&&(md(e),e.before(e.nodes),e.remove())})}function IS(r){let e=[];return r.each(t=>{t.type==="atrule"&&["responsive","variants"].includes(t.name)&&(t.name="layer",t.params="utilities")}),r.walkAtRules("layer",t=>{if(md(t),t.params==="base"){for(let i of t.nodes)e.push(function({addBase:n}){n(i,{respectPrefix:!1})});t.remove()}else if(t.params==="components"){for(let i of t.nodes)e.push(function({addComponents:n}){n(i,{respectPrefix:!1,preserveSource:!0})});t.remove()}else if(t.params==="utilities"){for(let i of t.nodes)e.push(function({addUtilities:n}){n(i,{respectPrefix:!1,preserveSource:!0})});t.remove()}}),e}function RS(r,e){let t=Object.entries({...ue,...Hp}).map(([o,u])=>r.tailwindConfig.corePlugins.includes(o)?u:null).filter(Boolean),i=r.tailwindConfig.plugins.map(o=>(o.__isOptionsFunction&&(o=o()),typeof o=="function"?o:o.handler)),n=IS(e),s=[ue.pseudoElementVariants,ue.pseudoClassVariants,ue.ariaVariants,ue.dataVariants],a=[ue.supportsVariants,ue.directionVariants,ue.reducedMotionVariants,ue.prefersContrastVariants,ue.darkVariants,ue.printVariant,ue.screenVariants,ue.orientationVariants];return[...t,...s,...i,...a,...n]}function MS(r,e){let t=[],i=new Map;e.variantMap=i;let n=new Ua;e.offsets=n;let s=new Set,a=qS(e.tailwindConfig,e,{variantList:t,variantMap:i,offsets:n,classList:s});for(let f of r)if(Array.isArray(f))for(let p of f)p(a);else f?.(a);n.recordVariants(t,f=>i.get(f).length);for(let[f,p]of i.entries())e.variantMap.set(f,p.map((h,d)=>[n.forVariant(f,d),h]));let o=(e.tailwindConfig.safelist??[]).filter(Boolean);if(o.length>0){let f=[];for(let p of o){if(typeof p=="string"){e.changedContent.push({content:p,extension:"html"});continue}if(p instanceof RegExp){N.warn("root-regex",["Regular expressions in `safelist` work differently in Tailwind CSS v3.0.","Update your `safelist` configuration to eliminate this warning.","https://tailwindcss.com/docs/content-configuration#safelisting-classes"]);continue}f.push(p)}if(f.length>0){let p=new Map,h=e.tailwindConfig.prefix.length,d=f.some(y=>y.pattern.source.includes("!"));for(let y of s){let k=Array.isArray(y)?(()=>{let[w,b]=y,S=Object.keys(b?.values??{}).map(_=>Gr(w,_));return b?.supportsNegativeValues&&(S=[...S,...S.map(_=>"-"+_)],S=[...S,...S.map(_=>_.slice(0,h)+"-"+_.slice(h))]),b.types.some(({type:_})=>_==="color")&&(S=[...S,...S.flatMap(_=>Object.keys(e.tailwindConfig.theme.opacity).map(D=>`${_}/${D}`))]),d&&b?.respectImportant&&(S=[...S,...S.map(_=>"!"+_)]),S})():[y];for(let w of k)for(let{pattern:b,variants:x=[]}of f)if(b.lastIndex=0,p.has(b)||p.set(b,0),!!b.test(w)){p.set(b,p.get(b)+1),e.changedContent.push({content:w,extension:"html"});for(let S of x)e.changedContent.push({content:S+e.tailwindConfig.separator+w,extension:"html"})}}for(let[y,k]of p.entries())k===0&&N.warn([`The safelist pattern \`${y}\` doesn't match any Tailwind CSS classes.`,"Fix this pattern or remove it from your `safelist` configuration.","https://tailwindcss.com/docs/content-configuration#safelisting-classes"])}}let u=[].concat(e.tailwindConfig.darkMode??"media")[1]??"dark",c=[Ya(e,u),Ya(e,"group"),Ya(e,"peer")];e.getClassOrder=function(p){let h=new Map(p.map(k=>[k,null])),d=mn(new Set(p),e);d=e.offsets.sort(d);let y=BigInt(c.length);for(let[,k]of d)h.set(k.raws.tailwind.candidate,y++);return p.map(k=>{let w=h.get(k)??null,b=c.indexOf(k);return w===null&&b!==-1&&(w=BigInt(b)),[k,w]})},e.getClassList=function(){let p=[];for(let h of s)if(Array.isArray(h)){let[d,y]=h,k=[];for(let[w,b]of Object.entries(y?.values??{}))b!=null&&(p.push(Gr(d,w)),y?.supportsNegativeValues&&ut(b)&&k.push(Gr(d,`-${w}`)));p.push(...k)}else p.push(h);return p},e.getVariants=function(){let p=[];for(let[h,d]of e.variantOptions.entries())d.variantInfo!==Ha.Base&&p.push({name:h,isArbitrary:d.type===Symbol.for("MATCH_VARIANT"),values:Object.keys(d.values??{}),hasDash:h!=="@",selectors({modifier:y,value:k}={}){let w="__TAILWIND_PLACEHOLDER__",b=j.rule({selector:`.${w}`}),x=j.root({nodes:[b.clone()]}),S=x.toString(),_=(e.variantMap.get(h)??[]).flatMap(([F,X])=>X),D=[];for(let F of _){let X=[],ce={args:{modifier:y,value:d.values?.[k]??k},separator:e.tailwindConfig.separator,modifySelectors(re){return x.each(pe=>{pe.type==="rule"&&(pe.selectors=pe.selectors.map(Rl=>re({get className(){return $a(Rl)},selector:Rl})))}),x},format(re){X.push(re)},wrap(re){X.push(`@${re.name} ${re.params} { & }`)},container:x},se=F(ce);if(X.length>0&&D.push(X),Array.isArray(se))for(let re of se)X=[],re(ce),D.push(X)}let M=[],B=x.toString();S!==B&&(x.walkRules(F=>{let X=F.selector,ce=(0,Wa.default)(se=>{se.walkClasses(re=>{re.value=`${h}${e.tailwindConfig.separator}${re.value}`})}).processSync(X);M.push(X.replace(ce,"&").replace(w,"&"))}),x.walkAtRules(F=>{M.push(`@${F.name} (${F.params}) { & }`)}));let q=D.map(F=>pn(Yr("&",...F),{selector:`.${w}`,candidate:w,context:e,isArbitraryVariant:!(k in(d.values??{}))}).replace(`.${w}`,"&").replace("{ & }","").trim());return M.length>0&&q.push(Yr("&",...M)),q}});return p}}function gd(r,e){!r.classCache.has(e)||(r.notClassCache.add(e),r.classCache.delete(e),r.applyClassCache.delete(e),r.candidateRuleMap.delete(e),r.candidateRuleCache.delete(e),r.stylesheetCache=null)}function FS(r,e){let t=e.raws.tailwind.candidate;if(!!t){for(let i of r.ruleCache)i[1].raws.tailwind.candidate===t&&r.ruleCache.delete(i);gd(r,t)}}function Ja(r,e=[],t=j.root()){let i={disposables:[],ruleCache:new Set,candidateRuleCache:new Map,classCache:new Map,applyClassCache:new Map,notClassCache:new Set(r.blocklist??[]),postCssNodeCache:new Map,candidateRuleMap:new Map,tailwindConfig:r,changedContent:e,variantMap:new Map,stylesheetCache:null,variantOptions:new Map,markInvalidUtilityCandidate:s=>gd(i,s),markInvalidUtilityNode:s=>FS(i,s)},n=RS(i,t);return MS(n,i),i}function yd(r,e,t,i,n,s){let a=e.opts.from,o=i!==null;Te.DEBUG&&console.log("Source path:",a);let u;if(o&&Mt.has(a))u=Mt.get(a);else if(Jr.has(n)){let p=Jr.get(n);it.get(p).add(a),Mt.set(a,p),u=p}let c=sd(a,r);if(u&&!hd([...s],vn(u))&&!c)return[u,!1];if(Mt.has(a)){let p=Mt.get(a);if(it.has(p)&&(it.get(p).delete(a),it.get(p).size===0)){it.delete(p);for(let[h,d]of Jr)d===p&&Jr.delete(h);for(let h of p.disposables.splice(0))h(p)}}Te.DEBUG&&console.log("Setting up new context...");let f=Ja(t,[],r);return Object.assign(f,{userConfigPath:i}),hd([...s],vn(f)),Jr.set(n,f),Mt.set(a,f),it.has(f)||it.set(f,new Set),it.get(f).add(a),[f,!0]}var ud,Wa,Ga,Ha,Qa,Mt,Jr,it,wn=A(()=>{l();Ge();Ks();Ze();ud=J(va()),Wa=J(De());Ur();Da();rn();wt();qt();Ia();Pr();Yp();rt();rt();li();Ae();ai();Fa();gn();ad();ld();$e();La();Ga={AddVariant:Symbol.for("ADD_VARIANT"),MatchVariant:Symbol.for("MATCH_VARIANT")},Ha={Base:1<<0,Dynamic:1<<1};Qa=new WeakMap;Mt=Qp,Jr=Jp,it=fn});function Xa(r){return r.ignore?[]:r.glob?m.env.ROLLUP_WATCH==="true"?[{type:"dependency",file:r.base}]:[{type:"dir-dependency",dir:r.base,glob:r.glob}]:[{type:"dependency",file:r.base}]}var wd=A(()=>{l()});function Ka(r){return r.content.files.length===0&&N.warn("content-problems",["The `content` option in your Tailwind CSS configuration is missing or empty.","Configure your content sources or your generated CSS will be missing styles.","https://tailwindcss.com/docs/content-configuration"]),r}var bd=A(()=>{l();Ae()});var vd,xd=A(()=>{l();vd=()=>!1});var xn,kd=A(()=>{l();xn={sync:r=>[].concat(r),generateTasks:r=>[{dynamic:!1,base:".",negative:[],positive:[].concat(r),patterns:[].concat(r)}],escapePath:r=>r}});var Za,Sd=A(()=>{l();Za=r=>r});var Cd,_d=A(()=>{l();Cd=()=>""});function Ad(r){let e=r,t=Cd(r);return t!=="."&&(e=r.substr(t.length),e.charAt(0)==="/"&&(e=e.substr(1))),e.substr(0,2)==="./"&&(e=e.substr(2)),e.charAt(0)==="/"&&(e=e.substr(1)),{base:t,glob:e}}var Od=A(()=>{l();_d()});function Ed(r,e){let t=e.content.files;t=t.filter(o=>typeof o=="string"),t=t.map(Za);let i=xn.generateTasks(t),n=[],s=[];for(let o of i)n.push(...o.positive.map(u=>Td(u,!1))),s.push(...o.negative.map(u=>Td(u,!0)));let a=[...n,...s];return a=LS(r,a),a=a.flatMap(BS),a=a.map(NS),a}function Td(r,e){let t={original:r,base:r,ignore:e,pattern:r,glob:null};return vd(r)&&Object.assign(t,Ad(r)),t}function NS(r){let e=Za(r.base);return e=xn.escapePath(e),r.pattern=r.glob?`${e}/${r.glob}`:e,r.pattern=r.ignore?`!${r.pattern}`:r.pattern,r}function LS(r,e){let t=[];return r.userConfigPath&&r.tailwindConfig.content.relative&&(t=[ie.dirname(r.userConfigPath)]),e.map(i=>(i.base=ie.resolve(...t,i.base),i))}function BS(r){let e=[r];try{let t=ae.realpathSync(r.base);t!==r.base&&e.push({...r,base:t})}catch{}return e}function Pd(r,e,t){let i=r.tailwindConfig.content.files.filter(n=>typeof n.raw=="string").map(({raw:n,extension:s="html"})=>({content:n,extension:s}));for(let n of $S(e,t)){let s=ae.readFileSync(n,"utf8"),a=ie.extname(n).slice(1);i.push({content:s,extension:a})}return i}function $S(r,e){let t=r.map(s=>s.pattern),i=new Set;Te.DEBUG&&console.time("Finding changed files");let n=xn.sync(t,{absolute:!0});for(let s of n){let a=e.has(s)?e.get(s):-1/0,o=ae.statSync(s).mtimeMs;o>=a&&(i.add(s),e.set(s,o))}return Te.DEBUG&&console.timeEnd("Finding changed files"),i}var Dd=A(()=>{l();Ge();lt();xd();kd();Sd();Od();rt()});function zS(r,e){if(eo.has(r))return eo.get(r);let t=Ed(r,e);return eo.set(r,t).get(r)}function jS(r){let e=Js(r);if(e!==null){let[i,n,s,a]=Id.get(e)||[],o=Ln(e).map(h=>h.file),u=!1,c=new Map;for(let h of o){let d=ae.statSync(h).mtimeMs;c.set(h,d),(!a||!a.has(h)||d>a.get(h))&&(u=!0)}if(!u)return[i,e,n,s];for(let h of o)delete Fn.cache[h];let f=qr(Fn(e));f=Ka(f);let p=ni(f);return Id.set(e,[f,p,o,c]),[f,e,p,o]}let t=qr(r.config===void 0?r:r.config);return t=Ka(t),[t,null,ni(t),[]]}function to(r){return({tailwindDirectives:e,registerDependency:t})=>(i,n)=>{let[s,a,o,u]=jS(r),c=new Set(u);if(e.size>0){c.add(n.opts.from);for(let h of n.messages)h.type==="dependency"&&c.add(h.file)}let[f]=yd(i,n,s,a,o,c),p=zS(f,s);if(e.size>0){let h=vn(f);for(let d of p)for(let y of Xa(d))t(y);for(let d of Pd(f,p,h))f.changedContent.push(d)}for(let h of u)t({type:"dependency",file:h});return f}}var qd,Id,eo,Rd=A(()=>{l();Ge();qd=J(Nn());$l();Vl();Qs();Vf();wn();wd();bd();Dd();Id=new qd.default({maxSize:100}),eo=new WeakMap});function ro(r){let e=new Set,t=new Set,i=new Set;if(r.walkAtRules(n=>{n.name==="apply"&&i.add(n),n.name==="import"&&(n.params==='"tailwindcss/base"'||n.params==="'tailwindcss/base'"?(n.name="tailwind",n.params="base"):n.params==='"tailwindcss/components"'||n.params==="'tailwindcss/components'"?(n.name="tailwind",n.params="components"):n.params==='"tailwindcss/utilities"'||n.params==="'tailwindcss/utilities'"?(n.name="tailwind",n.params="utilities"):(n.params==='"tailwindcss/screens"'||n.params==="'tailwindcss/screens'"||n.params==='"tailwindcss/variants"'||n.params==="'tailwindcss/variants'")&&(n.name="tailwind",n.params="variants")),n.name==="tailwind"&&(n.params==="screens"&&(n.params="variants"),e.add(n.params)),["layer","responsive","variants"].includes(n.name)&&(["responsive","variants"].includes(n.name)&&N.warn(`${n.name}-at-rule-deprecated`,[`The \`@${n.name}\` directive has been deprecated in Tailwind CSS v3.0.`,"Use `@layer utilities` or `@layer components` instead.","https://tailwindcss.com/docs/upgrade-guide#replace-variants-with-layer"]),t.add(n))}),!e.has("base")||!e.has("components")||!e.has("utilities")){for(let n of t)if(n.name==="layer"&&["base","components","utilities"].includes(n.params)){if(!e.has(n.params))throw n.error(`\`@layer ${n.params}\` is used but no matching \`@tailwind ${n.params}\` directive is present.`)}else if(n.name==="responsive"){if(!e.has("utilities"))throw n.error("`@responsive` is used but `@tailwind utilities` is missing.")}else if(n.name==="variants"&&!e.has("utilities"))throw n.error("`@variants` is used but `@tailwind utilities` is missing.")}return{tailwindDirectives:e,applyDirectives:i}}var Md=A(()=>{l();Ae()});function ht(r,e=void 0,t=void 0){return r.map(i=>{let n=i.clone(),s=i.raws.tailwind?.preserveSource!==!0||!n.source;return e!==void 0&&s&&(n.source=e,"walk"in n&&n.walk(a=>{a.source=e})),t!==void 0&&(n.raws.tailwind={...n.raws.tailwind,...t}),n})}var Fd=A(()=>{l()});function kn(r){return r=Array.isArray(r)?r:[r],r=r.map(e=>e instanceof RegExp?e.source:e),r.join("")}function xe(r){return new RegExp(kn(r),"g")}function Ft(r){return`(?:${r.map(kn).join("|")})`}function io(r){return`(?:${kn(r)})?`}function Ld(r){return`(?:${kn(r)})*`}function Bd(r){return r&&VS.test(r)?r.replace(Nd,"\\$&"):r||""}var Nd,VS,$d=A(()=>{l();Nd=/[\\^$.*+?()[\]{}|]/g,VS=RegExp(Nd.source)});function zd(r){let e=Array.from(US(r));return t=>{let i=[];for(let n of e)i=[...i,...t.match(n)??[]];return i.filter(n=>n!==void 0).map(HS)}}function*US(r){let e=r.tailwindConfig.separator,t=K(r.tailwindConfig,"variantGrouping"),i=r.tailwindConfig.prefix!==""?io(xe([/-?/,Bd(r.tailwindConfig.prefix)])):"",n=Ft([/\[[^\s:'"`]+:[^\s]+\]/,xe([/-?(?:\w+)/,io(Ft([xe([/-(?:\w+-)*\[[^\s:]+\]/,/(?![{([]])/,/(?:\/[^\s'"`\\><$]*)?/]),xe([/-(?:\w+-)*\[[^\s]+\]/,/(?![{([]])/,/(?:\/[^\s'"`\\$]*)?/]),/[-\/][^\s'"`\\$={><]*/]))])]),s=[Ft([xe([/@\[[^\s"'`]+\](\/[^\s"'`]+)?/,e]),xe([/([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/,e]),xe([/[^\s"'`\[\\]+/,e])]),Ft([xe([/([^\s"'`\[\\]+-)?\[[^\s`]+\]/,e]),xe([/[^\s`\[\\]+/,e])])];for(let a of s)yield xe(["((?=((",a,")+))\\2)?",/!?/,i,t?Ft([xe([/\(/,n,Ld([/,/,n]),/\)/]),n]):n]);yield/[^<>"'`\s.(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g}function HS(r){if(!r.includes("-["))return r;let e=0,t=[],i=r.matchAll(WS);i=Array.from(i).flatMap(n=>{let[,...s]=n;return s.map((a,o)=>Object.assign([],n,{index:n.index+o,0:a}))});for(let n of i){let s=n[0],a=t[t.length-1];if(s===a?t.pop():(s==="'"||s==='"'||s==="`")&&t.push(s),!a){if(s==="["){e++;continue}else if(s==="]"){e--;continue}if(e<0||e===0&&!GS.test(s))return r.substring(0,n.index)}}return r}var WS,GS,jd=A(()=>{l();$e();$d();WS=/([\[\]'"`])([^\[\]'"`])?/g,GS=/[^"'`\s<>\]]+/});function YS(r,e){let t=r.tailwindConfig.content.extract;return t[e]||t.DEFAULT||Ud[e]||Ud.DEFAULT(r)}function QS(r,e){let t=r.content.transform;return t[e]||t.DEFAULT||Wd[e]||Wd.DEFAULT}function JS(r,e,t,i){Xr.has(e)||Xr.set(e,new Vd.default({maxSize:25e3}));for(let n of r.split(` +`))if(n=n.trim(),!i.has(n))if(i.add(n),Xr.get(e).has(n))for(let s of Xr.get(e).get(n))t.add(s);else{let s=e(n).filter(o=>o!=="!*"),a=new Set(s);for(let o of a)t.add(o);Xr.get(e).set(n,a)}}function XS(r,e){let t=e.offsets.sort(r),i={base:new Set,defaults:new Set,components:new Set,utilities:new Set,variants:new Set};for(let[n,s]of t)i[n.layer].add(s);return i}function no(r){return e=>{let t={base:null,components:null,utilities:null,variants:null};if(e.walkAtRules(d=>{d.name==="tailwind"&&Object.keys(t).includes(d.params)&&(t[d.params]=d)}),Object.values(t).every(d=>d===null))return e;let i=new Set([Ve]),n=new Set;mt.DEBUG&&console.time("Reading changed files");for(let{content:d,extension:y}of r.changedContent){let k=QS(r.tailwindConfig,y),w=YS(r,y);JS(k(d),w,i,n)}mt.DEBUG&&console.timeEnd("Reading changed files");let s=r.classCache.size;mt.DEBUG&&console.time("Generate rules"),mn(i,r),mt.DEBUG&&console.timeEnd("Generate rules"),mt.DEBUG&&console.time("Build stylesheet"),(r.stylesheetCache===null||r.classCache.size!==s)&&(r.stylesheetCache=XS([...r.ruleCache],r)),mt.DEBUG&&console.timeEnd("Build stylesheet");let{defaults:a,base:o,components:u,utilities:c,variants:f}=r.stylesheetCache;t.base&&(t.base.before(ht([...o,...a],t.base.source,{layer:"base"})),t.base.remove()),t.components&&(t.components.before(ht([...u],t.components.source,{layer:"components"})),t.components.remove()),t.utilities&&(t.utilities.before(ht([...c],t.utilities.source,{layer:"utilities"})),t.utilities.remove());let p=Array.from(f).filter(d=>{let y=d.raws.tailwind?.parentLayer;return y==="components"?t.components!==null:y==="utilities"?t.utilities!==null:!0});t.variants?(t.variants.before(ht(p,t.variants.source,{layer:"variants"})),t.variants.remove()):p.length>0&&e.append(ht(p,e.source,{layer:"variants"}));let h=p.some(d=>d.raws.tailwind?.parentLayer==="utilities");t.utilities&&c.size===0&&!h&&N.warn("content-problems",["No utility classes were detected in your source files. If this is unexpected, double-check the `content` option in your Tailwind CSS configuration.","https://tailwindcss.com/docs/content-configuration"]),mt.DEBUG&&(console.log("Potential classes: ",i.size),console.log("Active contexts: ",fn.size)),r.changedContent=[],e.walkAtRules("layer",d=>{Object.keys(t).includes(d.params)&&d.remove()})}}var Vd,mt,Ud,Wd,Xr,Gd=A(()=>{l();Vd=J(Nn());rt();gn();Ae();Fd();jd();mt=Te,Ud={DEFAULT:zd},Wd={DEFAULT:r=>r,svelte:r=>r.replace(/(?:^|\s)class:/g," ")};Xr=new WeakMap});function Sn(r){let e=new Map;j.root({nodes:[r.clone()]}).walkRules(s=>{(0,so.default)(a=>{a.walkClasses(o=>{let u=o.parent.toString(),c=e.get(u);c||e.set(u,c=new Set),c.add(o.value)})}).processSync(s.selector)});let i=Array.from(e.values(),s=>Array.from(s)),n=i.flat();return Object.assign(n,{groups:i})}function ao(r){return KS.astSync(r)}function Hd(r,e){let t=new Set;for(let i of r)t.add(i.split(e).pop());return Array.from(t)}function Yd(r,e){let t=r.tailwindConfig.prefix;return typeof t=="function"?t(e):t+e}function*Qd(r){for(yield r;r.parent;)yield r.parent,r=r.parent}function ZS(r,e={}){let t=r.nodes;r.nodes=[];let i=r.clone(e);return r.nodes=t,i}function e2(r){for(let e of Qd(r))if(r!==e){if(e.type==="root")break;r=ZS(e,{nodes:[r]})}return r}function t2(r,e){let t=new Map;return r.walkRules(i=>{for(let a of Qd(i))if(a.raws.tailwind?.layer!==void 0)return;let n=e2(i),s=e.offsets.create("user");for(let a of Sn(i)){let o=t.get(a)||[];t.set(a,o),o.push([{layer:"user",sort:s,important:!1},n])}}),t}function r2(r,e){for(let t of r){if(e.notClassCache.has(t)||e.applyClassCache.has(t))continue;if(e.classCache.has(t)){e.applyClassCache.set(t,e.classCache.get(t).map(([n,s])=>[n,s.clone()]));continue}let i=Array.from(dn(t,e));if(i.length===0){e.notClassCache.add(t);continue}e.applyClassCache.set(t,i)}return e.applyClassCache}function i2(r){let e=null;return{get:t=>(e=e||r(),e.get(t)),has:t=>(e=e||r(),e.has(t))}}function n2(r){return{get:e=>r.flatMap(t=>t.get(e)||[]),has:e=>r.some(t=>t.has(e))}}function Jd(r){let e=r.split(/[\s\t\n]+/g);return e[e.length-1]==="!important"?[e.slice(0,-1),!0]:[e,!1]}function Xd(r,e,t){let i=new Set,n=[];if(r.walkAtRules("apply",u=>{let[c]=Jd(u.params);for(let f of c)i.add(f);n.push(u)}),n.length===0)return;let s=n2([t,r2(i,e)]);function a(u,c,f){let p=ao(u),h=ao(c),y=ao(`.${ve(f)}`).nodes[0].nodes[0];return p.each(k=>{let w=new Set;h.each(b=>{let x=!1;b=b.clone(),b.walkClasses(S=>{S.value===y.value&&(x||(S.replaceWith(...k.nodes.map(_=>_.clone())),w.add(b),x=!0))})});for(let b of w){let x=[[]];for(let S of b.nodes)S.type==="combinator"?(x.push(S),x.push([])):x[x.length-1].push(S);b.nodes=[];for(let S of x)Array.isArray(S)&&S.sort((_,D)=>_.type==="tag"&&D.type==="class"?-1:_.type==="class"&&D.type==="tag"?1:_.type==="class"&&D.type==="pseudo"&&D.value.startsWith("::")?-1:_.type==="pseudo"&&_.value.startsWith("::")&&D.type==="class"?1:0),b.nodes=b.nodes.concat(S)}k.replaceWith(...w)}),p.toString()}let o=new Map;for(let u of n){let[c]=o.get(u.parent)||[[],u.source];o.set(u.parent,[c,u.source]);let[f,p]=Jd(u.params);if(u.parent.type==="atrule"){if(u.parent.name==="screen"){let h=u.parent.params;throw u.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${f.map(d=>`${h}:${d}`).join(" ")} instead.`)}throw u.error(`@apply is not supported within nested at-rules like @${u.parent.name}. You can fix this by un-nesting @${u.parent.name}.`)}for(let h of f){if([Yd(e,"group"),Yd(e,"peer")].includes(h))throw u.error(`@apply should not be used with the '${h}' utility`);if(!s.has(h))throw u.error(`The \`${h}\` class does not exist. If \`${h}\` is a custom class, make sure it is defined within a \`@layer\` directive.`);let d=s.get(h);c.push([h,p,d])}}for(let[u,[c,f]]of o){let p=[];for(let[d,y,k]of c){let w=[d,...Hd([d],e.tailwindConfig.separator)];for(let[b,x]of k){let S=Sn(u),_=Sn(x);if(_=_.groups.filter(q=>q.some(F=>w.includes(F))).flat(),_=_.concat(Hd(_,e.tailwindConfig.separator)),S.some(q=>_.includes(q)))throw x.error(`You cannot \`@apply\` the \`${d}\` utility here because it creates a circular dependency.`);let M=j.root({nodes:[x.clone()]});M.walk(q=>{q.source=f}),(x.type!=="atrule"||x.type==="atrule"&&x.name!=="keyframes")&&M.walkRules(q=>{if(!Sn(q).some(se=>se===d)){q.remove();return}let F=typeof e.tailwindConfig.important=="string"?e.tailwindConfig.important:null,ce=u.raws.tailwind!==void 0&&F&&u.selector.indexOf(F)===0?u.selector.slice(F.length):u.selector;q.selector=a(ce,q.selector,d),F&&ce!==u.selector&&(q.selector=`${F} ${q.selector}`),q.walkDecls(se=>{se.important=b.important||y})}),!!M.nodes[0]&&p.push([b.sort,M.nodes[0]])}}let h=e.offsets.sort(p).map(d=>d[1]);u.after(h)}for(let u of n)u.parent.nodes.length>1?u.remove():u.parent.remove();Xd(r,e,t)}function oo(r){return e=>{let t=i2(()=>t2(e,r));Xd(e,r,t)}}var so,KS,Kd=A(()=>{l();Ze();so=J(De());gn();qt();KS=(0,so.default)()});var Zd=v((LP,Cn)=>{l();(function(){"use strict";function r(i,n,s){if(!i)return null;r.caseSensitive||(i=i.toLowerCase());var a=r.threshold===null?null:r.threshold*i.length,o=r.thresholdAbsolute,u;a!==null&&o!==null?u=Math.min(a,o):a!==null?u=a:o!==null?u=o:u=null;var c,f,p,h,d,y=n.length;for(d=0;ds)return s+1;var u=[],c,f,p,h,d;for(c=0;c<=o;c++)u[c]=[c];for(f=0;f<=a;f++)u[0][f]=f;for(c=1;c<=o;c++){for(p=e,h=1,c>s&&(h=c-s),d=o+1,d>s+c&&(d=s+c),f=1;f<=a;f++)fd?u[c][f]=s+1:n.charAt(c-1)===i.charAt(f-1)?u[c][f]=u[c-1][f-1]:u[c][f]=Math.min(u[c-1][f-1]+1,Math.min(u[c][f-1]+1,u[c-1][f]+1)),u[c][f]s)return s+1}return u[o][a]}})()});var th=v((BP,eh)=>{l();var lo="(".charCodeAt(0),uo=")".charCodeAt(0),_n="'".charCodeAt(0),fo='"'.charCodeAt(0),co="\\".charCodeAt(0),Nt="/".charCodeAt(0),po=",".charCodeAt(0),ho=":".charCodeAt(0),An="*".charCodeAt(0),s2="u".charCodeAt(0),a2="U".charCodeAt(0),o2="+".charCodeAt(0),l2=/^[a-f0-9?-]+$/i;eh.exports=function(r){for(var e=[],t=r,i,n,s,a,o,u,c,f,p=0,h=t.charCodeAt(p),d=t.length,y=[{nodes:e}],k=0,w,b="",x="",S="";p{l();rh.exports=function r(e,t,i){var n,s,a,o;for(n=0,s=e.length;n{l();function nh(r,e){var t=r.type,i=r.value,n,s;return e&&(s=e(r))!==void 0?s:t==="word"||t==="space"?i:t==="string"?(n=r.quote||"",n+i+(r.unclosed?"":n)):t==="comment"?"/*"+i+(r.unclosed?"":"*/"):t==="div"?(r.before||"")+i+(r.after||""):Array.isArray(r.nodes)?(n=sh(r.nodes,e),t!=="function"?n:i+"("+(r.before||"")+n+(r.after||"")+(r.unclosed?"":")")):i}function sh(r,e){var t,i;if(Array.isArray(r)){for(t="",i=r.length-1;~i;i-=1)t=nh(r[i],e)+t;return t}return nh(r,e)}ah.exports=sh});var uh=v((jP,lh)=>{l();var On="-".charCodeAt(0),En="+".charCodeAt(0),mo=".".charCodeAt(0),u2="e".charCodeAt(0),f2="E".charCodeAt(0);function c2(r){var e=r.charCodeAt(0),t;if(e===En||e===On){if(t=r.charCodeAt(1),t>=48&&t<=57)return!0;var i=r.charCodeAt(2);return t===mo&&i>=48&&i<=57}return e===mo?(t=r.charCodeAt(1),t>=48&&t<=57):e>=48&&e<=57}lh.exports=function(r){var e=0,t=r.length,i,n,s;if(t===0||!c2(r))return!1;for(i=r.charCodeAt(e),(i===En||i===On)&&e++;e57));)e+=1;if(i=r.charCodeAt(e),n=r.charCodeAt(e+1),i===mo&&n>=48&&n<=57)for(e+=2;e57));)e+=1;if(i=r.charCodeAt(e),n=r.charCodeAt(e+1),s=r.charCodeAt(e+2),(i===u2||i===f2)&&(n>=48&&n<=57||(n===En||n===On)&&s>=48&&s<=57))for(e+=n===En||n===On?3:2;e57));)e+=1;return{number:r.slice(0,e),unit:r.slice(e)}}});var Kr=v((VP,ph)=>{l();var p2=th(),fh=ih(),ch=oh();function nt(r){return this instanceof nt?(this.nodes=p2(r),this):new nt(r)}nt.prototype.toString=function(){return Array.isArray(this.nodes)?ch(this.nodes):""};nt.prototype.walk=function(r,e){return fh(this.nodes,r,e),this};nt.unit=uh();nt.walk=fh;nt.stringify=ch;ph.exports=nt});function yo(r){return typeof r=="object"&&r!==null}function d2(r,e){let t=He(e);do if(t.pop(),(0,Zr.default)(r,t)!==void 0)break;while(t.length);return t.length?t:void 0}function Lt(r){return typeof r=="string"?r:r.reduce((e,t,i)=>t.includes(".")?`${e}[${t}]`:i===0?t:`${e}.${t}`,"")}function hh(r){return r.map(e=>`'${e}'`).join(", ")}function mh(r){return hh(Object.keys(r))}function wo(r,e,t,i={}){let n=Array.isArray(e)?Lt(e):e.replace(/^['"]+|['"]+$/g,""),s=Array.isArray(e)?e:He(n),a=(0,Zr.default)(r.theme,s,t);if(a===void 0){let u=`'${n}' does not exist in your theme config.`,c=s.slice(0,-1),f=(0,Zr.default)(r.theme,c);if(yo(f)){let p=Object.keys(f).filter(d=>wo(r,[...c,d]).isValid),h=(0,dh.default)(s[s.length-1],p);h?u+=` Did you mean '${Lt([...c,h])}'?`:p.length>0&&(u+=` '${Lt(c)}' has the following valid keys: ${hh(p)}`)}else{let p=d2(r.theme,n);if(p){let h=(0,Zr.default)(r.theme,p);yo(h)?u+=` '${Lt(p)}' has the following keys: ${mh(h)}`:u+=` '${Lt(p)}' is not an object.`}else u+=` Your theme has the following top-level keys: ${mh(r.theme)}`}return{isValid:!1,error:u}}if(!(typeof a=="string"||typeof a=="number"||typeof a=="function"||a instanceof String||a instanceof Number||Array.isArray(a))){let u=`'${n}' was found but does not resolve to a string.`;if(yo(a)){let c=Object.keys(a).filter(f=>wo(r,[...s,f]).isValid);c.length&&(u+=` Did you mean something like '${Lt([...s,c[0]])}'?`)}return{isValid:!1,error:u}}let[o]=s;return{isValid:!0,value:je(o)(a,i)}}function h2(r,e,t){e=e.map(n=>gh(r,n,t));let i=[""];for(let n of e)n.type==="div"&&n.value===","?i.push(""):i[i.length-1]+=go.default.stringify(n);return i}function gh(r,e,t){if(e.type==="function"&&t[e.value]!==void 0){let i=h2(r,e.nodes,t);e.type="word",e.value=t[e.value](r,...i)}return e}function m2(r,e,t){return(0,go.default)(e).walk(i=>{gh(r,i,t)}).toString()}function*y2(r){r=r.replace(/^['"]+|['"]+$/g,"");let e=r.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/),t;yield[r,void 0],e&&(r=e[1],t=e[2],yield[r,t])}function w2(r,e,t){let i=Array.from(y2(e)).map(([n,s])=>Object.assign(wo(r,n,t,{opacityValue:s}),{resolvedPath:n,alpha:s}));return i.find(n=>n.isValid)??i[0]}function yh(r){let e=r.tailwindConfig,t={theme:(i,n,...s)=>{let{isValid:a,value:o,error:u,alpha:c}=w2(e,n,s.length?s:void 0);if(!a){let h=i.parent,d=h?.raws.tailwind?.candidate;if(h&&d!==void 0){r.markInvalidUtilityNode(h),h.remove(),N.warn("invalid-theme-key-in-class",[`The utility \`${d}\` contains an invalid theme value and was not generated.`]);return}throw i.error(u)}let f=kt(o),p=f!==void 0&&typeof f=="function";return(c!==void 0||p)&&(c===void 0&&(c=1),o=qe(f,c,f)),o},screen:(i,n)=>{n=n.replace(/^['"]+/g,"").replace(/['"]+$/g,"");let a=tt(e.theme.screens).find(({name:o})=>o===n);if(!a)throw i.error(`The '${n}' screen does not exist in your theme.`);return et(a)}};return i=>{i.walk(n=>{let s=g2[n.type];s!==void 0&&(n[s]=m2(n,n[s],t))})}}var Zr,dh,go,g2,wh=A(()=>{l();Zr=J(va()),dh=J(Zd());Ur();go=J(Kr());ln();sn();li();Cr();Pr();Ae();g2={atrule:"params",decl:"value"}});function bh({tailwindConfig:{theme:r}}){return function(e){e.walkAtRules("screen",t=>{let i=t.params,s=tt(r.screens).find(({name:a})=>a===i);if(!s)throw t.error(`No \`${i}\` screen found.`);t.name="media",t.params=et(s)})}}var vh=A(()=>{l();ln();sn()});function b2(r){let e=r.filter(o=>o.type!=="pseudo"||o.nodes.length>0?!0:o.value.startsWith("::")||[":before",":after",":first-line",":first-letter"].includes(o.value)).reverse(),t=new Set(["tag","class","id","attribute"]),i=e.findIndex(o=>t.has(o.type));if(i===-1)return e.reverse().join("").trim();let n=e[i],s=xh[n.type]?xh[n.type](n):n;e=e.slice(0,i);let a=e.findIndex(o=>o.type==="combinator"&&o.value===">");return a!==-1&&(e.splice(0,a),e.unshift(Tn.default.universal())),[s,...e.reverse()].join("").trim()}function x2(r){return bo.has(r)||bo.set(r,v2.transformSync(r)),bo.get(r)}function vo({tailwindConfig:r}){return e=>{let t=new Map,i=new Set;if(e.walkAtRules("defaults",n=>{if(n.nodes&&n.nodes.length>0){i.add(n);return}let s=n.params;t.has(s)||t.set(s,new Set),t.get(s).add(n.parent),n.remove()}),K(r,"optimizeUniversalDefaults"))for(let n of i){let s=new Map,a=t.get(n.params)??[];for(let o of a)for(let u of x2(o.selector)){let c=u.includes(":-")||u.includes("::-")?u:"__DEFAULT__",f=s.get(c)??new Set;s.set(c,f),f.add(u)}if(K(r,"optimizeUniversalDefaults")){if(s.size===0){n.remove();continue}for(let[,o]of s){let u=j.rule({source:n.source});u.selectors=[...o],u.append(n.nodes.map(c=>c.clone())),n.before(u)}}n.remove()}else if(i.size){let n=j.rule({selectors:["*","::before","::after"]});for(let a of i)n.append(a.nodes),n.parent||a.before(n),n.source||(n.source=a.source),a.remove();let s=n.clone({selectors:["::backdrop"]});n.after(s)}}}var Tn,xh,v2,bo,kh=A(()=>{l();Ze();Tn=J(De());$e();xh={id(r){return Tn.default.attribute({attribute:"id",operator:"=",value:r.value,quoteMark:'"'})}};v2=(0,Tn.default)(r=>r.map(e=>{let t=e.split(i=>i.type==="combinator"&&i.value===" ").pop();return b2(t)})),bo=new Map});function xo(){function r(e){let t=null;e.each(i=>{if(!k2.has(i.type)){t=null;return}if(t===null){t=i;return}let n=Sh[i.type];i.type==="atrule"&&i.name==="font-face"?t=i:n.every(s=>(i[s]??"").replace(/\s+/g," ")===(t[s]??"").replace(/\s+/g," "))?(i.nodes&&t.append(i.nodes),i.remove()):t=i}),e.each(i=>{i.type==="atrule"&&r(i)})}return e=>{r(e)}}var Sh,k2,Ch=A(()=>{l();Sh={atrule:["name","params"],rule:["selector"]},k2=new Set(Object.keys(Sh))});function ko(){return r=>{r.walkRules(e=>{let t=new Map,i=new Set([]),n=new Map;e.walkDecls(s=>{if(s.parent===e){if(t.has(s.prop)){if(t.get(s.prop).value===s.value){i.add(t.get(s.prop)),t.set(s.prop,s);return}n.has(s.prop)||n.set(s.prop,new Set),n.get(s.prop).add(t.get(s.prop)),n.get(s.prop).add(s)}t.set(s.prop,s)}});for(let s of i)s.remove();for(let s of n.values()){let a=new Map;for(let o of s){let u=C2(o.value);u!==null&&(a.has(u)||a.set(u,new Set),a.get(u).add(o))}for(let o of a.values()){let u=Array.from(o).slice(0,-1);for(let c of u)c.remove()}}})}}function C2(r){let e=/^-?\d*.?\d+([\w%]+)?$/g.exec(r);return e?e[1]??S2:null}var S2,_h=A(()=>{l();S2=Symbol("unitless-number")});function _2(r){if(!r.walkAtRules)return;let e=new Set;if(r.walkAtRules("apply",t=>{e.add(t.parent)}),e.size!==0)for(let t of e){let i=[],n=[];for(let s of t.nodes)s.type==="atrule"&&s.name==="apply"?(n.length>0&&(i.push(n),n=[]),i.push([s])):n.push(s);if(n.length>0&&i.push(n),i.length!==1){for(let s of[...i].reverse()){let a=t.clone({nodes:[]});a.append(s),t.after(a)}t.remove()}}}function Pn(){return r=>{_2(r)}}var Ah=A(()=>{l()});function Oh(r){return(e,t)=>{let i=!1;e.walkAtRules("tailwind",n=>{if(i)return!1;if(n.parent&&n.parent.type!=="root")return i=!0,n.warn(t,["Nested @tailwind rules were detected, but are not supported.","Consider using a prefix to scope Tailwind's classes: https://tailwindcss.com/docs/configuration#prefix","Alternatively, use the important selector strategy: https://tailwindcss.com/docs/configuration#selector-strategy"].join(` +`)),!1}),e.walkRules(n=>{if(i)return!1;n.walkRules(s=>(i=!0,s.warn(t,["Nested CSS was detected, but CSS nesting has not been configured correctly.","Please enable a CSS nesting plugin *before* Tailwind in your configuration.","See how here: https://tailwindcss.com/docs/using-with-preprocessors#nesting"].join(` +`)),!1))})}}var Eh=A(()=>{l()});function Dn(r){return function(e,t){let{tailwindDirectives:i,applyDirectives:n}=ro(e);Oh()(e,t),Pn()(e,t);let s=r({tailwindDirectives:i,applyDirectives:n,registerDependency(a){t.messages.push({plugin:"tailwindcss",parent:t.opts.from,...a})},createContext(a,o){return Ja(a,o,e)}})(e,t);if(s.tailwindConfig.separator==="-")throw new Error("The '-' character cannot be used as a custom separator in JIT mode due to parsing ambiguity. Please use another character like '_' instead.");Ef(s.tailwindConfig),no(s)(e,t),Pn()(e,t),oo(s)(e,t),yh(s)(e,t),bh(s)(e,t),vo(s)(e,t),xo(s)(e,t),ko(s)(e,t)}}var Th=A(()=>{l();Md();Gd();Kd();wh();vh();kh();Ch();_h();Ah();Eh();wn();$e()});function Ph(r,e){let t=null,i=null;return r.walkAtRules("config",n=>{if(i=n.source?.input.file??e.opts.from??null,i===null)throw n.error("The `@config` directive cannot be used without setting `from` in your PostCSS config.");if(t)throw n.error("Only one `@config` directive is allowed per file.");let s=n.params.match(/(['"])(.*?)\1/);if(!s)throw n.error("A path is required when using the `@config` directive.");let a=s[2];if(ie.isAbsolute(a))throw n.error("The `@config` directive cannot be used with an absolute path.");if(t=ie.resolve(ie.dirname(i),a),!ae.existsSync(t))throw n.error(`The config file at "${a}" does not exist. Make sure the path is correct and the file exists.`);n.remove()}),t||null}var Dh=A(()=>{l();Ge();lt()});var qh=v((E3,So)=>{l();Rd();Th();rt();Dh();So.exports=function(e){return{postcssPlugin:"tailwindcss",plugins:[Te.DEBUG&&function(t){return console.log(` +`),console.time("JIT TOTAL"),t},function(t,i){e=Ph(t,i)??e;let n=to(e);if(t.type==="document"){let s=t.nodes.filter(a=>a.type==="root");for(let a of s)a.type==="root"&&Dn(n)(a,i);return}Dn(n)(t,i)},Te.DEBUG&&function(t){return console.timeEnd("JIT TOTAL"),console.log(` +`),t}].filter(Boolean)}};So.exports.postcss=!0});var Co=v((T3,Ih)=>{l();Ih.exports=()=>["and_chr 92","and_uc 12.12","chrome 92","chrome 91","edge 91","firefox 89","ios_saf 14.5-14.7","ios_saf 14.0-14.4","safari 14.1","samsung 14.0"]});var qn={};Ce(qn,{agents:()=>A2,feature:()=>O2});function O2(){return{status:"cr",title:"CSS Feature Queries",stats:{ie:{"6":"n","7":"n","8":"n","9":"n","10":"n","11":"n","5.5":"n"},edge:{"12":"y","13":"y","14":"y","15":"y","16":"y","17":"y","18":"y","79":"y","80":"y","81":"y","83":"y","84":"y","85":"y","86":"y","87":"y","88":"y","89":"y","90":"y","91":"y","92":"y"},firefox:{"2":"n","3":"n","4":"n","5":"n","6":"n","7":"n","8":"n","9":"n","10":"n","11":"n","12":"n","13":"n","14":"n","15":"n","16":"n","17":"n","18":"n","19":"n","20":"n","21":"n","22":"y","23":"y","24":"y","25":"y","26":"y","27":"y","28":"y","29":"y","30":"y","31":"y","32":"y","33":"y","34":"y","35":"y","36":"y","37":"y","38":"y","39":"y","40":"y","41":"y","42":"y","43":"y","44":"y","45":"y","46":"y","47":"y","48":"y","49":"y","50":"y","51":"y","52":"y","53":"y","54":"y","55":"y","56":"y","57":"y","58":"y","59":"y","60":"y","61":"y","62":"y","63":"y","64":"y","65":"y","66":"y","67":"y","68":"y","69":"y","70":"y","71":"y","72":"y","73":"y","74":"y","75":"y","76":"y","77":"y","78":"y","79":"y","80":"y","81":"y","82":"y","83":"y","84":"y","85":"y","86":"y","87":"y","88":"y","89":"y","90":"y","91":"y","92":"y","93":"y","3.5":"n","3.6":"n"},chrome:{"4":"n","5":"n","6":"n","7":"n","8":"n","9":"n","10":"n","11":"n","12":"n","13":"n","14":"n","15":"n","16":"n","17":"n","18":"n","19":"n","20":"n","21":"n","22":"n","23":"n","24":"n","25":"n","26":"n","27":"n","28":"y","29":"y","30":"y","31":"y","32":"y","33":"y","34":"y","35":"y","36":"y","37":"y","38":"y","39":"y","40":"y","41":"y","42":"y","43":"y","44":"y","45":"y","46":"y","47":"y","48":"y","49":"y","50":"y","51":"y","52":"y","53":"y","54":"y","55":"y","56":"y","57":"y","58":"y","59":"y","60":"y","61":"y","62":"y","63":"y","64":"y","65":"y","66":"y","67":"y","68":"y","69":"y","70":"y","71":"y","72":"y","73":"y","74":"y","75":"y","76":"y","77":"y","78":"y","79":"y","80":"y","81":"y","83":"y","84":"y","85":"y","86":"y","87":"y","88":"y","89":"y","90":"y","91":"y","92":"y","93":"y","94":"y","95":"y"},safari:{"4":"n","5":"n","6":"n","7":"n","8":"n","9":"y","10":"y","11":"y","12":"y","13":"y","14":"y","15":"y","9.1":"y","10.1":"y","11.1":"y","12.1":"y","13.1":"y","14.1":"y",TP:"y","3.1":"n","3.2":"n","5.1":"n","6.1":"n","7.1":"n"},opera:{"9":"n","11":"n","12":"n","15":"y","16":"y","17":"y","18":"y","19":"y","20":"y","21":"y","22":"y","23":"y","24":"y","25":"y","26":"y","27":"y","28":"y","29":"y","30":"y","31":"y","32":"y","33":"y","34":"y","35":"y","36":"y","37":"y","38":"y","39":"y","40":"y","41":"y","42":"y","43":"y","44":"y","45":"y","46":"y","47":"y","48":"y","49":"y","50":"y","51":"y","52":"y","53":"y","54":"y","55":"y","56":"y","57":"y","58":"y","60":"y","62":"y","63":"y","64":"y","65":"y","66":"y","67":"y","68":"y","69":"y","70":"y","71":"y","72":"y","73":"y","74":"y","75":"y","76":"y","77":"y","78":"y","12.1":"y","9.5-9.6":"n","10.0-10.1":"n","10.5":"n","10.6":"n","11.1":"n","11.5":"n","11.6":"n"},ios_saf:{"8":"n","9.0-9.2":"y","9.3":"y","10.0-10.2":"y","10.3":"y","11.0-11.2":"y","11.3-11.4":"y","12.0-12.1":"y","12.2-12.4":"y","13.0-13.1":"y","13.2":"y","13.3":"y","13.4-13.7":"y","14.0-14.4":"y","14.5-14.7":"y","3.2":"n","4.0-4.1":"n","4.2-4.3":"n","5.0-5.1":"n","6.0-6.1":"n","7.0-7.1":"n","8.1-8.4":"n"},op_mini:{all:"y"},android:{"3":"n","4":"n","92":"y","4.4":"y","4.4.3-4.4.4":"y","2.1":"n","2.2":"n","2.3":"n","4.1":"n","4.2-4.3":"n"},bb:{"7":"n","10":"n"},op_mob:{"10":"n","11":"n","12":"n","64":"y","11.1":"n","11.5":"n","12.1":"n"},and_chr:{"92":"y"},and_ff:{"90":"y"},ie_mob:{"10":"n","11":"n"},and_uc:{"12.12":"y"},samsung:{"4":"y","5.0-5.4":"y","6.2-6.4":"y","7.2-7.4":"y","8.2":"y","9.2":"y","10.1":"y","11.1-11.2":"y","12.0":"y","13.0":"y","14.0":"y"},and_qq:{"10.4":"y"},baidu:{"7.12":"y"},kaios:{"2.5":"y"}}}}var A2,In=A(()=>{l();A2={ie:{prefix:"ms"},edge:{prefix:"webkit",prefix_exceptions:{"12":"ms","13":"ms","14":"ms","15":"ms","16":"ms","17":"ms","18":"ms"}},firefox:{prefix:"moz"},chrome:{prefix:"webkit"},safari:{prefix:"webkit"},opera:{prefix:"webkit",prefix_exceptions:{"9":"o","11":"o","12":"o","9.5-9.6":"o","10.0-10.1":"o","10.5":"o","10.6":"o","11.1":"o","11.5":"o","11.6":"o","12.1":"o"}},ios_saf:{prefix:"webkit"},op_mini:{prefix:"o"},android:{prefix:"webkit"},bb:{prefix:"webkit"},op_mob:{prefix:"o",prefix_exceptions:{"64":"webkit"}},and_chr:{prefix:"webkit"},and_ff:{prefix:"moz"},ie_mob:{prefix:"ms"},and_uc:{prefix:"webkit",prefix_exceptions:{"12.12":"webkit"}},samsung:{prefix:"webkit"},and_qq:{prefix:"webkit"},baidu:{prefix:"webkit"},kaios:{prefix:"moz"}}});var Rh=v(()=>{l()});var ne=v((q3,st)=>{l();var{list:_o}=me();st.exports.error=function(r){let e=new Error(r);throw e.autoprefixer=!0,e};st.exports.uniq=function(r){return[...new Set(r)]};st.exports.removeNote=function(r){return r.includes(" ")?r.split(" ")[0]:r};st.exports.escapeRegexp=function(r){return r.replace(/[$()*+-.?[\\\]^{|}]/g,"\\$&")};st.exports.regexp=function(r,e=!0){return e&&(r=this.escapeRegexp(r)),new RegExp(`(^|[\\s,(])(${r}($|[\\s(,]))`,"gi")};st.exports.editList=function(r,e){let t=_o.comma(r),i=e(t,[]);if(t===i)return r;let n=r.match(/,\s*/);return n=n?n[0]:", ",i.join(n)};st.exports.splitSelector=function(r){return _o.comma(r).map(e=>_o.space(e).map(t=>t.split(/(?=\.|#)/g)))}});var at=v((I3,Nh)=>{l();var E2=Co(),Mh=(In(),qn).agents,T2=ne(),Fh=class{static prefixes(){if(this.prefixesCache)return this.prefixesCache;this.prefixesCache=[];for(let e in Mh)this.prefixesCache.push(`-${Mh[e].prefix}-`);return this.prefixesCache=T2.uniq(this.prefixesCache).sort((e,t)=>t.length-e.length),this.prefixesCache}static withPrefix(e){return this.prefixesRegexp||(this.prefixesRegexp=new RegExp(this.prefixes().join("|"))),this.prefixesRegexp.test(e)}constructor(e,t,i,n){this.data=e,this.options=i||{},this.browserslistOpts=n||{},this.selected=this.parse(t)}parse(e){let t={};for(let i in this.browserslistOpts)t[i]=this.browserslistOpts[i];return t.path=this.options.from,E2(e,t)}prefix(e){let[t,i]=e.split(" "),n=this.data[t],s=n.prefix_exceptions&&n.prefix_exceptions[i];return s||(s=n.prefix),`-${s}-`}isSelected(e){return this.selected.includes(e)}};Nh.exports=Fh});var ei=v((R3,Lh)=>{l();Lh.exports={prefix(r){let e=r.match(/^(-\w+-)/);return e?e[0]:""},unprefixed(r){return r.replace(/^-\w+-/,"")}}});var Bt=v((M3,$h)=>{l();var P2=at(),Bh=ei(),D2=ne();function Ao(r,e){let t=new r.constructor;for(let i of Object.keys(r||{})){let n=r[i];i==="parent"&&typeof n=="object"?e&&(t[i]=e):i==="source"||i===null?t[i]=n:Array.isArray(n)?t[i]=n.map(s=>Ao(s,t)):i!=="_autoprefixerPrefix"&&i!=="_autoprefixerValues"&&i!=="proxyCache"&&(typeof n=="object"&&n!==null&&(n=Ao(n,t)),t[i]=n)}return t}var Rn=class{static hack(e){return this.hacks||(this.hacks={}),e.names.map(t=>(this.hacks[t]=e,this.hacks[t]))}static load(e,t,i){let n=this.hacks&&this.hacks[e];return n?new n(e,t,i):new this(e,t,i)}static clone(e,t){let i=Ao(e);for(let n in t)i[n]=t[n];return i}constructor(e,t,i){this.prefixes=t,this.name=e,this.all=i}parentPrefix(e){let t;return typeof e._autoprefixerPrefix!="undefined"?t=e._autoprefixerPrefix:e.type==="decl"&&e.prop[0]==="-"?t=Bh.prefix(e.prop):e.type==="root"?t=!1:e.type==="rule"&&e.selector.includes(":-")&&/:(-\w+-)/.test(e.selector)?t=e.selector.match(/:(-\w+-)/)[1]:e.type==="atrule"&&e.name[0]==="-"?t=Bh.prefix(e.name):t=this.parentPrefix(e.parent),P2.prefixes().includes(t)||(t=!1),e._autoprefixerPrefix=t,e._autoprefixerPrefix}process(e,t){if(!this.check(e))return;let i=this.parentPrefix(e),n=this.prefixes.filter(a=>!i||i===D2.removeNote(a)),s=[];for(let a of n)this.add(e,a,s.concat([a]),t)&&s.push(a);return s}clone(e,t){return Rn.clone(e,t)}};$h.exports=Rn});var I=v((F3,Vh)=>{l();var q2=Bt(),I2=at(),zh=ne(),jh=class extends q2{check(){return!0}prefixed(e,t){return t+e}normalize(e){return e}otherPrefixes(e,t){for(let i of I2.prefixes())if(i!==t&&e.includes(i))return!0;return!1}set(e,t){return e.prop=this.prefixed(e.prop,t),e}needCascade(e){return e._autoprefixerCascade||(e._autoprefixerCascade=this.all.options.cascade!==!1&&e.raw("before").includes(` +`)),e._autoprefixerCascade}maxPrefixed(e,t){if(t._autoprefixerMax)return t._autoprefixerMax;let i=0;for(let n of e)n=zh.removeNote(n),n.length>i&&(i=n.length);return t._autoprefixerMax=i,t._autoprefixerMax}calcBefore(e,t,i=""){let s=this.maxPrefixed(e,t)-zh.removeNote(i).length,a=t.raw("before");return s>0&&(a+=Array(s).fill(" ").join("")),a}restoreBefore(e){let t=e.raw("before").split(` +`),i=t[t.length-1];this.all.group(e).up(n=>{let s=n.raw("before").split(` +`),a=s[s.length-1];a.lengtha.prop===n.prop&&a.value===n.value)))return this.needCascade(e)&&(n.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,n)}isAlready(e,t){let i=this.all.group(e).up(n=>n.prop===t);return i||(i=this.all.group(e).down(n=>n.prop===t)),i}add(e,t,i,n){let s=this.prefixed(e.prop,t);if(!(this.isAlready(e,s)||this.otherPrefixes(e.value,t)))return this.insert(e,t,i,n)}process(e,t){if(!this.needCascade(e)){super.process(e,t);return}let i=super.process(e,t);!i||!i.length||(this.restoreBefore(e),e.raws.before=this.calcBefore(i,e))}old(e,t){return[this.prefixed(e,t)]}};Vh.exports=jh});var Wh=v((N3,Uh)=>{l();Uh.exports=function r(e){return{mul:t=>new r(e*t),div:t=>new r(e/t),simplify:()=>new r(e),toString:()=>e.toString()}}});var Yh=v((L3,Hh)=>{l();var R2=Wh(),M2=Bt(),Oo=ne(),F2=/(min|max)-resolution\s*:\s*\d*\.?\d+(dppx|dpcm|dpi|x)/gi,N2=/(min|max)-resolution(\s*:\s*)(\d*\.?\d+)(dppx|dpcm|dpi|x)/i,Gh=class extends M2{prefixName(e,t){return e==="-moz-"?t+"--moz-device-pixel-ratio":e+t+"-device-pixel-ratio"}prefixQuery(e,t,i,n,s){return n=new R2(n),s==="dpi"?n=n.div(96):s==="dpcm"&&(n=n.mul(2.54).div(96)),n=n.simplify(),e==="-o-"&&(n=n.n+"/"+n.d),this.prefixName(e,t)+i+n}clean(e){if(!this.bad){this.bad=[];for(let t of this.prefixes)this.bad.push(this.prefixName(t,"min")),this.bad.push(this.prefixName(t,"max"))}e.params=Oo.editList(e.params,t=>t.filter(i=>this.bad.every(n=>!i.includes(n))))}process(e){let t=this.parentPrefix(e),i=t?[t]:this.prefixes;e.params=Oo.editList(e.params,(n,s)=>{for(let a of n){if(!a.includes("min-resolution")&&!a.includes("max-resolution")){s.push(a);continue}for(let o of i){let u=a.replace(F2,c=>{let f=c.match(N2);return this.prefixQuery(o,f[1],f[2],f[3],f[4])});s.push(u)}s.push(a)}return Oo.uniq(s)})}};Hh.exports=Gh});var Zh=v((B3,Kh)=>{l();var{list:L2}=me(),Qh=Kr(),B2=at(),Jh=ei(),Xh=class{constructor(e){this.props=["transition","transition-property"],this.prefixes=e}add(e,t){let i,n,s=this.prefixes.add[e.prop],a=this.ruleVendorPrefixes(e),o=a||s&&s.prefixes||[],u=this.parse(e.value),c=u.map(d=>this.findProp(d)),f=[];if(c.some(d=>d[0]==="-"))return;for(let d of u){if(n=this.findProp(d),n[0]==="-")continue;let y=this.prefixes.add[n];if(!(!y||!y.prefixes))for(i of y.prefixes){if(a&&!a.some(w=>i.includes(w)))continue;let k=this.prefixes.prefixed(n,i);k!=="-ms-transform"&&!c.includes(k)&&(this.disabled(n,i)||f.push(this.clone(n,k,d)))}}u=u.concat(f);let p=this.stringify(u),h=this.stringify(this.cleanFromUnprefixed(u,"-webkit-"));if(o.includes("-webkit-")&&this.cloneBefore(e,`-webkit-${e.prop}`,h),this.cloneBefore(e,e.prop,h),o.includes("-o-")){let d=this.stringify(this.cleanFromUnprefixed(u,"-o-"));this.cloneBefore(e,`-o-${e.prop}`,d)}for(i of o)if(i!=="-webkit-"&&i!=="-o-"){let d=this.stringify(this.cleanOtherPrefixes(u,i));this.cloneBefore(e,i+e.prop,d)}p!==e.value&&!this.already(e,e.prop,p)&&(this.checkForWarning(t,e),e.cloneBefore(),e.value=p)}findProp(e){let t=e[0].value;if(/^\d/.test(t)){for(let[i,n]of e.entries())if(i!==0&&n.type==="word")return n.value}return t}already(e,t,i){return e.parent.some(n=>n.prop===t&&n.value===i)}cloneBefore(e,t,i){this.already(e,t,i)||e.cloneBefore({prop:t,value:i})}checkForWarning(e,t){if(t.prop!=="transition-property")return;let i=!1,n=!1;t.parent.each(s=>{if(s.type!=="decl"||s.prop.indexOf("transition-")!==0)return;let a=L2.comma(s.value);if(s.prop==="transition-property"){a.forEach(o=>{let u=this.prefixes.add[o];u&&u.prefixes&&u.prefixes.length>0&&(i=!0)});return}return n=n||a.length>1,!1}),i&&n&&t.warn(e,"Replace transition-property to transition, because Autoprefixer could not support any cases of transition-property and other transition-*")}remove(e){let t=this.parse(e.value);t=t.filter(a=>{let o=this.prefixes.remove[this.findProp(a)];return!o||!o.remove});let i=this.stringify(t);if(e.value===i)return;if(t.length===0){e.remove();return}let n=e.parent.some(a=>a.prop===e.prop&&a.value===i),s=e.parent.some(a=>a!==e&&a.prop===e.prop&&a.value.length>i.length);if(n||s){e.remove();return}e.value=i}parse(e){let t=Qh(e),i=[],n=[];for(let s of t.nodes)n.push(s),s.type==="div"&&s.value===","&&(i.push(n),n=[]);return i.push(n),i.filter(s=>s.length>0)}stringify(e){if(e.length===0)return"";let t=[];for(let i of e)i[i.length-1].type!=="div"&&i.push(this.div(e)),t=t.concat(i);return t[0].type==="div"&&(t=t.slice(1)),t[t.length-1].type==="div"&&(t=t.slice(0,-2+1||void 0)),Qh.stringify({nodes:t})}clone(e,t,i){let n=[],s=!1;for(let a of i)!s&&a.type==="word"&&a.value===e?(n.push({type:"word",value:t}),s=!0):n.push(a);return n}div(e){for(let t of e)for(let i of t)if(i.type==="div"&&i.value===",")return i;return{type:"div",value:",",after:" "}}cleanOtherPrefixes(e,t){return e.filter(i=>{let n=Jh.prefix(this.findProp(i));return n===""||n===t})}cleanFromUnprefixed(e,t){let i=e.map(s=>this.findProp(s)).filter(s=>s.slice(0,t.length)===t).map(s=>this.prefixes.unprefixed(s)),n=[];for(let s of e){let a=this.findProp(s),o=Jh.prefix(a);!i.includes(a)&&(o===t||o==="")&&n.push(s)}return n}disabled(e,t){let i=["order","justify-content","align-self","align-content"];if(e.includes("flex")||i.includes(e)){if(this.prefixes.options.flexbox===!1)return!0;if(this.prefixes.options.flexbox==="no-2009")return t.includes("2009")}}ruleVendorPrefixes(e){let{parent:t}=e;if(t.type!=="rule")return!1;if(!t.selector.includes(":-"))return!1;let i=B2.prefixes().filter(n=>t.selector.includes(":"+n));return i.length>0?i:!1}};Kh.exports=Xh});var $t=v(($3,tm)=>{l();var $2=ne(),em=class{constructor(e,t,i,n){this.unprefixed=e,this.prefixed=t,this.string=i||t,this.regexp=n||$2.regexp(t)}check(e){return e.includes(this.string)?!!e.match(this.regexp):!1}};tm.exports=em});var ke=v((z3,im)=>{l();var z2=Bt(),j2=$t(),V2=ei(),U2=ne(),rm=class extends z2{static save(e,t){let i=t.prop,n=[];for(let s in t._autoprefixerValues){let a=t._autoprefixerValues[s];if(a===t.value)continue;let o,u=V2.prefix(i);if(u==="-pie-")continue;if(u===s){o=t.value=a,n.push(o);continue}let c=e.prefixed(i,s),f=t.parent;if(!f.every(y=>y.prop!==c)){n.push(o);continue}let p=a.replace(/\s+/," ");if(f.some(y=>y.prop===t.prop&&y.value.replace(/\s+/," ")===p)){n.push(o);continue}let d=this.clone(t,{value:a});o=t.parent.insertBefore(t,d),n.push(o)}return n}check(e){let t=e.value;return t.includes(this.name)?!!t.match(this.regexp()):!1}regexp(){return this.regexpCache||(this.regexpCache=U2.regexp(this.name))}replace(e,t){return e.replace(this.regexp(),`$1${t}$2`)}value(e){return e.raws.value&&e.raws.value.value===e.value?e.raws.value.raw:e.value}add(e,t){e._autoprefixerValues||(e._autoprefixerValues={});let i=e._autoprefixerValues[t]||this.value(e),n;do if(n=i,i=this.replace(i,t),i===!1)return;while(i!==n);e._autoprefixerValues[t]=i}old(e){return new j2(this.name,e+this.name)}};im.exports=rm});var ot=v((j3,nm)=>{l();nm.exports={}});var To=v((V3,om)=>{l();var sm=Kr(),W2=ke(),G2=ot().insertAreas,H2=/(^|[^-])linear-gradient\(\s*(top|left|right|bottom)/i,Y2=/(^|[^-])radial-gradient\(\s*\d+(\w*|%)\s+\d+(\w*|%)\s*,/i,Q2=/(!\s*)?autoprefixer:\s*ignore\s+next/i,J2=/(!\s*)?autoprefixer\s*grid:\s*(on|off|(no-)?autoplace)/i,X2=["width","height","min-width","max-width","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size"];function Eo(r){return r.parent.some(e=>e.prop==="grid-template"||e.prop==="grid-template-areas")}function K2(r){let e=r.parent.some(i=>i.prop==="grid-template-rows"),t=r.parent.some(i=>i.prop==="grid-template-columns");return e&&t}var am=class{constructor(e){this.prefixes=e}add(e,t){let i=this.prefixes.add["@resolution"],n=this.prefixes.add["@keyframes"],s=this.prefixes.add["@viewport"],a=this.prefixes.add["@supports"];e.walkAtRules(f=>{if(f.name==="keyframes"){if(!this.disabled(f,t))return n&&n.process(f)}else if(f.name==="viewport"){if(!this.disabled(f,t))return s&&s.process(f)}else if(f.name==="supports"){if(this.prefixes.options.supports!==!1&&!this.disabled(f,t))return a.process(f)}else if(f.name==="media"&&f.params.includes("-resolution")&&!this.disabled(f,t))return i&&i.process(f)}),e.walkRules(f=>{if(!this.disabled(f,t))return this.prefixes.add.selectors.map(p=>p.process(f,t))});function o(f){return f.parent.nodes.some(p=>{if(p.type!=="decl")return!1;let h=p.prop==="display"&&/(inline-)?grid/.test(p.value),d=p.prop.startsWith("grid-template"),y=/^grid-([A-z]+-)?gap/.test(p.prop);return h||d||y})}function u(f){return f.parent.some(p=>p.prop==="display"&&/(inline-)?flex/.test(p.value))}let c=this.gridStatus(e,t)&&this.prefixes.add["grid-area"]&&this.prefixes.add["grid-area"].prefixes;return e.walkDecls(f=>{if(this.disabledDecl(f,t))return;let p=f.parent,h=f.prop,d=f.value;if(h==="grid-row-span"){t.warn("grid-row-span is not part of final Grid Layout. Use grid-row.",{node:f});return}else if(h==="grid-column-span"){t.warn("grid-column-span is not part of final Grid Layout. Use grid-column.",{node:f});return}else if(h==="display"&&d==="box"){t.warn("You should write display: flex by final spec instead of display: box",{node:f});return}else if(h==="text-emphasis-position")(d==="under"||d==="over")&&t.warn("You should use 2 values for text-emphasis-position For example, `under left` instead of just `under`.",{node:f});else if(/^(align|justify|place)-(items|content)$/.test(h)&&u(f))(d==="start"||d==="end")&&t.warn(`${d} value has mixed support, consider using flex-${d} instead`,{node:f});else if(h==="text-decoration-skip"&&d==="ink")t.warn("Replace text-decoration-skip: ink to text-decoration-skip-ink: auto, because spec had been changed",{node:f});else{if(c&&this.gridStatus(f,t))if(f.value==="subgrid"&&t.warn("IE does not support subgrid",{node:f}),/^(align|justify|place)-items$/.test(h)&&o(f)){let k=h.replace("-items","-self");t.warn(`IE does not support ${h} on grid containers. Try using ${k} on child elements instead: ${f.parent.selector} > * { ${k}: ${f.value} }`,{node:f})}else if(/^(align|justify|place)-content$/.test(h)&&o(f))t.warn(`IE does not support ${f.prop} on grid containers`,{node:f});else if(h==="display"&&f.value==="contents"){t.warn("Please do not use display: contents; if you have grid setting enabled",{node:f});return}else if(f.prop==="grid-gap"){let k=this.gridStatus(f,t);k==="autoplace"&&!K2(f)&&!Eo(f)?t.warn("grid-gap only works if grid-template(-areas) is being used or both rows and columns have been declared and cells have not been manually placed inside the explicit grid",{node:f}):(k===!0||k==="no-autoplace")&&!Eo(f)&&t.warn("grid-gap only works if grid-template(-areas) is being used",{node:f})}else if(h==="grid-auto-columns"){t.warn("grid-auto-columns is not supported by IE",{node:f});return}else if(h==="grid-auto-rows"){t.warn("grid-auto-rows is not supported by IE",{node:f});return}else if(h==="grid-auto-flow"){let k=p.some(b=>b.prop==="grid-template-rows"),w=p.some(b=>b.prop==="grid-template-columns");Eo(f)?t.warn("grid-auto-flow is not supported by IE",{node:f}):d.includes("dense")?t.warn("grid-auto-flow: dense is not supported by IE",{node:f}):!k&&!w&&t.warn("grid-auto-flow works only if grid-template-rows and grid-template-columns are present in the same rule",{node:f});return}else if(d.includes("auto-fit")){t.warn("auto-fit value is not supported by IE",{node:f,word:"auto-fit"});return}else if(d.includes("auto-fill")){t.warn("auto-fill value is not supported by IE",{node:f,word:"auto-fill"});return}else h.startsWith("grid-template")&&d.includes("[")&&t.warn("Autoprefixer currently does not support line names. Try using grid-template-areas instead.",{node:f,word:"["});if(d.includes("radial-gradient"))if(Y2.test(f.value))t.warn("Gradient has outdated direction syntax. New syntax is like `closest-side at 0 0` instead of `0 0, closest-side`.",{node:f});else{let k=sm(d);for(let w of k.nodes)if(w.type==="function"&&w.value==="radial-gradient")for(let b of w.nodes)b.type==="word"&&(b.value==="cover"?t.warn("Gradient has outdated direction syntax. Replace `cover` to `farthest-corner`.",{node:f}):b.value==="contain"&&t.warn("Gradient has outdated direction syntax. Replace `contain` to `closest-side`.",{node:f}))}d.includes("linear-gradient")&&H2.test(d)&&t.warn("Gradient has outdated direction syntax. New syntax is like `to left` instead of `right`.",{node:f})}X2.includes(f.prop)&&(f.value.includes("-fill-available")||(f.value.includes("fill-available")?t.warn("Replace fill-available to stretch, because spec had been changed",{node:f}):f.value.includes("fill")&&sm(d).nodes.some(w=>w.type==="word"&&w.value==="fill")&&t.warn("Replace fill to stretch, because spec had been changed",{node:f})));let y;if(f.prop==="transition"||f.prop==="transition-property")return this.prefixes.transition.add(f,t);if(f.prop==="align-self"){if(this.displayType(f)!=="grid"&&this.prefixes.options.flexbox!==!1&&(y=this.prefixes.add["align-self"],y&&y.prefixes&&y.process(f)),this.gridStatus(f,t)!==!1&&(y=this.prefixes.add["grid-row-align"],y&&y.prefixes))return y.process(f,t)}else if(f.prop==="justify-self"){if(this.gridStatus(f,t)!==!1&&(y=this.prefixes.add["grid-column-align"],y&&y.prefixes))return y.process(f,t)}else if(f.prop==="place-self"){if(y=this.prefixes.add["place-self"],y&&y.prefixes&&this.gridStatus(f,t)!==!1)return y.process(f,t)}else if(y=this.prefixes.add[f.prop],y&&y.prefixes)return y.process(f,t)}),this.gridStatus(e,t)&&G2(e,this.disabled),e.walkDecls(f=>{if(this.disabledValue(f,t))return;let p=this.prefixes.unprefixed(f.prop),h=this.prefixes.values("add",p);if(Array.isArray(h))for(let d of h)d.process&&d.process(f,t);W2.save(this.prefixes,f)})}remove(e,t){let i=this.prefixes.remove["@resolution"];e.walkAtRules((n,s)=>{this.prefixes.remove[`@${n.name}`]?this.disabled(n,t)||n.parent.removeChild(s):n.name==="media"&&n.params.includes("-resolution")&&i&&i.clean(n)});for(let n of this.prefixes.remove.selectors)e.walkRules((s,a)=>{n.check(s)&&(this.disabled(s,t)||s.parent.removeChild(a))});return e.walkDecls((n,s)=>{if(this.disabled(n,t))return;let a=n.parent,o=this.prefixes.unprefixed(n.prop);if((n.prop==="transition"||n.prop==="transition-property")&&this.prefixes.transition.remove(n),this.prefixes.remove[n.prop]&&this.prefixes.remove[n.prop].remove){let u=this.prefixes.group(n).down(c=>this.prefixes.normalize(c.prop)===o);if(o==="flex-flow"&&(u=!0),n.prop==="-webkit-box-orient"){let c={"flex-direction":!0,"flex-flow":!0};if(!n.parent.some(f=>c[f.prop]))return}if(u&&!this.withHackValue(n)){n.raw("before").includes(` +`)&&this.reduceSpaces(n),a.removeChild(s);return}}for(let u of this.prefixes.values("remove",o)){if(!u.check||!u.check(n.value))continue;if(o=u.unprefixed,this.prefixes.group(n).down(f=>f.value.includes(o))){a.removeChild(s);return}}})}withHackValue(e){return e.prop==="-webkit-background-clip"&&e.value==="text"}disabledValue(e,t){return this.gridStatus(e,t)===!1&&e.type==="decl"&&e.prop==="display"&&e.value.includes("grid")||this.prefixes.options.flexbox===!1&&e.type==="decl"&&e.prop==="display"&&e.value.includes("flex")||e.type==="decl"&&e.prop==="content"?!0:this.disabled(e,t)}disabledDecl(e,t){if(this.gridStatus(e,t)===!1&&e.type==="decl"&&(e.prop.includes("grid")||e.prop==="justify-items"))return!0;if(this.prefixes.options.flexbox===!1&&e.type==="decl"){let i=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||i.includes(e.prop))return!0}return this.disabled(e,t)}disabled(e,t){if(!e)return!1;if(e._autoprefixerDisabled!==void 0)return e._autoprefixerDisabled;if(e.parent){let n=e.prev();if(n&&n.type==="comment"&&Q2.test(n.text))return e._autoprefixerDisabled=!0,e._autoprefixerSelfDisabled=!0,!0}let i=null;if(e.nodes){let n;e.each(s=>{s.type==="comment"&&/(!\s*)?autoprefixer:\s*(off|on)/i.test(s.text)&&(typeof n!="undefined"?t.warn("Second Autoprefixer control comment was ignored. Autoprefixer applies control comment to whole block, not to next rules.",{node:s}):n=/on/i.test(s.text))}),n!==void 0&&(i=!n)}if(!e.nodes||i===null)if(e.parent){let n=this.disabled(e.parent,t);e.parent._autoprefixerSelfDisabled===!0?i=!1:i=n}else i=!1;return e._autoprefixerDisabled=i,i}reduceSpaces(e){let t=!1;if(this.prefixes.group(e).up(()=>(t=!0,!0)),t)return;let i=e.raw("before").split(` +`),n=i[i.length-1].length,s=!1;this.prefixes.group(e).down(a=>{i=a.raw("before").split(` +`);let o=i.length-1;i[o].length>n&&(s===!1&&(s=i[o].length-n),i[o]=i[o].slice(0,-s),a.raws.before=i.join(` +`))})}displayType(e){for(let t of e.parent.nodes)if(t.prop==="display"){if(t.value.includes("flex"))return"flex";if(t.value.includes("grid"))return"grid"}return!1}gridStatus(e,t){if(!e)return!1;if(e._autoprefixerGridStatus!==void 0)return e._autoprefixerGridStatus;let i=null;if(e.nodes){let n;e.each(s=>{if(s.type==="comment"&&J2.test(s.text)){let a=/:\s*autoplace/i.test(s.text),o=/no-autoplace/i.test(s.text);typeof n!="undefined"?t.warn("Second Autoprefixer grid control comment was ignored. Autoprefixer applies control comments to the whole block, not to the next rules.",{node:s}):a?n="autoplace":o?n=!0:n=/on/i.test(s.text)}}),n!==void 0&&(i=n)}if(e.type==="atrule"&&e.name==="supports"){let n=e.params;n.includes("grid")&&n.includes("auto")&&(i=!1)}if(!e.nodes||i===null)if(e.parent){let n=this.gridStatus(e.parent,t);e.parent._autoprefixerSelfDisabled===!0?i=!1:i=n}else typeof this.prefixes.options.grid!="undefined"?i=this.prefixes.options.grid:typeof m.env.AUTOPREFIXER_GRID!="undefined"?m.env.AUTOPREFIXER_GRID==="autoplace"?i="autoplace":i=!0:i=!1;return e._autoprefixerGridStatus=i,i}};om.exports=am});var um=v((U3,lm)=>{l();lm.exports={A:{A:{"2":"J D E F A B iB"},B:{"1":"C K L G M N O R S T U V W X Y Z a P b H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB bB HB cB IB JB Q KB LB MB NB OB PB QB RB SB TB UB VB WB XB R S T kB U V W X Y Z a P b H dB","2":"jB aB I c J D E F A B C K L G M N O d e f lB mB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 m n o p q r s t u v w x y z AB BB CB DB EB FB GB bB HB cB IB JB Q KB LB MB NB OB PB QB RB SB TB UB VB WB XB R S T U V W X Y Z a P b H dB nB oB","2":"I c J D E F A B C K L G M N O d e f g h i j k l"},E:{"1":"F A B C K L G tB fB YB ZB uB vB wB","2":"I c J D E pB eB qB rB sB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB Q KB LB MB NB OB PB QB RB SB TB UB VB WB XB ZB","2":"F B C xB yB zB 0B YB gB 1B"},G:{"1":"7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC","2":"E eB 2B hB 3B 4B 5B 6B"},H:{"1":"LC"},I:{"1":"H QC RC","2":"aB I MC NC OC PC hB"},J:{"2":"D A"},K:{"1":"Q","2":"A B C YB gB ZB"},L:{"1":"H"},M:{"1":"P"},N:{"2":"A B"},O:{"1":"SC"},P:{"1":"I TC UC VC WC XC fB YC ZC aC bC"},Q:{"1":"cC"},R:{"1":"dC"},S:{"1":"eC"}},B:4,C:"CSS Feature Queries"}});var dm=v((W3,pm)=>{l();function fm(r){return r[r.length-1]}var cm={parse(r){let e=[""],t=[e];for(let i of r){if(i==="("){e=[""],fm(t).push(e),t.push(e);continue}if(i===")"){t.pop(),e=fm(t),e.push("");continue}e[e.length-1]+=i}return t[0]},stringify(r){let e="";for(let t of r){if(typeof t=="object"){e+=`(${cm.stringify(t)})`;continue}e+=t}return e}};pm.exports=cm});var wm=v((G3,ym)=>{l();var Z2=um(),{feature:eC}=(In(),qn),{parse:tC}=me(),rC=at(),Po=dm(),iC=ke(),nC=ne(),hm=eC(Z2),mm=[];for(let r in hm.stats){let e=hm.stats[r];for(let t in e){let i=e[t];/y/.test(i)&&mm.push(r+" "+t)}}var gm=class{constructor(e,t){this.Prefixes=e,this.all=t}prefixer(){if(this.prefixerCache)return this.prefixerCache;let e=this.all.browsers.selected.filter(i=>mm.includes(i)),t=new rC(this.all.browsers.data,e,this.all.options);return this.prefixerCache=new this.Prefixes(this.all.data,t,this.all.options),this.prefixerCache}parse(e){let t=e.split(":"),i=t[0],n=t[1];return n||(n=""),[i.trim(),n.trim()]}virtual(e){let[t,i]=this.parse(e),n=tC("a{}").first;return n.append({prop:t,value:i,raws:{before:""}}),n}prefixed(e){let t=this.virtual(e);if(this.disabled(t.first))return t.nodes;let i={warn:()=>null},n=this.prefixer().add[t.first.prop];n&&n.process&&n.process(t.first,i);for(let s of t.nodes){for(let a of this.prefixer().values("add",t.first.prop))a.process(s);iC.save(this.all,s)}return t.nodes}isNot(e){return typeof e=="string"&&/not\s*/i.test(e)}isOr(e){return typeof e=="string"&&/\s*or\s*/i.test(e)}isProp(e){return typeof e=="object"&&e.length===1&&typeof e[0]=="string"}isHack(e,t){return!new RegExp(`(\\(|\\s)${nC.escapeRegexp(t)}:`).test(e)}toRemove(e,t){let[i,n]=this.parse(e),s=this.all.unprefixed(i),a=this.all.cleaner();if(a.remove[i]&&a.remove[i].remove&&!this.isHack(t,s))return!0;for(let o of a.values("remove",s))if(o.check(n))return!0;return!1}remove(e,t){let i=0;for(;itypeof t!="object"?t:t.length===1&&typeof t[0]=="object"?this.cleanBrackets(t[0]):this.cleanBrackets(t))}convert(e){let t=[""];for(let i of e)t.push([`${i.prop}: ${i.value}`]),t.push(" or ");return t[t.length-1]="",t}normalize(e){if(typeof e!="object")return e;if(e=e.filter(t=>t!==""),typeof e[0]=="string"){let t=e[0].trim();if(t.includes(":")||t==="selector"||t==="not selector")return[Po.stringify(e)]}return e.map(t=>this.normalize(t))}add(e,t){return e.map(i=>{if(this.isProp(i)){let n=this.prefixed(i[0]);return n.length>1?this.convert(n):i}return typeof i=="object"?this.add(i,t):i})}process(e){let t=Po.parse(e.params);t=this.normalize(t),t=this.remove(t,e.params),t=this.add(t,e.params),t=this.cleanBrackets(t),e.params=Po.stringify(t)}disabled(e){if(!this.all.options.grid&&(e.prop==="display"&&e.value.includes("grid")||e.prop.includes("grid")||e.prop==="justify-items"))return!0;if(this.all.options.flexbox===!1){if(e.prop==="display"&&e.value.includes("flex"))return!0;let t=["order","justify-content","align-items","align-content"];if(e.prop.includes("flex")||t.includes(e.prop))return!0}return!1}};ym.exports=gm});var xm=v((H3,vm)=>{l();var bm=class{constructor(e,t){this.prefix=t,this.prefixed=e.prefixed(this.prefix),this.regexp=e.regexp(this.prefix),this.prefixeds=e.possible().map(i=>[e.prefixed(i),e.regexp(i)]),this.unprefixed=e.name,this.nameRegexp=e.regexp()}isHack(e){let t=e.parent.index(e)+1,i=e.parent.nodes;for(;t{l();var{list:sC}=me(),aC=xm(),oC=Bt(),lC=at(),uC=ne(),km=class extends oC{constructor(e,t,i){super(e,t,i);this.regexpCache=new Map}check(e){return e.selector.includes(this.name)?!!e.selector.match(this.regexp()):!1}prefixed(e){return this.name.replace(/^(\W*)/,`$1${e}`)}regexp(e){if(!this.regexpCache.has(e)){let t=e?this.prefixed(e):this.name;this.regexpCache.set(e,new RegExp(`(^|[^:"'=])${uC.escapeRegexp(t)}`,"gi"))}return this.regexpCache.get(e)}possible(){return lC.prefixes()}prefixeds(e){if(e._autoprefixerPrefixeds){if(e._autoprefixerPrefixeds[this.name])return e._autoprefixerPrefixeds}else e._autoprefixerPrefixeds={};let t={};if(e.selector.includes(",")){let n=sC.comma(e.selector).filter(s=>s.includes(this.name));for(let s of this.possible())t[s]=n.map(a=>this.replace(a,s)).join(", ")}else for(let i of this.possible())t[i]=this.replace(e.selector,i);return e._autoprefixerPrefixeds[this.name]=t,e._autoprefixerPrefixeds}already(e,t,i){let n=e.parent.index(e)-1;for(;n>=0;){let s=e.parent.nodes[n];if(s.type!=="rule")return!1;let a=!1;for(let o in t[this.name]){let u=t[this.name][o];if(s.selector===u){if(i===o)return!0;a=!0;break}}if(!a)return!1;n-=1}return!1}replace(e,t){return e.replace(this.regexp(),`$1${this.prefixed(t)}`)}add(e,t){let i=this.prefixeds(e);if(this.already(e,i,t))return;let n=this.clone(e,{selector:i[this.name][t]});e.parent.insertBefore(e,n)}old(e){return new aC(this,e)}};Sm.exports=km});var Am=v((Q3,_m)=>{l();var fC=Bt(),Cm=class extends fC{add(e,t){let i=t+e.name;if(e.parent.some(a=>a.name===i&&a.params===e.params))return;let s=this.clone(e,{name:i});return e.parent.insertBefore(e,s)}process(e){let t=this.parentPrefix(e);for(let i of this.prefixes)(!t||t===i)&&this.add(e,i)}};_m.exports=Cm});var Em=v((J3,Om)=>{l();var cC=zt(),Do=class extends cC{prefixed(e){return e==="-webkit-"?":-webkit-full-screen":e==="-moz-"?":-moz-full-screen":`:${e}fullscreen`}};Do.names=[":fullscreen"];Om.exports=Do});var Pm=v((X3,Tm)=>{l();var pC=zt(),qo=class extends pC{possible(){return super.possible().concat(["-moz- old","-ms- old"])}prefixed(e){return e==="-webkit-"?"::-webkit-input-placeholder":e==="-ms-"?"::-ms-input-placeholder":e==="-ms- old"?":-ms-input-placeholder":e==="-moz- old"?":-moz-placeholder":`::${e}placeholder`}};qo.names=["::placeholder"];Tm.exports=qo});var qm=v((K3,Dm)=>{l();var dC=zt(),Io=class extends dC{prefixed(e){return e==="-ms-"?":-ms-input-placeholder":`:${e}placeholder-shown`}};Io.names=[":placeholder-shown"];Dm.exports=Io});var Rm=v((Z3,Im)=>{l();var hC=zt(),mC=ne(),Ro=class extends hC{constructor(e,t,i){super(e,t,i);this.prefixes&&(this.prefixes=mC.uniq(this.prefixes.map(n=>"-webkit-")))}prefixed(e){return e==="-webkit-"?"::-webkit-file-upload-button":`::${e}file-selector-button`}};Ro.names=["::file-selector-button"];Im.exports=Ro});var fe=v((eD,Mm)=>{l();Mm.exports=function(r){let e;return r==="-webkit- 2009"||r==="-moz-"?e=2009:r==="-ms-"?e=2012:r==="-webkit-"&&(e="final"),r==="-webkit- 2009"&&(r="-webkit-"),[e,r]}});var Bm=v((tD,Lm)=>{l();var Fm=me().list,Nm=fe(),gC=I(),jt=class extends gC{prefixed(e,t){let i;return[i,t]=Nm(t),i===2009?t+"box-flex":super.prefixed(e,t)}normalize(){return"flex"}set(e,t){let i=Nm(t)[0];if(i===2009)return e.value=Fm.space(e.value)[0],e.value=jt.oldValues[e.value]||e.value,super.set(e,t);if(i===2012){let n=Fm.space(e.value);n.length===3&&n[2]==="0"&&(e.value=n.slice(0,2).concat("0px").join(" "))}return super.set(e,t)}};jt.names=["flex","box-flex"];jt.oldValues={auto:"1",none:"0"};Lm.exports=jt});var jm=v((rD,zm)=>{l();var $m=fe(),yC=I(),Mo=class extends yC{prefixed(e,t){let i;return[i,t]=$m(t),i===2009?t+"box-ordinal-group":i===2012?t+"flex-order":super.prefixed(e,t)}normalize(){return"order"}set(e,t){return $m(t)[0]===2009&&/\d/.test(e.value)?(e.value=(parseInt(e.value)+1).toString(),super.set(e,t)):super.set(e,t)}};Mo.names=["order","flex-order","box-ordinal-group"];zm.exports=Mo});var Um=v((iD,Vm)=>{l();var wC=I(),Fo=class extends wC{check(e){let t=e.value;return!t.toLowerCase().includes("alpha(")&&!t.includes("DXImageTransform.Microsoft")&&!t.includes("data:image/svg+xml")}};Fo.names=["filter"];Vm.exports=Fo});var Gm=v((nD,Wm)=>{l();var bC=I(),No=class extends bC{insert(e,t,i,n){if(t!=="-ms-")return super.insert(e,t,i);let s=this.clone(e),a=e.prop.replace(/end$/,"start"),o=t+e.prop.replace(/end$/,"span");if(!e.parent.some(u=>u.prop===o)){if(s.prop=o,e.value.includes("span"))s.value=e.value.replace(/span\s/i,"");else{let u;if(e.parent.walkDecls(a,c=>{u=c}),u){let c=Number(e.value)-Number(u.value)+"";s.value=c}else e.warn(n,`Can not prefix ${e.prop} (${a} is not found)`)}e.cloneBefore(s)}}};No.names=["grid-row-end","grid-column-end"];Wm.exports=No});var Ym=v((sD,Hm)=>{l();var vC=I(),Lo=class extends vC{check(e){return!e.value.split(/\s+/).some(t=>{let i=t.toLowerCase();return i==="reverse"||i==="alternate-reverse"})}};Lo.names=["animation","animation-direction"];Hm.exports=Lo});var Jm=v((aD,Qm)=>{l();var xC=fe(),kC=I(),Bo=class extends kC{insert(e,t,i){let n;if([n,t]=xC(t),n!==2009)return super.insert(e,t,i);let s=e.value.split(/\s+/).filter(p=>p!=="wrap"&&p!=="nowrap"&&"wrap-reverse");if(s.length===0||e.parent.some(p=>p.prop===t+"box-orient"||p.prop===t+"box-direction"))return;let o=s[0],u=o.includes("row")?"horizontal":"vertical",c=o.includes("reverse")?"reverse":"normal",f=this.clone(e);return f.prop=t+"box-orient",f.value=u,this.needCascade(e)&&(f.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,f),f=this.clone(e),f.prop=t+"box-direction",f.value=c,this.needCascade(e)&&(f.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,f)}};Bo.names=["flex-flow","box-direction","box-orient"];Qm.exports=Bo});var Km=v((oD,Xm)=>{l();var SC=fe(),CC=I(),$o=class extends CC{normalize(){return"flex"}prefixed(e,t){let i;return[i,t]=SC(t),i===2009?t+"box-flex":i===2012?t+"flex-positive":super.prefixed(e,t)}};$o.names=["flex-grow","flex-positive"];Xm.exports=$o});var eg=v((lD,Zm)=>{l();var _C=fe(),AC=I(),zo=class extends AC{set(e,t){if(_C(t)[0]!==2009)return super.set(e,t)}};zo.names=["flex-wrap"];Zm.exports=zo});var rg=v((uD,tg)=>{l();var OC=I(),Vt=ot(),jo=class extends OC{insert(e,t,i,n){if(t!=="-ms-")return super.insert(e,t,i);let s=Vt.parse(e),[a,o]=Vt.translate(s,0,2),[u,c]=Vt.translate(s,1,3);[["grid-row",a],["grid-row-span",o],["grid-column",u],["grid-column-span",c]].forEach(([f,p])=>{Vt.insertDecl(e,f,p)}),Vt.warnTemplateSelectorNotFound(e,n),Vt.warnIfGridRowColumnExists(e,n)}};jo.names=["grid-area"];tg.exports=jo});var ng=v((fD,ig)=>{l();var EC=I(),ti=ot(),Vo=class extends EC{insert(e,t,i){if(t!=="-ms-")return super.insert(e,t,i);if(e.parent.some(a=>a.prop==="-ms-grid-row-align"))return;let[[n,s]]=ti.parse(e);s?(ti.insertDecl(e,"grid-row-align",n),ti.insertDecl(e,"grid-column-align",s)):(ti.insertDecl(e,"grid-row-align",n),ti.insertDecl(e,"grid-column-align",n))}};Vo.names=["place-self"];ig.exports=Vo});var ag=v((cD,sg)=>{l();var TC=I(),Uo=class extends TC{check(e){let t=e.value;return!t.includes("/")||t.includes("span")}normalize(e){return e.replace("-start","")}prefixed(e,t){let i=super.prefixed(e,t);return t==="-ms-"&&(i=i.replace("-start","")),i}};Uo.names=["grid-row-start","grid-column-start"];sg.exports=Uo});var ug=v((pD,lg)=>{l();var og=fe(),PC=I(),Ut=class extends PC{check(e){return e.parent&&!e.parent.some(t=>t.prop&&t.prop.startsWith("grid-"))}prefixed(e,t){let i;return[i,t]=og(t),i===2012?t+"flex-item-align":super.prefixed(e,t)}normalize(){return"align-self"}set(e,t){let i=og(t)[0];if(i===2012)return e.value=Ut.oldValues[e.value]||e.value,super.set(e,t);if(i==="final")return super.set(e,t)}};Ut.names=["align-self","flex-item-align"];Ut.oldValues={"flex-end":"end","flex-start":"start"};lg.exports=Ut});var cg=v((dD,fg)=>{l();var DC=I(),qC=ne(),Wo=class extends DC{constructor(e,t,i){super(e,t,i);this.prefixes&&(this.prefixes=qC.uniq(this.prefixes.map(n=>n==="-ms-"?"-webkit-":n)))}};Wo.names=["appearance"];fg.exports=Wo});var hg=v((hD,dg)=>{l();var pg=fe(),IC=I(),Go=class extends IC{normalize(){return"flex-basis"}prefixed(e,t){let i;return[i,t]=pg(t),i===2012?t+"flex-preferred-size":super.prefixed(e,t)}set(e,t){let i;if([i,t]=pg(t),i===2012||i==="final")return super.set(e,t)}};Go.names=["flex-basis","flex-preferred-size"];dg.exports=Go});var gg=v((mD,mg)=>{l();var RC=I(),Ho=class extends RC{normalize(){return this.name.replace("box-image","border")}prefixed(e,t){let i=super.prefixed(e,t);return t==="-webkit-"&&(i=i.replace("border","box-image")),i}};Ho.names=["mask-border","mask-border-source","mask-border-slice","mask-border-width","mask-border-outset","mask-border-repeat","mask-box-image","mask-box-image-source","mask-box-image-slice","mask-box-image-width","mask-box-image-outset","mask-box-image-repeat"];mg.exports=Ho});var wg=v((gD,yg)=>{l();var MC=I(),Fe=class extends MC{insert(e,t,i){let n=e.prop==="mask-composite",s;n?s=e.value.split(","):s=e.value.match(Fe.regexp)||[],s=s.map(c=>c.trim()).filter(c=>c);let a=s.length,o;if(a&&(o=this.clone(e),o.value=s.map(c=>Fe.oldValues[c]||c).join(", "),s.includes("intersect")&&(o.value+=", xor"),o.prop=t+"mask-composite"),n)return a?(this.needCascade(e)&&(o.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,o)):void 0;let u=this.clone(e);return u.prop=t+u.prop,a&&(u.value=u.value.replace(Fe.regexp,"")),this.needCascade(e)&&(u.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,u),a?(this.needCascade(e)&&(o.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,o)):e}};Fe.names=["mask","mask-composite"];Fe.oldValues={add:"source-over",subtract:"source-out",intersect:"source-in",exclude:"xor"};Fe.regexp=new RegExp(`\\s+(${Object.keys(Fe.oldValues).join("|")})\\b(?!\\))\\s*(?=[,])`,"ig");yg.exports=Fe});var xg=v((yD,vg)=>{l();var bg=fe(),FC=I(),Wt=class extends FC{prefixed(e,t){let i;return[i,t]=bg(t),i===2009?t+"box-align":i===2012?t+"flex-align":super.prefixed(e,t)}normalize(){return"align-items"}set(e,t){let i=bg(t)[0];return(i===2009||i===2012)&&(e.value=Wt.oldValues[e.value]||e.value),super.set(e,t)}};Wt.names=["align-items","flex-align","box-align"];Wt.oldValues={"flex-end":"end","flex-start":"start"};vg.exports=Wt});var Sg=v((wD,kg)=>{l();var NC=I(),Yo=class extends NC{set(e,t){return t==="-ms-"&&e.value==="contain"&&(e.value="element"),super.set(e,t)}insert(e,t,i){if(!(e.value==="all"&&t==="-ms-"))return super.insert(e,t,i)}};Yo.names=["user-select"];kg.exports=Yo});var Ag=v((bD,_g)=>{l();var Cg=fe(),LC=I(),Qo=class extends LC{normalize(){return"flex-shrink"}prefixed(e,t){let i;return[i,t]=Cg(t),i===2012?t+"flex-negative":super.prefixed(e,t)}set(e,t){let i;if([i,t]=Cg(t),i===2012||i==="final")return super.set(e,t)}};Qo.names=["flex-shrink","flex-negative"];_g.exports=Qo});var Eg=v((vD,Og)=>{l();var BC=I(),Jo=class extends BC{prefixed(e,t){return`${t}column-${e}`}normalize(e){return e.includes("inside")?"break-inside":e.includes("before")?"break-before":"break-after"}set(e,t){return(e.prop==="break-inside"&&e.value==="avoid-column"||e.value==="avoid-page")&&(e.value="avoid"),super.set(e,t)}insert(e,t,i){if(e.prop!=="break-inside")return super.insert(e,t,i);if(!(/region/i.test(e.value)||/page/i.test(e.value)))return super.insert(e,t,i)}};Jo.names=["break-inside","page-break-inside","column-break-inside","break-before","page-break-before","column-break-before","break-after","page-break-after","column-break-after"];Og.exports=Jo});var Pg=v((xD,Tg)=>{l();var $C=I(),Xo=class extends $C{prefixed(e,t){return t+"print-color-adjust"}normalize(){return"color-adjust"}};Xo.names=["color-adjust","print-color-adjust"];Tg.exports=Xo});var qg=v((kD,Dg)=>{l();var zC=I(),Gt=class extends zC{insert(e,t,i){if(t==="-ms-"){let n=this.set(this.clone(e),t);this.needCascade(e)&&(n.raws.before=this.calcBefore(i,e,t));let s="ltr";return e.parent.nodes.forEach(a=>{a.prop==="direction"&&(a.value==="rtl"||a.value==="ltr")&&(s=a.value)}),n.value=Gt.msValues[s][e.value]||e.value,e.parent.insertBefore(e,n)}return super.insert(e,t,i)}};Gt.names=["writing-mode"];Gt.msValues={ltr:{"horizontal-tb":"lr-tb","vertical-rl":"tb-rl","vertical-lr":"tb-lr"},rtl:{"horizontal-tb":"rl-tb","vertical-rl":"bt-rl","vertical-lr":"bt-lr"}};Dg.exports=Gt});var Rg=v((SD,Ig)=>{l();var jC=I(),Ko=class extends jC{set(e,t){return e.value=e.value.replace(/\s+fill(\s)/,"$1"),super.set(e,t)}};Ko.names=["border-image"];Ig.exports=Ko});var Ng=v((CD,Fg)=>{l();var Mg=fe(),VC=I(),Ht=class extends VC{prefixed(e,t){let i;return[i,t]=Mg(t),i===2012?t+"flex-line-pack":super.prefixed(e,t)}normalize(){return"align-content"}set(e,t){let i=Mg(t)[0];if(i===2012)return e.value=Ht.oldValues[e.value]||e.value,super.set(e,t);if(i==="final")return super.set(e,t)}};Ht.names=["align-content","flex-line-pack"];Ht.oldValues={"flex-end":"end","flex-start":"start","space-between":"justify","space-around":"distribute"};Fg.exports=Ht});var Bg=v((_D,Lg)=>{l();var UC=I(),Se=class extends UC{prefixed(e,t){return t==="-moz-"?t+(Se.toMozilla[e]||e):super.prefixed(e,t)}normalize(e){return Se.toNormal[e]||e}};Se.names=["border-radius"];Se.toMozilla={};Se.toNormal={};for(let r of["top","bottom"])for(let e of["left","right"]){let t=`border-${r}-${e}-radius`,i=`border-radius-${r}${e}`;Se.names.push(t),Se.names.push(i),Se.toMozilla[t]=i,Se.toNormal[i]=t}Lg.exports=Se});var zg=v((AD,$g)=>{l();var WC=I(),Zo=class extends WC{prefixed(e,t){return e.includes("-start")?t+e.replace("-block-start","-before"):t+e.replace("-block-end","-after")}normalize(e){return e.includes("-before")?e.replace("-before","-block-start"):e.replace("-after","-block-end")}};Zo.names=["border-block-start","border-block-end","margin-block-start","margin-block-end","padding-block-start","padding-block-end","border-before","border-after","margin-before","margin-after","padding-before","padding-after"];$g.exports=Zo});var Vg=v((OD,jg)=>{l();var GC=I(),{parseTemplate:HC,warnMissedAreas:YC,getGridGap:QC,warnGridGap:JC,inheritGridGap:XC}=ot(),el=class extends GC{insert(e,t,i,n){if(t!=="-ms-")return super.insert(e,t,i);if(e.parent.some(d=>d.prop==="-ms-grid-rows"))return;let s=QC(e),a=XC(e,s),{rows:o,columns:u,areas:c}=HC({decl:e,gap:a||s}),f=Object.keys(c).length>0,p=Boolean(o),h=Boolean(u);return JC({gap:s,hasColumns:h,decl:e,result:n}),YC(c,e,n),(p&&h||f)&&e.cloneBefore({prop:"-ms-grid-rows",value:o,raws:{}}),h&&e.cloneBefore({prop:"-ms-grid-columns",value:u,raws:{}}),e}};el.names=["grid-template"];jg.exports=el});var Wg=v((ED,Ug)=>{l();var KC=I(),tl=class extends KC{prefixed(e,t){return t+e.replace("-inline","")}normalize(e){return e.replace(/(margin|padding|border)-(start|end)/,"$1-inline-$2")}};tl.names=["border-inline-start","border-inline-end","margin-inline-start","margin-inline-end","padding-inline-start","padding-inline-end","border-start","border-end","margin-start","margin-end","padding-start","padding-end"];Ug.exports=tl});var Hg=v((TD,Gg)=>{l();var ZC=I(),rl=class extends ZC{check(e){return!e.value.includes("flex-")&&e.value!=="baseline"}prefixed(e,t){return t+"grid-row-align"}normalize(){return"align-self"}};rl.names=["grid-row-align"];Gg.exports=rl});var Qg=v((PD,Yg)=>{l();var e_=I(),Yt=class extends e_{keyframeParents(e){let{parent:t}=e;for(;t;){if(t.type==="atrule"&&t.name==="keyframes")return!0;({parent:t}=t)}return!1}contain3d(e){if(e.prop==="transform-origin")return!1;for(let t of Yt.functions3d)if(e.value.includes(`${t}(`))return!0;return!1}set(e,t){return e=super.set(e,t),t==="-ms-"&&(e.value=e.value.replace(/rotatez/gi,"rotate")),e}insert(e,t,i){if(t==="-ms-"){if(!this.contain3d(e)&&!this.keyframeParents(e))return super.insert(e,t,i)}else if(t==="-o-"){if(!this.contain3d(e))return super.insert(e,t,i)}else return super.insert(e,t,i)}};Yt.names=["transform","transform-origin"];Yt.functions3d=["matrix3d","translate3d","translateZ","scale3d","scaleZ","rotate3d","rotateX","rotateY","perspective"];Yg.exports=Yt});var Kg=v((DD,Xg)=>{l();var Jg=fe(),t_=I(),il=class extends t_{normalize(){return"flex-direction"}insert(e,t,i){let n;if([n,t]=Jg(t),n!==2009)return super.insert(e,t,i);if(e.parent.some(f=>f.prop===t+"box-orient"||f.prop===t+"box-direction"))return;let a=e.value,o,u;a==="inherit"||a==="initial"||a==="unset"?(o=a,u=a):(o=a.includes("row")?"horizontal":"vertical",u=a.includes("reverse")?"reverse":"normal");let c=this.clone(e);return c.prop=t+"box-orient",c.value=o,this.needCascade(e)&&(c.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,c),c=this.clone(e),c.prop=t+"box-direction",c.value=u,this.needCascade(e)&&(c.raws.before=this.calcBefore(i,e,t)),e.parent.insertBefore(e,c)}old(e,t){let i;return[i,t]=Jg(t),i===2009?[t+"box-orient",t+"box-direction"]:super.old(e,t)}};il.names=["flex-direction","box-direction","box-orient"];Xg.exports=il});var ey=v((qD,Zg)=>{l();var r_=I(),nl=class extends r_{check(e){return e.value==="pixelated"}prefixed(e,t){return t==="-ms-"?"-ms-interpolation-mode":super.prefixed(e,t)}set(e,t){return t!=="-ms-"?super.set(e,t):(e.prop="-ms-interpolation-mode",e.value="nearest-neighbor",e)}normalize(){return"image-rendering"}process(e,t){return super.process(e,t)}};nl.names=["image-rendering","interpolation-mode"];Zg.exports=nl});var ry=v((ID,ty)=>{l();var i_=I(),n_=ne(),sl=class extends i_{constructor(e,t,i){super(e,t,i);this.prefixes&&(this.prefixes=n_.uniq(this.prefixes.map(n=>n==="-ms-"?"-webkit-":n)))}};sl.names=["backdrop-filter"];ty.exports=sl});var ny=v((RD,iy)=>{l();var s_=I(),a_=ne(),al=class extends s_{constructor(e,t,i){super(e,t,i);this.prefixes&&(this.prefixes=a_.uniq(this.prefixes.map(n=>n==="-ms-"?"-webkit-":n)))}check(e){return e.value.toLowerCase()==="text"}};al.names=["background-clip"];iy.exports=al});var ay=v((MD,sy)=>{l();var o_=I(),l_=["none","underline","overline","line-through","blink","inherit","initial","unset"],ol=class extends o_{check(e){return e.value.split(/\s+/).some(t=>!l_.includes(t))}};ol.names=["text-decoration"];sy.exports=ol});var uy=v((FD,ly)=>{l();var oy=fe(),u_=I(),Qt=class extends u_{prefixed(e,t){let i;return[i,t]=oy(t),i===2009?t+"box-pack":i===2012?t+"flex-pack":super.prefixed(e,t)}normalize(){return"justify-content"}set(e,t){let i=oy(t)[0];if(i===2009||i===2012){let n=Qt.oldValues[e.value]||e.value;if(e.value=n,i!==2009||n!=="distribute")return super.set(e,t)}else if(i==="final")return super.set(e,t)}};Qt.names=["justify-content","flex-pack","box-pack"];Qt.oldValues={"flex-end":"end","flex-start":"start","space-between":"justify","space-around":"distribute"};ly.exports=Qt});var cy=v((ND,fy)=>{l();var f_=I(),ll=class extends f_{set(e,t){let i=e.value.toLowerCase();return t==="-webkit-"&&!i.includes(" ")&&i!=="contain"&&i!=="cover"&&(e.value=e.value+" "+e.value),super.set(e,t)}};ll.names=["background-size"];fy.exports=ll});var dy=v((LD,py)=>{l();var c_=I(),ul=ot(),fl=class extends c_{insert(e,t,i){if(t!=="-ms-")return super.insert(e,t,i);let n=ul.parse(e),[s,a]=ul.translate(n,0,1);n[0]&&n[0].includes("span")&&(a=n[0].join("").replace(/\D/g,"")),[[e.prop,s],[`${e.prop}-span`,a]].forEach(([u,c])=>{ul.insertDecl(e,u,c)})}};fl.names=["grid-row","grid-column"];py.exports=fl});var gy=v((BD,my)=>{l();var p_=I(),{prefixTrackProp:hy,prefixTrackValue:d_,autoplaceGridItems:h_,getGridGap:m_,inheritGridGap:g_}=ot(),y_=To(),cl=class extends p_{prefixed(e,t){return t==="-ms-"?hy({prop:e,prefix:t}):super.prefixed(e,t)}normalize(e){return e.replace(/^grid-(rows|columns)/,"grid-template-$1")}insert(e,t,i,n){if(t!=="-ms-")return super.insert(e,t,i);let{parent:s,prop:a,value:o}=e,u=a.includes("rows"),c=a.includes("columns"),f=s.some(x=>x.prop==="grid-template"||x.prop==="grid-template-areas");if(f&&u)return!1;let p=new y_({options:{}}),h=p.gridStatus(s,n),d=m_(e);d=g_(e,d)||d;let y=u?d.row:d.column;(h==="no-autoplace"||h===!0)&&!f&&(y=null);let k=d_({value:o,gap:y});e.cloneBefore({prop:hy({prop:a,prefix:t}),value:k});let w=s.nodes.find(x=>x.prop==="grid-auto-flow"),b="row";if(w&&!p.disabled(w,n)&&(b=w.value.trim()),h==="autoplace"){let x=s.nodes.find(_=>_.prop==="grid-template-rows");if(!x&&f)return;if(!x&&!f){e.warn(n,"Autoplacement does not work without grid-template-rows property");return}!s.nodes.find(_=>_.prop==="grid-template-columns")&&!f&&e.warn(n,"Autoplacement does not work without grid-template-columns property"),c&&!f&&h_(e,n,d,b)}}};cl.names=["grid-template-rows","grid-template-columns","grid-rows","grid-columns"];my.exports=cl});var wy=v(($D,yy)=>{l();var w_=I(),pl=class extends w_{check(e){return!e.value.includes("flex-")&&e.value!=="baseline"}prefixed(e,t){return t+"grid-column-align"}normalize(){return"justify-self"}};pl.names=["grid-column-align"];yy.exports=pl});var vy=v((zD,by)=>{l();var b_=I(),dl=class extends b_{prefixed(e,t){return t+"scroll-chaining"}normalize(){return"overscroll-behavior"}set(e,t){return e.value==="auto"?e.value="chained":(e.value==="none"||e.value==="contain")&&(e.value="none"),super.set(e,t)}};dl.names=["overscroll-behavior","scroll-chaining"];by.exports=dl});var Sy=v((jD,ky)=>{l();var v_=I(),{parseGridAreas:x_,warnMissedAreas:k_,prefixTrackProp:S_,prefixTrackValue:xy,getGridGap:C_,warnGridGap:__,inheritGridGap:A_}=ot();function O_(r){return r.trim().slice(1,-1).split(/["']\s*["']?/g)}var hl=class extends v_{insert(e,t,i,n){if(t!=="-ms-")return super.insert(e,t,i);let s=!1,a=!1,o=e.parent,u=C_(e);u=A_(e,u)||u,o.walkDecls(/-ms-grid-rows/,p=>p.remove()),o.walkDecls(/grid-template-(rows|columns)/,p=>{if(p.prop==="grid-template-rows"){a=!0;let{prop:h,value:d}=p;p.cloneBefore({prop:S_({prop:h,prefix:t}),value:xy({value:d,gap:u.row})})}else s=!0});let c=O_(e.value);s&&!a&&u.row&&c.length>1&&e.cloneBefore({prop:"-ms-grid-rows",value:xy({value:`repeat(${c.length}, auto)`,gap:u.row}),raws:{}}),__({gap:u,hasColumns:s,decl:e,result:n});let f=x_({rows:c,gap:u});return k_(f,e,n),e}};hl.names=["grid-template-areas"];ky.exports=hl});var _y=v((VD,Cy)=>{l();var E_=I(),ml=class extends E_{set(e,t){return t==="-webkit-"&&(e.value=e.value.replace(/\s*(right|left)\s*/i,"")),super.set(e,t)}};ml.names=["text-emphasis-position"];Cy.exports=ml});var Oy=v((UD,Ay)=>{l();var T_=I(),gl=class extends T_{set(e,t){return e.prop==="text-decoration-skip-ink"&&e.value==="auto"?(e.prop=t+"text-decoration-skip",e.value="ink",e):super.set(e,t)}};gl.names=["text-decoration-skip-ink","text-decoration-skip"];Ay.exports=gl});var Iy=v((WD,qy)=>{l();"use strict";qy.exports={wrap:Ey,limit:Ty,validate:Py,test:yl,curry:P_,name:Dy};function Ey(r,e,t){var i=e-r;return((t-r)%i+i)%i+r}function Ty(r,e,t){return Math.max(r,Math.min(e,t))}function Py(r,e,t,i,n){if(!yl(r,e,t,i,n))throw new Error(t+" is outside of range ["+r+","+e+")");return t}function yl(r,e,t,i,n){return!(te||n&&t===e||i&&t===r)}function Dy(r,e,t,i){return(t?"(":"[")+r+","+e+(i?")":"]")}function P_(r,e,t,i){var n=Dy.bind(null,r,e,t,i);return{wrap:Ey.bind(null,r,e),limit:Ty.bind(null,r,e),validate:function(s){return Py(r,e,s,t,i)},test:function(s){return yl(r,e,s,t,i)},toString:n,name:n}}});var Fy=v((GD,My)=>{l();var wl=Kr(),D_=Iy(),q_=$t(),I_=ke(),R_=ne(),Ry=/top|left|right|bottom/gi,Ue=class extends I_{replace(e,t){let i=wl(e);for(let n of i.nodes)if(n.type==="function"&&n.value===this.name)if(n.nodes=this.newDirection(n.nodes),n.nodes=this.normalize(n.nodes),t==="-webkit- old"){if(!this.oldWebkit(n))return!1}else n.nodes=this.convertDirection(n.nodes),n.value=t+n.value;return i.toString()}replaceFirst(e,...t){return t.map(n=>n===" "?{type:"space",value:n}:{type:"word",value:n}).concat(e.slice(1))}normalizeUnit(e,t){return`${parseFloat(e)/t*360}deg`}normalize(e){if(!e[0])return e;if(/-?\d+(.\d+)?grad/.test(e[0].value))e[0].value=this.normalizeUnit(e[0].value,400);else if(/-?\d+(.\d+)?rad/.test(e[0].value))e[0].value=this.normalizeUnit(e[0].value,2*Math.PI);else if(/-?\d+(.\d+)?turn/.test(e[0].value))e[0].value=this.normalizeUnit(e[0].value,1);else if(e[0].value.includes("deg")){let t=parseFloat(e[0].value);t=D_.wrap(0,360,t),e[0].value=`${t}deg`}return e[0].value==="0deg"?e=this.replaceFirst(e,"to"," ","top"):e[0].value==="90deg"?e=this.replaceFirst(e,"to"," ","right"):e[0].value==="180deg"?e=this.replaceFirst(e,"to"," ","bottom"):e[0].value==="270deg"&&(e=this.replaceFirst(e,"to"," ","left")),e}newDirection(e){if(e[0].value==="to"||(Ry.lastIndex=0,!Ry.test(e[0].value)))return e;e.unshift({type:"word",value:"to"},{type:"space",value:" "});for(let t=2;t0&&(e[0].value==="to"?this.fixDirection(e):e[0].value.includes("deg")?this.fixAngle(e):this.isRadial(e)&&this.fixRadial(e)),e}fixDirection(e){e.splice(0,2);for(let t of e){if(t.type==="div")break;t.type==="word"&&(t.value=this.revertDirection(t.value))}}fixAngle(e){let t=e[0].value;t=parseFloat(t),t=Math.abs(450-t)%360,t=this.roundFloat(t,3),e[0].value=`${t}deg`}fixRadial(e){let t=[],i=[],n,s,a,o,u;for(o=0;o{l();var M_=$t(),F_=ke();function Ny(r){return new RegExp(`(^|[\\s,(])(${r}($|[\\s),]))`,"gi")}var bl=class extends F_{regexp(){return this.regexpCache||(this.regexpCache=Ny(this.name)),this.regexpCache}isStretch(){return this.name==="stretch"||this.name==="fill"||this.name==="fill-available"}replace(e,t){return t==="-moz-"&&this.isStretch()?e.replace(this.regexp(),"$1-moz-available$3"):t==="-webkit-"&&this.isStretch()?e.replace(this.regexp(),"$1-webkit-fill-available$3"):super.replace(e,t)}old(e){let t=e+this.name;return this.isStretch()&&(e==="-moz-"?t="-moz-available":e==="-webkit-"&&(t="-webkit-fill-available")),new M_(this.name,t,t,Ny(t))}add(e,t){if(!(e.prop.includes("grid")&&t!=="-webkit-"))return super.add(e,t)}};bl.names=["max-content","min-content","fit-content","fill","fill-available","stretch"];Ly.exports=bl});var jy=v((YD,zy)=>{l();var $y=$t(),N_=ke(),vl=class extends N_{replace(e,t){return t==="-webkit-"?e.replace(this.regexp(),"$1-webkit-optimize-contrast"):t==="-moz-"?e.replace(this.regexp(),"$1-moz-crisp-edges"):super.replace(e,t)}old(e){return e==="-webkit-"?new $y(this.name,"-webkit-optimize-contrast"):e==="-moz-"?new $y(this.name,"-moz-crisp-edges"):super.old(e)}};vl.names=["pixelated"];zy.exports=vl});var Uy=v((QD,Vy)=>{l();var L_=ke(),xl=class extends L_{replace(e,t){let i=super.replace(e,t);return t==="-webkit-"&&(i=i.replace(/("[^"]+"|'[^']+')(\s+\d+\w)/gi,"url($1)$2")),i}};xl.names=["image-set"];Vy.exports=xl});var Gy=v((JD,Wy)=>{l();var B_=me().list,$_=ke(),kl=class extends $_{replace(e,t){return B_.space(e).map(i=>{if(i.slice(0,+this.name.length+1)!==this.name+"(")return i;let n=i.lastIndexOf(")"),s=i.slice(n+1),a=i.slice(this.name.length+1,n);if(t==="-webkit-"){let o=a.match(/\d*.?\d+%?/);o?(a=a.slice(o[0].length).trim(),a+=`, ${o[0]}`):a+=", 0.5"}return t+this.name+"("+a+")"+s}).join(" ")}};kl.names=["cross-fade"];Wy.exports=kl});var Yy=v((XD,Hy)=>{l();var z_=fe(),j_=$t(),V_=ke(),Sl=class extends V_{constructor(e,t){super(e,t);e==="display-flex"&&(this.name="flex")}check(e){return e.prop==="display"&&e.value===this.name}prefixed(e){let t,i;return[t,e]=z_(e),t===2009?this.name==="flex"?i="box":i="inline-box":t===2012?this.name==="flex"?i="flexbox":i="inline-flexbox":t==="final"&&(i=this.name),e+i}replace(e,t){return this.prefixed(t)}old(e){let t=this.prefixed(e);if(!!t)return new j_(this.name,t)}};Sl.names=["display-flex","inline-flex"];Hy.exports=Sl});var Jy=v((KD,Qy)=>{l();var U_=ke(),Cl=class extends U_{constructor(e,t){super(e,t);e==="display-grid"&&(this.name="grid")}check(e){return e.prop==="display"&&e.value===this.name}};Cl.names=["display-grid","inline-grid"];Qy.exports=Cl});var Ky=v((ZD,Xy)=>{l();var W_=ke(),_l=class extends W_{constructor(e,t){super(e,t);e==="filter-function"&&(this.name="filter")}};_l.names=["filter","filter-function"];Xy.exports=_l});var rw=v((eq,tw)=>{l();var Zy=ei(),R=I(),ew=Yh(),G_=Zh(),H_=To(),Y_=wm(),Al=at(),Jt=zt(),Q_=Am(),Ne=ke(),Xt=ne(),J_=Em(),X_=Pm(),K_=qm(),Z_=Rm(),eA=Bm(),tA=jm(),rA=Um(),iA=Gm(),nA=Ym(),sA=Jm(),aA=Km(),oA=eg(),lA=rg(),uA=ng(),fA=ag(),cA=ug(),pA=cg(),dA=hg(),hA=gg(),mA=wg(),gA=xg(),yA=Sg(),wA=Ag(),bA=Eg(),vA=Pg(),xA=qg(),kA=Rg(),SA=Ng(),CA=Bg(),_A=zg(),AA=Vg(),OA=Wg(),EA=Hg(),TA=Qg(),PA=Kg(),DA=ey(),qA=ry(),IA=ny(),RA=ay(),MA=uy(),FA=cy(),NA=dy(),LA=gy(),BA=wy(),$A=vy(),zA=Sy(),jA=_y(),VA=Oy(),UA=Fy(),WA=By(),GA=jy(),HA=Uy(),YA=Gy(),QA=Yy(),JA=Jy(),XA=Ky();Jt.hack(J_);Jt.hack(X_);Jt.hack(K_);Jt.hack(Z_);R.hack(eA);R.hack(tA);R.hack(rA);R.hack(iA);R.hack(nA);R.hack(sA);R.hack(aA);R.hack(oA);R.hack(lA);R.hack(uA);R.hack(fA);R.hack(cA);R.hack(pA);R.hack(dA);R.hack(hA);R.hack(mA);R.hack(gA);R.hack(yA);R.hack(wA);R.hack(bA);R.hack(vA);R.hack(xA);R.hack(kA);R.hack(SA);R.hack(CA);R.hack(_A);R.hack(AA);R.hack(OA);R.hack(EA);R.hack(TA);R.hack(PA);R.hack(DA);R.hack(qA);R.hack(IA);R.hack(RA);R.hack(MA);R.hack(FA);R.hack(NA);R.hack(LA);R.hack(BA);R.hack($A);R.hack(zA);R.hack(jA);R.hack(VA);Ne.hack(UA);Ne.hack(WA);Ne.hack(GA);Ne.hack(HA);Ne.hack(YA);Ne.hack(QA);Ne.hack(JA);Ne.hack(XA);var Ol=new Map,ri=class{constructor(e,t,i={}){this.data=e,this.browsers=t,this.options=i,[this.add,this.remove]=this.preprocess(this.select(this.data)),this.transition=new G_(this),this.processor=new H_(this)}cleaner(){if(this.cleanerCache)return this.cleanerCache;if(this.browsers.selected.length){let e=new Al(this.browsers.data,[]);this.cleanerCache=new ri(this.data,e,this.options)}else return this;return this.cleanerCache}select(e){let t={add:{},remove:{}};for(let i in e){let n=e[i],s=n.browsers.map(u=>{let c=u.split(" ");return{browser:`${c[0]} ${c[1]}`,note:c[2]}}),a=s.filter(u=>u.note).map(u=>`${this.browsers.prefix(u.browser)} ${u.note}`);a=Xt.uniq(a),s=s.filter(u=>this.browsers.isSelected(u.browser)).map(u=>{let c=this.browsers.prefix(u.browser);return u.note?`${c} ${u.note}`:c}),s=this.sort(Xt.uniq(s)),this.options.flexbox==="no-2009"&&(s=s.filter(u=>!u.includes("2009")));let o=n.browsers.map(u=>this.browsers.prefix(u));n.mistakes&&(o=o.concat(n.mistakes)),o=o.concat(a),o=Xt.uniq(o),s.length?(t.add[i]=s,s.length!s.includes(u)))):t.remove[i]=o}return t}sort(e){return e.sort((t,i)=>{let n=Xt.removeNote(t).length,s=Xt.removeNote(i).length;return n===s?i.length-t.length:s-n})}preprocess(e){let t={selectors:[],"@supports":new Y_(ri,this)};for(let n in e.add){let s=e.add[n];if(n==="@keyframes"||n==="@viewport")t[n]=new Q_(n,s,this);else if(n==="@resolution")t[n]=new ew(n,s,this);else if(this.data[n].selector)t.selectors.push(Jt.load(n,s,this));else{let a=this.data[n].props;if(a){let o=Ne.load(n,s,this);for(let u of a)t[u]||(t[u]={values:[]}),t[u].values.push(o)}else{let o=t[n]&&t[n].values||[];t[n]=R.load(n,s,this),t[n].values=o}}}let i={selectors:[]};for(let n in e.remove){let s=e.remove[n];if(this.data[n].selector){let a=Jt.load(n,s);for(let o of s)i.selectors.push(a.old(o))}else if(n==="@keyframes"||n==="@viewport")for(let a of s){let o=`@${a}${n.slice(1)}`;i[o]={remove:!0}}else if(n==="@resolution")i[n]=new ew(n,s,this);else{let a=this.data[n].props;if(a){let o=Ne.load(n,[],this);for(let u of s){let c=o.old(u);if(c)for(let f of a)i[f]||(i[f]={}),i[f].values||(i[f].values=[]),i[f].values.push(c)}}else for(let o of s){let u=this.decl(n).old(n,o);if(n==="align-self"){let c=t[n]&&t[n].prefixes;if(c){if(o==="-webkit- 2009"&&c.includes("-webkit-"))continue;if(o==="-webkit-"&&c.includes("-webkit- 2009"))continue}}for(let c of u)i[c]||(i[c]={}),i[c].remove=!0}}}return[t,i]}decl(e){return Ol.has(e)||Ol.set(e,R.load(e)),Ol.get(e)}unprefixed(e){let t=this.normalize(Zy.unprefixed(e));return t==="flex-direction"&&(t="flex-flow"),t}normalize(e){return this.decl(e).normalize(e)}prefixed(e,t){return e=Zy.unprefixed(e),this.decl(e).prefixed(e,t)}values(e,t){let i=this[e],n=i["*"]&&i["*"].values,s=i[t]&&i[t].values;return n&&s?Xt.uniq(n.concat(s)):n||s||[]}group(e){let t=e.parent,i=t.index(e),{length:n}=t.nodes,s=this.unprefixed(e.prop),a=(o,u)=>{for(i+=o;i>=0&&i{l();iw.exports={"backface-visibility":{mistakes:["-ms-","-o-"],feature:"transforms3d",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1"]},"backdrop-filter":{feature:"css-backdrop-filter",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1"]},element:{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-element-function",browsers:["firefox 89"]},"user-select":{mistakes:["-khtml-"],feature:"user-select-none",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1"]},"background-clip":{feature:"background-clip-text",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},hyphens:{feature:"css-hyphens",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1"]},":fullscreen":{selector:!0,feature:"fullscreen",browsers:["and_chr 92","and_uc 12.12","safari 14.1"]},"::backdrop":{selector:!0,feature:"fullscreen",browsers:["and_chr 92","and_uc 12.12","safari 14.1"]},"::file-selector-button":{selector:!0,feature:"fullscreen",browsers:["safari 14.1"]},"tab-size":{feature:"css3-tabsize",browsers:["firefox 89"]},fill:{props:["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"],feature:"intrinsic-width",browsers:["and_chr 92","chrome 91","chrome 92","edge 91","samsung 14.0"]},"fill-available":{props:["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"],feature:"intrinsic-width",browsers:["and_chr 92","chrome 91","chrome 92","edge 91","samsung 14.0"]},stretch:{props:["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"],feature:"intrinsic-width",browsers:["firefox 89"]},"fit-content":{props:["width","min-width","max-width","height","min-height","max-height","inline-size","min-inline-size","max-inline-size","block-size","min-block-size","max-block-size","grid","grid-template","grid-template-rows","grid-template-columns","grid-auto-columns","grid-auto-rows"],feature:"intrinsic-width",browsers:["firefox 89"]},"text-decoration-style":{feature:"text-decoration",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"text-decoration-color":{feature:"text-decoration",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"text-decoration-line":{feature:"text-decoration",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"text-decoration":{feature:"text-decoration",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"text-decoration-skip":{feature:"text-decoration",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"text-decoration-skip-ink":{feature:"text-decoration",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"text-size-adjust":{feature:"text-size-adjust",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7"]},"mask-clip":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-composite":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-image":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-origin":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-repeat":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-border-repeat":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-border-source":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},mask:{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-position":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-size":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-border":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-border-outset":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-border-width":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"mask-border-slice":{feature:"css-masks",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"clip-path":{feature:"css-clip-path",browsers:["and_uc 12.12","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"box-decoration-break":{feature:"css-boxdecorationbreak",browsers:["and_chr 92","chrome 91","chrome 92","edge 91","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"@resolution":{feature:"css-media-resolution",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1"]},"border-inline-start":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"border-inline-end":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"margin-inline-start":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"margin-inline-end":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"padding-inline-start":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"padding-inline-end":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"border-block-start":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"border-block-end":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"margin-block-start":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"margin-block-end":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"padding-block-start":{feature:"css-logical-props",browsers:["and_uc 12.12"]},"padding-block-end":{feature:"css-logical-props",browsers:["and_uc 12.12"]},appearance:{feature:"css-appearance",browsers:["and_uc 12.12","ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1","samsung 14.0"]},"image-set":{props:["background","background-image","border-image","cursor","mask","mask-image","list-style","list-style-image","content"],feature:"css-image-set",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","samsung 14.0"]},"cross-fade":{props:["background","background-image","border-image","mask","list-style","list-style-image","content","mask-image"],feature:"css-cross-fade",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","samsung 14.0"]},"text-emphasis":{feature:"text-emphasis",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","samsung 14.0"]},"text-emphasis-position":{feature:"text-emphasis",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","samsung 14.0"]},"text-emphasis-style":{feature:"text-emphasis",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","samsung 14.0"]},"text-emphasis-color":{feature:"text-emphasis",browsers:["and_chr 92","and_uc 12.12","chrome 91","chrome 92","edge 91","samsung 14.0"]},":any-link":{selector:!0,feature:"css-any-link",browsers:["and_uc 12.12"]},isolate:{props:["unicode-bidi"],feature:"css-unicode-bidi",browsers:["ios_saf 14.0-14.4","ios_saf 14.5-14.7","safari 14.1"]},"color-adjust":{feature:"css-color-adjust",browsers:["chrome 91","chrome 92","edge 91","safari 14.1"]}}});var aw=v((rq,sw)=>{l();sw.exports={}});var fw=v((iq,uw)=>{l();var KA=Co(),{agents:ZA}=(In(),qn),El=Rh(),eO=at(),tO=rw(),rO=nw(),iO=aw(),ow={browsers:ZA,prefixes:rO},lw=` + Replace Autoprefixer \`browsers\` option to Browserslist config. + Use \`browserslist\` key in \`package.json\` or \`.browserslistrc\` file. + + Using \`browsers\` option can cause errors. Browserslist config can + be used for Babel, Autoprefixer, postcss-normalize and other tools. + + If you really need to use option, rename it to \`overrideBrowserslist\`. + + Learn more at: + https://github.com/browserslist/browserslist#readme + https://twitter.com/browserslist + +`;function nO(r){return Object.prototype.toString.apply(r)==="[object Object]"}var Tl=new Map;function sO(r,e){e.browsers.selected.length!==0&&(e.add.selectors.length>0||Object.keys(e.add).length>2||r.warn(`Autoprefixer target browsers do not need any prefixes.You do not need Autoprefixer anymore. +Check your Browserslist config to be sure that your targets are set up correctly. + + Learn more at: + https://github.com/postcss/autoprefixer#readme + https://github.com/browserslist/browserslist#readme + +`))}uw.exports=Kt;function Kt(...r){let e;if(r.length===1&&nO(r[0])?(e=r[0],r=void 0):r.length===0||r.length===1&&!r[0]?r=void 0:r.length<=2&&(Array.isArray(r[0])||!r[0])?(e=r[1],r=r[0]):typeof r[r.length-1]=="object"&&(e=r.pop()),e||(e={}),e.browser)throw new Error("Change `browser` option to `overrideBrowserslist` in Autoprefixer");if(e.browserslist)throw new Error("Change `browserslist` option to `overrideBrowserslist` in Autoprefixer");e.overrideBrowserslist?r=e.overrideBrowserslist:e.browsers&&(typeof console!="undefined"&&console.warn&&(El.red?console.warn(El.red(lw.replace(/`[^`]+`/g,n=>El.yellow(n.slice(1,-1))))):console.warn(lw)),r=e.browsers);let t={ignoreUnknownVersions:e.ignoreUnknownVersions,stats:e.stats,env:e.env};function i(n){let s=ow,a=new eO(s.browsers,r,n,t),o=a.selected.join(", ")+JSON.stringify(e);return Tl.has(o)||Tl.set(o,new tO(s.prefixes,a,e)),Tl.get(o)}return{postcssPlugin:"autoprefixer",prepare(n){let s=i({from:n.opts.from,env:e.env});return{OnceExit(a){sO(n,s),e.remove!==!1&&s.processor.remove(a,n),e.add!==!1&&s.processor.add(a,n)}}},info(n){return n=n||{},n.from=n.from||m.cwd(),iO(i(n))},options:e,browsers:r}}Kt.postcss=!0;Kt.data=ow;Kt.defaults=KA.defaults;Kt.info=()=>Kt().info()});var cw={};Ce(cw,{default:()=>aO});var aO,pw=A(()=>{l();aO=[]});var hw={};Ce(hw,{default:()=>oO});var dw,oO,mw=A(()=>{l();ui();dw=J(Zt()),oO=Ye(dw.default.theme)});var yw={};Ce(yw,{default:()=>lO});var gw,lO,ww=A(()=>{l();ui();gw=J(Zt()),lO=Ye(gw.default)});function bw(r,e){return{handler:r,config:e}}var vw,xw=A(()=>{l();bw.withOptions=function(r,e=()=>({})){let t=function(i){return{__options:i,handler:r(i),config:e(i)}};return t.__isOptionsFunction=!0,t.__pluginFunction=r,t.__configFunction=e,t};vw=bw});var kw={};Ce(kw,{default:()=>uO});var uO,Sw=A(()=>{l();xw();uO=vw});l();"use strict";var fO=We(qh()),cO=We(me()),pO=We(fw()),dO=We((pw(),cw)),hO=We((mw(),hw)),mO=We((ww(),yw)),gO=We((jn(),Xl)),yO=We((Sw(),kw)),wO=We((Qs(),zf));function We(r){return r&&r.__esModule?r:{default:r}}console.warn("cdn.tailwindcss.com should not be used in production. To use Tailwind CSS in production, install it as a PostCSS plugin or use the Tailwind CLI: https://tailwindcss.com/docs/installation");var Mn="tailwind",Pl="text/tailwindcss",Cw="/template.html",gt,_w=!0,Aw=0,Dl=new Set,ql,Ow="",Ew=(r=!1)=>({get(e,t){return(!r||t==="config")&&typeof e[t]=="object"&&e[t]!==null?new Proxy(e[t],Ew()):e[t]},set(e,t,i){return e[t]=i,(!r||t==="config")&&Il(!0),!0}});window[Mn]=new Proxy({config:{},defaultTheme:hO.default,defaultConfig:mO.default,colors:gO.default,plugin:yO.default,resolveConfig:wO.default},Ew(!0));function Tw(r){ql.observe(r,{attributes:!0,attributeFilter:["type"],characterData:!0,subtree:!0,childList:!0})}new MutationObserver(async r=>{let e=!1;if(!ql){ql=new MutationObserver(async()=>await Il(!0));for(let t of document.querySelectorAll(`style[type="${Pl}"]`))Tw(t)}for(let t of r)for(let i of t.addedNodes)i.nodeType===1&&i.tagName==="STYLE"&&i.getAttribute("type")===Pl&&(Tw(i),e=!0);await Il(e)}).observe(document.documentElement,{attributes:!0,attributeFilter:["class"],childList:!0,subtree:!0});async function Il(r=!1){r&&(Aw++,Dl.clear());let e="";for(let i of document.querySelectorAll(`style[type="${Pl}"]`))e+=i.textContent;let t=new Set;for(let i of document.querySelectorAll("[class]"))for(let n of i.classList)Dl.has(n)||t.add(n);if(document.body&&(_w||t.size>0||e!==Ow||!gt||!gt.isConnected)){for(let n of t)Dl.add(n);_w=!1,Ow=e,self[Cw]=Array.from(t).join(" ");let i=(0,cO.default)([(0,fO.default)({...window[Mn].config,_hash:Aw,content:[Cw],plugins:[...dO.default,...Array.isArray(window[Mn].config.plugins)?window[Mn].config.plugins:[]]}),(0,pO.default)({remove:!1})]).process(`@tailwind base;@tailwind components;@tailwind utilities;${e}`).css;(!gt||!gt.isConnected)&&(gt=document.createElement("style"),document.head.append(gt)),gt.textContent=i}}})(); +/*! https://mths.be/cssesc v3.0.0 by @mathias */ diff --git a/media/vendor/turndown.js b/media/vendor/turndown.js new file mode 100644 index 0000000..7b85f7e --- /dev/null +++ b/media/vendor/turndown.js @@ -0,0 +1,974 @@ +/** @author https://github.com/mixmark-io/turndown - Turndown CDN https://unpkg.com/turndown@7.1.1/dist/turndown.js */ +var TurndownService = (function () { + 'use strict'; + + function extend(destination) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + for (var key in source) { + if (source.hasOwnProperty(key)) destination[key] = source[key]; + } + } + return destination; + } + + function repeat(character, count) { + return Array(count + 1).join(character); + } + + function trimLeadingNewlines(string) { + return string.replace(/^\n*/, ''); + } + + function trimTrailingNewlines(string) { + // avoid match-at-end regexp bottleneck, see #370 + var indexEnd = string.length; + while (indexEnd > 0 && string[indexEnd - 1] === '\n') indexEnd--; + return string.substring(0, indexEnd); + } + + var blockElements = [ + 'ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'BODY', 'CANVAS', + 'CENTER', 'DD', 'DIR', 'DIV', 'DL', 'DT', 'FIELDSET', 'FIGCAPTION', 'FIGURE', + 'FOOTER', 'FORM', 'FRAMESET', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER', + 'HGROUP', 'HR', 'HTML', 'ISINDEX', 'LI', 'MAIN', 'MENU', 'NAV', 'NOFRAMES', + 'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TBODY', 'TD', + 'TFOOT', 'TH', 'THEAD', 'TR', 'UL' + ]; + + function isBlock(node) { + return is(node, blockElements); + } + + var voidElements = [ + 'AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', + 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR' + ]; + + function isVoid(node) { + return is(node, voidElements); + } + + function hasVoid(node) { + return has(node, voidElements); + } + + var meaningfulWhenBlankElements = [ + 'A', 'TABLE', 'THEAD', 'TBODY', 'TFOOT', 'TH', 'TD', 'IFRAME', 'SCRIPT', + 'AUDIO', 'VIDEO' + ]; + + function isMeaningfulWhenBlank(node) { + return is(node, meaningfulWhenBlankElements); + } + + function hasMeaningfulWhenBlank(node) { + return has(node, meaningfulWhenBlankElements); + } + + function is(node, tagNames) { + return tagNames.indexOf(node.nodeName) >= 0; + } + + function has(node, tagNames) { + return ( + node.getElementsByTagName && + tagNames.some(function (tagName) { + return node.getElementsByTagName(tagName).length; + }) + ); + } + + var rules = {}; + + rules.paragraph = { + filter: 'p', + + replacement: function (content) { + return '\n\n' + content + '\n\n'; + } + }; + + rules.lineBreak = { + filter: 'br', + + replacement: function (content, node, options) { + return options.br + '\n'; + } + }; + + rules.heading = { + filter: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'], + + replacement: function (content, node, options) { + var hLevel = Number(node.nodeName.charAt(1)); + + if (options.headingStyle === 'setext' && hLevel < 3) { + var underline = repeat((hLevel === 1 ? '=' : '-'), content.length); + return ( + '\n\n' + content + '\n' + underline + '\n\n' + ); + } else { + return '\n\n' + repeat('#', hLevel) + ' ' + content + '\n\n'; + } + } + }; + + rules.blockquote = { + filter: 'blockquote', + + replacement: function (content) { + content = content.replace(/^\n+|\n+$/g, ''); + content = content.replace(/^/gm, '> '); + return '\n\n' + content + '\n\n'; + } + }; + + rules.list = { + filter: ['ul', 'ol'], + + replacement: function (content, node) { + var parent = node.parentNode; + if (parent.nodeName === 'LI' && parent.lastElementChild === node) { + return '\n' + content; + } else { + return '\n\n' + content + '\n\n'; + } + } + }; + + rules.listItem = { + filter: 'li', + + replacement: function (content, node, options) { + content = content + .replace(/^\n+/, '') // remove leading newlines + .replace(/\n+$/, '\n') // replace trailing newlines with just a single one + .replace(/\n/gm, '\n '); // indent + var prefix = options.bulletListMarker + ' '; + var parent = node.parentNode; + if (parent.nodeName === 'OL') { + var start = parent.getAttribute('start'); + var index = Array.prototype.indexOf.call(parent.children, node); + prefix = (start ? Number(start) + index : index + 1) + '. '; + } + return ( + prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '') + ); + } + }; + + rules.indentedCodeBlock = { + filter: function (node, options) { + return ( + options.codeBlockStyle === 'indented' && + node.nodeName === 'PRE' && + node.firstChild && + node.firstChild.nodeName === 'CODE' + ); + }, + + replacement: function (content, node, options) { + return ( + '\n\n ' + + node.firstChild.textContent.replace(/\n/g, '\n ') + + '\n\n' + ); + } + }; + + rules.fencedCodeBlock = { + filter: function (node, options) { + return ( + options.codeBlockStyle === 'fenced' && + node.nodeName === 'PRE' && + node.firstChild && + node.firstChild.nodeName === 'CODE' + ); + }, + + replacement: function (content, node, options) { + var className = node.firstChild.getAttribute('class') || ''; + var language = (className.match(/language-(\S+)/) || [null, ''])[1]; + var code = node.firstChild.textContent; + + var fenceChar = options.fence.charAt(0); + var fenceSize = 3; + var fenceInCodeRegex = new RegExp('^' + fenceChar + '{3,}', 'gm'); + + var match; + while ((match = fenceInCodeRegex.exec(code))) { + if (match[0].length >= fenceSize) { + fenceSize = match[0].length + 1; + } + } + + var fence = repeat(fenceChar, fenceSize); + + return ( + '\n\n' + fence + language + '\n' + + code.replace(/\n$/, '') + + '\n' + fence + '\n\n' + ); + } + }; + + rules.horizontalRule = { + filter: 'hr', + + replacement: function (content, node, options) { + return '\n\n' + options.hr + '\n\n'; + } + }; + + rules.inlineLink = { + filter: function (node, options) { + return ( + options.linkStyle === 'inlined' && + node.nodeName === 'A' && + node.getAttribute('href') + ); + }, + + replacement: function (content, node) { + var href = node.getAttribute('href'); + var title = cleanAttribute(node.getAttribute('title')); + if (title) title = ' "' + title + '"'; + return '[' + content + '](' + href + title + ')'; + } + }; + + rules.referenceLink = { + filter: function (node, options) { + return ( + options.linkStyle === 'referenced' && + node.nodeName === 'A' && + node.getAttribute('href') + ); + }, + + replacement: function (content, node, options) { + var href = node.getAttribute('href'); + var title = cleanAttribute(node.getAttribute('title')); + if (title) title = ' "' + title + '"'; + var replacement; + var reference; + + switch (options.linkReferenceStyle) { + case 'collapsed': + replacement = '[' + content + '][]'; + reference = '[' + content + ']: ' + href + title; + break; + case 'shortcut': + replacement = '[' + content + ']'; + reference = '[' + content + ']: ' + href + title; + break; + default: + var id = this.references.length + 1; + replacement = '[' + content + '][' + id + ']'; + reference = '[' + id + ']: ' + href + title; + } + + this.references.push(reference); + return replacement; + }, + + references: [], + + append: function (options) { + var references = ''; + if (this.references.length) { + references = '\n\n' + this.references.join('\n') + '\n\n'; + this.references = []; // Reset references + } + return references; + } + }; + + rules.emphasis = { + filter: ['em', 'i'], + + replacement: function (content, node, options) { + if (!content.trim()) return ''; + return options.emDelimiter + content + options.emDelimiter; + } + }; + + rules.strong = { + filter: ['strong', 'b'], + + replacement: function (content, node, options) { + if (!content.trim()) return ''; + return options.strongDelimiter + content + options.strongDelimiter; + } + }; + + rules.code = { + filter: function (node) { + var hasSiblings = node.previousSibling || node.nextSibling; + var isCodeBlock = node.parentNode.nodeName === 'PRE' && !hasSiblings; + + return node.nodeName === 'CODE' && !isCodeBlock; + }, + + replacement: function (content) { + if (!content) return ''; + content = content.replace(/\r?\n|\r/g, ' '); + + var extraSpace = /^`|^ .*?[^ ].* $|`$/.test(content) ? ' ' : ''; + var delimiter = '`'; + var matches = content.match(/`+/gm) || []; + while (matches.indexOf(delimiter) !== -1) delimiter = delimiter + '`'; + + return delimiter + extraSpace + content + extraSpace + delimiter; + } + }; + + rules.image = { + filter: 'img', + + replacement: function (content, node) { + var alt = cleanAttribute(node.getAttribute('alt')); + var src = node.getAttribute('src') || ''; + var title = cleanAttribute(node.getAttribute('title')); + var titlePart = title ? ' "' + title + '"' : ''; + return src ? '![' + alt + ']' + '(' + src + titlePart + ')' : ''; + } + }; + + function cleanAttribute(attribute) { + return attribute ? attribute.replace(/(\n+\s*)+/g, '\n') : ''; + } + + /** + * Manages a collection of rules used to convert HTML to Markdown + */ + + function Rules(options) { + this.options = options; + this._keep = []; + this._remove = []; + + this.blankRule = { + replacement: options.blankReplacement + }; + + this.keepReplacement = options.keepReplacement; + + this.defaultRule = { + replacement: options.defaultReplacement + }; + + this.array = []; + for (var key in options.rules) this.array.push(options.rules[key]); + } + + Rules.prototype = { + add: function (key, rule) { + this.array.unshift(rule); + }, + + keep: function (filter) { + this._keep.unshift({ + filter: filter, + replacement: this.keepReplacement + }); + }, + + remove: function (filter) { + this._remove.unshift({ + filter: filter, + replacement: function () { + return ''; + } + }); + }, + + forNode: function (node) { + if (node.isBlank) return this.blankRule; + var rule; + + if ((rule = findRule(this.array, node, this.options))) return rule; + if ((rule = findRule(this._keep, node, this.options))) return rule; + if ((rule = findRule(this._remove, node, this.options))) return rule; + + return this.defaultRule; + }, + + forEach: function (fn) { + for (var i = 0; i < this.array.length; i++) fn(this.array[i], i); + } + }; + + function findRule(rules, node, options) { + for (var i = 0; i < rules.length; i++) { + var rule = rules[i]; + if (filterValue(rule, node, options)) return rule; + } + return void 0; + } + + function filterValue(rule, node, options) { + var filter = rule.filter; + if (typeof filter === 'string') { + if (filter === node.nodeName.toLowerCase()) return true; + } else if (Array.isArray(filter)) { + if (filter.indexOf(node.nodeName.toLowerCase()) > -1) return true; + } else if (typeof filter === 'function') { + if (filter.call(rule, node, options)) return true; + } else { + throw new TypeError('`filter` needs to be a string, array, or function'); + } + } + + /** + * The collapseWhitespace function is adapted from collapse-whitespace + * by Luc Thevenard. + * + * The MIT License (MIT) + * + * Copyright (c) 2014 Luc Thevenard + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + + /** + * collapseWhitespace(options) removes extraneous whitespace from an the given element. + * + * @param {Object} options + */ + function collapseWhitespace(options) { + var element = options.element; + var isBlock = options.isBlock; + var isVoid = options.isVoid; + var isPre = options.isPre || function (node) { + return node.nodeName === 'PRE'; + }; + + if (!element.firstChild || isPre(element)) return; + + var prevText = null; + var keepLeadingWs = false; + + var prev = null; + var node = next(prev, element, isPre); + + while (node !== element) { + if (node.nodeType === 3 || node.nodeType === 4) { // Node.TEXT_NODE or Node.CDATA_SECTION_NODE + var text = node.data.replace(/[ \r\n\t]+/g, ' '); + + if ((!prevText || / $/.test(prevText.data)) && + !keepLeadingWs && text[0] === ' ') { + text = text.substr(1); + } + + // `text` might be empty at this point. + if (!text) { + node = remove(node); + continue; + } + + node.data = text; + + prevText = node; + } else if (node.nodeType === 1) { // Node.ELEMENT_NODE + if (isBlock(node) || node.nodeName === 'BR') { + if (prevText) { + prevText.data = prevText.data.replace(/ $/, ''); + } + + prevText = null; + keepLeadingWs = false; + } else if (isVoid(node) || isPre(node)) { + // Avoid trimming space around non-block, non-BR void elements and inline PRE. + prevText = null; + keepLeadingWs = true; + } else if (prevText) { + // Drop protection if set previously. + keepLeadingWs = false; + } + } else { + node = remove(node); + continue; + } + + var nextNode = next(prev, node, isPre); + prev = node; + node = nextNode; + } + + if (prevText) { + prevText.data = prevText.data.replace(/ $/, ''); + if (!prevText.data) { + remove(prevText); + } + } + } + + /** + * remove(node) removes the given node from the DOM and returns the + * next node in the sequence. + * + * @param {Node} node + * @return {Node} node + */ + function remove(node) { + var next = node.nextSibling || node.parentNode; + + node.parentNode.removeChild(node); + + return next; + } + + /** + * next(prev, current, isPre) returns the next node in the sequence, given the + * current and previous nodes. + * + * @param {Node} prev + * @param {Node} current + * @param {Function} isPre + * @return {Node} + */ + function next(prev, current, isPre) { + if ((prev && prev.parentNode === current) || isPre(current)) { + return current.nextSibling || current.parentNode; + } + + return current.firstChild || current.nextSibling || current.parentNode; + } + + /* + * Set up window for Node.js + */ + + var root = (typeof window !== 'undefined' ? window : {}); + + /* + * Parsing HTML strings + */ + + function canParseHTMLNatively() { + var Parser = root.DOMParser; + var canParse = false; + + // Adapted from https://gist.github.com/1129031 + // Firefox/Opera/IE throw errors on unsupported types + try { + // WebKit returns null on unsupported types + if (new Parser().parseFromString('', 'text/html')) { + canParse = true; + } + } catch (e) { } + + return canParse; + } + + function createHTMLParser() { + var Parser = function () { }; + + { + if (shouldUseActiveX()) { + Parser.prototype.parseFromString = function (string) { + var doc = new window.ActiveXObject('htmlfile'); + doc.designMode = 'on'; // disable on-page scripts + doc.open(); + doc.write(string); + doc.close(); + return doc; + }; + } else { + Parser.prototype.parseFromString = function (string) { + var doc = document.implementation.createHTMLDocument(''); + doc.open(); + doc.write(string); + doc.close(); + return doc; + }; + } + } + return Parser; + } + + function shouldUseActiveX() { + var useActiveX = false; + try { + document.implementation.createHTMLDocument('').open(); + } catch (e) { + if (window.ActiveXObject) useActiveX = true; + } + return useActiveX; + } + + var HTMLParser = canParseHTMLNatively() ? root.DOMParser : createHTMLParser(); + + function RootNode(input, options) { + var root; + if (typeof input === 'string') { + var doc = htmlParser().parseFromString( + // DOM parsers arrange elements in the and . + // Wrapping in a custom element ensures elements are reliably arranged in + // a single element. + '' + input + '', + 'text/html' + ); + root = doc.getElementById('turndown-root'); + } else { + root = input.cloneNode(true); + } + collapseWhitespace({ + element: root, + isBlock: isBlock, + isVoid: isVoid, + isPre: options.preformattedCode ? isPreOrCode : null + }); + + return root; + } + + var _htmlParser; + function htmlParser() { + _htmlParser = _htmlParser || new HTMLParser(); + return _htmlParser; + } + + function isPreOrCode(node) { + return node.nodeName === 'PRE' || node.nodeName === 'CODE'; + } + + function Node(node, options) { + node.isBlock = isBlock(node); + node.isCode = node.nodeName === 'CODE' || node.parentNode.isCode; + node.isBlank = isBlank(node); + node.flankingWhitespace = flankingWhitespace(node, options); + return node; + } + + function isBlank(node) { + return ( + !isVoid(node) && + !isMeaningfulWhenBlank(node) && + /^\s*$/i.test(node.textContent) && + !hasVoid(node) && + !hasMeaningfulWhenBlank(node) + ); + } + + function flankingWhitespace(node, options) { + if (node.isBlock || (options.preformattedCode && node.isCode)) { + return { leading: '', trailing: '' }; + } + + var edges = edgeWhitespace(node.textContent); + + // abandon leading ASCII WS if left-flanked by ASCII WS + if (edges.leadingAscii && isFlankedByWhitespace('left', node, options)) { + edges.leading = edges.leadingNonAscii; + } + + // abandon trailing ASCII WS if right-flanked by ASCII WS + if (edges.trailingAscii && isFlankedByWhitespace('right', node, options)) { + edges.trailing = edges.trailingNonAscii; + } + + return { leading: edges.leading, trailing: edges.trailing }; + } + + function edgeWhitespace(string) { + var m = string.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/); + return { + leading: m[1], // whole string for whitespace-only strings + leadingAscii: m[2], + leadingNonAscii: m[3], + trailing: m[4], // empty for whitespace-only strings + trailingNonAscii: m[5], + trailingAscii: m[6] + }; + } + + function isFlankedByWhitespace(side, node, options) { + var sibling; + var regExp; + var isFlanked; + + if (side === 'left') { + sibling = node.previousSibling; + regExp = / $/; + } else { + sibling = node.nextSibling; + regExp = /^ /; + } + + if (sibling) { + if (sibling.nodeType === 3) { + isFlanked = regExp.test(sibling.nodeValue); + } else if (options.preformattedCode && sibling.nodeName === 'CODE') { + isFlanked = false; + } else if (sibling.nodeType === 1 && !isBlock(sibling)) { + isFlanked = regExp.test(sibling.textContent); + } + } + return isFlanked; + } + + var reduce = Array.prototype.reduce; + var escapes = [ + [/\\/g, '\\\\'], + [/\*/g, '\\*'], + [/^-/g, '\\-'], + [/^\+ /g, '\\+ '], + [/^(=+)/g, '\\$1'], + [/^(#{1,6}) /g, '\\$1 '], + [/`/g, '\\`'], + [/^~~~/g, '\\~~~'], + [/\[/g, '\\['], + [/\]/g, '\\]'], + [/^>/g, '\\>'], + [/_/g, '\\_'], + [/^(\d+)\. /g, '$1\\. '] + ]; + + function TurndownService(options) { + if (!(this instanceof TurndownService)) return new TurndownService(options); + + var defaults = { + rules: rules, + headingStyle: 'setext', + hr: '* * *', + bulletListMarker: '*', + codeBlockStyle: 'indented', + fence: '```', + emDelimiter: '_', + strongDelimiter: '**', + linkStyle: 'inlined', + linkReferenceStyle: 'full', + br: ' ', + preformattedCode: false, + blankReplacement: function (content, node) { + return node.isBlock ? '\n\n' : ''; + }, + keepReplacement: function (content, node) { + return node.isBlock ? '\n\n' + node.outerHTML + '\n\n' : node.outerHTML; + }, + defaultReplacement: function (content, node) { + return node.isBlock ? '\n\n' + content + '\n\n' : content; + } + }; + this.options = extend({}, defaults, options); + this.rules = new Rules(this.options); + } + + TurndownService.prototype = { + /** + * The entry point for converting a string or DOM node to Markdown + * @public + * @param {String|HTMLElement} input The string or DOM node to convert + * @returns A Markdown representation of the input + * @type String + */ + + turndown: function (input) { + if (!canConvert(input)) { + throw new TypeError( + input + ' is not a string, or an element/document/fragment node.' + ); + } + + if (input === '') return ''; + + var output = process.call(this, new RootNode(input, this.options)); + return postProcess.call(this, output); + }, + + /** + * Add one or more plugins + * @public + * @param {Function|Array} plugin The plugin or array of plugins to add + * @returns The Turndown instance for chaining + * @type Object + */ + + use: function (plugin) { + if (Array.isArray(plugin)) { + for (var i = 0; i < plugin.length; i++) this.use(plugin[i]); + } else if (typeof plugin === 'function') { + plugin(this); + } else { + throw new TypeError('plugin must be a Function or an Array of Functions'); + } + return this; + }, + + /** + * Adds a rule + * @public + * @param {String} key The unique key of the rule + * @param {Object} rule The rule + * @returns The Turndown instance for chaining + * @type Object + */ + + addRule: function (key, rule) { + this.rules.add(key, rule); + return this; + }, + + /** + * Keep a node (as HTML) that matches the filter + * @public + * @param {String|Array|Function} filter The unique key of the rule + * @returns The Turndown instance for chaining + * @type Object + */ + + keep: function (filter) { + this.rules.keep(filter); + return this; + }, + + /** + * Remove a node that matches the filter + * @public + * @param {String|Array|Function} filter The unique key of the rule + * @returns The Turndown instance for chaining + * @type Object + */ + + remove: function (filter) { + this.rules.remove(filter); + return this; + }, + + /** + * Escapes Markdown syntax + * @public + * @param {String} string The string to escape + * @returns A string with Markdown syntax escaped + * @type String + */ + + escape: function (string) { + return escapes.reduce(function (accumulator, escape) { + return accumulator.replace(escape[0], escape[1]); + }, string); + } + }; + + /** + * Reduces a DOM node down to its Markdown string equivalent + * @private + * @param {HTMLElement} parentNode The node to convert + * @returns A Markdown representation of the node + * @type String + */ + + function process(parentNode) { + var self = this; + return reduce.call(parentNode.childNodes, function (output, node) { + node = new Node(node, self.options); + + var replacement = ''; + if (node.nodeType === 3) { + replacement = node.isCode ? node.nodeValue : self.escape(node.nodeValue); + } else if (node.nodeType === 1) { + replacement = replacementForNode.call(self, node); + } + + return join(output, replacement); + }, ''); + } + + /** + * Appends strings as each rule requires and trims the output + * @private + * @param {String} output The conversion output + * @returns A trimmed version of the ouput + * @type String + */ + + function postProcess(output) { + var self = this; + this.rules.forEach(function (rule) { + if (typeof rule.append === 'function') { + output = join(output, rule.append(self.options)); + } + }); + + return output.replace(/^[\t\r\n]+/, '').replace(/[\t\r\n\s]+$/, ''); + } + + /** + * Converts an element node to its Markdown equivalent + * @private + * @param {HTMLElement} node The node to convert + * @returns A Markdown representation of the node + * @type String + */ + + function replacementForNode(node) { + var rule = this.rules.forNode(node); + var content = process.call(this, node); + var whitespace = node.flankingWhitespace; + if (whitespace.leading || whitespace.trailing) content = content.trim(); + return ( + whitespace.leading + + rule.replacement(content, node, this.options) + + whitespace.trailing + ); + } + + /** + * Joins replacement to the current output with appropriate number of new lines + * @private + * @param {String} output The current conversion output + * @param {String} replacement The string to append to the output + * @returns Joined output + * @type String + */ + + function join(output, replacement) { + var s1 = trimTrailingNewlines(output); + var s2 = trimLeadingNewlines(replacement); + var nls = Math.max(output.length - s1.length, replacement.length - s2.length); + var separator = '\n\n'.substring(0, nls); + + return s1 + separator + s2; + } + + /** + * Determines whether an input can be converted + * @private + * @param {String|HTMLElement} input Describe this parameter + * @returns Describe what it returns + * @type String|Object|Array|Boolean|Number + */ + + function canConvert(input) { + return ( + input != null && ( + typeof input === 'string' || + (input.nodeType && ( + input.nodeType === 1 || input.nodeType === 9 || input.nodeType === 11 + )) + ) + ); + } + + return TurndownService; + +}()); diff --git a/package.json b/package.json new file mode 100644 index 0000000..bdf2e61 --- /dev/null +++ b/package.json @@ -0,0 +1,548 @@ +{ + "name": "vscode-chatgpt", + "publisher": "YOUR_PUBLISHER_NAME", + "displayName": "vscode-chatgpt", + "icon": "images/ai-logo.jpg", + "description": "vscode-chatgpt", + "version": "3.9.7-0", + "aiKey": "", + "repository": { + "url": "https://github.com/YOUR_PUBLISHER_NAME/vscode-chatgpt" + }, + "engines": { + "vscode": "^1.73.0" + }, + "categories": [ + "Testing", + "Data Science", + "Formatters", + "Programming Languages", + "Linters" + ], + "keywords": [ + "chatgpt", + "lamda", + "bard", + "gpt", + "gpt3", + "gpt3.5", + "gpt4", + "codex", + "openai", + "testing", + "find bugs", + "copilot", + "ai" + ], + "activationEvents": [ + "onStartupFinished" + ], + "main": "./out/extension.js", + "contributes": { + "menus": { + "editor/context": [ + { + "command": "vscode-chatgpt.generateCode", + "group": "chatGpt@1", + "when": "editorHasSelection && generateCode-enabled" + }, + { + "command": "vscode-chatgpt.addTests", + "group": "chatGpt@2", + "when": "editorHasSelection && addTests-enabled" + }, + { + "command": "vscode-chatgpt.findProblems", + "group": "chatGpt@3", + "when": "editorHasSelection && findProblems-enabled" + }, + { + "command": "vscode-chatgpt.optimize", + "group": "chatGpt@4", + "when": "editorHasSelection && optimize-enabled" + }, + { + "command": "vscode-chatgpt.explain", + "group": "chatGpt@5", + "when": "editorHasSelection && explain-enabled" + }, + { + "command": "vscode-chatgpt.addComments", + "group": "chatGpt@6", + "when": "editorHasSelection && addComments-enabled" + }, + { + "command": "vscode-chatgpt.completeCode", + "group": "chatGpt@7", + "when": "editorHasSelection && completeCode-enabled" + }, + { + "command": "vscode-chatgpt.adhoc", + "group": "chatGpt@8", + "when": "editorHasSelection && adhoc-enabled" + }, + { + "command": "vscode-chatgpt.customPrompt1", + "group": "chatGpt@9", + "when": "editorHasSelection && customPrompt1-enabled" + }, + { + "command": "vscode-chatgpt.customPrompt2", + "group": "chatGpt@10", + "when": "editorHasSelection && customPrompt2-enabled" + } + ] + }, + "keybindings": [ + { + "command": "vscode-chatgpt.generateCode", + "key": "ctrl+shift+a", + "mac": "cmd+shift+a", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.addTests", + "key": "ctrl+k ctrl+shift+1", + "mac": "cmd+k cmd+shift+1", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.findProblems", + "key": "ctrl+k ctrl+shift+2", + "mac": "cmd+k cmd+shift+2", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.optimize", + "key": "ctrl+k ctrl+shift+3", + "mac": "cmd+k cmd+shift+3", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.explain", + "key": "ctrl+k ctrl+shift+4", + "mac": "cmd+k cmd+shift+4", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.addComments", + "key": "ctrl+k ctrl+shift+5", + "mac": "cmd+k cmd+shift+5", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.completeCode", + "key": "ctrl+k ctrl+shift+6", + "mac": "cmd+k cmd+shift+6", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.adhoc", + "key": "ctrl+k ctrl+shift+7", + "mac": "cmd+k cmd+shift+7", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.customPrompt1", + "key": "ctrl+k ctrl+shift+8", + "mac": "cmd+k cmd+shift+8", + "when": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.customPrompt2", + "key": "ctrl+k ctrl+shift+9", + "mac": "cmd+k cmd+shift+9", + "when": "editorHasSelection" + } + ], + "commands": [ + { + "command": "vscode-chatgpt.freeText", + "title": "ChatGPT: Ask anything" + }, + { + "command": "vscode-chatgpt.clearSession", + "title": "ChatGPT: Reset session" + }, + { + "command": "vscode-chatgpt.generateCode", + "title": "ChatGPT-Codex: Generate code", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.addTests", + "title": "ChatGPT: Add tests", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.findProblems", + "title": "ChatGPT: Find bugs", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.optimize", + "title": "ChatGPT: Optimize", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.explain", + "title": "ChatGPT: Explain", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.addComments", + "title": "ChatGPT: Add comments", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.completeCode", + "title": "ChatGPT: Complete code", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.adhoc", + "title": "ChatGPT: Ad-hoc prompt", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.customPrompt1", + "title": "ChatGPT: Custom prompt 1", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.customPrompt2", + "title": "ChatGPT: Custom prompt 2", + "enablement": "editorHasSelection" + }, + { + "command": "vscode-chatgpt.clearConversation", + "title": "ChatGPT: Clear conversation" + }, + { + "command": "vscode-chatgpt.exportConversation", + "title": "ChatGPT: Export conversation" + } + ], + "viewsContainers": { + "activitybar": [ + { + "id": "vscode-chatgpt-view-container", + "title": "ChatGPT", + "icon": "images/openai-logo.svg" + } + ] + }, + "views": { + "vscode-chatgpt-view-container": [ + { + "type": "webview", + "id": "vscode-chatgpt.view", + "name": "Conversation window" + } + ] + }, + "configuration": { + "title": "ChatGPT", + "properties": { + "chatgpt.method": { + "type": "string", + "enum": [ + "GPT3 OpenAI API Key" + ], + "default": "GPT3 OpenAI API Key", + "markdownDescription": "Choose your integration preference.", + "order": 1, + "enumItemLabels": [ + "Use OpenAI API key integration" + ], + "markdownEnumDescriptions": [ + "Various text & code completion models are supported including ChatGPT Turbo models. \n\n- GPT3.5 -> i.e. `'chatgpt.gpt3.model': 'gpt-3.5-turbo'`\n\n- GPT3 -> i.e. `'chatgpt.gpt3.model': 'text-davinci-003'`\n\n- Codex -> i.e.`'chatgpt.gpt3.model': 'code-davinci-002'`" + ] + }, + "chatgpt.authenticationType": { + "type": "string", + "enum": [ + "OpenAI Authentication", + "Google Authentication", + "Microsoft Authentication" + ], + "default": "OpenAI Authentication", + "markdownDescription": "Choose your login type to autofill the provided email/password in the authentication flow. \n\n - `OpenAI Authentication` Standard authentication method. Use this if you signed up using your email address instead of Google/Microsoft authentication. \n\n - `Google Authentication` Use Google Authentication to login to OpenAI \n\n - `Microsoft Authentication` Use Microsoft Authentication to login to OpenAI", + "order": 2 + }, + "chatgpt.emailAddress": { + "type": "string", + "default": null, + "description": "[Optional] Your openai.com login email address. Provide this if you want to auto-fill your email address during autologin. You don't have to provide this if you want to fill it during login.", + "order": 3 + }, + "chatgpt.password": { + "type": "string", + "default": null, + "description": "[Optional] Your openai.com login password. Provide this if you want to auto-fill your password during autologin. You don't have to provide this if you want to fill it during login.", + "order": 4 + }, + "chatgpt.proxyServer": { + "type": "string", + "default": null, + "markdownDescription": "[Optional] The proxy server you'd like to use. Supports HTTP proxies only, don't provide the protocol in the setting. Format example: \n\n `authenticated`:`myUsername:myPassword@my.proxy.com:3001` \n\n `anonymous`: `204.137.172.37:999` \n\n **Only available for `Browser Auto-login` method**", + "order": 5 + }, + "chatgpt.chromiumPath": { + "type": "string", + "markdownDescription": "The executable path of your Chromium-based browser. i.e. `Chrome`, `Edge` etc. \n\n Unless you override, we use the default paths per Operating System for `Chrome`. \n\n **Windows**\n C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe \n\n **MAC**\n /Applications/Google Chrome.app/Contents/MacOS/Google Chrome \n\n You can use Chromium based Edge as well. e.g. \n\n **Windows Edge**\n C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe \n\n **You can find the executable path for your preferred browser by going to these URLs: `chrome://version` or `edge://version`**", + "order": 6 + }, + "chatgpt.gpt3.generateCode-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the code generation context menu item for the selected comment/code for Codex. Only available with code-* models", + "order": 7 + }, + "chatgpt.promptPrefix.addTests": { + "type": "string", + "default": "Implement tests for the following code", + "description": "The prompt prefix used for adding tests for the selected code", + "order": 8 + }, + "chatgpt.promptPrefix.addTests-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for adding tests for the selected code in the context menu", + "order": 9 + }, + "chatgpt.promptPrefix.findProblems": { + "type": "string", + "default": "Find problems with the following code", + "description": "The prompt prefix used for finding problems for the selected code", + "order": 10 + }, + "chatgpt.promptPrefix.findProblems-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for finding problems for the selected code in the context menu", + "order": 11 + }, + "chatgpt.promptPrefix.optimize": { + "type": "string", + "default": "Optimize the following code", + "description": "The prompt prefix used for optimizing the selected code", + "order": 12 + }, + "chatgpt.promptPrefix.optimize-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for optimizing the selected code in the context menu", + "order": 13 + }, + "chatgpt.promptPrefix.explain": { + "type": "string", + "default": "Explain the following code", + "description": "The prompt prefix used for explaining the selected code", + "order": 14 + }, + "chatgpt.promptPrefix.explain-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for explaining the selected code in the context menu", + "order": 15 + }, + "chatgpt.promptPrefix.addComments": { + "type": "string", + "default": "Add comments for the following code", + "description": "The prompt prefix used for adding comments for the selected code", + "order": 16 + }, + "chatgpt.promptPrefix.addComments-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for adding comments for the selected code in the context menu", + "order": 17 + }, + "chatgpt.promptPrefix.completeCode": { + "type": "string", + "default": "Complete the following code", + "description": "The prompt prefix used for completing the selected code", + "order": 18 + }, + "chatgpt.promptPrefix.completeCode-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for completing the selected code in the context menu", + "order": 19 + }, + "chatgpt.promptPrefix.customPrompt1": { + "type": "string", + "default": "", + "description": "Your custom prompt. It's disabled by default, please set to a custom prompt and enable it if you prefer using customized prompt", + "order": 20 + }, + "chatgpt.promptPrefix.customPrompt1-enabled": { + "type": "boolean", + "default": false, + "markdownDescription": "Enable the prompt prefix used for your custom prompt. The default value is empty, if you enable this item make sure to set this `chatgpt.promptPrefix.customPrompt1`", + "order": 21 + }, + "chatgpt.promptPrefix.customPrompt2": { + "type": "string", + "default": "", + "description": "Your custom prompt. It's disabled by default, please set to a custom prompt and enable it if you prefer using customized prompt", + "order": 22 + }, + "chatgpt.promptPrefix.customPrompt2-enabled": { + "type": "boolean", + "default": false, + "markdownDescription": "Enable the prompt prefix used for your custom prompt. The default value is empty, if you enable this item make sure to set this `chatgpt.promptPrefix.customPrompt2`", + "order": 23 + }, + "chatgpt.promptPrefix.adhoc-enabled": { + "type": "boolean", + "default": true, + "description": "Enable the prompt prefix used for adhoc command for the selected code in the context menu", + "order": 24 + }, + "chatgpt.gpt3.apiKey": { + "type": "string", + "markdownDescription": "OpenAI API key. [Get your API Key from OpenAI](https://beta.openai.com/account/api-keys). \n\n**Please enable OpenAI API Key method to use this setting.**", + "order": 30 + }, + "chatgpt.gpt3.apiBaseUrl": { + "type": "string", + "default": "https://api.openai.com", + "markdownDescription": "Optional override for the OpenAI API base URL. If you customize it, please make sure you have the same format. e.g. starts with `https://` without a trailing slash. The completions endpoint suffix is added internally, e.g. for reference: `${apiBaseUrl}/v1/completions`", + "order": 31 + }, + "chatgpt.gpt3.organization": { + "type": "string", + "markdownDescription": "OpenAI Organization ID. [Documentation](https://beta.openai.com/docs/api-reference/requesting-organization). \n\n**Please enable OpenAI API Key method to use this setting.**", + "order": 32 + }, + "chatgpt.gpt3.model": { + "type": "string", + "enum": [ + "text-davinci-002-render", + "gpt-4", + "text-davinci-002-render-paid", + "text-davinci-002-render-sha", + "gpt-3.5-turbo", + "gpt-3.5-turbo-0301", + "text-davinci-003", + "text-curie-001", + "text-babbage-001", + "text-ada-001", + "code-davinci-002", + "code-cushman-001" + ], + "default": "gpt-3.5-turbo", + "markdownDescription": "OpenAI models to use for your prompts. [Documentation](https://beta.openai.com/docs/models/models). \n\n**If you face 400 Bad Request please make sure you are using the right model for your integration method.**", + "order": 33, + "enumItemLabels": [ + "Browser autologin - default ChatGPT model", + "Browser autologin - ChatGPT Plus GPT-4", + "Browser autologin - ChatGPT Plus default model", + "Browser autologin - ChatGPT Plus legacy model", + "OpenAI API Key - gpt-3.5-turbo", + "OpenAI API Key - gpt-3.5-turbo-0301", + "OpenAI API Key - text-davinci-003", + "OpenAI API Key - text-curie-001", + "OpenAI API Key - text-babbage-001", + "OpenAI API Key - text-ada-001", + "OpenAI API Key - code-davinci-002", + "OpenAI API Key - code-cushman-001" + ], + "markdownEnumDescriptions": [ + "Free Tier ChatGPT model that's used in chat.openai.com", + "ChatGPT Plus subscription GPT-4 model that's used in chat.openai.com. This requires a subscription on OpenAI side, please make sure you are eligible to use this model. \n\n**More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Available to ChatGPT Plus users**", + "ChatGPT Plus subscription default model that's used in chat.openai.com. This requires a subscription on OpenAI side, please make sure you are eligible to use this model. \n\n**Optimized for speed, currently available to Plus users**", + "ChatGPT Plus subscription legacy model that's used in chat.openai.com. This requires a subscription on OpenAI side, please make sure you are eligible to use this model. \n\n**The previous ChatGPT Plus model**", + "Most capable GPT-3.5 model and optimized for chat at 1/10th the cost of `text-davinci-003`. Will be updated with our latest model iteration.", + "Snapshot of `gpt-3.5-turbo` from March 1st 2023. Unlike gpt-3.5-turbo, this model will not receive updates, and will only be supported for a three month period ending on June 1st 2023." + ] + }, + "chatgpt.gpt3.maxTokens": { + "type": "number", + "default": 1024, + "markdownDescription": "The maximum number of tokens to generate in the completion. \n\nThe token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-max_tokens) \n\n**Please enable OpenAI API Key method to use this setting.**", + "order": 34 + }, + "chatgpt.gpt3.temperature": { + "type": "number", + "default": 1, + "markdownDescription": "What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.\n\nIt is recommended altering this or top_p but not both. [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-temperature) \n\n**Please enable OpenAI API Key method to use this setting.**", + "order": 35 + }, + "chatgpt.gpt3.top_p": { + "type": "number", + "default": 1, + "markdownDescription": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. \n\nIt is recommended altering this or temperature but not both. [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-top_p) \n\n**Please enable OpenAI API Key method to use this setting.**", + "order": 36 + }, + "chatgpt.response.showNotification": { + "type": "boolean", + "default": false, + "description": "Choose whether you'd like to receive a notification when ChatGPT bot responds to your query.", + "order": 37 + }, + "chatgpt.response.autoScroll": { + "type": "boolean", + "default": true, + "description": "Whenever there is a new question or response added to the conversation window, extension will automatically scroll to the bottom. You can change that behavior by disabling this setting.", + "order": 38 + }, + "chatgpt.telemetry.disable": { + "type": "boolean", + "default": false, + "markdownDescription": "Specify if you want to disable the telemetry. This extension also respects your default vs-code telemetry setting `telemetry.telemetryLevel`. We check both settings for telemetry. **Important**: No user data is tracked, we only use telemetry to see what is used, and what isn't. This allows us to make accurate decisions on what to add or enhance to the extension.", + "order": 39 + } + } + } + }, + "scripts": { + "vscode:prepublish": "rimraf out && npm run esbuild-base -- --minify", + "esbuild-base": "esbuild ./src/extension.ts --bundle --outfile=out/extension.js --external:vscode --format=cjs --platform=node", + "build": "npm run -S esbuild-base -- --sourcemap", + "watch": "npm run -S esbuild-base -- --sourcemap --watch", + "fmt": "prettier --write \"src/**/*.ts\"&& npm run test -- --fix", + "test": "eslint src --ext ts && tsc --noEmit" + }, + "devDependencies": { + "@types/glob": "^8.0.0", + "@types/isomorphic-fetch": "^0.0.36", + "@types/mocha": "^10.0.1", + "@types/node": "16.x", + "@types/uuid": "^9.0.0", + "@types/vscode": "^1.73.0", + "@types/vscode-webview": "^1.57.0", + "@typescript-eslint/eslint-plugin": "^5.45.0", + "@typescript-eslint/parser": "^5.45.0", + "@vscode/test-electron": "^2.2.0", + "esbuild": "^0.15.18", + "eslint": "^8.28.0", + "glob": "^8.0.3", + "mocha": "^10.1.0", + "ts-loader": "^9.4.1", + "typescript": "^4.9.3" + }, + "dependencies": { + "delay": "^5.0.0", + "eventsource-parser": "^0.1.0", + "gpt3-tokenizer": "^1.1.5", + "isomorphic-fetch": "^3.0.0", + "keyv": "^4.5.2", + "openai": "^3.1.0", + "p-timeout": "^6.1.1", + "puppeteer": "^19.4.0", + "puppeteer-extra": "^3.3.4", + "puppeteer-extra-plugin-stealth": "^2.11.1", + "puppeteer-extra-plugin-user-data-dir": "^2.4.0", + "puppeteer-extra-plugin-user-preferences": "^2.4.0", + "quick-lru": "^6.1.1", + "remark": "^14.0.2", + "strip-markdown": "^5.0.0", + "uuid": "^9.0.0" + }, + "resolutions": { + "clone-deep": "^4.0.1" + } +} \ No newline at end of file diff --git a/package.nls.json b/package.nls.json new file mode 100644 index 0000000..3358f85 --- /dev/null +++ b/package.nls.json @@ -0,0 +1,77 @@ +{ + "vscode-chatgpt.freeText.title": "ChatGPT: Ask anything", + "vscode-chatgpt.clearSession.title": "ChatGPT: Reset session", + "vscode-chatgpt.generateCode.title": "ChatGPT-Codex: Generate code", + "vscode-chatgpt.addTests.title": "ChatGPT: Add tests", + "vscode-chatgpt.findProblems.title": "ChatGPT: Find bugs", + "vscode-chatgpt.optimize.title": "ChatGPT: Optimize", + "vscode-chatgpt.explain.title": "ChatGPT: Explain", + "vscode-chatgpt.addComments.title": "ChatGPT: Add comments", + "vscode-chatgpt.completeCode.title": "ChatGPT: Complete code", + "vscode-chatgpt.adhoc.title": "ChatGPT: Ad-hoc prompt", + "vscode-chatgpt.customPrompt1.title": "ChatGPT: Custom prompt 1", + "vscode-chatgpt.customPrompt2.title": "ChatGPT: Custom prompt 2", + "vscode-chatgpt.clearConversation.title": "ChatGPT: Clear conversation", + "vscode-chatgpt.exportConversation.title": "ChatGPT: Export conversation", + "vscode-chatgpt-view-container.name": "Conversation window", + "chatgpt.method.markdownDescription": "Choose your integration preference.", + "chatgpt.method.markdownEnumDescriptions1": "Make sure to select the correct model from the settings \n\n- Browser autologin - default ChatGPT model -> `text-davinci-002-render-sha` \n\n- Browser autologin - ChatGPT Plus default model -> `text-davinci-002-render-paid` \n\n- Browser autologin - ChatGPT Plus legacy model -> `text-davinci-002-render-sha`", + "chatgpt.method.markdownEnumDescriptions2": "Various text & code completion models are supported including ChatGPT Turbo models. \n\n- GPT3.5 -> i.e. `'chatgpt.gpt3.model': 'gpt-3.5-turbo'`\n\n- GPT3 -> i.e. `'chatgpt.gpt3.model': 'text-davinci-003'`\n\n- Codex -> i.e.`'chatgpt.gpt3.model': 'code-davinci-002'`", + "chatgpt.authenticationType.markdownDescription": "Choose your login type to autofill the provided email/password in the authentication flow. \n\n - `OpenAI Authentication` Standard authentication method. Use this if you signed up using your email address instead of Google/Microsoft authentication. \n\n - `Google Authentication` Use Google Authentication to login to OpenAI \n\n - `Microsoft Authentication` Use Microsoft Authentication to login to OpenAI", + "chatgpt.emailAddress.description": "[Optional] Your openai.com login email address. Provide this if you want to auto-fill your email address during autologin. You don't have to provide this if you want to fill it during login.", + "chatgpt.password.description": "[Optional] Your openai.com login password. Provide this if you want to auto-fill your password during autologin. You don't have to provide this if you want to fill it during login.", + "chatgpt.proxyServer.markdownDescription": "[Optional] The proxy server you'd like to use. Supports HTTP proxies only, don't provide the protocol in the setting. Format example: \n\n `authenticated`:`myUsername:myPassword@my.proxy.com:3001` \n\n `anonymous`: `204.137.172.37:999` \n\n **Only available for `Browser Auto-login` method**", + "chatgpt.chromiumPath.markdownDescription": "The executable path of your Chromium-based browser. i.e. `Chrome`, `Edge` etc. \n\n Unless you override, we use the default paths per Operating System for `Chrome`. \n\n **Windows**\n C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe \n\n **MAC**\n /Applications/Google Chrome.app/Contents/MacOS/Google Chrome \n\n You can use Chromium based Edge as well. e.g. \n\n **Windows Edge**\n C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe \n\n **You can find the executable path for your preferred browser by going to these URLs: `chrome://version` or `edge://version`**", + "chatgpt.gpt3.generateCode-enabled.description": "Enable the code generation context menu item for the selected comment/code for Codex. Only available with code-* models", + "chatgpt.promptPrefix.addTests.default": "Implement tests for the following code", + "chatgpt.promptPrefix.addTests.description": "The prompt prefix used for adding tests for the selected code", + "chatgpt.promptPrefix.addTests-enabled.description": "Enable the prompt prefix used for adding tests for the selected code in the context menu", + "chatgpt.promptPrefix.findProblems.default": "Find problems with the following code", + "chatgpt.promptPrefix.findProblems.description": "The prompt prefix used for finding problems for the selected code", + "chatgpt.promptPrefix.findProblems-enabled.description": "Enable the prompt prefix used for finding problems for the selected code in the context menu", + "chatgpt.promptPrefix.optimize.default": "Optimize the following code", + "chatgpt.promptPrefix.optimize.description": "The prompt prefix used for optimizing the selected code", + "chatgpt.promptPrefix.optimize-enabled.description": "Enable the prompt prefix used for optimizing the selected code in the context menu", + "chatgpt.promptPrefix.explain.default": "Explain the following code", + "chatgpt.promptPrefix.explain.description": "The prompt prefix used for explaining the selected code", + "chatgpt.promptPrefix.explain-enabled.description": "Enable the prompt prefix used for explaining the selected code in the context menu", + "chatgpt.promptPrefix.addComments.default": "Add comments for the following code", + "chatgpt.promptPrefix.addComments.description": "The prompt prefix used for adding comments for the selected code", + "chatgpt.promptPrefix.addComments-enabled.description": "Enable the prompt prefix used for adding comments for the selected code in the context menu", + "chatgpt.promptPrefix.completeCode.default": "Complete the following code", + "chatgpt.promptPrefix.completeCode.description": "The prompt prefix used for completing the selected code", + "chatgpt.promptPrefix.completeCode-enabled.description": "Enable the prompt prefix used for completing the selected code in the context menu", + "chatgpt.promptPrefix.customPrompt1.description": "Your custom prompt. It's disabled by default, please set to a custom prompt and enable it if you prefer using customized prompt", + "chatgpt.promptPrefix.customPrompt1-enabled.markdownDescription": "Enable the prompt prefix used for your custom prompt. The default value is empty, if you enable this item make sure to set this `chatgpt.promptPrefix.customPrompt1`", + "chatgpt.promptPrefix.customPrompt2.description": "Your custom prompt. It's disabled by default, please set to a custom prompt and enable it if you prefer using customized prompt", + "chatgpt.promptPrefix.customPrompt2-enabled.markdownDescription": "Enable the prompt prefix used for your custom prompt. The default value is empty, if you enable this item make sure to set this `chatgpt.promptPrefix.customPrompt2`", + "chatgpt.promptPrefix.adhoc-enabled.description": "Enable the prompt prefix used for adhoc command for the selected code in the context menu", + "chatgpt.gpt3.apiKey.markdownDescription": "OpenAI API key. [Get your API Key from OpenAI](https://beta.openai.com/account/api-keys). \n\n**Please enable OpenAI API Key method to use this setting.**", + "chatgpt.gpt3.apiBaseUrl.markdownDescription": "Optional override for the OpenAI API base URL. If you customize it, please make sure you have the same format. e.g. starts with `https://` without a trailing slash. The completions endpoint suffix is added internally, e.g. for reference: `${apiBaseUrl}/v1/completions`", + "chatgpt.gpt3.organization.markdownDescription": "OpenAI Organization ID. [Documentation](https://beta.openai.com/docs/api-reference/requesting-organization). \n\n**Please enable OpenAI API Key method to use this setting.**", + "chatgpt.gpt3.model.markdownDescription": "OpenAI models to use for your prompts. [Documentation](https://beta.openai.com/docs/models/models). \n\n**If you face 400 Bad Request please make sure you are using the right model for your integration method.**", + "chatgpt.gpt3.model.enumItemLabels1": "Browser autologin - default ChatGPT model", + "chatgpt.gpt3.model.enumItemLabels2": "Browser autologin - ChatGPT Plus GPT-4", + "chatgpt.gpt3.model.enumItemLabels3": "Browser autologin - ChatGPT Plus default model", + "chatgpt.gpt3.model.enumItemLabels4": "Browser autologin - ChatGPT Plus legacy model", + "chatgpt.gpt3.model.enumItemLabels5": "OpenAI API Key - gpt-3.5-turbo", + "chatgpt.gpt3.model.enumItemLabels6": "OpenAI API Key - gpt-3.5-turbo-0301", + "chatgpt.gpt3.model.enumItemLabels7": "OpenAI API Key - text-davinci-003", + "chatgpt.gpt3.model.enumItemLabels8": "OpenAI API Key - text-curie-001", + "chatgpt.gpt3.model.enumItemLabels9": "OpenAI API Key - text-babbage-001", + "chatgpt.gpt3.model.enumItemLabels10": "OpenAI API Key - text-ada-001", + "chatgpt.gpt3.model.enumItemLabels11": "OpenAI API Key - code-davinci-002", + "chatgpt.gpt3.model.enumItemLabels12": "OpenAI API Key - code-cushman-001", + "chatgpt.gpt3.model.markdownEnumDescriptions1": "Free Tier ChatGPT model that's used in chat.openai.com", + "chatgpt.gpt3.model.markdownEnumDescriptions2": "ChatGPT Plus subscription GPT-4 model that's used in chat.openai.com. This requires a subscription on OpenAI side, please make sure you are eligible to use this model. \n\n**More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Available to ChatGPT Plus users**", + "chatgpt.gpt3.model.markdownEnumDescriptions3": "ChatGPT Plus subscription default model that's used in chat.openai.com. This requires a subscription on OpenAI side, please make sure you are eligible to use this model. \n\n**Optimized for speed, currently available to Plus users**", + "chatgpt.gpt3.model.markdownEnumDescriptions4": "ChatGPT Plus subscription legacy model that's used in chat.openai.com. This requires a subscription on OpenAI side, please make sure you are eligible to use this model. \n\n**The previous ChatGPT Plus model**", + "chatgpt.gpt3.model.markdownEnumDescriptions5": "Most capable GPT-3.5 model and optimized for chat at 1/10th the cost of `text-davinci-003`. Will be updated with our latest model iteration.", + "chatgpt.gpt3.model.markdownEnumDescriptions6": "Snapshot of `gpt-3.5-turbo` from March 1st 2023. Unlike gpt-3.5-turbo, this model will not receive updates, and will only be supported for a three month period ending on June 1st 2023.", + "chatgpt.gpt3.maxTokens.markdownDescription": "The maximum number of tokens to generate in the completion. \n\nThe token count of your prompt plus max_tokens cannot exceed the model's context length. Most models have a context length of 2048 tokens (except for the newest models, which support 4096). [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-max_tokens) \n\n**Please enable OpenAI API Key method to use this setting.**", + "chatgpt.gpt3.temperature.markdownDescription": "What sampling temperature to use. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer.\n\nIt is recommended altering this or top_p but not both. [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-temperature) \n\n**Please enable OpenAI API Key method to use this setting.**", + "chatgpt.gpt3.top_p.markdownDescription": "An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. \n\nIt is recommended altering this or temperature but not both. [Documentation](https://beta.openai.com/docs/api-reference/completions/create#completions/create-top_p) \n\n**Please enable OpenAI API Key method to use this setting.**", + "chatgpt.response.showNotification.description": "Choose whether you'd like to receive a notification when ChatGPT bot responds to your query.", + "chatgpt.response.autoScroll.description": "Whenever there is a new question or response added to the conversation window, extension will automatically scroll to the bottom. You can change that behavior by disabling this setting.", + "chatgpt.telemetry.disable.markdownDescription": "Specify if you want to disable the telemetry. This extension also respects your default vs-code telemetry setting `telemetry.telemetryLevel`. We check both settings for telemetry. **Important**: No user data is tracked, we only use telemetry to see what is used, and what isn't. This allows us to make accurate decisions on what to add or enhance to the extension." +} \ No newline at end of file diff --git a/src/abstract-chatgpt-api.ts b/src/abstract-chatgpt-api.ts new file mode 100644 index 0000000..7b102d2 --- /dev/null +++ b/src/abstract-chatgpt-api.ts @@ -0,0 +1,99 @@ +// Adapted from https://github.com/transitive-bullshit/chatgpt-api/blob/v3/license + +/** + * + * MIT License + +Copyright (c) 2023 Travis Fischer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + */ +import * as types from './types'; + +export abstract class AChatGPTAPI { + /** + * Performs any async initialization work required to ensure that this API is + * properly authenticated. + * + * @throws An error if the session failed to initialize properly. + */ + abstract initSession(): Promise; + + /** + * Sends a message to ChatGPT, waits for the response to resolve, and returns + * the response. + * + * If you want to receive a stream of partial responses, use `opts.onProgress`. + * + * @param message - The prompt message to send + * @param opts.conversationId - Optional ID of a conversation to continue + * @param opts.parentMessageId - Optional ID of the previous message in the conversation + * @param opts.messageId - Optional ID of the message to send (defaults to a random UUID) + * @param opts.action - Optional ChatGPT `action` (either `next` or `variant`) + * @param opts.timeoutMs - Optional timeout in milliseconds (defaults to no timeout) + * @param opts.onProgress - Optional callback which will be invoked every time the partial response is updated + * @param opts.abortSignal - Optional callback used to abort the underlying `fetch` call using an [AbortController](https://developer.mozilla.org/en-US/docs/Web/API/AbortController) + * + * @returns The response from ChatGPT, including `conversationId`, `messageId`, and + * the `response` text. + */ + abstract sendMessage( + message: string, + opts?: types.SendMessageOptions + ): Promise; + + /** + * @returns `true` if the client is authenticated with a valid session or `false` + * otherwise. + */ + abstract getIsAuthenticated(): Promise; + + /** + * Refreshes the current ChatGPT session. + * + * Useful for bypassing 403 errors when Cloudflare clearance tokens expire. + * + * @returns Access credentials for the new session. + * @throws An error if it fails. + */ + abstract refreshSession(): Promise; + + /** + * Closes the current ChatGPT session and starts a new one. + * + * Useful for bypassing 401 errors when sessions expire. + * + * @returns Access credentials for the new session. + * @throws An error if it fails. + */ + async resetSession(): Promise { + await this.closeSession(); + return this.initSession(); + } + + /** + * Closes the active session. + * + * @throws An error if it fails. + */ + abstract closeSession(): Promise; + + abstract getConversations(offset?: number, limit?: number): Promise; + abstract getConversation(id: string): Promise; +} \ No newline at end of file diff --git a/src/chatgpt-view-provider.ts b/src/chatgpt-view-provider.ts new file mode 100644 index 0000000..0a5a224 --- /dev/null +++ b/src/chatgpt-view-provider.ts @@ -0,0 +1,576 @@ +import delay from 'delay'; +import fetch from 'isomorphic-fetch'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import * as vscode from 'vscode'; +import { ChatGPTAPI as ChatGPTAPI3 } from '../chatgpt-4.7.2/index'; +import { ChatGPTAPI as ChatGPTAPI35 } from '../chatgpt-5.1.1/index'; +import { AuthType, LoginMethod } from "./types"; + +export default class ChatGptViewProvider implements vscode.WebviewViewProvider { + private webView?: vscode.WebviewView; + + public subscribeToResponse: boolean; + public autoScroll: boolean; + public useAutoLogin?: boolean; + public useGpt3?: boolean; + public chromiumPath?: string; + public profilePath?: string; + public model?: string; + + private apiGpt3?: ChatGPTAPI3; + private apiGpt35?: ChatGPTAPI35; + private conversationId?: string; + private messageId?: string; + private proxyServer?: string; + private loginMethod?: LoginMethod; + private authType?: AuthType; + + private questionCounter: number = 0; + private inProgress: boolean = false; + private abortController?: AbortController; + private currentMessageId: string = ""; + private response: string = ""; + + /** + * Message to be rendered lazily if they haven't been rendered + * in time before resolveWebviewView is called. + */ + private leftOverMessage?: any; + constructor(private context: vscode.ExtensionContext) { + this.subscribeToResponse = vscode.workspace.getConfiguration("chatgpt").get("response.showNotification") || false; + this.autoScroll = !!vscode.workspace.getConfiguration("chatgpt").get("response.autoScroll"); + this.model = vscode.workspace.getConfiguration("chatgpt").get("gpt3.model") as string; + + this.setMethod(); + this.setChromeExecutablePath(); + this.setProfilePath(); + this.setProxyServer(); + this.setAuthType(); + } + + public resolveWebviewView( + webviewView: vscode.WebviewView, + _context: vscode.WebviewViewResolveContext, + _token: vscode.CancellationToken, + ) { + this.webView = webviewView; + + webviewView.webview.options = { + // Allow scripts in the webview + enableScripts: true, + + localResourceRoots: [ + this.context.extensionUri + ] + }; + + webviewView.webview.html = this.getWebviewHtml(webviewView.webview); + + webviewView.webview.onDidReceiveMessage(async data => { + switch (data.type) { + case 'addFreeTextQuestion': + this.sendApiRequest(data.value, { command: "freeText" }); + break; + case 'editCode': + const escapedString = (data.value as string).replace(/\$/g, '\\$');; + vscode.window.activeTextEditor?.insertSnippet(new vscode.SnippetString(escapedString)); + + this.logEvent("code-inserted"); + break; + case 'openNew': + const document = await vscode.workspace.openTextDocument({ + content: data.value, + language: data.language + }); + vscode.window.showTextDocument(document); + + this.logEvent(data.language === "markdown" ? "code-exported" : "code-opened"); + break; + case 'clearConversation': + this.messageId = undefined; + this.conversationId = undefined; + + this.logEvent("conversation-cleared"); + break; + case 'clearBrowser': + this.logEvent("browser-cleared"); + break; + case 'cleargpt3': + this.apiGpt3 = undefined; + + this.logEvent("gpt3-cleared"); + break; + case 'login': + this.prepareConversation().then(success => { + if (success) { + this.sendMessage({ type: 'loginSuccessful', showConversations: this.useAutoLogin }, true); + + this.logEvent("logged-in"); + } + }); + break; + case 'openSettings': + vscode.commands.executeCommand('workbench.action.openSettings', "@ext:YOUR_PUBLISHER_NAME.vscode-chatgpt chatgpt."); + + this.logEvent("settings-opened"); + break; + case 'openSettingsPrompt': + vscode.commands.executeCommand('workbench.action.openSettings', "@ext:YOUR_PUBLISHER_NAME.vscode-chatgpt promptPrefix"); + + this.logEvent("settings-prompt-opened"); + break; + case 'listConversations': + this.logEvent("conversations-list-attempted"); + break; + case 'showConversation': + /// ... + break; + case "stopGenerating": + this.stopGenerating(); + break; + default: + break; + } + }); + + if (this.leftOverMessage != null) { + // If there were any messages that wasn't delivered, render after resolveWebView is called. + this.sendMessage(this.leftOverMessage); + this.leftOverMessage = null; + } + } + + private stopGenerating(): void { + this.abortController?.abort?.(); + this.inProgress = false; + this.sendMessage({ type: 'showInProgress', inProgress: this.inProgress }); + const responseInMarkdown = !this.isCodexModel; + this.sendMessage({ type: 'addResponse', value: this.response, done: true, id: this.currentMessageId, autoScroll: this.autoScroll, responseInMarkdown }); + this.logEvent("stopped-generating"); + } + + public clearSession(): void { + this.stopGenerating(); + this.apiGpt3 = undefined; + this.messageId = undefined; + this.conversationId = undefined; + this.logEvent("cleared-session"); + } + + public setProxyServer(): void { + this.proxyServer = vscode.workspace.getConfiguration("chatgpt").get("proxyServer"); + } + + public setMethod(): void { + this.loginMethod = vscode.workspace.getConfiguration("chatgpt").get("method") as LoginMethod; + + this.useGpt3 = true; + this.useAutoLogin = false; + this.clearSession(); + } + + public setAuthType(): void { + this.authType = vscode.workspace.getConfiguration("chatgpt").get("authenticationType"); + this.clearSession(); + } + + public setChromeExecutablePath(): void { + let path = ""; + switch (os.platform()) { + case 'win32': + path = 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'; + break; + + case 'darwin': + path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'; + break; + + default: + /** + * Since two (2) separate chrome releases exists on linux + * we first do a check to ensure we're executing the right one. + */ + const chromeExists = fs.existsSync('/usr/bin/google-chrome'); + + path = chromeExists + ? '/usr/bin/google-chrome' + : '/usr/bin/google-chrome-stable'; + break; + } + + this.chromiumPath = vscode.workspace.getConfiguration("chatgpt").get("chromiumPath") || path; + this.clearSession(); + } + + public setProfilePath(): void { + this.profilePath = vscode.workspace.getConfiguration("chatgpt").get("profilePath"); + this.clearSession(); + } + + private get isCodexModel(): boolean { + return !!this.model?.startsWith("code-"); + } + + private get isGpt35Model(): boolean { + return !!this.model?.startsWith("gpt-"); + } + + public async prepareConversation(modelChanged = false): Promise { + if (modelChanged && this.useAutoLogin) { + // no need to reinitialize in autologin when model changes + return false; + } + + const state = this.context.globalState; + const configuration = vscode.workspace.getConfiguration("chatgpt"); + + if (this.useGpt3) { + if ((this.isGpt35Model && !this.apiGpt35) || (!this.isGpt35Model && !this.apiGpt3) || modelChanged) { + let apiKey = configuration.get("gpt3.apiKey") as string || state.get("chatgpt-gpt3-apiKey") as string; + const organization = configuration.get("gpt3.organization") as string; + const max_tokens = configuration.get("gpt3.maxTokens") as number; + const temperature = configuration.get("gpt3.temperature") as number; + const top_p = configuration.get("gpt3.top_p") as number; + const apiBaseUrl = configuration.get("gpt3.apiBaseUrl") as string; + + if (!apiKey) { + vscode.window.showErrorMessage("Please add your API Key to use OpenAI official APIs. Storing the API Key in Settings is discouraged due to security reasons, though you can still opt-in to use it to persist it in settings. Instead you can also temporarily set the API Key one-time: You will need to re-enter after restarting the vs-code.", "Store in session (Recommended)", "Open settings").then(async choice => { + if (choice === "Open settings") { + vscode.commands.executeCommand('workbench.action.openSettings', "chatgpt.gpt3.apiKey"); + return false; + } else if (choice === "Store in session (Recommended)") { + await vscode.window + .showInputBox({ + title: "Store OpenAI API Key in session", + prompt: "Please enter your OpenAI API Key to store in your session only. This option won't persist the token on your settings.json file. You may need to re-enter after restarting your VS-Code", + ignoreFocusOut: true, + placeHolder: "API Key", + value: apiKey || "" + }) + .then((value) => { + if (value) { + apiKey = value; + state.update("chatgpt-gpt3-apiKey", apiKey); + this.sendMessage({ type: 'loginSuccessful', showConversations: this.useAutoLogin }, true); + } + }); + } + }); + + return false; + } + + if (this.isGpt35Model) { + this.apiGpt35 = new ChatGPTAPI35({ + apiKey, + fetch: fetch, + apiBaseUrl: apiBaseUrl?.trim() || undefined, + organization, + completionParams: { + model: this.model, + max_tokens, + temperature, + top_p, + } + }); + } else { + this.apiGpt3 = new ChatGPTAPI3({ + apiKey, + fetch: fetch, + apiBaseUrl: apiBaseUrl?.trim() || undefined, + organization, + completionParams: { + model: this.model, + max_tokens, + temperature, + top_p, + } + }); + } + } + } + + this.sendMessage({ type: 'loginSuccessful', showConversations: this.useAutoLogin }, true); + + return true; + } + + private get systemContext() { + return `You are ChatGPT helping the User with coding. + You are intelligent, helpful and an expert developer, who always gives the correct answer and only does what instructed. You always answer truthfully and don't make things up. + (When responding to the following prompt, please make sure to properly style your response using Github Flavored Markdown. + Use markdown syntax for things like headings, lists, colored text, code blocks, highlights etc. Make sure not to mention markdown or styling in your actual response.)`; + } + + private processQuestion(question: string, code?: string, language?: string) { + if (code != null) { + // Add prompt prefix to the code if there was a code block selected + question = `${question}${language ? ` (The following code is in ${language} programming language)` : ''}: ${code}`; + } + return question + "\r\n"; + } + + public async sendApiRequest(prompt: string, options: { command: string, code?: string, previousAnswer?: string, language?: string; }) { + if (this.inProgress) { + // The AI is still thinking... Do not accept more questions. + return; + } + + this.questionCounter++; + + this.logEvent("api-request-sent", { "chatgpt.command": options.command, "chatgpt.hasCode": String(!!options.code), "chatgpt.hasPreviousAnswer": String(!!options.previousAnswer) }); + + if (!await this.prepareConversation()) { + return; + } + + this.response = ''; + let question = this.processQuestion(prompt, options.code, options.language); + const responseInMarkdown = !this.isCodexModel; + + // If the ChatGPT view is not in focus/visible; focus on it to render Q&A + if (this.webView == null) { + vscode.commands.executeCommand('vscode-chatgpt.view.focus'); + } else { + this.webView?.show?.(true); + } + + this.inProgress = true; + this.abortController = new AbortController(); + this.sendMessage({ type: 'showInProgress', inProgress: this.inProgress, showStopButton: this.useGpt3 }); + this.currentMessageId = this.getRandomId(); + + this.sendMessage({ type: 'addQuestion', value: prompt, code: options.code, autoScroll: this.autoScroll }); + + try { + if (this.useGpt3) { + if (this.isGpt35Model && this.apiGpt35) { + const gpt3Response = await this.apiGpt35.sendMessage(question, { + systemMessage: this.systemContext, + messageId: this.conversationId, + parentMessageId: this.messageId, + abortSignal: this.abortController.signal, + onProgress: (partialResponse) => { + this.response = partialResponse.text; + this.sendMessage({ type: 'addResponse', value: this.response, id: this.currentMessageId, autoScroll: this.autoScroll, responseInMarkdown }); + }, + }); + ({ text: this.response, id: this.conversationId, parentMessageId: this.messageId } = gpt3Response); + } else if (!this.isGpt35Model && this.apiGpt3) { + ({ text: this.response, conversationId: this.conversationId, parentMessageId: this.messageId } = await this.apiGpt3.sendMessage(question, { + promptPrefix: this.systemContext, + abortSignal: this.abortController.signal, + onProgress: (partialResponse) => { + this.response = partialResponse.text; + this.sendMessage({ type: 'addResponse', value: this.response, id: this.currentMessageId, autoScroll: this.autoScroll, responseInMarkdown }); + }, + })); + } + } + + if (options.previousAnswer != null) { + this.response = options.previousAnswer + this.response; + } + + const hasContinuation = ((this.response.split("```").length) % 2) === 0; + + if (hasContinuation) { + this.response = this.response + " \r\n ```\r\n"; + vscode.window.showInformationMessage("It looks like ChatGPT didn't complete their answer for your coding question. You can ask it to continue and combine the answers.", "Continue and combine answers") + .then(async (choice) => { + if (choice === "Continue and combine answers") { + this.sendApiRequest("Continue", { command: options.command, code: undefined, previousAnswer: this.response }); + } + }); + } + + this.sendMessage({ type: 'addResponse', value: this.response, done: true, id: this.currentMessageId, autoScroll: this.autoScroll, responseInMarkdown }); + + if (this.subscribeToResponse) { + vscode.window.showInformationMessage("ChatGPT responded to your question.", "Open conversation").then(async () => { + await vscode.commands.executeCommand('vscode-chatgpt.view.focus'); + }); + } + } catch (error: any) { + let message; + let apiMessage = error?.response?.data?.error?.message || error?.tostring?.() || error?.message || error?.name; + + this.logError("api-request-failed"); + + if (error?.response?.status || error?.response?.statusText) { + message = `${error?.response?.status || ""} ${error?.response?.statusText || ""}`; + + vscode.window.showErrorMessage("An error occured. If this is due to max_token you could try `ChatGPT: Clear Conversation` command and retry sending your prompt.", "Clear conversation and retry").then(async choice => { + if (choice === "Clear conversation and retry") { + await vscode.commands.executeCommand("vscode-chatgpt.clearConversation"); + await delay(250); + this.sendApiRequest(prompt, { command: options.command, code: options.code }); + } + }); + } else if (error.statusCode === 400) { + message = `Your method: '${this.loginMethod}' and your model: '${this.model}' may be incompatible or one of your parameters is unknown. Reset your settings to default. (HTTP 400 Bad Request)`; + + } else if (error.statusCode === 401) { + message = 'Make sure you are properly signed in. If you are using Browser Auto-login method, make sure the browser is open (You could refresh the browser tab manually if you face any issues, too). If you stored your API key in settings.json, make sure it is accurate. If you stored API key in session, you can reset it with `ChatGPT: Reset session` command. (HTTP 401 Unauthorized) Potential reasons: \r\n- 1.Invalid Authentication\r\n- 2.Incorrect API key provided.\r\n- 3.Incorrect Organization provided. \r\n See https://platform.openai.com/docs/guides/error-codes for more details.'; + } else if (error.statusCode === 403) { + message = 'Your token has expired. Please try authenticating again. (HTTP 403 Forbidden)'; + } else if (error.statusCode === 404) { + message = `Your method: '${this.loginMethod}' and your model: '${this.model}' may be incompatible or you may have exhausted your ChatGPT subscription allowance. (HTTP 404 Not Found)`; + } else if (error.statusCode === 429) { + message = "Too many requests try again later. (HTTP 429 Too Many Requests) Potential reasons: \r\n 1. You exceeded your current quota, please check your plan and billing details\r\n 2. You are sending requests too quickly \r\n 3. The engine is currently overloaded, please try again later. \r\n See https://platform.openai.com/docs/guides/error-codes for more details."; + } else if (error.statusCode === 500) { + message = "The server had an error while processing your request, please try again. (HTTP 500 Internal Server Error)\r\n See https://platform.openai.com/docs/guides/error-codes for more details."; + } + + if (apiMessage) { + message = `${message ? message + " " : ""} + + ${apiMessage} +`; + } + + this.sendMessage({ type: 'addError', value: message, autoScroll: this.autoScroll }); + + return; + } finally { + this.inProgress = false; + this.sendMessage({ type: 'showInProgress', inProgress: this.inProgress }); + } + } + + /** + * Message sender, stores if a message cannot be delivered + * @param message Message to be sent to WebView + * @param ignoreMessageIfNullWebView We will ignore the command if webView is null/not-focused + */ + public sendMessage(message: any, ignoreMessageIfNullWebView?: boolean) { + if (this.webView) { + this.webView?.webview.postMessage(message); + } else if (!ignoreMessageIfNullWebView) { + this.leftOverMessage = message; + } + } + + private logEvent(eventName: string, properties?: {}): void { + // You can initialize your telemetry reporter and consume it here - *replaced with console.debug to prevent unwanted telemetry logs + // this.reporter?.sendTelemetryEvent(eventName, { "chatgpt.loginMethod": this.loginMethod!, "chatgpt.authType": this.authType!, "chatgpt.model": this.model || "unknown", ...properties }, { "chatgpt.questionCounter": this.questionCounter }); + console.debug(eventName, { "chatgpt.loginMethod": this.loginMethod!, "chatgpt.authType": this.authType!, "chatgpt.model": this.model || "unknown", ...properties }, { "chatgpt.questionCounter": this.questionCounter }); + } + + private logError(eventName: string): void { + // You can initialize your telemetry reporter and consume it here - *replaced with console.error to prevent unwanted telemetry logs + // this.reporter?.sendTelemetryErrorEvent(eventName, { "chatgpt.loginMethod": this.loginMethod!, "chatgpt.authType": this.authType!, "chatgpt.model": this.model || "unknown" }, { "chatgpt.questionCounter": this.questionCounter }); + console.error(eventName, { "chatgpt.loginMethod": this.loginMethod!, "chatgpt.authType": this.authType!, "chatgpt.model": this.model || "unknown" }, { "chatgpt.questionCounter": this.questionCounter }); + } + + private getWebviewHtml(webview: vscode.Webview) { + const scriptUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'main.js')); + const stylesMainUri = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'main.css')); + + const vendorHighlightCss = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'vendor', 'highlight.min.css')); + const vendorHighlightJs = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'vendor', 'highlight.min.js')); + const vendorMarkedJs = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'vendor', 'marked.min.js')); + const vendorTailwindJs = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'vendor', 'tailwindcss.3.2.4.min.js')); + const vendorTurndownJs = webview.asWebviewUri(vscode.Uri.joinPath(this.context.extensionUri, 'media', 'vendor', 'turndown.js')); + + const nonce = this.getRandomId(); + + return ` + + + + + + + + + + + + + +
    + + +
    + + + + + +
    +
    + +
    + +
    + + + +
    +
    +
    + + + + `; + } + + private getRandomId() { + let text = ''; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + for (let i = 0; i < 32; i++) { + text += possible.charAt(Math.floor(Math.random() * possible.length)); + } + return text; + } +} diff --git a/src/extension.ts b/src/extension.ts new file mode 100644 index 0000000..b18792c --- /dev/null +++ b/src/extension.ts @@ -0,0 +1,184 @@ +import * as vscode from "vscode"; +import ChatGptViewProvider from './chatgpt-view-provider'; + +const menuCommands = ["addTests", "findProblems", "optimize", "explain", "addComments", "completeCode", "generateCode", "customPrompt1", "customPrompt2", "adhoc"]; + +export async function activate(context: vscode.ExtensionContext) { + let adhocCommandPrefix: string = context.globalState.get("chatgpt-adhoc-prompt") || ''; + + const provider = new ChatGptViewProvider(context); + + const view = vscode.window.registerWebviewViewProvider( + "vscode-chatgpt.view", + provider, + { + webviewOptions: { + retainContextWhenHidden: true, + }, + } + ); + + const freeText = vscode.commands.registerCommand("vscode-chatgpt.freeText", async () => { + const value = await vscode.window.showInputBox({ + prompt: "Ask anything...", + }); + + if (value) { + provider?.sendApiRequest(value, { command: "freeText" }); + } + }); + + const resetThread = vscode.commands.registerCommand("vscode-chatgpt.clearConversation", async () => { + provider?.sendMessage({ type: 'clearConversation' }, true); + }); + + const exportConversation = vscode.commands.registerCommand("vscode-chatgpt.exportConversation", async () => { + provider?.sendMessage({ type: 'exportConversation' }, true); + }); + + const clearSession = vscode.commands.registerCommand("vscode-chatgpt.clearSession", () => { + context.globalState.update("chatgpt-session-token", null); + context.globalState.update("chatgpt-clearance-token", null); + context.globalState.update("chatgpt-user-agent", null); + context.globalState.update("chatgpt-gpt3-apiKey", null); + provider?.clearSession(); + }); + + const configChanged = vscode.workspace.onDidChangeConfiguration(e => { + if (e.affectsConfiguration('chatgpt.response.showNotification')) { + provider.subscribeToResponse = vscode.workspace.getConfiguration("chatgpt").get("response.showNotification") || false; + } + + if (e.affectsConfiguration('chatgpt.response.autoScroll')) { + provider.autoScroll = !!vscode.workspace.getConfiguration("chatgpt").get("response.autoScroll"); + } + + if (e.affectsConfiguration('chatgpt.useAutoLogin')) { + provider.useAutoLogin = vscode.workspace.getConfiguration("chatgpt").get("useAutoLogin") || false; + + context.globalState.update("chatgpt-session-token", null); + context.globalState.update("chatgpt-clearance-token", null); + context.globalState.update("chatgpt-user-agent", null); + } + + if (e.affectsConfiguration('chatgpt.chromiumPath')) { + provider.setChromeExecutablePath(); + } + + if (e.affectsConfiguration('chatgpt.profilePath')) { + provider.setProfilePath(); + } + + if (e.affectsConfiguration('chatgpt.proxyServer')) { + provider.setProxyServer(); + } + + if (e.affectsConfiguration('chatgpt.method')) { + provider.setMethod(); + } + + if (e.affectsConfiguration('chatgpt.authenticationType')) { + provider.setAuthType(); + } + + if (e.affectsConfiguration('chatgpt.gpt3.model')) { + provider.model = vscode.workspace.getConfiguration("chatgpt").get("gpt3.model"); + } + + if (e.affectsConfiguration('chatgpt.gpt3.apiBaseUrl') + || e.affectsConfiguration('chatgpt.gpt3.model') + || e.affectsConfiguration('chatgpt.gpt3.organization') + || e.affectsConfiguration('chatgpt.gpt3.maxTokens') + || e.affectsConfiguration('chatgpt.gpt3.temperature') + || e.affectsConfiguration('chatgpt.gpt3.top_p')) { + provider.prepareConversation(true); + } + + if (e.affectsConfiguration('chatgpt.promptPrefix') || e.affectsConfiguration('chatgpt.gpt3.generateCode-enabled') || e.affectsConfiguration('chatgpt.gpt3.model') || e.affectsConfiguration('chatgpt.method')) { + setContext(); + } + }); + + const adhocCommand = vscode.commands.registerCommand("vscode-chatgpt.adhoc", async () => { + const editor = vscode.window.activeTextEditor; + + if (!editor) { + return; + } + + const selection = editor.document.getText(editor.selection); + let dismissed = false; + if (selection) { + await vscode.window + .showInputBox({ + title: "Add prefix to your ad-hoc command", + prompt: "Prefix your code with your custom prompt. i.e. Explain this", + ignoreFocusOut: true, + placeHolder: "Ask anything...", + value: adhocCommandPrefix + }) + .then((value) => { + if (!value) { + dismissed = true; + return; + } + + adhocCommandPrefix = value.trim() || ''; + context.globalState.update("chatgpt-adhoc-prompt", adhocCommandPrefix); + }); + + if (!dismissed && adhocCommandPrefix?.length > 0) { + provider?.sendApiRequest(adhocCommandPrefix, { command: "adhoc", code: selection }); + } + } + }); + + const generateCodeCommand = vscode.commands.registerCommand(`vscode-chatgpt.generateCode`, () => { + const editor = vscode.window.activeTextEditor; + + if (!editor) { + return; + } + + const selection = editor.document.getText(editor.selection); + if (selection) { + provider?.sendApiRequest(selection, { command: "generateCode", language: editor.document.languageId }); + } + }); + + // Skip AdHoc - as it was registered earlier + const registeredCommands = menuCommands.filter(command => command !== "adhoc" && command !== "generateCode").map((command) => vscode.commands.registerCommand(`vscode-chatgpt.${command}`, () => { + const prompt = vscode.workspace.getConfiguration("chatgpt").get(`promptPrefix.${command}`); + const editor = vscode.window.activeTextEditor; + + if (!editor) { + return; + } + + const selection = editor.document.getText(editor.selection); + if (selection && prompt) { + provider?.sendApiRequest(prompt, { command, code: selection, language: editor.document.languageId }); + } + })); + + context.subscriptions.push(view, freeText, resetThread, exportConversation, clearSession, configChanged, adhocCommand, generateCodeCommand, ...registeredCommands); + + const setContext = () => { + menuCommands.forEach(command => { + if (command === "generateCode") { + let generateCodeEnabled = !!vscode.workspace.getConfiguration("chatgpt").get("gpt3.generateCode-enabled"); + const modelName = vscode.workspace.getConfiguration("chatgpt").get("gpt3.model") as string; + const method = vscode.workspace.getConfiguration("chatgpt").get("method") as string; + generateCodeEnabled = generateCodeEnabled && method === "GPT3 OpenAI API Key" && modelName.startsWith("code-"); + vscode.commands.executeCommand('setContext', "generateCode-enabled", generateCodeEnabled); + } else { + const enabled = !!vscode.workspace.getConfiguration("chatgpt.promptPrefix").get(`${command}-enabled`); + vscode.commands.executeCommand('setContext', `${command}-enabled`, enabled); + } + }); + }; + + setContext(); +} + +export function deactivate() { } diff --git a/src/lib.dom.d.ts b/src/lib.dom.d.ts new file mode 100644 index 0000000..769c125 --- /dev/null +++ b/src/lib.dom.d.ts @@ -0,0 +1,18505 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + + + +/// + + +///////////////////////////// +/// Window APIs +///////////////////////////// + +interface AddEventListenerOptions extends EventListenerOptions { + once?: boolean; + passive?: boolean; + signal?: AbortSignal; +} + +interface AesCbcParams extends Algorithm { + iv: BufferSource; +} + +interface AesCtrParams extends Algorithm { + counter: BufferSource; + length: number; +} + +interface AesDerivedKeyParams extends Algorithm { + length: number; +} + +interface AesGcmParams extends Algorithm { + additionalData?: BufferSource; + iv: BufferSource; + tagLength?: number; +} + +interface AesKeyAlgorithm extends KeyAlgorithm { + length: number; +} + +interface AesKeyGenParams extends Algorithm { + length: number; +} + +interface Algorithm { + name: string; +} + +interface AnalyserOptions extends AudioNodeOptions { + fftSize?: number; + maxDecibels?: number; + minDecibels?: number; + smoothingTimeConstant?: number; +} + +interface AnimationEventInit extends EventInit { + animationName?: string; + elapsedTime?: number; + pseudoElement?: string; +} + +interface AnimationPlaybackEventInit extends EventInit { + currentTime?: CSSNumberish | null; + timelineTime?: CSSNumberish | null; +} + +interface AssignedNodesOptions { + flatten?: boolean; +} + +interface AudioBufferOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; +} + +interface AudioBufferSourceOptions { + buffer?: AudioBuffer | null; + detune?: number; + loop?: boolean; + loopEnd?: number; + loopStart?: number; + playbackRate?: number; +} + +interface AudioConfiguration { + bitrate?: number; + channels?: string; + contentType: string; + samplerate?: number; + spatialRendering?: boolean; +} + +interface AudioContextOptions { + latencyHint?: AudioContextLatencyCategory | number; + sampleRate?: number; +} + +interface AudioNodeOptions { + channelCount?: number; + channelCountMode?: ChannelCountMode; + channelInterpretation?: ChannelInterpretation; +} + +interface AudioProcessingEventInit extends EventInit { + inputBuffer: AudioBuffer; + outputBuffer: AudioBuffer; + playbackTime: number; +} + +interface AudioTimestamp { + contextTime?: number; + performanceTime?: DOMHighResTimeStamp; +} + +interface AudioWorkletNodeOptions extends AudioNodeOptions { + numberOfInputs?: number; + numberOfOutputs?: number; + outputChannelCount?: number[]; + parameterData?: Record; + processorOptions?: any; +} + +interface AuthenticationExtensionsClientInputs { + appid?: string; + credProps?: boolean; + hmacCreateSecret?: boolean; +} + +interface AuthenticationExtensionsClientOutputs { + appid?: boolean; + credProps?: CredentialPropertiesOutput; + hmacCreateSecret?: boolean; +} + +interface AuthenticatorSelectionCriteria { + authenticatorAttachment?: AuthenticatorAttachment; + requireResidentKey?: boolean; + residentKey?: ResidentKeyRequirement; + userVerification?: UserVerificationRequirement; +} + +interface BiquadFilterOptions extends AudioNodeOptions { + Q?: number; + detune?: number; + frequency?: number; + gain?: number; + type?: BiquadFilterType; +} + +interface BlobEventInit { + data: Blob; + timecode?: DOMHighResTimeStamp; +} + +interface BlobPropertyBag { + endings?: EndingType; + type?: string; +} + +interface CSSStyleSheetInit { + baseURL?: string; + disabled?: boolean; + media?: MediaList | string; +} + +interface CacheQueryOptions { + ignoreMethod?: boolean; + ignoreSearch?: boolean; + ignoreVary?: boolean; +} + +interface CanvasRenderingContext2DSettings { + alpha?: boolean; + colorSpace?: PredefinedColorSpace; + desynchronized?: boolean; + willReadFrequently?: boolean; +} + +interface ChannelMergerOptions extends AudioNodeOptions { + numberOfInputs?: number; +} + +interface ChannelSplitterOptions extends AudioNodeOptions { + numberOfOutputs?: number; +} + +interface ClientQueryOptions { + includeUncontrolled?: boolean; + type?: ClientTypes; +} + +interface ClipboardEventInit extends EventInit { + clipboardData?: DataTransfer | null; +} + +interface ClipboardItemOptions { + presentationStyle?: PresentationStyle; +} + +interface CloseEventInit extends EventInit { + code?: number; + reason?: string; + wasClean?: boolean; +} + +interface CompositionEventInit extends UIEventInit { + data?: string; +} + +interface ComputedEffectTiming extends EffectTiming { + activeDuration?: CSSNumberish; + currentIteration?: number | null; + endTime?: CSSNumberish; + localTime?: CSSNumberish | null; + progress?: number | null; + startTime?: CSSNumberish; +} + +interface ComputedKeyframe { + composite: CompositeOperationOrAuto; + computedOffset: number; + easing: string; + offset: number | null; + [property: string]: string | number | null | undefined; +} + +interface ConstantSourceOptions { + offset?: number; +} + +interface ConstrainBooleanParameters { + exact?: boolean; + ideal?: boolean; +} + +interface ConstrainDOMStringParameters { + exact?: string | string[]; + ideal?: string | string[]; +} + +interface ConstrainDoubleRange extends DoubleRange { + exact?: number; + ideal?: number; +} + +interface ConstrainULongRange extends ULongRange { + exact?: number; + ideal?: number; +} + +interface ConvolverOptions extends AudioNodeOptions { + buffer?: AudioBuffer | null; + disableNormalization?: boolean; +} + +interface CredentialCreationOptions { + publicKey?: PublicKeyCredentialCreationOptions; + signal?: AbortSignal; +} + +interface CredentialPropertiesOutput { + rk?: boolean; +} + +interface CredentialRequestOptions { + mediation?: CredentialMediationRequirement; + publicKey?: PublicKeyCredentialRequestOptions; + signal?: AbortSignal; +} + +interface CryptoKeyPair { + privateKey: CryptoKey; + publicKey: CryptoKey; +} + +interface CustomEventInit extends EventInit { + detail?: T; +} + +interface DOMMatrix2DInit { + a?: number; + b?: number; + c?: number; + d?: number; + e?: number; + f?: number; + m11?: number; + m12?: number; + m21?: number; + m22?: number; + m41?: number; + m42?: number; +} + +interface DOMMatrixInit extends DOMMatrix2DInit { + is2D?: boolean; + m13?: number; + m14?: number; + m23?: number; + m24?: number; + m31?: number; + m32?: number; + m33?: number; + m34?: number; + m43?: number; + m44?: number; +} + +interface DOMPointInit { + w?: number; + x?: number; + y?: number; + z?: number; +} + +interface DOMQuadInit { + p1?: DOMPointInit; + p2?: DOMPointInit; + p3?: DOMPointInit; + p4?: DOMPointInit; +} + +interface DOMRectInit { + height?: number; + width?: number; + x?: number; + y?: number; +} + +interface DelayOptions extends AudioNodeOptions { + delayTime?: number; + maxDelayTime?: number; +} + +interface DeviceMotionEventAccelerationInit { + x?: number | null; + y?: number | null; + z?: number | null; +} + +interface DeviceMotionEventInit extends EventInit { + acceleration?: DeviceMotionEventAccelerationInit; + accelerationIncludingGravity?: DeviceMotionEventAccelerationInit; + interval?: number; + rotationRate?: DeviceMotionEventRotationRateInit; +} + +interface DeviceMotionEventRotationRateInit { + alpha?: number | null; + beta?: number | null; + gamma?: number | null; +} + +interface DeviceOrientationEventInit extends EventInit { + absolute?: boolean; + alpha?: number | null; + beta?: number | null; + gamma?: number | null; +} + +interface DisplayMediaStreamOptions { + audio?: boolean | MediaTrackConstraints; + video?: boolean | MediaTrackConstraints; +} + +interface DocumentTimelineOptions { + originTime?: DOMHighResTimeStamp; +} + +interface DoubleRange { + max?: number; + min?: number; +} + +interface DragEventInit extends MouseEventInit { + dataTransfer?: DataTransfer | null; +} + +interface DynamicsCompressorOptions extends AudioNodeOptions { + attack?: number; + knee?: number; + ratio?: number; + release?: number; + threshold?: number; +} + +interface EcKeyAlgorithm extends KeyAlgorithm { + namedCurve: NamedCurve; +} + +interface EcKeyGenParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcKeyImportParams extends Algorithm { + namedCurve: NamedCurve; +} + +interface EcdhKeyDeriveParams extends Algorithm { + public: CryptoKey; +} + +interface EcdsaParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface EffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; +} + +interface ElementCreationOptions { + is?: string; +} + +interface ElementDefinitionOptions { + extends?: string; +} + +interface ErrorEventInit extends EventInit { + colno?: number; + error?: any; + filename?: string; + lineno?: number; + message?: string; +} + +interface EventInit { + bubbles?: boolean; + cancelable?: boolean; + composed?: boolean; +} + +interface EventListenerOptions { + capture?: boolean; +} + +interface EventModifierInit extends UIEventInit { + altKey?: boolean; + ctrlKey?: boolean; + metaKey?: boolean; + modifierAltGraph?: boolean; + modifierCapsLock?: boolean; + modifierFn?: boolean; + modifierFnLock?: boolean; + modifierHyper?: boolean; + modifierNumLock?: boolean; + modifierScrollLock?: boolean; + modifierSuper?: boolean; + modifierSymbol?: boolean; + modifierSymbolLock?: boolean; + shiftKey?: boolean; +} + +interface EventSourceInit { + withCredentials?: boolean; +} + +interface FilePropertyBag extends BlobPropertyBag { + lastModified?: number; +} + +interface FileSystemFlags { + create?: boolean; + exclusive?: boolean; +} + +interface FileSystemGetDirectoryOptions { + create?: boolean; +} + +interface FileSystemGetFileOptions { + create?: boolean; +} + +interface FileSystemRemoveOptions { + recursive?: boolean; +} + +interface FocusEventInit extends UIEventInit { + relatedTarget?: EventTarget | null; +} + +interface FocusOptions { + preventScroll?: boolean; +} + +interface FontFaceDescriptors { + display?: string; + featureSettings?: string; + stretch?: string; + style?: string; + unicodeRange?: string; + variant?: string; + weight?: string; +} + +interface FontFaceSetLoadEventInit extends EventInit { + fontfaces?: FontFace[]; +} + +interface FormDataEventInit extends EventInit { + formData: FormData; +} + +interface FullscreenOptions { + navigationUI?: FullscreenNavigationUI; +} + +interface GainOptions extends AudioNodeOptions { + gain?: number; +} + +interface GamepadEventInit extends EventInit { + gamepad: Gamepad; +} + +interface GetAnimationsOptions { + subtree?: boolean; +} + +interface GetNotificationOptions { + tag?: string; +} + +interface GetRootNodeOptions { + composed?: boolean; +} + +interface HashChangeEventInit extends EventInit { + newURL?: string; + oldURL?: string; +} + +interface HkdfParams extends Algorithm { + hash: HashAlgorithmIdentifier; + info: BufferSource; + salt: BufferSource; +} + +interface HmacImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface HmacKeyAlgorithm extends KeyAlgorithm { + hash: KeyAlgorithm; + length: number; +} + +interface HmacKeyGenParams extends Algorithm { + hash: HashAlgorithmIdentifier; + length?: number; +} + +interface IDBDatabaseInfo { + name?: string; + version?: number; +} + +interface IDBIndexParameters { + multiEntry?: boolean; + unique?: boolean; +} + +interface IDBObjectStoreParameters { + autoIncrement?: boolean; + keyPath?: string | string[] | null; +} + +interface IDBTransactionOptions { + durability?: IDBTransactionDurability; +} + +interface IDBVersionChangeEventInit extends EventInit { + newVersion?: number | null; + oldVersion?: number; +} + +interface IIRFilterOptions extends AudioNodeOptions { + feedback: number[]; + feedforward: number[]; +} + +interface IdleRequestOptions { + timeout?: number; +} + +interface ImageBitmapOptions { + colorSpaceConversion?: ColorSpaceConversion; + imageOrientation?: ImageOrientation; + premultiplyAlpha?: PremultiplyAlpha; + resizeHeight?: number; + resizeQuality?: ResizeQuality; + resizeWidth?: number; +} + +interface ImageBitmapRenderingContextSettings { + alpha?: boolean; +} + +interface ImageDataSettings { + colorSpace?: PredefinedColorSpace; +} + +interface ImportMeta { + url: string; +} + +interface InputEventInit extends UIEventInit { + data?: string | null; + dataTransfer?: DataTransfer | null; + inputType?: string; + isComposing?: boolean; + targetRanges?: StaticRange[]; +} + +interface IntersectionObserverEntryInit { + boundingClientRect: DOMRectInit; + intersectionRatio: number; + intersectionRect: DOMRectInit; + isIntersecting: boolean; + rootBounds: DOMRectInit | null; + target: Element; + time: DOMHighResTimeStamp; +} + +interface IntersectionObserverInit { + root?: Element | Document | null; + rootMargin?: string; + threshold?: number | number[]; +} + +interface JsonWebKey { + alg?: string; + crv?: string; + d?: string; + dp?: string; + dq?: string; + e?: string; + ext?: boolean; + k?: string; + key_ops?: string[]; + kty?: string; + n?: string; + oth?: RsaOtherPrimesInfo[]; + p?: string; + q?: string; + qi?: string; + use?: string; + x?: string; + y?: string; +} + +interface KeyAlgorithm { + name: string; +} + +interface KeyboardEventInit extends EventModifierInit { + /** @deprecated */ + charCode?: number; + code?: string; + isComposing?: boolean; + key?: string; + /** @deprecated */ + keyCode?: number; + location?: number; + repeat?: boolean; +} + +interface Keyframe { + composite?: CompositeOperationOrAuto; + easing?: string; + offset?: number | null; + [property: string]: string | number | null | undefined; +} + +interface KeyframeAnimationOptions extends KeyframeEffectOptions { + id?: string; +} + +interface KeyframeEffectOptions extends EffectTiming { + composite?: CompositeOperation; + iterationComposite?: IterationCompositeOperation; + pseudoElement?: string | null; +} + +interface LockInfo { + clientId?: string; + mode?: LockMode; + name?: string; +} + +interface LockManagerSnapshot { + held?: LockInfo[]; + pending?: LockInfo[]; +} + +interface LockOptions { + ifAvailable?: boolean; + mode?: LockMode; + signal?: AbortSignal; + steal?: boolean; +} + +interface MediaCapabilitiesDecodingInfo extends MediaCapabilitiesInfo { + configuration?: MediaDecodingConfiguration; +} + +interface MediaCapabilitiesEncodingInfo extends MediaCapabilitiesInfo { + configuration?: MediaEncodingConfiguration; +} + +interface MediaCapabilitiesInfo { + powerEfficient: boolean; + smooth: boolean; + supported: boolean; +} + +interface MediaConfiguration { + audio?: AudioConfiguration; + video?: VideoConfiguration; +} + +interface MediaDecodingConfiguration extends MediaConfiguration { + type: MediaDecodingType; +} + +interface MediaElementAudioSourceOptions { + mediaElement: HTMLMediaElement; +} + +interface MediaEncodingConfiguration extends MediaConfiguration { + type: MediaEncodingType; +} + +interface MediaEncryptedEventInit extends EventInit { + initData?: ArrayBuffer | null; + initDataType?: string; +} + +interface MediaImage { + sizes?: string; + src: string; + type?: string; +} + +interface MediaKeyMessageEventInit extends EventInit { + message: ArrayBuffer; + messageType: MediaKeyMessageType; +} + +interface MediaKeySystemConfiguration { + audioCapabilities?: MediaKeySystemMediaCapability[]; + distinctiveIdentifier?: MediaKeysRequirement; + initDataTypes?: string[]; + label?: string; + persistentState?: MediaKeysRequirement; + sessionTypes?: string[]; + videoCapabilities?: MediaKeySystemMediaCapability[]; +} + +interface MediaKeySystemMediaCapability { + contentType?: string; + encryptionScheme?: string | null; + robustness?: string; +} + +interface MediaMetadataInit { + album?: string; + artist?: string; + artwork?: MediaImage[]; + title?: string; +} + +interface MediaPositionState { + duration?: number; + playbackRate?: number; + position?: number; +} + +interface MediaQueryListEventInit extends EventInit { + matches?: boolean; + media?: string; +} + +interface MediaRecorderOptions { + audioBitsPerSecond?: number; + bitsPerSecond?: number; + mimeType?: string; + videoBitsPerSecond?: number; +} + +interface MediaSessionActionDetails { + action: MediaSessionAction; + fastSeek?: boolean; + seekOffset?: number; + seekTime?: number; +} + +interface MediaStreamAudioSourceOptions { + mediaStream: MediaStream; +} + +interface MediaStreamConstraints { + audio?: boolean | MediaTrackConstraints; + peerIdentity?: string; + preferCurrentTab?: boolean; + video?: boolean | MediaTrackConstraints; +} + +interface MediaStreamTrackEventInit extends EventInit { + track: MediaStreamTrack; +} + +interface MediaTrackCapabilities { + aspectRatio?: DoubleRange; + autoGainControl?: boolean[]; + channelCount?: ULongRange; + cursor?: string[]; + deviceId?: string; + displaySurface?: string; + echoCancellation?: boolean[]; + facingMode?: string[]; + frameRate?: DoubleRange; + groupId?: string; + height?: ULongRange; + latency?: DoubleRange; + logicalSurface?: boolean; + noiseSuppression?: boolean[]; + resizeMode?: string[]; + sampleRate?: ULongRange; + sampleSize?: ULongRange; + width?: ULongRange; +} + +interface MediaTrackConstraintSet { + aspectRatio?: ConstrainDouble; + autoGainControl?: ConstrainBoolean; + channelCount?: ConstrainULong; + deviceId?: ConstrainDOMString; + echoCancellation?: ConstrainBoolean; + facingMode?: ConstrainDOMString; + frameRate?: ConstrainDouble; + groupId?: ConstrainDOMString; + height?: ConstrainULong; + latency?: ConstrainDouble; + noiseSuppression?: ConstrainBoolean; + sampleRate?: ConstrainULong; + sampleSize?: ConstrainULong; + suppressLocalAudioPlayback?: ConstrainBoolean; + width?: ConstrainULong; +} + +interface MediaTrackConstraints extends MediaTrackConstraintSet { + advanced?: MediaTrackConstraintSet[]; +} + +interface MediaTrackSettings { + aspectRatio?: number; + autoGainControl?: boolean; + deviceId?: string; + echoCancellation?: boolean; + facingMode?: string; + frameRate?: number; + groupId?: string; + height?: number; + noiseSuppression?: boolean; + restrictOwnAudio?: boolean; + sampleRate?: number; + sampleSize?: number; + width?: number; +} + +interface MediaTrackSupportedConstraints { + aspectRatio?: boolean; + autoGainControl?: boolean; + deviceId?: boolean; + echoCancellation?: boolean; + facingMode?: boolean; + frameRate?: boolean; + groupId?: boolean; + height?: boolean; + noiseSuppression?: boolean; + sampleRate?: boolean; + sampleSize?: boolean; + suppressLocalAudioPlayback?: boolean; + width?: boolean; +} + +interface MessageEventInit extends EventInit { + data?: T; + lastEventId?: string; + origin?: string; + ports?: MessagePort[]; + source?: MessageEventSource | null; +} + +interface MouseEventInit extends EventModifierInit { + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + movementX?: number; + movementY?: number; + relatedTarget?: EventTarget | null; + screenX?: number; + screenY?: number; +} + +interface MultiCacheQueryOptions extends CacheQueryOptions { + cacheName?: string; +} + +interface MutationObserverInit { + /** Set to a list of attribute local names (without namespace) if not all attribute mutations need to be observed and attributes is true or omitted. */ + attributeFilter?: string[]; + /** Set to true if attributes is true or omitted and target's attribute value before the mutation needs to be recorded. */ + attributeOldValue?: boolean; + /** Set to true if mutations to target's attributes are to be observed. Can be omitted if attributeOldValue or attributeFilter is specified. */ + attributes?: boolean; + /** Set to true if mutations to target's data are to be observed. Can be omitted if characterDataOldValue is specified. */ + characterData?: boolean; + /** Set to true if characterData is set to true or omitted and target's data before the mutation needs to be recorded. */ + characterDataOldValue?: boolean; + /** Set to true if mutations to target's children are to be observed. */ + childList?: boolean; + /** Set to true if mutations to not just target, but also target's descendants are to be observed. */ + subtree?: boolean; +} + +interface NavigationPreloadState { + enabled?: boolean; + headerValue?: string; +} + +interface NotificationAction { + action: string; + icon?: string; + title: string; +} + +interface NotificationOptions { + actions?: NotificationAction[]; + badge?: string; + body?: string; + data?: any; + dir?: NotificationDirection; + icon?: string; + image?: string; + lang?: string; + renotify?: boolean; + requireInteraction?: boolean; + silent?: boolean; + tag?: string; + timestamp?: EpochTimeStamp; + vibrate?: VibratePattern; +} + +interface OfflineAudioCompletionEventInit extends EventInit { + renderedBuffer: AudioBuffer; +} + +interface OfflineAudioContextOptions { + length: number; + numberOfChannels?: number; + sampleRate: number; +} + +interface OptionalEffectTiming { + delay?: number; + direction?: PlaybackDirection; + duration?: number | string; + easing?: string; + endDelay?: number; + fill?: FillMode; + iterationStart?: number; + iterations?: number; + playbackRate?: number; +} + +interface OscillatorOptions extends AudioNodeOptions { + detune?: number; + frequency?: number; + periodicWave?: PeriodicWave; + type?: OscillatorType; +} + +interface PageTransitionEventInit extends EventInit { + persisted?: boolean; +} + +interface PannerOptions extends AudioNodeOptions { + coneInnerAngle?: number; + coneOuterAngle?: number; + coneOuterGain?: number; + distanceModel?: DistanceModelType; + maxDistance?: number; + orientationX?: number; + orientationY?: number; + orientationZ?: number; + panningModel?: PanningModelType; + positionX?: number; + positionY?: number; + positionZ?: number; + refDistance?: number; + rolloffFactor?: number; +} + +interface PaymentCurrencyAmount { + currency: string; + value: string; +} + +interface PaymentDetailsBase { + displayItems?: PaymentItem[]; + modifiers?: PaymentDetailsModifier[]; +} + +interface PaymentDetailsInit extends PaymentDetailsBase { + id?: string; + total: PaymentItem; +} + +interface PaymentDetailsModifier { + additionalDisplayItems?: PaymentItem[]; + data?: any; + supportedMethods: string; + total?: PaymentItem; +} + +interface PaymentDetailsUpdate extends PaymentDetailsBase { + paymentMethodErrors?: any; + total?: PaymentItem; +} + +interface PaymentItem { + amount: PaymentCurrencyAmount; + label: string; + pending?: boolean; +} + +interface PaymentMethodChangeEventInit extends PaymentRequestUpdateEventInit { + methodDetails?: any; + methodName?: string; +} + +interface PaymentMethodData { + data?: any; + supportedMethods: string; +} + +interface PaymentRequestUpdateEventInit extends EventInit { +} + +interface PaymentValidationErrors { + error?: string; + paymentMethod?: any; +} + +interface Pbkdf2Params extends Algorithm { + hash: HashAlgorithmIdentifier; + iterations: number; + salt: BufferSource; +} + +interface PerformanceMarkOptions { + detail?: any; + startTime?: DOMHighResTimeStamp; +} + +interface PerformanceMeasureOptions { + detail?: any; + duration?: DOMHighResTimeStamp; + end?: string | DOMHighResTimeStamp; + start?: string | DOMHighResTimeStamp; +} + +interface PerformanceObserverInit { + buffered?: boolean; + entryTypes?: string[]; + type?: string; +} + +interface PeriodicWaveConstraints { + disableNormalization?: boolean; +} + +interface PeriodicWaveOptions extends PeriodicWaveConstraints { + imag?: number[] | Float32Array; + real?: number[] | Float32Array; +} + +interface PermissionDescriptor { + name: PermissionName; +} + +interface PictureInPictureEventInit extends EventInit { + pictureInPictureWindow: PictureInPictureWindow; +} + +interface PointerEventInit extends MouseEventInit { + coalescedEvents?: PointerEvent[]; + height?: number; + isPrimary?: boolean; + pointerId?: number; + pointerType?: string; + predictedEvents?: PointerEvent[]; + pressure?: number; + tangentialPressure?: number; + tiltX?: number; + tiltY?: number; + twist?: number; + width?: number; +} + +interface PopStateEventInit extends EventInit { + state?: any; +} + +interface PositionOptions { + enableHighAccuracy?: boolean; + maximumAge?: number; + timeout?: number; +} + +interface ProgressEventInit extends EventInit { + lengthComputable?: boolean; + loaded?: number; + total?: number; +} + +interface PromiseRejectionEventInit extends EventInit { + promise: Promise; + reason?: any; +} + +interface PropertyIndexedKeyframes { + composite?: CompositeOperationOrAuto | CompositeOperationOrAuto[]; + easing?: string | string[]; + offset?: number | (number | null)[]; + [property: string]: string | string[] | number | null | (number | null)[] | undefined; +} + +interface PublicKeyCredentialCreationOptions { + attestation?: AttestationConveyancePreference; + authenticatorSelection?: AuthenticatorSelectionCriteria; + challenge: BufferSource; + excludeCredentials?: PublicKeyCredentialDescriptor[]; + extensions?: AuthenticationExtensionsClientInputs; + pubKeyCredParams: PublicKeyCredentialParameters[]; + rp: PublicKeyCredentialRpEntity; + timeout?: number; + user: PublicKeyCredentialUserEntity; +} + +interface PublicKeyCredentialDescriptor { + id: BufferSource; + transports?: AuthenticatorTransport[]; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialEntity { + name: string; +} + +interface PublicKeyCredentialParameters { + alg: COSEAlgorithmIdentifier; + type: PublicKeyCredentialType; +} + +interface PublicKeyCredentialRequestOptions { + allowCredentials?: PublicKeyCredentialDescriptor[]; + challenge: BufferSource; + extensions?: AuthenticationExtensionsClientInputs; + rpId?: string; + timeout?: number; + userVerification?: UserVerificationRequirement; +} + +interface PublicKeyCredentialRpEntity extends PublicKeyCredentialEntity { + id?: string; +} + +interface PublicKeyCredentialUserEntity extends PublicKeyCredentialEntity { + displayName: string; + id: BufferSource; +} + +interface PushSubscriptionJSON { + endpoint?: string; + expirationTime?: EpochTimeStamp | null; + keys?: Record; +} + +interface PushSubscriptionOptionsInit { + applicationServerKey?: BufferSource | string | null; + userVisibleOnly?: boolean; +} + +interface QueuingStrategy { + highWaterMark?: number; + size?: QueuingStrategySize; +} + +interface QueuingStrategyInit { + /** + * Creates a new ByteLengthQueuingStrategy with the provided high water mark. + * + * Note that the provided high water mark will not be validated ahead of time. Instead, if it is negative, NaN, or not a number, the resulting ByteLengthQueuingStrategy will cause the corresponding stream constructor to throw. + */ + highWaterMark: number; +} + +interface RTCAnswerOptions extends RTCOfferAnswerOptions { +} + +interface RTCCertificateExpiration { + expires?: number; +} + +interface RTCConfiguration { + bundlePolicy?: RTCBundlePolicy; + certificates?: RTCCertificate[]; + iceCandidatePoolSize?: number; + iceServers?: RTCIceServer[]; + iceTransportPolicy?: RTCIceTransportPolicy; + rtcpMuxPolicy?: RTCRtcpMuxPolicy; +} + +interface RTCDTMFToneChangeEventInit extends EventInit { + tone?: string; +} + +interface RTCDataChannelEventInit extends EventInit { + channel: RTCDataChannel; +} + +interface RTCDataChannelInit { + id?: number; + maxPacketLifeTime?: number; + maxRetransmits?: number; + negotiated?: boolean; + ordered?: boolean; + protocol?: string; +} + +interface RTCDtlsFingerprint { + algorithm?: string; + value?: string; +} + +interface RTCEncodedAudioFrameMetadata { + contributingSources?: number[]; + synchronizationSource?: number; +} + +interface RTCEncodedVideoFrameMetadata { + contributingSources?: number[]; + dependencies?: number[]; + frameId?: number; + height?: number; + spatialIndex?: number; + synchronizationSource?: number; + temporalIndex?: number; + width?: number; +} + +interface RTCErrorEventInit extends EventInit { + error: RTCError; +} + +interface RTCErrorInit { + errorDetail: RTCErrorDetailType; + httpRequestStatusCode?: number; + receivedAlert?: number; + sctpCauseCode?: number; + sdpLineNumber?: number; + sentAlert?: number; +} + +interface RTCIceCandidateInit { + candidate?: string; + sdpMLineIndex?: number | null; + sdpMid?: string | null; + usernameFragment?: string | null; +} + +interface RTCIceCandidatePairStats extends RTCStats { + availableIncomingBitrate?: number; + availableOutgoingBitrate?: number; + bytesReceived?: number; + bytesSent?: number; + currentRoundTripTime?: number; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + lastPacketSentTimestamp?: DOMHighResTimeStamp; + localCandidateId: string; + nominated?: boolean; + remoteCandidateId: string; + requestsReceived?: number; + requestsSent?: number; + responsesReceived?: number; + responsesSent?: number; + state: RTCStatsIceCandidatePairState; + totalRoundTripTime?: number; + transportId: string; +} + +interface RTCIceServer { + credential?: string; + urls: string | string[]; + username?: string; +} + +interface RTCInboundRtpStreamStats extends RTCReceivedRtpStreamStats { + audioLevel?: number; + bytesReceived?: number; + concealedSamples?: number; + concealmentEvents?: number; + decoderImplementation?: string; + estimatedPlayoutTimestamp?: DOMHighResTimeStamp; + fecPacketsDiscarded?: number; + fecPacketsReceived?: number; + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesDecoded?: number; + framesDropped?: number; + framesPerSecond?: number; + framesReceived?: number; + headerBytesReceived?: number; + insertedSamplesForDeceleration?: number; + jitterBufferDelay?: number; + jitterBufferEmittedCount?: number; + keyFramesDecoded?: number; + kind: string; + lastPacketReceivedTimestamp?: DOMHighResTimeStamp; + nackCount?: number; + packetsDiscarded?: number; + pliCount?: number; + qpSum?: number; + remoteId?: string; + removedSamplesForAcceleration?: number; + silentConcealedSamples?: number; + totalAudioEnergy?: number; + totalDecodeTime?: number; + totalInterFrameDelay?: number; + totalProcessingDelay?: number; + totalSamplesDuration?: number; + totalSamplesReceived?: number; + totalSquaredInterFrameDelay?: number; +} + +interface RTCLocalSessionDescriptionInit { + sdp?: string; + type?: RTCSdpType; +} + +interface RTCOfferAnswerOptions { +} + +interface RTCOfferOptions extends RTCOfferAnswerOptions { + iceRestart?: boolean; + offerToReceiveAudio?: boolean; + offerToReceiveVideo?: boolean; +} + +interface RTCOutboundRtpStreamStats extends RTCSentRtpStreamStats { + firCount?: number; + frameHeight?: number; + frameWidth?: number; + framesEncoded?: number; + framesPerSecond?: number; + framesSent?: number; + headerBytesSent?: number; + hugeFramesSent?: number; + keyFramesEncoded?: number; + mediaSourceId?: string; + nackCount?: number; + pliCount?: number; + qpSum?: number; + qualityLimitationResolutionChanges?: number; + remoteId?: string; + retransmittedBytesSent?: number; + retransmittedPacketsSent?: number; + rid?: string; + targetBitrate?: number; + totalEncodeTime?: number; + totalEncodedBytesTarget?: number; + totalPacketSendDelay?: number; +} + +interface RTCPeerConnectionIceErrorEventInit extends EventInit { + address?: string | null; + errorCode: number; + errorText?: string; + port?: number | null; + url?: string; +} + +interface RTCPeerConnectionIceEventInit extends EventInit { + candidate?: RTCIceCandidate | null; + url?: string | null; +} + +interface RTCReceivedRtpStreamStats extends RTCRtpStreamStats { + jitter?: number; + packetsLost?: number; + packetsReceived?: number; +} + +interface RTCRtcpParameters { + cname?: string; + reducedSize?: boolean; +} + +interface RTCRtpCapabilities { + codecs: RTCRtpCodecCapability[]; + headerExtensions: RTCRtpHeaderExtensionCapability[]; +} + +interface RTCRtpCodecCapability { + channels?: number; + clockRate: number; + mimeType: string; + sdpFmtpLine?: string; +} + +interface RTCRtpCodecParameters { + channels?: number; + clockRate: number; + mimeType: string; + payloadType: number; + sdpFmtpLine?: string; +} + +interface RTCRtpCodingParameters { + rid?: string; +} + +interface RTCRtpContributingSource { + audioLevel?: number; + rtpTimestamp: number; + source: number; + timestamp: DOMHighResTimeStamp; +} + +interface RTCRtpEncodingParameters extends RTCRtpCodingParameters { + active?: boolean; + maxBitrate?: number; + maxFramerate?: number; + networkPriority?: RTCPriorityType; + priority?: RTCPriorityType; + scaleResolutionDownBy?: number; +} + +interface RTCRtpHeaderExtensionCapability { + uri?: string; +} + +interface RTCRtpHeaderExtensionParameters { + encrypted?: boolean; + id: number; + uri: string; +} + +interface RTCRtpParameters { + codecs: RTCRtpCodecParameters[]; + headerExtensions: RTCRtpHeaderExtensionParameters[]; + rtcp: RTCRtcpParameters; +} + +interface RTCRtpReceiveParameters extends RTCRtpParameters { +} + +interface RTCRtpSendParameters extends RTCRtpParameters { + degradationPreference?: RTCDegradationPreference; + encodings: RTCRtpEncodingParameters[]; + transactionId: string; +} + +interface RTCRtpStreamStats extends RTCStats { + codecId?: string; + kind: string; + ssrc: number; + transportId?: string; +} + +interface RTCRtpSynchronizationSource extends RTCRtpContributingSource { +} + +interface RTCRtpTransceiverInit { + direction?: RTCRtpTransceiverDirection; + sendEncodings?: RTCRtpEncodingParameters[]; + streams?: MediaStream[]; +} + +interface RTCSentRtpStreamStats extends RTCRtpStreamStats { + bytesSent?: number; + packetsSent?: number; +} + +interface RTCSessionDescriptionInit { + sdp?: string; + type: RTCSdpType; +} + +interface RTCStats { + id: string; + timestamp: DOMHighResTimeStamp; + type: RTCStatsType; +} + +interface RTCTrackEventInit extends EventInit { + receiver: RTCRtpReceiver; + streams?: MediaStream[]; + track: MediaStreamTrack; + transceiver: RTCRtpTransceiver; +} + +interface RTCTransportStats extends RTCStats { + bytesReceived?: number; + bytesSent?: number; + dtlsCipher?: string; + dtlsState: RTCDtlsTransportState; + localCertificateId?: string; + remoteCertificateId?: string; + selectedCandidatePairId?: string; + srtpCipher?: string; + tlsVersion?: string; +} + +interface ReadableStreamGetReaderOptions { + /** + * Creates a ReadableStreamBYOBReader and locks the stream to the new reader. + * + * This call behaves the same way as the no-argument variant, except that it only works on readable byte streams, i.e. streams which were constructed specifically with the ability to handle "bring your own buffer" reading. The returned BYOB reader provides the ability to directly read individual chunks from the stream via its read() method, into developer-supplied buffers, allowing more precise control over allocation. + */ + mode?: ReadableStreamReaderMode; +} + +interface ReadableStreamReadDoneResult { + done: true; + value?: T; +} + +interface ReadableStreamReadValueResult { + done: false; + value: T; +} + +interface ReadableWritablePair { + readable: ReadableStream; + /** + * Provides a convenient, chainable way of piping this readable stream through a transform stream (or any other { writable, readable } pair). It simply pipes the stream into the writable side of the supplied pair, and returns the readable side for further use. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + */ + writable: WritableStream; +} + +interface RegistrationOptions { + scope?: string; + type?: WorkerType; + updateViaCache?: ServiceWorkerUpdateViaCache; +} + +interface RequestInit { + /** A BodyInit object or null to set request's body. */ + body?: BodyInit | null; + /** A string indicating how the request will interact with the browser's cache to set request's cache. */ + cache?: RequestCache; + /** A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request's credentials. */ + credentials?: RequestCredentials; + /** A Headers object, an object literal, or an array of two-item arrays to set request's headers. */ + headers?: HeadersInit; + /** A cryptographic hash of the resource to be fetched by request. Sets request's integrity. */ + integrity?: string; + /** A boolean to set request's keepalive. */ + keepalive?: boolean; + /** A string to set request's method. */ + method?: string; + /** A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request's mode. */ + mode?: RequestMode; + /** A string indicating whether request follows redirects, results in an error upon encountering a redirect, or returns the redirect (in an opaque fashion). Sets request's redirect. */ + redirect?: RequestRedirect; + /** A string whose value is a same-origin URL, "about:client", or the empty string, to set request's referrer. */ + referrer?: string; + /** A referrer policy to set request's referrerPolicy. */ + referrerPolicy?: ReferrerPolicy; + /** An AbortSignal to set request's signal. */ + signal?: AbortSignal | null; + /** Can only be null. Used to disassociate request from any Window. */ + window?: null; +} + +interface ResizeObserverOptions { + box?: ResizeObserverBoxOptions; +} + +interface ResponseInit { + headers?: HeadersInit; + status?: number; + statusText?: string; +} + +interface RsaHashedImportParams extends Algorithm { + hash: HashAlgorithmIdentifier; +} + +interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm { + hash: KeyAlgorithm; +} + +interface RsaHashedKeyGenParams extends RsaKeyGenParams { + hash: HashAlgorithmIdentifier; +} + +interface RsaKeyAlgorithm extends KeyAlgorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaKeyGenParams extends Algorithm { + modulusLength: number; + publicExponent: BigInteger; +} + +interface RsaOaepParams extends Algorithm { + label?: BufferSource; +} + +interface RsaOtherPrimesInfo { + d?: string; + r?: string; + t?: string; +} + +interface RsaPssParams extends Algorithm { + saltLength: number; +} + +interface SVGBoundingBoxOptions { + clipped?: boolean; + fill?: boolean; + markers?: boolean; + stroke?: boolean; +} + +interface ScrollIntoViewOptions extends ScrollOptions { + block?: ScrollLogicalPosition; + inline?: ScrollLogicalPosition; +} + +interface ScrollOptions { + behavior?: ScrollBehavior; +} + +interface ScrollToOptions extends ScrollOptions { + left?: number; + top?: number; +} + +interface SecurityPolicyViolationEventInit extends EventInit { + blockedURI?: string; + columnNumber?: number; + disposition: SecurityPolicyViolationEventDisposition; + documentURI: string; + effectiveDirective: string; + lineNumber?: number; + originalPolicy: string; + referrer?: string; + sample?: string; + sourceFile?: string; + statusCode: number; + violatedDirective: string; +} + +interface ShadowRootInit { + delegatesFocus?: boolean; + mode: ShadowRootMode; + slotAssignment?: SlotAssignmentMode; +} + +interface ShareData { + files?: File[]; + text?: string; + title?: string; + url?: string; +} + +interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit { + error: SpeechSynthesisErrorCode; +} + +interface SpeechSynthesisEventInit extends EventInit { + charIndex?: number; + charLength?: number; + elapsedTime?: number; + name?: string; + utterance: SpeechSynthesisUtterance; +} + +interface StaticRangeInit { + endContainer: Node; + endOffset: number; + startContainer: Node; + startOffset: number; +} + +interface StereoPannerOptions extends AudioNodeOptions { + pan?: number; +} + +interface StorageEstimate { + quota?: number; + usage?: number; +} + +interface StorageEventInit extends EventInit { + key?: string | null; + newValue?: string | null; + oldValue?: string | null; + storageArea?: Storage | null; + url?: string; +} + +interface StreamPipeOptions { + preventAbort?: boolean; + preventCancel?: boolean; + /** + * Pipes this readable stream to a given writable stream destination. The way in which the piping process behaves under various error conditions can be customized with a number of passed options. It returns a promise that fulfills when the piping process completes successfully, or rejects if any errors were encountered. + * + * Piping a stream will lock it for the duration of the pipe, preventing any other consumer from acquiring a reader. + * + * Errors and closures of the source and destination streams propagate as follows: + * + * An error in this source readable stream will abort destination, unless preventAbort is truthy. The returned promise will be rejected with the source's error, or with any error that occurs during aborting the destination. + * + * An error in destination will cancel this source readable stream, unless preventCancel is truthy. The returned promise will be rejected with the destination's error, or with any error that occurs during canceling the source. + * + * When this source readable stream closes, destination will be closed, unless preventClose is truthy. The returned promise will be fulfilled once this process completes, unless an error is encountered while closing the destination, in which case it will be rejected with that error. + * + * If destination starts out closed or closing, this source readable stream will be canceled, unless preventCancel is true. The returned promise will be rejected with an error indicating piping to a closed stream failed, or with any error that occurs during canceling the source. + * + * The signal option can be set to an AbortSignal to allow aborting an ongoing pipe operation via the corresponding AbortController. In this case, this source readable stream will be canceled, and destination aborted, unless the respective options preventCancel or preventAbort are set. + */ + preventClose?: boolean; + signal?: AbortSignal; +} + +interface StructuredSerializeOptions { + transfer?: Transferable[]; +} + +interface SubmitEventInit extends EventInit { + submitter?: HTMLElement | null; +} + +interface TextDecodeOptions { + stream?: boolean; +} + +interface TextDecoderOptions { + fatal?: boolean; + ignoreBOM?: boolean; +} + +interface TextEncoderEncodeIntoResult { + read?: number; + written?: number; +} + +interface TouchEventInit extends EventModifierInit { + changedTouches?: Touch[]; + targetTouches?: Touch[]; + touches?: Touch[]; +} + +interface TouchInit { + altitudeAngle?: number; + azimuthAngle?: number; + clientX?: number; + clientY?: number; + force?: number; + identifier: number; + pageX?: number; + pageY?: number; + radiusX?: number; + radiusY?: number; + rotationAngle?: number; + screenX?: number; + screenY?: number; + target: EventTarget; + touchType?: TouchType; +} + +interface TrackEventInit extends EventInit { + track?: TextTrack | null; +} + +interface Transformer { + flush?: TransformerFlushCallback; + readableType?: undefined; + start?: TransformerStartCallback; + transform?: TransformerTransformCallback; + writableType?: undefined; +} + +interface TransitionEventInit extends EventInit { + elapsedTime?: number; + propertyName?: string; + pseudoElement?: string; +} + +interface UIEventInit extends EventInit { + detail?: number; + view?: Window | null; + /** @deprecated */ + which?: number; +} + +interface ULongRange { + max?: number; + min?: number; +} + +interface UnderlyingByteSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableByteStreamController) => void | PromiseLike; + start?: (controller: ReadableByteStreamController) => any; + type: "bytes"; +} + +interface UnderlyingDefaultSource { + cancel?: UnderlyingSourceCancelCallback; + pull?: (controller: ReadableStreamDefaultController) => void | PromiseLike; + start?: (controller: ReadableStreamDefaultController) => any; + type?: undefined; +} + +interface UnderlyingSink { + abort?: UnderlyingSinkAbortCallback; + close?: UnderlyingSinkCloseCallback; + start?: UnderlyingSinkStartCallback; + type?: undefined; + write?: UnderlyingSinkWriteCallback; +} + +interface UnderlyingSource { + autoAllocateChunkSize?: number; + cancel?: UnderlyingSourceCancelCallback; + pull?: UnderlyingSourcePullCallback; + start?: UnderlyingSourceStartCallback; + type?: ReadableStreamType; +} + +interface ValidityStateFlags { + badInput?: boolean; + customError?: boolean; + patternMismatch?: boolean; + rangeOverflow?: boolean; + rangeUnderflow?: boolean; + stepMismatch?: boolean; + tooLong?: boolean; + tooShort?: boolean; + typeMismatch?: boolean; + valueMissing?: boolean; +} + +interface VideoColorSpaceInit { + fullRange?: boolean | null; + matrix?: VideoMatrixCoefficients | null; + primaries?: VideoColorPrimaries | null; + transfer?: VideoTransferCharacteristics | null; +} + +interface VideoConfiguration { + bitrate: number; + colorGamut?: ColorGamut; + contentType: string; + framerate: number; + hdrMetadataType?: HdrMetadataType; + height: number; + scalabilityMode?: string; + transferFunction?: TransferFunction; + width: number; +} + +interface VideoFrameCallbackMetadata { + captureTime?: DOMHighResTimeStamp; + expectedDisplayTime: DOMHighResTimeStamp; + height: number; + mediaTime: number; + presentationTime: DOMHighResTimeStamp; + presentedFrames: number; + processingDuration?: number; + receiveTime?: DOMHighResTimeStamp; + rtpTimestamp?: number; + width: number; +} + +interface WaveShaperOptions extends AudioNodeOptions { + curve?: number[] | Float32Array; + oversample?: OverSampleType; +} + +interface WebGLContextAttributes { + alpha?: boolean; + antialias?: boolean; + depth?: boolean; + desynchronized?: boolean; + failIfMajorPerformanceCaveat?: boolean; + powerPreference?: WebGLPowerPreference; + premultipliedAlpha?: boolean; + preserveDrawingBuffer?: boolean; + stencil?: boolean; +} + +interface WebGLContextEventInit extends EventInit { + statusMessage?: string; +} + +interface WheelEventInit extends MouseEventInit { + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; +} + +interface WindowPostMessageOptions extends StructuredSerializeOptions { + targetOrigin?: string; +} + +interface WorkerOptions { + credentials?: RequestCredentials; + name?: string; + type?: WorkerType; +} + +interface WorkletOptions { + credentials?: RequestCredentials; +} + +type NodeFilter = ((node: Node) => number) | { acceptNode(node: Node): number; }; + +declare var NodeFilter: { + readonly FILTER_ACCEPT: number; + readonly FILTER_REJECT: number; + readonly FILTER_SKIP: number; + readonly SHOW_ALL: number; + readonly SHOW_ATTRIBUTE: number; + readonly SHOW_CDATA_SECTION: number; + readonly SHOW_COMMENT: number; + readonly SHOW_DOCUMENT: number; + readonly SHOW_DOCUMENT_FRAGMENT: number; + readonly SHOW_DOCUMENT_TYPE: number; + readonly SHOW_ELEMENT: number; + readonly SHOW_ENTITY: number; + readonly SHOW_ENTITY_REFERENCE: number; + readonly SHOW_NOTATION: number; + readonly SHOW_PROCESSING_INSTRUCTION: number; + readonly SHOW_TEXT: number; +}; + +type XPathNSResolver = ((prefix: string | null) => string | null) | { lookupNamespaceURI(prefix: string | null): string | null; }; + +/** The ANGLE_instanced_arrays extension is part of the WebGL API and allows to draw the same object, or groups of similar objects multiple times, if they share the same vertex data, primitive count and type. */ +interface ANGLE_instanced_arrays { + drawArraysInstancedANGLE(mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei): void; + drawElementsInstancedANGLE(mode: GLenum, count: GLsizei, type: GLenum, offset: GLintptr, primcount: GLsizei): void; + vertexAttribDivisorANGLE(index: GLuint, divisor: GLuint): void; + readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: GLenum; +} + +interface ARIAMixin { + ariaAtomic: string | null; + ariaAutoComplete: string | null; + ariaBusy: string | null; + ariaChecked: string | null; + ariaColCount: string | null; + ariaColIndex: string | null; + ariaColIndexText: string | null; + ariaColSpan: string | null; + ariaCurrent: string | null; + ariaDisabled: string | null; + ariaExpanded: string | null; + ariaHasPopup: string | null; + ariaHidden: string | null; + ariaInvalid: string | null; + ariaKeyShortcuts: string | null; + ariaLabel: string | null; + ariaLevel: string | null; + ariaLive: string | null; + ariaModal: string | null; + ariaMultiLine: string | null; + ariaMultiSelectable: string | null; + ariaOrientation: string | null; + ariaPlaceholder: string | null; + ariaPosInSet: string | null; + ariaPressed: string | null; + ariaReadOnly: string | null; + ariaRequired: string | null; + ariaRoleDescription: string | null; + ariaRowCount: string | null; + ariaRowIndex: string | null; + ariaRowIndexText: string | null; + ariaRowSpan: string | null; + ariaSelected: string | null; + ariaSetSize: string | null; + ariaSort: string | null; + ariaValueMax: string | null; + ariaValueMin: string | null; + ariaValueNow: string | null; + ariaValueText: string | null; + role: string | null; +} + +/** A controller object that allows you to abort one or more DOM requests as and when desired. */ +interface AbortController { + /** Returns the AbortSignal object associated with this object. */ + readonly signal: AbortSignal; + /** Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted. */ + abort(reason?: any): void; +} + +declare var AbortController: { + prototype: AbortController; + new(): AbortController; +}; + +interface AbortSignalEventMap { + "abort": Event; +} + +/** A signal object that allows you to communicate with a DOM request (such as a Fetch) and abort it if required via an AbortController object. */ +interface AbortSignal extends EventTarget { + /** Returns true if this AbortSignal's AbortController has signaled to abort, and false otherwise. */ + readonly aborted: boolean; + onabort: ((this: AbortSignal, ev: Event) => any) | null; + readonly reason: any; + throwIfAborted(): void; + addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AbortSignal: { + prototype: AbortSignal; + new(): AbortSignal; + abort(reason?: any): AbortSignal; + timeout(milliseconds: number): AbortSignal; +}; + +interface AbstractRange { + /** Returns true if range is collapsed, and false otherwise. */ + readonly collapsed: boolean; + /** Returns range's end node. */ + readonly endContainer: Node; + /** Returns range's end offset. */ + readonly endOffset: number; + /** Returns range's start node. */ + readonly startContainer: Node; + /** Returns range's start offset. */ + readonly startOffset: number; +} + +declare var AbstractRange: { + prototype: AbstractRange; + new(): AbstractRange; +}; + +interface AbstractWorkerEventMap { + "error": ErrorEvent; +} + +interface AbstractWorker { + onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null; + addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +/** A node able to provide real-time frequency and time-domain analysis information. It is an AudioNode that passes the audio stream unchanged from the input to the output, but allows you to take the generated data, process it, and create audio visualizations. */ +interface AnalyserNode extends AudioNode { + fftSize: number; + readonly frequencyBinCount: number; + maxDecibels: number; + minDecibels: number; + smoothingTimeConstant: number; + getByteFrequencyData(array: Uint8Array): void; + getByteTimeDomainData(array: Uint8Array): void; + getFloatFrequencyData(array: Float32Array): void; + getFloatTimeDomainData(array: Float32Array): void; +} + +declare var AnalyserNode: { + prototype: AnalyserNode; + new(context: BaseAudioContext, options?: AnalyserOptions): AnalyserNode; +}; + +interface Animatable { + animate(keyframes: Keyframe[] | PropertyIndexedKeyframes | null, options?: number | KeyframeAnimationOptions): Animation; + getAnimations(options?: GetAnimationsOptions): Animation[]; +} + +interface AnimationEventMap { + "cancel": AnimationPlaybackEvent; + "finish": AnimationPlaybackEvent; + "remove": Event; +} + +interface Animation extends EventTarget { + currentTime: CSSNumberish | null; + effect: AnimationEffect | null; + readonly finished: Promise; + id: string; + oncancel: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; + onfinish: ((this: Animation, ev: AnimationPlaybackEvent) => any) | null; + onremove: ((this: Animation, ev: Event) => any) | null; + readonly pending: boolean; + readonly playState: AnimationPlayState; + playbackRate: number; + readonly ready: Promise; + readonly replaceState: AnimationReplaceState; + startTime: CSSNumberish | null; + timeline: AnimationTimeline | null; + cancel(): void; + commitStyles(): void; + finish(): void; + pause(): void; + persist(): void; + play(): void; + reverse(): void; + updatePlaybackRate(playbackRate: number): void; + addEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Animation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Animation: { + prototype: Animation; + new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; +}; + +interface AnimationEffect { + getComputedTiming(): ComputedEffectTiming; + getTiming(): EffectTiming; + updateTiming(timing?: OptionalEffectTiming): void; +} + +declare var AnimationEffect: { + prototype: AnimationEffect; + new(): AnimationEffect; +}; + +/** Events providing information related to animations. */ +interface AnimationEvent extends Event { + readonly animationName: string; + readonly elapsedTime: number; + readonly pseudoElement: string; +} + +declare var AnimationEvent: { + prototype: AnimationEvent; + new(type: string, animationEventInitDict?: AnimationEventInit): AnimationEvent; +}; + +interface AnimationFrameProvider { + cancelAnimationFrame(handle: number): void; + requestAnimationFrame(callback: FrameRequestCallback): number; +} + +interface AnimationPlaybackEvent extends Event { + readonly currentTime: CSSNumberish | null; + readonly timelineTime: CSSNumberish | null; +} + +declare var AnimationPlaybackEvent: { + prototype: AnimationPlaybackEvent; + new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent; +}; + +interface AnimationTimeline { + readonly currentTime: CSSNumberish | null; +} + +declare var AnimationTimeline: { + prototype: AnimationTimeline; + new(): AnimationTimeline; +}; + +/** A DOM element's attribute as an object. In most DOM methods, you will probably directly retrieve the attribute as a string (e.g., Element.getAttribute(), but certain functions (e.g., Element.getAttributeNode()) or means of iterating give Attr types. */ +interface Attr extends Node { + readonly localName: string; + readonly name: string; + readonly namespaceURI: string | null; + readonly ownerDocument: Document; + readonly ownerElement: Element | null; + readonly prefix: string | null; + /** @deprecated */ + readonly specified: boolean; + value: string; +} + +declare var Attr: { + prototype: Attr; + new(): Attr; +}; + +/** A short audio asset residing in memory, created from an audio file using the AudioContext.decodeAudioData() method, or from raw data using AudioContext.createBuffer(). Once put into an AudioBuffer, the audio can then be played by being passed into an AudioBufferSourceNode. */ +interface AudioBuffer { + readonly duration: number; + readonly length: number; + readonly numberOfChannels: number; + readonly sampleRate: number; + copyFromChannel(destination: Float32Array, channelNumber: number, bufferOffset?: number): void; + copyToChannel(source: Float32Array, channelNumber: number, bufferOffset?: number): void; + getChannelData(channel: number): Float32Array; +} + +declare var AudioBuffer: { + prototype: AudioBuffer; + new(options: AudioBufferOptions): AudioBuffer; +}; + +/** An AudioScheduledSourceNode which represents an audio source consisting of in-memory audio data, stored in an AudioBuffer. It's especially useful for playing back audio which has particularly stringent timing accuracy requirements, such as for sounds that must match a specific rhythm and can be kept in memory rather than being played from disk or the network. */ +interface AudioBufferSourceNode extends AudioScheduledSourceNode { + buffer: AudioBuffer | null; + readonly detune: AudioParam; + loop: boolean; + loopEnd: number; + loopStart: number; + readonly playbackRate: AudioParam; + start(when?: number, offset?: number, duration?: number): void; + addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioBufferSourceNode: { + prototype: AudioBufferSourceNode; + new(context: BaseAudioContext, options?: AudioBufferSourceOptions): AudioBufferSourceNode; +}; + +/** An audio-processing graph built from audio modules linked together, each represented by an AudioNode. */ +interface AudioContext extends BaseAudioContext { + readonly baseLatency: number; + readonly outputLatency: number; + close(): Promise; + createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode; + createMediaStreamDestination(): MediaStreamAudioDestinationNode; + createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode; + getOutputTimestamp(): AudioTimestamp; + resume(): Promise; + suspend(): Promise; + addEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioContext: { + prototype: AudioContext; + new(contextOptions?: AudioContextOptions): AudioContext; +}; + +/** AudioDestinationNode has no output (as it is the output, no more AudioNode can be linked after it in the audio graph) and one input. The number of channels in the input must be between 0 and the maxChannelCount value or an exception is raised. */ +interface AudioDestinationNode extends AudioNode { + readonly maxChannelCount: number; +} + +declare var AudioDestinationNode: { + prototype: AudioDestinationNode; + new(): AudioDestinationNode; +}; + +/** The position and orientation of the unique person listening to the audio scene, and is used in audio spatialization. All PannerNodes spatialize in relation to the AudioListener stored in the BaseAudioContext.listener attribute. */ +interface AudioListener { + readonly forwardX: AudioParam; + readonly forwardY: AudioParam; + readonly forwardZ: AudioParam; + readonly positionX: AudioParam; + readonly positionY: AudioParam; + readonly positionZ: AudioParam; + readonly upX: AudioParam; + readonly upY: AudioParam; + readonly upZ: AudioParam; + /** @deprecated */ + setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void; + /** @deprecated */ + setPosition(x: number, y: number, z: number): void; +} + +declare var AudioListener: { + prototype: AudioListener; + new(): AudioListener; +}; + +/** A generic interface for representing an audio processing module. Examples include: */ +interface AudioNode extends EventTarget { + channelCount: number; + channelCountMode: ChannelCountMode; + channelInterpretation: ChannelInterpretation; + readonly context: BaseAudioContext; + readonly numberOfInputs: number; + readonly numberOfOutputs: number; + connect(destinationNode: AudioNode, output?: number, input?: number): AudioNode; + connect(destinationParam: AudioParam, output?: number): void; + disconnect(): void; + disconnect(output: number): void; + disconnect(destinationNode: AudioNode): void; + disconnect(destinationNode: AudioNode, output: number): void; + disconnect(destinationNode: AudioNode, output: number, input: number): void; + disconnect(destinationParam: AudioParam): void; + disconnect(destinationParam: AudioParam, output: number): void; +} + +declare var AudioNode: { + prototype: AudioNode; + new(): AudioNode; +}; + +/** The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain). */ +interface AudioParam { + automationRate: AutomationRate; + readonly defaultValue: number; + readonly maxValue: number; + readonly minValue: number; + value: number; + cancelAndHoldAtTime(cancelTime: number): AudioParam; + cancelScheduledValues(cancelTime: number): AudioParam; + exponentialRampToValueAtTime(value: number, endTime: number): AudioParam; + linearRampToValueAtTime(value: number, endTime: number): AudioParam; + setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam; + setValueAtTime(value: number, startTime: number): AudioParam; + setValueCurveAtTime(values: number[] | Float32Array, startTime: number, duration: number): AudioParam; +} + +declare var AudioParam: { + prototype: AudioParam; + new(): AudioParam; +}; + +interface AudioParamMap { + forEach(callbackfn: (value: AudioParam, key: string, parent: AudioParamMap) => void, thisArg?: any): void; +} + +declare var AudioParamMap: { + prototype: AudioParamMap; + new(): AudioParamMap; +}; + +/** + * The Web Audio API events that occur when a ScriptProcessorNode input buffer is ready to be processed. + * @deprecated As of the August 29 2014 Web Audio API spec publication, this feature has been marked as deprecated, and is soon to be replaced by AudioWorklet. + */ +interface AudioProcessingEvent extends Event { + /** @deprecated */ + readonly inputBuffer: AudioBuffer; + /** @deprecated */ + readonly outputBuffer: AudioBuffer; + /** @deprecated */ + readonly playbackTime: number; +} + +/** @deprecated */ +declare var AudioProcessingEvent: { + prototype: AudioProcessingEvent; + new(type: string, eventInitDict: AudioProcessingEventInit): AudioProcessingEvent; +}; + +interface AudioScheduledSourceNodeEventMap { + "ended": Event; +} + +interface AudioScheduledSourceNode extends AudioNode { + onended: ((this: AudioScheduledSourceNode, ev: Event) => any) | null; + start(when?: number): void; + stop(when?: number): void; + addEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioScheduledSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioScheduledSourceNode: { + prototype: AudioScheduledSourceNode; + new(): AudioScheduledSourceNode; +}; + +/** Available only in secure contexts. */ +interface AudioWorklet extends Worklet { +} + +declare var AudioWorklet: { + prototype: AudioWorklet; + new(): AudioWorklet; +}; + +interface AudioWorkletNodeEventMap { + "processorerror": Event; +} + +/** Available only in secure contexts. */ +interface AudioWorkletNode extends AudioNode { + onprocessorerror: ((this: AudioWorkletNode, ev: Event) => any) | null; + readonly parameters: AudioParamMap; + readonly port: MessagePort; + addEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: AudioWorkletNode, ev: AudioWorkletNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var AudioWorkletNode: { + prototype: AudioWorkletNode; + new(context: BaseAudioContext, name: string, options?: AudioWorkletNodeOptions): AudioWorkletNode; +}; + +/** Available only in secure contexts. */ +interface AuthenticatorAssertionResponse extends AuthenticatorResponse { + readonly authenticatorData: ArrayBuffer; + readonly signature: ArrayBuffer; + readonly userHandle: ArrayBuffer | null; +} + +declare var AuthenticatorAssertionResponse: { + prototype: AuthenticatorAssertionResponse; + new(): AuthenticatorAssertionResponse; +}; + +/** Available only in secure contexts. */ +interface AuthenticatorAttestationResponse extends AuthenticatorResponse { + readonly attestationObject: ArrayBuffer; + getAuthenticatorData(): ArrayBuffer; + getPublicKey(): ArrayBuffer | null; + getPublicKeyAlgorithm(): COSEAlgorithmIdentifier; + getTransports(): string[]; +} + +declare var AuthenticatorAttestationResponse: { + prototype: AuthenticatorAttestationResponse; + new(): AuthenticatorAttestationResponse; +}; + +/** Available only in secure contexts. */ +interface AuthenticatorResponse { + readonly clientDataJSON: ArrayBuffer; +} + +declare var AuthenticatorResponse: { + prototype: AuthenticatorResponse; + new(): AuthenticatorResponse; +}; + +interface BarProp { + readonly visible: boolean; +} + +declare var BarProp: { + prototype: BarProp; + new(): BarProp; +}; + +interface BaseAudioContextEventMap { + "statechange": Event; +} + +interface BaseAudioContext extends EventTarget { + /** Available only in secure contexts. */ + readonly audioWorklet: AudioWorklet; + readonly currentTime: number; + readonly destination: AudioDestinationNode; + readonly listener: AudioListener; + onstatechange: ((this: BaseAudioContext, ev: Event) => any) | null; + readonly sampleRate: number; + readonly state: AudioContextState; + createAnalyser(): AnalyserNode; + createBiquadFilter(): BiquadFilterNode; + createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer; + createBufferSource(): AudioBufferSourceNode; + createChannelMerger(numberOfInputs?: number): ChannelMergerNode; + createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode; + createConstantSource(): ConstantSourceNode; + createConvolver(): ConvolverNode; + createDelay(maxDelayTime?: number): DelayNode; + createDynamicsCompressor(): DynamicsCompressorNode; + createGain(): GainNode; + createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode; + createOscillator(): OscillatorNode; + createPanner(): PannerNode; + createPeriodicWave(real: number[] | Float32Array, imag: number[] | Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave; + /** @deprecated */ + createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode; + createStereoPanner(): StereoPannerNode; + createWaveShaper(): WaveShaperNode; + decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback | null, errorCallback?: DecodeErrorCallback | null): Promise; + addEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: BaseAudioContext, ev: BaseAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var BaseAudioContext: { + prototype: BaseAudioContext; + new(): BaseAudioContext; +}; + +/** The beforeunload event is fired when the window, the document and its resources are about to be unloaded. */ +interface BeforeUnloadEvent extends Event { + returnValue: any; +} + +declare var BeforeUnloadEvent: { + prototype: BeforeUnloadEvent; + new(): BeforeUnloadEvent; +}; + +/** A simple low-order filter, and is created using the AudioContext.createBiquadFilter() method. It is an AudioNode that can represent different kinds of filters, tone control devices, and graphic equalizers. */ +interface BiquadFilterNode extends AudioNode { + readonly Q: AudioParam; + readonly detune: AudioParam; + readonly frequency: AudioParam; + readonly gain: AudioParam; + type: BiquadFilterType; + getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void; +} + +declare var BiquadFilterNode: { + prototype: BiquadFilterNode; + new(context: BaseAudioContext, options?: BiquadFilterOptions): BiquadFilterNode; +}; + +/** A file-like object of immutable, raw data. Blobs represent data that isn't necessarily in a JavaScript-native format. The File interface is based on Blob, inheriting blob functionality and expanding it to support files on the user's system. */ +interface Blob { + readonly size: number; + readonly type: string; + arrayBuffer(): Promise; + slice(start?: number, end?: number, contentType?: string): Blob; + stream(): ReadableStream; + text(): Promise; +} + +declare var Blob: { + prototype: Blob; + new(blobParts?: BlobPart[], options?: BlobPropertyBag): Blob; +}; + +interface BlobEvent extends Event { + readonly data: Blob; + readonly timecode: DOMHighResTimeStamp; +} + +declare var BlobEvent: { + prototype: BlobEvent; + new(type: string, eventInitDict: BlobEventInit): BlobEvent; +}; + +interface Body { + readonly body: ReadableStream | null; + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + formData(): Promise; + json(): Promise; + text(): Promise; +} + +interface BroadcastChannelEventMap { + "message": MessageEvent; + "messageerror": MessageEvent; +} + +interface BroadcastChannel extends EventTarget { + /** Returns the channel name (as passed to the constructor). */ + readonly name: string; + onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; + onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null; + /** Closes the BroadcastChannel object, opening it up to garbage collection. */ + close(): void; + /** Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays. */ + postMessage(message: any): void; + addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var BroadcastChannel: { + prototype: BroadcastChannel; + new(name: string): BroadcastChannel; +}; + +/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ +interface ByteLengthQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; +} + +declare var ByteLengthQueuingStrategy: { + prototype: ByteLengthQueuingStrategy; + new(init: QueuingStrategyInit): ByteLengthQueuingStrategy; +}; + +/** A CDATA section that can be used within XML to include extended portions of unescaped text. The symbols < and & don’t need escaping as they normally do when inside a CDATA section. */ +interface CDATASection extends Text { +} + +declare var CDATASection: { + prototype: CDATASection; + new(): CDATASection; +}; + +interface CSSAnimation extends Animation { + readonly animationName: string; + addEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CSSAnimation, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CSSAnimation: { + prototype: CSSAnimation; + new(): CSSAnimation; +}; + +/** A single condition CSS at-rule, which consists of a condition and a statement block. It is a child of CSSGroupingRule. */ +interface CSSConditionRule extends CSSGroupingRule { + readonly conditionText: string; +} + +declare var CSSConditionRule: { + prototype: CSSConditionRule; + new(): CSSConditionRule; +}; + +interface CSSContainerRule extends CSSConditionRule { +} + +declare var CSSContainerRule: { + prototype: CSSContainerRule; + new(): CSSContainerRule; +}; + +interface CSSCounterStyleRule extends CSSRule { + additiveSymbols: string; + fallback: string; + name: string; + negative: string; + pad: string; + prefix: string; + range: string; + speakAs: string; + suffix: string; + symbols: string; + system: string; +} + +declare var CSSCounterStyleRule: { + prototype: CSSCounterStyleRule; + new(): CSSCounterStyleRule; +}; + +interface CSSFontFaceRule extends CSSRule { + readonly style: CSSStyleDeclaration; +} + +declare var CSSFontFaceRule: { + prototype: CSSFontFaceRule; + new(): CSSFontFaceRule; +}; + +interface CSSFontPaletteValuesRule extends CSSRule { + readonly basePalette: string; + readonly fontFamily: string; + readonly name: string; + readonly overrideColors: string; +} + +declare var CSSFontPaletteValuesRule: { + prototype: CSSFontPaletteValuesRule; + new(): CSSFontPaletteValuesRule; +}; + +/** Any CSS at-rule that contains other rules nested within it. */ +interface CSSGroupingRule extends CSSRule { + readonly cssRules: CSSRuleList; + deleteRule(index: number): void; + insertRule(rule: string, index?: number): number; +} + +declare var CSSGroupingRule: { + prototype: CSSGroupingRule; + new(): CSSGroupingRule; +}; + +interface CSSImportRule extends CSSRule { + readonly href: string; + readonly layerName: string | null; + readonly media: MediaList; + readonly styleSheet: CSSStyleSheet; +} + +declare var CSSImportRule: { + prototype: CSSImportRule; + new(): CSSImportRule; +}; + +/** An object representing a set of style for a given keyframe. It corresponds to the contains of a single keyframe of a @keyframes at-rule. It implements the CSSRule interface with a type value of 8 (CSSRule.KEYFRAME_RULE). */ +interface CSSKeyframeRule extends CSSRule { + keyText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSKeyframeRule: { + prototype: CSSKeyframeRule; + new(): CSSKeyframeRule; +}; + +/** An object representing a complete set of keyframes for a CSS animation. It corresponds to the contains of a whole @keyframes at-rule. It implements the CSSRule interface with a type value of 7 (CSSRule.KEYFRAMES_RULE). */ +interface CSSKeyframesRule extends CSSRule { + readonly cssRules: CSSRuleList; + name: string; + appendRule(rule: string): void; + deleteRule(select: string): void; + findRule(select: string): CSSKeyframeRule | null; +} + +declare var CSSKeyframesRule: { + prototype: CSSKeyframesRule; + new(): CSSKeyframesRule; +}; + +interface CSSLayerBlockRule extends CSSGroupingRule { + readonly name: string; +} + +declare var CSSLayerBlockRule: { + prototype: CSSLayerBlockRule; + new(): CSSLayerBlockRule; +}; + +interface CSSLayerStatementRule extends CSSRule { + readonly nameList: ReadonlyArray; +} + +declare var CSSLayerStatementRule: { + prototype: CSSLayerStatementRule; + new(): CSSLayerStatementRule; +}; + +/** A single CSS @media rule. It implements the CSSConditionRule interface, and therefore the CSSGroupingRule and the CSSRule interface with a type value of 4 (CSSRule.MEDIA_RULE). */ +interface CSSMediaRule extends CSSConditionRule { + readonly media: MediaList; +} + +declare var CSSMediaRule: { + prototype: CSSMediaRule; + new(): CSSMediaRule; +}; + +/** An object representing a single CSS @namespace at-rule. It implements the CSSRule interface, with a type value of 10 (CSSRule.NAMESPACE_RULE). */ +interface CSSNamespaceRule extends CSSRule { + readonly namespaceURI: string; + readonly prefix: string; +} + +declare var CSSNamespaceRule: { + prototype: CSSNamespaceRule; + new(): CSSNamespaceRule; +}; + +/** CSSPageRule is an interface representing a single CSS @page rule. It implements the CSSRule interface with a type value of 6 (CSSRule.PAGE_RULE). */ +interface CSSPageRule extends CSSGroupingRule { + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSPageRule: { + prototype: CSSPageRule; + new(): CSSPageRule; +}; + +/** A single CSS rule. There are several types of rules, listed in the Type constants section below. */ +interface CSSRule { + cssText: string; + readonly parentRule: CSSRule | null; + readonly parentStyleSheet: CSSStyleSheet | null; + /** @deprecated */ + readonly type: number; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; +} + +declare var CSSRule: { + prototype: CSSRule; + new(): CSSRule; + readonly CHARSET_RULE: number; + readonly FONT_FACE_RULE: number; + readonly IMPORT_RULE: number; + readonly KEYFRAMES_RULE: number; + readonly KEYFRAME_RULE: number; + readonly MEDIA_RULE: number; + readonly NAMESPACE_RULE: number; + readonly PAGE_RULE: number; + readonly STYLE_RULE: number; + readonly SUPPORTS_RULE: number; +}; + +/** A CSSRuleList is an (indirect-modify only) array-like object containing an ordered collection of CSSRule objects. */ +interface CSSRuleList { + readonly length: number; + item(index: number): CSSRule | null; + [index: number]: CSSRule; +} + +declare var CSSRuleList: { + prototype: CSSRuleList; + new(): CSSRuleList; +}; + +/** An object that is a CSS declaration block, and exposes style information and various style-related methods and properties. */ +interface CSSStyleDeclaration { + accentColor: string; + alignContent: string; + alignItems: string; + alignSelf: string; + alignmentBaseline: string; + all: string; + animation: string; + animationDelay: string; + animationDirection: string; + animationDuration: string; + animationFillMode: string; + animationIterationCount: string; + animationName: string; + animationPlayState: string; + animationTimingFunction: string; + appearance: string; + aspectRatio: string; + backdropFilter: string; + backfaceVisibility: string; + background: string; + backgroundAttachment: string; + backgroundBlendMode: string; + backgroundClip: string; + backgroundColor: string; + backgroundImage: string; + backgroundOrigin: string; + backgroundPosition: string; + backgroundPositionX: string; + backgroundPositionY: string; + backgroundRepeat: string; + backgroundSize: string; + baselineShift: string; + blockSize: string; + border: string; + borderBlock: string; + borderBlockColor: string; + borderBlockEnd: string; + borderBlockEndColor: string; + borderBlockEndStyle: string; + borderBlockEndWidth: string; + borderBlockStart: string; + borderBlockStartColor: string; + borderBlockStartStyle: string; + borderBlockStartWidth: string; + borderBlockStyle: string; + borderBlockWidth: string; + borderBottom: string; + borderBottomColor: string; + borderBottomLeftRadius: string; + borderBottomRightRadius: string; + borderBottomStyle: string; + borderBottomWidth: string; + borderCollapse: string; + borderColor: string; + borderEndEndRadius: string; + borderEndStartRadius: string; + borderImage: string; + borderImageOutset: string; + borderImageRepeat: string; + borderImageSlice: string; + borderImageSource: string; + borderImageWidth: string; + borderInline: string; + borderInlineColor: string; + borderInlineEnd: string; + borderInlineEndColor: string; + borderInlineEndStyle: string; + borderInlineEndWidth: string; + borderInlineStart: string; + borderInlineStartColor: string; + borderInlineStartStyle: string; + borderInlineStartWidth: string; + borderInlineStyle: string; + borderInlineWidth: string; + borderLeft: string; + borderLeftColor: string; + borderLeftStyle: string; + borderLeftWidth: string; + borderRadius: string; + borderRight: string; + borderRightColor: string; + borderRightStyle: string; + borderRightWidth: string; + borderSpacing: string; + borderStartEndRadius: string; + borderStartStartRadius: string; + borderStyle: string; + borderTop: string; + borderTopColor: string; + borderTopLeftRadius: string; + borderTopRightRadius: string; + borderTopStyle: string; + borderTopWidth: string; + borderWidth: string; + bottom: string; + boxShadow: string; + boxSizing: string; + breakAfter: string; + breakBefore: string; + breakInside: string; + captionSide: string; + caretColor: string; + clear: string; + /** @deprecated */ + clip: string; + clipPath: string; + clipRule: string; + color: string; + colorInterpolation: string; + colorInterpolationFilters: string; + colorScheme: string; + columnCount: string; + columnFill: string; + columnGap: string; + columnRule: string; + columnRuleColor: string; + columnRuleStyle: string; + columnRuleWidth: string; + columnSpan: string; + columnWidth: string; + columns: string; + contain: string; + container: string; + containerName: string; + containerType: string; + content: string; + counterIncrement: string; + counterReset: string; + counterSet: string; + cssFloat: string; + cssText: string; + cursor: string; + direction: string; + display: string; + dominantBaseline: string; + emptyCells: string; + fill: string; + fillOpacity: string; + fillRule: string; + filter: string; + flex: string; + flexBasis: string; + flexDirection: string; + flexFlow: string; + flexGrow: string; + flexShrink: string; + flexWrap: string; + float: string; + floodColor: string; + floodOpacity: string; + font: string; + fontFamily: string; + fontFeatureSettings: string; + fontKerning: string; + fontOpticalSizing: string; + fontPalette: string; + fontSize: string; + fontSizeAdjust: string; + fontStretch: string; + fontStyle: string; + fontSynthesis: string; + fontVariant: string; + fontVariantAlternates: string; + fontVariantCaps: string; + fontVariantEastAsian: string; + fontVariantLigatures: string; + fontVariantNumeric: string; + fontVariantPosition: string; + fontVariationSettings: string; + fontWeight: string; + gap: string; + grid: string; + gridArea: string; + gridAutoColumns: string; + gridAutoFlow: string; + gridAutoRows: string; + gridColumn: string; + gridColumnEnd: string; + /** @deprecated This is a legacy alias of `columnGap`. */ + gridColumnGap: string; + gridColumnStart: string; + /** @deprecated This is a legacy alias of `gap`. */ + gridGap: string; + gridRow: string; + gridRowEnd: string; + /** @deprecated This is a legacy alias of `rowGap`. */ + gridRowGap: string; + gridRowStart: string; + gridTemplate: string; + gridTemplateAreas: string; + gridTemplateColumns: string; + gridTemplateRows: string; + height: string; + hyphenateCharacter: string; + hyphens: string; + /** @deprecated */ + imageOrientation: string; + imageRendering: string; + inlineSize: string; + inset: string; + insetBlock: string; + insetBlockEnd: string; + insetBlockStart: string; + insetInline: string; + insetInlineEnd: string; + insetInlineStart: string; + isolation: string; + justifyContent: string; + justifyItems: string; + justifySelf: string; + left: string; + readonly length: number; + letterSpacing: string; + lightingColor: string; + lineBreak: string; + lineHeight: string; + listStyle: string; + listStyleImage: string; + listStylePosition: string; + listStyleType: string; + margin: string; + marginBlock: string; + marginBlockEnd: string; + marginBlockStart: string; + marginBottom: string; + marginInline: string; + marginInlineEnd: string; + marginInlineStart: string; + marginLeft: string; + marginRight: string; + marginTop: string; + marker: string; + markerEnd: string; + markerMid: string; + markerStart: string; + mask: string; + maskClip: string; + maskComposite: string; + maskImage: string; + maskMode: string; + maskOrigin: string; + maskPosition: string; + maskRepeat: string; + maskSize: string; + maskType: string; + maxBlockSize: string; + maxHeight: string; + maxInlineSize: string; + maxWidth: string; + minBlockSize: string; + minHeight: string; + minInlineSize: string; + minWidth: string; + mixBlendMode: string; + objectFit: string; + objectPosition: string; + offset: string; + offsetDistance: string; + offsetPath: string; + offsetRotate: string; + opacity: string; + order: string; + orphans: string; + outline: string; + outlineColor: string; + outlineOffset: string; + outlineStyle: string; + outlineWidth: string; + overflow: string; + overflowAnchor: string; + overflowClipMargin: string; + overflowWrap: string; + overflowX: string; + overflowY: string; + overscrollBehavior: string; + overscrollBehaviorBlock: string; + overscrollBehaviorInline: string; + overscrollBehaviorX: string; + overscrollBehaviorY: string; + padding: string; + paddingBlock: string; + paddingBlockEnd: string; + paddingBlockStart: string; + paddingBottom: string; + paddingInline: string; + paddingInlineEnd: string; + paddingInlineStart: string; + paddingLeft: string; + paddingRight: string; + paddingTop: string; + pageBreakAfter: string; + pageBreakBefore: string; + pageBreakInside: string; + paintOrder: string; + readonly parentRule: CSSRule | null; + perspective: string; + perspectiveOrigin: string; + placeContent: string; + placeItems: string; + placeSelf: string; + pointerEvents: string; + position: string; + printColorAdjust: string; + quotes: string; + resize: string; + right: string; + rotate: string; + rowGap: string; + rubyPosition: string; + scale: string; + scrollBehavior: string; + scrollMargin: string; + scrollMarginBlock: string; + scrollMarginBlockEnd: string; + scrollMarginBlockStart: string; + scrollMarginBottom: string; + scrollMarginInline: string; + scrollMarginInlineEnd: string; + scrollMarginInlineStart: string; + scrollMarginLeft: string; + scrollMarginRight: string; + scrollMarginTop: string; + scrollPadding: string; + scrollPaddingBlock: string; + scrollPaddingBlockEnd: string; + scrollPaddingBlockStart: string; + scrollPaddingBottom: string; + scrollPaddingInline: string; + scrollPaddingInlineEnd: string; + scrollPaddingInlineStart: string; + scrollPaddingLeft: string; + scrollPaddingRight: string; + scrollPaddingTop: string; + scrollSnapAlign: string; + scrollSnapStop: string; + scrollSnapType: string; + scrollbarGutter: string; + shapeImageThreshold: string; + shapeMargin: string; + shapeOutside: string; + shapeRendering: string; + stopColor: string; + stopOpacity: string; + stroke: string; + strokeDasharray: string; + strokeDashoffset: string; + strokeLinecap: string; + strokeLinejoin: string; + strokeMiterlimit: string; + strokeOpacity: string; + strokeWidth: string; + tabSize: string; + tableLayout: string; + textAlign: string; + textAlignLast: string; + textAnchor: string; + textCombineUpright: string; + textDecoration: string; + textDecorationColor: string; + textDecorationLine: string; + textDecorationSkipInk: string; + textDecorationStyle: string; + textDecorationThickness: string; + textEmphasis: string; + textEmphasisColor: string; + textEmphasisPosition: string; + textEmphasisStyle: string; + textIndent: string; + textOrientation: string; + textOverflow: string; + textRendering: string; + textShadow: string; + textTransform: string; + textUnderlineOffset: string; + textUnderlinePosition: string; + top: string; + touchAction: string; + transform: string; + transformBox: string; + transformOrigin: string; + transformStyle: string; + transition: string; + transitionDelay: string; + transitionDuration: string; + transitionProperty: string; + transitionTimingFunction: string; + translate: string; + unicodeBidi: string; + userSelect: string; + verticalAlign: string; + visibility: string; + /** @deprecated This is a legacy alias of `alignContent`. */ + webkitAlignContent: string; + /** @deprecated This is a legacy alias of `alignItems`. */ + webkitAlignItems: string; + /** @deprecated This is a legacy alias of `alignSelf`. */ + webkitAlignSelf: string; + /** @deprecated This is a legacy alias of `animation`. */ + webkitAnimation: string; + /** @deprecated This is a legacy alias of `animationDelay`. */ + webkitAnimationDelay: string; + /** @deprecated This is a legacy alias of `animationDirection`. */ + webkitAnimationDirection: string; + /** @deprecated This is a legacy alias of `animationDuration`. */ + webkitAnimationDuration: string; + /** @deprecated This is a legacy alias of `animationFillMode`. */ + webkitAnimationFillMode: string; + /** @deprecated This is a legacy alias of `animationIterationCount`. */ + webkitAnimationIterationCount: string; + /** @deprecated This is a legacy alias of `animationName`. */ + webkitAnimationName: string; + /** @deprecated This is a legacy alias of `animationPlayState`. */ + webkitAnimationPlayState: string; + /** @deprecated This is a legacy alias of `animationTimingFunction`. */ + webkitAnimationTimingFunction: string; + /** @deprecated This is a legacy alias of `appearance`. */ + webkitAppearance: string; + /** @deprecated This is a legacy alias of `backfaceVisibility`. */ + webkitBackfaceVisibility: string; + /** @deprecated This is a legacy alias of `backgroundClip`. */ + webkitBackgroundClip: string; + /** @deprecated This is a legacy alias of `backgroundOrigin`. */ + webkitBackgroundOrigin: string; + /** @deprecated This is a legacy alias of `backgroundSize`. */ + webkitBackgroundSize: string; + /** @deprecated This is a legacy alias of `borderBottomLeftRadius`. */ + webkitBorderBottomLeftRadius: string; + /** @deprecated This is a legacy alias of `borderBottomRightRadius`. */ + webkitBorderBottomRightRadius: string; + /** @deprecated This is a legacy alias of `borderRadius`. */ + webkitBorderRadius: string; + /** @deprecated This is a legacy alias of `borderTopLeftRadius`. */ + webkitBorderTopLeftRadius: string; + /** @deprecated This is a legacy alias of `borderTopRightRadius`. */ + webkitBorderTopRightRadius: string; + /** @deprecated This is a legacy alias of `boxAlign`. */ + webkitBoxAlign: string; + /** @deprecated This is a legacy alias of `boxFlex`. */ + webkitBoxFlex: string; + /** @deprecated This is a legacy alias of `boxOrdinalGroup`. */ + webkitBoxOrdinalGroup: string; + /** @deprecated This is a legacy alias of `boxOrient`. */ + webkitBoxOrient: string; + /** @deprecated This is a legacy alias of `boxPack`. */ + webkitBoxPack: string; + /** @deprecated This is a legacy alias of `boxShadow`. */ + webkitBoxShadow: string; + /** @deprecated This is a legacy alias of `boxSizing`. */ + webkitBoxSizing: string; + /** @deprecated This is a legacy alias of `filter`. */ + webkitFilter: string; + /** @deprecated This is a legacy alias of `flex`. */ + webkitFlex: string; + /** @deprecated This is a legacy alias of `flexBasis`. */ + webkitFlexBasis: string; + /** @deprecated This is a legacy alias of `flexDirection`. */ + webkitFlexDirection: string; + /** @deprecated This is a legacy alias of `flexFlow`. */ + webkitFlexFlow: string; + /** @deprecated This is a legacy alias of `flexGrow`. */ + webkitFlexGrow: string; + /** @deprecated This is a legacy alias of `flexShrink`. */ + webkitFlexShrink: string; + /** @deprecated This is a legacy alias of `flexWrap`. */ + webkitFlexWrap: string; + /** @deprecated This is a legacy alias of `justifyContent`. */ + webkitJustifyContent: string; + webkitLineClamp: string; + /** @deprecated This is a legacy alias of `mask`. */ + webkitMask: string; + /** @deprecated This is a legacy alias of `maskBorder`. */ + webkitMaskBoxImage: string; + /** @deprecated This is a legacy alias of `maskBorderOutset`. */ + webkitMaskBoxImageOutset: string; + /** @deprecated This is a legacy alias of `maskBorderRepeat`. */ + webkitMaskBoxImageRepeat: string; + /** @deprecated This is a legacy alias of `maskBorderSlice`. */ + webkitMaskBoxImageSlice: string; + /** @deprecated This is a legacy alias of `maskBorderSource`. */ + webkitMaskBoxImageSource: string; + /** @deprecated This is a legacy alias of `maskBorderWidth`. */ + webkitMaskBoxImageWidth: string; + /** @deprecated This is a legacy alias of `maskClip`. */ + webkitMaskClip: string; + webkitMaskComposite: string; + /** @deprecated This is a legacy alias of `maskImage`. */ + webkitMaskImage: string; + /** @deprecated This is a legacy alias of `maskOrigin`. */ + webkitMaskOrigin: string; + /** @deprecated This is a legacy alias of `maskPosition`. */ + webkitMaskPosition: string; + /** @deprecated This is a legacy alias of `maskRepeat`. */ + webkitMaskRepeat: string; + /** @deprecated This is a legacy alias of `maskSize`. */ + webkitMaskSize: string; + /** @deprecated This is a legacy alias of `order`. */ + webkitOrder: string; + /** @deprecated This is a legacy alias of `perspective`. */ + webkitPerspective: string; + /** @deprecated This is a legacy alias of `perspectiveOrigin`. */ + webkitPerspectiveOrigin: string; + webkitTextFillColor: string; + /** @deprecated This is a legacy alias of `textSizeAdjust`. */ + webkitTextSizeAdjust: string; + webkitTextStroke: string; + webkitTextStrokeColor: string; + webkitTextStrokeWidth: string; + /** @deprecated This is a legacy alias of `transform`. */ + webkitTransform: string; + /** @deprecated This is a legacy alias of `transformOrigin`. */ + webkitTransformOrigin: string; + /** @deprecated This is a legacy alias of `transformStyle`. */ + webkitTransformStyle: string; + /** @deprecated This is a legacy alias of `transition`. */ + webkitTransition: string; + /** @deprecated This is a legacy alias of `transitionDelay`. */ + webkitTransitionDelay: string; + /** @deprecated This is a legacy alias of `transitionDuration`. */ + webkitTransitionDuration: string; + /** @deprecated This is a legacy alias of `transitionProperty`. */ + webkitTransitionProperty: string; + /** @deprecated This is a legacy alias of `transitionTimingFunction`. */ + webkitTransitionTimingFunction: string; + /** @deprecated This is a legacy alias of `userSelect`. */ + webkitUserSelect: string; + whiteSpace: string; + widows: string; + width: string; + willChange: string; + wordBreak: string; + wordSpacing: string; + /** @deprecated */ + wordWrap: string; + writingMode: string; + zIndex: string; + getPropertyPriority(property: string): string; + getPropertyValue(property: string): string; + item(index: number): string; + removeProperty(property: string): string; + setProperty(property: string, value: string | null, priority?: string): void; + [index: number]: string; +} + +declare var CSSStyleDeclaration: { + prototype: CSSStyleDeclaration; + new(): CSSStyleDeclaration; +}; + +/** CSSStyleRule represents a single CSS style rule. It implements the CSSRule interface with a type value of 1 (CSSRule.STYLE_RULE). */ +interface CSSStyleRule extends CSSRule { + selectorText: string; + readonly style: CSSStyleDeclaration; +} + +declare var CSSStyleRule: { + prototype: CSSStyleRule; + new(): CSSStyleRule; +}; + +/** A single CSS style sheet. It inherits properties and methods from its parent, StyleSheet. */ +interface CSSStyleSheet extends StyleSheet { + readonly cssRules: CSSRuleList; + readonly ownerRule: CSSRule | null; + /** @deprecated */ + readonly rules: CSSRuleList; + /** @deprecated */ + addRule(selector?: string, style?: string, index?: number): number; + deleteRule(index: number): void; + insertRule(rule: string, index?: number): number; + /** @deprecated */ + removeRule(index?: number): void; + replace(text: string): Promise; + replaceSync(text: string): void; +} + +declare var CSSStyleSheet: { + prototype: CSSStyleSheet; + new(options?: CSSStyleSheetInit): CSSStyleSheet; +}; + +/** An object representing a single CSS @supports at-rule. It implements the CSSConditionRule interface, and therefore the CSSRule and CSSGroupingRule interfaces with a type value of 12 (CSSRule.SUPPORTS_RULE). */ +interface CSSSupportsRule extends CSSConditionRule { +} + +declare var CSSSupportsRule: { + prototype: CSSSupportsRule; + new(): CSSSupportsRule; +}; + +interface CSSTransition extends Animation { + readonly transitionProperty: string; + addEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CSSTransition, ev: AnimationEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CSSTransition: { + prototype: CSSTransition; + new(): CSSTransition; +}; + +/** + * Provides a storage mechanism for Request / Response object pairs that are cached, for example as part of the ServiceWorker life cycle. Note that the Cache interface is exposed to windowed scopes as well as workers. You don't have to use it in conjunction with service workers, even though it is defined in the service worker spec. + * Available only in secure contexts. + */ +interface Cache { + add(request: RequestInfo | URL): Promise; + addAll(requests: RequestInfo[]): Promise; + delete(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + keys(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + match(request: RequestInfo | URL, options?: CacheQueryOptions): Promise; + matchAll(request?: RequestInfo | URL, options?: CacheQueryOptions): Promise>; + put(request: RequestInfo | URL, response: Response): Promise; +} + +declare var Cache: { + prototype: Cache; + new(): Cache; +}; + +/** + * The storage for Cache objects. + * Available only in secure contexts. + */ +interface CacheStorage { + delete(cacheName: string): Promise; + has(cacheName: string): Promise; + keys(): Promise; + match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise; + open(cacheName: string): Promise; +} + +declare var CacheStorage: { + prototype: CacheStorage; + new(): CacheStorage; +}; + +interface CanvasCaptureMediaStreamTrack extends MediaStreamTrack { + readonly canvas: HTMLCanvasElement; + requestFrame(): void; + addEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: CanvasCaptureMediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var CanvasCaptureMediaStreamTrack: { + prototype: CanvasCaptureMediaStreamTrack; + new(): CanvasCaptureMediaStreamTrack; +}; + +interface CanvasCompositing { + globalAlpha: number; + globalCompositeOperation: GlobalCompositeOperation; +} + +interface CanvasDrawImage { + drawImage(image: CanvasImageSource, dx: number, dy: number): void; + drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void; + drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; +} + +interface CanvasDrawPath { + beginPath(): void; + clip(fillRule?: CanvasFillRule): void; + clip(path: Path2D, fillRule?: CanvasFillRule): void; + fill(fillRule?: CanvasFillRule): void; + fill(path: Path2D, fillRule?: CanvasFillRule): void; + isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean; + isPointInStroke(x: number, y: number): boolean; + isPointInStroke(path: Path2D, x: number, y: number): boolean; + stroke(): void; + stroke(path: Path2D): void; +} + +interface CanvasFillStrokeStyles { + fillStyle: string | CanvasGradient | CanvasPattern; + strokeStyle: string | CanvasGradient | CanvasPattern; + createConicGradient(startAngle: number, x: number, y: number): CanvasGradient; + createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; + createPattern(image: CanvasImageSource, repetition: string | null): CanvasPattern | null; + createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; +} + +interface CanvasFilters { + filter: string; +} + +/** An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient(). */ +interface CanvasGradient { + /** + * Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end. + * + * Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed. + */ + addColorStop(offset: number, color: string): void; +} + +declare var CanvasGradient: { + prototype: CanvasGradient; + new(): CanvasGradient; +}; + +interface CanvasImageData { + createImageData(sw: number, sh: number, settings?: ImageDataSettings): ImageData; + createImageData(imagedata: ImageData): ImageData; + getImageData(sx: number, sy: number, sw: number, sh: number, settings?: ImageDataSettings): ImageData; + putImageData(imagedata: ImageData, dx: number, dy: number): void; + putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; +} + +interface CanvasImageSmoothing { + imageSmoothingEnabled: boolean; + imageSmoothingQuality: ImageSmoothingQuality; +} + +interface CanvasPath { + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; + closePath(): void; + ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, counterclockwise?: boolean): void; + lineTo(x: number, y: number): void; + moveTo(x: number, y: number): void; + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; + rect(x: number, y: number, w: number, h: number): void; + roundRect(x: number, y: number, w: number, h: number, radii?: number | DOMPointInit | (number | DOMPointInit)[]): void; +} + +interface CanvasPathDrawingStyles { + lineCap: CanvasLineCap; + lineDashOffset: number; + lineJoin: CanvasLineJoin; + lineWidth: number; + miterLimit: number; + getLineDash(): number[]; + setLineDash(segments: number[]): void; +} + +/** An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method. */ +interface CanvasPattern { + /** Sets the transformation matrix that will be used when rendering the pattern during a fill or stroke painting operation. */ + setTransform(transform?: DOMMatrix2DInit): void; +} + +declare var CanvasPattern: { + prototype: CanvasPattern; + new(): CanvasPattern; +}; + +interface CanvasRect { + clearRect(x: number, y: number, w: number, h: number): void; + fillRect(x: number, y: number, w: number, h: number): void; + strokeRect(x: number, y: number, w: number, h: number): void; +} + +/** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a element. It is used for drawing shapes, text, images, and other objects. */ +interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface { + readonly canvas: HTMLCanvasElement; + getContextAttributes(): CanvasRenderingContext2DSettings; +} + +declare var CanvasRenderingContext2D: { + prototype: CanvasRenderingContext2D; + new(): CanvasRenderingContext2D; +}; + +interface CanvasShadowStyles { + shadowBlur: number; + shadowColor: string; + shadowOffsetX: number; + shadowOffsetY: number; +} + +interface CanvasState { + restore(): void; + save(): void; +} + +interface CanvasText { + fillText(text: string, x: number, y: number, maxWidth?: number): void; + measureText(text: string): TextMetrics; + strokeText(text: string, x: number, y: number, maxWidth?: number): void; +} + +interface CanvasTextDrawingStyles { + direction: CanvasDirection; + font: string; + fontKerning: CanvasFontKerning; + textAlign: CanvasTextAlign; + textBaseline: CanvasTextBaseline; +} + +interface CanvasTransform { + getTransform(): DOMMatrix; + resetTransform(): void; + rotate(angle: number): void; + scale(x: number, y: number): void; + setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; + setTransform(transform?: DOMMatrix2DInit): void; + transform(a: number, b: number, c: number, d: number, e: number, f: number): void; + translate(x: number, y: number): void; +} + +interface CanvasUserInterface { + drawFocusIfNeeded(element: Element): void; + drawFocusIfNeeded(path: Path2D, element: Element): void; +} + +/** The ChannelMergerNode interface, often used in conjunction with its opposite, ChannelSplitterNode, reunites different mono inputs into a single output. Each input is used to fill a channel of the output. This is useful for accessing each channels separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */ +interface ChannelMergerNode extends AudioNode { +} + +declare var ChannelMergerNode: { + prototype: ChannelMergerNode; + new(context: BaseAudioContext, options?: ChannelMergerOptions): ChannelMergerNode; +}; + +/** The ChannelSplitterNode interface, often used in conjunction with its opposite, ChannelMergerNode, separates the different channels of an audio source into a set of mono outputs. This is useful for accessing each channel separately, e.g. for performing channel mixing where gain must be separately controlled on each channel. */ +interface ChannelSplitterNode extends AudioNode { +} + +declare var ChannelSplitterNode: { + prototype: ChannelSplitterNode; + new(context: BaseAudioContext, options?: ChannelSplitterOptions): ChannelSplitterNode; +}; + +/** The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. */ +interface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode { + data: string; + readonly length: number; + readonly ownerDocument: Document; + appendData(data: string): void; + deleteData(offset: number, count: number): void; + insertData(offset: number, data: string): void; + replaceData(offset: number, count: number, data: string): void; + substringData(offset: number, count: number): string; +} + +declare var CharacterData: { + prototype: CharacterData; + new(): CharacterData; +}; + +interface ChildNode extends Node { + /** + * Inserts nodes just after node, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + */ + after(...nodes: (Node | string)[]): void; + /** + * Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + */ + before(...nodes: (Node | string)[]): void; + /** Removes node. */ + remove(): void; + /** + * Replaces node with nodes, while replacing strings in nodes with equivalent Text nodes. + * + * Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. + */ + replaceWith(...nodes: (Node | string)[]): void; +} + +/** @deprecated */ +interface ClientRect extends DOMRect { +} + +/** Available only in secure contexts. */ +interface Clipboard extends EventTarget { + read(): Promise; + readText(): Promise; + write(data: ClipboardItems): Promise; + writeText(data: string): Promise; +} + +declare var Clipboard: { + prototype: Clipboard; + new(): Clipboard; +}; + +/** Events providing information related to modification of the clipboard, that is cut, copy, and paste events. */ +interface ClipboardEvent extends Event { + readonly clipboardData: DataTransfer | null; +} + +declare var ClipboardEvent: { + prototype: ClipboardEvent; + new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent; +}; + +/** Available only in secure contexts. */ +interface ClipboardItem { + readonly types: ReadonlyArray; + getType(type: string): Promise; +} + +declare var ClipboardItem: { + prototype: ClipboardItem; + new(items: Record>, options?: ClipboardItemOptions): ClipboardItem; +}; + +/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */ +interface CloseEvent extends Event { + /** Returns the WebSocket connection close code provided by the server. */ + readonly code: number; + /** Returns the WebSocket connection close reason provided by the server. */ + readonly reason: string; + /** Returns true if the connection closed cleanly; false otherwise. */ + readonly wasClean: boolean; +} + +declare var CloseEvent: { + prototype: CloseEvent; + new(type: string, eventInitDict?: CloseEventInit): CloseEvent; +}; + +/** Textual notations within markup; although it is generally not visually shown, such comments are available to be read in the source view. */ +interface Comment extends CharacterData { +} + +declare var Comment: { + prototype: Comment; + new(data?: string): Comment; +}; + +/** The DOM CompositionEvent represents events that occur due to the user indirectly entering text. */ +interface CompositionEvent extends UIEvent { + readonly data: string; + /** @deprecated */ + initCompositionEvent(typeArg: string, bubblesArg?: boolean, cancelableArg?: boolean, viewArg?: WindowProxy | null, dataArg?: string): void; +} + +declare var CompositionEvent: { + prototype: CompositionEvent; + new(type: string, eventInitDict?: CompositionEventInit): CompositionEvent; +}; + +interface ConstantSourceNode extends AudioScheduledSourceNode { + readonly offset: AudioParam; + addEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: ConstantSourceNode, ev: AudioScheduledSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var ConstantSourceNode: { + prototype: ConstantSourceNode; + new(context: BaseAudioContext, options?: ConstantSourceOptions): ConstantSourceNode; +}; + +/** An AudioNode that performs a Linear Convolution on a given AudioBuffer, often used to achieve a reverb effect. A ConvolverNode always has exactly one input and one output. */ +interface ConvolverNode extends AudioNode { + buffer: AudioBuffer | null; + normalize: boolean; +} + +declare var ConvolverNode: { + prototype: ConvolverNode; + new(context: BaseAudioContext, options?: ConvolverOptions): ConvolverNode; +}; + +/** This Streams API interface provides a built-in byte length queuing strategy that can be used when constructing streams. */ +interface CountQueuingStrategy extends QueuingStrategy { + readonly highWaterMark: number; + readonly size: QueuingStrategySize; +} + +declare var CountQueuingStrategy: { + prototype: CountQueuingStrategy; + new(init: QueuingStrategyInit): CountQueuingStrategy; +}; + +/** Available only in secure contexts. */ +interface Credential { + readonly id: string; + readonly type: string; +} + +declare var Credential: { + prototype: Credential; + new(): Credential; +}; + +/** Available only in secure contexts. */ +interface CredentialsContainer { + create(options?: CredentialCreationOptions): Promise; + get(options?: CredentialRequestOptions): Promise; + preventSilentAccess(): Promise; + store(credential: Credential): Promise; +} + +declare var CredentialsContainer: { + prototype: CredentialsContainer; + new(): CredentialsContainer; +}; + +/** Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives. */ +interface Crypto { + /** Available only in secure contexts. */ + readonly subtle: SubtleCrypto; + getRandomValues(array: T): T; + /** Available only in secure contexts. */ + randomUUID(): string; +} + +declare var Crypto: { + prototype: Crypto; + new(): Crypto; +}; + +/** + * The CryptoKey dictionary of the Web Crypto API represents a cryptographic key. + * Available only in secure contexts. + */ +interface CryptoKey { + readonly algorithm: KeyAlgorithm; + readonly extractable: boolean; + readonly type: KeyType; + readonly usages: KeyUsage[]; +} + +declare var CryptoKey: { + prototype: CryptoKey; + new(): CryptoKey; +}; + +interface CustomElementRegistry { + define(name: string, constructor: CustomElementConstructor, options?: ElementDefinitionOptions): void; + get(name: string): CustomElementConstructor | undefined; + upgrade(root: Node): void; + whenDefined(name: string): Promise; +} + +declare var CustomElementRegistry: { + prototype: CustomElementRegistry; + new(): CustomElementRegistry; +}; + +interface CustomEvent extends Event { + /** Returns any custom data event was created with. Typically used for synthetic events. */ + readonly detail: T; + /** @deprecated */ + initCustomEvent(type: string, bubbles?: boolean, cancelable?: boolean, detail?: T): void; +} + +declare var CustomEvent: { + prototype: CustomEvent; + new (type: string, eventInitDict?: CustomEventInit): CustomEvent; +}; + +/** An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. */ +interface DOMException extends Error { + /** @deprecated */ + readonly code: number; + readonly message: string; + readonly name: string; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +} + +declare var DOMException: { + prototype: DOMException; + new(message?: string, name?: string): DOMException; + readonly ABORT_ERR: number; + readonly DATA_CLONE_ERR: number; + readonly DOMSTRING_SIZE_ERR: number; + readonly HIERARCHY_REQUEST_ERR: number; + readonly INDEX_SIZE_ERR: number; + readonly INUSE_ATTRIBUTE_ERR: number; + readonly INVALID_ACCESS_ERR: number; + readonly INVALID_CHARACTER_ERR: number; + readonly INVALID_MODIFICATION_ERR: number; + readonly INVALID_NODE_TYPE_ERR: number; + readonly INVALID_STATE_ERR: number; + readonly NAMESPACE_ERR: number; + readonly NETWORK_ERR: number; + readonly NOT_FOUND_ERR: number; + readonly NOT_SUPPORTED_ERR: number; + readonly NO_DATA_ALLOWED_ERR: number; + readonly NO_MODIFICATION_ALLOWED_ERR: number; + readonly QUOTA_EXCEEDED_ERR: number; + readonly SECURITY_ERR: number; + readonly SYNTAX_ERR: number; + readonly TIMEOUT_ERR: number; + readonly TYPE_MISMATCH_ERR: number; + readonly URL_MISMATCH_ERR: number; + readonly VALIDATION_ERR: number; + readonly WRONG_DOCUMENT_ERR: number; +}; + +/** An object providing methods which are not dependent on any particular document. Such an object is returned by the Document.implementation property. */ +interface DOMImplementation { + createDocument(namespace: string | null, qualifiedName: string | null, doctype?: DocumentType | null): XMLDocument; + createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType; + createHTMLDocument(title?: string): Document; + /** @deprecated */ + hasFeature(...args: any[]): true; +} + +declare var DOMImplementation: { + prototype: DOMImplementation; + new(): DOMImplementation; +}; + +interface DOMMatrix extends DOMMatrixReadOnly { + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + m11: number; + m12: number; + m13: number; + m14: number; + m21: number; + m22: number; + m23: number; + m24: number; + m31: number; + m32: number; + m33: number; + m34: number; + m41: number; + m42: number; + m43: number; + m44: number; + invertSelf(): DOMMatrix; + multiplySelf(other?: DOMMatrixInit): DOMMatrix; + preMultiplySelf(other?: DOMMatrixInit): DOMMatrix; + rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; + rotateFromVectorSelf(x?: number, y?: number): DOMMatrix; + rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; + scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + setMatrixValue(transformList: string): DOMMatrix; + skewXSelf(sx?: number): DOMMatrix; + skewYSelf(sy?: number): DOMMatrix; + translateSelf(tx?: number, ty?: number, tz?: number): DOMMatrix; +} + +declare var DOMMatrix: { + prototype: DOMMatrix; + new(init?: string | number[]): DOMMatrix; + fromFloat32Array(array32: Float32Array): DOMMatrix; + fromFloat64Array(array64: Float64Array): DOMMatrix; + fromMatrix(other?: DOMMatrixInit): DOMMatrix; +}; + +type SVGMatrix = DOMMatrix; +declare var SVGMatrix: typeof DOMMatrix; + +type WebKitCSSMatrix = DOMMatrix; +declare var WebKitCSSMatrix: typeof DOMMatrix; + +interface DOMMatrixReadOnly { + readonly a: number; + readonly b: number; + readonly c: number; + readonly d: number; + readonly e: number; + readonly f: number; + readonly is2D: boolean; + readonly isIdentity: boolean; + readonly m11: number; + readonly m12: number; + readonly m13: number; + readonly m14: number; + readonly m21: number; + readonly m22: number; + readonly m23: number; + readonly m24: number; + readonly m31: number; + readonly m32: number; + readonly m33: number; + readonly m34: number; + readonly m41: number; + readonly m42: number; + readonly m43: number; + readonly m44: number; + flipX(): DOMMatrix; + flipY(): DOMMatrix; + inverse(): DOMMatrix; + multiply(other?: DOMMatrixInit): DOMMatrix; + rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix; + rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix; + rotateFromVector(x?: number, y?: number): DOMMatrix; + scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix; + /** @deprecated */ + scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix; + skewX(sx?: number): DOMMatrix; + skewY(sy?: number): DOMMatrix; + toFloat32Array(): Float32Array; + toFloat64Array(): Float64Array; + toJSON(): any; + transformPoint(point?: DOMPointInit): DOMPoint; + translate(tx?: number, ty?: number, tz?: number): DOMMatrix; + toString(): string; +} + +declare var DOMMatrixReadOnly: { + prototype: DOMMatrixReadOnly; + new(init?: string | number[]): DOMMatrixReadOnly; + fromFloat32Array(array32: Float32Array): DOMMatrixReadOnly; + fromFloat64Array(array64: Float64Array): DOMMatrixReadOnly; + fromMatrix(other?: DOMMatrixInit): DOMMatrixReadOnly; + toString(): string; +}; + +/** Provides the ability to parse XML or HTML source code from a string into a DOM Document. */ +interface DOMParser { + /** + * Parses string using either the HTML or XML parser, according to type, and returns the resulting Document. type can be "text/html" (which will invoke the HTML parser), or any of "text/xml", "application/xml", "application/xhtml+xml", or "image/svg+xml" (which will invoke the XML parser). + * + * For the XML parser, if string cannot be parsed, then the returned Document will contain elements describing the resulting error. + * + * Note that script elements are not evaluated during parsing, and the resulting document's encoding will always be UTF-8. + * + * Values other than the above for type will cause a TypeError exception to be thrown. + */ + parseFromString(string: string, type: DOMParserSupportedType): Document; +} + +declare var DOMParser: { + prototype: DOMParser; + new(): DOMParser; +}; + +interface DOMPoint extends DOMPointReadOnly { + w: number; + x: number; + y: number; + z: number; +} + +declare var DOMPoint: { + prototype: DOMPoint; + new(x?: number, y?: number, z?: number, w?: number): DOMPoint; + fromPoint(other?: DOMPointInit): DOMPoint; +}; + +type SVGPoint = DOMPoint; +declare var SVGPoint: typeof DOMPoint; + +interface DOMPointReadOnly { + readonly w: number; + readonly x: number; + readonly y: number; + readonly z: number; + matrixTransform(matrix?: DOMMatrixInit): DOMPoint; + toJSON(): any; +} + +declare var DOMPointReadOnly: { + prototype: DOMPointReadOnly; + new(x?: number, y?: number, z?: number, w?: number): DOMPointReadOnly; + fromPoint(other?: DOMPointInit): DOMPointReadOnly; +}; + +interface DOMQuad { + readonly p1: DOMPoint; + readonly p2: DOMPoint; + readonly p3: DOMPoint; + readonly p4: DOMPoint; + getBounds(): DOMRect; + toJSON(): any; +} + +declare var DOMQuad: { + prototype: DOMQuad; + new(p1?: DOMPointInit, p2?: DOMPointInit, p3?: DOMPointInit, p4?: DOMPointInit): DOMQuad; + fromQuad(other?: DOMQuadInit): DOMQuad; + fromRect(other?: DOMRectInit): DOMQuad; +}; + +interface DOMRect extends DOMRectReadOnly { + height: number; + width: number; + x: number; + y: number; +} + +declare var DOMRect: { + prototype: DOMRect; + new(x?: number, y?: number, width?: number, height?: number): DOMRect; + fromRect(other?: DOMRectInit): DOMRect; +}; + +type SVGRect = DOMRect; +declare var SVGRect: typeof DOMRect; + +interface DOMRectList { + readonly length: number; + item(index: number): DOMRect | null; + [index: number]: DOMRect; +} + +declare var DOMRectList: { + prototype: DOMRectList; + new(): DOMRectList; +}; + +interface DOMRectReadOnly { + readonly bottom: number; + readonly height: number; + readonly left: number; + readonly right: number; + readonly top: number; + readonly width: number; + readonly x: number; + readonly y: number; + toJSON(): any; +} + +declare var DOMRectReadOnly: { + prototype: DOMRectReadOnly; + new(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly; + fromRect(other?: DOMRectInit): DOMRectReadOnly; +}; + +/** A type returned by some APIs which contains a list of DOMString (strings). */ +interface DOMStringList { + /** Returns the number of strings in strings. */ + readonly length: number; + /** Returns true if strings contains string, and false otherwise. */ + contains(string: string): boolean; + /** Returns the string with index index from strings. */ + item(index: number): string | null; + [index: number]: string; +} + +declare var DOMStringList: { + prototype: DOMStringList; + new(): DOMStringList; +}; + +/** Used by the dataset HTML attribute to represent data for custom attributes added to elements. */ +interface DOMStringMap { + [name: string]: string | undefined; +} + +declare var DOMStringMap: { + prototype: DOMStringMap; + new(): DOMStringMap; +}; + +/** A set of space-separated tokens. Such a set is returned by Element.classList, HTMLLinkElement.relList, HTMLAnchorElement.relList, HTMLAreaElement.relList, HTMLIframeElement.sandbox, or HTMLOutputElement.htmlFor. It is indexed beginning with 0 as with JavaScript Array objects. DOMTokenList is always case-sensitive. */ +interface DOMTokenList { + /** Returns the number of tokens. */ + readonly length: number; + /** + * Returns the associated set as string. + * + * Can be set, to change the associated attribute. + */ + value: string; + toString(): string; + /** + * Adds all arguments passed, except those already present. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + */ + add(...tokens: string[]): void; + /** Returns true if token is present, and false otherwise. */ + contains(token: string): boolean; + /** Returns the token with index index. */ + item(index: number): string | null; + /** + * Removes arguments passed, if they are present. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + */ + remove(...tokens: string[]): void; + /** + * Replaces token with newToken. + * + * Returns true if token was replaced with newToken, and false otherwise. + * + * Throws a "SyntaxError" DOMException if one of the arguments is the empty string. + * + * Throws an "InvalidCharacterError" DOMException if one of the arguments contains any ASCII whitespace. + */ + replace(token: string, newToken: string): boolean; + /** + * Returns true if token is in the associated attribute's supported tokens. Returns false otherwise. + * + * Throws a TypeError if the associated attribute has no supported tokens defined. + */ + supports(token: string): boolean; + /** + * If force is not given, "toggles" token, removing it if it's present and adding it if it's not present. If force is true, adds token (same as add()). If force is false, removes token (same as remove()). + * + * Returns true if token is now present, and false otherwise. + * + * Throws a "SyntaxError" DOMException if token is empty. + * + * Throws an "InvalidCharacterError" DOMException if token contains any spaces. + */ + toggle(token: string, force?: boolean): boolean; + forEach(callbackfn: (value: string, key: number, parent: DOMTokenList) => void, thisArg?: any): void; + [index: number]: string; +} + +declare var DOMTokenList: { + prototype: DOMTokenList; + new(): DOMTokenList; +}; + +/** Used to hold the data that is being dragged during a drag and drop operation. It may hold one or more data items, each of one or more data types. For more information about drag and drop, see HTML Drag and Drop API. */ +interface DataTransfer { + /** + * Returns the kind of operation that is currently selected. If the kind of operation isn't one of those that is allowed by the effectAllowed attribute, then the operation will fail. + * + * Can be set, to change the selected operation. + * + * The possible values are "none", "copy", "link", and "move". + */ + dropEffect: "none" | "copy" | "link" | "move"; + /** + * Returns the kinds of operations that are to be allowed. + * + * Can be set (during the dragstart event), to change the allowed operations. + * + * The possible values are "none", "copy", "copyLink", "copyMove", "link", "linkMove", "move", "all", and "uninitialized", + */ + effectAllowed: "none" | "copy" | "copyLink" | "copyMove" | "link" | "linkMove" | "move" | "all" | "uninitialized"; + /** Returns a FileList of the files being dragged, if any. */ + readonly files: FileList; + /** Returns a DataTransferItemList object, with the drag data. */ + readonly items: DataTransferItemList; + /** Returns a frozen array listing the formats that were set in the dragstart event. In addition, if any files are being dragged, then one of the types will be the string "Files". */ + readonly types: ReadonlyArray; + /** Removes the data of the specified formats. Removes all data if the argument is omitted. */ + clearData(format?: string): void; + /** Returns the specified data. If there is no such data, returns the empty string. */ + getData(format: string): string; + /** Adds the specified data. */ + setData(format: string, data: string): void; + /** Uses the given element to update the drag feedback, replacing any previously specified feedback. */ + setDragImage(image: Element, x: number, y: number): void; +} + +declare var DataTransfer: { + prototype: DataTransfer; + new(): DataTransfer; +}; + +/** One drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object. */ +interface DataTransferItem { + /** Returns the drag data item kind, one of: "string", "file". */ + readonly kind: string; + /** Returns the drag data item type string. */ + readonly type: string; + /** Returns a File object, if the drag data item kind is File. */ + getAsFile(): File | null; + /** Invokes the callback with the string data as the argument, if the drag data item kind is text. */ + getAsString(callback: FunctionStringCallback | null): void; + webkitGetAsEntry(): FileSystemEntry | null; +} + +declare var DataTransferItem: { + prototype: DataTransferItem; + new(): DataTransferItem; +}; + +/** A list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList. */ +interface DataTransferItemList { + /** Returns the number of items in the drag data store. */ + readonly length: number; + /** Adds a new entry for the given data to the drag data store. If the data is plain text then a type string has to be provided also. */ + add(data: string, type: string): DataTransferItem | null; + add(data: File): DataTransferItem | null; + /** Removes all the entries in the drag data store. */ + clear(): void; + /** Removes the indexth entry in the drag data store. */ + remove(index: number): void; + [index: number]: DataTransferItem; +} + +declare var DataTransferItemList: { + prototype: DataTransferItemList; + new(): DataTransferItemList; +}; + +/** A delay-line; an AudioNode audio-processing module that causes a delay between the arrival of an input data and its propagation to the output. */ +interface DelayNode extends AudioNode { + readonly delayTime: AudioParam; +} + +declare var DelayNode: { + prototype: DelayNode; + new(context: BaseAudioContext, options?: DelayOptions): DelayNode; +}; + +/** + * The DeviceMotionEvent provides web developers with information about the speed of changes for the device's position and orientation. + * Available only in secure contexts. + */ +interface DeviceMotionEvent extends Event { + readonly acceleration: DeviceMotionEventAcceleration | null; + readonly accelerationIncludingGravity: DeviceMotionEventAcceleration | null; + readonly interval: number; + readonly rotationRate: DeviceMotionEventRotationRate | null; +} + +declare var DeviceMotionEvent: { + prototype: DeviceMotionEvent; + new(type: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent; +}; + +/** Available only in secure contexts. */ +interface DeviceMotionEventAcceleration { + readonly x: number | null; + readonly y: number | null; + readonly z: number | null; +} + +/** Available only in secure contexts. */ +interface DeviceMotionEventRotationRate { + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; +} + +/** + * The DeviceOrientationEvent provides web developers with information from the physical orientation of the device running the web page. + * Available only in secure contexts. + */ +interface DeviceOrientationEvent extends Event { + readonly absolute: boolean; + readonly alpha: number | null; + readonly beta: number | null; + readonly gamma: number | null; +} + +declare var DeviceOrientationEvent: { + prototype: DeviceOrientationEvent; + new(type: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent; +}; + +interface DocumentEventMap extends DocumentAndElementEventHandlersEventMap, GlobalEventHandlersEventMap { + "DOMContentLoaded": Event; + "fullscreenchange": Event; + "fullscreenerror": Event; + "pointerlockchange": Event; + "pointerlockerror": Event; + "readystatechange": Event; + "visibilitychange": Event; +} + +/** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */ +interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, FontFaceSource, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { + /** Sets or gets the URL for the current document. */ + readonly URL: string; + /** + * Sets or gets the color of all active links in the document. + * @deprecated + */ + alinkColor: string; + /** + * Returns a reference to the collection of elements contained by the object. + * @deprecated + */ + readonly all: HTMLAllCollection; + /** + * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order. + * @deprecated + */ + readonly anchors: HTMLCollectionOf; + /** + * Retrieves a collection of all applet objects in the document. + * @deprecated + */ + readonly applets: HTMLCollection; + /** + * Deprecated. Sets or retrieves a value that indicates the background color behind the object. + * @deprecated + */ + bgColor: string; + /** Specifies the beginning and end of the document body. */ + body: HTMLElement; + /** Returns document's encoding. */ + readonly characterSet: string; + /** + * Gets or sets the character set used to encode the object. + * @deprecated This is a legacy alias of `characterSet`. + */ + readonly charset: string; + /** Gets a value that indicates whether standards-compliant mode is switched on for the object. */ + readonly compatMode: string; + /** Returns document's content type. */ + readonly contentType: string; + /** + * Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned. + * + * Can be set, to add a new cookie to the element's set of HTTP cookies. + * + * If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting. + */ + cookie: string; + /** + * Returns the script element, or the SVG script element, that is currently executing, as long as the element represents a classic script. In the case of reentrant script execution, returns the one that most recently started executing amongst those that have not yet finished executing. + * + * Returns null if the Document is not currently executing a script or SVG script element (e.g., because the running script is an event handler, or a timeout), or if the currently executing script or SVG script element represents a module script. + */ + readonly currentScript: HTMLOrSVGScriptElement | null; + /** Returns the Window object of the active document. */ + readonly defaultView: (WindowProxy & typeof globalThis) | null; + /** Sets or gets a value that indicates whether the document can be edited. */ + designMode: string; + /** Sets or retrieves a value that indicates the reading order of the object. */ + dir: string; + /** Gets an object representing the document type declaration associated with the current document. */ + readonly doctype: DocumentType | null; + /** Gets a reference to the root node of the document. */ + readonly documentElement: HTMLElement; + /** Returns document's URL. */ + readonly documentURI: string; + /** + * Sets or gets the security domain of the document. + * @deprecated + */ + domain: string; + /** Retrieves a collection of all embed objects in the document. */ + readonly embeds: HTMLCollectionOf; + /** + * Sets or gets the foreground (text) color of the document. + * @deprecated + */ + fgColor: string; + /** Retrieves a collection, in source order, of all form objects in the document. */ + readonly forms: HTMLCollectionOf; + /** @deprecated */ + readonly fullscreen: boolean; + /** Returns true if document has the ability to display elements fullscreen and fullscreen is supported, or false otherwise. */ + readonly fullscreenEnabled: boolean; + /** Returns the head element. */ + readonly head: HTMLHeadElement; + readonly hidden: boolean; + /** Retrieves a collection, in source order, of img objects in the document. */ + readonly images: HTMLCollectionOf; + /** Gets the implementation object of the current document. */ + readonly implementation: DOMImplementation; + /** + * Returns the character encoding used to create the webpage that is loaded into the document object. + * @deprecated This is a legacy alias of `characterSet`. + */ + readonly inputEncoding: string; + /** Gets the date that the page was last modified, if the page supplies one. */ + readonly lastModified: string; + /** + * Sets or gets the color of the document links. + * @deprecated + */ + linkColor: string; + /** Retrieves a collection of all a objects that specify the href property and all area objects in the document. */ + readonly links: HTMLCollectionOf; + /** Contains information about the current URL. */ + get location(): Location; + set location(href: string | Location); + onfullscreenchange: ((this: Document, ev: Event) => any) | null; + onfullscreenerror: ((this: Document, ev: Event) => any) | null; + onpointerlockchange: ((this: Document, ev: Event) => any) | null; + onpointerlockerror: ((this: Document, ev: Event) => any) | null; + /** + * Fires when the state of the object has changed. + * @param ev The event + */ + onreadystatechange: ((this: Document, ev: Event) => any) | null; + onvisibilitychange: ((this: Document, ev: Event) => any) | null; + readonly ownerDocument: null; + readonly pictureInPictureEnabled: boolean; + /** Return an HTMLCollection of the embed elements in the Document. */ + readonly plugins: HTMLCollectionOf; + /** Retrieves a value that indicates the current state of the object. */ + readonly readyState: DocumentReadyState; + /** Gets the URL of the location that referred the user to the current page. */ + readonly referrer: string; + /** @deprecated */ + readonly rootElement: SVGSVGElement | null; + /** Retrieves a collection of all script objects in the document. */ + readonly scripts: HTMLCollectionOf; + readonly scrollingElement: Element | null; + readonly timeline: DocumentTimeline; + /** Contains the title of the document. */ + title: string; + readonly visibilityState: DocumentVisibilityState; + /** + * Sets or gets the color of the links that the user has visited. + * @deprecated + */ + vlinkColor: string; + /** + * Moves node from another document and returns it. + * + * If node is a document, throws a "NotSupportedError" DOMException or, if node is a shadow root, throws a "HierarchyRequestError" DOMException. + */ + adoptNode(node: T): T; + /** @deprecated */ + captureEvents(): void; + /** @deprecated */ + caretRangeFromPoint(x: number, y: number): Range | null; + /** @deprecated */ + clear(): void; + /** Closes an output stream and forces the sent data to display. */ + close(): void; + /** + * Creates an attribute object with a specified name. + * @param name String that sets the attribute object's name. + */ + createAttribute(localName: string): Attr; + createAttributeNS(namespace: string | null, qualifiedName: string): Attr; + /** Returns a CDATASection node whose data is data. */ + createCDATASection(data: string): CDATASection; + /** + * Creates a comment object with the specified data. + * @param data Sets the comment object's data. + */ + createComment(data: string): Comment; + /** Creates a new document. */ + createDocumentFragment(): DocumentFragment; + /** + * Creates an instance of the element for the specified tag. + * @param tagName The name of an element. + */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K]; + /** @deprecated */ + createElement(tagName: K, options?: ElementCreationOptions): HTMLElementDeprecatedTagNameMap[K]; + createElement(tagName: string, options?: ElementCreationOptions): HTMLElement; + /** + * Returns an element with namespace namespace. Its namespace prefix will be everything before ":" (U+003E) in qualifiedName or null. Its local name will be everything after ":" (U+003E) in qualifiedName or qualifiedName. + * + * If localName does not match the Name production an "InvalidCharacterError" DOMException will be thrown. + * + * If one of the following conditions is true a "NamespaceError" DOMException will be thrown: + * + * localName does not match the QName production. + * Namespace prefix is not null and namespace is the empty string. + * Namespace prefix is "xml" and namespace is not the XML namespace. + * qualifiedName or namespace prefix is "xmlns" and namespace is not the XMLNS namespace. + * namespace is the XMLNS namespace and neither qualifiedName nor namespace prefix is "xmlns". + * + * When supplied, options's is can be used to create a customized built-in element. + */ + createElementNS(namespaceURI: "http://www.w3.org/1999/xhtml", qualifiedName: string): HTMLElement; + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: K): SVGElementTagNameMap[K]; + createElementNS(namespaceURI: "http://www.w3.org/2000/svg", qualifiedName: string): SVGElement; + createElementNS(namespaceURI: string | null, qualifiedName: string, options?: ElementCreationOptions): Element; + createElementNS(namespace: string | null, qualifiedName: string, options?: string | ElementCreationOptions): Element; + createEvent(eventInterface: "AnimationEvent"): AnimationEvent; + createEvent(eventInterface: "AnimationPlaybackEvent"): AnimationPlaybackEvent; + createEvent(eventInterface: "AudioProcessingEvent"): AudioProcessingEvent; + createEvent(eventInterface: "BeforeUnloadEvent"): BeforeUnloadEvent; + createEvent(eventInterface: "BlobEvent"): BlobEvent; + createEvent(eventInterface: "ClipboardEvent"): ClipboardEvent; + createEvent(eventInterface: "CloseEvent"): CloseEvent; + createEvent(eventInterface: "CompositionEvent"): CompositionEvent; + createEvent(eventInterface: "CustomEvent"): CustomEvent; + createEvent(eventInterface: "DeviceMotionEvent"): DeviceMotionEvent; + createEvent(eventInterface: "DeviceOrientationEvent"): DeviceOrientationEvent; + createEvent(eventInterface: "DragEvent"): DragEvent; + createEvent(eventInterface: "ErrorEvent"): ErrorEvent; + createEvent(eventInterface: "Event"): Event; + createEvent(eventInterface: "Events"): Event; + createEvent(eventInterface: "FocusEvent"): FocusEvent; + createEvent(eventInterface: "FontFaceSetLoadEvent"): FontFaceSetLoadEvent; + createEvent(eventInterface: "FormDataEvent"): FormDataEvent; + createEvent(eventInterface: "GamepadEvent"): GamepadEvent; + createEvent(eventInterface: "HashChangeEvent"): HashChangeEvent; + createEvent(eventInterface: "IDBVersionChangeEvent"): IDBVersionChangeEvent; + createEvent(eventInterface: "InputEvent"): InputEvent; + createEvent(eventInterface: "KeyboardEvent"): KeyboardEvent; + createEvent(eventInterface: "MediaEncryptedEvent"): MediaEncryptedEvent; + createEvent(eventInterface: "MediaKeyMessageEvent"): MediaKeyMessageEvent; + createEvent(eventInterface: "MediaQueryListEvent"): MediaQueryListEvent; + createEvent(eventInterface: "MediaStreamTrackEvent"): MediaStreamTrackEvent; + createEvent(eventInterface: "MessageEvent"): MessageEvent; + createEvent(eventInterface: "MouseEvent"): MouseEvent; + createEvent(eventInterface: "MouseEvents"): MouseEvent; + createEvent(eventInterface: "MutationEvent"): MutationEvent; + createEvent(eventInterface: "MutationEvents"): MutationEvent; + createEvent(eventInterface: "OfflineAudioCompletionEvent"): OfflineAudioCompletionEvent; + createEvent(eventInterface: "PageTransitionEvent"): PageTransitionEvent; + createEvent(eventInterface: "PaymentMethodChangeEvent"): PaymentMethodChangeEvent; + createEvent(eventInterface: "PaymentRequestUpdateEvent"): PaymentRequestUpdateEvent; + createEvent(eventInterface: "PictureInPictureEvent"): PictureInPictureEvent; + createEvent(eventInterface: "PointerEvent"): PointerEvent; + createEvent(eventInterface: "PopStateEvent"): PopStateEvent; + createEvent(eventInterface: "ProgressEvent"): ProgressEvent; + createEvent(eventInterface: "PromiseRejectionEvent"): PromiseRejectionEvent; + createEvent(eventInterface: "RTCDTMFToneChangeEvent"): RTCDTMFToneChangeEvent; + createEvent(eventInterface: "RTCDataChannelEvent"): RTCDataChannelEvent; + createEvent(eventInterface: "RTCErrorEvent"): RTCErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceErrorEvent"): RTCPeerConnectionIceErrorEvent; + createEvent(eventInterface: "RTCPeerConnectionIceEvent"): RTCPeerConnectionIceEvent; + createEvent(eventInterface: "RTCTrackEvent"): RTCTrackEvent; + createEvent(eventInterface: "SecurityPolicyViolationEvent"): SecurityPolicyViolationEvent; + createEvent(eventInterface: "SpeechSynthesisErrorEvent"): SpeechSynthesisErrorEvent; + createEvent(eventInterface: "SpeechSynthesisEvent"): SpeechSynthesisEvent; + createEvent(eventInterface: "StorageEvent"): StorageEvent; + createEvent(eventInterface: "SubmitEvent"): SubmitEvent; + createEvent(eventInterface: "TouchEvent"): TouchEvent; + createEvent(eventInterface: "TrackEvent"): TrackEvent; + createEvent(eventInterface: "TransitionEvent"): TransitionEvent; + createEvent(eventInterface: "UIEvent"): UIEvent; + createEvent(eventInterface: "UIEvents"): UIEvent; + createEvent(eventInterface: "WebGLContextEvent"): WebGLContextEvent; + createEvent(eventInterface: "WheelEvent"): WheelEvent; + createEvent(eventInterface: string): Event; + /** + * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list + * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter. + */ + createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter | null): NodeIterator; + /** Returns a ProcessingInstruction node whose target is target and data is data. If target does not match the Name production an "InvalidCharacterError" DOMException will be thrown. If data contains "?>" an "InvalidCharacterError" DOMException will be thrown. */ + createProcessingInstruction(target: string, data: string): ProcessingInstruction; + /** Returns an empty range object that has both of its boundary points positioned at the beginning of the document. */ + createRange(): Range; + /** + * Creates a text string from the specified value. + * @param data String that specifies the nodeValue property of the text node. + */ + createTextNode(data: string): Text; + /** + * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document. + * @param root The root element or node to start traversing on. + * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow. + * @param filter A custom NodeFilter function to use. + */ + createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter | null): TreeWalker; + /** + * Executes a command on the current document, current selection, or the given range. + * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script. + * @param showUI Display the user interface, defaults to false. + * @param value Value to assign. + * @deprecated + */ + execCommand(commandId: string, showUI?: boolean, value?: string): boolean; + /** Stops document's fullscreen element from being displayed fullscreen and resolves promise when done. */ + exitFullscreen(): Promise; + exitPictureInPicture(): Promise; + exitPointerLock(): void; + /** + * Returns a reference to the first object with the specified value of the ID attribute. + * @param elementId String that specifies the ID value. + */ + getElementById(elementId: string): HTMLElement | null; + /** Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + /** + * Gets a collection of objects based on the value of the NAME or ID attribute. + * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute. + */ + getElementsByName(elementName: string): NodeListOf; + /** + * Retrieves a collection of objects based on the specified element name. + * @param name Specifies the name of an element. + */ + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + /** + * If namespace and localName are "*" returns a HTMLCollection of all descendant elements. + * + * If only namespace is "*" returns a HTMLCollection of all descendant elements whose local name is localName. + * + * If only localName is "*" returns a HTMLCollection of all descendant elements whose namespace is namespace. + * + * Otherwise, returns a HTMLCollection of all descendant elements whose namespace is namespace and local name is localName. + */ + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + /** Returns an object representing the current selection of the document that is loaded into the object displaying a webpage. */ + getSelection(): Selection | null; + /** Gets a value indicating whether the object currently has focus. */ + hasFocus(): boolean; + hasStorageAccess(): Promise; + /** + * Returns a copy of node. If deep is true, the copy also includes the node's descendants. + * + * If node is a document or a shadow root, throws a "NotSupportedError" DOMException. + */ + importNode(node: T, deep?: boolean): T; + /** + * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method. + * @param url Specifies a MIME type for the document. + * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. + * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, "fullscreen=yes, toolbar=yes"). The following values are supported. + * @param replace Specifies whether the existing entry for the document is replaced in the history list. + */ + open(unused1?: string, unused2?: string): Document; + open(url: string | URL, name: string, features: string): WindowProxy | null; + /** + * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document. + * @param commandId Specifies a command identifier. + * @deprecated + */ + queryCommandEnabled(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the specified command is in the indeterminate state. + * @param commandId String that specifies a command identifier. + * @deprecated + */ + queryCommandIndeterm(commandId: string): boolean; + /** + * Returns a Boolean value that indicates the current state of the command. + * @param commandId String that specifies a command identifier. + * @deprecated + */ + queryCommandState(commandId: string): boolean; + /** + * Returns a Boolean value that indicates whether the current command is supported on the current range. + * @param commandId Specifies a command identifier. + * @deprecated + */ + queryCommandSupported(commandId: string): boolean; + /** + * Returns the current value of the document, range, or current selection for the given command. + * @param commandId String that specifies a command identifier. + * @deprecated + */ + queryCommandValue(commandId: string): string; + /** @deprecated */ + releaseEvents(): void; + requestStorageAccess(): Promise; + /** + * Writes one or more HTML expressions to a document in the specified window. + * @param content Specifies the text and HTML tags to write. + */ + write(...text: string[]): void; + /** + * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window. + * @param content The text and HTML tags to write. + */ + writeln(...text: string[]): void; + addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Document: { + prototype: Document; + new(): Document; +}; + +interface DocumentAndElementEventHandlersEventMap { + "copy": ClipboardEvent; + "cut": ClipboardEvent; + "paste": ClipboardEvent; +} + +interface DocumentAndElementEventHandlers { + oncopy: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; + oncut: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; + onpaste: ((this: DocumentAndElementEventHandlers, ev: ClipboardEvent) => any) | null; + addEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: DocumentAndElementEventHandlers, ev: DocumentAndElementEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +/** A minimal document object that has no parent. It is used as a lightweight version of Document that stores a segment of a document structure comprised of nodes just like a standard document. The key difference is that because the document fragment isn't part of the active document tree structure, changes made to the fragment don't affect the document, cause reflow, or incur any performance impact that can occur when changes are made. */ +interface DocumentFragment extends Node, NonElementParentNode, ParentNode { + readonly ownerDocument: Document; + getElementById(elementId: string): HTMLElement | null; +} + +declare var DocumentFragment: { + prototype: DocumentFragment; + new(): DocumentFragment; +}; + +interface DocumentOrShadowRoot { + /** + * Returns the deepest element in the document through which or to which key events are being routed. This is, roughly speaking, the focused element in the document. + * + * For the purposes of this API, when a child browsing context is focused, its container is focused in the parent browsing context. For example, if the user moves the focus to a text control in an iframe, the iframe is the element returned by the activeElement API in the iframe's node document. + * + * Similarly, when the focused element is in a different node tree than documentOrShadowRoot, the element returned will be the host that's located in the same node tree as documentOrShadowRoot if documentOrShadowRoot is a shadow-including inclusive ancestor of the focused element, and null if not. + */ + readonly activeElement: Element | null; + adoptedStyleSheets: CSSStyleSheet[]; + /** Returns document's fullscreen element. */ + readonly fullscreenElement: Element | null; + readonly pictureInPictureElement: Element | null; + readonly pointerLockElement: Element | null; + /** Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. */ + readonly styleSheets: StyleSheetList; + /** + * Returns the element for the specified x coordinate and the specified y coordinate. + * @param x The x-offset + * @param y The y-offset + */ + elementFromPoint(x: number, y: number): Element | null; + elementsFromPoint(x: number, y: number): Element[]; + getAnimations(): Animation[]; +} + +interface DocumentTimeline extends AnimationTimeline { +} + +declare var DocumentTimeline: { + prototype: DocumentTimeline; + new(options?: DocumentTimelineOptions): DocumentTimeline; +}; + +/** A Node containing a doctype. */ +interface DocumentType extends Node, ChildNode { + readonly name: string; + readonly ownerDocument: Document; + readonly publicId: string; + readonly systemId: string; +} + +declare var DocumentType: { + prototype: DocumentType; + new(): DocumentType; +}; + +/** A DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element). Applications are free to interpret a drag and drop interaction in an application-specific way. */ +interface DragEvent extends MouseEvent { + /** Returns the DataTransfer object for the event. */ + readonly dataTransfer: DataTransfer | null; +} + +declare var DragEvent: { + prototype: DragEvent; + new(type: string, eventInitDict?: DragEventInit): DragEvent; +}; + +/** Inherits properties from its parent, AudioNode. */ +interface DynamicsCompressorNode extends AudioNode { + readonly attack: AudioParam; + readonly knee: AudioParam; + readonly ratio: AudioParam; + readonly reduction: number; + readonly release: AudioParam; + readonly threshold: AudioParam; +} + +declare var DynamicsCompressorNode: { + prototype: DynamicsCompressorNode; + new(context: BaseAudioContext, options?: DynamicsCompressorOptions): DynamicsCompressorNode; +}; + +interface EXT_blend_minmax { + readonly MAX_EXT: GLenum; + readonly MIN_EXT: GLenum; +} + +interface EXT_color_buffer_float { +} + +interface EXT_color_buffer_half_float { + readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: GLenum; + readonly RGB16F_EXT: GLenum; + readonly RGBA16F_EXT: GLenum; + readonly UNSIGNED_NORMALIZED_EXT: GLenum; +} + +interface EXT_float_blend { +} + +/** The EXT_frag_depth extension is part of the WebGL API and enables to set a depth value of a fragment from within the fragment shader. */ +interface EXT_frag_depth { +} + +interface EXT_sRGB { + readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: GLenum; + readonly SRGB8_ALPHA8_EXT: GLenum; + readonly SRGB_ALPHA_EXT: GLenum; + readonly SRGB_EXT: GLenum; +} + +interface EXT_shader_texture_lod { +} + +interface EXT_texture_compression_bptc { + readonly COMPRESSED_RGBA_BPTC_UNORM_EXT: GLenum; + readonly COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT: GLenum; + readonly COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT: GLenum; + readonly COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT: GLenum; +} + +interface EXT_texture_compression_rgtc { + readonly COMPRESSED_RED_GREEN_RGTC2_EXT: GLenum; + readonly COMPRESSED_RED_RGTC1_EXT: GLenum; + readonly COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: GLenum; + readonly COMPRESSED_SIGNED_RED_RGTC1_EXT: GLenum; +} + +/** The EXT_texture_filter_anisotropic extension is part of the WebGL API and exposes two constants for anisotropic filtering (AF). */ +interface EXT_texture_filter_anisotropic { + readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: GLenum; + readonly TEXTURE_MAX_ANISOTROPY_EXT: GLenum; +} + +interface EXT_texture_norm16 { + readonly R16_EXT: GLenum; + readonly R16_SNORM_EXT: GLenum; + readonly RG16_EXT: GLenum; + readonly RG16_SNORM_EXT: GLenum; + readonly RGB16_EXT: GLenum; + readonly RGB16_SNORM_EXT: GLenum; + readonly RGBA16_EXT: GLenum; + readonly RGBA16_SNORM_EXT: GLenum; +} + +interface ElementEventMap { + "fullscreenchange": Event; + "fullscreenerror": Event; +} + +/** Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. */ +interface Element extends Node, ARIAMixin, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slottable { + readonly attributes: NamedNodeMap; + /** Allows for manipulation of element's class content attribute as a set of whitespace-separated tokens through a DOMTokenList object. */ + readonly classList: DOMTokenList; + /** Returns the value of element's class content attribute. Can be set to change it. */ + className: string; + readonly clientHeight: number; + readonly clientLeft: number; + readonly clientTop: number; + readonly clientWidth: number; + /** Returns the value of element's id content attribute. Can be set to change it. */ + id: string; + /** Returns the local name. */ + readonly localName: string; + /** Returns the namespace. */ + readonly namespaceURI: string | null; + onfullscreenchange: ((this: Element, ev: Event) => any) | null; + onfullscreenerror: ((this: Element, ev: Event) => any) | null; + outerHTML: string; + readonly ownerDocument: Document; + readonly part: DOMTokenList; + /** Returns the namespace prefix. */ + readonly prefix: string | null; + readonly scrollHeight: number; + scrollLeft: number; + scrollTop: number; + readonly scrollWidth: number; + /** Returns element's shadow root, if any, and if shadow root's mode is "open", and null otherwise. */ + readonly shadowRoot: ShadowRoot | null; + /** Returns the value of element's slot content attribute. Can be set to change it. */ + slot: string; + /** Returns the HTML-uppercased qualified name. */ + readonly tagName: string; + /** Creates a shadow root for element and returns it. */ + attachShadow(init: ShadowRootInit): ShadowRoot; + /** Returns the first (starting at element) inclusive ancestor that matches selectors, and null otherwise. */ + closest(selector: K): HTMLElementTagNameMap[K] | null; + closest(selector: K): SVGElementTagNameMap[K] | null; + closest(selectors: string): E | null; + /** Returns element's first attribute whose qualified name is qualifiedName, and null if there is no such attribute otherwise. */ + getAttribute(qualifiedName: string): string | null; + /** Returns element's attribute whose namespace is namespace and local name is localName, and null if there is no such attribute otherwise. */ + getAttributeNS(namespace: string | null, localName: string): string | null; + /** Returns the qualified names of all element's attributes. Can contain duplicates. */ + getAttributeNames(): string[]; + getAttributeNode(qualifiedName: string): Attr | null; + getAttributeNodeNS(namespace: string | null, localName: string): Attr | null; + getBoundingClientRect(): DOMRect; + getClientRects(): DOMRectList; + /** Returns a HTMLCollection of the elements in the object on which the method was invoked (a document or an element) that have all the classes given by classNames. The classNames argument is interpreted as a space-separated list of classes. */ + getElementsByClassName(classNames: string): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: K): HTMLCollectionOf; + getElementsByTagName(qualifiedName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/1999/xhtml", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespaceURI: "http://www.w3.org/2000/svg", localName: string): HTMLCollectionOf; + getElementsByTagNameNS(namespace: string | null, localName: string): HTMLCollectionOf; + /** Returns true if element has an attribute whose qualified name is qualifiedName, and false otherwise. */ + hasAttribute(qualifiedName: string): boolean; + /** Returns true if element has an attribute whose namespace is namespace and local name is localName. */ + hasAttributeNS(namespace: string | null, localName: string): boolean; + /** Returns true if element has attributes, and false otherwise. */ + hasAttributes(): boolean; + hasPointerCapture(pointerId: number): boolean; + insertAdjacentElement(where: InsertPosition, element: Element): Element | null; + insertAdjacentHTML(position: InsertPosition, text: string): void; + insertAdjacentText(where: InsertPosition, data: string): void; + /** Returns true if matching selectors against element's root yields element, and false otherwise. */ + matches(selectors: string): boolean; + releasePointerCapture(pointerId: number): void; + /** Removes element's first attribute whose qualified name is qualifiedName. */ + removeAttribute(qualifiedName: string): void; + /** Removes element's attribute whose namespace is namespace and local name is localName. */ + removeAttributeNS(namespace: string | null, localName: string): void; + removeAttributeNode(attr: Attr): Attr; + /** + * Displays element fullscreen and resolves promise when done. + * + * When supplied, options's navigationUI member indicates whether showing navigation UI while in fullscreen is preferred or not. If set to "show", navigation simplicity is preferred over screen space, and if set to "hide", more screen space is preferred. User agents are always free to honor user preference over the application's. The default value "auto" indicates no application preference. + */ + requestFullscreen(options?: FullscreenOptions): Promise; + requestPointerLock(): void; + scroll(options?: ScrollToOptions): void; + scroll(x: number, y: number): void; + scrollBy(options?: ScrollToOptions): void; + scrollBy(x: number, y: number): void; + scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void; + scrollTo(options?: ScrollToOptions): void; + scrollTo(x: number, y: number): void; + /** Sets the value of element's first attribute whose qualified name is qualifiedName to value. */ + setAttribute(qualifiedName: string, value: string): void; + /** Sets the value of element's attribute whose namespace is namespace and local name is localName to value. */ + setAttributeNS(namespace: string | null, qualifiedName: string, value: string): void; + setAttributeNode(attr: Attr): Attr | null; + setAttributeNodeNS(attr: Attr): Attr | null; + setPointerCapture(pointerId: number): void; + /** + * If force is not given, "toggles" qualifiedName, removing it if it is present and adding it if it is not present. If force is true, adds qualifiedName. If force is false, removes qualifiedName. + * + * Returns true if qualifiedName is now present, and false otherwise. + */ + toggleAttribute(qualifiedName: string, force?: boolean): boolean; + /** @deprecated This is a legacy alias of `matches`. */ + webkitMatchesSelector(selectors: string): boolean; + addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var Element: { + prototype: Element; + new(): Element; +}; + +interface ElementCSSInlineStyle { + readonly style: CSSStyleDeclaration; +} + +interface ElementContentEditable { + contentEditable: string; + enterKeyHint: string; + inputMode: string; + readonly isContentEditable: boolean; +} + +interface ElementInternals extends ARIAMixin { + /** Returns the form owner of internals's target element. */ + readonly form: HTMLFormElement | null; + /** Returns a NodeList of all the label elements that internals's target element is associated with. */ + readonly labels: NodeList; + /** Returns the ShadowRoot for internals's target element, if the target element is a shadow host, or null otherwise. */ + readonly shadowRoot: ShadowRoot | null; + /** Returns the error message that would be shown to the user if internals's target element was to be checked for validity. */ + readonly validationMessage: string; + /** Returns the ValidityState object for internals's target element. */ + readonly validity: ValidityState; + /** Returns true if internals's target element will be validated when the form is submitted; false otherwise. */ + readonly willValidate: boolean; + /** Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case. */ + checkValidity(): boolean; + /** Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. */ + reportValidity(): boolean; + /** + * Sets both the state and submission value of internals's target element to value. + * + * If value is null, the element won't participate in form submission. + */ + setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void; + /** Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called. */ + setValidity(flags?: ValidityStateFlags, message?: string, anchor?: HTMLElement): void; +} + +declare var ElementInternals: { + prototype: ElementInternals; + new(): ElementInternals; +}; + +/** Events providing information related to errors in scripts or in files. */ +interface ErrorEvent extends Event { + readonly colno: number; + readonly error: any; + readonly filename: string; + readonly lineno: number; + readonly message: string; +} + +declare var ErrorEvent: { + prototype: ErrorEvent; + new(type: string, eventInitDict?: ErrorEventInit): ErrorEvent; +}; + +/** An event which takes place in the DOM. */ +interface Event { + /** Returns true or false depending on how event was initialized. True if event goes through its target's ancestors in reverse tree order, and false otherwise. */ + readonly bubbles: boolean; + /** @deprecated */ + cancelBubble: boolean; + /** Returns true or false depending on how event was initialized. Its return value does not always carry meaning, but true can indicate that part of the operation during which event was dispatched, can be canceled by invoking the preventDefault() method. */ + readonly cancelable: boolean; + /** Returns true or false depending on how event was initialized. True if event invokes listeners past a ShadowRoot node that is the root of its target, and false otherwise. */ + readonly composed: boolean; + /** Returns the object whose event listener's callback is currently being invoked. */ + readonly currentTarget: EventTarget | null; + /** Returns true if preventDefault() was invoked successfully to indicate cancelation, and false otherwise. */ + readonly defaultPrevented: boolean; + /** Returns the event's phase, which is one of NONE, CAPTURING_PHASE, AT_TARGET, and BUBBLING_PHASE. */ + readonly eventPhase: number; + /** Returns true if event was dispatched by the user agent, and false otherwise. */ + readonly isTrusted: boolean; + /** @deprecated */ + returnValue: boolean; + /** @deprecated */ + readonly srcElement: EventTarget | null; + /** Returns the object to which event is dispatched (its target). */ + readonly target: EventTarget | null; + /** Returns the event's timestamp as the number of milliseconds measured relative to the time origin. */ + readonly timeStamp: DOMHighResTimeStamp; + /** Returns the type of event, e.g. "click", "hashchange", or "submit". */ + readonly type: string; + /** Returns the invocation target objects of event's path (objects on which listeners will be invoked), except for any nodes in shadow trees of which the shadow root's mode is "closed" that are not reachable from event's currentTarget. */ + composedPath(): EventTarget[]; + /** @deprecated */ + initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void; + /** If invoked when the cancelable attribute value is true, and while executing a listener for the event with passive set to false, signals to the operation that caused event to be dispatched that it needs to be canceled. */ + preventDefault(): void; + /** Invoking this method prevents event from reaching any registered event listeners after the current one finishes running and, when dispatched in a tree, also prevents event from reaching any other objects. */ + stopImmediatePropagation(): void; + /** When dispatched in a tree, invoking this method prevents event from reaching any objects other than the current object. */ + stopPropagation(): void; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; + readonly NONE: number; +} + +declare var Event: { + prototype: Event; + new(type: string, eventInitDict?: EventInit): Event; + readonly AT_TARGET: number; + readonly BUBBLING_PHASE: number; + readonly CAPTURING_PHASE: number; + readonly NONE: number; +}; + +interface EventCounts { + forEach(callbackfn: (value: number, key: string, parent: EventCounts) => void, thisArg?: any): void; +} + +declare var EventCounts: { + prototype: EventCounts; + new(): EventCounts; +}; + +interface EventListener { + (evt: Event): void; +} + +interface EventListenerObject { + handleEvent(object: Event): void; +} + +interface EventSourceEventMap { + "error": Event; + "message": MessageEvent; + "open": Event; +} + +interface EventSource extends EventTarget { + onerror: ((this: EventSource, ev: Event) => any) | null; + onmessage: ((this: EventSource, ev: MessageEvent) => any) | null; + onopen: ((this: EventSource, ev: Event) => any) | null; + /** Returns the state of this EventSource object's connection. It can have the values described below. */ + readonly readyState: number; + /** Returns the URL providing the event stream. */ + readonly url: string; + /** Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise. */ + readonly withCredentials: boolean; + /** Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED. */ + close(): void; + readonly CLOSED: number; + readonly CONNECTING: number; + readonly OPEN: number; + addEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: EventSource, ev: EventSourceEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: (this: EventSource, event: MessageEvent) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var EventSource: { + prototype: EventSource; + new(url: string | URL, eventSourceInitDict?: EventSourceInit): EventSource; + readonly CLOSED: number; + readonly CONNECTING: number; + readonly OPEN: number; +}; + +/** EventTarget is a DOM interface implemented by objects that can receive events and may have listeners for them. */ +interface EventTarget { + /** + * Appends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched. + * + * The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options's capture. + * + * When set to true, options's capture prevents callback from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event's eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event's eventPhase attribute value is AT_TARGET. + * + * When set to true, options's passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners. + * + * When set to true, options's once indicates that the callback will only be invoked once after which the event listener will be removed. + * + * If an AbortSignal is passed for options's signal, then the event listener will be removed when signal is aborted. + * + * The event listener is appended to target's event listener list and is not appended if it has the same type, callback, and capture. + */ + addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: AddEventListenerOptions | boolean): void; + /** Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise. */ + dispatchEvent(event: Event): boolean; + /** Removes the event listener in target's event listener list with the same type, callback, and options. */ + removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void; +} + +declare var EventTarget: { + prototype: EventTarget; + new(): EventTarget; +}; + +/** @deprecated */ +interface External { + /** @deprecated */ + AddSearchProvider(): void; + /** @deprecated */ + IsSearchProviderInstalled(): void; +} + +/** @deprecated */ +declare var External: { + prototype: External; + new(): External; +}; + +/** Provides information about files and allows JavaScript in a web page to access their content. */ +interface File extends Blob { + readonly lastModified: number; + readonly name: string; + readonly webkitRelativePath: string; +} + +declare var File: { + prototype: File; + new(fileBits: BlobPart[], fileName: string, options?: FilePropertyBag): File; +}; + +/** An object of this type is returned by the files property of the HTML element; this lets you access the list of files selected with the element. It's also used for a list of files dropped into web content when using the drag and drop API; see the DataTransfer object for details on this usage. */ +interface FileList { + readonly length: number; + item(index: number): File | null; + [index: number]: File; +} + +declare var FileList: { + prototype: FileList; + new(): FileList; +}; + +interface FileReaderEventMap { + "abort": ProgressEvent; + "error": ProgressEvent; + "load": ProgressEvent; + "loadend": ProgressEvent; + "loadstart": ProgressEvent; + "progress": ProgressEvent; +} + +/** Lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. */ +interface FileReader extends EventTarget { + readonly error: DOMException | null; + onabort: ((this: FileReader, ev: ProgressEvent) => any) | null; + onerror: ((this: FileReader, ev: ProgressEvent) => any) | null; + onload: ((this: FileReader, ev: ProgressEvent) => any) | null; + onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null; + onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null; + onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null; + readonly readyState: number; + readonly result: string | ArrayBuffer | null; + abort(): void; + readAsArrayBuffer(blob: Blob): void; + readAsBinaryString(blob: Blob): void; + readAsDataURL(blob: Blob): void; + readAsText(blob: Blob, encoding?: string): void; + readonly DONE: number; + readonly EMPTY: number; + readonly LOADING: number; + addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var FileReader: { + prototype: FileReader; + new(): FileReader; + readonly DONE: number; + readonly EMPTY: number; + readonly LOADING: number; +}; + +interface FileSystem { + readonly name: string; + readonly root: FileSystemDirectoryEntry; +} + +declare var FileSystem: { + prototype: FileSystem; + new(): FileSystem; +}; + +interface FileSystemDirectoryEntry extends FileSystemEntry { + createReader(): FileSystemDirectoryReader; + getDirectory(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; + getFile(path?: string | null, options?: FileSystemFlags, successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemDirectoryEntry: { + prototype: FileSystemDirectoryEntry; + new(): FileSystemDirectoryEntry; +}; + +/** Available only in secure contexts. */ +interface FileSystemDirectoryHandle extends FileSystemHandle { + readonly kind: "directory"; + getDirectoryHandle(name: string, options?: FileSystemGetDirectoryOptions): Promise; + getFileHandle(name: string, options?: FileSystemGetFileOptions): Promise; + removeEntry(name: string, options?: FileSystemRemoveOptions): Promise; + resolve(possibleDescendant: FileSystemHandle): Promise; +} + +declare var FileSystemDirectoryHandle: { + prototype: FileSystemDirectoryHandle; + new(): FileSystemDirectoryHandle; +}; + +interface FileSystemDirectoryReader { + readEntries(successCallback: FileSystemEntriesCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemDirectoryReader: { + prototype: FileSystemDirectoryReader; + new(): FileSystemDirectoryReader; +}; + +interface FileSystemEntry { + readonly filesystem: FileSystem; + readonly fullPath: string; + readonly isDirectory: boolean; + readonly isFile: boolean; + readonly name: string; + getParent(successCallback?: FileSystemEntryCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemEntry: { + prototype: FileSystemEntry; + new(): FileSystemEntry; +}; + +interface FileSystemFileEntry extends FileSystemEntry { + file(successCallback: FileCallback, errorCallback?: ErrorCallback): void; +} + +declare var FileSystemFileEntry: { + prototype: FileSystemFileEntry; + new(): FileSystemFileEntry; +}; + +/** Available only in secure contexts. */ +interface FileSystemFileHandle extends FileSystemHandle { + readonly kind: "file"; + getFile(): Promise; +} + +declare var FileSystemFileHandle: { + prototype: FileSystemFileHandle; + new(): FileSystemFileHandle; +}; + +/** Available only in secure contexts. */ +interface FileSystemHandle { + readonly kind: FileSystemHandleKind; + readonly name: string; + isSameEntry(other: FileSystemHandle): Promise; +} + +declare var FileSystemHandle: { + prototype: FileSystemHandle; + new(): FileSystemHandle; +}; + +/** Focus-related events like focus, blur, focusin, or focusout. */ +interface FocusEvent extends UIEvent { + readonly relatedTarget: EventTarget | null; +} + +declare var FocusEvent: { + prototype: FocusEvent; + new(type: string, eventInitDict?: FocusEventInit): FocusEvent; +}; + +interface FontFace { + ascentOverride: string; + descentOverride: string; + display: string; + family: string; + featureSettings: string; + lineGapOverride: string; + readonly loaded: Promise; + readonly status: FontFaceLoadStatus; + stretch: string; + style: string; + unicodeRange: string; + variant: string; + variationSettings: string; + weight: string; + load(): Promise; +} + +declare var FontFace: { + prototype: FontFace; + new(family: string, source: string | BinaryData, descriptors?: FontFaceDescriptors): FontFace; +}; + +interface FontFaceSetEventMap { + "loading": Event; + "loadingdone": Event; + "loadingerror": Event; +} + +interface FontFaceSet extends EventTarget { + onloading: ((this: FontFaceSet, ev: Event) => any) | null; + onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null; + onloadingerror: ((this: FontFaceSet, ev: Event) => any) | null; + readonly ready: Promise; + readonly status: FontFaceSetLoadStatus; + check(font: string, text?: string): boolean; + load(font: string, text?: string): Promise; + forEach(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any): void; + addEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: FontFaceSet, ev: FontFaceSetEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var FontFaceSet: { + prototype: FontFaceSet; + new(initialFaces: FontFace[]): FontFaceSet; +}; + +interface FontFaceSetLoadEvent extends Event { + readonly fontfaces: ReadonlyArray; +} + +declare var FontFaceSetLoadEvent: { + prototype: FontFaceSetLoadEvent; + new(type: string, eventInitDict?: FontFaceSetLoadEventInit): FontFaceSetLoadEvent; +}; + +interface FontFaceSource { + readonly fonts: FontFaceSet; +} + +/** Provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest.send() method. It uses the same format a form would use if the encoding type were set to "multipart/form-data". */ +interface FormData { + append(name: string, value: string | Blob, fileName?: string): void; + delete(name: string): void; + get(name: string): FormDataEntryValue | null; + getAll(name: string): FormDataEntryValue[]; + has(name: string): boolean; + set(name: string, value: string | Blob, fileName?: string): void; + forEach(callbackfn: (value: FormDataEntryValue, key: string, parent: FormData) => void, thisArg?: any): void; +} + +declare var FormData: { + prototype: FormData; + new(form?: HTMLFormElement): FormData; +}; + +interface FormDataEvent extends Event { + /** Returns a FormData object representing names and values of elements associated to the target form. Operations on the FormData object will affect form data to be submitted. */ + readonly formData: FormData; +} + +declare var FormDataEvent: { + prototype: FormDataEvent; + new(type: string, eventInitDict: FormDataEventInit): FormDataEvent; +}; + +/** A change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels. */ +interface GainNode extends AudioNode { + readonly gain: AudioParam; +} + +declare var GainNode: { + prototype: GainNode; + new(context: BaseAudioContext, options?: GainOptions): GainNode; +}; + +/** + * This Gamepad API interface defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id. + * Available only in secure contexts. + */ +interface Gamepad { + readonly axes: ReadonlyArray; + readonly buttons: ReadonlyArray; + readonly connected: boolean; + readonly hapticActuators: ReadonlyArray; + readonly id: string; + readonly index: number; + readonly mapping: GamepadMappingType; + readonly timestamp: DOMHighResTimeStamp; +} + +declare var Gamepad: { + prototype: Gamepad; + new(): Gamepad; +}; + +/** + * An individual button of a gamepad or other controller, allowing access to the current state of different types of buttons available on the control device. + * Available only in secure contexts. + */ +interface GamepadButton { + readonly pressed: boolean; + readonly touched: boolean; + readonly value: number; +} + +declare var GamepadButton: { + prototype: GamepadButton; + new(): GamepadButton; +}; + +/** + * This Gamepad API interface contains references to gamepads connected to the system, which is what the gamepad events Window.gamepadconnected and Window.gamepaddisconnected are fired in response to. + * Available only in secure contexts. + */ +interface GamepadEvent extends Event { + readonly gamepad: Gamepad; +} + +declare var GamepadEvent: { + prototype: GamepadEvent; + new(type: string, eventInitDict: GamepadEventInit): GamepadEvent; +}; + +/** This Gamepad API interface represents hardware in the controller designed to provide haptic feedback to the user (if available), most commonly vibration hardware. */ +interface GamepadHapticActuator { + readonly type: GamepadHapticActuatorType; +} + +declare var GamepadHapticActuator: { + prototype: GamepadHapticActuator; + new(): GamepadHapticActuator; +}; + +interface GenericTransformStream { + readonly readable: ReadableStream; + readonly writable: WritableStream; +} + +/** An object able to programmatically obtain the position of the device. It gives Web content access to the location of the device. This allows a Web site or app to offer customized results based on the user's location. */ +interface Geolocation { + clearWatch(watchId: number): void; + getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): void; + watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback | null, options?: PositionOptions): number; +} + +declare var Geolocation: { + prototype: Geolocation; + new(): Geolocation; +}; + +/** Available only in secure contexts. */ +interface GeolocationCoordinates { + readonly accuracy: number; + readonly altitude: number | null; + readonly altitudeAccuracy: number | null; + readonly heading: number | null; + readonly latitude: number; + readonly longitude: number; + readonly speed: number | null; +} + +declare var GeolocationCoordinates: { + prototype: GeolocationCoordinates; + new(): GeolocationCoordinates; +}; + +/** Available only in secure contexts. */ +interface GeolocationPosition { + readonly coords: GeolocationCoordinates; + readonly timestamp: EpochTimeStamp; +} + +declare var GeolocationPosition: { + prototype: GeolocationPosition; + new(): GeolocationPosition; +}; + +interface GeolocationPositionError { + readonly code: number; + readonly message: string; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +} + +declare var GeolocationPositionError: { + prototype: GeolocationPositionError; + new(): GeolocationPositionError; + readonly PERMISSION_DENIED: number; + readonly POSITION_UNAVAILABLE: number; + readonly TIMEOUT: number; +}; + +interface GlobalEventHandlersEventMap { + "abort": UIEvent; + "animationcancel": AnimationEvent; + "animationend": AnimationEvent; + "animationiteration": AnimationEvent; + "animationstart": AnimationEvent; + "auxclick": MouseEvent; + "beforeinput": InputEvent; + "blur": FocusEvent; + "cancel": Event; + "canplay": Event; + "canplaythrough": Event; + "change": Event; + "click": MouseEvent; + "close": Event; + "compositionend": CompositionEvent; + "compositionstart": CompositionEvent; + "compositionupdate": CompositionEvent; + "contextmenu": MouseEvent; + "cuechange": Event; + "dblclick": MouseEvent; + "drag": DragEvent; + "dragend": DragEvent; + "dragenter": DragEvent; + "dragleave": DragEvent; + "dragover": DragEvent; + "dragstart": DragEvent; + "drop": DragEvent; + "durationchange": Event; + "emptied": Event; + "ended": Event; + "error": ErrorEvent; + "focus": FocusEvent; + "focusin": FocusEvent; + "focusout": FocusEvent; + "formdata": FormDataEvent; + "gotpointercapture": PointerEvent; + "input": Event; + "invalid": Event; + "keydown": KeyboardEvent; + "keypress": KeyboardEvent; + "keyup": KeyboardEvent; + "load": Event; + "loadeddata": Event; + "loadedmetadata": Event; + "loadstart": Event; + "lostpointercapture": PointerEvent; + "mousedown": MouseEvent; + "mouseenter": MouseEvent; + "mouseleave": MouseEvent; + "mousemove": MouseEvent; + "mouseout": MouseEvent; + "mouseover": MouseEvent; + "mouseup": MouseEvent; + "pause": Event; + "play": Event; + "playing": Event; + "pointercancel": PointerEvent; + "pointerdown": PointerEvent; + "pointerenter": PointerEvent; + "pointerleave": PointerEvent; + "pointermove": PointerEvent; + "pointerout": PointerEvent; + "pointerover": PointerEvent; + "pointerup": PointerEvent; + "progress": ProgressEvent; + "ratechange": Event; + "reset": Event; + "resize": UIEvent; + "scroll": Event; + "securitypolicyviolation": SecurityPolicyViolationEvent; + "seeked": Event; + "seeking": Event; + "select": Event; + "selectionchange": Event; + "selectstart": Event; + "slotchange": Event; + "stalled": Event; + "submit": SubmitEvent; + "suspend": Event; + "timeupdate": Event; + "toggle": Event; + "touchcancel": TouchEvent; + "touchend": TouchEvent; + "touchmove": TouchEvent; + "touchstart": TouchEvent; + "transitioncancel": TransitionEvent; + "transitionend": TransitionEvent; + "transitionrun": TransitionEvent; + "transitionstart": TransitionEvent; + "volumechange": Event; + "waiting": Event; + "webkitanimationend": Event; + "webkitanimationiteration": Event; + "webkitanimationstart": Event; + "webkittransitionend": Event; + "wheel": WheelEvent; +} + +interface GlobalEventHandlers { + /** + * Fires when the user aborts the download. + * @param ev The event. + */ + onabort: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + onanimationcancel: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + onanimationend: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + onanimationiteration: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + onanimationstart: ((this: GlobalEventHandlers, ev: AnimationEvent) => any) | null; + onauxclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onbeforeinput: ((this: GlobalEventHandlers, ev: InputEvent) => any) | null; + /** + * Fires when the object loses the input focus. + * @param ev The focus event. + */ + onblur: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + oncancel: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback is possible, but would require further buffering. + * @param ev The event. + */ + oncanplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + oncanplaythrough: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the contents of the object or selection have changed. + * @param ev The event. + */ + onchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the left mouse button on the object + * @param ev The mouse event. + */ + onclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onclose: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user clicks the right mouse button in the client area, opening the context menu. + * @param ev The mouse event. + */ + oncontextmenu: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + oncuechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user double-clicks the object. + * @param ev The mouse event. + */ + ondblclick: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires on the source object continuously during a drag operation. + * @param ev The event. + */ + ondrag: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user releases the mouse at the close of a drag operation. + * @param ev The event. + */ + ondragend: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element when the user drags the object to a valid drop target. + * @param ev The drag event. + */ + ondragenter: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. + * @param ev The drag event. + */ + ondragleave: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the target element continuously while the user drags the object over a valid drop target. + * @param ev The event. + */ + ondragover: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Fires on the source object when the user starts to drag a text selection or selected object. + * @param ev The event. + */ + ondragstart: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + ondrop: ((this: GlobalEventHandlers, ev: DragEvent) => any) | null; + /** + * Occurs when the duration attribute is updated. + * @param ev The event. + */ + ondurationchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the media element is reset to its initial state. + * @param ev The event. + */ + onemptied: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the end of playback is reached. + * @param ev The event + */ + onended: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when an error occurs during object loading. + * @param ev The event. + */ + onerror: OnErrorEventHandler; + /** + * Fires when the object receives focus. + * @param ev The event. + */ + onfocus: ((this: GlobalEventHandlers, ev: FocusEvent) => any) | null; + onformdata: ((this: GlobalEventHandlers, ev: FormDataEvent) => any) | null; + ongotpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + oninput: ((this: GlobalEventHandlers, ev: Event) => any) | null; + oninvalid: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user presses a key. + * @param ev The keyboard event + */ + onkeydown: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user presses an alphanumeric key. + * @param ev The event. + * @deprecated + */ + onkeypress: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires when the user releases a key. + * @param ev The keyboard event + */ + onkeyup: ((this: GlobalEventHandlers, ev: KeyboardEvent) => any) | null; + /** + * Fires immediately after the browser loads the object. + * @param ev The event. + */ + onload: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when media data is loaded at the current playback position. + * @param ev The event. + */ + onloadeddata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the duration and dimensions of the media have been determined. + * @param ev The event. + */ + onloadedmetadata: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when Internet Explorer begins looking for media data. + * @param ev The event. + */ + onloadstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onlostpointercapture: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Fires when the user clicks the object with either mouse button. + * @param ev The mouse event. + */ + onmousedown: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onmouseenter: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + onmouseleave: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse over the object. + * @param ev The mouse event. + */ + onmousemove: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer outside the boundaries of the object. + * @param ev The mouse event. + */ + onmouseout: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user moves the mouse pointer into the object. + * @param ev The mouse event. + */ + onmouseover: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Fires when the user releases a mouse button while the mouse is over the object. + * @param ev The mouse event. + */ + onmouseup: ((this: GlobalEventHandlers, ev: MouseEvent) => any) | null; + /** + * Occurs when playback is paused. + * @param ev The event. + */ + onpause: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the play method is requested. + * @param ev The event. + */ + onplay: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the audio or video has started playing. + * @param ev The event. + */ + onplaying: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null; + /** + * Occurs to indicate progress while downloading media data. + * @param ev The event. + */ + onprogress: ((this: GlobalEventHandlers, ev: ProgressEvent) => any) | null; + /** + * Occurs when the playback rate is increased or decreased. + * @param ev The event. + */ + onratechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the user resets a form. + * @param ev The event. + */ + onreset: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onresize: ((this: GlobalEventHandlers, ev: UIEvent) => any) | null; + /** + * Fires when the user repositions the scroll box in the scroll bar on the object. + * @param ev The event. + */ + onscroll: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onsecuritypolicyviolation: ((this: GlobalEventHandlers, ev: SecurityPolicyViolationEvent) => any) | null; + /** + * Occurs when the seek operation ends. + * @param ev The event. + */ + onseeked: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the current playback position is moved. + * @param ev The event. + */ + onseeking: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Fires when the current selection changes. + * @param ev The event. + */ + onselect: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onselectionchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onselectstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onslotchange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when the download has stopped. + * @param ev The event. + */ + onstalled: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onsubmit: ((this: GlobalEventHandlers, ev: SubmitEvent) => any) | null; + /** + * Occurs if the load operation has been intentionally halted. + * @param ev The event. + */ + onsuspend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs to indicate the current playback position. + * @param ev The event. + */ + ontimeupdate: ((this: GlobalEventHandlers, ev: Event) => any) | null; + ontoggle: ((this: GlobalEventHandlers, ev: Event) => any) | null; + ontouchcancel?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontouchend?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontouchmove?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontouchstart?: ((this: GlobalEventHandlers, ev: TouchEvent) => any) | null | undefined; + ontransitioncancel: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + ontransitionend: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + ontransitionrun: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + ontransitionstart: ((this: GlobalEventHandlers, ev: TransitionEvent) => any) | null; + /** + * Occurs when the volume is changed, or playback is muted or unmuted. + * @param ev The event. + */ + onvolumechange: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** + * Occurs when playback stops because the next frame of a video resource is not available. + * @param ev The event. + */ + onwaiting: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** @deprecated This is a legacy alias of `onanimationend`. */ + onwebkitanimationend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** @deprecated This is a legacy alias of `onanimationiteration`. */ + onwebkitanimationiteration: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** @deprecated This is a legacy alias of `onanimationstart`. */ + onwebkitanimationstart: ((this: GlobalEventHandlers, ev: Event) => any) | null; + /** @deprecated This is a legacy alias of `ontransitionend`. */ + onwebkittransitionend: ((this: GlobalEventHandlers, ev: Event) => any) | null; + onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null; + addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +interface HTMLAllCollection { + /** Returns the number of elements in the collection. */ + readonly length: number; + /** Returns the item with index index from the collection (determined by tree order). */ + item(nameOrIndex?: string): HTMLCollection | Element | null; + /** + * Returns the item with ID or name name from the collection. + * + * If there are multiple matching items, then an HTMLCollection object containing all those elements is returned. + * + * Only button, form, iframe, input, map, meta, object, select, and textarea elements can have a name for the purpose of this method; their name is given by the value of their name attribute. + */ + namedItem(name: string): HTMLCollection | Element | null; + [index: number]: Element; +} + +declare var HTMLAllCollection: { + prototype: HTMLAllCollection; + new(): HTMLAllCollection; +}; + +/** Hyperlink elements and provides special properties and methods (beyond those of the regular HTMLElement object interface that they inherit from) for manipulating the layout and presentation of such elements. */ +interface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils { + /** + * Sets or retrieves the character set used to encode the object. + * @deprecated + */ + charset: string; + /** + * Sets or retrieves the coordinates of the object. + * @deprecated + */ + coords: string; + download: string; + /** Sets or retrieves the language code of the object. */ + hreflang: string; + /** + * Sets or retrieves the shape of the object. + * @deprecated + */ + name: string; + ping: string; + referrerPolicy: string; + /** Sets or retrieves the relationship between the object and the destination of the link. */ + rel: string; + readonly relList: DOMTokenList; + /** + * Sets or retrieves the relationship between the object and the destination of the link. + * @deprecated + */ + rev: string; + /** + * Sets or retrieves the shape of the object. + * @deprecated + */ + shape: string; + /** Sets or retrieves the window or frame at which to target content. */ + target: string; + /** Retrieves or sets the text of the object as a string. */ + text: string; + type: string; + addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var HTMLAnchorElement: { + prototype: HTMLAnchorElement; + new(): HTMLAnchorElement; +}; + +/** Provides special properties and methods (beyond those of the regular object HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of elements. */ +interface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils { + /** Sets or retrieves a text alternative to the graphic. */ + alt: string; + /** Sets or retrieves the coordinates of the object. */ + coords: string; + download: string; + /** + * Sets or gets whether clicks in this region cause action. + * @deprecated + */ + noHref: boolean; + ping: string; + referrerPolicy: string; + rel: string; + readonly relList: DOMTokenList; + /** Sets or retrieves the shape of the object. */ + shape: string; + /** Sets or retrieves the window or frame at which to target content. */ + target: string; + addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void; + addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; + removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void; + removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void; +} + +declare var HTMLAreaElement: { + prototype: HTMLAreaElement; + new(): HTMLAreaElement; +}; + +/** Provides access to the properties of