diff --git a/.agents/rules/docs.mdc b/.agents/rules/docs.mdc index 6ba8b2d6e..22ea3d57c 100644 --- a/.agents/rules/docs.mdc +++ b/.agents/rules/docs.mdc @@ -31,7 +31,7 @@ Consult these guides before working on related tasks: ## Writing documentation pages -Pages live in `pages/**/*.mdx`. Use the flat convention: leaf pages are `foo.mdx`; only pages with sub-pages use `foo/index.mdx` (both render as `/foo/`). +Pages live in `content/**/*.mdx` — the `docs` content collection, rendered by `pages/[...slug].astro`. Use the flat convention: leaf pages are `foo.mdx`; only pages with sub-pages use `foo/index.mdx` (both render as `/foo/`). - Write in simple English: short sentences, common words, direct verbs (`Use`, `Add`, `Set`). - Component docs use singular naming in frontmatter and filename: `title: Card`, `card.mdx` (not `cards.mdx`). @@ -39,18 +39,19 @@ Pages live in `pages/**/*.mdx`. Use the flat convention: leaf pages are `foo.mdx ### Frontmatter -Static YAML only. Required keys plus the layout: +Static YAML only, validated by the collection schema in `docs/content.config.ts` — an unknown or mistyped key fails the build. Required keys: ```yaml --- title: Alert summary: Short one-sentence summary of what this component does. description: Practical description of when and why to use it. -layout: '@shared/layouts/DocsMdxLayout.astro' --- ``` -Optional: `bootstrapLink: components/alerts/` when the component extends a Bootstrap component. +No `layout:` key — the route picks the layout. + +Optional keys: `seoTitle`, `seoDescription`, `icon`, `order`, `related`, `docs-libs`, `css-plugins`, `hide-pagination`, `added-in`. Anything else is rejected. ### Examples diff --git a/.agents/rules/main.mdc b/.agents/rules/main.mdc index 7bb0d589e..9a3da1c0e 100644 --- a/.agents/rules/main.mdc +++ b/.agents/rules/main.mdc @@ -13,11 +13,33 @@ Shared instructions for all AI agents (Claude Code, Cursor, etc.). Canonical age - `core/` — `@tabler/core`: SCSS sources (`core/scss/`), JS, the distributable framework. - `preview/` — `@tabler/preview`: demo site built with Astro (pages in `preview/pages/*.astro`). -- `docs/` — `@tabler/docs`: documentation site built with Astro (pages in `docs/pages/**/*.mdx`); docs-specific rules: `.agents/rules/docs.mdc`. +- `docs/` — `@tabler/docs`: documentation site built with Astro (content in `docs/content/**/*.mdx`); docs-specific rules: `.agents/rules/docs.mdc`. - `shared/` — Astro components (`ui/`, `components/`, `layouts/`, `lib/`) shared by `preview` and `docs` via `@shared`; JSON data in `data/` via `@data`; plus `static/`. - `docs/components/` — docs-only Astro components (`Example`, menu, …) via `@components`. - Package manager: pnpm workspaces + turbo. Node.js >= 22.12. +## Skills + +Task-specific instructions live in `.agents/skills//SKILL.md` — read the matching one before starting, it is the source of truth for that area. + +| Skill | Use it when | +| --- | --- | +| `ui-component` | creating or extending a component in `shared/ui/` or `shared/components/` | +| `astro-scripts` | a component or page needs client-side JavaScript | +| `page-layouts` | choosing or changing the page chrome (`shared/layouts/`) | +| `shared-lib` | moving logic into `shared/lib/` and testing it | +| `core-scss` | writing or changing styles in `core/scss/` | +| `core-js` | working on the framework JavaScript in `core/js/` | +| `demo-pages` | adding or updating a page in `preview/pages/` | +| `write-docs` | writing or updating a page in `docs/content/` | +| `class-reference` | a docs page needs its `classnames` table added or refreshed | +| `navigation` | menus, page URLs and docs redirects | +| `astro-dev` | starting a dev server and verifying a change in the browser | +| `html-diff` | proving a refactor changes no rendered HTML | +| `build-pipeline` | assets missing, stale or growing; editing `.build/` or the asset manifests | +| `generate-changeset` | writing a changeset (always — never hand-write the file) | +| `mr-description` | drafting an MR/PR title and description | + ## Language - Write all repository content in English: code, comments, documentation, commit messages, PR titles and descriptions. @@ -28,6 +50,10 @@ Shared instructions for all AI agents (Claude Code, Cursor, etc.). Canonical age ### Astro pages and components - Pages are Astro components; reusable markup lives in `shared/components/`. +- Building or changing a shared component: follow the `ui-component` skill (Props interface, prop names, class composition, slots). +- Client-side JavaScript: follow the `astro-scripts` skill. Always ` + + +``` + +- `BEGIN … / END …` comments mark the block in the copied HTML. Use the component name in caps. +- A named `init…` function plus the `readyState` guard, never a bare call: the script may be parsed after `DOMContentLoaded` has already fired. +- The component takes a required `id` prop and derives ids and selectors from it in the frontmatter. Never query by class or by tag — a page renders many instances. + +## 4. Passing data with `define:vars` + +`define:vars` JSON-serialises the values and declares them as consts at the top of the script. It carries data only: no functions, no DOM nodes, no closures over frontmatter helpers. Pass config objects whole (`chartOptions`, `markers`, `sortKeys`) instead of interpolating them into a template string. + +Two known snags: + +- **Astro wraps a `define:vars` script in an IIFE.** Anything the markup calls (`onclick="setPageListItems(this)"`) must be assigned to `window` explicitly — see `shared/components/demo/AdvancedTable.astro`. If several instances define the same global, make it stateless and resolve the instance from the clicked element. +- The type checker does not see `define:vars` bindings used inside template literals. `shared/components/marketing/hero/Side.astro` carries a `// @ts-nocheck` for exactly that; copy the comment with its explanation rather than restructuring the script. + +## 5. When the script has to be a string + +If caller-supplied JS must land *inside* a function body, `define:vars` cannot do it — it injects variables, not code. Then build the script as a template string in the frontmatter and render it with `` inside `` (see `shared/ui/Signature.astro`). Serialise every interpolated value with `JSON.stringify` and keep raw-JS props documented as an escape hatch. + +## 6. Instance registries + +Plugin instances go into a namespaced global keyed by id, so demo pages, docs examples, and the browser console can reach them: + +```js +window.tabler_rating ??= {} +window.tabler_rating[ratingKey] = new StarRating(ratingSelector, { … }) +``` + +`window.tabler_list`, `window.tabler_rating`, … follow the same shape. Never store an instance in a bare global. + +## 7. Loading the library + +The library itself is not imported — it is a global loaded from `libs.json`: + +1. Check `core/libs.json` for the plugin (`npm`, `js`, `css`, `head`); add an entry if it is missing. +2. Preview pages declare it on the layout: `pageLibs={['nouislider', 'tom-select']}` on `DefaultLayout` / `BaseLayout`. +3. Docs pages declare it in front matter: `docs-libs: apexcharts` (and `css-plugins:` for extra `tabler-*.css`). + +A component that silently assumes a global is a broken page whenever someone forgets the prop — say which lib it needs in a frontmatter comment and in the docs page. + +## 8. Prettier caveat + +`prettier-plugin-astro` cannot parse HTML comments or ` ``` -#### Styles +Styles: ```html ``` -## Building locally +### Download -To build a copy of Tabler locally, you have two options. You can either set up your device directly with the development tools required to build Tabler, or if you would prefer not to install all the development dependencies directly onto your device, you can use a Dockerfile that Tabler provides to build a docker image. Instructions follow below. +If you don't use a package manager, you can [download the latest release](https://github.com/tabler/tabler/releases) as a ZIP archive. -### First steps: Downloading the Tabler source files +### Quick start -With either method, the first thing you'll want to do is download a copy of the Tabler source files to your device. +Create an HTML file with Tabler's CSS and JavaScript loaded from the CDN and start building: -#### From the Tabler GitHub releases page - -If you don't want to edit the source code once you've downloaded it, and aren't interested in merging future project updates into your copy, you can just download the source files straight from the [Tabler releases on GitHub](https://github.com/tabler/tabler/releases) and extract the contents to a directory called `tabler`. - -#### Cloning with Git - -If you **do** wish to edit the source code after downloading it, for example to contribute changes back to the Tabler project, you'll want to do this by cloning it with Git: -1. If you don't have Git installed on your device, download and install it. You can find instructions at [https://git-scm.com/downloads](https://git-scm.com/downloads). -2. (Optional) **Windows users:** you could optionally install Git in the `C:\Program Files\git\bin` directory and run `npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"` to change the default shell. -3. Clone the Tabler project into a folder on your device. Instructions can be found at [cloning a repository](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository). - -### Installing and running development tools directly - -1. [Install Node.js](https://nodejs.org/download/) (version 22.12 or newer), which we use to manage our dependencies. -2. [Install pnpm](https://pnpm.io/installation) (We recommend either by [Using Corepack](https://pnpm.io/installation#using-corepack) or by [Using npm](https://pnpm.io/installation#using-npm)) -3. From the root `/tabler` directory where you downloaded the Tabler source files, run installation on the command line: -```sh -pnpm install +```html + + + + + + Tabler demo + + + +

Hello, Tabler!

+ + + + ``` -4. Then execute the following to start up the application stack: -```sh -pnpm run start -``` -5. Open [http://localhost:3000](http://localhost:3000) to view the preview website in your browser, or [http://localhost:3010](http://localhost:3010) to view the documentation website - and voilà. -Changes to most of the source files of Tabler core, preview and docs will rebuild the application and refresh the page. -**Note**: -If you wish to perform a one-off production build without a dev server, you can run: +Or try it without installing anything: open the [tabler-starter](https://github.com/tabler/tabler-starter) template on [StackBlitz](https://stackblitz.com/github/tabler/tabler-starter), [CodeSandbox](https://codesandbox.io/s/github/tabler/tabler-starter) or [GitHub Codespaces](https://codespaces.new/tabler/tabler-starter). + +## 📖 Documentation + +The full documentation is available at [docs.tabler.io](https://docs.tabler.io/). To see what changed in each release, check the [changelog](core/CHANGELOG.md) and [GitHub releases](https://github.com/tabler/tabler/releases). + +### Upgrading to 1.5 + +Tabler 1.5 ships Bootstrap inside the package, moves the Sass sources to the module system, and drops a few unused variables. Read the [upgrade guide](https://docs.tabler.io/ui/getting-started/upgrade/) before updating from 1.4 — it lists every breaking change with a before-and-after example. + +## 🛠️ Development + +To build a copy of Tabler locally, you have two options: set up the development tools directly on your device, or use the provided Docker setup. You can also start right away in the cloud with [GitHub Codespaces](https://codespaces.new/tabler/tabler) — the dev container installs everything for you. + +### Local setup + +1. Install [Node.js](https://nodejs.org/download/) (version 22.12 or newer) and [pnpm](https://pnpm.io/installation) (we recommend [Corepack](https://pnpm.io/installation#using-corepack)). +2. Clone the repository: + + ```sh + git clone https://github.com/tabler/tabler.git + cd tabler + ``` + +3. Install dependencies: + + ```sh + pnpm install + ``` + +4. Start the development servers: + + ```sh + pnpm run dev + ``` + +5. Open [http://localhost:3000](http://localhost:3000) to view the preview website, or [http://localhost:3010](http://localhost:3010) to view the documentation website. Changes to most source files of Tabler core, preview and docs will rebuild the application and refresh the page. + +To perform a one-off production build without a dev server, run: + ```sh pnpm run build ``` +### Docker -### Installing and running development tools with Docker +1. From the root `tabler` directory, build the image: -**Plain Docker** + ```sh + docker build -t tabler . + ``` -Here is an example of how to use this image: +2. Run the image. The following command mounts the source directories into the container and exposes port 3000 (preview) and port 3010 (documentation): -1. From the root `/tabler` directory where you downloaded the Tabler source files, build the tabler image: -```sh -docker build -t tabler . -``` -2. Run the tabler image. The following command mounts the source directories into the container, exposes port 3000 to browse the preview website and port 3010 to browse the documentation website: -```sh -docker run -p 3000:3000 -p 3010:3010 -v $(pwd)/core:/app/core -v $(pwd)/preview:/app/preview -v $(pwd)/docs:/app/docs -v $(pwd)/shared:/app/shared tabler -``` -3. Open your browser to [http://localhost:3000](http://localhost:3000) (preview) or [http://localhost:3010](http://localhost:3010) (documentation). Edit anything in the `core/`, `preview/`, `docs/` or `shared/` folders and watch your browser refresh the page after it has been rebuilt. + ```sh + docker run -p 3000:3000 -p 3010:3010 -v $(pwd)/core:/app/core -v $(pwd)/preview:/app/preview -v $(pwd)/docs:/app/docs -v $(pwd)/shared:/app/shared tabler + ``` -**Docker Compose** +3. Open [http://localhost:3000](http://localhost:3000) (preview) or [http://localhost:3010](http://localhost:3010) (documentation). Edit anything in the `core/`, `preview/`, `docs/` or `shared/` folders and watch your browser refresh the page after it has been rebuilt. -You can also use the docker compose config from this repo. From the root `/tabler` directory where you downloaded the Tabler source files, use `docker compose build && docker compose up` or `docker compose up --build` to build and start the container. Edit anything in the `core/`, `preview/`, `docs/` or `shared/` folders the same way as with plain docker and access the same URLs and ports in your browser. +Alternatively, use Docker Compose: `docker compose up --build` builds and starts the container with the same mounts, ports and URLs. -## Bugs and feature requests +## 🤝 Contributing -Found a bug or have a feature request? [Please open a new issue](https://github.com/tabler/tabler/issues/new). +We welcome contributions of all kinds! Please read the [contributing guide](CONTRIBUTING.md) to learn about the development workflow, project structure and conventions. By participating, you agree to follow our [Code of Conduct](.github/CODE_OF_CONDUCT.md). + +- **Found a bug?** [Open a bug report](https://github.com/tabler/tabler/issues/new?template=bug_report.yml). +- **Have an idea?** [Open a feature request](https://github.com/tabler/tabler/issues/new?template=feature_request.yml) or start a [discussion](https://github.com/tabler/tabler/discussions). +- **Found a security issue?** Please report it privately — see our [security policy](SECURITY.md). + +## 🪴 Project activity + +

+ Repobeats analytics image +

## 🤓 Creators @@ -171,17 +189,22 @@ Found a bug or have a feature request? [Please open a new issue](https://github. - - +**Bartosz Dobija** + +- + ## 👨‍🚀 Contributors This project exists thanks to all the people who contribute. - + + Tabler contributors + -## Social media +## 📣 Social media -Stay up to date by joining our community on X and Facebook +Stay up to date by joining our community on [X](https://x.com/tabler_io) and [Facebook](https://www.facebook.com/tabler.io). -## License - -See the [LICENSE](https://github.com/tabler/tabler/blob/master/LICENSE) file. +## 📄 License +Tabler is licensed under the [MIT License](LICENSE). diff --git a/SECURITY.md b/SECURITY.md index 26bdf1e14..6f2bbbe1e 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,16 +1,28 @@ # Security Policy -We take security very seriously and ask that you follow the following process. +We take security seriously and appreciate responsible disclosure of vulnerabilities. -## Supported Versions +## Supported versions | Version | Supported | | ------- | ------------------ | -| 1.0.x | :white_check_mark: | +| 1.x | :white_check_mark: | | 0.x | :x: | -## Reporting a Vulnerability +## Reporting a vulnerability -If you think you may have found a security bug, We ask that you privately send the details to support@tabler.io. -Please make sure to use a descriptive title in the email. +**Please do not report security vulnerabilities through public GitHub issues.** +If you think you have found a security issue, report it privately in one of two ways: + +- Use GitHub's private reporting: [Report a vulnerability](https://github.com/tabler/tabler/security/advisories/new) (Security tab → "Report a vulnerability") +- Send the details to **support@tabler.io** + +Please include: + +- A descriptive title +- A description of the issue and its potential impact +- Steps to reproduce, or a proof of concept if possible +- The affected version(s) + +We will review your report and get back to you as soon as possible. Please give us reasonable time to address the issue before disclosing it publicly. diff --git a/UPGRADE.md b/UPGRADE.md new file mode 100644 index 000000000..91cddbdcb --- /dev/null +++ b/UPGRADE.md @@ -0,0 +1,5 @@ +# Upgrading to Tabler 1.5 + +The upgrade guide lives in the documentation: [Upgrade to 1.5](https://docs.tabler.io/ui/getting-started/upgrade/). + +It covers every breaking change between 1.4 and 1.5, with a before and after example for each one. diff --git a/core/.build/generate-sri.ts b/core/.build/generate-sri.ts index c567a89f8..8ac0d38c1 100644 --- a/core/.build/generate-sri.ts +++ b/core/.build/generate-sri.ts @@ -1,115 +1,129 @@ +// Writes SRI hashes for the built core files to shared/data/sri.json. +// +// Nothing consumes that file yet: the CDN snippets in the docs are shown without `integrity`, and +// Subresource Integrity is planned for v2.0. The script is kept here so the hashes are ready to be +// wired up then; it is not part of any build or workflow. Run it by hand after building core: +// +// pnpm exec tsx core/.build/generate-sri.ts +// +// Hashes describe the release the snippets would link to (@tabler/core@), so a real setup +// must run this against the published build — hashing an unreleased core/dist would pin an +// `integrity` value the browser rejects, which is worse for users than no `integrity` at all. The +// version is stored next to the hashes so the consumer can check the two match. import * as crypto from 'node:crypto' -import { readFileSync, writeFileSync } from 'node:fs' +import { existsSync, readFileSync, writeFileSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const configFile = path.join(__dirname, '../../shared/data/sri.json') +const distDir = path.join(__dirname, '../dist') +const { version } = JSON.parse(readFileSync(path.join(__dirname, '../package.json'), 'utf8')) as { version: string } interface FileConfig { file: string configPropertyName: string } +interface SriData { + version: string + hashes: Record +} + const files: FileConfig[] = [ { - file: 'dist/css/tabler.min.css', + file: 'css/tabler.min.css', configPropertyName: 'css', }, { - file: 'dist/css/tabler.rtl.min.css', + file: 'css/tabler.rtl.min.css', configPropertyName: 'css-rtl', }, { - file: 'dist/css/tabler-flags.min.css', + file: 'css/tabler-flags.min.css', configPropertyName: 'css-flags', }, { - file: 'dist/css/tabler-flags.rtl.min.css', + file: 'css/tabler-flags.rtl.min.css', configPropertyName: 'css-flags-rtl', }, { - file: 'dist/css/tabler-marketing.min.css', + file: 'css/tabler-marketing.min.css', configPropertyName: 'css-marketing', }, { - file: 'dist/css/tabler-marketing.rtl.min.css', + file: 'css/tabler-marketing.rtl.min.css', configPropertyName: 'css-marketing-rtl', }, { - file: 'dist/css/tabler-payments.min.css', + file: 'css/tabler-payments.min.css', configPropertyName: 'css-payments', }, { - file: 'dist/css/tabler-payments.rtl.min.css', + file: 'css/tabler-payments.rtl.min.css', configPropertyName: 'css-payments-rtl', }, { - file: 'dist/css/tabler-props.min.css', + file: 'css/tabler-props.min.css', configPropertyName: 'css-props', }, { - file: 'dist/css/tabler-props.rtl.min.css', + file: 'css/tabler-props.rtl.min.css', configPropertyName: 'css-props-rtl', }, { - file: 'dist/css/tabler-themes.min.css', + file: 'css/tabler-themes.min.css', configPropertyName: 'css-themes', }, { - file: 'dist/css/tabler-themes.rtl.min.css', + file: 'css/tabler-themes.rtl.min.css', configPropertyName: 'css-themes-rtl', }, { - file: 'dist/css/tabler-socials.min.css', + file: 'css/tabler-socials.min.css', configPropertyName: 'css-socials', }, { - file: 'dist/css/tabler-socials.rtl.min.css', + file: 'css/tabler-socials.rtl.min.css', configPropertyName: 'css-socials-rtl', }, { - file: 'dist/css/tabler-vendors.min.css', + file: 'css/tabler-vendors.min.css', configPropertyName: 'css-vendors', }, { - file: 'dist/css/tabler-vendors.rtl.min.css', + file: 'css/tabler-vendors.rtl.min.css', configPropertyName: 'css-vendors-rtl', }, { - file: 'dist/js/tabler.min.js', + file: 'js/tabler.min.js', configPropertyName: 'js', }, { - file: 'dist/js/tabler-theme.min.js', + file: 'js/tabler-theme.min.js', configPropertyName: 'js-theme', }, ] function generateSRI(): void { - const sriData: Record = {} + const hashes: Record = {} for (const { file, configPropertyName } of files) { - try { - const filePath = path.join(__dirname, '..', file) - const data = readFileSync(filePath, 'utf8') + const filePath = path.join(distDir, file) - const algorithm = 'sha384' - const hash = crypto.createHash(algorithm).update(data, 'utf8').digest('base64') - const integrity = `${algorithm}-${hash}` - - console.log(`${configPropertyName}: ${integrity}`) - - sriData[configPropertyName] = integrity - } catch (error) { - const errorMessage = error instanceof Error ? error.message : String(error) - console.error(`Error processing ${file}:`, errorMessage) - throw error + if (!existsSync(filePath)) { + throw new Error(`${filePath} is missing. Run \`pnpm --filter @tabler/core build\` first.`) } + + const integrity = `sha384-${crypto.createHash('sha384').update(readFileSync(filePath)).digest('base64')}` + + console.log(`${configPropertyName}: ${integrity}`) + + hashes[configPropertyName] = integrity } - writeFileSync(configFile, JSON.stringify(sriData, null, 2) + '\n', 'utf8') + writeFileSync(configFile, JSON.stringify({ version, hashes } satisfies SriData, null, 2) + '\n', 'utf8') } try { diff --git a/core/README.md b/core/README.md index 615d4108c..8e4501ac4 100644 --- a/core/README.md +++ b/core/README.md @@ -1,6 +1,20 @@ -# Tabler Core +

+Tabler +

-Tabler Core is a set of components and utilities for building web applications. It provides a collection of pre-designed components, such as buttons, forms, modals, and more, that can be easily customized and integrated into your projects. +

+A premium and open source dashboard template with a responsive and high-quality UI. +

+ +

+NPM version +NPM Downloads +License +

+ +

+Live demo · Documentation · GitHub · Changelog +

## 🔎 Preview @@ -12,21 +26,62 @@ Tabler is fully responsive and compatible with all modern browsers. Thanks to it

-## Installation +## 📦 Installation -To install Tabler Core, you can use npm or yarn. Run one of the following commands in your terminal: +Install `@tabler/core` with npm or your preferred JavaScript package manager: -```bash -npm install @tabler/core +```sh +npm install --save @tabler/core ``` -or +### CDN -```bash -pnpm add @tabler/core +All files included in the `@tabler/core` npm package are also available over a CDN. + +JavaScript: + +```html + ``` -## Sponsors +Styles: + +```html + +``` + +### Quick start + +Create an HTML file with Tabler's CSS and JavaScript loaded from the CDN and start building: + +```html + + + + + + Tabler demo + + + +

Hello, Tabler!

+ + + + +``` + +Or try it without installing anything: open the [tabler-starter](https://github.com/tabler/tabler-starter) template on [StackBlitz](https://stackblitz.com/github/tabler/tabler-starter), [CodeSandbox](https://codesandbox.io/s/github/tabler/tabler-starter) or [GitHub Codespaces](https://codespaces.new/tabler/tabler-starter). + +## 📖 Documentation + +The full documentation is available at [docs.tabler.io](https://docs.tabler.io/). Release notes live in the [changelog](https://github.com/tabler/tabler/blob/dev/core/CHANGELOG.md). + +## 🤝 Contributing + +We welcome contributions of all kinds! See the [contributing guide](https://github.com/tabler/tabler/blob/dev/CONTRIBUTING.md) to get started. + +## 💛 Sponsors **If you want to support our project and help us grow it, you can [become a sponsor on GitHub](https://github.com/sponsors/codecalm) or just [donate on PayPal](https://paypal.me/codecalm) :)** @@ -36,7 +91,6 @@ pnpm add @tabler/core

+## 📄 License -## License - -See the [LICENSE](https://github.com/tabler/tabler/blob/master/LICENSE) file. \ No newline at end of file +Tabler is licensed under the [MIT License](https://github.com/tabler/tabler/blob/dev/LICENSE). diff --git a/core/img/payments/2c2p-dark.svg b/core/img/payments/2c2p-dark.svg index c02bc8bc4..b1482653d 100644 --- a/core/img/payments/2c2p-dark.svg +++ b/core/img/payments/2c2p-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/2c2p.svg b/core/img/payments/2c2p.svg index 5402034b2..c1b771480 100644 --- a/core/img/payments/2c2p.svg +++ b/core/img/payments/2c2p.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/2checkout-dark.svg b/core/img/payments/2checkout-dark.svg index 31295f991..ddb1d40ba 100644 --- a/core/img/payments/2checkout-dark.svg +++ b/core/img/payments/2checkout-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/2checkout.svg b/core/img/payments/2checkout.svg index ee059732c..89be19015 100644 --- a/core/img/payments/2checkout.svg +++ b/core/img/payments/2checkout.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/ach-transfer-dark.svg b/core/img/payments/ach-transfer-dark.svg new file mode 100644 index 000000000..ca17690ed --- /dev/null +++ b/core/img/payments/ach-transfer-dark.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/core/img/payments/ach-transfer.svg b/core/img/payments/ach-transfer.svg new file mode 100644 index 000000000..eb6998459 --- /dev/null +++ b/core/img/payments/ach-transfer.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/core/img/payments/adyen-dark.svg b/core/img/payments/adyen-dark.svg index 27b84ed2b..7103e90c9 100644 --- a/core/img/payments/adyen-dark.svg +++ b/core/img/payments/adyen-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/adyen.svg b/core/img/payments/adyen.svg index bd26437e1..a46443b1a 100644 --- a/core/img/payments/adyen.svg +++ b/core/img/payments/adyen.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/affirm-dark.svg b/core/img/payments/affirm-dark.svg index 313dcabff..3762c4c6b 100644 --- a/core/img/payments/affirm-dark.svg +++ b/core/img/payments/affirm-dark.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/affirm.svg b/core/img/payments/affirm.svg index dece89adb..24e9f9021 100644 --- a/core/img/payments/affirm.svg +++ b/core/img/payments/affirm.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/afterpay-dark.svg b/core/img/payments/afterpay-dark.svg new file mode 100644 index 000000000..57649db04 --- /dev/null +++ b/core/img/payments/afterpay-dark.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/core/img/payments/afterpay.svg b/core/img/payments/afterpay.svg new file mode 100644 index 000000000..01ca343b9 --- /dev/null +++ b/core/img/payments/afterpay.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/core/img/payments/airtm-dark.svg b/core/img/payments/airtm-dark.svg new file mode 100644 index 000000000..4fdcfa48a --- /dev/null +++ b/core/img/payments/airtm-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/airtm.svg b/core/img/payments/airtm.svg new file mode 100644 index 000000000..ff298af45 --- /dev/null +++ b/core/img/payments/airtm.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/airwallex-dark.svg b/core/img/payments/airwallex-dark.svg new file mode 100644 index 000000000..57b6e9da6 --- /dev/null +++ b/core/img/payments/airwallex-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/airwallex.svg b/core/img/payments/airwallex.svg new file mode 100644 index 000000000..372e8e844 --- /dev/null +++ b/core/img/payments/airwallex.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/alipay-dark.svg b/core/img/payments/alipay-dark.svg index 518a708cc..9193c32ca 100644 --- a/core/img/payments/alipay-dark.svg +++ b/core/img/payments/alipay-dark.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/alipay-plus-dark.svg b/core/img/payments/alipay-plus-dark.svg index 6fbc96d2d..e45f024e3 100644 --- a/core/img/payments/alipay-plus-dark.svg +++ b/core/img/payments/alipay-plus-dark.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/alipay-plus.svg b/core/img/payments/alipay-plus.svg index 5f81c8794..9b3ba5167 100644 --- a/core/img/payments/alipay-plus.svg +++ b/core/img/payments/alipay-plus.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/alipay.svg b/core/img/payments/alipay.svg index b2b08041a..b0aa37711 100644 --- a/core/img/payments/alipay.svg +++ b/core/img/payments/alipay.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/allegro-pay-dark.svg b/core/img/payments/allegro-pay-dark.svg index aad3975aa..21ae4d6f3 100644 --- a/core/img/payments/allegro-pay-dark.svg +++ b/core/img/payments/allegro-pay-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/allegro-pay.svg b/core/img/payments/allegro-pay.svg index 4e5e07f76..a15c746c1 100644 --- a/core/img/payments/allegro-pay.svg +++ b/core/img/payments/allegro-pay.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/amazon-dark.svg b/core/img/payments/amazon-dark.svg index 4d44550da..3f6067f43 100644 --- a/core/img/payments/amazon-dark.svg +++ b/core/img/payments/amazon-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/amazon-pay-dark.svg b/core/img/payments/amazon-pay-dark.svg index 510841661..bb118d98c 100644 --- a/core/img/payments/amazon-pay-dark.svg +++ b/core/img/payments/amazon-pay-dark.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/amazon-pay.svg b/core/img/payments/amazon-pay.svg index a499cebba..efec2ef08 100644 --- a/core/img/payments/amazon-pay.svg +++ b/core/img/payments/amazon-pay.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/amazon.svg b/core/img/payments/amazon.svg index 23f7e9de3..340b69447 100644 --- a/core/img/payments/amazon.svg +++ b/core/img/payments/amazon.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/americanexpress-dark.svg b/core/img/payments/americanexpress-dark.svg index df4c35327..364b8f720 100644 --- a/core/img/payments/americanexpress-dark.svg +++ b/core/img/payments/americanexpress-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/americanexpress.svg b/core/img/payments/americanexpress.svg index c6bc3ac0d..907b249ac 100644 --- a/core/img/payments/americanexpress.svg +++ b/core/img/payments/americanexpress.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/ant-group-dark.svg b/core/img/payments/ant-group-dark.svg new file mode 100644 index 000000000..d082f14b8 --- /dev/null +++ b/core/img/payments/ant-group-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/ant-group.svg b/core/img/payments/ant-group.svg new file mode 100644 index 000000000..744a15178 --- /dev/null +++ b/core/img/payments/ant-group.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/applepay-dark.svg b/core/img/payments/applepay-dark.svg index fe8060c19..5f2e1c205 100644 --- a/core/img/payments/applepay-dark.svg +++ b/core/img/payments/applepay-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/applepay.svg b/core/img/payments/applepay.svg index d0bf3573f..7ea5c0010 100644 --- a/core/img/payments/applepay.svg +++ b/core/img/payments/applepay.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/authorize-dark.svg b/core/img/payments/authorize-dark.svg index bdb3b74a5..c6f229979 100644 --- a/core/img/payments/authorize-dark.svg +++ b/core/img/payments/authorize-dark.svg @@ -1 +1,17 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/authorize.svg b/core/img/payments/authorize.svg index 76ee3789b..69efd3e1b 100644 --- a/core/img/payments/authorize.svg +++ b/core/img/payments/authorize.svg @@ -1 +1,17 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/autopay-dark.svg b/core/img/payments/autopay-dark.svg index f18de72c1..e1722bdce 100644 --- a/core/img/payments/autopay-dark.svg +++ b/core/img/payments/autopay-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/autopay.svg b/core/img/payments/autopay.svg index 1a9aa008b..60010eb28 100644 --- a/core/img/payments/autopay.svg +++ b/core/img/payments/autopay.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/bancontact-dark.svg b/core/img/payments/bancontact-dark.svg index 66c4b3827..541f082e0 100644 --- a/core/img/payments/bancontact-dark.svg +++ b/core/img/payments/bancontact-dark.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/bancontact.svg b/core/img/payments/bancontact.svg index 261d171d5..b6c2c811a 100644 --- a/core/img/payments/bancontact.svg +++ b/core/img/payments/bancontact.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/bank-of-america-dark.svg b/core/img/payments/bank-of-america-dark.svg new file mode 100644 index 000000000..86c3f1dc5 --- /dev/null +++ b/core/img/payments/bank-of-america-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/bank-of-america.svg b/core/img/payments/bank-of-america.svg new file mode 100644 index 000000000..78f324ebb --- /dev/null +++ b/core/img/payments/bank-of-america.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/barclays-dark.svg b/core/img/payments/barclays-dark.svg new file mode 100644 index 000000000..1318ee2f8 --- /dev/null +++ b/core/img/payments/barclays-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/barclays.svg b/core/img/payments/barclays.svg new file mode 100644 index 000000000..3e9739bbb --- /dev/null +++ b/core/img/payments/barclays.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/bbva-dark.svg b/core/img/payments/bbva-dark.svg new file mode 100644 index 000000000..34d42301a --- /dev/null +++ b/core/img/payments/bbva-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/bbva.svg b/core/img/payments/bbva.svg new file mode 100644 index 000000000..60decc664 --- /dev/null +++ b/core/img/payments/bbva.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/binance-dark.svg b/core/img/payments/binance-dark.svg new file mode 100644 index 000000000..d2b88c4ea --- /dev/null +++ b/core/img/payments/binance-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/binance-usd-dark.svg b/core/img/payments/binance-usd-dark.svg index d63c13be5..9f7f08caf 100644 --- a/core/img/payments/binance-usd-dark.svg +++ b/core/img/payments/binance-usd-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/binance-usd.svg b/core/img/payments/binance-usd.svg index 81a4b9b04..705c715c6 100644 --- a/core/img/payments/binance-usd.svg +++ b/core/img/payments/binance-usd.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/binance.svg b/core/img/payments/binance.svg new file mode 100644 index 000000000..df7491213 --- /dev/null +++ b/core/img/payments/binance.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/bitcoin-dark.svg b/core/img/payments/bitcoin-dark.svg index 232c82599..aec8cb349 100644 --- a/core/img/payments/bitcoin-dark.svg +++ b/core/img/payments/bitcoin-dark.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + diff --git a/core/img/payments/bitcoin.svg b/core/img/payments/bitcoin.svg index f01ba3490..3c1a1ae96 100644 --- a/core/img/payments/bitcoin.svg +++ b/core/img/payments/bitcoin.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/bitpay-dark.svg b/core/img/payments/bitpay-dark.svg index 5493c9141..d01b4dc4f 100644 --- a/core/img/payments/bitpay-dark.svg +++ b/core/img/payments/bitpay-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/bitpay.svg b/core/img/payments/bitpay.svg index c91274601..fdaaed90c 100644 --- a/core/img/payments/bitpay.svg +++ b/core/img/payments/bitpay.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/bkash-dark.svg b/core/img/payments/bkash-dark.svg index 58ea0b9b2..baeb6ecd2 100644 --- a/core/img/payments/bkash-dark.svg +++ b/core/img/payments/bkash-dark.svg @@ -1 +1,16 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + diff --git a/core/img/payments/bkash.svg b/core/img/payments/bkash.svg index 854b2121e..7fe3f0451 100644 --- a/core/img/payments/bkash.svg +++ b/core/img/payments/bkash.svg @@ -1 +1,16 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + diff --git a/core/img/payments/blik-dark.svg b/core/img/payments/blik-dark.svg index 3c512cf51..1dd02c199 100644 --- a/core/img/payments/blik-dark.svg +++ b/core/img/payments/blik-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/blik.svg b/core/img/payments/blik.svg index 9e3611ce7..65937769c 100644 --- a/core/img/payments/blik.svg +++ b/core/img/payments/blik.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/bnb-chain-dark.svg b/core/img/payments/bnb-chain-dark.svg new file mode 100644 index 000000000..562ac1fc8 --- /dev/null +++ b/core/img/payments/bnb-chain-dark.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/core/img/payments/bnb-chain.svg b/core/img/payments/bnb-chain.svg new file mode 100644 index 000000000..ba0f635de --- /dev/null +++ b/core/img/payments/bnb-chain.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/core/img/payments/bnp-paribas-dark.svg b/core/img/payments/bnp-paribas-dark.svg new file mode 100644 index 000000000..95f252d1d --- /dev/null +++ b/core/img/payments/bnp-paribas-dark.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/bnp-paribas.svg b/core/img/payments/bnp-paribas.svg new file mode 100644 index 000000000..b64c5536c --- /dev/null +++ b/core/img/payments/bnp-paribas.svg @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/braintree-dark.svg b/core/img/payments/braintree-dark.svg index d71e62d4a..c62563d8e 100644 --- a/core/img/payments/braintree-dark.svg +++ b/core/img/payments/braintree-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/braintree.svg b/core/img/payments/braintree.svg index dd75f6878..8e5b35171 100644 --- a/core/img/payments/braintree.svg +++ b/core/img/payments/braintree.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/brex-dark.svg b/core/img/payments/brex-dark.svg new file mode 100644 index 000000000..e5d445c6f --- /dev/null +++ b/core/img/payments/brex-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/brex.svg b/core/img/payments/brex.svg new file mode 100644 index 000000000..40b649c94 --- /dev/null +++ b/core/img/payments/brex.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/capital-one-dark.svg b/core/img/payments/capital-one-dark.svg new file mode 100644 index 000000000..b92626c33 --- /dev/null +++ b/core/img/payments/capital-one-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/capital-one.svg b/core/img/payments/capital-one.svg new file mode 100644 index 000000000..eb30363e4 --- /dev/null +++ b/core/img/payments/capital-one.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/cash-app-dark.svg b/core/img/payments/cash-app-dark.svg index 42745b486..47612a99f 100644 --- a/core/img/payments/cash-app-dark.svg +++ b/core/img/payments/cash-app-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/cash-app.svg b/core/img/payments/cash-app.svg index e267fd9b5..881948b1d 100644 --- a/core/img/payments/cash-app.svg +++ b/core/img/payments/cash-app.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/chase-dark.svg b/core/img/payments/chase-dark.svg new file mode 100644 index 000000000..c7568483d --- /dev/null +++ b/core/img/payments/chase-dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/core/img/payments/chase.svg b/core/img/payments/chase.svg new file mode 100644 index 000000000..bc44288ca --- /dev/null +++ b/core/img/payments/chase.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/core/img/payments/checkout-com-dark.svg b/core/img/payments/checkout-com-dark.svg new file mode 100644 index 000000000..735d6e838 --- /dev/null +++ b/core/img/payments/checkout-com-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/checkout-com.svg b/core/img/payments/checkout-com.svg new file mode 100644 index 000000000..d1a0ed5c3 --- /dev/null +++ b/core/img/payments/checkout-com.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/chime-dark.svg b/core/img/payments/chime-dark.svg index 8c7066b7f..6620fcd54 100644 --- a/core/img/payments/chime-dark.svg +++ b/core/img/payments/chime-dark.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/chime.svg b/core/img/payments/chime.svg index 7d923829a..ce37ebeb2 100644 --- a/core/img/payments/chime.svg +++ b/core/img/payments/chime.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/china-construction-bank-dark.svg b/core/img/payments/china-construction-bank-dark.svg new file mode 100644 index 000000000..e4e0a44c4 --- /dev/null +++ b/core/img/payments/china-construction-bank-dark.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/china-construction-bank.svg b/core/img/payments/china-construction-bank.svg new file mode 100644 index 000000000..a68ae4bbf --- /dev/null +++ b/core/img/payments/china-construction-bank.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/cirrus-dark.svg b/core/img/payments/cirrus-dark.svg index fefbe374b..f2caf989a 100644 --- a/core/img/payments/cirrus-dark.svg +++ b/core/img/payments/cirrus-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/cirrus.svg b/core/img/payments/cirrus.svg index de2ec6e70..72645ee64 100644 --- a/core/img/payments/cirrus.svg +++ b/core/img/payments/cirrus.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/citi-dark.svg b/core/img/payments/citi-dark.svg new file mode 100644 index 000000000..1a0b52937 --- /dev/null +++ b/core/img/payments/citi-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/citi.svg b/core/img/payments/citi.svg new file mode 100644 index 000000000..c75a31612 --- /dev/null +++ b/core/img/payments/citi.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/clickandbuy-dark.svg b/core/img/payments/clickandbuy-dark.svg deleted file mode 100644 index 3d6c7085d..000000000 --- a/core/img/payments/clickandbuy-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/clickandbuy.svg b/core/img/payments/clickandbuy.svg deleted file mode 100644 index 901ff2beb..000000000 --- a/core/img/payments/clickandbuy.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/coinbase-dark.svg b/core/img/payments/coinbase-dark.svg new file mode 100644 index 000000000..0e7058fff --- /dev/null +++ b/core/img/payments/coinbase-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/coinbase.svg b/core/img/payments/coinbase.svg new file mode 100644 index 000000000..353e3c435 --- /dev/null +++ b/core/img/payments/coinbase.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/coinkite-dark.svg b/core/img/payments/coinkite-dark.svg index edf30f034..fac3ca896 100644 --- a/core/img/payments/coinkite-dark.svg +++ b/core/img/payments/coinkite-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/coinkite.svg b/core/img/payments/coinkite.svg index 4f352bc2e..fdf82715e 100644 --- a/core/img/payments/coinkite.svg +++ b/core/img/payments/coinkite.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/crypto-com-dark.svg b/core/img/payments/crypto-com-dark.svg new file mode 100644 index 000000000..9c1489fc4 --- /dev/null +++ b/core/img/payments/crypto-com-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/crypto-com.svg b/core/img/payments/crypto-com.svg new file mode 100644 index 000000000..157891eb9 --- /dev/null +++ b/core/img/payments/crypto-com.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/deutsche-bank-dark.svg b/core/img/payments/deutsche-bank-dark.svg new file mode 100644 index 000000000..dc8f10619 --- /dev/null +++ b/core/img/payments/deutsche-bank-dark.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/core/img/payments/deutsche-bank.svg b/core/img/payments/deutsche-bank.svg new file mode 100644 index 000000000..32a5b5c8b --- /dev/null +++ b/core/img/payments/deutsche-bank.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/core/img/payments/dinersclub-dark.svg b/core/img/payments/dinersclub-dark.svg index 69bef0069..1e471f5a7 100644 --- a/core/img/payments/dinersclub-dark.svg +++ b/core/img/payments/dinersclub-dark.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/dinersclub.svg b/core/img/payments/dinersclub.svg index b49d7ac19..05545e9fe 100644 --- a/core/img/payments/dinersclub.svg +++ b/core/img/payments/dinersclub.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/directdebit-dark.svg b/core/img/payments/directdebit-dark.svg index 702730124..fe6518502 100644 --- a/core/img/payments/directdebit-dark.svg +++ b/core/img/payments/directdebit-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/directdebit.svg b/core/img/payments/directdebit.svg index 5f1d72be3..db0081a4c 100644 --- a/core/img/payments/directdebit.svg +++ b/core/img/payments/directdebit.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/discover-dark.svg b/core/img/payments/discover-dark.svg index adf125b88..c8b09cc08 100644 --- a/core/img/payments/discover-dark.svg +++ b/core/img/payments/discover-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/discover.svg b/core/img/payments/discover.svg index 59d6e2d34..47720a755 100644 --- a/core/img/payments/discover.svg +++ b/core/img/payments/discover.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/dotpay-dark.svg b/core/img/payments/dotpay-dark.svg deleted file mode 100644 index 949e08aaf..000000000 --- a/core/img/payments/dotpay-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/dotpay.svg b/core/img/payments/dotpay.svg deleted file mode 100644 index 10530506a..000000000 --- a/core/img/payments/dotpay.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/dwolla-dark.svg b/core/img/payments/dwolla-dark.svg index e7fd192e9..3d3a7ae4b 100644 --- a/core/img/payments/dwolla-dark.svg +++ b/core/img/payments/dwolla-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/dwolla.svg b/core/img/payments/dwolla.svg index 41df8601b..fe2df5c7f 100644 --- a/core/img/payments/dwolla.svg +++ b/core/img/payments/dwolla.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/easypaisa-dark.svg b/core/img/payments/easypaisa-dark.svg index d7c8d2462..c51611c1c 100644 --- a/core/img/payments/easypaisa-dark.svg +++ b/core/img/payments/easypaisa-dark.svg @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + + + + + + + diff --git a/core/img/payments/easypaisa.svg b/core/img/payments/easypaisa.svg index eb72c2ecf..6e40d132f 100644 --- a/core/img/payments/easypaisa.svg +++ b/core/img/payments/easypaisa.svg @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + + + + + + + diff --git a/core/img/payments/ebay-dark.svg b/core/img/payments/ebay-dark.svg index 060aef5ca..d7418ee51 100644 --- a/core/img/payments/ebay-dark.svg +++ b/core/img/payments/ebay-dark.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/ebay.svg b/core/img/payments/ebay.svg index 72bfcfd71..4277c122b 100644 --- a/core/img/payments/ebay.svg +++ b/core/img/payments/ebay.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/elo-dark.svg b/core/img/payments/elo-dark.svg index 31b16caac..757840161 100644 --- a/core/img/payments/elo-dark.svg +++ b/core/img/payments/elo-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/elo.svg b/core/img/payments/elo.svg index 126f59a5d..a143ece4f 100644 --- a/core/img/payments/elo.svg +++ b/core/img/payments/elo.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/epayco-dark.svg b/core/img/payments/epayco-dark.svg index 731794769..bcdeb74b8 100644 --- a/core/img/payments/epayco-dark.svg +++ b/core/img/payments/epayco-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/epayco.svg b/core/img/payments/epayco.svg index 193a96e5e..e26b0e6ee 100644 --- a/core/img/payments/epayco.svg +++ b/core/img/payments/epayco.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/esewa-dark.svg b/core/img/payments/esewa-dark.svg index a999ad1c4..915362220 100644 --- a/core/img/payments/esewa-dark.svg +++ b/core/img/payments/esewa-dark.svg @@ -1,11 +1,11 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/core/img/payments/esewa.svg b/core/img/payments/esewa.svg index 09a4a2af4..6063d8c56 100644 --- a/core/img/payments/esewa.svg +++ b/core/img/payments/esewa.svg @@ -1,12 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/core/img/payments/ethereum-dark.svg b/core/img/payments/ethereum-dark.svg index 4a6e6df82..21d7ab79f 100644 --- a/core/img/payments/ethereum-dark.svg +++ b/core/img/payments/ethereum-dark.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + diff --git a/core/img/payments/ethereum.svg b/core/img/payments/ethereum.svg index d1be9f02a..fa4c8bc5d 100644 --- a/core/img/payments/ethereum.svg +++ b/core/img/payments/ethereum.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/eway-dark.svg b/core/img/payments/eway-dark.svg index 154f24bd3..3d520742e 100644 --- a/core/img/payments/eway-dark.svg +++ b/core/img/payments/eway-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/eway.svg b/core/img/payments/eway.svg index 799f4db1c..0a9a60748 100644 --- a/core/img/payments/eway.svg +++ b/core/img/payments/eway.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/fifth-third-bank-dark.svg b/core/img/payments/fifth-third-bank-dark.svg new file mode 100644 index 000000000..e66445e51 --- /dev/null +++ b/core/img/payments/fifth-third-bank-dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/fifth-third-bank.svg b/core/img/payments/fifth-third-bank.svg new file mode 100644 index 000000000..dfe808365 --- /dev/null +++ b/core/img/payments/fifth-third-bank.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/fiserv-dark.svg b/core/img/payments/fiserv-dark.svg new file mode 100644 index 000000000..c0931f2ab --- /dev/null +++ b/core/img/payments/fiserv-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/fiserv.svg b/core/img/payments/fiserv.svg new file mode 100644 index 000000000..5ffed6415 --- /dev/null +++ b/core/img/payments/fiserv.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/flutterwave-dark.svg b/core/img/payments/flutterwave-dark.svg new file mode 100644 index 000000000..dbeb7722d --- /dev/null +++ b/core/img/payments/flutterwave-dark.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/flutterwave.svg b/core/img/payments/flutterwave.svg new file mode 100644 index 000000000..c49c5ea9c --- /dev/null +++ b/core/img/payments/flutterwave.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/fonepay-dark.svg b/core/img/payments/fonepay-dark.svg index 768e141ef..70d451a50 100644 --- a/core/img/payments/fonepay-dark.svg +++ b/core/img/payments/fonepay-dark.svg @@ -1,10 +1,10 @@ - - - - - - - - - + + + + + + + + + diff --git a/core/img/payments/fonepay.svg b/core/img/payments/fonepay.svg index aa58688b3..f25e817ec 100644 --- a/core/img/payments/fonepay.svg +++ b/core/img/payments/fonepay.svg @@ -1,10 +1,10 @@ - - - - - - - - - + + + + + + + + + diff --git a/core/img/payments/gcash-dark.svg b/core/img/payments/gcash-dark.svg new file mode 100644 index 000000000..33f1411bb --- /dev/null +++ b/core/img/payments/gcash-dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/gcash.svg b/core/img/payments/gcash.svg new file mode 100644 index 000000000..7241013f0 --- /dev/null +++ b/core/img/payments/gcash.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/giropay-dark.svg b/core/img/payments/giropay-dark.svg index 6ecb073fb..200581917 100644 --- a/core/img/payments/giropay-dark.svg +++ b/core/img/payments/giropay-dark.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + diff --git a/core/img/payments/giropay.svg b/core/img/payments/giropay.svg index 2bb357bfd..fb9b98c06 100644 --- a/core/img/payments/giropay.svg +++ b/core/img/payments/giropay.svg @@ -1 +1,25 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/goldman-sachs-dark.svg b/core/img/payments/goldman-sachs-dark.svg new file mode 100644 index 000000000..2d8c84d62 --- /dev/null +++ b/core/img/payments/goldman-sachs-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/goldman-sachs.svg b/core/img/payments/goldman-sachs.svg new file mode 100644 index 000000000..e91431016 --- /dev/null +++ b/core/img/payments/goldman-sachs.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/google-pay-dark.svg b/core/img/payments/google-pay-dark.svg index 83f4b1b33..ee888301b 100644 --- a/core/img/payments/google-pay-dark.svg +++ b/core/img/payments/google-pay-dark.svg @@ -1 +1,10 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/core/img/payments/google-pay.svg b/core/img/payments/google-pay.svg index 1c6d47dc9..176a8fa14 100644 --- a/core/img/payments/google-pay.svg +++ b/core/img/payments/google-pay.svg @@ -1 +1,10 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/core/img/payments/googlewallet-dark.svg b/core/img/payments/googlewallet-dark.svg index d24443680..605dd9dff 100644 --- a/core/img/payments/googlewallet-dark.svg +++ b/core/img/payments/googlewallet-dark.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/googlewallet.svg b/core/img/payments/googlewallet.svg index 6095e51b4..a83a554dd 100644 --- a/core/img/payments/googlewallet.svg +++ b/core/img/payments/googlewallet.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/grabpay-dark.svg b/core/img/payments/grabpay-dark.svg new file mode 100644 index 000000000..a3d81ae4f --- /dev/null +++ b/core/img/payments/grabpay-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/grabpay.svg b/core/img/payments/grabpay.svg new file mode 100644 index 000000000..35240bec6 --- /dev/null +++ b/core/img/payments/grabpay.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/hsbc-dark.svg b/core/img/payments/hsbc-dark.svg new file mode 100644 index 000000000..e431db954 --- /dev/null +++ b/core/img/payments/hsbc-dark.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/core/img/payments/hsbc.svg b/core/img/payments/hsbc.svg new file mode 100644 index 000000000..70687f782 --- /dev/null +++ b/core/img/payments/hsbc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/core/img/payments/hubspot-dark.svg b/core/img/payments/hubspot-dark.svg index 66800ba0b..f654a8246 100644 --- a/core/img/payments/hubspot-dark.svg +++ b/core/img/payments/hubspot-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/hubspot.svg b/core/img/payments/hubspot.svg index 29cd572f9..78c28f4e7 100644 --- a/core/img/payments/hubspot.svg +++ b/core/img/payments/hubspot.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/huntington-bank-dark.svg b/core/img/payments/huntington-bank-dark.svg new file mode 100644 index 000000000..7c9fc32db --- /dev/null +++ b/core/img/payments/huntington-bank-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/huntington-bank.svg b/core/img/payments/huntington-bank.svg new file mode 100644 index 000000000..dc039227b --- /dev/null +++ b/core/img/payments/huntington-bank.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/icbc-dark.svg b/core/img/payments/icbc-dark.svg new file mode 100644 index 000000000..90ad3c0ee --- /dev/null +++ b/core/img/payments/icbc-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/icbc.svg b/core/img/payments/icbc.svg new file mode 100644 index 000000000..c5447343a --- /dev/null +++ b/core/img/payments/icbc.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/ideal-dark.svg b/core/img/payments/ideal-dark.svg index 96de54013..051bca76a 100644 --- a/core/img/payments/ideal-dark.svg +++ b/core/img/payments/ideal-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/ideal.svg b/core/img/payments/ideal.svg index 80de1129d..2d5c4322c 100644 --- a/core/img/payments/ideal.svg +++ b/core/img/payments/ideal.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/imepay-dark.svg b/core/img/payments/imepay-dark.svg index d0da83fad..6e13aef97 100644 --- a/core/img/payments/imepay-dark.svg +++ b/core/img/payments/imepay-dark.svg @@ -1,11 +1,11 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/core/img/payments/imepay.svg b/core/img/payments/imepay.svg index acb056e5e..3c60151ef 100644 --- a/core/img/payments/imepay.svg +++ b/core/img/payments/imepay.svg @@ -1,11 +1,11 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/core/img/payments/imoje-dark.svg b/core/img/payments/imoje-dark.svg new file mode 100644 index 000000000..12cc6a665 --- /dev/null +++ b/core/img/payments/imoje-dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/imoje.svg b/core/img/payments/imoje.svg new file mode 100644 index 000000000..36052ef0c --- /dev/null +++ b/core/img/payments/imoje.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/ing-dark.svg b/core/img/payments/ing-dark.svg new file mode 100644 index 000000000..70a8d5d24 --- /dev/null +++ b/core/img/payments/ing-dark.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/ing.svg b/core/img/payments/ing.svg new file mode 100644 index 000000000..34246de6b --- /dev/null +++ b/core/img/payments/ing.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/ingenico-dark.svg b/core/img/payments/ingenico-dark.svg index 25d6d4873..3e58d1732 100644 --- a/core/img/payments/ingenico-dark.svg +++ b/core/img/payments/ingenico-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/ingenico.svg b/core/img/payments/ingenico.svg index 3888b40a7..2a0610114 100644 --- a/core/img/payments/ingenico.svg +++ b/core/img/payments/ingenico.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/interac-dark.svg b/core/img/payments/interac-dark.svg new file mode 100644 index 000000000..0be871853 --- /dev/null +++ b/core/img/payments/interac-dark.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/core/img/payments/interac.svg b/core/img/payments/interac.svg new file mode 100644 index 000000000..5bf41fdc2 --- /dev/null +++ b/core/img/payments/interac.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/core/img/payments/jazzcash-dark.svg b/core/img/payments/jazzcash-dark.svg new file mode 100644 index 000000000..f8edc9179 --- /dev/null +++ b/core/img/payments/jazzcash-dark.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/core/img/payments/jazzcash.svg b/core/img/payments/jazzcash.svg new file mode 100644 index 000000000..d2b4a23f0 --- /dev/null +++ b/core/img/payments/jazzcash.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/core/img/payments/jcb-dark.svg b/core/img/payments/jcb-dark.svg index 098707201..bcf161de6 100644 --- a/core/img/payments/jcb-dark.svg +++ b/core/img/payments/jcb-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/jcb.svg b/core/img/payments/jcb.svg index c4d9779e4..5d80cedef 100644 --- a/core/img/payments/jcb.svg +++ b/core/img/payments/jcb.svg @@ -1 +1,41 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/khalti-dark.svg b/core/img/payments/khalti-dark.svg index 091b613f3..cc6364b1d 100644 --- a/core/img/payments/khalti-dark.svg +++ b/core/img/payments/khalti-dark.svg @@ -1,14 +1,14 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/core/img/payments/khalti.svg b/core/img/payments/khalti.svg index 45195a70a..2182de223 100644 --- a/core/img/payments/khalti.svg +++ b/core/img/payments/khalti.svg @@ -1,14 +1,14 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/core/img/payments/klarna-dark.svg b/core/img/payments/klarna-dark.svg index d184ae531..11dbb279c 100644 --- a/core/img/payments/klarna-dark.svg +++ b/core/img/payments/klarna-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/klarna.svg b/core/img/payments/klarna.svg index dad9a515b..072e6e71c 100644 --- a/core/img/payments/klarna.svg +++ b/core/img/payments/klarna.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/kraken-dark.svg b/core/img/payments/kraken-dark.svg new file mode 100644 index 000000000..98249b31b --- /dev/null +++ b/core/img/payments/kraken-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/kraken.svg b/core/img/payments/kraken.svg new file mode 100644 index 000000000..e57006303 --- /dev/null +++ b/core/img/payments/kraken.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/laser-dark.svg b/core/img/payments/laser-dark.svg deleted file mode 100644 index 784ffde58..000000000 --- a/core/img/payments/laser-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/laser.svg b/core/img/payments/laser.svg deleted file mode 100644 index a53af6430..000000000 --- a/core/img/payments/laser.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/linepay-dark.svg b/core/img/payments/linepay-dark.svg new file mode 100644 index 000000000..74bfc4739 --- /dev/null +++ b/core/img/payments/linepay-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/linepay.svg b/core/img/payments/linepay.svg new file mode 100644 index 000000000..3f570a8d6 --- /dev/null +++ b/core/img/payments/linepay.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/litecoin-dark.svg b/core/img/payments/litecoin-dark.svg index 61b9739cf..198d3fa95 100644 --- a/core/img/payments/litecoin-dark.svg +++ b/core/img/payments/litecoin-dark.svg @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + + + + + + + diff --git a/core/img/payments/litecoin.svg b/core/img/payments/litecoin.svg index be8c5095b..5b341057c 100644 --- a/core/img/payments/litecoin.svg +++ b/core/img/payments/litecoin.svg @@ -1 +1,14 @@ - \ No newline at end of file + + + + + + + + + + + + + + diff --git a/core/img/payments/mada-dark.svg b/core/img/payments/mada-dark.svg new file mode 100644 index 000000000..2f9a8c193 --- /dev/null +++ b/core/img/payments/mada-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/mada.svg b/core/img/payments/mada.svg new file mode 100644 index 000000000..7d82cef30 --- /dev/null +++ b/core/img/payments/mada.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/maestro-dark.svg b/core/img/payments/maestro-dark.svg index 23540e1f7..c8cef5b76 100644 --- a/core/img/payments/maestro-dark.svg +++ b/core/img/payments/maestro-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/maestro.svg b/core/img/payments/maestro.svg index e8258b8fc..1dc7f985e 100644 --- a/core/img/payments/maestro.svg +++ b/core/img/payments/maestro.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/mastercard-dark.svg b/core/img/payments/mastercard-dark.svg index a40ba7d64..a943ee1d1 100644 --- a/core/img/payments/mastercard-dark.svg +++ b/core/img/payments/mastercard-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/mastercard.svg b/core/img/payments/mastercard.svg index 6a74d6b43..6b569cb1c 100644 --- a/core/img/payments/mastercard.svg +++ b/core/img/payments/mastercard.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/mercado-pago-dark.svg b/core/img/payments/mercado-pago-dark.svg index 5cf8c1ed8..5c8510f09 100644 --- a/core/img/payments/mercado-pago-dark.svg +++ b/core/img/payments/mercado-pago-dark.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/mercado-pago.svg b/core/img/payments/mercado-pago.svg index 4ce4be020..f6b271f4b 100644 --- a/core/img/payments/mercado-pago.svg +++ b/core/img/payments/mercado-pago.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/mercury-dark.svg b/core/img/payments/mercury-dark.svg new file mode 100644 index 000000000..06742121f --- /dev/null +++ b/core/img/payments/mercury-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/mercury.svg b/core/img/payments/mercury.svg new file mode 100644 index 000000000..4643e6a5f --- /dev/null +++ b/core/img/payments/mercury.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/meta-pay-dark.svg b/core/img/payments/meta-pay-dark.svg new file mode 100644 index 000000000..f89b8f4e6 --- /dev/null +++ b/core/img/payments/meta-pay-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/meta-pay.svg b/core/img/payments/meta-pay.svg new file mode 100644 index 000000000..305009359 --- /dev/null +++ b/core/img/payments/meta-pay.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/core/img/payments/metamask-dark.svg b/core/img/payments/metamask-dark.svg index f332ec9de..82620834d 100644 --- a/core/img/payments/metamask-dark.svg +++ b/core/img/payments/metamask-dark.svg @@ -1 +1,40 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/metamask.svg b/core/img/payments/metamask.svg index 4685599ae..78db74187 100644 --- a/core/img/payments/metamask.svg +++ b/core/img/payments/metamask.svg @@ -1 +1,40 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/mir-dark.svg b/core/img/payments/mir-dark.svg index 3486050a8..d4530da33 100644 --- a/core/img/payments/mir-dark.svg +++ b/core/img/payments/mir-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/mir.svg b/core/img/payments/mir.svg index fcf949372..93d2283c0 100644 --- a/core/img/payments/mir.svg +++ b/core/img/payments/mir.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/mitsubishi-ufj-dark.svg b/core/img/payments/mitsubishi-ufj-dark.svg new file mode 100644 index 000000000..476d249f9 --- /dev/null +++ b/core/img/payments/mitsubishi-ufj-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/mitsubishi-ufj.svg b/core/img/payments/mitsubishi-ufj.svg new file mode 100644 index 000000000..f2cf31468 --- /dev/null +++ b/core/img/payments/mitsubishi-ufj.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/mobilepay-dark.svg b/core/img/payments/mobilepay-dark.svg new file mode 100644 index 000000000..8a738c4ae --- /dev/null +++ b/core/img/payments/mobilepay-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/mobilepay.svg b/core/img/payments/mobilepay.svg new file mode 100644 index 000000000..b5fb51a45 --- /dev/null +++ b/core/img/payments/mobilepay.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/mollie-dark.svg b/core/img/payments/mollie-dark.svg new file mode 100644 index 000000000..9c0a6d423 --- /dev/null +++ b/core/img/payments/mollie-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/mollie.svg b/core/img/payments/mollie.svg new file mode 100644 index 000000000..941a2368c --- /dev/null +++ b/core/img/payments/mollie.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/monero-dark.svg b/core/img/payments/monero-dark.svg index 9a345ca79..93c475962 100644 --- a/core/img/payments/monero-dark.svg +++ b/core/img/payments/monero-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/monero.svg b/core/img/payments/monero.svg index dfe0169f1..6654ec45e 100644 --- a/core/img/payments/monero.svg +++ b/core/img/payments/monero.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/moneygram-dark.svg b/core/img/payments/moneygram-dark.svg index 1d31a64b6..c7c7c6e46 100644 --- a/core/img/payments/moneygram-dark.svg +++ b/core/img/payments/moneygram-dark.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/moneygram.svg b/core/img/payments/moneygram.svg index 9743d108c..ae7b9f682 100644 --- a/core/img/payments/moneygram.svg +++ b/core/img/payments/moneygram.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/mpesa-dark.svg b/core/img/payments/mpesa-dark.svg new file mode 100644 index 000000000..205cdc0b8 --- /dev/null +++ b/core/img/payments/mpesa-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/mpesa.svg b/core/img/payments/mpesa.svg new file mode 100644 index 000000000..1dc97171c --- /dev/null +++ b/core/img/payments/mpesa.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/ncr-dark.svg b/core/img/payments/ncr-dark.svg new file mode 100644 index 000000000..7be172be1 --- /dev/null +++ b/core/img/payments/ncr-dark.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core/img/payments/ncr.svg b/core/img/payments/ncr.svg new file mode 100644 index 000000000..9fb85e93d --- /dev/null +++ b/core/img/payments/ncr.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core/img/payments/neteller-dark.svg b/core/img/payments/neteller-dark.svg index 86631902f..0f7bc17a3 100644 --- a/core/img/payments/neteller-dark.svg +++ b/core/img/payments/neteller-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/neteller.svg b/core/img/payments/neteller.svg index 86f8c3984..a516217b9 100644 --- a/core/img/payments/neteller.svg +++ b/core/img/payments/neteller.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/northone-dark.svg b/core/img/payments/northone-dark.svg new file mode 100644 index 000000000..e747cfc92 --- /dev/null +++ b/core/img/payments/northone-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/northone.svg b/core/img/payments/northone.svg new file mode 100644 index 000000000..34817d1ba --- /dev/null +++ b/core/img/payments/northone.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/nu-dark.svg b/core/img/payments/nu-dark.svg new file mode 100644 index 000000000..293b1cb38 --- /dev/null +++ b/core/img/payments/nu-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/nu.svg b/core/img/payments/nu.svg new file mode 100644 index 000000000..50d54cd32 --- /dev/null +++ b/core/img/payments/nu.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/nuvei-dark.svg b/core/img/payments/nuvei-dark.svg new file mode 100644 index 000000000..6e11b6f89 --- /dev/null +++ b/core/img/payments/nuvei-dark.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core/img/payments/nuvei.svg b/core/img/payments/nuvei.svg new file mode 100644 index 000000000..4b7fe3863 --- /dev/null +++ b/core/img/payments/nuvei.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/core/img/payments/ogone-dark.svg b/core/img/payments/ogone-dark.svg deleted file mode 100644 index b7c215cb3..000000000 --- a/core/img/payments/ogone-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/ogone.svg b/core/img/payments/ogone.svg deleted file mode 100644 index ccb4dedc4..000000000 --- a/core/img/payments/ogone.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/okpay-dark.svg b/core/img/payments/okpay-dark.svg deleted file mode 100644 index b06f30132..000000000 --- a/core/img/payments/okpay-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/okpay.svg b/core/img/payments/okpay.svg deleted file mode 100644 index 08994ceab..000000000 --- a/core/img/payments/okpay.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/opensea-dark.svg b/core/img/payments/opensea-dark.svg index a850263e4..b51cf2a33 100644 --- a/core/img/payments/opensea-dark.svg +++ b/core/img/payments/opensea-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/opensea.svg b/core/img/payments/opensea.svg index 747933fb4..8f16ec1e3 100644 --- a/core/img/payments/opensea.svg +++ b/core/img/payments/opensea.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/oxxo-dark.svg b/core/img/payments/oxxo-dark.svg new file mode 100644 index 000000000..e1cf0fa9d --- /dev/null +++ b/core/img/payments/oxxo-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/oxxo.svg b/core/img/payments/oxxo.svg new file mode 100644 index 000000000..0189354c4 --- /dev/null +++ b/core/img/payments/oxxo.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/paybox-dark.svg b/core/img/payments/paybox-dark.svg index 7a287d01d..583086e4d 100644 --- a/core/img/payments/paybox-dark.svg +++ b/core/img/payments/paybox-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/paybox.svg b/core/img/payments/paybox.svg index bc4562744..cd30def31 100644 --- a/core/img/payments/paybox.svg +++ b/core/img/payments/paybox.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/payconiq-dark.svg b/core/img/payments/payconiq-dark.svg index 072b2622f..3ea6d1be1 100644 --- a/core/img/payments/payconiq-dark.svg +++ b/core/img/payments/payconiq-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/payconiq.svg b/core/img/payments/payconiq.svg index 57720dd10..eb5357e75 100644 --- a/core/img/payments/payconiq.svg +++ b/core/img/payments/payconiq.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/payka-dark.svg b/core/img/payments/payka-dark.svg index cab62e983..a43bfc4fd 100644 --- a/core/img/payments/payka-dark.svg +++ b/core/img/payments/payka-dark.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/payka.svg b/core/img/payments/payka.svg index a9a5a5db6..51a9d34fa 100644 --- a/core/img/payments/payka.svg +++ b/core/img/payments/payka.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/payline-dark.svg b/core/img/payments/payline-dark.svg index b7f54d9f6..6e719a11a 100644 --- a/core/img/payments/payline-dark.svg +++ b/core/img/payments/payline-dark.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/payline.svg b/core/img/payments/payline.svg index ccdde6cec..ae6dfbe9c 100644 --- a/core/img/payments/payline.svg +++ b/core/img/payments/payline.svg @@ -1 +1,12 @@ - \ No newline at end of file + + + + + + + + + + + + diff --git a/core/img/payments/paymill-dark.svg b/core/img/payments/paymill-dark.svg deleted file mode 100644 index 9df87b0dc..000000000 --- a/core/img/payments/paymill-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/paymill.svg b/core/img/payments/paymill.svg deleted file mode 100644 index 6cb4afae8..000000000 --- a/core/img/payments/paymill.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/paynow-dark.svg b/core/img/payments/paynow-dark.svg new file mode 100644 index 000000000..aec7c68d6 --- /dev/null +++ b/core/img/payments/paynow-dark.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/core/img/payments/paynow.svg b/core/img/payments/paynow.svg new file mode 100644 index 000000000..9a67d6ff3 --- /dev/null +++ b/core/img/payments/paynow.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/core/img/payments/payone-dark.svg b/core/img/payments/payone-dark.svg index 2e460df62..aa06b6a22 100644 --- a/core/img/payments/payone-dark.svg +++ b/core/img/payments/payone-dark.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/payone.svg b/core/img/payments/payone.svg index d9e511d0a..fdd141952 100644 --- a/core/img/payments/payone.svg +++ b/core/img/payments/payone.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/payoneer-dark.svg b/core/img/payments/payoneer-dark.svg index 26b12241c..77ff673aa 100644 --- a/core/img/payments/payoneer-dark.svg +++ b/core/img/payments/payoneer-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/payoneer.svg b/core/img/payments/payoneer.svg index 5878e73aa..fd0c47077 100644 --- a/core/img/payments/payoneer.svg +++ b/core/img/payments/payoneer.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/paypal-dark.svg b/core/img/payments/paypal-dark.svg index f5a52c41d..fb064bec8 100644 --- a/core/img/payments/paypal-dark.svg +++ b/core/img/payments/paypal-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/paypal.svg b/core/img/payments/paypal.svg index 853759630..678517b2d 100644 --- a/core/img/payments/paypal.svg +++ b/core/img/payments/paypal.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/paypay-dark.svg b/core/img/payments/paypay-dark.svg new file mode 100644 index 000000000..532d5a0eb --- /dev/null +++ b/core/img/payments/paypay-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/paypay.svg b/core/img/payments/paypay.svg new file mode 100644 index 000000000..faccfbc5a --- /dev/null +++ b/core/img/payments/paypay.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/paypo-dark.svg b/core/img/payments/paypo-dark.svg index 0f0387c98..d33b599b0 100644 --- a/core/img/payments/paypo-dark.svg +++ b/core/img/payments/paypo-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/paypo.svg b/core/img/payments/paypo.svg index 07170429f..b563565ad 100644 --- a/core/img/payments/paypo.svg +++ b/core/img/payments/paypo.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/paysafe-dark.svg b/core/img/payments/paysafe-dark.svg index 746e363bf..6825b6051 100644 --- a/core/img/payments/paysafe-dark.svg +++ b/core/img/payments/paysafe-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/paysafe.svg b/core/img/payments/paysafe.svg index 807768d79..64e337e7c 100644 --- a/core/img/payments/paysafe.svg +++ b/core/img/payments/paysafe.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/paysafecard-dark.svg b/core/img/payments/paysafecard-dark.svg index 09504718c..eb97c1a08 100644 --- a/core/img/payments/paysafecard-dark.svg +++ b/core/img/payments/paysafecard-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/paysafecard.svg b/core/img/payments/paysafecard.svg index 8aa579b74..4de26869c 100644 --- a/core/img/payments/paysafecard.svg +++ b/core/img/payments/paysafecard.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/paystack-dark.svg b/core/img/payments/paystack-dark.svg new file mode 100644 index 000000000..b8c4dd49e --- /dev/null +++ b/core/img/payments/paystack-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/paystack.svg b/core/img/payments/paystack.svg new file mode 100644 index 000000000..d7f5133ee --- /dev/null +++ b/core/img/payments/paystack.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/paytm-dark.svg b/core/img/payments/paytm-dark.svg new file mode 100644 index 000000000..9b7cfaf0c --- /dev/null +++ b/core/img/payments/paytm-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/paytm.svg b/core/img/payments/paytm.svg new file mode 100644 index 000000000..831315569 --- /dev/null +++ b/core/img/payments/paytm.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/payu-dark.svg b/core/img/payments/payu-dark.svg index d7b552fa5..d2c90878e 100644 --- a/core/img/payments/payu-dark.svg +++ b/core/img/payments/payu-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/payu.svg b/core/img/payments/payu.svg index c19985ebf..2ffdf3edc 100644 --- a/core/img/payments/payu.svg +++ b/core/img/payments/payu.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/payza-dark.svg b/core/img/payments/payza-dark.svg deleted file mode 100644 index 54f23a8a5..000000000 --- a/core/img/payments/payza-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/payza.svg b/core/img/payments/payza.svg deleted file mode 100644 index df86dc7d0..000000000 --- a/core/img/payments/payza.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/phonepe-dark.svg b/core/img/payments/phonepe-dark.svg new file mode 100644 index 000000000..dcb526ab5 --- /dev/null +++ b/core/img/payments/phonepe-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/phonepe.svg b/core/img/payments/phonepe.svg new file mode 100644 index 000000000..99893768e --- /dev/null +++ b/core/img/payments/phonepe.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/pix-dark.svg b/core/img/payments/pix-dark.svg new file mode 100644 index 000000000..8fabe0c46 --- /dev/null +++ b/core/img/payments/pix-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/pix.svg b/core/img/payments/pix.svg new file mode 100644 index 000000000..336144b40 --- /dev/null +++ b/core/img/payments/pix.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/pnc-bank-dark.svg b/core/img/payments/pnc-bank-dark.svg new file mode 100644 index 000000000..c2aae8ac3 --- /dev/null +++ b/core/img/payments/pnc-bank-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/pnc-bank.svg b/core/img/payments/pnc-bank.svg new file mode 100644 index 000000000..59206da17 --- /dev/null +++ b/core/img/payments/pnc-bank.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/poli-dark.svg b/core/img/payments/poli-dark.svg index df706b730..caa5d85f9 100644 --- a/core/img/payments/poli-dark.svg +++ b/core/img/payments/poli-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/poli.svg b/core/img/payments/poli.svg index 437da502b..a0af78f32 100644 --- a/core/img/payments/poli.svg +++ b/core/img/payments/poli.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/przelewy24-dark.svg b/core/img/payments/przelewy24-dark.svg index 2695ead7e..c8c221970 100644 --- a/core/img/payments/przelewy24-dark.svg +++ b/core/img/payments/przelewy24-dark.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/przelewy24.svg b/core/img/payments/przelewy24.svg index 25d77251a..162248866 100644 --- a/core/img/payments/przelewy24.svg +++ b/core/img/payments/przelewy24.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/rapyd-dark.svg b/core/img/payments/rapyd-dark.svg new file mode 100644 index 000000000..86da3307f --- /dev/null +++ b/core/img/payments/rapyd-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/rapyd.svg b/core/img/payments/rapyd.svg new file mode 100644 index 000000000..abc69379a --- /dev/null +++ b/core/img/payments/rapyd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/razorpay-dark.svg b/core/img/payments/razorpay-dark.svg new file mode 100644 index 000000000..c46f38558 --- /dev/null +++ b/core/img/payments/razorpay-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/razorpay.svg b/core/img/payments/razorpay.svg new file mode 100644 index 000000000..0a535cb82 --- /dev/null +++ b/core/img/payments/razorpay.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/revolut-pay-dark.svg b/core/img/payments/revolut-pay-dark.svg index 4f6af5201..cd6d64c13 100644 --- a/core/img/payments/revolut-pay-dark.svg +++ b/core/img/payments/revolut-pay-dark.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/revolut-pay.svg b/core/img/payments/revolut-pay.svg index 2e204aa43..abf69b7af 100644 --- a/core/img/payments/revolut-pay.svg +++ b/core/img/payments/revolut-pay.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/img/payments/ripple-dark.svg b/core/img/payments/ripple-dark.svg index 42636ff5e..02181015b 100644 --- a/core/img/payments/ripple-dark.svg +++ b/core/img/payments/ripple-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/ripple.svg b/core/img/payments/ripple.svg index 4ebc3f9df..3eb6f493b 100644 --- a/core/img/payments/ripple.svg +++ b/core/img/payments/ripple.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/rupay-dark.svg b/core/img/payments/rupay-dark.svg new file mode 100644 index 000000000..37b68aa18 --- /dev/null +++ b/core/img/payments/rupay-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/rupay.svg b/core/img/payments/rupay.svg new file mode 100644 index 000000000..dd83d4981 --- /dev/null +++ b/core/img/payments/rupay.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/sage-dark.svg b/core/img/payments/sage-dark.svg deleted file mode 100644 index b14fb1667..000000000 --- a/core/img/payments/sage-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/sage.svg b/core/img/payments/sage.svg deleted file mode 100644 index 1ac3fc021..000000000 --- a/core/img/payments/sage.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/samsung-pay-dark.svg b/core/img/payments/samsung-pay-dark.svg index 56573b24e..be0352636 100644 --- a/core/img/payments/samsung-pay-dark.svg +++ b/core/img/payments/samsung-pay-dark.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + diff --git a/core/img/payments/samsung-pay.svg b/core/img/payments/samsung-pay.svg index 45f731db2..45b6d1095 100644 --- a/core/img/payments/samsung-pay.svg +++ b/core/img/payments/samsung-pay.svg @@ -1 +1,13 @@ - \ No newline at end of file + + + + + + + + + + + + + diff --git a/core/img/payments/santander-dark.svg b/core/img/payments/santander-dark.svg new file mode 100644 index 000000000..eb1f502d3 --- /dev/null +++ b/core/img/payments/santander-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/santander.svg b/core/img/payments/santander.svg new file mode 100644 index 000000000..c91584696 --- /dev/null +++ b/core/img/payments/santander.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/sepa-dark.svg b/core/img/payments/sepa-dark.svg index 44a0c9fae..fd55a77c0 100644 --- a/core/img/payments/sepa-dark.svg +++ b/core/img/payments/sepa-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/sepa.svg b/core/img/payments/sepa.svg index e55e56d9a..36e3d83e6 100644 --- a/core/img/payments/sepa.svg +++ b/core/img/payments/sepa.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/shop-pay-dark.svg b/core/img/payments/shop-pay-dark.svg index 70eb6fbdc..c8ac273c2 100644 --- a/core/img/payments/shop-pay-dark.svg +++ b/core/img/payments/shop-pay-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/shop-pay.svg b/core/img/payments/shop-pay.svg index 6901908c8..d4bfd9994 100644 --- a/core/img/payments/shop-pay.svg +++ b/core/img/payments/shop-pay.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/shopify-dark.svg b/core/img/payments/shopify-dark.svg index d69b4771e..3e2980684 100644 --- a/core/img/payments/shopify-dark.svg +++ b/core/img/payments/shopify-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/shopify.svg b/core/img/payments/shopify.svg index 0c64055de..8232a58d8 100644 --- a/core/img/payments/shopify.svg +++ b/core/img/payments/shopify.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/skrill-dark.svg b/core/img/payments/skrill-dark.svg index 1069e20c1..1b780db9a 100644 --- a/core/img/payments/skrill-dark.svg +++ b/core/img/payments/skrill-dark.svg @@ -1 +1,10 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/core/img/payments/skrill.svg b/core/img/payments/skrill.svg index 9afe8c2a1..1b125b886 100644 --- a/core/img/payments/skrill.svg +++ b/core/img/payments/skrill.svg @@ -1 +1,10 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/core/img/payments/skycash-dark.svg b/core/img/payments/skycash-dark.svg new file mode 100644 index 000000000..fba4e32b8 --- /dev/null +++ b/core/img/payments/skycash-dark.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/skycash.svg b/core/img/payments/skycash.svg new file mode 100644 index 000000000..c1dba78e8 --- /dev/null +++ b/core/img/payments/skycash.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/core/img/payments/sofort-dark.svg b/core/img/payments/sofort-dark.svg new file mode 100644 index 000000000..5945ce6de --- /dev/null +++ b/core/img/payments/sofort-dark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/sofort.svg b/core/img/payments/sofort.svg new file mode 100644 index 000000000..87db5c8d0 --- /dev/null +++ b/core/img/payments/sofort.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/core/img/payments/solana-dark.svg b/core/img/payments/solana-dark.svg index 1f3147ace..37e15c1bb 100644 --- a/core/img/payments/solana-dark.svg +++ b/core/img/payments/solana-dark.svg @@ -1 +1,20 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/solana.svg b/core/img/payments/solana.svg index dd05204d8..a75f58251 100644 --- a/core/img/payments/solana.svg +++ b/core/img/payments/solana.svg @@ -1 +1,20 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/solo-dark.svg b/core/img/payments/solo-dark.svg deleted file mode 100644 index c620b55fc..000000000 --- a/core/img/payments/solo-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/solo.svg b/core/img/payments/solo.svg deleted file mode 100644 index 4efa271d8..000000000 --- a/core/img/payments/solo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/spingo-dark.svg b/core/img/payments/spingo-dark.svg index e487563d7..b47da81ca 100644 --- a/core/img/payments/spingo-dark.svg +++ b/core/img/payments/spingo-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/spingo.svg b/core/img/payments/spingo.svg index e96c0558a..f15325389 100644 --- a/core/img/payments/spingo.svg +++ b/core/img/payments/spingo.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/square-dark.svg b/core/img/payments/square-dark.svg index 70239e18c..632066ed2 100644 --- a/core/img/payments/square-dark.svg +++ b/core/img/payments/square-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/square.svg b/core/img/payments/square.svg index 84fc0a0fd..7bb0f0d4e 100644 --- a/core/img/payments/square.svg +++ b/core/img/payments/square.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/stax-dark.svg b/core/img/payments/stax-dark.svg index 38609e7cf..b2cfe4cc6 100644 --- a/core/img/payments/stax-dark.svg +++ b/core/img/payments/stax-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/stax.svg b/core/img/payments/stax.svg index 53ce0f348..8988448b9 100644 --- a/core/img/payments/stax.svg +++ b/core/img/payments/stax.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/stcpay-dark.svg b/core/img/payments/stcpay-dark.svg new file mode 100644 index 000000000..7cb1f476d --- /dev/null +++ b/core/img/payments/stcpay-dark.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/stcpay.svg b/core/img/payments/stcpay.svg new file mode 100644 index 000000000..a36f5614d --- /dev/null +++ b/core/img/payments/stcpay.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/core/img/payments/stripe-dark.svg b/core/img/payments/stripe-dark.svg index 34670aaf2..d55bc3f28 100644 --- a/core/img/payments/stripe-dark.svg +++ b/core/img/payments/stripe-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/stripe.svg b/core/img/payments/stripe.svg index c02fba2b1..bfe9d1410 100644 --- a/core/img/payments/stripe.svg +++ b/core/img/payments/stripe.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/sumitomo-mitsui-dark.svg b/core/img/payments/sumitomo-mitsui-dark.svg new file mode 100644 index 000000000..93954c835 --- /dev/null +++ b/core/img/payments/sumitomo-mitsui-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/sumitomo-mitsui.svg b/core/img/payments/sumitomo-mitsui.svg new file mode 100644 index 000000000..6d20975bf --- /dev/null +++ b/core/img/payments/sumitomo-mitsui.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/swift-dark.svg b/core/img/payments/swift-dark.svg new file mode 100644 index 000000000..80466531a --- /dev/null +++ b/core/img/payments/swift-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/swift.svg b/core/img/payments/swift.svg new file mode 100644 index 000000000..9d428a8aa --- /dev/null +++ b/core/img/payments/swift.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/swish-dark.svg b/core/img/payments/swish-dark.svg new file mode 100644 index 000000000..0ed0bdabb --- /dev/null +++ b/core/img/payments/swish-dark.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/swish.svg b/core/img/payments/swish.svg new file mode 100644 index 000000000..421f42305 --- /dev/null +++ b/core/img/payments/swish.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/switch-dark.svg b/core/img/payments/switch-dark.svg deleted file mode 100644 index 520d66e2e..000000000 --- a/core/img/payments/switch-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/switch.svg b/core/img/payments/switch.svg deleted file mode 100644 index 3e882c1ce..000000000 --- a/core/img/payments/switch.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/synchrony-dark.svg b/core/img/payments/synchrony-dark.svg new file mode 100644 index 000000000..709fd63e4 --- /dev/null +++ b/core/img/payments/synchrony-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/synchrony.svg b/core/img/payments/synchrony.svg new file mode 100644 index 000000000..434643b35 --- /dev/null +++ b/core/img/payments/synchrony.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/tether-dark.svg b/core/img/payments/tether-dark.svg index 2729646e2..c2de29c50 100644 --- a/core/img/payments/tether-dark.svg +++ b/core/img/payments/tether-dark.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/tether.svg b/core/img/payments/tether.svg index b3b68bd07..8b3906b7d 100644 --- a/core/img/payments/tether.svg +++ b/core/img/payments/tether.svg @@ -1 +1,11 @@ - \ No newline at end of file + + + + + + + + + + + diff --git a/core/img/payments/tpay-dark.svg b/core/img/payments/tpay-dark.svg index 3191ee7e4..d205ec4e0 100644 --- a/core/img/payments/tpay-dark.svg +++ b/core/img/payments/tpay-dark.svg @@ -1 +1,10 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/core/img/payments/tpay.svg b/core/img/payments/tpay.svg index 930add058..e795fa0b5 100644 --- a/core/img/payments/tpay.svg +++ b/core/img/payments/tpay.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/troy-dark.svg b/core/img/payments/troy-dark.svg index aeb2872c7..24a633b7f 100644 --- a/core/img/payments/troy-dark.svg +++ b/core/img/payments/troy-dark.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/troy.svg b/core/img/payments/troy.svg index d998cc1ef..3f8ab3e88 100644 --- a/core/img/payments/troy.svg +++ b/core/img/payments/troy.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/true-usd-dark.svg b/core/img/payments/true-usd-dark.svg index 8df1aada4..984ddeeb2 100644 --- a/core/img/payments/true-usd-dark.svg +++ b/core/img/payments/true-usd-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/true-usd.svg b/core/img/payments/true-usd.svg index f3cfd1dbd..5a91f23c7 100644 --- a/core/img/payments/true-usd.svg +++ b/core/img/payments/true-usd.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/trustly-dark.svg b/core/img/payments/trustly-dark.svg new file mode 100644 index 000000000..626288c5b --- /dev/null +++ b/core/img/payments/trustly-dark.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/trustly.svg b/core/img/payments/trustly.svg new file mode 100644 index 000000000..9c20894da --- /dev/null +++ b/core/img/payments/trustly.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/core/img/payments/twint-dark.svg b/core/img/payments/twint-dark.svg new file mode 100644 index 000000000..0e96eb560 --- /dev/null +++ b/core/img/payments/twint-dark.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/twint.svg b/core/img/payments/twint.svg new file mode 100644 index 000000000..a319aa1a3 --- /dev/null +++ b/core/img/payments/twint.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/ubs-dark.svg b/core/img/payments/ubs-dark.svg new file mode 100644 index 000000000..b6da8904e --- /dev/null +++ b/core/img/payments/ubs-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/ubs.svg b/core/img/payments/ubs.svg new file mode 100644 index 000000000..862ffa207 --- /dev/null +++ b/core/img/payments/ubs.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/core/img/payments/ukash-dark.svg b/core/img/payments/ukash-dark.svg deleted file mode 100644 index 8061b1e15..000000000 --- a/core/img/payments/ukash-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/ukash.svg b/core/img/payments/ukash.svg deleted file mode 100644 index 842157415..000000000 --- a/core/img/payments/ukash.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/unionpay-dark.svg b/core/img/payments/unionpay-dark.svg index a6b60a8e0..5acc83a6b 100644 --- a/core/img/payments/unionpay-dark.svg +++ b/core/img/payments/unionpay-dark.svg @@ -1 +1,6 @@ - \ No newline at end of file + + + + + + diff --git a/core/img/payments/unionpay.svg b/core/img/payments/unionpay.svg index 0dae4cd40..7dd4af770 100644 --- a/core/img/payments/unionpay.svg +++ b/core/img/payments/unionpay.svg @@ -1 +1,7 @@ - \ No newline at end of file + + + + + + + diff --git a/core/img/payments/upi-dark.svg b/core/img/payments/upi-dark.svg new file mode 100644 index 000000000..aefe378f1 --- /dev/null +++ b/core/img/payments/upi-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/upi.svg b/core/img/payments/upi.svg new file mode 100644 index 000000000..7228da10d --- /dev/null +++ b/core/img/payments/upi.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/us-bank-dark.svg b/core/img/payments/us-bank-dark.svg new file mode 100644 index 000000000..850a05cdd --- /dev/null +++ b/core/img/payments/us-bank-dark.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/core/img/payments/us-bank.svg b/core/img/payments/us-bank.svg new file mode 100644 index 000000000..6f4f08244 --- /dev/null +++ b/core/img/payments/us-bank.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/core/img/payments/usdc-dark.svg b/core/img/payments/usdc-dark.svg new file mode 100644 index 000000000..9df2e08a4 --- /dev/null +++ b/core/img/payments/usdc-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/usdc.svg b/core/img/payments/usdc.svg new file mode 100644 index 000000000..c31bb9469 --- /dev/null +++ b/core/img/payments/usdc.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/venmo-dark.svg b/core/img/payments/venmo-dark.svg index e8328be24..f51c8551b 100644 --- a/core/img/payments/venmo-dark.svg +++ b/core/img/payments/venmo-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/venmo.svg b/core/img/payments/venmo.svg index 0588c2441..277cfd28d 100644 --- a/core/img/payments/venmo.svg +++ b/core/img/payments/venmo.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/verifone-dark.svg b/core/img/payments/verifone-dark.svg index dbbcb7e24..de2a7d6fe 100644 --- a/core/img/payments/verifone-dark.svg +++ b/core/img/payments/verifone-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/verifone.svg b/core/img/payments/verifone.svg index f099f3e46..7e4339019 100644 --- a/core/img/payments/verifone.svg +++ b/core/img/payments/verifone.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/verisign-dark.svg b/core/img/payments/verisign-dark.svg deleted file mode 100644 index 5e265ca49..000000000 --- a/core/img/payments/verisign-dark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/verisign.svg b/core/img/payments/verisign.svg deleted file mode 100644 index 357574a31..000000000 --- a/core/img/payments/verisign.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/core/img/payments/vipps-dark.svg b/core/img/payments/vipps-dark.svg new file mode 100644 index 000000000..5d079c442 --- /dev/null +++ b/core/img/payments/vipps-dark.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/vipps.svg b/core/img/payments/vipps.svg new file mode 100644 index 000000000..40f322a0c --- /dev/null +++ b/core/img/payments/vipps.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/core/img/payments/visa-dark.svg b/core/img/payments/visa-dark.svg index c2cd04514..071f75060 100644 --- a/core/img/payments/visa-dark.svg +++ b/core/img/payments/visa-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/visa.svg b/core/img/payments/visa.svg index 96dd0f788..f14d1e0c6 100644 --- a/core/img/payments/visa.svg +++ b/core/img/payments/visa.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/we-chat-pay-dark.svg b/core/img/payments/we-chat-pay-dark.svg index bb91a42a0..d59b8c764 100644 --- a/core/img/payments/we-chat-pay-dark.svg +++ b/core/img/payments/we-chat-pay-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/we-chat-pay.svg b/core/img/payments/we-chat-pay.svg index 7bfe58a26..4fbe79d34 100644 --- a/core/img/payments/we-chat-pay.svg +++ b/core/img/payments/we-chat-pay.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/webmoney-dark.svg b/core/img/payments/webmoney-dark.svg index 9a1f2737e..0d07020a0 100644 --- a/core/img/payments/webmoney-dark.svg +++ b/core/img/payments/webmoney-dark.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/webmoney.svg b/core/img/payments/webmoney.svg index f525487ae..daf91a118 100644 --- a/core/img/payments/webmoney.svg +++ b/core/img/payments/webmoney.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/wells-fargo-dark.svg b/core/img/payments/wells-fargo-dark.svg new file mode 100644 index 000000000..ce8d7ff5b --- /dev/null +++ b/core/img/payments/wells-fargo-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/wells-fargo.svg b/core/img/payments/wells-fargo.svg new file mode 100644 index 000000000..5f8b21fd4 --- /dev/null +++ b/core/img/payments/wells-fargo.svg @@ -0,0 +1,4 @@ + + + + diff --git a/core/img/payments/westernunion-dark.svg b/core/img/payments/westernunion-dark.svg index f813ba451..a1d2ded2f 100644 --- a/core/img/payments/westernunion-dark.svg +++ b/core/img/payments/westernunion-dark.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/westernunion.svg b/core/img/payments/westernunion.svg index 0046876e4..716c15976 100644 --- a/core/img/payments/westernunion.svg +++ b/core/img/payments/westernunion.svg @@ -1 +1,18 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/wire-transfer-dark.svg b/core/img/payments/wire-transfer-dark.svg new file mode 100644 index 000000000..ed7ce8713 --- /dev/null +++ b/core/img/payments/wire-transfer-dark.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/wire-transfer.svg b/core/img/payments/wire-transfer.svg new file mode 100644 index 000000000..2581ed9cc --- /dev/null +++ b/core/img/payments/wire-transfer.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/img/payments/wise-dark.svg b/core/img/payments/wise-dark.svg index b5e8a63b1..4e116c042 100644 --- a/core/img/payments/wise-dark.svg +++ b/core/img/payments/wise-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/wise.svg b/core/img/payments/wise.svg index aa6fa413c..0513be637 100644 --- a/core/img/payments/wise.svg +++ b/core/img/payments/wise.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/worldpay-dark.svg b/core/img/payments/worldpay-dark.svg index 21eacde57..b60b88ae8 100644 --- a/core/img/payments/worldpay-dark.svg +++ b/core/img/payments/worldpay-dark.svg @@ -1 +1,4 @@ - \ No newline at end of file + + + + diff --git a/core/img/payments/worldpay.svg b/core/img/payments/worldpay.svg index 706c9687a..0e60f525c 100644 --- a/core/img/payments/worldpay.svg +++ b/core/img/payments/worldpay.svg @@ -1 +1,5 @@ - \ No newline at end of file + + + + + diff --git a/core/img/payments/zelle-dark.svg b/core/img/payments/zelle-dark.svg index 61df2384b..66a358d28 100644 --- a/core/img/payments/zelle-dark.svg +++ b/core/img/payments/zelle-dark.svg @@ -1 +1,9 @@ - \ No newline at end of file + + + + + + + + + diff --git a/core/img/payments/zelle.svg b/core/img/payments/zelle.svg index 10113c1d2..23dbbc724 100644 --- a/core/img/payments/zelle.svg +++ b/core/img/payments/zelle.svg @@ -1 +1,8 @@ - \ No newline at end of file + + + + + + + + diff --git a/core/js/tabler-theme.ts b/core/js/tabler-theme.ts index 23b2b73c0..597a9a19d 100644 --- a/core/js/tabler-theme.ts +++ b/core/js/tabler-theme.ts @@ -12,7 +12,7 @@ interface ThemeConfig { } const themeConfig: ThemeConfig = { - 'theme': 'light', + 'theme': 'auto', 'theme-base': 'gray', 'theme-font': 'sans-serif', 'theme-primary': 'blue', @@ -49,7 +49,8 @@ for (const key in themeConfig) { } prefersDark.addEventListener('change', (event) => { - if (localStorage.getItem('tabler-theme') === 'auto') { + // No stored choice means the default, which is auto. + if ((localStorage.getItem('tabler-theme') ?? 'auto') === 'auto') { if (event.matches) { document.documentElement.setAttribute('data-bs-theme', 'dark') } else { diff --git a/core/package.json b/core/package.json index c2888c5a3..39f523f2e 100644 --- a/core/package.json +++ b/core/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "pnpm run watch", "dev-prepare": "pnpm run clean && pnpm run copy && concurrently \"pnpm run css-build\" \"pnpm run js-build\"", - "build": "pnpm run clean && pnpm run build-assets && pnpm run copy && pnpm run generate-sri", + "build": "pnpm run clean && pnpm run build-assets && pnpm run copy", "build-assets": "concurrently \"pnpm run css\" \"pnpm run js\"", "clean": "shx rm -rf dist demo", "css": "tsx ../.build/build-css.ts scss dist/css --rtl --minify --banner", @@ -30,7 +30,6 @@ "watch-css": "nodemon --watch scss/ --ext scss --exec \"pnpm run css-build\"", "watch-js": "nodemon --watch js/ --ext ts,js --exec \"pnpm run js-build\"", "bundlewatch": "bundlewatch", - "generate-sri": "tsx .build/generate-sri.ts", "type-check": "tsc --noEmit", "test": "concurrently \"pnpm run test:js\" \"pnpm run test:scss\"", "test:js": "vitest run", @@ -132,19 +131,19 @@ }, { "path": "./dist/css/tabler-payments.css", - "maxSize": "2.4 kB" + "maxSize": "3.5 kB" }, { "path": "./dist/css/tabler-payments.min.css", - "maxSize": "2.1 kB" + "maxSize": "3.25 kB" }, { "path": "./dist/css/tabler-payments.rtl.css", - "maxSize": "2.4 kB" + "maxSize": "3.5 kB" }, { "path": "./dist/css/tabler-payments.rtl.min.css", - "maxSize": "2.1 kB" + "maxSize": "3.25 kB" }, { "path": "./dist/css/tabler-props.css", diff --git a/core/scss/_extends.scss b/core/scss/_extends.scss index 27fa86bd0..736876052 100644 --- a/core/scss/_extends.scss +++ b/core/scss/_extends.scss @@ -55,7 +55,26 @@ // Markdown tables pick up the styled table look (from `ui/_markdown.scss`) .prose > table, .markdown > table { - @extend .table, .table-bordered, .table-sm; + @extend .table; + font-size: var(--body-font-size); + + th:first-child, + td:first-child { + padding-left: 0; + } + + th:last-child, + td:last-child { + padding-right: 0; + } + + tr:last-child > * { + border-bottom: 0; + } + + th { + --bg-surface-tertiary: transparent; + } } // Light-scoped subtrees inside a dark body inherit the dark styles diff --git a/core/scss/_props.scss b/core/scss/_props.scss index c6828d9de..2b9b75e5b 100644 --- a/core/scss/_props.scss +++ b/core/scss/_props.scss @@ -26,6 +26,7 @@ --gray-950: #{$gray-950}; --white: #{$white}; + --white-lt: color-mix(in oklab, var(--white) 10%, transparent); --black: #{$black}; --dark: #{$dark}; --light: #{$light}; diff --git a/core/scss/_utilities.scss b/core/scss/_utilities.scss index 3679bc112..d73e25014 100644 --- a/core/scss/_utilities.scss +++ b/core/scss/_utilities.scss @@ -564,13 +564,6 @@ $utilities: map.merge( class: column-gap, values: $spacers, ), - 'bg-pattern': ( - property: background, - class: bg-pattern, - values: ( - transparent: #{url-svg('')} repeat center/16px 16px, - ), - ), 'bg-gradient': ( property: background, class: bg-gradient, @@ -839,7 +832,7 @@ $utilities: map.merge( ), ), 'rounded-end': ( - property: border-end-end-radius border-end-start-radius, + property: border-end-end-radius border-start-end-radius, class: rounded-end, values: ( null: var(--border-radius), @@ -869,7 +862,7 @@ $utilities: map.merge( ), ), 'rounded-start': ( - property: border-start-start-radius border-start-end-radius, + property: border-start-start-radius border-end-start-radius, class: rounded-start, values: ( null: var(--border-radius), diff --git a/core/scss/_variables.scss b/core/scss/_variables.scss index 8a9ccf13a..f98858de2 100644 --- a/core/scss/_variables.scss +++ b/core/scss/_variables.scss @@ -373,8 +373,6 @@ $body-secondary-bg: $gray-200 !default; $body-tertiary-color: rgba($body-color, 0.5) !default; $body-tertiary-bg: $gray-100 !default; -$body-emphasis-color: $black !default; - // Typography $font-google: null !default; $font-google-monospaced: null !default; @@ -727,8 +725,8 @@ $backdrop-opacity: 0.32 !default; $backdrop-blur: 4px !default; $backdrop-bg: light-dark(var(--gray-800), var(--black)) !default; $backdrops: ( - dark: color-mix(in sRGB, var(--color-dark), transparent var(--backdrop-opacity)), - light: color-mix(in sRGB, var(--color-light), transparent var(--backdrop-opacity)), + dark: color-mix(in sRGB, var(--dark), transparent var(--backdrop-opacity)), + light: color-mix(in sRGB, var(--light), transparent var(--backdrop-opacity)), ) !default; // Gradient @@ -786,7 +784,7 @@ $kbd-padding-y: 0.25rem !default; $kbd-font-weight: var(--font-weight-medium) !default; $kbd-font-size: var(--font-size-h5) !default; $kbd-border: var(--border-width) var(--border-style) var(--border-color) !default; -$kbd-color: var(--text-secondary-dark) !default; +$kbd-color: var(--secondary-color) !default; $kbd-bg: var(--code-bg) !default; $kbd-border-radius: var(--border-radius) !default; $nested-kbd-font-weight: null !default; // Deprecated in v5.2.0, removing in v6 @@ -795,7 +793,6 @@ $nested-kbd-font-weight: null !default; // Deprecated in v5.2.0, removing in v6 // scss-docs-start avatar-variables $avatar-size: 2.5rem !default; $avatar-status-size: 0.75rem !default; -$avatar-font-size: 1rem !default; $avatar-icon-size: 1.5rem !default; $avatar-brand-size: 1.25rem !default; $avatar-upload-icon-size: 1.5rem !default; @@ -1006,7 +1003,7 @@ $box-shadow-inset: inset 0 1px 2px rgba($black, 0.075) !default; $component-active-color: $white !default; $component-active-bg: $primary !default; -// Focus +// Focus (WCAG 2.2 SC 1.4.11) $focus-ring-width: 0.25rem !default; $focus-ring-opacity: 0.25 !default; $focus-ring-color: color-mix(in srgb, var(--primary) #{math.percentage($focus-ring-opacity)}, transparent) !default; @@ -1312,6 +1309,7 @@ $accordion-button-active-color: inherit !default; $accordion-btn-gap: 0.75rem !default; $accordion-header-gap: 1rem !default; $accordion-tabs-gap: 0.75rem !default; +$accordion-btn-focus-box-shadow: $focus-ring-box-shadow !default; // scss-docs-end accordion-variables // Carousel @@ -1355,7 +1353,7 @@ $carousel-indicators-vertical-margin-inline-end: 1rem !default; // Close $btn-close-width: 1em !default; -$btn-close-padding-x: 0.25em !default; +$btn-close-padding-x: 0.875em !default; $btn-close-padding-y: $btn-close-padding-x !default; $btn-close-color: $body-color !default; $btn-close-bg: url("data:image/svg+xml,") !default; @@ -2193,6 +2191,18 @@ $pattern-size-sm: 0.25rem !default; $pattern-size-md: 0.5rem !default; $pattern-size-lg: 0.75rem !default; $pattern-size-xl: 1rem !default; +$pattern-opacity: 10% !default; +$pattern-opacity-factor: 1 !default; +$pattern-opacity-lighter: 6% !default; +$pattern-opacity-light: 8% !default; +$pattern-opacity-dark: 20% !default; +$pattern-opacity-darker: 50% !default; +$pattern-opacities: ( + lighter: $pattern-opacity-lighter, + light: $pattern-opacity-light, + dark: $pattern-opacity-dark, + darker: $pattern-opacity-darker, +) !default; // Markdown $markdown-heading-margin-top: 2.5rem !default; @@ -2283,33 +2293,51 @@ $payment-sizes: $avatar-sizes !default; $payment-providers: ( '2c2p', '2checkout', + 'ach-transfer', 'adyen', 'affirm', + 'afterpay', + 'airtm', + 'airwallex', 'alipay-plus', 'alipay', 'allegro-pay', 'amazon-pay', 'amazon', 'americanexpress', + 'ant-group', 'applepay', 'authorize', 'autopay', 'bancontact', + 'bank-of-america', + 'barclays', + 'bbva', 'binance-usd', + 'binance', 'bitcoin', 'bitpay', 'bkash', 'blik', + 'bnb-chain', + 'bnp-paribas', 'braintree', + 'brex', + 'capital-one', 'cash-app', + 'chase', + 'checkout-com', 'chime', + 'china-construction-bank', 'cirrus', - 'clickandbuy', + 'citi', + 'coinbase', 'coinkite', + 'crypto-com', + 'deutsche-bank', 'dinersclub', 'directdebit', 'discover', - 'dotpay', 'dwolla', 'easypaisa', 'ebay', @@ -2318,73 +2346,117 @@ $payment-providers: ( 'esewa', 'ethereum', 'eway', + 'fifth-third-bank', + 'fiserv', + 'flutterwave', 'fonepay', + 'gcash', 'giropay', + 'goldman-sachs', 'google-pay', 'googlewallet', + 'grabpay', + 'hsbc', 'hubspot', - 'ingenico', + 'huntington-bank', + 'icbc', 'ideal', 'imepay', + 'imoje', + 'ing', + 'ingenico', + 'interac', + 'jazzcash', 'jcb', 'khalti', 'klarna', - 'laser', + 'kraken', + 'linepay', 'litecoin', + 'mada', 'maestro', 'mastercard', 'mercado-pago', + 'mercury', + 'meta-pay', 'metamask', 'mir', + 'mitsubishi-ufj', + 'mobilepay', + 'mollie', 'monero', 'moneygram', + 'mpesa', + 'ncr', 'neteller', - 'ogone', - 'okpay', + 'northone', + 'nu', + 'nuvei', 'opensea', + 'oxxo', 'paybox', 'payconiq', 'payka', 'payline', - 'paymill', + 'paynow', 'payone', 'payoneer', 'paypal', + 'paypay', 'paypo', 'paysafe', 'paysafecard', + 'paystack', + 'paytm', 'payu', - 'payza', + 'phonepe', + 'pix', + 'pnc-bank', 'poli', 'przelewy24', + 'rapyd', + 'razorpay', 'revolut-pay', 'ripple', - 'sage', + 'rupay', 'samsung-pay', + 'santander', 'sepa', 'shop-pay', 'shopify', 'skrill', + 'skycash', + 'sofort', 'solana', - 'solo', 'spingo', 'square', 'stax', + 'stcpay', 'stripe', - 'switch', + 'sumitomo-mitsui', + 'swift', + 'swish', + 'synchrony', 'tether', 'tpay', 'troy', 'true-usd', - 'ukash', + 'trustly', + 'twint', + 'ubs', 'unionpay', + 'upi', + 'us-bank', + 'usdc', 'venmo', 'verifone', - 'verisign', + 'vipps', 'visa', 'we-chat-pay', 'webmoney', + 'wells-fargo', 'westernunion', + 'wire-transfer', 'wise', 'worldpay', 'zelle' diff --git a/core/scss/bootstrap/_dropdown.scss b/core/scss/bootstrap/_dropdown.scss index 352dce3eb..95463a89f 100644 --- a/core/scss/bootstrap/_dropdown.scss +++ b/core/scss/bootstrap/_dropdown.scss @@ -62,7 +62,6 @@ list-style: none; background-color: var(--dropdown-bg); background-clip: padding-box; - border: var(--dropdown-border-width) solid var(--dropdown-border-color); @include border-radius(var(--dropdown-border-radius)); @include box-shadow(var(--dropdown-box-shadow)); diff --git a/core/scss/bootstrap/_placeholders.scss b/core/scss/bootstrap/_placeholders.scss index d6121b5af..08b212469 100644 --- a/core/scss/bootstrap/_placeholders.scss +++ b/core/scss/bootstrap/_placeholders.scss @@ -31,6 +31,10 @@ .placeholder-glow { .placeholder { animation: placeholder-glow 2s ease-in-out infinite; + + @media (prefers-reduced-motion: reduce) { + animation: none; + } } } @@ -44,6 +48,10 @@ mask-image: linear-gradient(130deg, $black 55%, rgba(0, 0, 0, (1 - $placeholder-opacity-min)) 75%, $black 95%); mask-size: 200% 100%; animation: placeholder-wave 2s linear infinite; + + @media (prefers-reduced-motion: reduce) { + animation: none; + } } @keyframes placeholder-wave { diff --git a/core/scss/layout/_dark.scss b/core/scss/layout/_dark.scss index 3b59491a3..90325bd59 100644 --- a/core/scss/layout/_dark.scss +++ b/core/scss/layout/_dark.scss @@ -48,4 +48,15 @@ // The global `@extend [data-bs-theme='dark']` for light-scoped subtrees // inside a dark body lives in `_extends.scss` — with the module system it // must have every dark-styling module upstream. + + // Printing a dark page wastes ink/toner and can leave near-white text on + // paper, since browsers skip background colors in print by default. Force + // every light-dark() token back to its light value regardless of theme. + @include media-print() { + :root, + [data-bs-theme='dark'], + [data-theme='dark'] { + color-scheme: light !important; + } + } } diff --git a/core/scss/layout/_navbar.scss b/core/scss/layout/_navbar.scss index e5757e47e..96624a78e 100644 --- a/core/scss/layout/_navbar.scss +++ b/core/scss/layout/_navbar.scss @@ -97,6 +97,10 @@ Navbar background: var(--navbar-bg); box-shadow: inset 0 calc(-1 * var(--navbar-border-width)) 0 0 var(--navbar-border-color); + @include media-print() { + display: none; + } + .navbar-collapse & { flex-grow: 1; } @@ -391,6 +395,13 @@ Navbar vertical } } } + + @include media-print() { + .navbar-vertical ~ .page { + padding-inline-start: 0; + padding-inline-end: 0; + } + } } .navbar-overlap { diff --git a/core/scss/mixins/_functions.scss b/core/scss/mixins/_functions.scss index b276a113a..9176033f1 100644 --- a/core/scss/mixins/_functions.scss +++ b/core/scss/mixins/_functions.scss @@ -19,7 +19,7 @@ // "Bootstrap functions" section below. @mixin media-breakpoint-down-than($name, $breakpoints: $grid-breakpoints) { - $prev: breakpoint-prev($name); + $prev: breakpoint-prev($name, $breakpoints); @if $prev == null { @content; diff --git a/core/scss/mixins/bootstrap/_border-radius.scss b/core/scss/mixins/bootstrap/_border-radius.scss index a65388340..08e3e1163 100644 --- a/core/scss/mixins/bootstrap/_border-radius.scss +++ b/core/scss/mixins/bootstrap/_border-radius.scss @@ -22,28 +22,9 @@ @return $return; } -@function squircle-radius($radius) { - $return: (); - @each $value in valid-radius($radius) { - @if $value == 0 { - $return: list.append($return, 0); - } @else { - $return: list.append($return, calc(#{$value} * 2.5)); - } - } - @return $return; -} - @mixin border-radius($radius: $border-radius, $fallback-border-radius: false) { @if $enable-rounded { border-radius: valid-radius($radius); - - // @if $radius != 0 { - // @supports (corner-shape: squircle) { - // corner-shape: squircle; - // border-radius: squircle-radius($radius) !important; - // } - // } } @else if $fallback-border-radius != false { border-radius: $fallback-border-radius; } diff --git a/core/scss/mixins/bootstrap/_caret.scss b/core/scss/mixins/bootstrap/_caret.scss index 7fd6c4df2..3b601e1d5 100644 --- a/core/scss/mixins/bootstrap/_caret.scss +++ b/core/scss/mixins/bootstrap/_caret.scss @@ -33,7 +33,7 @@ @mixin caret($direction: down, $width: $caret-width, $spacing: $caret-spacing, $vertical-align: $caret-vertical-align) { $selector: 'after'; - @if $direction == 'left' { + @if $direction == 'start' { $selector: 'before'; } @@ -47,7 +47,7 @@ border-inline-start: 1px var(--border-style); margin-inline-end: 0.1em; - @if $direction != 'left' { + @if $direction != 'start' { margin-inline-start: $caret-spacing; } @else { margin-inline-end: $caret-spacing; @@ -64,7 +64,7 @@ } } - @if $direction == 'left' { + @if $direction == 'start' { &::after { content: none; } diff --git a/core/scss/tests/__snapshots__/css-var-prefix.test.mjs.snap b/core/scss/tests/__snapshots__/css-var-prefix.test.mjs.snap index 2bd2e2824..a6e852438 100644 --- a/core/scss/tests/__snapshots__/css-var-prefix.test.mjs.snap +++ b/core/scss/tests/__snapshots__/css-var-prefix.test.mjs.snap @@ -43,6 +43,8 @@ exports[`css custom-property prefixing > leaves vendor-owned names alone and pre "--tblr-font-size-h5", "--tblr-font-weight-medium", "--tblr-font-weight-semibold", + "--tblr-form-select-bg-icon", + "--tblr-form-select-bg-img", "--tblr-gray-500", "--tblr-icon-size", "--tblr-info", diff --git a/core/scss/tests/_border-radius.test.scss b/core/scss/tests/_border-radius.test.scss index 10418438a..c02ffe9f0 100644 --- a/core/scss/tests/_border-radius.test.scss +++ b/core/scss/tests/_border-radius.test.scss @@ -21,13 +21,3 @@ @include assert-equal(meta.inspect(valid-radius(4px -2px 6px)), '4px 0 6px'); } } - -@include describe('squircle-radius') { - @include it('keeps 0 as 0') { - @include assert-equal(meta.inspect(squircle-radius(0)), '0'); - } - - @include it('scales a non-zero radius by 2.5 via calc()') { - @include assert-equal(meta.inspect(squircle-radius(4px)), 'calc(4px * 2.5)'); - } -} diff --git a/core/scss/tests/_caret.test.scss b/core/scss/tests/_caret.test.scss index 2fcca4d7f..d5e022b3c 100644 --- a/core/scss/tests/_caret.test.scss +++ b/core/scss/tests/_caret.test.scss @@ -1,7 +1,7 @@ // Output tests for the caret mixins in scss/mixins/bootstrap/_caret.scss. // The `caret-{down,up,end,start}` helpers draw a triangle out of borders; the // main `caret()` builds a pseudo-element and branches on `$direction` for the -// rotation and (for `left`) the ::before/::after structure. +// rotation and (for `start`) the ::before/::after structure. @use '../mixins/bootstrap/caret' as *; @@ -86,11 +86,11 @@ } } - @include it('uses ::before and clears ::after for the left direction') { + @include it('uses ::before and clears ::after for the start direction') { @include assert() { @include output() { .t { - @include caret(left); + @include caret(start); } } @include expect() { diff --git a/core/scss/tests/_media-breakpoint.test.scss b/core/scss/tests/_media-breakpoint.test.scss index 1412d6315..85ddee4e2 100644 --- a/core/scss/tests/_media-breakpoint.test.scss +++ b/core/scss/tests/_media-breakpoint.test.scss @@ -174,4 +174,29 @@ $g: ( } } } + + // Names that don't exist in the global $grid-breakpoints at all: this only + // resolves if $breakpoints actually reaches the breakpoint-prev() lookup, + // not just the breakpoint-max() one. + $custom: ( + tablet: 0, + desktop: 900px, + ); + + @include it('resolves the previous breakpoint from a custom $breakpoints map') { + @include assert() { + @include output() { + @include media-breakpoint-down-than(desktop, $custom) { + .t { + color: red; + } + } + } + @include expect() { + .t { + color: red; + } + } + } + } } diff --git a/core/scss/ui/_accordion.scss b/core/scss/ui/_accordion.scss index 4bd1774c4..148d44e98 100644 --- a/core/scss/ui/_accordion.scss +++ b/core/scss/ui/_accordion.scss @@ -18,6 +18,7 @@ --accordion-body-padding-y: #{$accordion-body-padding-y}; --accordion-btn-gap: #{$accordion-btn-gap}; --accordion-header-gap: #{$accordion-header-gap}; + --accordion-btn-focus-box-shadow: #{$accordion-btn-focus-box-shadow}; display: flex; flex-direction: column; diff --git a/core/scss/ui/_alerts.scss b/core/scss/ui/_alerts.scss index ab341f11b..43e18663f 100644 --- a/core/scss/ui/_alerts.scss +++ b/core/scss/ui/_alerts.scss @@ -26,7 +26,6 @@ color: var(--alert-color); background-color: color-mix(in sRGB, var(--alert-bg), var(--bg-surface)); border: var(--border-width) var(--border-style) var(--alert-border-color); - box-shadow: var(--box-shadow); @include border-radius(var(--alert-border-radius)); } diff --git a/core/scss/ui/_badges.scss b/core/scss/ui/_badges.scss index 32f61d168..abaee5605 100644 --- a/core/scss/ui/_badges.scss +++ b/core/scss/ui/_badges.scss @@ -70,9 +70,11 @@ } // -// Badges list +// Badge list // +.badge-list, .badges-list { + // `.badges-list` is deprecated, use `.badge-list` instead @include elements-list(); } diff --git a/core/scss/ui/_cards.scss b/core/scss/ui/_cards.scss index 1c2800fbc..3ecdeeedf 100644 --- a/core/scss/ui/_cards.scss +++ b/core/scss/ui/_cards.scss @@ -24,6 +24,7 @@ @include media-print() { border: none; box-shadow: none; + break-inside: avoid; } @at-root a#{&} { @@ -209,7 +210,8 @@ Stacked card .card-actions { --card-actions-gutter: #{$card-actions-gutter}; padding-inline-start: var(--card-actions-gutter); - margin: calc(-1 * var(--card-actions-gutter)) calc(-1 * var(--card-actions-gutter)) calc(-1 * var(--card-actions-gutter)) auto; + margin-block: calc(-1 * var(--card-actions-gutter)); + margin-inline: auto calc(-1 * var(--card-actions-gutter)); a { text-decoration: none; @@ -347,7 +349,8 @@ Stacked card } .card-title & { - margin: 0 0 0 var(--card-subtitle-margin-start); + margin-block: 0; + margin-inline: var(--card-subtitle-margin-start) 0; font-size: $h4-font-size; } } diff --git a/core/scss/ui/_carousel.scss b/core/scss/ui/_carousel.scss index a46e51885..39abd5480 100644 --- a/core/scss/ui/_carousel.scss +++ b/core/scss/ui/_carousel.scss @@ -6,7 +6,8 @@ inset-inline-start: auto; top: 0; flex-direction: column; - margin: 0 var(--carousel-indicators-vertical-margin-inline-end) 0 0; + margin-block: 0; + margin-inline: 0 var(--carousel-indicators-vertical-margin-inline-end); [data-bs-target], [data-target] { diff --git a/core/scss/ui/_dropdowns.scss b/core/scss/ui/_dropdowns.scss index 008daa2b5..698c24e42 100644 --- a/core/scss/ui/_dropdowns.scss +++ b/core/scss/ui/_dropdowns.scss @@ -30,7 +30,7 @@ .dropdown-item { display: flex; - gap: var(--dropdown-item-gap); + gap: var(--dropdown-item-gap, #{$dropdown-item-gap}); align-items: center; min-width: $dropdown-min-width; margin: 0; diff --git a/core/scss/ui/_lists.scss b/core/scss/ui/_lists.scss index 83df6ad95..faf6787ef 100644 --- a/core/scss/ui/_lists.scss +++ b/core/scss/ui/_lists.scss @@ -111,11 +111,6 @@ Inline list margin: 0; } -.list-inline-item:not(:last-child) { - margin-inline-end: auto; - margin-inline-end: $list-inline-padding; -} - .list-inline-dots { .list-inline-item + .list-inline-item::before { margin-inline-end: $list-inline-padding; diff --git a/core/scss/ui/_modals.scss b/core/scss/ui/_modals.scss index 78fa09283..d32bfc754 100644 --- a/core/scss/ui/_modals.scss +++ b/core/scss/ui/_modals.scss @@ -39,7 +39,8 @@ .modal-header { align-items: center; min-height: $modal-header-height; - padding: 0 $modal-header-height 0 $modal-inner-padding; + padding-block: 0; + padding-inline: $modal-inner-padding $modal-header-height; background: $modal-header-bg; } diff --git a/core/scss/ui/_nav.scss b/core/scss/ui/_nav.scss index d59659c3a..df4a74dee 100644 --- a/core/scss/ui/_nav.scss +++ b/core/scss/ui/_nav.scss @@ -6,6 +6,7 @@ --nav-vertical-nested-padding-start: #{$nav-vertical-nested-padding-start}; --nav-link-toggle-padding-x: #{$nav-link-toggle-padding-x}; --nav-link-icon-margin-end: #{$nav-link-icon-margin-end}; + font-size: var(--body-font-size); } .nav-vertical { diff --git a/core/scss/ui/_offcanvas.scss b/core/scss/ui/_offcanvas.scss index bb498c8bb..85a3ab68d 100644 --- a/core/scss/ui/_offcanvas.scss +++ b/core/scss/ui/_offcanvas.scss @@ -24,6 +24,5 @@ .offcanvas-narrow { --offcanvas-narrow-width: #{$offcanvas-narrow-width}; - - width: var(--offcanvas-narrow-width); + --offcanvas-width: var(--offcanvas-narrow-width); } diff --git a/core/scss/ui/_patterns.scss b/core/scss/ui/_patterns.scss index 68a43918c..a8c391ea3 100644 --- a/core/scss/ui/_patterns.scss +++ b/core/scss/ui/_patterns.scss @@ -1,180 +1,128 @@ @use '../config' as *; -.bg-pattern-diagonal { +@mixin pattern-base($opacity: $pattern-opacity) { --pattern-color: var(--body-color); --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - background-image: repeating-linear-gradient(-45deg, var(--pattern-fill) 0 1px, transparent 0 50%); + --pattern-opacity: calc(var(--pattern-opacity-factor, #{$pattern-opacity-factor}) * #{$opacity}); + --pattern-fill: color-mix(in oklch, var(--pattern-color) var(--pattern-opacity), transparent); background-clip: padding-box; +} + +.bg-pattern-transparent { + @include pattern-base(); + background-image: repeating-conic-gradient(var(--pattern-fill) 0% 25%, transparent 0% 50%); + background-size: calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); +} + +.bg-pattern-diagonal { + @include pattern-base(); + background-image: repeating-linear-gradient(-45deg, var(--pattern-fill) 0 1px, transparent 0 50%); background-size: var(--pattern-size) var(--pattern-size); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-diagonal-2 { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(); background-image: repeating-linear-gradient(45deg, var(--pattern-fill) 0 1px, transparent 0 50%); - background-clip: padding-box; background-size: var(--pattern-size) var(--pattern-size); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-dots { - --pattern-color: var(--body-color); - --pattern-size: 5px; - --pattern-dot: 0.5px; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 20%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - background-image: radial-gradient(circle, var(--pattern-fill) var(--pattern-dot), transparent var(--pattern-dot)), radial-gradient(circle, var(--pattern-fill) var(--pattern-dot), transparent var(--pattern-dot)); + @include pattern-base(20%); + --pattern-dot: max(1px, calc(var(--pattern-size) * 0.1)); + background-image: radial-gradient(circle, var(--pattern-fill) var(--pattern-dot), transparent calc(var(--pattern-dot) + 0.5px)), radial-gradient(circle, var(--pattern-fill) var(--pattern-dot), transparent calc(var(--pattern-dot) + 0.5px)); background-position: 0 0, - calc(var(--pattern-size) / 2) calc(var(--pattern-size) / 2); - background-clip: padding-box; - background-size: var(--pattern-size) var(--pattern-size); - border: var(--border-width) var(--border-style) var(--pattern-border); + calc(var(--pattern-size)) calc(var(--pattern-size)); + background-size: calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); } .bg-pattern-rectangles { - --pattern-color: var(--body-color); - --pattern-fill: color-mix(in oklch, var(--pattern-color) 3%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-size: #{$pattern-size}; + @include pattern-base(3%); background-image: repeating-linear-gradient(45deg, var(--pattern-fill) 25%, transparent 25%, transparent 75%, var(--pattern-fill) 75%, var(--pattern-fill)), repeating-linear-gradient(45deg, var(--pattern-fill) 25%, transparent 25%, transparent 75%, var(--pattern-fill) 75%, var(--pattern-fill)); background-position: -1px -1px, calc(var(--pattern-size) - 1px) calc(var(--pattern-size) - 1px); - background-clip: padding-box; background-size: calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-lines { - --pattern-color: var(--body-color); - --pattern-fill: color-mix(in oklch, var(--pattern-color) 6%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-size: #{$pattern-size}; + @include pattern-base(6%); background-image: repeating-linear-gradient(0deg, var(--pattern-fill), var(--pattern-fill) 1px, transparent 1px, transparent); background-position: -1px -1px; - background-clip: padding-box; background-size: var(--pattern-size) var(--pattern-size); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-lines-vertical { - --pattern-color: var(--body-color); - --pattern-fill: color-mix(in oklch, var(--pattern-color) 6%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-size: #{$pattern-size}; + @include pattern-base(6%); background-image: repeating-linear-gradient(90deg, var(--pattern-fill), var(--pattern-fill) 1px, transparent 1px, transparent); background-position: -1px -1px; - background-clip: padding-box; background-size: var(--pattern-size) var(--pattern-size); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-grid { - --pattern-color: var(--body-color); - --pattern-fill: color-mix(in oklch, var(--pattern-color) 6%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-size: #{$pattern-size}; + @include pattern-base(6%); background-image: linear-gradient(to right, var(--pattern-fill) 1px, transparent 1px), linear-gradient(to bottom, var(--pattern-fill) 1px, transparent 1px); background-position: -1px -1px, -1px -1px; - background-clip: padding-box; background-size: calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-grid-diagonal { - --pattern-color: var(--body-color); - --pattern-fill: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-size: #{$pattern-size}; + @include pattern-base(); background-image: linear-gradient(45deg, transparent 49%, var(--pattern-fill) 49%, var(--pattern-fill) 51%, transparent 51%), linear-gradient(-45deg, transparent 49%, var(--pattern-fill) 49%, var(--pattern-fill) 51%, transparent 51%); background-position: center center; - background-clip: padding-box; background-size: calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-blueprint { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-line: color-mix(in oklch, var(--pattern-color) 6%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(6%); + --pattern-line: var(--pattern-fill); background-image: linear-gradient(var(--pattern-line) 2px, transparent 2px), linear-gradient(90deg, var(--pattern-line) 2px, transparent 2px), linear-gradient(var(--pattern-line) 1px, transparent 1px), linear-gradient(90deg, var(--pattern-line) 1px, transparent 1px); background-position: -3px -3px, -3px -3px, -2px -2px, -2px -2px; - background-clip: padding-box; background-size: calc(var(--pattern-size) * 10) calc(var(--pattern-size) * 10), calc(var(--pattern-size) * 10) calc(var(--pattern-size) * 10), calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2), calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-cross-dots { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(); background-image: radial-gradient(var(--pattern-fill) 1px, transparent 1px), radial-gradient(var(--pattern-fill) 1px, transparent 1px); background-position: 0 0, var(--pattern-size) var(--pattern-size); - background-clip: padding-box; background-size: calc(var(--pattern-size) * 2) calc(var(--pattern-size) * 2); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-circles { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 10%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(); background-image: radial-gradient(circle at center top, transparent 9%, var(--pattern-fill) 10%, var(--pattern-fill) 15%, transparent 16%), radial-gradient(circle at center bottom, transparent 9%, var(--pattern-fill) 10%, var(--pattern-fill) 15%, transparent 16%), radial-gradient(circle at right center, transparent 9%, var(--pattern-fill) 10%, var(--pattern-fill) 15%, transparent 16%), radial-gradient(circle at left center, transparent 9%, var(--pattern-fill) 10%, var(--pattern-fill) 15%, transparent 16%); background-position: 0 0; background-size: calc(var(--pattern-size) * 3) calc(var(--pattern-size) * 3); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-diagonal-stripes { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 5%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(5%); background-image: repeating-linear-gradient(45deg, transparent, transparent var(--pattern-size), var(--pattern-fill) var(--pattern-size), var(--pattern-fill) calc(2 * var(--pattern-size))); background-repeat: no-repeat; - background-clip: padding-box; - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-diagonal-stripes-2 { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 5%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(5%); background-image: repeating-linear-gradient(-45deg, transparent, transparent var(--pattern-size), var(--pattern-fill) var(--pattern-size), var(--pattern-fill) calc(2 * var(--pattern-size))); background-repeat: no-repeat; - background-clip: padding-box; - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-zigzag { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 5%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(5%); background: linear-gradient(135deg, var(--pattern-fill) 25%, transparent 25%) calc(-1 * var(--pattern-size)) 0, linear-gradient(225deg, var(--pattern-fill) 25%, transparent 25%) calc(-1 * var(--pattern-size)) 0, @@ -182,28 +130,17 @@ linear-gradient(45deg, var(--pattern-fill) 25%, transparent 25%); background-clip: padding-box; background-size: calc(2 * var(--pattern-size)) calc(2 * var(--pattern-size)); - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-vertical-stripes { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 5%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(5%); background-image: repeating-linear-gradient(90deg, transparent, transparent var(--pattern-size), var(--pattern-fill) var(--pattern-size), var(--pattern-fill) calc(2 * var(--pattern-size))); - background-clip: padding-box; - border: var(--border-width) var(--border-style) var(--pattern-border); } .bg-pattern-horizontal-stripes { - --pattern-color: var(--body-color); - --pattern-size: #{$pattern-size}; - --pattern-fill: color-mix(in oklch, var(--pattern-color) 5%, transparent); - --pattern-border: color-mix(in oklch, var(--pattern-color) 10%, transparent); + @include pattern-base(5%); background-image: repeating-linear-gradient(0deg, transparent, transparent var(--pattern-size), var(--pattern-fill) var(--pattern-size), var(--pattern-fill) calc(2 * var(--pattern-size))); background-position: -1px -1px; - background-clip: padding-box; - border: var(--border-width) var(--border-style) var(--pattern-border); } // Color variants @@ -226,3 +163,9 @@ $sizes: ( --pattern-size: #{$value}; } } + +@each $key, $value in $pattern-opacities { + .bg-pattern-opacity-#{$key} { + --pattern-opacity: #{$value}; + } +} diff --git a/core/scss/ui/_progress.scss b/core/scss/ui/_progress.scss index 5fd1e8e12..d76670016 100644 --- a/core/scss/ui/_progress.scss +++ b/core/scss/ui/_progress.scss @@ -69,7 +69,7 @@ Progress bar bottom: 0; content: ''; background-color: inherit; - will-change: left, right; + will-change: inset-inline-start, inset-inline-end; } &::before { diff --git a/core/scss/ui/_ribbons.scss b/core/scss/ui/_ribbons.scss index caf1b97a5..b84881fdb 100644 --- a/core/scss/ui/_ribbons.scss +++ b/core/scss/ui/_ribbons.scss @@ -136,7 +136,7 @@ border-inline-end-width: 0; } - &.ribbon-left { + &.ribbon-start { padding-inline-end: var(--ribbon-bookmark-notch-width); &::after { diff --git a/core/scss/ui/_tables.scss b/core/scss/ui/_tables.scss index 5881684a6..0716693bf 100644 --- a/core/scss/ui/_tables.scss +++ b/core/scss/ui/_tables.scss @@ -3,6 +3,16 @@ .table { font: inherit; + @include media-print() { + thead { + display: table-header-group; + } + + tr { + break-inside: avoid; + } + } + thead { th { padding-top: $table-th-padding-y; diff --git a/core/scss/ui/_tags.scss b/core/scss/ui/_tags.scss index 1f8a7fd91..10bd09306 100644 --- a/core/scss/ui/_tags.scss +++ b/core/scss/ui/_tags.scss @@ -66,8 +66,10 @@ } // -// Tags list +// Tag list // +.tag-list, .tags-list { + // `.tags-list` is deprecated, use `.tag-list` instead @include elements-list(); } diff --git a/core/scss/ui/_type.scss b/core/scss/ui/_type.scss index 4ba9d86e8..4a13dc90a 100644 --- a/core/scss/ui/_type.scss +++ b/core/scss/ui/_type.scss @@ -9,10 +9,10 @@ a { text-decoration-skip-ink: auto; - color: color-mix(in sRGB, transparent, var(--link-color) var(--link-opacity, 100%)); + color: color-mix(in sRGB, transparent, var(--link-color) calc(var(--link-opacity, 1) * 100%)); &:hover { - color: color-mix(in sRGB, transparent, var(--link-hover-color) var(--link-opacity, 100%)); + color: color-mix(in sRGB, transparent, var(--link-hover-color) calc(var(--link-opacity, 1) * 100%)); } } @@ -91,6 +91,10 @@ blockquote { p { margin-bottom: var(--blockquote-paragraph-margin-bottom); + + &:last-child { + margin-bottom: 0; + } } cite { diff --git a/core/scss/ui/forms/_form-imagecheck.scss b/core/scss/ui/forms/_form-imagecheck.scss index 5b3066aeb..3d5ec4d51 100644 --- a/core/scss/ui/forms/_form-imagecheck.scss +++ b/core/scss/ui/forms/_form-imagecheck.scss @@ -92,6 +92,10 @@ Image check .form-imagecheck-input:checked ~ .form-imagecheck-figure & { opacity: 1; } + + .avatar { + border-radius: inherit; + } } .form-imagecheck-caption { diff --git a/core/scss/ui/forms/_validation.scss b/core/scss/ui/forms/_validation.scss index cd687973b..d29c93fdd 100644 --- a/core/scss/ui/forms/_validation.scss +++ b/core/scss/ui/forms/_validation.scss @@ -4,6 +4,44 @@ border-color: var(--border-color) !important; } +// Bootstrap sizes the valid/invalid icon off the input's own line-height and +// padding, which makes it noticeably bigger than every other icon in the +// design system. Match it to $input-btn-icon-size instead, the same token +// `.btn`/`.btn-sm`/`.btn-lg` use for their own icons (see ui/_buttons.scss). +%validation-icon-size { + --form-feedback-icon-size: #{$input-btn-icon-size}; + --form-feedback-icon-inset: #{$input-padding-x}; + padding-inline-end: calc(var(--form-feedback-icon-size) + var(--form-feedback-icon-inset) * 2) !important; + background-position: right var(--form-feedback-icon-inset) center !important; + background-size: var(--form-feedback-icon-size) var(--form-feedback-icon-size) !important; +} + +%validation-icon-size-sm { + --form-feedback-icon-size: #{$input-btn-icon-size-sm}; + --form-feedback-icon-inset: #{$input-padding-x-sm}; +} + +%validation-icon-size-lg { + --form-feedback-icon-size: #{$input-btn-icon-size-lg}; + --form-feedback-icon-inset: #{$input-padding-x-lg}; +} + +%validation-icon-size-textarea { + background-position: top var(--form-feedback-icon-inset) right var(--form-feedback-icon-inset) !important; +} + +// `.form-select` layers a second background (the feedback icon) behind its +// own caret, so it needs its own override alongside %validation-icon-size — +// same oversized-icon bug, but the caret's background-size must stay first. +// Tom Select copies the select's classes onto its `.ts-wrapper`, which is +// what actually paints these backgrounds, so this rule reaches that too. +%validation-icon-size-select { + --form-feedback-icon-size: #{$input-btn-icon-size}; + background-size: + #{$form-select-bg-size}, + var(--form-feedback-icon-size) var(--form-feedback-icon-size) !important; +} + @each $state, $data in $form-validation-states { .form-control.is-#{$state}-lite { @extend %validation-lite; @@ -12,4 +50,24 @@ .form-select.is-#{$state}-lite { @extend %validation-lite; } + + .form-control.is-#{$state} { + @extend %validation-icon-size; + } + + .form-select.is-#{$state} { + @extend %validation-icon-size-select; + } + + .form-control-sm.is-#{$state} { + @extend %validation-icon-size-sm; + } + + .form-control-lg.is-#{$state} { + @extend %validation-icon-size-lg; + } + + textarea.form-control.is-#{$state} { + @extend %validation-icon-size-textarea; + } } diff --git a/core/scss/vendor/_nouislider.scss b/core/scss/vendor/_nouislider.scss index 1fbb7a776..cc2531598 100644 --- a/core/scss/vendor/_nouislider.scss +++ b/core/scss/vendor/_nouislider.scss @@ -37,7 +37,8 @@ top: calc($form-range-thumb-height * -0.5); width: $form-range-thumb-width; height: $form-range-thumb-height; - margin: 1px 1px 0 0; + margin-block: 1px 0; + margin-inline: 0 1px; } &.noUi-active, diff --git a/core/scss/vendor/_stars-rating.scss b/core/scss/vendor/_stars-rating.scss index 0376ecc4f..1a1663916 100644 --- a/core/scss/vendor/_stars-rating.scss +++ b/core/scss/vendor/_stars-rating.scss @@ -8,8 +8,8 @@ [data-star-rating] { svg { - width: var(--icon-size, --gl-star-size); - height: var(--icon-size, --gl-star-size); + width: var(--icon-size, var(--gl-star-size)); + height: var(--icon-size, var(--gl-star-size)); } :not(.gl-active) > .gl-star-full { diff --git a/core/scss/vendor/_tom-select.scss b/core/scss/vendor/_tom-select.scss index 28f968948..e91372951 100644 --- a/core/scss/vendor/_tom-select.scss +++ b/core/scss/vendor/_tom-select.scss @@ -38,31 +38,53 @@ $input-border-width: 1px; --ts-pr-clear-button: 1.5rem; } } + + // Tom Select's Bootstrap 5 stylesheet hardcodes Bootstrap's own caret and + // valid/invalid icons on `.ts-wrapper.is-valid` / `.is-invalid`, and those + // selectors outrank `.form-select`. Hand the backgrounds back to the + // `.form-select` custom properties so a validated select shows the same + // icons as a validated `.form-control`. `:not(.single)` matches the + // specificity of the vendor rule for multi selects. + &.form-select.is-invalid, + &.form-select.is-valid { + &, + &:not(.single) { + background-image: var(--form-select-bg-img), var(--form-select-bg-icon, none); + } + } } +// Every declaration below is `!important`: the bootstrap5 preset CSS targets +// these same selectors at equal specificity, and whichever stylesheet is +// included last otherwise wins outright (not just for z-index — the preset's +// `--bs-*` vars are undefined outside Bootstrap, so once it wins a property it +// renders as transparent/unstyled rather than merely off-theme) (#2600). .ts-dropdown { - z-index: $zindex-dropdown; - color: var(--body-color); - background: var(--bg-surface); - box-shadow: var(--shadow-dropdown); + // Tabler inits Tom Select with dropdownParent: 'body', so the dropdown is a + // direct child of rather than of whatever contains the "; - } - }, - { - key: "paragraph", - value: function(e) { - var t = e.tokens; - return "

".concat(this.parser.parseInline(t), "

\n"); - } - }, - { - key: "table", - value: function(e) { - for (var t = "", n = "", r = 0; r < e.header.length; r++) n += this.tablecell(e.header[r]); - t += this.tablerow({ text: n }); - for (var u = "", a = 0; a < e.rows.length; a++) { - var i = e.rows[a]; - n = ""; - for (var o = 0; o < i.length; o++) n += this.tablecell(i[o]); - u += this.tablerow({ text: n }); - } - return u && (u = "".concat(u, "")), "\n\n" + t + "\n" + u + "
\n"; - } - }, - { - key: "tablerow", - value: function(e) { - var t = e.text; - return "\n".concat(t, "\n"); - } - }, - { - key: "tablecell", - value: function(e) { - var t = this.parser.parseInline(e.tokens), n = e.header ? "th" : "td"; - return (e.align ? "<".concat(n, " align=\"").concat(e.align, "\">") : "<".concat(n, ">")) + t + "\n"); - } - }, - { - key: "strong", - value: function(e) { - var t = e.tokens; - return "".concat(this.parser.parseInline(t), ""); - } - }, - { - key: "em", - value: function(e) { - var t = e.tokens; - return "".concat(this.parser.parseInline(t), ""); - } - }, - { - key: "codespan", - value: function(e) { - var t = e.text; - return "".concat(Ri(t, !0), ""); - } - }, - { - key: "br", - value: function(e) { - return "
"; - } - }, - { - key: "del", - value: function(e) { - var t = e.tokens; - return "".concat(this.parser.parseInline(t), ""); - } - }, - { - key: "link", - value: function(e) { - var t = e.href, n = e.title, r = e.tokens, u = this.parser.parseInline(r), a = Mi(t); - if (null === a) return u; - var i = "" + u + ""; - } - }, - { - key: "image", - value: function(e) { - var t = e.href, n = e.title, r = e.text, u = e.tokens; - u && (r = this.parser.parseInline(u, this.parser.textRenderer)); - var a = Mi(t); - if (null === a) return Ri(r); - var i = "\"").concat(r,"; - } - }, - { - key: "text", - value: function(e) { - return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : Ri(e.text); - } - } -]), Vi = un(function e() { - tn(this, e); -}, [ - { - key: "strong", - value: function(e) { - return e.text; - } - }, - { - key: "em", - value: function(e) { - return e.text; - } - }, - { - key: "codespan", - value: function(e) { - return e.text; - } - }, - { - key: "del", - value: function(e) { - return e.text; - } - }, - { - key: "html", - value: function(e) { - return e.text; - } - }, - { - key: "text", - value: function(e) { - return e.text; - } - }, - { - key: "link", - value: function(e) { - return "" + e.text; - } - }, - { - key: "image", - value: function(e) { - return "" + e.text; - } - }, - { - key: "br", - value: function() { - return ""; - } - } -]), Wi = function() { - function e(t) { - tn(this, e), on(this, "options", void 0), on(this, "renderer", void 0), on(this, "textRenderer", void 0), this.options = t || Ra, this.options.renderer = this.options.renderer || new Hi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Vi(); - } - return un(e, [{ - key: "parse", - value: function(e) { - for (var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1], n = "", r = 0; r < e.length; r++) { - var u, a = e[r]; - if (null !== (u = this.options.extensions) && void 0 !== u && null !== (u = u.renderers) && void 0 !== u && u[a.type]) { - var i = a, o = this.options.extensions.renderers[i.type].call({ parser: this }, i); - if (!1 !== o || ![ - "space", - "hr", - "heading", - "code", - "table", - "blockquote", - "list", - "html", - "def", - "paragraph", - "text" - ].includes(i.type)) { - n += o || ""; - continue; - } - } - var s = a; - switch (s.type) { - case "space": - n += this.renderer.space(s); - continue; - case "hr": - n += this.renderer.hr(s); - continue; - case "heading": - n += this.renderer.heading(s); - continue; - case "code": - n += this.renderer.code(s); - continue; - case "table": - n += this.renderer.table(s); - continue; - case "blockquote": - n += this.renderer.blockquote(s); - continue; - case "list": - n += this.renderer.list(s); - continue; - case "html": - n += this.renderer.html(s); - continue; - case "def": - n += this.renderer.def(s); - continue; - case "paragraph": - n += this.renderer.paragraph(s); - continue; - case "text": - for (var c = s, l = this.renderer.text(c); r + 1 < e.length && "text" === e[r + 1].type;) c = e[++r], l += "\n" + this.renderer.text(c); - n += t ? this.renderer.paragraph({ - type: "paragraph", - raw: l, - text: l, - tokens: [{ - type: "text", - raw: l, - text: l, - escaped: !0 - }] - }) : l; - continue; - default: - var f = "Token with \"" + s.type + "\" type was not found."; - if (this.options.silent) return console.error(f), ""; - throw new Error(f); - } - } - return n; - } - }, { - key: "parseInline", - value: function(e) { - for (var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this.renderer, n = "", r = 0; r < e.length; r++) { - var u, a = e[r]; - if (null !== (u = this.options.extensions) && void 0 !== u && null !== (u = u.renderers) && void 0 !== u && u[a.type]) { - var i = this.options.extensions.renderers[a.type].call({ parser: this }, a); - if (!1 !== i || ![ - "escape", - "html", - "link", - "image", - "strong", - "em", - "codespan", - "br", - "del", - "text" - ].includes(a.type)) { - n += i || ""; - continue; - } - } - var o = a; - switch (o.type) { - case "escape": - case "text": - n += t.text(o); - break; - case "html": - n += t.html(o); - break; - case "link": - n += t.link(o); - break; - case "image": - n += t.image(o); - break; - case "strong": - n += t.strong(o); - break; - case "em": - n += t.em(o); - break; - case "codespan": - n += t.codespan(o); - break; - case "br": - n += t.br(o); - break; - case "del": - n += t.del(o); - break; - default: - var s = "Token with \"" + o.type + "\" type was not found."; - if (this.options.silent) return console.error(s), ""; - throw new Error(s); - } - } - return n; - } - }], [{ - key: "parse", - value: function(t, n) { - return new e(n).parse(t); - } - }, { - key: "parseInline", - value: function(t, n) { - return new e(n).parseInline(t); - } - }]); -}(), Ki = (ja = un(function e(t) { - tn(this, e), on(this, "options", void 0), on(this, "block", void 0), this.options = t || Ra; -}, [ - { - key: "preprocess", - value: function(e) { - return e; - } - }, - { - key: "postprocess", - value: function(e) { - return e; - } - }, - { - key: "processAllTokens", - value: function(e) { - return e; - } - }, - { - key: "emStrongMask", - value: function(e) { - return e; - } - }, - { - key: "provideLexer", - value: function() { - return this.block ? Ui.lex : Ui.lexInline; - } - }, - { - key: "provideParser", - value: function() { - return this.block ? Wi.parse : Wi.parseInline; - } - } -]), on(ja, "passThroughHooks", /* @__PURE__ */ new Set([ - "preprocess", - "postprocess", - "processAllTokens", - "emStrongMask" -])), on(ja, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set([ - "preprocess", - "postprocess", - "processAllTokens" -])), ja), Qi = new (un(function e() { - tn(this, e), on(this, "defaults", { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }), on(this, "options", this.setOptions), on(this, "parse", this.parseMarkdown(!0)), on(this, "parseInline", this.parseMarkdown(!1)), on(this, "Parser", Wi), on(this, "Renderer", Hi), on(this, "TextRenderer", Vi), on(this, "Lexer", Ui), on(this, "Tokenizer", qi), on(this, "Hooks", Ki), this.use.apply(this, arguments); -}, [ - { - key: "walkTokens", - value: function(e, t) { - var n, r = this, u = [], a = an(e); - try { - var i = function() { - var e = n.value; - switch (u = u.concat(t.call(r, e)), e.type) { - case "table": - var a, i = e, o = an(i.header); - try { - for (o.s(); !(a = o.n()).done;) { - var s = a.value; - u = u.concat(r.walkTokens(s.tokens, t)); - } - } catch (e) { - o.e(e); - } finally { - o.f(); - } - var c, l = an(i.rows); - try { - for (l.s(); !(c = l.n()).done;) { - var f, d = an(c.value); - try { - for (d.s(); !(f = d.n()).done;) { - var p = f.value; - u = u.concat(r.walkTokens(p.tokens, t)); - } - } catch (e) { - d.e(e); - } finally { - d.f(); - } - } - } catch (e) { - l.e(e); - } finally { - l.f(); - } - break; - case "list": - var h = e; - u = u.concat(r.walkTokens(h.items, t)); - break; - default: - var v, m = e; - null !== (v = r.defaults.extensions) && void 0 !== v && null !== (v = v.childTokens) && void 0 !== v && v[m.type] ? r.defaults.extensions.childTokens[m.type].forEach(function(e) { - var n = m[e].flat(Infinity); - u = u.concat(r.walkTokens(n, t)); - }) : m.tokens && (u = u.concat(r.walkTokens(m.tokens, t))); - } - }; - for (a.s(); !(n = a.n()).done;) i(); - } catch (e) { - a.e(e); - } finally { - a.f(); - } - return u; - } - }, - { - key: "use", - value: function() { - for (var e = this, t = this.defaults.extensions || { - renderers: {}, - childTokens: {} - }, n = arguments.length, r = new Array(n), u = 0; u < n; u++) r[u] = arguments[u]; - return r.forEach(function(n) { - var r = pn({}, n); - if (r.async = e.defaults.async || r.async || !1, n.extensions && (n.extensions.forEach(function(e) { - if (!e.name) throw new Error("extension name required"); - if ("renderer" in e) { - var n = t.renderers[e.name]; - t.renderers[e.name] = n ? function() { - for (var t = arguments.length, r = new Array(t), u = 0; u < t; u++) r[u] = arguments[u]; - var a = e.renderer.apply(this, r); - return !1 === a && (a = n.apply(this, r)), a; - } : e.renderer; - } - if ("tokenizer" in e) { - if (!e.level || "block" !== e.level && "inline" !== e.level) throw new Error("extension level must be 'block' or 'inline'"); - var r = t[e.level]; - r ? r.unshift(e.tokenizer) : t[e.level] = [e.tokenizer], e.start && ("block" === e.level ? t.startBlock ? t.startBlock.push(e.start) : t.startBlock = [e.start] : "inline" === e.level && (t.startInline ? t.startInline.push(e.start) : t.startInline = [e.start])); - } - "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens); - }), r.extensions = t), n.renderer) { - var u = e.defaults.renderer || new Hi(e.defaults), a = function() { - if (!(i in u)) throw new Error("renderer '".concat(i, "' does not exist")); - if (["options", "parser"].includes(i)) return 1; - var e = i, t = n.renderer[e], r = u[e]; - u[e] = function() { - for (var e = arguments.length, n = new Array(e), a = 0; a < e; a++) n[a] = arguments[a]; - var i = t.apply(u, n); - return !1 === i && (i = r.apply(u, n)), i || ""; - }; - }; - for (var i in n.renderer) a(); - r.renderer = u; - } - if (n.tokenizer) { - var o = e.defaults.tokenizer || new qi(e.defaults), s = function() { - if (!(c in o)) throw new Error("tokenizer '".concat(c, "' does not exist")); - if ([ - "options", - "rules", - "lexer" - ].includes(c)) return 1; - var e = c, t = n.tokenizer[e], r = o[e]; - o[e] = function() { - for (var e = arguments.length, n = new Array(e), u = 0; u < e; u++) n[u] = arguments[u]; - var a = t.apply(o, n); - return !1 === a && (a = r.apply(o, n)), a; - }; - }; - for (var c in n.tokenizer) s(); - r.tokenizer = o; - } - if (n.hooks) { - var l = e.defaults.hooks || new Ki(), f = function(t) { - if (!(t in l)) throw new Error("hook '".concat(t, "' does not exist")); - if (["options", "block"].includes(t)) return 1; - var r = t, u = n.hooks[r], a = l[r]; - Ki.passThroughHooks.has(t) ? l[r] = function(n) { - if (e.defaults.async && Ki.passThroughHooksRespectAsync.has(t)) return Xt(vn().m(function e() { - var t; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, u.call(l, n); - case 1: return t = e.v, e.a(2, a.call(l, t)); - } - }, e); - }))(); - var r = u.call(l, n); - return a.call(l, r); - } : l[r] = function() { - for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; - if (e.defaults.async) return Xt(vn().m(function e() { - var t; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, u.apply(l, n); - case 1: - if (!1 !== (t = e.v)) { - e.n = 3; - break; - } - return e.n = 2, a.apply(l, n); - case 2: t = e.v; - case 3: return e.a(2, t); - } - }, e); - }))(); - var i = u.apply(l, n); - return !1 === i && (i = a.apply(l, n)), i; - }; - }; - for (var d in n.hooks) f(d); - r.hooks = l; - } - if (n.walkTokens) { - var p = e.defaults.walkTokens, h = n.walkTokens; - r.walkTokens = function(e) { - var t = []; - return t.push(h.call(this, e)), p && (t = t.concat(p.call(this, e))), t; - }; - } - e.defaults = pn(pn({}, e.defaults), r); - }), this; - } - }, - { - key: "setOptions", - value: function(e) { - return this.defaults = pn(pn({}, this.defaults), e), this; - } - }, - { - key: "lexer", - value: function(e, t) { - return Ui.lex(e, null != t ? t : this.defaults); - } - }, - { - key: "parser", - value: function(e, t) { - return Wi.parse(e, null != t ? t : this.defaults); - } - }, - { - key: "parseMarkdown", - value: function(e) { - var t = this; - return function(n, r) { - var u = pn({}, r), a = pn(pn({}, t.defaults), u), i = t.onError(!!a.silent, !!a.async); - if (!0 === t.defaults.async && !1 === u.async) return i(/* @__PURE__ */ new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.")); - if (En(n) > "u" || null === n) return i(/* @__PURE__ */ new Error("marked(): input parameter is undefined or null")); - if ("string" != typeof n) return i(/* @__PURE__ */ new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected")); - if (a.hooks && (a.hooks.options = a, a.hooks.block = e), a.async) return Xt(vn().m(function r() { - var u, i, o, s, c, l, f, d, p, h, v; - return vn().w(function(r) { - for (;;) switch (r.n) { - case 0: - if (!a.hooks) { - r.n = 2; - break; - } - return r.n = 1, a.hooks.preprocess(n); - case 1: - c = r.v, r.n = 3; - break; - case 2: c = n; - case 3: - if (u = c, !a.hooks) { - r.n = 5; - break; - } - return r.n = 4, a.hooks.provideLexer(); - case 4: - l = r.v, r.n = 6; - break; - case 5: l = e ? Ui.lex : Ui.lexInline; - case 6: return f = l, r.n = 7, f(u, a); - case 7: - if (i = r.v, !a.hooks) { - r.n = 9; - break; - } - return r.n = 8, a.hooks.processAllTokens(i); - case 8: - d = r.v, r.n = 10; - break; - case 9: d = i; - case 10: - if (o = d, !a.walkTokens) { - r.n = 11; - break; - } - return r.n = 11, Promise.all(t.walkTokens(o, a.walkTokens)); - case 11: - if (!a.hooks) { - r.n = 13; - break; - } - return r.n = 12, a.hooks.provideParser(); - case 12: - p = r.v, r.n = 14; - break; - case 13: p = e ? Wi.parse : Wi.parseInline; - case 14: return h = p, r.n = 15, h(o, a); - case 15: - if (s = r.v, !a.hooks) { - r.n = 17; - break; - } - return r.n = 16, a.hooks.postprocess(s); - case 16: - v = r.v, r.n = 18; - break; - case 17: v = s; - case 18: return r.a(2, v); - } - }, r); - }))().catch(i); - try { - a.hooks && (n = a.hooks.preprocess(n)); - var o = (a.hooks ? a.hooks.provideLexer() : e ? Ui.lex : Ui.lexInline)(n, a); - a.hooks && (o = a.hooks.processAllTokens(o)), a.walkTokens && t.walkTokens(o, a.walkTokens); - var s = (a.hooks ? a.hooks.provideParser() : e ? Wi.parse : Wi.parseInline)(o, a); - return a.hooks && (s = a.hooks.postprocess(s)), s; - } catch (e) { - return i(e); - } - }; - } - }, - { - key: "onError", - value: function(e, t) { - return function(n) { - if (n.message += "\nPlease report this to https://github.com/markedjs/marked.", e) { - var r = "

An error occurred:

" + Ri(n.message + "", !0) + "
"; - return t ? Promise.resolve(r) : r; - } - if (t) return Promise.reject(n); - throw n; - }; - } - } -]))(); -function Gi(e, t) { - return Qi.parse(e, t); -} -function Yi(e) { - return e.replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'"); -} -Gi.options = Gi.setOptions = function(e) { - return Qi.setOptions(e), Gi.defaults = Qi.defaults, Ma(Gi.defaults), Gi; -}, Gi.getDefaults = function() { - return { - async: !1, - breaks: !1, - extensions: null, - gfm: !0, - hooks: null, - pedantic: !1, - renderer: null, - silent: !1, - tokenizer: null, - walkTokens: null - }; -}, Gi.defaults = Ra, Gi.use = function() { - return Qi.use.apply(Qi, arguments), Gi.defaults = Qi.defaults, Ma(Gi.defaults), Gi; -}, Gi.walkTokens = function(e, t) { - return Qi.walkTokens(e, t); -}, Gi.parseInline = Qi.parseInline, Gi.Parser = Wi, Gi.parser = Wi.parse, Gi.Renderer = Hi, Gi.TextRenderer = Vi, Gi.Lexer = Ui, Gi.lexer = Ui.lex, Gi.Tokenizer = qi, Gi.Hooks = Ki, Gi.parse = Gi, Gi.options, Gi.setOptions, Gi.use, Gi.walkTokens, Gi.parseInline, Wi.parse, Ui.lex; -var Xi = new Gi.Renderer(); -Xi.code = function(e) { - var t = e.text, n = e.lang, r = void 0 === n ? "" : n, u = e.escaped, a = r ? "language-".concat(r) : "", i = u ? t : Yi(t), o = encodeURIComponent(t); - return "\n
\n \n
").concat(i, "
\n
\n "); -}, Xi.link = function(e) { - var t = e.href, n = e.title, r = e.text, u = n ? " title=\"".concat(Yi(n), "\"") : "", a = t ? Yi(t) : "", i = Yi(r); - return "").concat(i, ""); -}; -var eo = nt(function(e) { - var t = e.content, n = e.copyButtonText, r = e.copyButtonCopiedText, u = e.isStreaming, a = Pe(function() { - return Gi.parse(t, { - gfm: !0, - breaks: !0, - renderer: Xi - }); - }, [t]), i = Ie(null); - return Oe(function() { - var e = i.current; - if (e) return Array.from(e.querySelectorAll(".DocSearch-CodeSnippet-CopyButton")).forEach(function(e) { - var t = e.querySelector(".DocSearch-CodeSnippet-CopyButton-Label"); - t && (t.textContent = n), e.classList.remove("DocSearch-CodeSnippet-CopyButton--copied"); - }), e.addEventListener("click", t), function() { - e.removeEventListener("click", t); - }; - function t(e) { - var t, u = e.target.closest(".DocSearch-CodeSnippet-CopyButton"); - if (u) { - var a = null !== (t = u.getAttribute("data-code")) && void 0 !== t ? t : ""; - navigator.clipboard.writeText(decodeURIComponent(a)).catch(function() {}); - var i = u.querySelector(".DocSearch-CodeSnippet-CopyButton-Label"); - if (i) { - u.classList.add("DocSearch-CodeSnippet-CopyButton--copied"); - var o = n; - i.textContent = r, setTimeout(function() { - u.classList.remove("DocSearch-CodeSnippet-CopyButton--copied"), i.textContent = o; - }, 1500); - } - } - } - }, [ - a, - n, - r - ]), It.createElement("div", { - ref: i, - className: "DocSearch-Markdown-Content ".concat(u ? "DocSearch-Markdown-Content--streaming" : ""), - dangerouslySetInnerHTML: { __html: a } - }); -}); -function to(e) { - var t = e.part, n = e.translations, r = e.onSearchQueryClick, u = n.searchingText, a = n.preToolCallText, i = n.toolCallResultText; - switch (t.state) { - case "input-streaming": return It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent-Tool Tool--PartialCall shimmer" }, It.createElement(ya, { className: "DocSearch-AskAiScreen-SmallerLoadingIcon" }), It.createElement("span", null, u)); - case "input-available": return It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent-Tool Tool--Call shimmer" }, It.createElement(ya, { className: "DocSearch-AskAiScreen-SmallerLoadingIcon" }), It.createElement("span", null, a, " ", "\"".concat(t.input.query || "", "\" ..."))); - case "output-available": - var o, s, c = "tool-searchIndex" === t.type ? t.output.query : t.input.query, l = null !== (o = null === (s = t.output.hits) || void 0 === s ? void 0 : s.length) && void 0 !== o ? o : 0; - return It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent-Tool Tool--Result" }, It.createElement($n, null), It.createElement("span", null, i, " ", r ? It.createElement("span", { - role: "button", - tabIndex: 0, - className: "DocSearch-AskAiScreen-MessageContent-Tool-Query", - onKeyDown: function(e) { - "Enter" !== e.key && " " !== e.key || (e.preventDefault(), r(c || "")); - }, - onClick: function() { - return r(c || ""); - } - }, " ", "\"", c || "", "\"") : It.createElement("span", { className: "DocSearch-AskAiScreen-MessageContent-Tool-Query" }, " \"", c || "", "\""), " ", "found ", l, " results")); - default: return null; - } -} -eo.displayName = "MemoizedMarkdown"; -var no = ["translations"]; -function ro(e) { - var t = e.disclaimerText; - return It.createElement("p", { className: "DocSearch-AskAiScreen-Disclaimer" }, t); -} -function uo(e) { - var t, n, r, u = e.exchange, a = e.askAiError, i = e.isLastExchange, o = e.loadingStatus, s = e.onSearchQueryClick, c = e.translations, l = e.conversations, f = e.onFeedback, d = e.agentStudio, p = u.userMessage, h = u.assistantMessage, v = c.stoppedStreamingText, m = void 0 === v ? "You stopped this response" : v, D = c.errorTitleText, y = void 0 === D ? "Chat error" : D, g = c.preToolCallText, F = void 0 === g ? "Searching..." : g, E = c.afterToolCallText, b = void 0 === E ? "Searched for" : E, _ = c.duringToolCallText, k = void 0 === _ ? "Searching..." : _, C = Nn(a, Boolean(d)), A = Pe(function() { - return Tn(h); - }, [h]), w = Pe(function() { - return Tn(p); - }, [p]), S = It.useMemo(function() { - return e = h, t = [], n = /* @__PURE__ */ new Set(), e ? (e.parts.forEach(function(e) { - if ("text" === e.type && 0 !== e.text.length) { - var r, u = e.text.replace(/```[\s\S]*?```/g, "").replace(/`[^`]*`/g, ""), a = an(u.matchAll(/\[([^\]]*)\]\(([^)]+)\)/g)); - try { - for (a.s(); !(r = a.n()).done;) { - var i = r.value, o = i[1].trim(), s = i[2]; - n.has(s) || (n.add(s), t.push({ - url: s, - title: o || void 0 - })); - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - var c, l = an(u.matchAll(/* @__PURE__ */ new RegExp("(?\"{}|\\\\^`[\\]]+", "g"))); - try { - for (l.s(); !(c = l.n()).done;) { - var f = c.value[0].replace(/[.,;:!?]+$/, ""); - n.has(f) || (n.add(f), t.push({ url: f })); - } - } catch (e) { - l.e(e); - } finally { - l.f(); - } - } - }), t) : []; - var e, t, n; - }, [h]), x = It.useMemo(function() { - return function(e) { - for (var t = [], n = 0; n < e.length; n++) { - var r = e[n]; - if ("tool-searchIndex" === r.type && "output-available" === r.state) { - for (var u = [], a = n; a < e.length;) { - var i = e[a]; - if ("tool-searchIndex" !== i.type || "output-available" !== i.state) break; - var o, s, c = (null !== (o = null === (s = i.output) || void 0 === s ? void 0 : s.query) && void 0 !== o ? o : "").trim(); - c && c.length > 0 && u.push(c), a++; - } - u.length > 1 ? t.push({ - type: "aggregated-tool-call", - queries: u - }) : 1 === u.length && t.push(r), n = a - 1; - } else t.push(r); - } - return t; - }((null == h ? void 0 : h.parts) || []); - }, [h]), O = (null === (t = p.metadata) || void 0 === t ? void 0 : t.stopped) || (null == h || null === (n = h.metadata) || void 0 === n ? void 0 : n.stopped), B = !O && (!i || i && "ready" === o && Boolean(h)), I = ["submitted", "streaming"].includes(o) && i && !x.some(function(e) { - return "step-start" !== e.type; - }), T = d ? (null == h ? void 0 : h.id) || u.id : (null == p ? void 0 : p.id) || u.id; - return It.createElement("div", { className: "DocSearch-AskAiScreen-Response-Container" }, It.createElement("div", { className: "DocSearch-AskAiScreen-Response" }, It.createElement("div", { className: "DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--user" }, It.createElement("p", { className: "DocSearch-AskAiScreen-Query" }, null !== (r = null == w ? void 0 : w.text) && void 0 !== r ? r : "")), It.createElement("div", { className: "DocSearch-AskAiScreen-Message DocSearch-AskAiScreen-Message--assistant" }, It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent" }, "error" === o && a && i && !C && It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error" }, It.createElement(ba, null), It.createElement("div", { className: "DocSearch-AskAiScreen-Error-Content" }, It.createElement("h4", { className: "DocSearch-AskAiScreen-Error-Title" }, y), It.createElement(eo, { - content: a.message, - copyButtonText: "", - copyButtonCopiedText: "", - isStreaming: !1 - }))), I && It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent-Reasoning" }, It.createElement("span", { className: "shimmer" }, c.thinkingText || "Thinking...")), x.map(function(e, t) { - var n = t; - return "string" == typeof e ? It.createElement(eo, { - key: n, - content: e, - copyButtonText: c.copyButtonText || "Copy", - copyButtonCopiedText: c.copyButtonCopiedText || "Copied!", - isStreaming: "streaming" === o - }) : "aggregated-tool-call" === e.type ? It.createElement(za, { - key: n, - queries: e.queries, - translations: c, - onSearchQueryClick: s - }) : "reasoning" === e.type && "streaming" === e.state ? It.createElement("div", { - key: n, - className: "DocSearch-AskAiScreen-MessageContent-Reasoning shimmer" - }, It.createElement(ya, { className: "DocSearch-AskAiScreen-SmallerLoadingIcon" }), It.createElement("span", { className: "shimmer" }, "Reasoning...")) : "text" === e.type ? It.createElement(eo, { - key: n, - content: e.text, - copyButtonText: c.copyButtonText || "Copy", - copyButtonCopiedText: c.copyButtonCopiedText || "Copied!", - isStreaming: "streaming" === e.state - }) : "tool-searchIndex" === e.type || "tool-algolia_search_index" === e.type ? It.createElement(to, { - key: n, - translations: { - preToolCallText: F, - searchingText: k, - toolCallResultText: b - }, - part: e, - onSearchQueryClick: s - }) : null; - })), O && It.createElement("p", { className: "DocSearck-AskAiScreen-MessageContent-Stopped" }, m)), It.createElement("div", { className: "DocSearch-AskAiScreen-Answer-Footer" }, It.createElement(ao, { - id: T, - showActions: B, - latestAssistantMessageContent: (null == A ? void 0 : A.text) || null, - translations: c, - conversations: l, - onFeedback: f - }))), S.length > 0 ? It.createElement(io, { - urlsToDisplay: S, - relatedSourcesText: c.relatedSourcesText - }) : null); -} -function ao(e) { - var t = e.id, n = e.showActions, r = e.latestAssistantMessageContent, u = e.translations, a = e.conversations, i = e.onFeedback, o = It.useMemo(function() { - var e, n, r = null === (e = a.getOne) || void 0 === e ? void 0 : e.call(a, t); - return null !== (n = null == r ? void 0 : r.feedback) && void 0 !== n ? n : null; - }, [a, t]), s = yn(It.useState(o), 2), c = s[0], l = s[1], f = yn(It.useState(!1), 2), d = f[0], p = f[1], h = yn(It.useState(null), 2), v = h[0], m = h[1], D = function() { - var e = Xt(vn().m(function e(n) { - var r; - return vn().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: - if (!d) { - e.n = 1; - break; - } - return e.a(2); - case 1: return m(null), p(!0), e.p = 2, e.n = 3, null == i ? void 0 : i(t, "like" === n ? 1 : 0); - case 3: - l(n), e.n = 5; - break; - case 4: e.p = 4, r = e.v, m(r); - case 5: return e.p = 5, p(!1), e.f(5); - case 6: return e.a(2); - } - }, e, null, [[ - 2, - 4, - 5, - 6 - ]]); - })); - return function(t) { - return e.apply(this, arguments); - }; - }(), y = u.likeButtonTitle, g = void 0 === y ? "Like" : y, F = u.dislikeButtonTitle, E = void 0 === F ? "Dislike" : F, b = u.thanksForFeedbackText, _ = void 0 === b ? "Thanks for your feedback!" : b; - return n && r ? It.createElement("div", { className: "DocSearch-AskAiScreen-Actions" }, null === c ? It.createElement(It.Fragment, null, d ? It.createElement(ya, { className: "DocSearch-AskAiScreen-SmallerLoadingIcon" }) : It.createElement(It.Fragment, null, It.createElement(lo, { - title: g, - onClick: function() { - return D("like"); - } - }), It.createElement(fo, { - title: E, - onClick: function() { - return D("dislike"); - } - })), v && It.createElement("p", { className: "DocSearch-AskAiScreen-FeedbackText" }, v.message || "An error occured")) : It.createElement("p", { className: "DocSearch-AskAiScreen-FeedbackText DocSearch-AskAiScreen-FeedbackText--visible" }, _), It.createElement(co, { - translations: u, - onClick: function() { - return navigator.clipboard.writeText(r); - } - })) : null; -} -function io(e) { - var t = e.urlsToDisplay, n = e.relatedSourcesText; - return It.createElement("div", { className: "DocSearch-AskAiScreen-RelatedSources" }, It.createElement("p", { className: "DocSearch-AskAiScreen-RelatedSources-Title" }, n || "Related sources"), It.createElement("div", { className: "DocSearch-AskAiScreen-RelatedSources-List" }, t.length > 0 && t.map(function(e) { - return It.createElement("a", { - key: e.url, - href: e.url, - className: "DocSearch-AskAiScreen-RelatedSources-Item-Link", - target: "_blank", - rel: "noopener noreferrer" - }, It.createElement(so, null), It.createElement("span", null, e.title || e.url)); - }))); -} -function oo(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = hn(e, no), u = n.disclaimerText, a = void 0 === u ? "Answers are generated with AI which can make mistakes. Verify responses." : u, i = n.startNewConversationButtonText, o = void 0 === i ? "Start a new conversation" : i, s = r.messages, c = r.askAiError, l = r.status, f = r.agentStudio, d = Pe(function() { - return "error" === l && Nn(c, Boolean(f)); - }, [ - l, - c, - f - ]), p = Pe(function() { - return function(e) { - if (e) { - if (zn(e)) { - var t = Mn(e); - return t && !function(e) { - var t = e.trim(); - return t.startsWith("{") && t.endsWith("}"); - }(t) ? t : "Could not complete response due to token output limits"; - } - return Mn(e); - } - }(c); - }, [c]), h = function(e, t) { - return !e || !zn(e) && (!!jn(e) || !t || On(e).showNewConversationLink); - }(c, Boolean(f)), v = Pe(function() { - for (var e = [], t = 0; t < s.length; t++) if ("user" === s[t].role) { - var n, r = s[t], u = "assistant" === (null === (n = s[t + 1]) || void 0 === n ? void 0 : n.role) ? s[t + 1] : null; - e.push({ - id: r.id, - userMessage: r, - assistantMessage: u - }), u && t++; - } - return function(e) { - return e; - }(e); - }, [s, d]), m = function(e) { - r.onAskAiToggle(!1), r.setQuery(e); - }, D = d && (!jn(c) || s.some(function(e) { - return "assistant" === e.role; - })); - return It.createElement("div", { className: "DocSearch-AskAiScreen DocSearch-AskAiScreen-Container" }, D && It.createElement("div", { className: "DocSearch-AskAiScreen-MessageContent DocSearch-AskAiScreen-Error DocSearch-AskAiScreen-Error--ThreadDepth" }, It.createElement("div", { className: "DocSearch-AskAiScreen-Error-Content" }, p ? It.createElement("p", { className: "DocSearch-AskAiScreen-Error-Title" }, p) : null, h ? It.createElement("p", null, It.createElement("button", { - type: "button", - className: "DocSearch-ThreadDepthError-Link", - onClick: r.onNewConversation - }, o), " ", "to continue.") : null)), It.createElement(ro, { disclaimerText: a }), It.createElement("div", { className: "DocSearch-AskAiScreen-Body" }, It.createElement("div", { className: "DocSearch-AskAiScreen-ExchangesList" }, v.slice().reverse().map(function(e, t) { - return It.createElement(uo, { - key: e.id, - exchange: e, - askAiError: r.askAiError, - isLastExchange: 0 === t, - loadingStatus: r.status, - translations: n, - conversations: r.conversations, - agentStudio: f, - onSearchQueryClick: m, - onFeedback: r.onFeedback - }); - })))); -} -function so() { - return It.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - width: "20", - height: "20", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeLinecap: "round", - strokeLinejoin: "round" - }, It.createElement("line", { - x1: "4", - x2: "20", - y1: "9", - y2: "9" - }), It.createElement("line", { - x1: "4", - x2: "20", - y1: "15", - y2: "15" - }), It.createElement("line", { - x1: "10", - x2: "8", - y1: "3", - y2: "21" - }), It.createElement("line", { - x1: "16", - x2: "14", - y1: "3", - y2: "21" - })); -} -function co(e) { - var t = e.onClick, n = e.translations, r = n.copyButtonTitle, u = void 0 === r ? "Copy" : r, a = n.copyButtonCopiedText, i = void 0 === a ? "Copied!" : a, o = yn(Se(!1), 2), s = o[0], c = o[1]; - return Oe(function() { - if (s) { - var e = setTimeout(function() { - c(!1); - }, 1500); - return function() { - return clearTimeout(e); - }; - } - }, [s]), It.createElement("button", { - type: "button", - className: "DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-CopyButton ".concat(s ? "DocSearch-AskAiScreen-CopyButton--copied" : ""), - disabled: s, - title: s ? i : u, - onClick: function() { - t(), c(!0); - } - }, s ? It.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "1.5", - strokeLinecap: "round", - strokeLinejoin: "round", - className: "lucide lucide-check-icon lucide-check" - }, It.createElement("path", { d: "M20 6 9 17l-5-5" })) : It.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "1.5", - strokeLinecap: "round", - strokeLinejoin: "round", - className: "lucide lucide-copy-icon lucide-copy" - }, It.createElement("rect", { - width: "14", - height: "14", - x: "8", - y: "8", - rx: "2", - ry: "2" - }), It.createElement("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }))); -} -function lo(e) { - var t = e.title, n = e.onClick; - return It.createElement("button", { - type: "button", - className: "DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-LikeButton", - title: t, - onClick: n - }, It.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "1.5", - strokeLinecap: "round", - strokeLinejoin: "round", - className: "lucide lucide-thumbs-up-icon lucide-thumbs-up" - }, It.createElement("path", { d: "M7 10v12" }), It.createElement("path", { d: "M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z" }))); -} -function fo(e) { - var t = e.title, n = e.onClick; - return It.createElement("button", { - type: "button", - className: "DocSearch-AskAiScreen-ActionButton DocSearch-AskAiScreen-DislikeButton", - title: t, - onClick: n - }, It.createElement("svg", { - xmlns: "http://www.w3.org/2000/svg", - width: "24", - height: "24", - viewBox: "0 0 24 24", - fill: "none", - stroke: "currentColor", - strokeWidth: "1.5", - strokeLinecap: "round", - strokeLinejoin: "round", - className: "lucide lucide-thumbs-down-icon lucide-thumbs-down" - }, It.createElement("path", { d: "M17 14V2" }), It.createElement("path", { d: "M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z" }))); -} -var po = [ - "hit", - "attribute", - "tagName" -]; -function ho(e, t) { - return t.split(".").reduce(function(e, t) { - return null != e && e[t] ? e[t] : null; - }, e); -} -function vo(e) { - var t = e.hit, n = e.attribute, r = e.tagName; - return $(void 0 === r ? "span" : r, pn(pn({}, hn(e, po)), {}, { dangerouslySetInnerHTML: { __html: ho(t, "_snippetResult.".concat(n, ".value")) || ho(t, n) } })); -} -var mo = [ - "item", - "getItemProps", - "onItemClick", - "translations", - "collection" -]; -function Do(e) { - var t = It.useMemo(function() { - return e.title ? e.title.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'") : null; - }, [e.title]); - return e.collection && 0 !== e.collection.items.length ? "askAI" === e.collection.source.sourceId ? It.createElement("section", { className: "DocSearch-AskAi-Section" }, It.createElement("ul", e.getListProps({ source: e.collection.source }), It.createElement(go, sn({ - item: e.collection.items[0], - translations: e.translations - }, e)))) : (e.collection.source.sourceId, It.createElement("section", { className: "DocSearch-Hits" }, It.createElement("div", { className: "DocSearch-Hit-source" }, t), It.createElement("ul", e.getListProps({ source: e.collection.source }), e.collection.items.map(function(t, n) { - return It.createElement(yo, sn({ - key: [e.title, t.objectID].join(":"), - item: t, - index: n - }, e)); - })))) : null; -} -function yo(e) { - var t = e.item, n = e.index, r = e.renderIcon, u = e.renderAction, a = e.getItemProps, i = e.onItemClick, o = e.collection, s = e.hitComponent; - return It.createElement("li", sn({ className: ["DocSearch-Hit", t.__docsearch_parent && "DocSearch-Hit--Child"].filter(Boolean).join(" ") }, a({ - item: t, - source: o.source, - onClick: function(e) { - i(t, e); - } - })), It.createElement(s, { hit: t }, It.createElement("div", { className: "DocSearch-Hit-Container" }, r({ - item: t, - index: n - }), t.hierarchy[t.type] && "lvl1" === t.type && It.createElement("div", { className: "DocSearch-Hit-content-wrapper" }, It.createElement(vo, { - className: "DocSearch-Hit-title", - hit: t, - attribute: "hierarchy.lvl1" - }), t.content && It.createElement(vo, { - className: "DocSearch-Hit-path", - hit: t, - attribute: "content" - })), "askAI" === t.type && It.createElement("div", { className: "DocSearch-Hit-content-wrapper" }, It.createElement("span", { className: "DocSearch-Hit-title" }, Bn(t.hierarchy.lvl1 || ""))), t.hierarchy[t.type] && ("lvl2" === t.type || "lvl3" === t.type || "lvl4" === t.type || "lvl5" === t.type || "lvl6" === t.type) && It.createElement("div", { className: "DocSearch-Hit-content-wrapper" }, It.createElement(vo, { - className: "DocSearch-Hit-title", - hit: t, - attribute: "hierarchy.".concat(t.type) - }), It.createElement(vo, { - className: "DocSearch-Hit-path", - hit: t, - attribute: "hierarchy.lvl1" - })), "content" === t.type && It.createElement("div", { className: "DocSearch-Hit-content-wrapper" }, It.createElement(vo, { - className: "DocSearch-Hit-title", - hit: t, - attribute: "content" - }), It.createElement(vo, { - className: "DocSearch-Hit-path", - hit: t, - attribute: "hierarchy.lvl1" - })), u({ item: t })))); -} -function go(e) { - var t = e.item, n = e.getItemProps, r = e.onItemClick, u = e.translations, a = e.collection, i = hn(e, mo), o = u || {}, s = o.askAiPlaceholder, c = void 0 === s ? "Ask AI: " : s, l = o.noResultsAskAiPlaceholder, f = void 0 === l ? "Didn't find it in the docs? Ask AI to help: " : l, d = 1 === i.state.collections.length ? f : c; - return It.createElement("li", sn({ className: "DocSearch-Hit" }, n({ - item: t, - source: a.source, - onClick: function(e) { - r(t, e); - } - })), It.createElement("div", { className: "DocSearch-Hit--AskAI" }, It.createElement("div", { className: "DocSearch-Hit-AskAIButton DocSearch-Hit-Container" }, It.createElement("div", { className: " DocSearch-Hit-AskAIButton-icon DocSearch-Hit-icon" }, It.createElement(ga, null)), It.createElement("div", { className: "DocSearch-Hit-AskAIButton-title" }, It.createElement("span", { className: "DocSearch-Hit-AskAIButton-title-highlight" }, d), It.createElement("mark", { className: "DocSearch-Hit-AskAIButton-title-query" }, String(t.query || "")))))); -} -var Fo = ["onAskAiToggle"]; -function Eo(e) { - var t = e.onAskAiToggle, n = hn(e, Fo), r = It.useMemo(function() { - return n.state.collections[2]; - }, [n.state]); - return It.useEffect(function() { - r && 0 !== r.items.length || t(!0); - }, [r, t]), It.createElement("div", { className: "DocSearch-Dropdown-Container DocSearch-Conversation-History" }, It.createElement(Do, sn({}, n, { - key: r.source.sourceId, - title: "", - translations: n.translations, - collection: r, - renderIcon: function() { - return It.createElement("div", { className: "DocSearch-Hit-icon" }, It.createElement(ga, null)); - }, - renderAction: function(e) { - var t = e.item; - return It.createElement("div", { className: "DocSearch-Hit-action" }, It.createElement("button", { - type: "button", - className: "DocSearch-Hit-action-button", - onClick: function(e) { - e.preventDefault(), e.stopPropagation(), n.conversations.remove(t), n.refresh(); - } - }, It.createElement(Ea, null))); - } - }))); -} -function bo(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = n.titleText, u = void 0 === r ? "Unable to fetch results" : r, a = n.helpText, i = void 0 === a ? "You might want to check your network connection." : a; - return It.createElement("div", { className: "DocSearch-ErrorScreen" }, It.createElement("div", { className: "DocSearch-Screen-Icon" }, It.createElement(Oa, null)), It.createElement("p", { className: "DocSearch-Title" }, u), It.createElement("p", { className: "DocSearch-Help" }, i)); -} -function _o(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = e.suggestedQuestions, u = void 0 === r ? [] : r, a = e.selectSuggestedQuestion, i = n.newConversationTitle, o = void 0 === i ? "How can I help you today?" : i, s = n.newConversationDescription, c = void 0 === s ? "I search through your documentation to help you find setup guides, feature details and troubleshooting tips, fast." : s; - return It.createElement("div", { className: "DocSearch-NewConversationScreen" }, It.createElement("h3", { className: "DocSearch-NewConversationScreen-Title" }, o), It.createElement("p", { className: "DocSearch-NewConversationScreen-Description" }, c), It.createElement("div", { className: "DocSearch-NewConversationScreen-SuggestedQuestions" }, u.map(function(e) { - return It.createElement("button", { - key: e.objectID, - type: "button", - className: "DocSearch-NewConversationScreen-SuggestedQuestion", - onClick: function() { - return a(e); - } - }, e.question); - }))); -} -var ko = ["translations"]; -function Co(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = hn(e, ko), u = n.noResultsText, a = void 0 === u ? "No results found for" : u, i = n.suggestedQueryText, o = void 0 === i ? "Try searching for" : i, s = n.reportMissingResultsText, c = void 0 === s ? "Believe this query should return results?" : s, l = n.reportMissingResultsLinkText, f = void 0 === l ? "Let us know." : l, d = r.state.context.searchSuggestions; - return It.createElement("div", { className: "DocSearch-NoResults ".concat(r.canHandleAskAi ? "DocSearch-NoResults--withAskAi" : "") }, It.createElement("div", { className: "DocSearch-Screen-Icon" }, It.createElement(Ba, null)), It.createElement("p", { className: "DocSearch-Title" }, a, " \"", It.createElement("strong", null, r.state.query), "\""), d && d.length > 0 && It.createElement("div", { className: "DocSearch-NoResults-Prefill-List" }, It.createElement("p", { className: "DocSearch-Help" }, o, ":"), It.createElement("div", { className: "DocSearch-NoResults-Prefill-List-Items" }, d.slice(0, 3).reduce(function(e, t) { - return [].concat(gn(e), [It.createElement("p", { key: t }, It.createElement($n, { size: 16 }), It.createElement("button", { - className: "DocSearch-Prefill", - key: t, - type: "button", - onClick: function() { - r.setQuery(t.toLowerCase() + " "), r.refresh(), r.inputRef.current.focus(); - } - }, t))]); - }, []))), r.getMissingResultsUrl && It.createElement("p", { className: "DocSearch-Help" }, "".concat(c, " "), It.createElement("a", { - href: r.getMissingResultsUrl({ query: r.state.query }), - target: "_blank", - rel: "noopener noreferrer" - }, f))); -} -var Ao = ["translations"]; -function wo(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = hn(e, Ao); - return It.createElement("div", { className: "DocSearch-Dropdown-Container" }, r.state.collections.map(function(e) { - if (0 === e.items.length) return null; - var t = Qn(e.items[0]); - return It.createElement(Do, sn({}, r, { - key: e.source.sourceId, - translations: n, - title: t, - collection: e, - renderIcon: function(t) { - var n, r = t.item, u = t.index; - return It.createElement(It.Fragment, null, r.__docsearch_parent && It.createElement("svg", { - className: "DocSearch-Hit-Tree", - viewBox: "0 0 24 54" - }, It.createElement("g", { - stroke: "currentColor", - fill: "none", - fillRule: "evenodd", - strokeLinecap: "round", - strokeLinejoin: "round" - }, r.__docsearch_parent !== (null === (n = e.items[u + 1]) || void 0 === n ? void 0 : n.__docsearch_parent) ? It.createElement("path", { d: "M8 6v21M20 27H8.3" }) : It.createElement("path", { d: "M8 6v42M20 27H8.3" }))), It.createElement("div", { className: "DocSearch-Hit-icon" }, It.createElement(Ca, { type: r.type }))); - }, - renderAction: function() { - return It.createElement("div", { className: "DocSearch-Hit-action" }, It.createElement(_a, null)); - } - })); - }), r.resultsFooterComponent && It.createElement("section", { className: "DocSearch-HitsFooter" }, It.createElement(r.resultsFooterComponent, { state: r.state }))); -} -var So = ["translations"]; -function xo(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = hn(e, So), u = n.recentSearchesTitle, a = void 0 === u ? "Recent" : u, i = n.saveRecentSearchButtonTitle, o = void 0 === i ? "Save this search" : i, s = n.removeRecentSearchButtonTitle, c = void 0 === s ? "Remove this search from history" : s, l = n.favoriteSearchesTitle, f = void 0 === l ? "Favorite" : l, d = n.removeFavoriteSearchButtonTitle, p = void 0 === d ? "Remove this search from favorites" : d, h = n.recentConversationsTitle, v = void 0 === h ? "Recent conversations" : h, m = n.removeRecentConversationButtonTitle, D = void 0 === m ? "Remove this conversation from history" : m; - return It.createElement("div", { className: "DocSearch-Dropdown-Container" }, It.createElement(Do, sn({}, r, { - title: a, - collection: r.state.collections[0], - renderIcon: function() { - return It.createElement("div", { className: "DocSearch-Hit-icon" }, It.createElement(Fa, null)); - }, - renderAction: function(e) { - var t = e.item; - return It.createElement(It.Fragment, null, It.createElement("div", { className: "DocSearch-Hit-action" }, It.createElement("button", { - className: "DocSearch-Hit-action-button", - title: o, - type: "submit", - onClick: function(e) { - e.preventDefault(), e.stopPropagation(), r.favoriteSearches.add(t), r.recentSearches.remove(t), r.refresh(); - } - }, It.createElement(Sa, null))), It.createElement("div", { className: "DocSearch-Hit-action" }, It.createElement("button", { - className: "DocSearch-Hit-action-button", - title: c, - type: "submit", - onClick: function(e) { - e.preventDefault(), e.stopPropagation(), r.recentSearches.remove(t), r.refresh(); - } - }, It.createElement(Ea, null)))); - } - })), It.createElement(Do, sn({}, r, { - title: f, - collection: r.state.collections[1], - renderIcon: function() { - return It.createElement("div", { className: "DocSearch-Hit-icon" }, It.createElement(Sa, null)); - }, - renderAction: function(e) { - var t = e.item; - return It.createElement("div", { className: "DocSearch-Hit-action" }, It.createElement("button", { - className: "DocSearch-Hit-action-button", - title: p, - type: "submit", - onClick: function(e) { - e.preventDefault(), e.stopPropagation(), r.favoriteSearches.remove(t), r.refresh(); - } - }, It.createElement(Ea, null))); - } - })), It.createElement(Do, sn({}, r, { - title: v, - collection: r.state.collections[2], - renderIcon: function() { - return It.createElement("div", { className: "DocSearch-Hit-icon" }, It.createElement(ga, null)); - }, - renderAction: function(e) { - var t = e.item; - return It.createElement("div", { className: "DocSearch-Hit-action" }, It.createElement("button", { - className: "DocSearch-Hit-action-button", - title: D, - type: "submit", - onClick: function(e) { - e.preventDefault(), e.stopPropagation(), r.conversations.remove(t), r.refresh(); - } - }, It.createElement(Ea, null))); - } - }))); -} -var Oo = ["translations"], Bo = It.memo(function(e) { - var t, n = e.translations, r = void 0 === n ? {} : n, u = hn(e, Oo); - return u.canHandleAskAi && u.isAskAiActive && "conversation-history" === u.askAiState ? It.createElement(Eo, u) : u.canHandleAskAi && u.isAskAiActive && "new-conversation" === u.askAiState ? It.createElement(_o, { - translations: null == r ? void 0 : r.newConversation, - selectSuggestedQuestion: u.selectSuggestedQuestion, - suggestedQuestions: u.suggestedQuestions - }) : u.isAskAiActive && u.canHandleAskAi ? It.createElement(oo, sn({}, u, { - messages: u.messages, - status: u.status, - askAiError: u.askAiError, - translations: null == r ? void 0 : r.askAiScreen, - agentStudio: u.agentStudio - })) : "error" === (null === (t = u.state) || void 0 === t ? void 0 : t.status) ? It.createElement(bo, { translations: null == r ? void 0 : r.errorScreen }) : u.state.query ? u.hasCollections || u.canHandleAskAi ? It.createElement(It.Fragment, null, It.createElement(wo, sn({}, u, { translations: null == r ? void 0 : r.resultsScreen })), u.canHandleAskAi && 1 === u.state.collections.length && It.createElement(Co, sn({}, u, { translations: null == r ? void 0 : r.noResultsScreen }))) : It.createElement(Co, sn({}, u, { translations: null == r ? void 0 : r.noResultsScreen })) : It.createElement(xo, sn({}, u, { - hasCollections: u.hasCollections, - translations: null == r ? void 0 : r.startScreen - })); -}, function(e, t) { - return "loading" === t.state.status || "stalled" === t.state.status; -}); -function Io(e) { - var t = e.size, n = void 0 === t ? 20 : t, r = e.color, u = void 0 === r ? "currentColor" : r; - return It.createElement("svg", { - width: n, - height: n, - className: "DocSearch-Back-Icon", - viewBox: "0 0 24 24", - fill: "none", - stroke: u, - strokeWidth: "1.6", - strokeLinecap: "round", - strokeLinejoin: "round", - "aria-hidden": "true" - }, It.createElement("path", { d: "m12 19-7-7 7-7" }), It.createElement("path", { d: "M19 12H5" })); -} -var To = [ - "children", - "className", - "onClick" -], Po = It.createContext({ - open: !1, - setOpen: function(e) {} -}); -function jo(e) { - var t = e.children, n = yn(It.useState(!1), 2), r = n[0], u = n[1], a = It.useRef(null); - return It.useEffect(function() { - function e(e) { - var t; - null !== (t = a.current) && void 0 !== t && t.contains(e.target) || u(!1); - } - return r && window.addEventListener("click", e), function() { - window.removeEventListener("click", e); - }; - }, [r]), It.createElement(Po.Provider, { value: { - open: r, - setOpen: u - } }, It.createElement("div", { - ref: a, - className: "DocSearch-Menu" - }, t)); -} -function No(e) { - var t = e.heading, n = e.shimmer, r = void 0 !== n && n; - return It.createElement("span", { className: "DocSearch-Modal-heading".concat(r ? " shimmer" : "") }, t); -} -jo.Trigger = function(e) { - var t = e.children, n = e.className, r = void 0 === n ? "" : n, u = e.disabled, a = It.useContext(Po), i = a.open, o = a.setOpen; - return It.createElement("button", { - type: "button", - className: "DocSearch-Menu-trigger ".concat(r).concat(u ? " disabled" : ""), - "aria-disabled": u, - onClick: function() { - u || o(!i); - } - }, t); -}, jo.Content = function(e) { - var t = e.children, n = It.useContext(Po).open; - return It.createElement("div", { className: "DocSearch-Menu-content".concat(n ? " open" : "") }, t); -}, jo.Item = function(e) { - var t = e.children, n = e.className, r = void 0 === n ? "" : n, u = e.onClick, a = hn(e, To), i = It.useContext(Po).setOpen; - return It.createElement("button", sn({ - type: "button", - className: "DocSearch-Menu-item ".concat(r), - onClick: function(e) { - u && (u(e), i(!1)); - } - }, a), t); -}; -var zo = [ - "translations", - "askAiState", - "onAskAiToggle", - "setAskAiState" -]; -function Ro(e) { - var t = e.translations, n = void 0 === t ? {} : t, r = e.askAiState, u = e.onAskAiToggle, a = e.setAskAiState, i = hn(e, zo), o = n.clearButtonTitle, s = void 0 === o ? "Clear" : o, c = n.clearButtonAriaLabel, l = void 0 === c ? "Clear the query" : c, f = n.closeButtonText, d = void 0 === f ? "Close" : f, p = n.closeButtonAriaLabel, h = void 0 === p ? "Close" : p, v = n.searchInputLabel, m = void 0 === v ? "Search" : v, D = n.backToKeywordSearchButtonText, y = void 0 === D ? "Back to keyword search" : D, g = n.backToKeywordSearchButtonAriaLabel, F = void 0 === g ? "Back to keyword search" : g, E = n.placeholderTextAskAiStreaming, b = void 0 === E ? "Answering..." : E, _ = n.newConversationPlaceholder, k = void 0 === _ ? "Ask a question" : _, C = n.conversationHistoryTitle, A = void 0 === C ? "My conversation history" : C, w = n.startNewConversationText, S = void 0 === w ? "Start a new conversation" : w, x = n.viewConversationHistoryText, O = void 0 === x ? "Conversation history" : x, B = n.threadDepthErrorPlaceholder, I = void 0 === B ? "Conversation limit reached" : B, T = i.getFormProps({ inputElement: i.inputRef.current }).onReset; - It.useEffect(function() { - i.autoFocus && i.inputRef.current && i.inputRef.current.focus(); - }, [i.autoFocus, i.inputRef]), It.useEffect(function() { - i.isFromSelection && i.inputRef.current && i.inputRef.current.select(); - }, [i.isFromSelection, i.inputRef]); - var P = It.useMemo(function() { - var e = i.state.collections[2]; - return !!e && e.items.length > 0; - }, [i.state.collections]), j = i.getInputProps({ - inputElement: i.inputRef.current, - autoFocus: i.autoFocus, - maxLength: 512 - }), N = /* @__PURE__ */ new Set([ - "ArrowUp", - "ArrowDown", - "Enter" - ]), z = j.onKeyDown, R = j.onChange, M = "streaming" === i.askAiStatus || "submitted" === i.askAiStatus, Z = "stalled" === i.state.status, L = i.isAskAiActive && "conversation-history" !== r, $ = i.isThreadDepthError || !1, q = i.placeholder; - "new-conversation" === r && (q = k), $ && i.isAskAiActive && "minimal" !== i.askAiBlockingChrome && (q = I); - var U = null; - M && (U = b), "conversation-history" === r && (U = A), It.useEffect(function() { - "streaming" !== i.askAiStatus && "submitted" !== i.askAiStatus && i.inputRef.current && i.inputRef.current.focus(); - }, [i.askAiStatus, i.inputRef]); - var H = pn(pn({}, j), {}, { - enterKeyHint: i.isAskAiActive ? "enter" : "search", - onKeyDown: function(e) { - if (i.isAskAiActive && N.has(e.key)) return "Enter" === e.key && !M && i.state.query && i.onAskAgain(i.state.query), e.preventDefault(), void e.stopPropagation(); - null == z || z(e); - }, - onChange: function(e) { - if (i.isAskAiActive) return i.setQuery(e.currentTarget.value), e.preventDefault(), void e.stopPropagation(); - null == R || R(e); - }, - disabled: M || $ && i.isAskAiActive - }), V = It.useCallback(function() { - if (!$) return "conversation-history" === r ? (u(!0), void a("initial")) : void u(!1); - i.onNewConversation(); - }, [ - r, - $, - u, - a, - i - ]); - return It.createElement(It.Fragment, null, It.createElement("form", { - className: "DocSearch-Form", - onSubmit: function(e) { - e.preventDefault(); - }, - onReset: T - }, i.isAskAiActive ? It.createElement(It.Fragment, null, It.createElement("button", { - type: "button", - tabIndex: 0, - className: "DocSearch-Action DocSearch-AskAi-Return", - title: y, - "aria-label": F, - onClick: V - }, It.createElement(Io, null))) : It.createElement(It.Fragment, null, Z && It.createElement("div", { className: "DocSearch-LoadingIndicator" }, It.createElement(ya, null)), !Z && It.createElement("label", sn({ className: "DocSearch-MagnifierLabel" }, i.getLabelProps()), It.createElement($n, null), It.createElement("span", { className: "DocSearch-VisuallyHiddenForAccessibility" }, m))), U && It.createElement(No, { - heading: U, - shimmer: M - }), It.createElement("input", sn({ - className: "DocSearch-Input", - ref: i.inputRef - }, H, { - placeholder: q, - hidden: Boolean(U) - })), It.createElement("div", { className: "DocSearch-Actions" }, It.createElement("button", { - className: "DocSearch-Clear", - type: "reset", - "aria-label": l, - hidden: !i.state.query, - tabIndex: i.state.query ? 0 : -1, - "aria-hidden": i.state.query ? "false" : "true" - }, s), i.state.query && It.createElement("div", { className: "DocSearch-Divider" }), M && It.createElement(It.Fragment, null, It.createElement("button", { - type: "button", - className: "DocSearch-Action DocSearch-StopStreaming", - onClick: i.onStopAskAiStreaming - }, It.createElement(xa, null)), It.createElement("div", { className: "DocSearch-Divider" })), L && It.createElement(It.Fragment, null, It.createElement(jo, null, It.createElement(jo.Trigger, { className: "DocSearch-Action" }, It.createElement(Ia, null)), It.createElement(jo.Content, null, It.createElement(jo.Item, { onClick: i.onNewConversation }, It.createElement(Pa, null), S), P && It.createElement(jo.Item, { onClick: i.onViewConversationHistory }, It.createElement(Ta, null), O))), It.createElement("div", { className: "DocSearch-Divider" })), It.createElement("button", { - type: "button", - title: d, - className: "DocSearch-Action DocSearch-Close", - "aria-label": h, - onClick: i.onClose - }, It.createElement(Ea, null))))); -} -function Mo() { - if ("undefined" != typeof window && window.localStorage) { - var e = []; - for (var t in window.localStorage) if (t.includes("__DOCSEARCH_")) { - var n = window.localStorage[t]; - e.push({ - key: t, - size: n.length + t.length - }); - } - e.sort(function(e, t) { - return t.size - e.size; - }); - for (var r = Math.ceil(e.length / 2), u = 0; u < r && u < e.length; u++) try { - window.localStorage.removeItem(e[u].key); - } catch (e) {} - } -} -function Zo(e) { - return !1 === function() { - if ("undefined" == typeof window || !("localStorage" in window)) return !1; - var e = "__TEST_KEY__"; - try { - return window.localStorage.setItem(e, ""), window.localStorage.removeItem(e), !0; - } catch (e) { - return !1; - } - }() ? { - setItem: function() {}, - getItem: function() { - return []; - } - } : { - setItem: function(t) { - (function(e, t) { - try { - window.localStorage.setItem(e, JSON.stringify(t)); - } catch (n) { - if (n instanceof DOMException && "QuotaExceededError" === n.name) try { - Mo(), window.localStorage.setItem(e, JSON.stringify(t)); - } catch (e) {} - } - })(e, t); - }, - getItem: function() { - var t = window.localStorage.getItem(e); - if (null === t) return []; - try { - var n = JSON.parse(t); - return Array.isArray(n) ? n : []; - } catch (t) { - return window.localStorage.removeItem(e), []; - } - } - }; -} -var Lo = ["_highlightResult", "_snippetResult"]; -function $o(e) { - var t = e.key, n = e.limit, r = void 0 === n ? 5 : n, u = Zo(t), a = u.getItem().slice(0, r); - return { - add: function(e) { - var t = e; - t._highlightResult, t._snippetResult; - var n = hn(t, Lo), i = a.findIndex(function(e) { - return e.objectID === n.objectID; - }); - i > -1 && a.splice(i, 1), a.unshift(n), a = a.slice(0, r), u.setItem(a); - }, - remove: function(e) { - a = a.filter(function(t) { - return t.objectID !== e.objectID; - }), u.setItem(a); - }, - getAll: function() { - return a; - } - }; -} -var qo, Uo = "vercel.ai.error", Ho = Symbol.for(Uo), Vo = function() { - function e(t) { - var n, r = t.name, i = t.message, o = t.cause; - return a(this, e), (n = u(this, e, [i]))[qo] = !0, n.name = r, n.cause = o, n; - } - return f(e, k(Error)), o(e, null, [{ - key: "isInstance", - value: function(t) { - return e.hasMarker(t, Uo); - } - }, { - key: "hasMarker", - value: function(e, t) { - var n = Symbol.for(t); - return null != e && "object" == b(e) && n in e && "boolean" == typeof e[n] && !0 === e[n]; - } - }]); -}(); -qo = Ho; -var Wo = Vo; -function Ko(e) { - return null == e ? "unknown error" : "string" == typeof e ? e : e instanceof Error ? e.message : JSON.stringify(e); -} -var Jo, Qo = "AI_InvalidArgumentError", Go = "vercel.ai.error.".concat(Qo), Yo = Symbol.for(Go), Xo = function() { - function e(t) { - var n, r = t.message, i = t.cause, o = t.argument; - return a(this, e), (n = u(this, e, [{ - name: Qo, - message: r, - cause: i - }]))[Jo] = !0, n.argument = o, n; - } - return f(e, Wo), o(e, null, [{ - key: "isInstance", - value: function(e) { - return Wo.hasMarker(e, Go); - } - }]); -}(); -Jo = Yo; -var es, ts = "AI_JSONParseError", ns = "vercel.ai.error.".concat(ts), rs = Symbol.for(ns), us = function() { - function e(t) { - var n, r = t.text, i = t.cause; - return a(this, e), (n = u(this, e, [{ - name: ts, - message: "JSON parsing failed: Text: ".concat(r, ".\nError message: ").concat(Ko(i)), - cause: i - }]))[es] = !0, n.text = r, n; - } - return f(e, Wo), o(e, null, [{ - key: "isInstance", - value: function(e) { - return Wo.hasMarker(e, ns); - } - }]); -}(); -es = rs; -var as, is = "AI_TypeValidationError", os = "vercel.ai.error.".concat(is); -as = Symbol.for(os); -var cs = function() { - function e(t) { - var n, r = t.value, i = t.cause; - return a(this, e), (n = u(this, e, [{ - name: is, - message: "Type validation failed: Value: ".concat(JSON.stringify(r), ".\nError message: ").concat(Ko(i)), - cause: i - }]))[as] = !0, n.value = r, n; - } - return f(e, Wo), o(e, null, [{ - key: "isInstance", - value: function(e) { - return Wo.hasMarker(e, os); - } - }, { - key: "wrap", - value: function(t) { - var n = t.value, r = t.cause; - return e.isInstance(r) && r.value === n ? r : new e({ - value: n, - cause: r - }); - } - }]); -}(), ls = function() { - function e(t, n) { - var r; - return tn(this, e), (r = en(this, e, [t])).name = "ParseError", r.type = n.type, r.field = n.field, r.value = n.value, r.line = n.line, r; - } - return ln(e, _n(Error)), un(e); -}(); -function fs(e) {} -var ds = function() { - function e() { - var t, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, r = n.onError, u = n.onRetry, a = n.onComment; - return tn(this, e), en(this, e, [{ - start: function(e) { - t = function(e) { - if ("function" == typeof e) throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"); - var t, n = e.onEvent, r = void 0 === n ? fs : n, u = e.onError, a = void 0 === u ? fs : u, i = e.onRetry, o = void 0 === i ? fs : i, s = e.onComment, c = "", l = !0, f = "", d = ""; - function p(e) { - if ("" === e) return f.length > 0 && r({ - id: t, - event: d || void 0, - data: f.endsWith("\n") ? f.slice(0, -1) : f - }), t = void 0, f = "", void (d = ""); - if (e.startsWith(":")) s && s(e.slice(e.startsWith(": ") ? 2 : 1)); - else { - var n = e.indexOf(":"); - if (-1 === n) h(e, "", e); - else { - var u = e.slice(0, n), a = " " === e[n + 1] ? 2 : 1; - h(u, e.slice(n + a), e); - } - } - } - function h(e, n, r) { - switch (e) { - case "event": - d = n; - break; - case "data": - f = "".concat(f).concat(n, "\n"); - break; - case "id": - t = n.includes("\0") ? void 0 : n; - break; - case "retry": - /^\d+$/.test(n) ? o(parseInt(n, 10)) : a(new ls("Invalid `retry` value: \"".concat(n, "\""), { - type: "invalid-retry", - value: n, - line: r - })); - break; - default: a(new ls("Unknown field \"".concat(e.length > 20 ? "".concat(e.slice(0, 20), "…") : e, "\""), { - type: "unknown-field", - field: e, - value: n, - line: r - })); - } - } - return { - feed: function(e) { - var t, n = l ? e.replace(/^\xEF\xBB\xBF/, "") : e, u = yn(function(e) { - for (var t = [], n = "", r = 0; r < e.length;) { - var u = e.indexOf("\r", r), a = e.indexOf("\n", r), i = -1; - if (-1 !== u && -1 !== a ? i = Math.min(u, a) : -1 !== u ? i = u === e.length - 1 ? -1 : u : -1 !== a && (i = a), -1 === i) { - n = e.slice(r); - break; - } - var o = e.slice(r, i); - t.push(o), "\r" === e[(r = i + 1) - 1] && "\n" === e[r] && r++; - } - return [t, n]; - }("".concat(c).concat(n)), 2), a = u[0], i = u[1], o = an(a); - try { - for (o.s(); !(t = o.n()).done;) p(t.value); - } catch (e) { - o.e(e); - } finally { - o.f(); - } - c = i, l = !1; - }, - reset: function() { - c && (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).consume && p(c), l = !0, t = void 0, f = "", d = "", c = ""; - } - }; - }({ - onEvent: function(t) { - e.enqueue(t); - }, - onError: function(t) { - "terminate" === r ? e.error(t) : "function" == typeof r && r(t); - }, - onRetry: u, - onComment: a - }); - }, - transform: function(e) { - t.feed(e); - } - }]); - } - return ln(e, _n(TransformStream)), un(e); -}(); -function ps(e, t, n) { - var r; - function u(n, r) { - var u, a, o; - for (var s in Object.defineProperty(n, "_zod", { - value: null !== (u = n._zod) && void 0 !== u ? u : {}, - enumerable: !1 - }), null !== (a = (o = n._zod).traits) && void 0 !== a || (o.traits = /* @__PURE__ */ new Set()), n._zod.traits.add(e), t(n, r), i.prototype) s in n || Object.defineProperty(n, s, { value: i.prototype[s].bind(n) }); - n._zod.constr = i, n._zod.def = r; - } - var a = function(e) { - function t() { - return tn(this, t), en(this, t, arguments); - } - return ln(t, e), un(t); - }(null !== (r = null == n ? void 0 : n.Parent) && void 0 !== r ? r : Object); - function i(e) { - var t, r, i = null != n && n.Parent ? new a() : this; - u(i, e), null !== (t = (r = i._zod).deferred) && void 0 !== t || (r.deferred = []); - var o, s = an(i._zod.deferred); - try { - for (s.s(); !(o = s.n()).done;) (0, o.value)(); - } catch (e) { - s.e(e); - } finally { - s.f(); - } - return i; - } - return Object.defineProperty(a, "name", { value: e }), Object.defineProperty(i, "init", { value: u }), Object.defineProperty(i, Symbol.hasInstance, { value: function(t) { - var r; - return !!(null != n && n.Parent && t instanceof n.Parent) || (null == t || null === (r = t._zod) || void 0 === r || null === (r = r.traits) || void 0 === r ? void 0 : r.has(e)); - } }), Object.defineProperty(i, "name", { value: e }), i; -} -var hs = function() { - function e() { - return tn(this, e), en(this, e, ["Encountered Promise during synchronous parse. Use .parseAsync() instead."]); - } - return ln(e, _n(Error)), un(e); -}(), vs = function() { - function e(t) { - var n; - return tn(this, e), (n = en(this, e, ["Encountered unidirectional transform during encode: ".concat(t)])).name = "ZodEncodeError", n; - } - return ln(e, _n(Error)), un(e); -}(), ms = {}; -function Ds(e) { - return ms; -} -function ys(e) { - var t = Object.values(e).filter(function(e) { - return "number" == typeof e; - }); - return Object.entries(e).filter(function(e) { - var n = yn(e, 2), r = n[0]; - return n[1], -1 === t.indexOf(+r); - }).map(function(e) { - var t = yn(e, 2); - return t[0], t[1]; - }); -} -function gs(e, t) { - return "bigint" == typeof t ? t.toString() : t; -} -function Fs(e) { - return { get value() { - var t = e(); - return Object.defineProperty(this, "value", { value: t }), t; - } }; -} -function Es(e) { - return null == e; -} -function bs(e) { - var t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length; - return e.slice(t, n); -} -var _s = Symbol("evaluating"); -function ks(e, t, n) { - var r = void 0; - Object.defineProperty(e, t, { - get: function() { - if (r !== _s) return void 0 === r && (r = _s, r = n()), r; - }, - set: function(n) { - Object.defineProperty(e, t, { value: n }); - }, - configurable: !0 - }); -} -function Cs(e, t, n) { - Object.defineProperty(e, t, { - value: n, - writable: !0, - enumerable: !0, - configurable: !0 - }); -} -function As() { - for (var e = {}, t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; - for (var u = 0, a = n; u < a.length; u++) { - var i = a[u], o = Object.getOwnPropertyDescriptors(i); - Object.assign(e, o); - } - return Object.defineProperties({}, e); -} -function ws(e) { - return JSON.stringify(e); -} -var Ss = "captureStackTrace" in Error ? Error.captureStackTrace : function() {}; -function xs(e) { - return "object" === En(e) && null !== e && !Array.isArray(e); -} -var Os = Fs(function() { - var e; - if ("undefined" != typeof navigator && null !== (e = navigator) && void 0 !== e && null !== (e = e.userAgent) && void 0 !== e && e.includes("Cloudflare")) return !1; - try { - return new Function(""), !0; - } catch (e) { - return !1; - } -}); -function Bs(e) { - if (!1 === xs(e)) return !1; - var t = e.constructor; - if (void 0 === t) return !0; - var n = t.prototype; - return !1 !== xs(n) && !1 !== Object.prototype.hasOwnProperty.call(n, "isPrototypeOf"); -} -function Is(e) { - return Bs(e) ? pn({}, e) : Array.isArray(e) ? gn(e) : e; -} -var Ts = /* @__PURE__ */ new Set([ - "string", - "number", - "symbol" -]); -function Ps(e) { - return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); -} -function js(e, t, n) { - var r = new e._zod.constr(null != t ? t : e._zod.def); - return (!t || null != n && n.parent) && (r._zod.parent = e), r; -} -function Ns(e) { - var t = e; - if (!t) return {}; - if ("string" == typeof t) return { error: function() { - return t; - } }; - if (void 0 !== (null == t ? void 0 : t.message)) { - if (void 0 !== (null == t ? void 0 : t.error)) throw new Error("Cannot specify both `message` and `error` params"); - t.error = t.message; - } - return delete t.message, "string" == typeof t.error ? pn(pn({}, t), {}, { error: function() { - return t.error; - } }) : t; -} -var zs = { - safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], - int32: [-2147483648, 2147483647], - uint32: [0, 4294967295], - float32: [-34028234663852886e22, 34028234663852886e22], - float64: [-Number.MAX_VALUE, Number.MAX_VALUE] -}; -function Rs(e) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; - if (!0 === e.aborted) return !0; - for (var n = t; n < e.issues.length; n++) { - var r; - if (!0 !== (null === (r = e.issues[n]) || void 0 === r ? void 0 : r.continue)) return !0; - } - return !1; -} -function Ms(e, t) { - return t.map(function(t) { - var n, r; - return null !== (n = (r = t).path) && void 0 !== n || (r.path = []), t.path.unshift(e), t; - }); -} -function Zs(e) { - return "string" == typeof e ? e : null == e ? void 0 : e.message; -} -function Ls(e, t, n) { - var r, u = pn(pn({}, e), {}, { path: null !== (r = e.path) && void 0 !== r ? r : [] }); - if (!e.message) { - var a, i, o, s, c, l, f, d, p; - u.message = null !== (a = null !== (i = null !== (o = null !== (s = Zs(null === (c = e.inst) || void 0 === c || null === (c = c._zod.def) || void 0 === c || null === (l = c.error) || void 0 === l ? void 0 : l.call(c, e))) && void 0 !== s ? s : Zs(null == t || null === (f = t.error) || void 0 === f ? void 0 : f.call(t, e))) && void 0 !== o ? o : Zs(null === (d = n.customError) || void 0 === d ? void 0 : d.call(n, e))) && void 0 !== i ? i : Zs(null === (p = n.localeError) || void 0 === p ? void 0 : p.call(n, e))) && void 0 !== a ? a : "Invalid input"; - } - return delete u.inst, delete u.continue, null != t && t.reportInput || delete u.input, u; -} -function $s(e) { - return e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof File ? "file" : "unknown"; -} -function qs(e) { - return Array.isArray(e) ? "array" : "string" == typeof e ? "string" : "unknown"; -} -function Us() { - for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n]; - var r = t[0], u = t[1], a = t[2]; - return "string" == typeof r ? { - message: r, - code: "custom", - input: u, - inst: a - } : pn({}, r); -} -var Hs = function(e, t) { - e.name = "$ZodError", Object.defineProperty(e, "_zod", { - value: e._zod, - enumerable: !1 - }), Object.defineProperty(e, "issues", { - value: t, - enumerable: !1 - }), e.message = JSON.stringify(t, gs, 2), Object.defineProperty(e, "toString", { - value: function() { - return e.message; - }, - enumerable: !1 - }); -}, Vs = ps("$ZodError", Hs), Ws = ps("$ZodError", Hs, { Parent: Error }), Ks = function(e) { - return function(t, n, r, u) { - var a = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ - value: n, - issues: [] - }, a); - if (i instanceof Promise) throw new hs(); - if (i.issues.length) { - var o, s = new (null !== (o = null == u ? void 0 : u.Err) && void 0 !== o ? o : e)(i.issues.map(function(e) { - return Ls(e, a, Ds()); - })); - throw Ss(s, null == u ? void 0 : u.callee), s; - } - return i.value; - }; -}, Js = function(e) { - return function() { - var t = Xt(vn().m(function t(n, r, u, a) { - var i, o, s, c; - return vn().w(function(t) { - for (;;) switch (t.n) { - case 0: - if (i = u ? Object.assign(u, { async: !0 }) : { async: !0 }, !((o = n._zod.run({ - value: r, - issues: [] - }, i)) instanceof Promise)) { - t.n = 2; - break; - } - return t.n = 1, o; - case 1: o = t.v; - case 2: - if (!o.issues.length) { - t.n = 3; - break; - } - throw c = new (null !== (s = null == a ? void 0 : a.Err) && void 0 !== s ? s : e)(o.issues.map(function(e) { - return Ls(e, i, Ds()); - })), Ss(c, null == a ? void 0 : a.callee), c; - case 3: return t.a(2, o.value); - } - }, t); - })); - return function(e, n, r, u) { - return t.apply(this, arguments); - }; - }(); -}, Qs = function(e) { - return function(t, n, r) { - var u = r ? pn(pn({}, r), {}, { async: !1 }) : { async: !1 }, a = t._zod.run({ - value: n, - issues: [] - }, u); - if (a instanceof Promise) throw new hs(); - return a.issues.length ? { - success: !1, - error: new (null != e ? e : Vs)(a.issues.map(function(e) { - return Ls(e, u, Ds()); - })) - } : { - success: !0, - data: a.value - }; - }; -}, Gs = Qs(Ws), Ys = function(e) { - return function() { - var t = Xt(vn().m(function t(n, r, u) { - var a, i; - return vn().w(function(t) { - for (;;) switch (t.n) { - case 0: - if (a = u ? Object.assign(u, { async: !0 }) : { async: !0 }, !((i = n._zod.run({ - value: r, - issues: [] - }, a)) instanceof Promise)) { - t.n = 2; - break; - } - return t.n = 1, i; - case 1: i = t.v; - case 2: return t.a(2, i.issues.length ? { - success: !1, - error: new e(i.issues.map(function(e) { - return Ls(e, a, Ds()); - })) - } : { - success: !0, - data: i.value - }); - } - }, t); - })); - return function(e, n, r) { - return t.apply(this, arguments); - }; - }(); -}, Xs = Ys(Ws), ec = /^[cC][^\s-]{8,}$/, tc = /^[0-9a-z]+$/, nc = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, rc = /^[0-9a-vA-V]{20}$/, uc = /^[A-Za-z0-9]{27}$/, ac = /^[a-zA-Z0-9_-]{21}$/, ic = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, oc = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, sc = function(e) { - return e ? new RegExp("^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-".concat(e, "[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$")) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/; -}, cc = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, lc = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, fc = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, dc = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, pc = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, hc = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, vc = /^[A-Za-z0-9_-]*$/, mc = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Dc = /^\+(?:[0-9]){6,14}[0-9]$/, yc = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", gc = new RegExp("^".concat(yc, "$")); -function Fc(e) { - var t = "(?:[01]\\d|2[0-3]):[0-5]\\d"; - return "number" == typeof e.precision ? -1 === e.precision ? "".concat(t) : 0 === e.precision ? "".concat(t, ":[0-5]\\d") : "".concat(t, ":[0-5]\\d\\.\\d{").concat(e.precision, "}") : "".concat(t, "(?::[0-5]\\d(?:\\.\\d+)?)?"); -} -var Ec = /^-?\d+$/, bc = /^-?\d+(?:\.\d+)?/, _c = /^(?:true|false)$/i, kc = /^null$/i, Cc = /^[^A-Z]*$/, Ac = /^[^a-z]*$/, wc = ps("$ZodCheck", function(e, t) { - var n, r, u; - null !== (n = e._zod) && void 0 !== n || (e._zod = {}), e._zod.def = t, null !== (r = (u = e._zod).onattach) && void 0 !== r || (u.onattach = []); -}), Sc = { - number: "number", - bigint: "bigint", - object: "date" -}, xc = ps("$ZodCheckLessThan", function(e, t) { - wc.init(e, t); - var n = Sc[En(t.value)]; - e._zod.onattach.push(function(e) { - var n, r = e._zod.bag, u = null !== (n = t.inclusive ? r.maximum : r.exclusiveMaximum) && void 0 !== n ? n : Number.POSITIVE_INFINITY; - t.value < u && (t.inclusive ? r.maximum = t.value : r.exclusiveMaximum = t.value); - }), e._zod.check = function(r) { - (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({ - origin: n, - code: "too_big", - maximum: t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}), Oc = ps("$ZodCheckGreaterThan", function(e, t) { - wc.init(e, t); - var n = Sc[En(t.value)]; - e._zod.onattach.push(function(e) { - var n, r = e._zod.bag, u = null !== (n = t.inclusive ? r.minimum : r.exclusiveMinimum) && void 0 !== n ? n : Number.NEGATIVE_INFINITY; - t.value > u && (t.inclusive ? r.minimum = t.value : r.exclusiveMinimum = t.value); - }), e._zod.check = function(r) { - (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({ - origin: n, - code: "too_small", - minimum: t.value, - input: r.value, - inclusive: t.inclusive, - inst: e, - continue: !t.abort - }); - }; -}), Bc = ps("$ZodCheckMultipleOf", function(e, t) { - wc.init(e, t), e._zod.onattach.push(function(e) { - var n, r; - null !== (n = (r = e._zod.bag).multipleOf) && void 0 !== n || (r.multipleOf = t.value); - }), e._zod.check = function(n) { - if (En(n.value) !== En(t.value)) throw new Error("Cannot mix number and bigint in multiple_of check."); - ("bigint" == typeof n.value ? n.value % t.value === BigInt(0) : 0 === function(e, t) { - var n = (e.toString().split(".")[1] || "").length, r = t.toString(), u = (r.split(".")[1] || "").length; - if (0 === u && /\d?e-\d?/.test(r)) { - var a = r.match(/\d?e-(\d?)/); - null != a && a[1] && (u = Number.parseInt(a[1])); - } - var i = n > u ? n : u; - return Number.parseInt(e.toFixed(i).replace(".", "")) % Number.parseInt(t.toFixed(i).replace(".", "")) / Math.pow(10, i); - }(n.value, t.value)) || n.issues.push({ - origin: En(n.value), - code: "not_multiple_of", - divisor: t.value, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}), Ic = ps("$ZodCheckNumberFormat", function(e, t) { - var n; - wc.init(e, t), t.format = t.format || "float64"; - var r = null === (n = t.format) || void 0 === n ? void 0 : n.includes("int"), u = r ? "int" : "number", a = yn(zs[t.format], 2), i = a[0], o = a[1]; - e._zod.onattach.push(function(e) { - var n = e._zod.bag; - n.format = t.format, n.minimum = i, n.maximum = o, r && (n.pattern = Ec); - }), e._zod.check = function(n) { - var a = n.value; - if (r) { - if (!Number.isInteger(a)) return void n.issues.push({ - expected: u, - format: t.format, - code: "invalid_type", - continue: !1, - input: a, - inst: e - }); - if (!Number.isSafeInteger(a)) return void (a > 0 ? n.issues.push({ - input: a, - code: "too_big", - maximum: Number.MAX_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst: e, - origin: u, - continue: !t.abort - }) : n.issues.push({ - input: a, - code: "too_small", - minimum: Number.MIN_SAFE_INTEGER, - note: "Integers must be within the safe integer range.", - inst: e, - origin: u, - continue: !t.abort - })); - } - a < i && n.issues.push({ - origin: "number", - input: a, - code: "too_small", - minimum: i, - inclusive: !0, - inst: e, - continue: !t.abort - }), a > o && n.issues.push({ - origin: "number", - input: a, - code: "too_big", - maximum: o, - inst: e - }); - }; -}), Tc = ps("$ZodCheckMaxSize", function(e, t) { - var n, r; - wc.init(e, t), null !== (n = (r = e._zod.def).when) && void 0 !== n || (r.when = function(e) { - var t = e.value; - return !Es(t) && void 0 !== t.size; - }), e._zod.onattach.push(function(e) { - var n, r = null !== (n = e._zod.bag.maximum) && void 0 !== n ? n : Number.POSITIVE_INFINITY; - t.maximum < r && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = function(n) { - var r = n.value; - r.size <= t.maximum || n.issues.push({ - origin: $s(r), - code: "too_big", - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}), Pc = ps("$ZodCheckMinSize", function(e, t) { - var n, r; - wc.init(e, t), null !== (n = (r = e._zod.def).when) && void 0 !== n || (r.when = function(e) { - var t = e.value; - return !Es(t) && void 0 !== t.size; - }), e._zod.onattach.push(function(e) { - var n, r = null !== (n = e._zod.bag.minimum) && void 0 !== n ? n : Number.NEGATIVE_INFINITY; - t.minimum > r && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = function(n) { - var r = n.value; - r.size >= t.minimum || n.issues.push({ - origin: $s(r), - code: "too_small", - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - }; -}), jc = ps("$ZodCheckSizeEquals", function(e, t) { - var n, r; - wc.init(e, t), null !== (n = (r = e._zod.def).when) && void 0 !== n || (r.when = function(e) { - var t = e.value; - return !Es(t) && void 0 !== t.size; - }), e._zod.onattach.push(function(e) { - var n = e._zod.bag; - n.minimum = t.size, n.maximum = t.size, n.size = t.size; - }), e._zod.check = function(n) { - var r = n.value, u = r.size; - if (u !== t.size) { - var a = u > t.size; - n.issues.push(pn(pn({ origin: $s(r) }, a ? { - code: "too_big", - maximum: t.size - } : { - code: "too_small", - minimum: t.size - }), {}, { - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - })); - } - }; -}), Nc = ps("$ZodCheckMaxLength", function(e, t) { - var n, r; - wc.init(e, t), null !== (n = (r = e._zod.def).when) && void 0 !== n || (r.when = function(e) { - var t = e.value; - return !Es(t) && void 0 !== t.length; - }), e._zod.onattach.push(function(e) { - var n, r = null !== (n = e._zod.bag.maximum) && void 0 !== n ? n : Number.POSITIVE_INFINITY; - t.maximum < r && (e._zod.bag.maximum = t.maximum); - }), e._zod.check = function(n) { - var r = n.value; - if (!(r.length <= t.maximum)) { - var u = qs(r); - n.issues.push({ - origin: u, - code: "too_big", - maximum: t.maximum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - } - }; -}), zc = ps("$ZodCheckMinLength", function(e, t) { - var n, r; - wc.init(e, t), null !== (n = (r = e._zod.def).when) && void 0 !== n || (r.when = function(e) { - var t = e.value; - return !Es(t) && void 0 !== t.length; - }), e._zod.onattach.push(function(e) { - var n, r = null !== (n = e._zod.bag.minimum) && void 0 !== n ? n : Number.NEGATIVE_INFINITY; - t.minimum > r && (e._zod.bag.minimum = t.minimum); - }), e._zod.check = function(n) { - var r = n.value; - if (!(r.length >= t.minimum)) { - var u = qs(r); - n.issues.push({ - origin: u, - code: "too_small", - minimum: t.minimum, - inclusive: !0, - input: r, - inst: e, - continue: !t.abort - }); - } - }; -}), Rc = ps("$ZodCheckLengthEquals", function(e, t) { - var n, r; - wc.init(e, t), null !== (n = (r = e._zod.def).when) && void 0 !== n || (r.when = function(e) { - var t = e.value; - return !Es(t) && void 0 !== t.length; - }), e._zod.onattach.push(function(e) { - var n = e._zod.bag; - n.minimum = t.length, n.maximum = t.length, n.length = t.length; - }), e._zod.check = function(n) { - var r = n.value, u = r.length; - if (u !== t.length) { - var a = qs(r), i = u > t.length; - n.issues.push(pn(pn({ origin: a }, i ? { - code: "too_big", - maximum: t.length - } : { - code: "too_small", - minimum: t.length - }), {}, { - inclusive: !0, - exact: !0, - input: n.value, - inst: e, - continue: !t.abort - })); - } - }; -}), Mc = ps("$ZodCheckStringFormat", function(e, t) { - var n, r, u, a; - wc.init(e, t), e._zod.onattach.push(function(e) { - var n, r = e._zod.bag; - r.format = t.format, t.pattern && (null !== (n = r.patterns) && void 0 !== n || (r.patterns = /* @__PURE__ */ new Set()), r.patterns.add(t.pattern)); - }), t.pattern ? null !== (n = (u = e._zod).check) && void 0 !== n || (u.check = function(n) { - t.pattern.lastIndex = 0, t.pattern.test(n.value) || n.issues.push(pn(pn({ - origin: "string", - code: "invalid_format", - format: t.format, - input: n.value - }, t.pattern ? { pattern: t.pattern.toString() } : {}), {}, { - inst: e, - continue: !t.abort - })); - }) : null !== (r = (a = e._zod).check) && void 0 !== r || (a.check = function() {}); -}), Zc = ps("$ZodCheckRegex", function(e, t) { - Mc.init(e, t), e._zod.check = function(n) { - t.pattern.lastIndex = 0, t.pattern.test(n.value) || n.issues.push({ - origin: "string", - code: "invalid_format", - format: "regex", - input: n.value, - pattern: t.pattern.toString(), - inst: e, - continue: !t.abort - }); - }; -}), Lc = ps("$ZodCheckLowerCase", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = Cc), Mc.init(e, t); -}), $c = ps("$ZodCheckUpperCase", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = Ac), Mc.init(e, t); -}), qc = ps("$ZodCheckIncludes", function(e, t) { - wc.init(e, t); - var n = Ps(t.includes), r = new RegExp("number" == typeof t.position ? "^.{".concat(t.position, "}").concat(n) : n); - t.pattern = r, e._zod.onattach.push(function(e) { - var t, n = e._zod.bag; - null !== (t = n.patterns) && void 0 !== t || (n.patterns = /* @__PURE__ */ new Set()), n.patterns.add(r); - }), e._zod.check = function(n) { - n.value.includes(t.includes, t.position) || n.issues.push({ - origin: "string", - code: "invalid_format", - format: "includes", - includes: t.includes, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}), Uc = ps("$ZodCheckStartsWith", function(e, t) { - var n; - wc.init(e, t); - var r = new RegExp("^".concat(Ps(t.prefix), ".*")); - null !== (n = t.pattern) && void 0 !== n || (t.pattern = r), e._zod.onattach.push(function(e) { - var t, n = e._zod.bag; - null !== (t = n.patterns) && void 0 !== t || (n.patterns = /* @__PURE__ */ new Set()), n.patterns.add(r); - }), e._zod.check = function(n) { - n.value.startsWith(t.prefix) || n.issues.push({ - origin: "string", - code: "invalid_format", - format: "starts_with", - prefix: t.prefix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}), Hc = ps("$ZodCheckEndsWith", function(e, t) { - var n; - wc.init(e, t); - var r = new RegExp(".*".concat(Ps(t.suffix), "$")); - null !== (n = t.pattern) && void 0 !== n || (t.pattern = r), e._zod.onattach.push(function(e) { - var t, n = e._zod.bag; - null !== (t = n.patterns) && void 0 !== t || (n.patterns = /* @__PURE__ */ new Set()), n.patterns.add(r); - }), e._zod.check = function(n) { - n.value.endsWith(t.suffix) || n.issues.push({ - origin: "string", - code: "invalid_format", - format: "ends_with", - suffix: t.suffix, - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}); -function Vc(e, t, n) { - var r; - e.issues.length && (r = t.issues).push.apply(r, gn(Ms(n, e.issues))); -} -var Wc = ps("$ZodCheckProperty", function(e, t) { - wc.init(e, t), e._zod.check = function(e) { - var n = t.schema._zod.run({ - value: e.value[t.property], - issues: [] - }, {}); - if (n instanceof Promise) return n.then(function(n) { - return Vc(n, e, t.property); - }); - Vc(n, e, t.property); - }; -}), Kc = ps("$ZodCheckMimeType", function(e, t) { - wc.init(e, t); - var n = new Set(t.mime); - e._zod.onattach.push(function(e) { - e._zod.bag.mime = t.mime; - }), e._zod.check = function(r) { - n.has(r.value.type) || r.issues.push({ - code: "invalid_value", - values: t.mime, - input: r.value.type, - inst: e, - continue: !t.abort - }); - }; -}), Jc = ps("$ZodCheckOverwrite", function(e, t) { - wc.init(e, t), e._zod.check = function(e) { - e.value = t.tx(e.value); - }; -}), Qc = un(function e() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; - tn(this, e), this.content = [], this.indent = 0, this && (this.args = t); -}, [ - { - key: "indented", - value: function(e) { - this.indent += 1, e(this), this.indent -= 1; - } - }, - { - key: "write", - value: function(e) { - var t = this; - if ("function" == typeof e) return e(this, { execution: "sync" }), void e(this, { execution: "async" }); - var n, r = e.split("\n").filter(function(e) { - return e; - }), u = Math.min.apply(Math, gn(r.map(function(e) { - return e.length - e.trimStart().length; - }))), i = an(r.map(function(e) { - return e.slice(u); - }).map(function(e) { - return " ".repeat(2 * t.indent) + e; - })); - try { - for (i.s(); !(n = i.n()).done;) { - var o = n.value; - this.content.push(o); - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - } - }, - { - key: "compile", - value: function() { - var e, t = Function, n = null == this ? void 0 : this.args, r = gn((null !== (e = null == this ? void 0 : this.content) && void 0 !== e ? e : [""]).map(function(e) { - return " ".concat(e); - })); - return nn(t, gn(n).concat([r.join("\n")])); - } - } -]), Gc = { - major: 4, - minor: 1, - patch: 12 -}, Yc = ps("$ZodType", function(e, t) { - var n, r; - null != e || (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Gc; - var u = gn(null !== (n = e._zod.def.checks) && void 0 !== n ? n : []); - e._zod.traits.has("$ZodCheck") && u.unshift(e); - var a, i = an(u); - try { - for (i.s(); !(a = i.n()).done;) { - var o, s = an(a.value._zod.onattach); - try { - for (s.s(); !(o = s.n()).done;) (0, o.value)(e); - } catch (e) { - s.e(e); - } finally { - s.f(); - } - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - if (0 === u.length) { - var c, l; - null !== (c = (r = e._zod).deferred) && void 0 !== c || (r.deferred = []), null === (l = e._zod.deferred) || void 0 === l || l.push(function() { - e._zod.run = e._zod.parse; - }); - } else { - var f = function(e, t, n) { - var r, u, a = Rs(e), i = an(t); - try { - var o = function() { - var t = u.value; - if (t._zod.def.when) { - if (!t._zod.def.when(e)) return 0; - } else if (a) return 0; - var i = e.issues.length, o = t._zod.check(e); - if (o instanceof Promise && !1 === (null == n ? void 0 : n.async)) throw new hs(); - if (r || o instanceof Promise) r = (null != r ? r : Promise.resolve()).then(Xt(vn().m(function t() { - return vn().w(function(t) { - for (;;) switch (t.n) { - case 0: return t.n = 1, o; - case 1: - if (e.issues.length !== i) { - t.n = 2; - break; - } - return t.a(2); - case 2: a || (a = Rs(e, i)); - case 3: return t.a(2); - } - }, t); - }))); - else { - if (e.issues.length === i) return 0; - a || (a = Rs(e, i)); - } - }; - for (i.s(); !(u = i.n()).done;) o(); - } catch (e) { - i.e(e); - } finally { - i.f(); - } - return r ? r.then(function() { - return e; - }) : e; - }, d = function(t, n, r) { - if (Rs(t)) return t.aborted = !0, t; - var a = f(n, u, r); - if (a instanceof Promise) { - if (!1 === r.async) throw new hs(); - return a.then(function(t) { - return e._zod.parse(t, r); - }); - } - return e._zod.parse(a, r); - }; - e._zod.run = function(t, n) { - if (n.skipChecks) return e._zod.parse(t, n); - if ("backward" === n.direction) { - var r = e._zod.parse({ - value: t.value, - issues: [] - }, pn(pn({}, n), {}, { skipChecks: !0 })); - return r instanceof Promise ? r.then(function(e) { - return d(e, t, n); - }) : d(r, t, n); - } - var a = e._zod.parse(t, n); - if (a instanceof Promise) { - if (!1 === n.async) throw new hs(); - return a.then(function(e) { - return f(e, u, n); - }); - } - return f(a, u, n); - }; - } - e["~standard"] = { - validate: function(t) { - try { - var n, r = Gs(e, t); - return r.success ? { value: r.data } : { issues: null === (n = r.error) || void 0 === n ? void 0 : n.issues }; - } catch (n) { - return Xs(e, t).then(function(e) { - var t; - return e.success ? { value: e.data } : { issues: null === (t = e.error) || void 0 === t ? void 0 : t.issues }; - }); - } - }, - vendor: "zod", - version: 1 - }; -}), Xc = ps("$ZodString", function(e, t) { - var n, r, u; - Yc.init(e, t), e._zod.pattern = null !== (n = gn(null !== (r = null == e || null === (u = e._zod.bag) || void 0 === u ? void 0 : u.patterns) && void 0 !== r ? r : []).pop()) && void 0 !== n ? n : function(e) { - var t, n, r = e ? "[\\s\\S]{".concat(null !== (t = null == e ? void 0 : e.minimum) && void 0 !== t ? t : 0, ",").concat(null !== (n = null == e ? void 0 : e.maximum) && void 0 !== n ? n : "", "}") : "[\\s\\S]*"; - return new RegExp("^".concat(r, "$")); - }(e._zod.bag), e._zod.parse = function(n, r) { - if (t.coerce) try { - n.value = String(n.value); - } catch (r) {} - return "string" == typeof n.value || n.issues.push({ - expected: "string", - code: "invalid_type", - input: n.value, - inst: e - }), n; - }; -}), el = ps("$ZodStringFormat", function(e, t) { - Mc.init(e, t), Xc.init(e, t); -}), tl = ps("$ZodGUID", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = oc), el.init(e, t); -}), nl = ps("$ZodUUID", function(e, t) { - var n; - if (t.version) { - var r, u = { - v1: 1, - v2: 2, - v3: 3, - v4: 4, - v5: 5, - v6: 6, - v7: 7, - v8: 8 - }[t.version]; - if (void 0 === u) throw new Error("Invalid UUID version: \"".concat(t.version, "\"")); - null !== (r = t.pattern) && void 0 !== r || (t.pattern = sc(u)); - } else null !== (n = t.pattern) && void 0 !== n || (t.pattern = sc()); - el.init(e, t); -}), rl = ps("$ZodEmail", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = cc), el.init(e, t); -}), ul = ps("$ZodURL", function(e, t) { - el.init(e, t), e._zod.check = function(n) { - try { - var r = n.value.trim(), u = new URL(r); - t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(u.hostname) || n.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid hostname", - pattern: mc.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(u.protocol.endsWith(":") ? u.protocol.slice(0, -1) : u.protocol) || n.issues.push({ - code: "invalid_format", - format: "url", - note: "Invalid protocol", - pattern: t.protocol.source, - input: n.value, - inst: e, - continue: !t.abort - })), t.normalize ? n.value = u.href : n.value = r; - return; - } catch (r) { - n.issues.push({ - code: "invalid_format", - format: "url", - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}), al = ps("$ZodEmoji", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = /* @__PURE__ */ new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), el.init(e, t); -}), il = ps("$ZodNanoID", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = ac), el.init(e, t); -}), ol = ps("$ZodCUID", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = ec), el.init(e, t); -}), sl = ps("$ZodCUID2", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = tc), el.init(e, t); -}), cl = ps("$ZodULID", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = nc), el.init(e, t); -}), ll = ps("$ZodXID", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = rc), el.init(e, t); -}), fl = ps("$ZodKSUID", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = uc), el.init(e, t); -}), dl = ps("$ZodISODateTime", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = function(e) { - var t = Fc({ precision: e.precision }), n = ["Z"]; - e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)"); - var r = "".concat(t, "(?:").concat(n.join("|"), ")"); - return new RegExp("^".concat(yc, "T(?:").concat(r, ")$")); - }(t)), el.init(e, t); -}), pl = ps("$ZodISODate", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = gc), el.init(e, t); -}), hl = ps("$ZodISOTime", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = new RegExp("^".concat(Fc(t), "$"))), el.init(e, t); -}), vl = ps("$ZodISODuration", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = ic), el.init(e, t); -}), ml = ps("$ZodIPv4", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = lc), el.init(e, t), e._zod.onattach.push(function(e) { - e._zod.bag.format = "ipv4"; - }); -}), Dl = ps("$ZodIPv6", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = fc), el.init(e, t), e._zod.onattach.push(function(e) { - e._zod.bag.format = "ipv6"; - }), e._zod.check = function(n) { - try { - new URL("http://[".concat(n.value, "]")); - } catch (r) { - n.issues.push({ - code: "invalid_format", - format: "ipv6", - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}), yl = ps("$ZodCIDRv4", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = dc), el.init(e, t); -}), gl = ps("$ZodCIDRv6", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = pc), el.init(e, t), e._zod.check = function(n) { - var r = n.value.split("/"); - try { - if (2 !== r.length) throw new Error(); - var u = yn(r, 2), a = u[0], i = u[1]; - if (!i) throw new Error(); - var o = Number(i); - if ("".concat(o) !== i) throw new Error(); - if (o < 0 || o > 128) throw new Error(); - new URL("http://[".concat(a, "]")); - } catch (r) { - n.issues.push({ - code: "invalid_format", - format: "cidrv6", - input: n.value, - inst: e, - continue: !t.abort - }); - } - }; -}); -function Fl(e) { - if ("" === e) return !0; - if (e.length % 4 != 0) return !1; - try { - return atob(e), !0; - } catch (e) { - return !1; - } -} -var El = ps("$ZodBase64", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = hc), el.init(e, t), e._zod.onattach.push(function(e) { - e._zod.bag.contentEncoding = "base64"; - }), e._zod.check = function(n) { - Fl(n.value) || n.issues.push({ - code: "invalid_format", - format: "base64", - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}), bl = ps("$ZodBase64URL", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = vc), el.init(e, t), e._zod.onattach.push(function(e) { - e._zod.bag.contentEncoding = "base64url"; - }), e._zod.check = function(n) { - (function(e) { - if (!vc.test(e)) return !1; - var t = e.replace(/[-_]/g, function(e) { - return "-" === e ? "+" : "/"; - }); - return Fl(t.padEnd(4 * Math.ceil(t.length / 4), "=")); - })(n.value) || n.issues.push({ - code: "invalid_format", - format: "base64url", - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}), _l = ps("$ZodE164", function(e, t) { - var n; - null !== (n = t.pattern) && void 0 !== n || (t.pattern = Dc), el.init(e, t); -}), kl = ps("$ZodJWT", function(e, t) { - el.init(e, t), e._zod.check = function(n) { - (function(e) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : null; - try { - var n = e.split("."); - if (3 !== n.length) return !1; - var r = yn(n, 1)[0]; - if (!r) return !1; - var u = JSON.parse(atob(r)); - return !("typ" in u && "JWT" !== (null == u ? void 0 : u.typ) || !u.alg || t && (!("alg" in u) || u.alg !== t)); - } catch (e) { - return !1; - } - })(n.value, t.alg) || n.issues.push({ - code: "invalid_format", - format: "jwt", - input: n.value, - inst: e, - continue: !t.abort - }); - }; -}), Cl = ps("$ZodNumber", function(e, t) { - var n; - Yc.init(e, t), e._zod.pattern = null !== (n = e._zod.bag.pattern) && void 0 !== n ? n : bc, e._zod.parse = function(n, r) { - if (t.coerce) try { - n.value = Number(n.value); - } catch (e) {} - var u = n.value; - if ("number" == typeof u && !Number.isNaN(u) && Number.isFinite(u)) return n; - var a = "number" == typeof u ? Number.isNaN(u) ? "NaN" : Number.isFinite(u) ? void 0 : "Infinity" : void 0; - return n.issues.push(pn({ - expected: "number", - code: "invalid_type", - input: u, - inst: e - }, a ? { received: a } : {})), n; - }; -}), Al = ps("$ZodNumber", function(e, t) { - Ic.init(e, t), Cl.init(e, t); -}), wl = ps("$ZodBoolean", function(e, t) { - Yc.init(e, t), e._zod.pattern = _c, e._zod.parse = function(n, r) { - if (t.coerce) try { - n.value = Boolean(n.value); - } catch (e) {} - var u = n.value; - return "boolean" == typeof u || n.issues.push({ - expected: "boolean", - code: "invalid_type", - input: u, - inst: e - }), n; - }; -}), Sl = ps("$ZodNull", function(e, t) { - Yc.init(e, t), e._zod.pattern = kc, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = function(t, n) { - var r = t.value; - return null === r || t.issues.push({ - expected: "null", - code: "invalid_type", - input: r, - inst: e - }), t; - }; -}), xl = ps("$ZodUnknown", function(e, t) { - Yc.init(e, t), e._zod.parse = function(e) { - return e; - }; -}), Ol = ps("$ZodNever", function(e, t) { - Yc.init(e, t), e._zod.parse = function(t, n) { - return t.issues.push({ - expected: "never", - code: "invalid_type", - input: t.value, - inst: e - }), t; - }; -}); -function Bl(e, t, n) { - var r; - e.issues.length && (r = t.issues).push.apply(r, gn(Ms(n, e.issues))), t.value[n] = e.value; -} -var Il = ps("$ZodArray", function(e, t) { - Yc.init(e, t), e._zod.parse = function(n, r) { - var u = n.value; - if (!Array.isArray(u)) return n.issues.push({ - expected: "array", - code: "invalid_type", - input: u, - inst: e - }), n; - n.value = Array(u.length); - for (var a = [], i = function(e) { - var i = u[e], o = t.element._zod.run({ - value: i, - issues: [] - }, r); - o instanceof Promise ? a.push(o.then(function(t) { - return Bl(t, n, e); - })) : Bl(o, n, e); - }, o = 0; o < u.length; o++) i(o); - return a.length ? Promise.all(a).then(function() { - return n; - }) : n; - }; -}); -function Tl(e, t, n, r) { - var u; - e.issues.length && (u = t.issues).push.apply(u, gn(Ms(n, e.issues))), void 0 === e.value ? n in r && (t.value[n] = void 0) : t.value[n] = e.value; -} -function Pl(e) { - for (var t = Object.keys(e.shape), n = 0, r = t; n < r.length; n++) { - var u, a = r[n]; - if (null === (u = e.shape) || void 0 === u || null === (u = u[a]) || void 0 === u || null === (u = u._zod) || void 0 === u || null === (u = u.traits) || void 0 === u || !u.has("$ZodType")) throw new Error("Invalid element at key \"".concat(a, "\": expected a Zod schema")); - } - var i, o = (i = e.shape, Object.keys(i).filter(function(e) { - return "optional" === i[e]._zod.optin && "optional" === i[e]._zod.optout; - })); - return pn(pn({}, e), {}, { - keys: t, - keySet: new Set(t), - numKeys: t.length, - optionalKeys: new Set(o) - }); -} -function jl(e, t, n, r, u, a) { - for (var i = [], o = u.keySet, s = u.catchall._zod, c = s.def.type, l = function() { - var u = d[f]; - if (o.has(u)) return 0; - if ("never" === c) return i.push(u), 0; - var a = s.run({ - value: t[u], - issues: [] - }, r); - a instanceof Promise ? e.push(a.then(function(e) { - return Tl(e, n, u, t); - })) : Tl(a, n, u, t); - }, f = 0, d = Object.keys(t); f < d.length; f++) l(); - return i.length && n.issues.push({ - code: "unrecognized_keys", - keys: i, - input: t, - inst: a - }), e.length ? Promise.all(e).then(function() { - return n; - }) : n; -} -var Nl = ps("$ZodObject", function(e, t) { - Yc.init(e, t); - var n = Object.getOwnPropertyDescriptor(t, "shape"); - if (null == n || !n.get) { - var r = t.shape; - Object.defineProperty(t, "shape", { get: function() { - var e = pn({}, r); - return Object.defineProperty(t, "shape", { value: e }), e; - } }); - } - var u = Fs(function() { - return Pl(t); - }); - ks(e._zod, "propValues", function() { - var e = t.shape, n = {}; - for (var r in e) { - var u = e[r]._zod; - if (u.values) { - var a; - null !== (a = n[r]) && void 0 !== a || (n[r] = /* @__PURE__ */ new Set()); - var i, o = an(u.values); - try { - for (o.s(); !(i = o.n()).done;) { - var s = i.value; - n[r].add(s); - } - } catch (e) { - o.e(e); - } finally { - o.f(); - } - } - } - return n; - }); - var a, i = xs, o = t.catchall; - e._zod.parse = function(t, n) { - null != a || (a = u.value); - var r = t.value; - if (!i(r)) return t.issues.push({ - expected: "object", - code: "invalid_type", - input: r, - inst: e - }), t; - t.value = {}; - var s, c = [], l = a.shape, f = an(a.keys); - try { - var d = function() { - var e = s.value, u = l[e]._zod.run({ - value: r[e], - issues: [] - }, n); - u instanceof Promise ? c.push(u.then(function(n) { - return Tl(n, t, e, r); - })) : Tl(u, t, e, r); - }; - for (f.s(); !(s = f.n()).done;) d(); - } catch (e) { - f.e(e); - } finally { - f.f(); - } - return o ? jl(c, r, t, n, u.value, e) : c.length ? Promise.all(c).then(function() { - return t; - }) : t; - }; -}), zl = ps("$ZodObjectJIT", function(e, t) { - Nl.init(e, t); - var n, r, u = e._zod.parse, a = Fs(function() { - return Pl(t); - }), i = xs, o = !ms.jitless, s = o && Os.value, c = t.catchall; - e._zod.parse = function(l, f) { - null != r || (r = a.value); - var d = l.value; - return i(d) ? o && s && !1 === (null == f ? void 0 : f.async) && !0 !== f.jitless ? (n || (n = function(e) { - var t = new Qc([ - "shape", - "payload", - "ctx" - ]), n = a.value, r = function(e) { - var t = ws(e); - return "shape[".concat(t, "]._zod.run({ value: input[").concat(t, "], issues: [] }, ctx)"); - }; - t.write("const input = payload.value;"); - var u, i = Object.create(null), o = 0, s = an(n.keys); - try { - for (s.s(); !(u = s.n()).done;) i[u.value] = "key_".concat(o++); - } catch (e) { - s.e(e); - } finally { - s.f(); - } - t.write("const newResult = {};"); - var c, l = an(n.keys); - try { - for (l.s(); !(c = l.n()).done;) { - var f = c.value, d = i[f], p = ws(f); - t.write("const ".concat(d, " = ").concat(r(f), ";")), t.write("\n if (".concat(d, ".issues.length) {\n payload.issues = payload.issues.concat(").concat(d, ".issues.map(iss => ({\n ...iss,\n path: iss.path ? [").concat(p, ", ...iss.path] : [").concat(p, "]\n })));\n }\n \n \n if (").concat(d, ".value === undefined) {\n if (").concat(p, " in input) {\n newResult[").concat(p, "] = undefined;\n }\n } else {\n newResult[").concat(p, "] = ").concat(d, ".value;\n }\n \n ")); - } - } catch (e) { - l.e(e); - } finally { - l.f(); - } - t.write("payload.value = newResult;"), t.write("return payload;"); - var h = t.compile(); - return function(t, n) { - return h(e, t, n); - }; - }(t.shape)), l = n(l, f), c ? jl([], d, l, f, r, e) : l) : u(l, f) : (l.issues.push({ - expected: "object", - code: "invalid_type", - input: d, - inst: e - }), l); - }; -}); -function Rl(e, t, n, r) { - var u, a = an(e); - try { - for (a.s(); !(u = a.n()).done;) { - var i = u.value; - if (0 === i.issues.length) return t.value = i.value, t; - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - var o = e.filter(function(e) { - return !Rs(e); - }); - return 1 === o.length ? (t.value = o[0].value, o[0]) : (t.issues.push({ - code: "invalid_union", - input: t.value, - inst: n, - errors: e.map(function(e) { - return e.issues.map(function(e) { - return Ls(e, r, Ds()); - }); - }) - }), t); -} -var Ml = ps("$ZodUnion", function(e, t) { - Yc.init(e, t), ks(e._zod, "optin", function() { - return t.options.some(function(e) { - return "optional" === e._zod.optin; - }) ? "optional" : void 0; - }), ks(e._zod, "optout", function() { - return t.options.some(function(e) { - return "optional" === e._zod.optout; - }) ? "optional" : void 0; - }), ks(e._zod, "values", function() { - if (t.options.every(function(e) { - return e._zod.values; - })) return new Set(t.options.flatMap(function(e) { - return Array.from(e._zod.values); - })); - }), ks(e._zod, "pattern", function() { - if (t.options.every(function(e) { - return e._zod.pattern; - })) { - var e = t.options.map(function(e) { - return e._zod.pattern; - }); - return new RegExp("^(".concat(e.map(function(e) { - return bs(e.source); - }).join("|"), ")$")); - } - }); - var n = 1 === t.options.length, r = t.options[0]._zod.run; - e._zod.parse = function(u, a) { - if (n) return r(u, a); - var i, o = !1, s = [], c = an(t.options); - try { - for (c.s(); !(i = c.n()).done;) { - var l = i.value._zod.run({ - value: u.value, - issues: [] - }, a); - if (l instanceof Promise) s.push(l), o = !0; - else { - if (0 === l.issues.length) return l; - s.push(l); - } - } - } catch (e) { - c.e(e); - } finally { - c.f(); - } - return o ? Promise.all(s).then(function(t) { - return Rl(t, u, e, a); - }) : Rl(s, u, e, a); - }; -}), Zl = ps("$ZodDiscriminatedUnion", function(e, t) { - Ml.init(e, t); - var n = e._zod.parse; - ks(e._zod, "propValues", function() { - var e, n = {}, r = an(t.options); - try { - for (r.s(); !(e = r.n()).done;) { - var u = e.value, a = u._zod.propValues; - if (!a || 0 === Object.keys(a).length) throw new Error("Invalid discriminated union option at index \"".concat(t.options.indexOf(u), "\"")); - for (var i = 0, o = Object.entries(a); i < o.length; i++) { - var s = yn(o[i], 2), c = s[0], l = s[1]; - n[c] || (n[c] = /* @__PURE__ */ new Set()); - var f, d = an(l); - try { - for (d.s(); !(f = d.n()).done;) { - var p = f.value; - n[c].add(p); - } - } catch (e) { - d.e(e); - } finally { - d.f(); - } - } - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - return n; - }); - var r = Fs(function() { - var e, n = t.options, r = /* @__PURE__ */ new Map(), u = an(n); - try { - for (u.s(); !(e = u.n()).done;) { - var a, i = e.value, o = null === (a = i._zod.propValues) || void 0 === a ? void 0 : a[t.discriminator]; - if (!o || 0 === o.size) throw new Error("Invalid discriminated union option at index \"".concat(t.options.indexOf(i), "\"")); - var s, c = an(o); - try { - for (c.s(); !(s = c.n()).done;) { - var l = s.value; - if (r.has(l)) throw new Error("Duplicate discriminator value \"".concat(String(l), "\"")); - r.set(l, i); - } - } catch (e) { - c.e(e); - } finally { - c.f(); - } - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return r; - }); - e._zod.parse = function(u, a) { - var i = u.value; - if (!xs(i)) return u.issues.push({ - code: "invalid_type", - expected: "object", - input: i, - inst: e - }), u; - var o = r.value.get(null == i ? void 0 : i[t.discriminator]); - return o ? o._zod.run(u, a) : t.unionFallback ? n(u, a) : (u.issues.push({ - code: "invalid_union", - errors: [], - note: "No matching discriminator", - discriminator: t.discriminator, - input: i, - path: [t.discriminator], - inst: e - }), u); - }; -}), Ll = ps("$ZodIntersection", function(e, t) { - Yc.init(e, t), e._zod.parse = function(e, n) { - var r = e.value, u = t.left._zod.run({ - value: r, - issues: [] - }, n), a = t.right._zod.run({ - value: r, - issues: [] - }, n); - return u instanceof Promise || a instanceof Promise ? Promise.all([u, a]).then(function(t) { - var n = yn(t, 2), r = n[0], u = n[1]; - return ql(e, r, u); - }) : ql(e, u, a); - }; -}); -function $l(e, t) { - if (e === t) return { - valid: !0, - data: e - }; - if (e instanceof Date && t instanceof Date && +e === +t) return { - valid: !0, - data: e - }; - if (Bs(e) && Bs(t)) { - var n, r = Object.keys(t), u = Object.keys(e).filter(function(e) { - return -1 !== r.indexOf(e); - }), a = pn(pn({}, e), t), i = an(u); - try { - for (i.s(); !(n = i.n()).done;) { - var o = n.value, s = $l(e[o], t[o]); - if (!s.valid) return { - valid: !1, - mergeErrorPath: [o].concat(gn(s.mergeErrorPath)) - }; - a[o] = s.data; - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - return { - valid: !0, - data: a - }; - } - if (Array.isArray(e) && Array.isArray(t)) { - if (e.length !== t.length) return { - valid: !1, - mergeErrorPath: [] - }; - for (var c = [], l = 0; l < e.length; l++) { - var f = $l(e[l], t[l]); - if (!f.valid) return { - valid: !1, - mergeErrorPath: [l].concat(gn(f.mergeErrorPath)) - }; - c.push(f.data); - } - return { - valid: !0, - data: c - }; - } - return { - valid: !1, - mergeErrorPath: [] - }; -} -function ql(e, t, n) { - var r, u; - if (t.issues.length && (r = e.issues).push.apply(r, gn(t.issues)), n.issues.length && (u = e.issues).push.apply(u, gn(n.issues)), Rs(e)) return e; - var a = $l(t.value, n.value); - if (!a.valid) throw new Error("Unmergable intersection. Error path: " + "".concat(JSON.stringify(a.mergeErrorPath))); - return e.value = a.data, e; -} -var Ul = ps("$ZodRecord", function(e, t) { - Yc.init(e, t), e._zod.parse = function(n, r) { - var u = n.value; - if (!Bs(u)) return n.issues.push({ - expected: "record", - code: "invalid_type", - input: u, - inst: e - }), n; - var a = []; - if (t.keyType._zod.values) { - var i = t.keyType._zod.values; - n.value = {}; - var o, s, c = an(i); - try { - var l = function() { - var e = o.value; - if ("string" == typeof e || "number" == typeof e || "symbol" === En(e)) { - var i, s = t.valueType._zod.run({ - value: u[e], - issues: [] - }, r); - if (s instanceof Promise) a.push(s.then(function(t) { - var r; - t.issues.length && (r = n.issues).push.apply(r, gn(Ms(e, t.issues))), n.value[e] = t.value; - })); - else s.issues.length && (i = n.issues).push.apply(i, gn(Ms(e, s.issues))), n.value[e] = s.value; - } - }; - for (c.s(); !(o = c.n()).done;) l(); - } catch (e) { - c.e(e); - } finally { - c.f(); - } - for (var f in u) i.has(f) || (s = null != s ? s : []).push(f); - s && s.length > 0 && n.issues.push({ - code: "unrecognized_keys", - input: u, - inst: e, - keys: s - }); - } else { - n.value = {}; - var d, p = an(Reflect.ownKeys(u)); - try { - var h = function() { - var i = d.value; - if ("__proto__" === i) return 0; - var o = t.keyType._zod.run({ - value: i, - issues: [] - }, r); - if (o instanceof Promise) throw new Error("Async schemas not supported in object keys currently"); - if (o.issues.length) return n.issues.push({ - code: "invalid_key", - origin: "record", - issues: o.issues.map(function(e) { - return Ls(e, r, Ds()); - }), - input: i, - path: [i], - inst: e - }), n.value[o.value] = o.value, 0; - var s, c = t.valueType._zod.run({ - value: u[i], - issues: [] - }, r); - c instanceof Promise ? a.push(c.then(function(e) { - var t; - e.issues.length && (t = n.issues).push.apply(t, gn(Ms(i, e.issues))), n.value[o.value] = e.value; - })) : (c.issues.length && (s = n.issues).push.apply(s, gn(Ms(i, c.issues))), n.value[o.value] = c.value); - }; - for (p.s(); !(d = p.n()).done;) h(); - } catch (e) { - p.e(e); - } finally { - p.f(); - } - } - return a.length ? Promise.all(a).then(function() { - return n; - }) : n; - }; -}), Hl = ps("$ZodEnum", function(e, t) { - Yc.init(e, t); - var n = ys(t.entries), r = new Set(n); - e._zod.values = r, e._zod.pattern = new RegExp("^(".concat(n.filter(function(e) { - return Ts.has(En(e)); - }).map(function(e) { - return "string" == typeof e ? Ps(e) : e.toString(); - }).join("|"), ")$")), e._zod.parse = function(t, u) { - var a = t.value; - return r.has(a) || t.issues.push({ - code: "invalid_value", - values: n, - input: a, - inst: e - }), t; - }; -}), Vl = ps("$ZodLiteral", function(e, t) { - if (Yc.init(e, t), 0 === t.values.length) throw new Error("Cannot create literal schema with no valid values"); - e._zod.values = new Set(t.values), e._zod.pattern = new RegExp("^(".concat(t.values.map(function(e) { - return "string" == typeof e ? Ps(e) : e ? Ps(e.toString()) : String(e); - }).join("|"), ")$")), e._zod.parse = function(n, r) { - var u = n.value; - return e._zod.values.has(u) || n.issues.push({ - code: "invalid_value", - values: t.values, - input: u, - inst: e - }), n; - }; -}), Wl = ps("$ZodTransform", function(e, t) { - Yc.init(e, t), e._zod.parse = function(n, r) { - if ("backward" === r.direction) throw new vs(e.constructor.name); - var u = t.transform(n.value, n); - if (r.async) return (u instanceof Promise ? u : Promise.resolve(u)).then(function(e) { - return n.value = e, n; - }); - if (u instanceof Promise) throw new hs(); - return n.value = u, n; - }; -}); -function Kl(e, t) { - return e.issues.length && void 0 === t ? { - issues: [], - value: void 0 - } : e; -} -var Jl = ps("$ZodOptional", function(e, t) { - Yc.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", ks(e._zod, "values", function() { - return t.innerType._zod.values ? new Set([].concat(gn(t.innerType._zod.values), [void 0])) : void 0; - }), ks(e._zod, "pattern", function() { - var e = t.innerType._zod.pattern; - return e ? new RegExp("^(".concat(bs(e.source), ")?$")) : void 0; - }), e._zod.parse = function(e, n) { - if ("optional" === t.innerType._zod.optin) { - var r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(function(t) { - return Kl(t, e.value); - }) : Kl(r, e.value); - } - return void 0 === e.value ? e : t.innerType._zod.run(e, n); - }; -}), Ql = ps("$ZodNullable", function(e, t) { - Yc.init(e, t), ks(e._zod, "optin", function() { - return t.innerType._zod.optin; - }), ks(e._zod, "optout", function() { - return t.innerType._zod.optout; - }), ks(e._zod, "pattern", function() { - var e = t.innerType._zod.pattern; - return e ? new RegExp("^(".concat(bs(e.source), "|null)$")) : void 0; - }), ks(e._zod, "values", function() { - return t.innerType._zod.values ? new Set([].concat(gn(t.innerType._zod.values), [null])) : void 0; - }), e._zod.parse = function(e, n) { - return null === e.value ? e : t.innerType._zod.run(e, n); - }; -}), Gl = ps("$ZodDefault", function(e, t) { - Yc.init(e, t), e._zod.optin = "optional", ks(e._zod, "values", function() { - return t.innerType._zod.values; - }), e._zod.parse = function(e, n) { - if ("backward" === n.direction) return t.innerType._zod.run(e, n); - if (void 0 === e.value) return e.value = t.defaultValue, e; - var r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(function(e) { - return Yl(e, t); - }) : Yl(r, t); - }; -}); -function Yl(e, t) { - return void 0 === e.value && (e.value = t.defaultValue), e; -} -var Xl = ps("$ZodPrefault", function(e, t) { - Yc.init(e, t), e._zod.optin = "optional", ks(e._zod, "values", function() { - return t.innerType._zod.values; - }), e._zod.parse = function(e, n) { - return "backward" === n.direction || void 0 === e.value && (e.value = t.defaultValue), t.innerType._zod.run(e, n); - }; -}), ef = ps("$ZodNonOptional", function(e, t) { - Yc.init(e, t), ks(e._zod, "values", function() { - var e = t.innerType._zod.values; - return e ? new Set(gn(e).filter(function(e) { - return void 0 !== e; - })) : void 0; - }), e._zod.parse = function(n, r) { - var u = t.innerType._zod.run(n, r); - return u instanceof Promise ? u.then(function(t) { - return tf(t, e); - }) : tf(u, e); - }; -}); -function tf(e, t) { - return e.issues.length || void 0 !== e.value || e.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: e.value, - inst: t - }), e; -} -var nf = ps("$ZodCatch", function(e, t) { - Yc.init(e, t), ks(e._zod, "optin", function() { - return t.innerType._zod.optin; - }), ks(e._zod, "optout", function() { - return t.innerType._zod.optout; - }), ks(e._zod, "values", function() { - return t.innerType._zod.values; - }), e._zod.parse = function(e, n) { - if ("backward" === n.direction) return t.innerType._zod.run(e, n); - var r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(function(r) { - return e.value = r.value, r.issues.length && (e.value = t.catchValue(pn(pn({}, e), {}, { - error: { issues: r.issues.map(function(e) { - return Ls(e, n, Ds()); - }) }, - input: e.value - })), e.issues = []), e; - }) : (e.value = r.value, r.issues.length && (e.value = t.catchValue(pn(pn({}, e), {}, { - error: { issues: r.issues.map(function(e) { - return Ls(e, n, Ds()); - }) }, - input: e.value - })), e.issues = []), e); - }; -}), rf = ps("$ZodPipe", function(e, t) { - Yc.init(e, t), ks(e._zod, "values", function() { - return t.in._zod.values; - }), ks(e._zod, "optin", function() { - return t.in._zod.optin; - }), ks(e._zod, "optout", function() { - return t.out._zod.optout; - }), ks(e._zod, "propValues", function() { - return t.in._zod.propValues; - }), e._zod.parse = function(e, n) { - if ("backward" === n.direction) { - var r = t.out._zod.run(e, n); - return r instanceof Promise ? r.then(function(e) { - return uf(e, t.in, n); - }) : uf(r, t.in, n); - } - var u = t.in._zod.run(e, n); - return u instanceof Promise ? u.then(function(e) { - return uf(e, t.out, n); - }) : uf(u, t.out, n); - }; -}); -function uf(e, t, n) { - return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ - value: e.value, - issues: e.issues - }, n); -} -var af = ps("$ZodReadonly", function(e, t) { - Yc.init(e, t), ks(e._zod, "propValues", function() { - return t.innerType._zod.propValues; - }), ks(e._zod, "values", function() { - return t.innerType._zod.values; - }), ks(e._zod, "optin", function() { - return t.innerType._zod.optin; - }), ks(e._zod, "optout", function() { - return t.innerType._zod.optout; - }), e._zod.parse = function(e, n) { - if ("backward" === n.direction) return t.innerType._zod.run(e, n); - var r = t.innerType._zod.run(e, n); - return r instanceof Promise ? r.then(of) : of(r); - }; -}); -function of(e) { - return e.value = Object.freeze(e.value), e; -} -var sf = ps("$ZodLazy", function(e, t) { - Yc.init(e, t), ks(e._zod, "innerType", function() { - return t.getter(); - }), ks(e._zod, "pattern", function() { - return e._zod.innerType._zod.pattern; - }), ks(e._zod, "propValues", function() { - return e._zod.innerType._zod.propValues; - }), ks(e._zod, "optin", function() { - var t; - return null !== (t = e._zod.innerType._zod.optin) && void 0 !== t ? t : void 0; - }), ks(e._zod, "optout", function() { - var t; - return null !== (t = e._zod.innerType._zod.optout) && void 0 !== t ? t : void 0; - }), e._zod.parse = function(t, n) { - return e._zod.innerType._zod.run(t, n); - }; -}), cf = ps("$ZodCustom", function(e, t) { - wc.init(e, t), Yc.init(e, t), e._zod.parse = function(e, t) { - return e; - }, e._zod.check = function(n) { - var r = n.value, u = t.fn(r); - if (u instanceof Promise) return u.then(function(t) { - return lf(t, n, r, e); - }); - lf(u, n, r, e); - }; -}); -function lf(e, t, n, r) { - if (!e) { - var u, a = { - code: "custom", - input: n, - inst: r, - path: gn(null !== (u = r._zod.def.path) && void 0 !== u ? u : []), - continue: !r._zod.def.abort - }; - r._zod.def.params && (a.params = r._zod.def.params), t.issues.push(Us(a)); - } -} -var ff = un(function e() { - tn(this, e), this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(); -}, [ - { - key: "add", - value: function(e) { - var t = arguments.length <= 1 ? void 0 : arguments[1]; - if (this._map.set(e, t), t && "object" === En(t) && "id" in t) { - if (this._idmap.has(t.id)) throw new Error("ID ".concat(t.id, " already exists in the registry")); - this._idmap.set(t.id, e); - } - return this; - } - }, - { - key: "clear", - value: function() { - return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this; - } - }, - { - key: "remove", - value: function(e) { - var t = this._map.get(e); - return t && "object" === En(t) && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this; - } - }, - { - key: "get", - value: function(e) { - var t = e._zod.parent; - if (t) { - var n, r = pn({}, null !== (n = this.get(t)) && void 0 !== n ? n : {}); - delete r.id; - var u = pn(pn({}, r), this._map.get(e)); - return Object.keys(u).length ? u : void 0; - } - return this._map.get(e); - } - }, - { - key: "has", - value: function(e) { - return this._map.has(e); - } - } -]); -var df = new ff(); -function pf(e, t) { - return new e(pn({ - type: "string", - format: "guid", - check: "string_format", - abort: !1 - }, Ns(t))); -} -function hf(e, t) { - return new xc(pn(pn({ check: "less_than" }, Ns(t)), {}, { - value: e, - inclusive: !1 - })); -} -function vf(e, t) { - return new xc(pn(pn({ check: "less_than" }, Ns(t)), {}, { - value: e, - inclusive: !0 - })); -} -function mf(e, t) { - return new Oc(pn(pn({ check: "greater_than" }, Ns(t)), {}, { - value: e, - inclusive: !1 - })); -} -function Df(e, t) { - return new Oc(pn(pn({ check: "greater_than" }, Ns(t)), {}, { - value: e, - inclusive: !0 - })); -} -function yf(e, t) { - return new Bc(pn(pn({ check: "multiple_of" }, Ns(t)), {}, { value: e })); -} -function gf(e, t) { - return new Nc(pn(pn({ check: "max_length" }, Ns(t)), {}, { maximum: e })); -} -function Ff(e, t) { - return new zc(pn(pn({ check: "min_length" }, Ns(t)), {}, { minimum: e })); -} -function Ef(e, t) { - return new Rc(pn(pn({ check: "length_equals" }, Ns(t)), {}, { length: e })); -} -function bf(e, t) { - return new Zc(pn(pn({ - check: "string_format", - format: "regex" - }, Ns(t)), {}, { pattern: e })); -} -function _f(e) { - return new Lc(pn({ - check: "string_format", - format: "lowercase" - }, Ns(e))); -} -function kf(e) { - return new $c(pn({ - check: "string_format", - format: "uppercase" - }, Ns(e))); -} -function Cf(e, t) { - return new qc(pn(pn({ - check: "string_format", - format: "includes" - }, Ns(t)), {}, { includes: e })); -} -function Af(e, t) { - return new Uc(pn(pn({ - check: "string_format", - format: "starts_with" - }, Ns(t)), {}, { prefix: e })); -} -function wf(e, t) { - return new Hc(pn(pn({ - check: "string_format", - format: "ends_with" - }, Ns(t)), {}, { suffix: e })); -} -function Sf(e) { - return new Jc({ - check: "overwrite", - tx: e - }); -} -function xf(e) { - return Sf(function(t) { - return t.normalize(e); - }); -} -function Of() { - return Sf(function(e) { - return e.trim(); - }); -} -function Bf() { - return Sf(function(e) { - return e.toLowerCase(); - }); -} -function If() { - return Sf(function(e) { - return e.toUpperCase(); - }); -} -var Tf = un(function e(t) { - var n, r, u, a, i; - tn(this, e), this.counter = 0, this.metadataRegistry = null !== (n = null == t ? void 0 : t.metadata) && void 0 !== n ? n : df, this.target = null !== (r = null == t ? void 0 : t.target) && void 0 !== r ? r : "draft-2020-12", this.unrepresentable = null !== (u = null == t ? void 0 : t.unrepresentable) && void 0 !== u ? u : "throw", this.override = null !== (a = null == t ? void 0 : t.override) && void 0 !== a ? a : function() {}, this.io = null !== (i = null == t ? void 0 : t.io) && void 0 !== i ? i : "output", this.seen = /* @__PURE__ */ new Map(); -}, [{ - key: "process", - value: function(e) { - var t, n, r, u, a = this, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { - path: [], - schemaPath: [] - }, o = e._zod.def, s = this.seen.get(e); - if (s) return s.count++, i.schemaPath.includes(e) && (s.cycle = i.path), s.schema; - var c = { - schema: {}, - count: 1, - cycle: void 0, - path: i.path - }; - this.seen.set(e, c); - var l = null === (t = (n = e._zod).toJSONSchema) || void 0 === t ? void 0 : t.call(n); - if (l) c.schema = l; - else { - var f = pn(pn({}, i), {}, { - schemaPath: [].concat(gn(i.schemaPath), [e]), - path: i.path - }), d = e._zod.parent; - if (d) c.ref = d, this.process(d, f), this.seen.get(d).isParent = !0; - else { - var p = c.schema; - switch (o.type) { - case "string": - var h = p; - h.type = "string"; - var v, m = e._zod.bag, D = m.minimum, y = m.maximum, g = m.format, F = m.patterns, E = m.contentEncoding; - if ("number" == typeof D && (h.minLength = D), "number" == typeof y && (h.maxLength = y), g && (h.format = null !== (v = { - guid: "uuid", - url: "uri", - datetime: "date-time", - json_string: "json-string", - regex: "" - }[g]) && void 0 !== v ? v : g, "" === h.format && delete h.format), E && (h.contentEncoding = E), F && F.size > 0) { - var b = gn(F); - 1 === b.length ? h.pattern = b[0].source : b.length > 1 && (c.schema.allOf = gn(b.map(function(e) { - return pn(pn({}, "draft-7" === a.target || "draft-4" === a.target || "openapi-3.0" === a.target ? { type: "string" } : {}), {}, { pattern: e.source }); - }))); - } - break; - case "number": - var _ = p, k = e._zod.bag, C = k.minimum, A = k.maximum, w = k.format, S = k.multipleOf, x = k.exclusiveMaximum, O = k.exclusiveMinimum; - "string" == typeof w && w.includes("int") ? _.type = "integer" : _.type = "number", "number" == typeof O && ("draft-4" === this.target || "openapi-3.0" === this.target ? (_.minimum = O, _.exclusiveMinimum = !0) : _.exclusiveMinimum = O), "number" == typeof C && (_.minimum = C, "number" == typeof O && "draft-4" !== this.target && (O >= C ? delete _.minimum : delete _.exclusiveMinimum)), "number" == typeof x && ("draft-4" === this.target || "openapi-3.0" === this.target ? (_.maximum = x, _.exclusiveMaximum = !0) : _.exclusiveMaximum = x), "number" == typeof A && (_.maximum = A, "number" == typeof x && "draft-4" !== this.target && (x <= A ? delete _.maximum : delete _.exclusiveMaximum)), "number" == typeof S && (_.multipleOf = S); - break; - case "boolean": - case "success": - p.type = "boolean"; - break; - case "bigint": - if ("throw" === this.unrepresentable) throw new Error("BigInt cannot be represented in JSON Schema"); - break; - case "symbol": - if ("throw" === this.unrepresentable) throw new Error("Symbols cannot be represented in JSON Schema"); - break; - case "null": - "openapi-3.0" === this.target ? (p.type = "string", p.nullable = !0, p.enum = [null]) : p.type = "null"; - break; - case "any": - case "unknown": break; - case "undefined": - if ("throw" === this.unrepresentable) throw new Error("Undefined cannot be represented in JSON Schema"); - break; - case "void": - if ("throw" === this.unrepresentable) throw new Error("Void cannot be represented in JSON Schema"); - break; - case "never": - p.not = {}; - break; - case "date": - if ("throw" === this.unrepresentable) throw new Error("Date cannot be represented in JSON Schema"); - break; - case "array": - var B = p, I = e._zod.bag, T = I.minimum, P = I.maximum; - "number" == typeof T && (B.minItems = T), "number" == typeof P && (B.maxItems = P), B.type = "array", B.items = this.process(o.element, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["items"]) })); - break; - case "object": - var j, N = p; - N.type = "object", N.properties = {}; - var z = o.shape; - for (var R in z) N.properties[R] = this.process(z[R], pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["properties", R]) })); - var M = new Set(Object.keys(z)), Z = new Set(gn(M).filter(function(e) { - var t = o.shape[e]._zod; - return "input" === a.io ? void 0 === t.optin : void 0 === t.optout; - })); - Z.size > 0 && (N.required = Array.from(Z)), "never" === (null === (j = o.catchall) || void 0 === j ? void 0 : j._zod.def.type) ? N.additionalProperties = !1 : o.catchall ? o.catchall && (N.additionalProperties = this.process(o.catchall, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["additionalProperties"]) }))) : "output" === this.io && (N.additionalProperties = !1); - break; - case "union": - var L = p; - L.anyOf = o.options.map(function(e, t) { - return a.process(e, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["anyOf", t]) })); - }); - break; - case "intersection": - var q = p, U = this.process(o.left, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["allOf", 0]) })), H = this.process(o.right, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["allOf", 1]) })), V = function(e) { - return "allOf" in e && 1 === Object.keys(e).length; - }; - q.allOf = [].concat(gn(V(U) ? U.allOf : [U]), gn(V(H) ? H.allOf : [H])); - break; - case "tuple": - var K = p; - K.type = "array"; - var J = "draft-2020-12" === this.target ? "prefixItems" : "items", Q = "draft-2020-12" === this.target || "openapi-3.0" === this.target ? "items" : "additionalItems", G = o.items.map(function(e, t) { - return a.process(e, pn(pn({}, f), {}, { path: [].concat(gn(f.path), [J, t]) })); - }), Y = o.rest ? this.process(o.rest, pn(pn({}, f), {}, { path: [].concat(gn(f.path), [Q], gn("openapi-3.0" === this.target ? [o.items.length] : [])) })) : null; - "draft-2020-12" === this.target ? (K.prefixItems = G, Y && (K.items = Y)) : "openapi-3.0" === this.target ? (K.items = { anyOf: G }, Y && K.items.anyOf.push(Y), K.minItems = G.length, Y || (K.maxItems = G.length)) : (K.items = G, Y && (K.additionalItems = Y)); - var X = e._zod.bag, ee = X.minimum, te = X.maximum; - "number" == typeof ee && (K.minItems = ee), "number" == typeof te && (K.maxItems = te); - break; - case "record": - var ne = p; - ne.type = "object", "draft-7" !== this.target && "draft-2020-12" !== this.target || (ne.propertyNames = this.process(o.keyType, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["propertyNames"]) }))), ne.additionalProperties = this.process(o.valueType, pn(pn({}, f), {}, { path: [].concat(gn(f.path), ["additionalProperties"]) })); - break; - case "map": - if ("throw" === this.unrepresentable) throw new Error("Map cannot be represented in JSON Schema"); - break; - case "set": - if ("throw" === this.unrepresentable) throw new Error("Set cannot be represented in JSON Schema"); - break; - case "enum": - var re = p, ue = ys(o.entries); - ue.every(function(e) { - return "number" == typeof e; - }) && (re.type = "number"), ue.every(function(e) { - return "string" == typeof e; - }) && (re.type = "string"), re.enum = ue; - break; - case "literal": - var ae, ie = p, oe = [], se = an(o.values); - try { - for (se.s(); !(ae = se.n()).done;) { - var ce = ae.value; - if (void 0 === ce) { - if ("throw" === this.unrepresentable) throw new Error("Literal `undefined` cannot be represented in JSON Schema"); - } else if ("bigint" == typeof ce) { - if ("throw" === this.unrepresentable) throw new Error("BigInt literals cannot be represented in JSON Schema"); - oe.push(Number(ce)); - } else oe.push(ce); - } - } catch (e) { - se.e(e); - } finally { - se.f(); - } - if (0 === oe.length); - else if (1 === oe.length) { - var le = oe[0]; - ie.type = null === le ? "null" : En(le), "draft-4" === this.target || "openapi-3.0" === this.target ? ie.enum = [le] : ie.const = le; - } else oe.every(function(e) { - return "number" == typeof e; - }) && (ie.type = "number"), oe.every(function(e) { - return "string" == typeof e; - }) && (ie.type = "string"), oe.every(function(e) { - return "boolean" == typeof e; - }) && (ie.type = "string"), oe.every(function(e) { - return null === e; - }) && (ie.type = "null"), ie.enum = oe; - break; - case "file": - var fe = p, de = { - type: "string", - format: "binary", - contentEncoding: "binary" - }, pe = e._zod.bag, he = pe.minimum, ve = pe.maximum, me = pe.mime; - void 0 !== he && (de.minLength = he), void 0 !== ve && (de.maxLength = ve), me ? 1 === me.length ? (de.contentMediaType = me[0], Object.assign(fe, de)) : fe.anyOf = me.map(function(e) { - return pn(pn({}, de), {}, { contentMediaType: e }); - }) : Object.assign(fe, de); - break; - case "transform": - if ("throw" === this.unrepresentable) throw new Error("Transforms cannot be represented in JSON Schema"); - break; - case "nullable": - var De = this.process(o.innerType, f); - "openapi-3.0" === this.target ? (c.ref = o.innerType, p.nullable = !0) : p.anyOf = [De, { type: "null" }]; - break; - case "nonoptional": - case "promise": - case "optional": - this.process(o.innerType, f), c.ref = o.innerType; - break; - case "default": - this.process(o.innerType, f), c.ref = o.innerType, p.default = JSON.parse(JSON.stringify(o.defaultValue)); - break; - case "prefault": - this.process(o.innerType, f), c.ref = o.innerType, "input" === this.io && (p._prefault = JSON.parse(JSON.stringify(o.defaultValue))); - break; - case "catch": - var ye; - this.process(o.innerType, f), c.ref = o.innerType; - try { - ye = o.catchValue(void 0); - } catch (e) { - throw new Error("Dynamic catch values are not supported in JSON Schema"); - } - p.default = ye; - break; - case "nan": - if ("throw" === this.unrepresentable) throw new Error("NaN cannot be represented in JSON Schema"); - break; - case "template_literal": - var ge = p, Fe = e._zod.pattern; - if (!Fe) throw new Error("Pattern not found in template literal"); - ge.type = "string", ge.pattern = Fe.source; - break; - case "pipe": - var Ee = "input" === this.io ? "transform" === o.in._zod.def.type ? o.out : o.in : o.out; - this.process(Ee, f), c.ref = Ee; - break; - case "readonly": - this.process(o.innerType, f), c.ref = o.innerType, p.readOnly = !0; - break; - case "lazy": - var be = e._zod.innerType; - this.process(be, f), c.ref = be; - break; - case "custom": - if ("throw" === this.unrepresentable) throw new Error("Custom types cannot be represented in JSON Schema"); - break; - case "function": if ("throw" === this.unrepresentable) throw new Error("Function types cannot be represented in JSON Schema"); - } - } - } - var _e = this.metadataRegistry.get(e); - return _e && Object.assign(c.schema, _e), "input" === this.io && Pf(e) && (delete c.schema.examples, delete c.schema.default), "input" === this.io && c.schema._prefault && (null !== (r = (u = c.schema).default) && void 0 !== r || (u.default = c.schema._prefault)), delete c.schema._prefault, this.seen.get(e).schema; - } -}, { - key: "emit", - value: function(e, t) { - var n, r, u, a, i, o, s = this, c = { - cycles: null !== (n = null == t ? void 0 : t.cycles) && void 0 !== n ? n : "ref", - reused: null !== (r = null == t ? void 0 : t.reused) && void 0 !== r ? r : "inline", - external: null !== (u = null == t ? void 0 : t.external) && void 0 !== u ? u : void 0 - }, l = this.seen.get(e); - if (!l) throw new Error("Unprocessed schema. This is a bug in Zod."); - var f = function(e) { - if (!e[1].schema.$ref) { - var t = e[1], n = function(e) { - var t, n = "draft-2020-12" === s.target ? "$defs" : "definitions"; - if (c.external) { - var r, u, a, i, o = null === (r = c.external.registry.get(e[0])) || void 0 === r ? void 0 : r.id, f = null !== (u = c.external.uri) && void 0 !== u ? u : function(e) { - return e; - }; - if (o) return { ref: f(o) }; - var d = null !== (a = null !== (i = e[1].defId) && void 0 !== i ? i : e[1].schema.id) && void 0 !== a ? a : "schema".concat(s.counter++); - return e[1].defId = d, { - defId: d, - ref: "".concat(f("__shared"), "#/").concat(n, "/").concat(d) - }; - } - if (e[1] === l) return { ref: "#" }; - var p = "".concat("#", "/").concat(n, "/"), h = null !== (t = e[1].schema.id) && void 0 !== t ? t : "__schema".concat(s.counter++); - return { - defId: h, - ref: p + h - }; - }(e), r = n.ref, u = n.defId; - t.def = pn({}, t.schema), u && (t.defId = u); - var a = t.schema; - for (var i in a) delete a[i]; - a.$ref = r; - } - }; - if ("throw" === c.cycles) { - var d, p = an(this.seen.entries()); - try { - for (p.s(); !(d = p.n()).done;) { - var h, v = d.value[1]; - if (v.cycle) throw new Error("Cycle detected: " + "#/".concat(null === (h = v.cycle) || void 0 === h ? void 0 : h.join("/"), "/") + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs."); - } - } catch (e) { - p.e(e); - } finally { - p.f(); - } - } - var m, D = an(this.seen.entries()); - try { - for (D.s(); !(m = D.n()).done;) { - var y, g = m.value, F = g[1]; - if (e !== g[0]) { - if (c.external) { - var E, b = null === (E = c.external.registry.get(g[0])) || void 0 === E ? void 0 : E.id; - if (e !== g[0] && b) { - f(g); - continue; - } - } - (!(null === (y = this.metadataRegistry.get(g[0])) || void 0 === y) && y.id || F.cycle || F.count > 1 && "ref" === c.reused) && f(g); - } else f(g); - } - } catch (e) { - D.e(e); - } finally { - D.f(); - } - var _, k = function(e, t) { - var n, r, u = s.seen.get(e), a = null !== (n = u.def) && void 0 !== n ? n : u.schema, i = pn({}, a); - if (null !== u.ref) { - var o = u.ref; - if (u.ref = null, o) { - k(o, t); - var c, l = s.seen.get(o).schema; - !l.$ref || "draft-7" !== t.target && "draft-4" !== t.target && "openapi-3.0" !== t.target ? (Object.assign(a, l), Object.assign(a, i)) : (a.allOf = null !== (c = a.allOf) && void 0 !== c ? c : [], a.allOf.push(l)); - } - u.isParent || s.override({ - zodSchema: e, - jsonSchema: a, - path: null !== (r = u.path) && void 0 !== r ? r : [] - }); - } - }, C = an(gn(this.seen.entries()).reverse()); - try { - for (C.s(); !(_ = C.n()).done;) { - var A = _.value; - k(A[0], { target: this.target }); - } - } catch (e) { - C.e(e); - } finally { - C.f(); - } - var w = {}; - if ("draft-2020-12" === this.target ? w.$schema = "https://json-schema.org/draft/2020-12/schema" : "draft-7" === this.target ? w.$schema = "http://json-schema.org/draft-07/schema#" : "draft-4" === this.target ? w.$schema = "http://json-schema.org/draft-04/schema#" : "openapi-3.0" === this.target || console.warn("Invalid target: ".concat(this.target)), null !== (a = c.external) && void 0 !== a && a.uri) { - var S, x = null === (S = c.external.registry.get(e)) || void 0 === S ? void 0 : S.id; - if (!x) throw new Error("Schema is missing an `id` property"); - w.$id = c.external.uri(x); - } - Object.assign(w, l.def); - var O, B = null !== (i = null === (o = c.external) || void 0 === o ? void 0 : o.defs) && void 0 !== i ? i : {}, I = an(this.seen.entries()); - try { - for (I.s(); !(O = I.n()).done;) { - var T = O.value[1]; - T.def && T.defId && (B[T.defId] = T.def); - } - } catch (e) { - I.e(e); - } finally { - I.f(); - } - c.external || Object.keys(B).length > 0 && ("draft-2020-12" === this.target ? w.$defs = B : w.definitions = B); - try { - return JSON.parse(JSON.stringify(w)); - } catch (e) { - throw new Error("Error converting schema to JSON."); - } - } -}]); -function Pf(e, t) { - var n = null != t ? t : { seen: /* @__PURE__ */ new Set() }; - if (n.seen.has(e)) return !1; - n.seen.add(e); - var r = e._zod.def; - switch (r.type) { - case "string": - case "number": - case "bigint": - case "boolean": - case "date": - case "symbol": - case "undefined": - case "null": - case "any": - case "unknown": - case "never": - case "void": - case "literal": - case "enum": - case "nan": - case "file": - case "template_literal": - case "custom": - case "success": - case "catch": - case "function": return !1; - case "array": return Pf(r.element, n); - case "object": - for (var u in r.shape) if (Pf(r.shape[u], n)) return !0; - return !1; - case "union": - var a, i = an(r.options); - try { - for (i.s(); !(a = i.n()).done;) if (Pf(a.value, n)) return !0; - } catch (e) { - i.e(e); - } finally { - i.f(); - } - return !1; - case "intersection": return Pf(r.left, n) || Pf(r.right, n); - case "tuple": - var o, s = an(r.items); - try { - for (s.s(); !(o = s.n()).done;) if (Pf(o.value, n)) return !0; - } catch (e) { - s.e(e); - } finally { - s.f(); - } - return !(!r.rest || !Pf(r.rest, n)); - case "record": - case "map": return Pf(r.keyType, n) || Pf(r.valueType, n); - case "set": return Pf(r.valueType, n); - case "promise": - case "optional": - case "nonoptional": - case "nullable": - case "readonly": - case "default": - case "prefault": return Pf(r.innerType, n); - case "lazy": return Pf(r.getter(), n); - case "transform": return !0; - case "pipe": return Pf(r.in, n) || Pf(r.out, n); - } - throw new Error("Unknown schema type: ".concat(r.type)); -} -var jf = Object.freeze({ - __proto__: null, - endsWith: wf, - gt: mf, - gte: Df, - includes: Cf, - length: Ef, - lowercase: _f, - lt: hf, - lte: vf, - maxLength: gf, - maxSize: function(e, t) { - return new Tc(pn(pn({ check: "max_size" }, Ns(t)), {}, { maximum: e })); - }, - mime: function(e, t) { - return new Kc(pn({ - check: "mime_type", - mime: e - }, Ns(t))); - }, - minLength: Ff, - minSize: function(e, t) { - return new Pc(pn(pn({ check: "min_size" }, Ns(t)), {}, { minimum: e })); - }, - multipleOf: yf, - negative: function(e) { - return hf(0, e); - }, - nonnegative: function(e) { - return Df(0, e); - }, - nonpositive: function(e) { - return vf(0, e); - }, - normalize: xf, - overwrite: Sf, - positive: function(e) { - return mf(0, e); - }, - property: function(e, t, n) { - return new Wc(pn({ - check: "property", - property: e, - schema: t - }, Ns(n))); - }, - regex: bf, - size: function(e, t) { - return new jc(pn(pn({ check: "size_equals" }, Ns(t)), {}, { size: e })); - }, - startsWith: Af, - toLowerCase: Bf, - toUpperCase: If, - trim: Of, - uppercase: kf -}), Nf = ps("ZodISODateTime", function(e, t) { - dl.init(e, t), rd.init(e, t); -}); -var zf = ps("ZodISODate", function(e, t) { - pl.init(e, t), rd.init(e, t); -}); -var Rf = ps("ZodISOTime", function(e, t) { - hl.init(e, t), rd.init(e, t); -}); -var Mf = ps("ZodISODuration", function(e, t) { - vl.init(e, t), rd.init(e, t); -}); -var Zf = ps("ZodError", function(e, t) { - Vs.init(e, t), e.name = "ZodError", Object.defineProperties(e, { - format: { value: function(t) { - return function(e) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function(e) { - return e.message; - }, n = { _errors: [] }, r = function(e) { - var u, a = an(e.issues); - try { - for (a.s(); !(u = a.n()).done;) { - var i = u.value; - if ("invalid_union" === i.code && i.errors.length) i.errors.map(function(e) { - return r({ issues: e }); - }); - else if ("invalid_key" === i.code) r({ issues: i.issues }); - else if ("invalid_element" === i.code) r({ issues: i.issues }); - else if (0 === i.path.length) n._errors.push(t(i)); - else for (var o = n, s = 0; s < i.path.length;) { - var c = i.path[s]; - s === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], s++; - } - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - }; - return r(e), n; - }(e, t); - } }, - flatten: { value: function(t) { - return function(e) { - var t, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : function(e) { - return e.message; - }, r = {}, u = [], a = an(e.issues); - try { - for (a.s(); !(t = a.n()).done;) { - var i = t.value; - i.path.length > 0 ? (r[i.path[0]] = r[i.path[0]] || [], r[i.path[0]].push(n(i))) : u.push(n(i)); - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - return { - formErrors: u, - fieldErrors: r - }; - }(e, t); - } }, - addIssue: { value: function(t) { - e.issues.push(t), e.message = JSON.stringify(e.issues, gs, 2); - } }, - addIssues: { value: function(t) { - var n; - (n = e.issues).push.apply(n, gn(t)), e.message = JSON.stringify(e.issues, gs, 2); - } }, - isEmpty: { get: function() { - return 0 === e.issues.length; - } } - }); -}, { Parent: Error }), Lf = Ks(Zf), $f = Js(Zf), qf = Qs(Zf), Uf = Ys(Zf), Hf = function(e) { - return function(t, n, r) { - var u = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" }; - return Ks(e)(t, n, u); - }; -}(Zf), Vf = function(e) { - return function(t, n, r) { - return Ks(e)(t, n, r); - }; -}(Zf), Wf = function(e) { - return function() { - var t = Xt(vn().m(function t(n, r, u) { - var a; - return vn().w(function(t) { - for (;;) if (0 === t.n) return a = u ? Object.assign(u, { direction: "backward" }) : { direction: "backward" }, t.a(2, Js(e)(n, r, a)); - }, t); - })); - return function(e, n, r) { - return t.apply(this, arguments); - }; - }(); -}(Zf), Kf = function(e) { - return function() { - var t = Xt(vn().m(function t(n, r, u) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Js(e)(n, r, u)); - }, t); - })); - return function(e, n, r) { - return t.apply(this, arguments); - }; - }(); -}(Zf), Jf = function(e) { - return function(t, n, r) { - var u = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" }; - return Qs(e)(t, n, u); - }; -}(Zf), Qf = function(e) { - return function(t, n, r) { - return Qs(e)(t, n, r); - }; -}(Zf), Gf = function(e) { - return function() { - var t = Xt(vn().m(function t(n, r, u) { - var a; - return vn().w(function(t) { - for (;;) if (0 === t.n) return a = u ? Object.assign(u, { direction: "backward" }) : { direction: "backward" }, t.a(2, Ys(e)(n, r, a)); - }, t); - })); - return function(e, n, r) { - return t.apply(this, arguments); - }; - }(); -}(Zf), Yf = function(e) { - return function() { - var t = Xt(vn().m(function t(n, r, u) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Ys(e)(n, r, u)); - }, t); - })); - return function(e, n, r) { - return t.apply(this, arguments); - }; - }(); -}(Zf), Xf = ps("ZodType", function(e, t) { - return Yc.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = function() { - for (var n, r = arguments.length, u = new Array(r), a = 0; a < r; a++) u[a] = arguments[a]; - return e.clone(As(t, { checks: [].concat(gn(null !== (n = t.checks) && void 0 !== n ? n : []), gn(u.map(function(e) { - return "function" == typeof e ? { _zod: { - check: e, - def: { check: "custom" }, - onattach: [] - } } : e; - }))) })); - }, e.clone = function(t, n) { - return js(e, t, n); - }, e.brand = function() { - return e; - }, e.register = function(t, n) { - return t.add(e, n), e; - }, e.parse = function(t, n) { - return Lf(e, t, n, { callee: e.parse }); - }, e.safeParse = function(t, n) { - return qf(e, t, n); - }, e.parseAsync = function() { - var t = Xt(vn().m(function t(n, r) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, $f(e, n, r, { callee: e.parseAsync })); - }, t); - })); - return function(e, n) { - return t.apply(this, arguments); - }; - }(), e.safeParseAsync = function() { - var t = Xt(vn().m(function t(n, r) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Uf(e, n, r)); - }, t); - })); - return function(e, n) { - return t.apply(this, arguments); - }; - }(), e.spa = e.safeParseAsync, e.encode = function(t, n) { - return Hf(e, t, n); - }, e.decode = function(t, n) { - return Vf(e, t, n); - }, e.encodeAsync = function() { - var t = Xt(vn().m(function t(n, r) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Wf(e, n, r)); - }, t); - })); - return function(e, n) { - return t.apply(this, arguments); - }; - }(), e.decodeAsync = function() { - var t = Xt(vn().m(function t(n, r) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Kf(e, n, r)); - }, t); - })); - return function(e, n) { - return t.apply(this, arguments); - }; - }(), e.safeEncode = function(t, n) { - return Jf(e, t, n); - }, e.safeDecode = function(t, n) { - return Qf(e, t, n); - }, e.safeEncodeAsync = function() { - var t = Xt(vn().m(function t(n, r) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Gf(e, n, r)); - }, t); - })); - return function(e, n) { - return t.apply(this, arguments); - }; - }(), e.safeDecodeAsync = function() { - var t = Xt(vn().m(function t(n, r) { - return vn().w(function(t) { - for (;;) if (0 === t.n) return t.a(2, Yf(e, n, r)); - }, t); - })); - return function(e, n) { - return t.apply(this, arguments); - }; - }(), e.refine = function(t, n) { - return e.check(function(e) { - return function(e, t, n) { - return new fp(pn({ - type: "custom", - check: "custom", - fn: t - }, Ns(n))); - }(0, e, arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}); - }(t, n)); - }, e.superRefine = function(t) { - return e.check(function(e) { - var t = function(e) { - var t = new wc(pn({ check: "custom" }, Ns(void 0))); - return t._zod.check = e, t; - }(function(n) { - return n.addIssue = function(e) { - if ("string" == typeof e) n.issues.push(Us(e, n.value, t._zod.def)); - else { - var r, u, a, i, o = e; - o.fatal && (o.continue = !1), null !== (r = o.code) && void 0 !== r || (o.code = "custom"), null !== (u = o.input) && void 0 !== u || (o.input = n.value), null !== (a = o.inst) && void 0 !== a || (o.inst = t), null !== (i = o.continue) && void 0 !== i || (o.continue = !t._zod.def.abort), n.issues.push(Us(o)); - } - }, e(n.value, n); - }); - return t; - }(t)); - }, e.overwrite = function(t) { - return e.check(Sf(t)); - }, e.optional = function() { - return Yd(e); - }, e.nullable = function() { - return ep(e); - }, e.nullish = function() { - return Yd(ep(e)); - }, e.nonoptional = function(t) { - return function(e, t) { - return new rp(pn({ - type: "nonoptional", - innerType: e - }, Ns(t))); - }(e, t); - }, e.array = function() { - return Nd(e); - }, e.or = function(t) { - return Ld([e, t]); - }, e.and = function(t) { - return new qd({ - type: "intersection", - left: e, - right: t - }); - }, e.transform = function(t) { - return ip(e, new Qd({ - type: "transform", - transform: t - })); - }, e.default = function(t) { - return n = t, new tp({ - type: "default", - innerType: e, - get defaultValue() { - return "function" == typeof n ? n() : Is(n); - } - }); - var n; - }, e.prefault = function(t) { - return n = t, new np({ - type: "prefault", - innerType: e, - get defaultValue() { - return "function" == typeof n ? n() : Is(n); - } - }); - var n; - }, e.catch = function(t) { - return new up({ - type: "catch", - innerType: e, - catchValue: "function" == typeof (n = t) ? n : function() { - return n; - } - }); - var n; - }, e.pipe = function(t) { - return ip(e, t); - }, e.readonly = function() { - return new cp({ - type: "readonly", - innerType: e - }); - }, e.describe = function(t) { - var n = e.clone(); - return df.add(n, { description: t }), n; - }, Object.defineProperty(e, "description", { - get: function() { - var t; - return null === (t = df.get(e)) || void 0 === t ? void 0 : t.description; - }, - configurable: !0 - }), e.meta = function() { - if (0 === arguments.length) return df.get(e); - var t = e.clone(); - return df.add(t, arguments.length <= 0 ? void 0 : arguments[0]), t; - }, e.isOptional = function() { - return e.safeParse(void 0).success; - }, e.isNullable = function() { - return e.safeParse(null).success; - }, e; -}), ed = ps("_ZodString", function(e, t) { - var n, r, u; - Xc.init(e, t), Xf.init(e, t); - var a = e._zod.bag; - e.format = null !== (n = a.format) && void 0 !== n ? n : null, e.minLength = null !== (r = a.minimum) && void 0 !== r ? r : null, e.maxLength = null !== (u = a.maximum) && void 0 !== u ? u : null, e.regex = function() { - return e.check(bf.apply(jf, arguments)); - }, e.includes = function() { - return e.check(Cf.apply(jf, arguments)); - }, e.startsWith = function() { - return e.check(Af.apply(jf, arguments)); - }, e.endsWith = function() { - return e.check(wf.apply(jf, arguments)); - }, e.min = function() { - return e.check(Ff.apply(jf, arguments)); - }, e.max = function() { - return e.check(gf.apply(jf, arguments)); - }, e.length = function() { - return e.check(Ef.apply(jf, arguments)); - }, e.nonempty = function() { - for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; - return e.check(Ff.apply(jf, [1].concat(n))); - }, e.lowercase = function(t) { - return e.check(_f(t)); - }, e.uppercase = function(t) { - return e.check(kf(t)); - }, e.trim = function() { - return e.check(Of()); - }, e.normalize = function() { - return e.check(xf.apply(jf, arguments)); - }, e.toLowerCase = function() { - return e.check(Bf()); - }, e.toUpperCase = function() { - return e.check(If()); - }; -}), td = ps("ZodString", function(e, t) { - Xc.init(e, t), ed.init(e, t), e.email = function(t) { - return e.check(function(e, t) { - return new ud(pn({ - type: "string", - format: "email", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.url = function(t) { - return e.check(function(e, t) { - return new od(pn({ - type: "string", - format: "url", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.jwt = function(t) { - return e.check(function(e, t) { - return new bd(pn({ - type: "string", - format: "jwt", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.emoji = function(t) { - return e.check(function(e, t) { - return new sd(pn({ - type: "string", - format: "emoji", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.guid = function(t) { - return e.check(pf(ad, t)); - }, e.uuid = function(t) { - return e.check(function(e, t) { - return new id(pn({ - type: "string", - format: "uuid", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.uuidv4 = function(t) { - return e.check(function(e, t) { - return new id(pn({ - type: "string", - format: "uuid", - check: "string_format", - abort: !1, - version: "v4" - }, Ns(t))); - }(0, t)); - }, e.uuidv6 = function(t) { - return e.check(function(e, t) { - return new id(pn({ - type: "string", - format: "uuid", - check: "string_format", - abort: !1, - version: "v6" - }, Ns(t))); - }(0, t)); - }, e.uuidv7 = function(t) { - return e.check(function(e, t) { - return new id(pn({ - type: "string", - format: "uuid", - check: "string_format", - abort: !1, - version: "v7" - }, Ns(t))); - }(0, t)); - }, e.nanoid = function(t) { - return e.check(function(e, t) { - return new cd(pn({ - type: "string", - format: "nanoid", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.guid = function(t) { - return e.check(pf(ad, t)); - }, e.cuid = function(t) { - return e.check(function(e, t) { - return new ld(pn({ - type: "string", - format: "cuid", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.cuid2 = function(t) { - return e.check(function(e, t) { - return new fd(pn({ - type: "string", - format: "cuid2", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.ulid = function(t) { - return e.check(function(e, t) { - return new dd(pn({ - type: "string", - format: "ulid", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.base64 = function(t) { - return e.check(function(e, t) { - return new gd(pn({ - type: "string", - format: "base64", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.base64url = function(t) { - return e.check(function(e, t) { - return new Fd(pn({ - type: "string", - format: "base64url", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.xid = function(t) { - return e.check(function(e, t) { - return new pd(pn({ - type: "string", - format: "xid", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.ksuid = function(t) { - return e.check(function(e, t) { - return new hd(pn({ - type: "string", - format: "ksuid", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.ipv4 = function(t) { - return e.check(function(e, t) { - return new vd(pn({ - type: "string", - format: "ipv4", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.ipv6 = function(t) { - return e.check(function(e, t) { - return new md(pn({ - type: "string", - format: "ipv6", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.cidrv4 = function(t) { - return e.check(function(e, t) { - return new Dd(pn({ - type: "string", - format: "cidrv4", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.cidrv6 = function(t) { - return e.check(function(e, t) { - return new yd(pn({ - type: "string", - format: "cidrv6", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.e164 = function(t) { - return e.check(function(e, t) { - return new Ed(pn({ - type: "string", - format: "e164", - check: "string_format", - abort: !1 - }, Ns(t))); - }(0, t)); - }, e.datetime = function(t) { - return e.check(function(e) { - return function(e, t) { - return new Nf(pn({ - type: "string", - format: "datetime", - check: "string_format", - offset: !1, - local: !1, - precision: null - }, Ns(t))); - }(0, e); - }(t)); - }, e.date = function(t) { - return e.check(function(e) { - return function(e, t) { - return new zf(pn({ - type: "string", - format: "date", - check: "string_format" - }, Ns(t))); - }(0, e); - }(t)); - }, e.time = function(t) { - return e.check(function(e) { - return function(e, t) { - return new Rf(pn({ - type: "string", - format: "time", - check: "string_format", - precision: null - }, Ns(t))); - }(0, e); - }(t)); - }, e.duration = function(t) { - return e.check(function(e) { - return function(e, t) { - return new Mf(pn({ - type: "string", - format: "duration", - check: "string_format" - }, Ns(t))); - }(0, e); - }(t)); - }; -}); -function nd(e) { - return function(e, t) { - return new td(pn({ type: "string" }, Ns(t))); - }(0, e); -} -var rd = ps("ZodStringFormat", function(e, t) { - el.init(e, t), ed.init(e, t); -}), ud = ps("ZodEmail", function(e, t) { - rl.init(e, t), rd.init(e, t); -}), ad = ps("ZodGUID", function(e, t) { - tl.init(e, t), rd.init(e, t); -}), id = ps("ZodUUID", function(e, t) { - nl.init(e, t), rd.init(e, t); -}), od = ps("ZodURL", function(e, t) { - ul.init(e, t), rd.init(e, t); -}), sd = ps("ZodEmoji", function(e, t) { - al.init(e, t), rd.init(e, t); -}), cd = ps("ZodNanoID", function(e, t) { - il.init(e, t), rd.init(e, t); -}), ld = ps("ZodCUID", function(e, t) { - ol.init(e, t), rd.init(e, t); -}), fd = ps("ZodCUID2", function(e, t) { - sl.init(e, t), rd.init(e, t); -}), dd = ps("ZodULID", function(e, t) { - cl.init(e, t), rd.init(e, t); -}), pd = ps("ZodXID", function(e, t) { - ll.init(e, t), rd.init(e, t); -}), hd = ps("ZodKSUID", function(e, t) { - fl.init(e, t), rd.init(e, t); -}), vd = ps("ZodIPv4", function(e, t) { - ml.init(e, t), rd.init(e, t); -}), md = ps("ZodIPv6", function(e, t) { - Dl.init(e, t), rd.init(e, t); -}), Dd = ps("ZodCIDRv4", function(e, t) { - yl.init(e, t), rd.init(e, t); -}), yd = ps("ZodCIDRv6", function(e, t) { - gl.init(e, t), rd.init(e, t); -}), gd = ps("ZodBase64", function(e, t) { - El.init(e, t), rd.init(e, t); -}), Fd = ps("ZodBase64URL", function(e, t) { - bl.init(e, t), rd.init(e, t); -}), Ed = ps("ZodE164", function(e, t) { - _l.init(e, t), rd.init(e, t); -}), bd = ps("ZodJWT", function(e, t) { - kl.init(e, t), rd.init(e, t); -}), _d = ps("ZodNumber", function(e, t) { - var n, r, u, a, i, o, s, c, l; - Cl.init(e, t), Xf.init(e, t), e.gt = function(t, n) { - return e.check(mf(t, n)); - }, e.gte = function(t, n) { - return e.check(Df(t, n)); - }, e.min = function(t, n) { - return e.check(Df(t, n)); - }, e.lt = function(t, n) { - return e.check(hf(t, n)); - }, e.lte = function(t, n) { - return e.check(vf(t, n)); - }, e.max = function(t, n) { - return e.check(vf(t, n)); - }, e.int = function(t) { - return e.check(Ad(t)); - }, e.safe = function(t) { - return e.check(Ad(t)); - }, e.positive = function(t) { - return e.check(mf(0, t)); - }, e.nonnegative = function(t) { - return e.check(Df(0, t)); - }, e.negative = function(t) { - return e.check(hf(0, t)); - }, e.nonpositive = function(t) { - return e.check(vf(0, t)); - }, e.multipleOf = function(t, n) { - return e.check(yf(t, n)); - }, e.step = function(t, n) { - return e.check(yf(t, n)); - }, e.finite = function() { - return e; - }; - var f = e._zod.bag; - e.minValue = null !== (n = Math.max(null !== (r = f.minimum) && void 0 !== r ? r : Number.NEGATIVE_INFINITY, null !== (u = f.exclusiveMinimum) && void 0 !== u ? u : Number.NEGATIVE_INFINITY)) && void 0 !== n ? n : null, e.maxValue = null !== (a = Math.min(null !== (i = f.maximum) && void 0 !== i ? i : Number.POSITIVE_INFINITY, null !== (o = f.exclusiveMaximum) && void 0 !== o ? o : Number.POSITIVE_INFINITY)) && void 0 !== a ? a : null, e.isInt = (null !== (s = f.format) && void 0 !== s ? s : "").includes("int") || Number.isSafeInteger(null !== (c = f.multipleOf) && void 0 !== c ? c : .5), e.isFinite = !0, e.format = null !== (l = f.format) && void 0 !== l ? l : null; -}); -function kd(e) { - return function(e, t) { - return new _d(pn({ - type: "number", - checks: [] - }, Ns(t))); - }(0, e); -} -var Cd = ps("ZodNumberFormat", function(e, t) { - Al.init(e, t), _d.init(e, t); -}); -function Ad(e) { - return function(e, t) { - return new Cd(pn({ - type: "number", - check: "number_format", - abort: !1, - format: "safeint" - }, Ns(t))); - }(0, e); -} -var wd = ps("ZodBoolean", function(e, t) { - wl.init(e, t), Xf.init(e, t); -}); -function Sd(e) { - return function(e, t) { - return new wd(pn({ type: "boolean" }, Ns(t))); - }(0, e); -} -var xd = ps("ZodNull", function(e, t) { - Sl.init(e, t), Xf.init(e, t); -}); -function Od(e) { - return function(e, t) { - return new xd(pn({ type: "null" }, Ns(t))); - }(0, e); -} -var Bd = ps("ZodUnknown", function(e, t) { - xl.init(e, t), Xf.init(e, t); -}); -function Id() { - return new Bd({ type: "unknown" }); -} -var Td = ps("ZodNever", function(e, t) { - Ol.init(e, t), Xf.init(e, t); -}); -function Pd(e) { - return function(e, t) { - return new Td(pn({ type: "never" }, Ns(t))); - }(0, e); -} -var jd = ps("ZodArray", function(e, t) { - Il.init(e, t), Xf.init(e, t), e.element = t.element, e.min = function(t, n) { - return e.check(Ff(t, n)); - }, e.nonempty = function(t) { - return e.check(Ff(1, t)); - }, e.max = function(t, n) { - return e.check(gf(t, n)); - }, e.length = function(t, n) { - return e.check(Ef(t, n)); - }, e.unwrap = function() { - return e.element; - }; -}); -function Nd(e, t) { - return function(e, t, n) { - return new jd(pn({ - type: "array", - element: t - }, Ns(n))); - }(0, e, t); -} -var zd = ps("ZodObject", function(e, t) { - zl.init(e, t), Xf.init(e, t), ks(e, "shape", function() { - return t.shape; - }), e.keyof = function() { - return Wd(Object.keys(e._zod.def.shape)); - }, e.catchall = function(t) { - return e.clone(pn(pn({}, e._zod.def), {}, { catchall: t })); - }, e.passthrough = function() { - return e.clone(pn(pn({}, e._zod.def), {}, { catchall: Id() })); - }, e.loose = function() { - return e.clone(pn(pn({}, e._zod.def), {}, { catchall: Id() })); - }, e.strict = function() { - return e.clone(pn(pn({}, e._zod.def), {}, { catchall: Pd() })); - }, e.strip = function() { - return e.clone(pn(pn({}, e._zod.def), {}, { catchall: void 0 })); - }, e.extend = function(t) { - return function(e, t) { - if (!Bs(t)) throw new Error("Invalid input to extend: expected a plain object"); - var n = e._zod.def.checks; - if (n && n.length > 0) throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead."); - return js(e, As(e._zod.def, { - get shape() { - var n = pn(pn({}, e._zod.def.shape), t); - return Cs(this, "shape", n), n; - }, - checks: [] - })); - }(e, t); - }, e.safeExtend = function(t) { - return function(e, t) { - if (!Bs(t)) throw new Error("Invalid input to safeExtend: expected a plain object"); - return js(e, pn(pn({}, e._zod.def), {}, { - get shape() { - var n = pn(pn({}, e._zod.def.shape), t); - return Cs(this, "shape", n), n; - }, - checks: e._zod.def.checks - })); - }(e, t); - }, e.merge = function(t) { - return function(e, t) { - return js(e, As(e._zod.def, { - get shape() { - var n = pn(pn({}, e._zod.def.shape), t._zod.def.shape); - return Cs(this, "shape", n), n; - }, - get catchall() { - return t._zod.def.catchall; - }, - checks: [] - })); - }(e, t); - }, e.pick = function(t) { - return function(e, t) { - var n = e._zod.def; - return js(e, As(e._zod.def, { - get shape() { - var e = {}; - for (var r in t) { - if (!(r in n.shape)) throw new Error("Unrecognized key: \"".concat(r, "\"")); - t[r] && (e[r] = n.shape[r]); - } - return Cs(this, "shape", e), e; - }, - checks: [] - })); - }(e, t); - }, e.omit = function(t) { - return function(e, t) { - var n = e._zod.def; - return js(e, As(e._zod.def, { - get shape() { - var r = pn({}, e._zod.def.shape); - for (var u in t) { - if (!(u in n.shape)) throw new Error("Unrecognized key: \"".concat(u, "\"")); - t[u] && delete r[u]; - } - return Cs(this, "shape", r), r; - }, - checks: [] - })); - }(e, t); - }, e.partial = function() { - return function(e, t, n) { - return js(t, As(t._zod.def, { - get shape() { - var r = t._zod.def.shape, u = pn({}, r); - if (n) for (var a in n) { - if (!(a in r)) throw new Error("Unrecognized key: \"".concat(a, "\"")); - n[a] && (u[a] = e ? new e({ - type: "optional", - innerType: r[a] - }) : r[a]); - } - else for (var i in r) u[i] = e ? new e({ - type: "optional", - innerType: r[i] - }) : r[i]; - return Cs(this, "shape", u), u; - }, - checks: [] - })); - }(Gd, e, arguments.length <= 0 ? void 0 : arguments[0]); - }, e.required = function() { - return function(e, t, n) { - return js(t, As(t._zod.def, { - get shape() { - var r = t._zod.def.shape, u = pn({}, r); - if (n) for (var a in n) { - if (!(a in u)) throw new Error("Unrecognized key: \"".concat(a, "\"")); - n[a] && (u[a] = new e({ - type: "nonoptional", - innerType: r[a] - })); - } - else for (var i in r) u[i] = new e({ - type: "nonoptional", - innerType: r[i] - }); - return Cs(this, "shape", u), u; - }, - checks: [] - })); - }(rp, e, arguments.length <= 0 ? void 0 : arguments[0]); - }; -}); -function Rd(e, t) { - return new zd(pn({ - type: "object", - shape: null != e ? e : {} - }, Ns(t))); -} -function Md(e, t) { - return new zd(pn({ - type: "object", - shape: e, - catchall: Pd() - }, Ns(t))); -} -var Zd = ps("ZodUnion", function(e, t) { - Ml.init(e, t), Xf.init(e, t), e.options = t.options; -}); -function Ld(e, t) { - return new Zd(pn({ - type: "union", - options: e - }, Ns(t))); -} -var $d = ps("ZodDiscriminatedUnion", function(e, t) { - Zd.init(e, t), Zl.init(e, t); -}), qd = ps("ZodIntersection", function(e, t) { - Ll.init(e, t), Xf.init(e, t); -}), Ud = ps("ZodRecord", function(e, t) { - Ul.init(e, t), Xf.init(e, t), e.keyType = t.keyType, e.valueType = t.valueType; -}); -function Hd(e, t, n) { - return new Ud(pn({ - type: "record", - keyType: e, - valueType: t - }, Ns(n))); -} -var Vd = ps("ZodEnum", function(e, t) { - Hl.init(e, t), Xf.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries); - var n = new Set(Object.keys(t.entries)); - e.extract = function(e, r) { - var u, a = {}, i = an(e); - try { - for (i.s(); !(u = i.n()).done;) { - var o = u.value; - if (!n.has(o)) throw new Error("Key ".concat(o, " not found in enum")); - a[o] = t.entries[o]; - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - return new Vd(pn(pn(pn({}, t), {}, { checks: [] }, Ns(r)), {}, { entries: a })); - }, e.exclude = function(e, r) { - var u, a = pn({}, t.entries), i = an(e); - try { - for (i.s(); !(u = i.n()).done;) { - var o = u.value; - if (!n.has(o)) throw new Error("Key ".concat(o, " not found in enum")); - delete a[o]; - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - return new Vd(pn(pn(pn({}, t), {}, { checks: [] }, Ns(r)), {}, { entries: a })); - }; -}); -function Wd(e, t) { - return new Vd(pn({ - type: "enum", - entries: Array.isArray(e) ? Object.fromEntries(e.map(function(e) { - return [e, e]; - })) : e - }, Ns(t))); -} -var Kd = ps("ZodLiteral", function(e, t) { - Vl.init(e, t), Xf.init(e, t), e.values = new Set(t.values), Object.defineProperty(e, "value", { get: function() { - if (t.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); - return t.values[0]; - } }); -}); -function Jd(e, t) { - return new Kd(pn({ - type: "literal", - values: Array.isArray(e) ? e : [e] - }, Ns(t))); -} -var Qd = ps("ZodTransform", function(e, t) { - Wl.init(e, t), Xf.init(e, t), e._zod.parse = function(n, r) { - if ("backward" === r.direction) throw new vs(e.constructor.name); - n.addIssue = function(r) { - if ("string" == typeof r) n.issues.push(Us(r, n.value, t)); - else { - var u, a, i, o = r; - o.fatal && (o.continue = !1), null !== (u = o.code) && void 0 !== u || (o.code = "custom"), null !== (a = o.input) && void 0 !== a || (o.input = n.value), null !== (i = o.inst) && void 0 !== i || (o.inst = e), n.issues.push(Us(o)); - } - }; - var u = t.transform(n.value, n); - return u instanceof Promise ? u.then(function(e) { - return n.value = e, n; - }) : (n.value = u, n); - }; -}), Gd = ps("ZodOptional", function(e, t) { - Jl.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }; -}); -function Yd(e) { - return new Gd({ - type: "optional", - innerType: e - }); -} -var Xd = ps("ZodNullable", function(e, t) { - Ql.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }; -}); -function ep(e) { - return new Xd({ - type: "nullable", - innerType: e - }); -} -var tp = ps("ZodDefault", function(e, t) { - Gl.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }, e.removeDefault = e.unwrap; -}), np = ps("ZodPrefault", function(e, t) { - Xl.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }; -}), rp = ps("ZodNonOptional", function(e, t) { - ef.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }; -}), up = ps("ZodCatch", function(e, t) { - nf.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }, e.removeCatch = e.unwrap; -}), ap = ps("ZodPipe", function(e, t) { - rf.init(e, t), Xf.init(e, t), e.in = t.in, e.out = t.out; -}); -function ip(e, t) { - return new ap({ - type: "pipe", - in: e, - out: t - }); -} -var op, sp, cp = ps("ZodReadonly", function(e, t) { - af.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.innerType; - }; -}), lp = ps("ZodLazy", function(e, t) { - sf.init(e, t), Xf.init(e, t), e.unwrap = function() { - return e._zod.def.getter(); - }; -}), fp = ps("ZodCustom", function(e, t) { - cf.init(e, t), Xf.init(e, t); -}); -function dp(e, t) { - return function(e, t, n) { - var r, u = Ns(n); - return null !== (r = u.abort) && void 0 !== r || (u.abort = !0), new e(pn({ - type: "custom", - check: "custom", - fn: t - }, u)); - }(fp, null != e ? e : function() { - return !0; - }, t); -} -function pp(e) { - var n = new fp(pn({ - type: "custom", - check: "custom", - fn: function(t) { - return t instanceof e; - }, - abort: !0 - }, Ns(arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : { error: "Input not instance of ".concat(e.name) }))); - return n._zod.bag.Class = e, n; -} -(function(e) { - e.assertEqual = function(e) {}, e.assertIs = function(e) {}, e.assertNever = function(e) { - throw new Error(); - }, e.arrayToEnum = function(e) { - var t, n = {}, r = an(e); - try { - for (r.s(); !(t = r.n()).done;) { - var u = t.value; - n[u] = u; - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - return n; - }, e.getValidEnumValues = function(t) { - var n, r = {}, u = an(e.objectKeys(t).filter(function(e) { - return "number" != typeof t[t[e]]; - })); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value; - r[a] = t[a]; - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return e.objectValues(r); - }, e.objectValues = function(t) { - return e.objectKeys(t).map(function(e) { - return t[e]; - }); - }, e.objectKeys = "function" == typeof Object.keys ? function(e) { - return Object.keys(e); - } : function(e) { - var t = []; - for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.push(n); - return t; - }, e.find = function(e, t) { - var n, r = an(e); - try { - for (r.s(); !(n = r.n()).done;) { - var u = n.value; - if (t(u)) return u; - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - }, e.isInteger = "function" == typeof Number.isInteger ? function(e) { - return Number.isInteger(e); - } : function(e) { - return "number" == typeof e && Number.isFinite(e) && Math.floor(e) === e; - }, e.joinValues = function(e) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : " | "; - return e.map(function(e) { - return "string" == typeof e ? "'".concat(e, "'") : e; - }).join(t); - }, e.jsonStringifyReplacer = function(e, t) { - return "bigint" == typeof t ? t.toString() : t; - }; -})(op || (op = {})), (sp || (sp = {})).mergeShapes = function(e, t) { - return pn(pn({}, e), t); -}; -var hp = op.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" -]), vp = function(e) { - switch (En(e)) { - case "undefined": return hp.undefined; - case "string": return hp.string; - case "number": return Number.isNaN(e) ? hp.nan : hp.number; - case "boolean": return hp.boolean; - case "function": return hp.function; - case "bigint": return hp.bigint; - case "symbol": return hp.symbol; - case "object": return Array.isArray(e) ? hp.array : null === e ? hp.null : e.then && "function" == typeof e.then && e.catch && "function" == typeof e.catch ? hp.promise : "undefined" != typeof Map && e instanceof Map ? hp.map : "undefined" != typeof Set && e instanceof Set ? hp.set : "undefined" != typeof Date && e instanceof Date ? hp.date : hp.object; - default: return hp.unknown; - } -}, mp = op.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" -]), Dp = function() { - function e(t) { - var n; - tn(this, e), (n = en(this, e)).issues = [], n.addIssue = function(e) { - n.issues = [].concat(gn(n.issues), [e]); - }, n.addIssues = function() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; - n.issues = [].concat(gn(n.issues), gn(e)); - }; - var r = (this instanceof e ? this.constructor : void 0).prototype; - return Object.setPrototypeOf ? Object.setPrototypeOf(n, r) : n.__proto__ = r, n.name = "ZodError", n.issues = t, n; - } - return ln(e, _n(Error)), un(e, [ - { - key: "errors", - get: function() { - return this.issues; - } - }, - { - key: "format", - value: function(e) { - var t = e || function(e) { - return e.message; - }, n = { _errors: [] }, r = function(e) { - var u, a = an(e.issues); - try { - for (a.s(); !(u = a.n()).done;) { - var i = u.value; - if ("invalid_union" === i.code) i.unionErrors.map(r); - else if ("invalid_return_type" === i.code) r(i.returnTypeError); - else if ("invalid_arguments" === i.code) r(i.argumentsError); - else if (0 === i.path.length) n._errors.push(t(i)); - else for (var o = n, s = 0; s < i.path.length;) { - var c = i.path[s]; - s === i.path.length - 1 ? (o[c] = o[c] || { _errors: [] }, o[c]._errors.push(t(i))) : o[c] = o[c] || { _errors: [] }, o = o[c], s++; - } - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - }; - return r(this), n; - } - }, - { - key: "toString", - value: function() { - return this.message; - } - }, - { - key: "message", - get: function() { - return JSON.stringify(this.issues, op.jsonStringifyReplacer, 2); - } - }, - { - key: "isEmpty", - get: function() { - return 0 === this.issues.length; - } - }, - { - key: "flatten", - value: function() { - var e, t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : function(e) { - return e.message; - }, n = Object.create(null), r = [], u = an(this.issues); - try { - for (u.s(); !(e = u.n()).done;) { - var a = e.value; - if (a.path.length > 0) { - var i = a.path[0]; - n[i] = n[i] || [], n[i].push(t(a)); - } else r.push(t(a)); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return { - formErrors: r, - fieldErrors: n - }; - } - }, - { - key: "formErrors", - get: function() { - return this.flatten(); - } - } - ], [{ - key: "assert", - value: function(t) { - if (!(t instanceof e)) throw new Error("Not a ZodError: ".concat(t)); - } - }]); -}(); -Dp.create = function(e) { - return new Dp(e); -}; -var yp = function(e, t) { - var n; - switch (e.code) { - case mp.invalid_type: - n = e.received === hp.undefined ? "Required" : "Expected ".concat(e.expected, ", received ").concat(e.received); - break; - case mp.invalid_literal: - n = "Invalid literal value, expected ".concat(JSON.stringify(e.expected, op.jsonStringifyReplacer)); - break; - case mp.unrecognized_keys: - n = "Unrecognized key(s) in object: ".concat(op.joinValues(e.keys, ", ")); - break; - case mp.invalid_union: - n = "Invalid input"; - break; - case mp.invalid_union_discriminator: - n = "Invalid discriminator value. Expected ".concat(op.joinValues(e.options)); - break; - case mp.invalid_enum_value: - n = "Invalid enum value. Expected ".concat(op.joinValues(e.options), ", received '").concat(e.received, "'"); - break; - case mp.invalid_arguments: - n = "Invalid function arguments"; - break; - case mp.invalid_return_type: - n = "Invalid function return type"; - break; - case mp.invalid_date: - n = "Invalid date"; - break; - case mp.invalid_string: - "object" === En(e.validation) ? "includes" in e.validation ? (n = "Invalid input: must include \"".concat(e.validation.includes, "\""), "number" == typeof e.validation.position && (n = "".concat(n, " at one or more positions greater than or equal to ").concat(e.validation.position))) : "startsWith" in e.validation ? n = "Invalid input: must start with \"".concat(e.validation.startsWith, "\"") : "endsWith" in e.validation ? n = "Invalid input: must end with \"".concat(e.validation.endsWith, "\"") : op.assertNever(e.validation) : n = "regex" !== e.validation ? "Invalid ".concat(e.validation) : "Invalid"; - break; - case mp.too_small: - n = "array" === e.type ? "Array must contain ".concat(e.exact ? "exactly" : e.inclusive ? "at least" : "more than", " ").concat(e.minimum, " element(s)") : "string" === e.type ? "String must contain ".concat(e.exact ? "exactly" : e.inclusive ? "at least" : "over", " ").concat(e.minimum, " character(s)") : "number" === e.type || "bigint" === e.type ? "Number must be ".concat(e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than ").concat(e.minimum) : "date" === e.type ? "Date must be ".concat(e.exact ? "exactly equal to " : e.inclusive ? "greater than or equal to " : "greater than ").concat(new Date(Number(e.minimum))) : "Invalid input"; - break; - case mp.too_big: - n = "array" === e.type ? "Array must contain ".concat(e.exact ? "exactly" : e.inclusive ? "at most" : "less than", " ").concat(e.maximum, " element(s)") : "string" === e.type ? "String must contain ".concat(e.exact ? "exactly" : e.inclusive ? "at most" : "under", " ").concat(e.maximum, " character(s)") : "number" === e.type ? "Number must be ".concat(e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than", " ").concat(e.maximum) : "bigint" === e.type ? "BigInt must be ".concat(e.exact ? "exactly" : e.inclusive ? "less than or equal to" : "less than", " ").concat(e.maximum) : "date" === e.type ? "Date must be ".concat(e.exact ? "exactly" : e.inclusive ? "smaller than or equal to" : "smaller than", " ").concat(new Date(Number(e.maximum))) : "Invalid input"; - break; - case mp.custom: - n = "Invalid input"; - break; - case mp.invalid_intersection_types: - n = "Intersection results could not be merged"; - break; - case mp.not_multiple_of: - n = "Number must be a multiple of ".concat(e.multipleOf); - break; - case mp.not_finite: - n = "Number must be finite"; - break; - default: n = t.defaultError, op.assertNever(e); - } - return { message: n }; -}, gp = yp; -function Fp() { - return gp; -} -var Ep = function(e) { - var t = e.data, n = e.path, r = e.errorMaps, u = e.issueData, a = [].concat(gn(n), gn(u.path || [])), i = pn(pn({}, u), {}, { path: a }); - if (void 0 !== u.message) return pn(pn({}, u), {}, { - path: a, - message: u.message - }); - var o, s = "", l = an(r.filter(function(e) { - return !!e; - }).slice().reverse()); - try { - for (l.s(); !(o = l.n()).done;) s = (0, o.value)(i, { - data: t, - defaultError: s - }).message; - } catch (e) { - l.e(e); - } finally { - l.f(); - } - return pn(pn({}, u), {}, { - path: a, - message: s - }); -}; -function bp(e, t) { - var n = Fp(), r = Ep({ - issueData: t, - data: e.data, - path: e.path, - errorMaps: [ - e.common.contextualErrorMap, - e.schemaErrorMap, - n, - n === yp ? void 0 : yp - ].filter(function(e) { - return !!e; - }) - }); - e.common.issues.push(r); -} -var _p, kp = function() { - function e() { - tn(this, e), this.value = "valid"; - } - return un(e, [{ - key: "dirty", - value: function() { - "valid" === this.value && (this.value = "dirty"); - } - }, { - key: "abort", - value: function() { - "aborted" !== this.value && (this.value = "aborted"); - } - }], [ - { - key: "mergeArray", - value: function(e, t) { - var n, r = [], u = an(t); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value; - if ("aborted" === a.status) return Cp; - "dirty" === a.status && e.dirty(), r.push(a.value); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return { - status: e.value, - value: r - }; - } - }, - { - key: "mergeObjectAsync", - value: (t = Xt(vn().m(function t(n, r) { - var u, a, i, o, s, c, l; - return vn().w(function(t) { - for (;;) switch (t.p = t.n) { - case 0: u = [], a = an(r), t.p = 1, a.s(); - case 2: - if ((i = a.n()).done) { - t.n = 6; - break; - } - return o = i.value, t.n = 3, o.key; - case 3: return s = t.v, t.n = 4, o.value; - case 4: c = t.v, u.push({ - key: s, - value: c - }); - case 5: - t.n = 2; - break; - case 6: - t.n = 8; - break; - case 7: t.p = 7, l = t.v, a.e(l); - case 8: return t.p = 8, a.f(), t.f(8); - case 9: return t.a(2, e.mergeObjectSync(n, u)); - } - }, t, null, [[ - 1, - 7, - 8, - 9 - ]]); - })), function(e, n) { - return t.apply(this, arguments); - }) - }, - { - key: "mergeObjectSync", - value: function(e, t) { - var n, r = {}, u = an(t); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value, i = a.key, o = a.value; - if ("aborted" === i.status) return Cp; - if ("aborted" === o.status) return Cp; - "dirty" === i.status && e.dirty(), "dirty" === o.status && e.dirty(), "__proto__" === i.value || void 0 === o.value && !a.alwaysSet || (r[i.value] = o.value); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return { - status: e.value, - value: r - }; - } - } - ]); - var t; -}(), Cp = Object.freeze({ status: "aborted" }), Ap = function(e) { - return { - status: "dirty", - value: e - }; -}, wp = function(e) { - return { - status: "valid", - value: e - }; -}, Sp = function(e) { - return "aborted" === e.status; -}, xp = function(e) { - return "dirty" === e.status; -}, Op = function(e) { - return "valid" === e.status; -}, Bp = function(e) { - return "undefined" != typeof Promise && e instanceof Promise; -}; -(function(e) { - e.errToObj = function(e) { - return "string" == typeof e ? { message: e } : e || {}; - }, e.toString = function(e) { - return "string" == typeof e ? e : null == e ? void 0 : e.message; - }; -})(_p || (_p = {})); -var Ip = un(function e(t, n, r, u) { - tn(this, e), this._cachedPath = [], this.parent = t, this.data = n, this._path = r, this._key = u; -}, [{ - key: "path", - get: function() { - var e, t; - return this._cachedPath.length || (Array.isArray(this._key) ? (e = this._cachedPath).push.apply(e, gn(this._path).concat(gn(this._key))) : (t = this._cachedPath).push.apply(t, gn(this._path).concat([this._key]))), this._cachedPath; - } -}]), Tp = function(e, t) { - if (Op(t)) return { - success: !0, - data: t.value - }; - if (!e.common.issues.length) throw new Error("Validation failed but no issues detected."); - return { - success: !1, - get error() { - if (this._error) return this._error; - var t = new Dp(e.common.issues); - return this._error = t, this._error; - } - }; -}; -function Pp(e) { - if (!e) return {}; - var t = e.errorMap, n = e.invalid_type_error, r = e.required_error, u = e.description; - if (t && (n || r)) throw new Error("Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map."); - return t ? { - errorMap: t, - description: u - } : { - errorMap: function(t, u) { - var a, i, o = e.message; - return "invalid_enum_value" === t.code ? { message: null != o ? o : u.defaultError } : void 0 === u.data ? { message: null !== (i = null != o ? o : r) && void 0 !== i ? i : u.defaultError } : "invalid_type" !== t.code ? { message: u.defaultError } : { message: null !== (a = null != o ? o : n) && void 0 !== a ? a : u.defaultError }; - }, - description: u - }; -} -var jp, Np = function() { - return un(function e(t) { - var n = this; - tn(this, e), this.spa = this.safeParseAsync, this._def = t, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this), this["~standard"] = { - version: 1, - vendor: "zod", - validate: function(e) { - return n["~validate"](e); - } - }; - }, [ - { - key: "description", - get: function() { - return this._def.description; - } - }, - { - key: "_getType", - value: function(e) { - return vp(e.data); - } - }, - { - key: "_getOrReturnCtx", - value: function(e, t) { - return t || { - common: e.parent.common, - data: e.data, - parsedType: vp(e.data), - schemaErrorMap: this._def.errorMap, - path: e.path, - parent: e.parent - }; - } - }, - { - key: "_processInputParams", - value: function(e) { - return { - status: new kp(), - ctx: { - common: e.parent.common, - data: e.data, - parsedType: vp(e.data), - schemaErrorMap: this._def.errorMap, - path: e.path, - parent: e.parent - } - }; - } - }, - { - key: "_parseSync", - value: function(e) { - var t = this._parse(e); - if (Bp(t)) throw new Error("Synchronous parse encountered promise."); - return t; - } - }, - { - key: "_parseAsync", - value: function(e) { - var t = this._parse(e); - return Promise.resolve(t); - } - }, - { - key: "parse", - value: function(e, t) { - var n = this.safeParse(e, t); - if (n.success) return n.data; - throw n.error; - } - }, - { - key: "safeParse", - value: function(e, t) { - var n, r = { - common: { - issues: [], - async: null !== (n = null == t ? void 0 : t.async) && void 0 !== n && n, - contextualErrorMap: null == t ? void 0 : t.errorMap - }, - path: (null == t ? void 0 : t.path) || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data: e, - parsedType: vp(e) - }; - return Tp(r, this._parseSync({ - data: e, - path: r.path, - parent: r - })); - } - }, - { - key: "~validate", - value: function(e) { - var t = { - common: { - issues: [], - async: !!this["~standard"].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data: e, - parsedType: vp(e) - }; - if (!this["~standard"].async) try { - var n = this._parseSync({ - data: e, - path: [], - parent: t - }); - return Op(n) ? { value: n.value } : { issues: t.common.issues }; - } catch (e) { - var r; - null != e && null !== (r = e.message) && void 0 !== r && null !== (r = r.toLowerCase()) && void 0 !== r && r.includes("encountered") && (this["~standard"].async = !0), t.common = { - issues: [], - async: !0 - }; - } - return this._parseAsync({ - data: e, - path: [], - parent: t - }).then(function(e) { - return Op(e) ? { value: e.value } : { issues: t.common.issues }; - }); - } - }, - { - key: "parseAsync", - value: (e = Xt(vn().m(function e(t, n) { - var r; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, this.safeParseAsync(t, n); - case 1: - if (!(r = e.v).success) { - e.n = 2; - break; - } - return e.a(2, r.data); - case 2: throw r.error; - case 3: return e.a(2); - } - }, e, this); - })), function(t, n) { - return e.apply(this, arguments); - }) - }, - { - key: "safeParseAsync", - value: function() { - var e = Xt(vn().m(function e(t, n) { - var r, u, a; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return r = { - common: { - issues: [], - contextualErrorMap: null == n ? void 0 : n.errorMap, - async: !0 - }, - path: (null == n ? void 0 : n.path) || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data: t, - parsedType: vp(t) - }, u = this._parse({ - data: t, - path: r.path, - parent: r - }), e.n = 1, Bp(u) ? u : Promise.resolve(u); - case 1: return a = e.v, e.a(2, Tp(r, a)); - } - }, e, this); - })); - return function(t, n) { - return e.apply(this, arguments); - }; - }() - }, - { - key: "refine", - value: function(e, t) { - return this._refinement(function(n, r) { - var u = e(n), a = function() { - return r.addIssue(pn({ code: mp.custom }, function(e) { - return "string" == typeof t || void 0 === t ? { message: t } : "function" == typeof t ? t(e) : t; - }(n))); - }; - return "undefined" != typeof Promise && u instanceof Promise ? u.then(function(e) { - return !!e || (a(), !1); - }) : !!u || (a(), !1); - }); - } - }, - { - key: "refinement", - value: function(e, t) { - return this._refinement(function(n, r) { - return !!e(n) || (r.addIssue("function" == typeof t ? t(n, r) : t), !1); - }); - } - }, - { - key: "_refinement", - value: function(e) { - return new zh({ - schema: this, - typeName: qh.ZodEffects, - effect: { - type: "refinement", - refinement: e - } - }); - } - }, - { - key: "superRefine", - value: function(e) { - return this._refinement(e); - } - }, - { - key: "optional", - value: function() { - return Rh.create(this, this._def); - } - }, - { - key: "nullable", - value: function() { - return Mh.create(this, this._def); - } - }, - { - key: "nullish", - value: function() { - return this.nullable().optional(); - } - }, - { - key: "array", - value: function() { - return yh.create(this); - } - }, - { - key: "promise", - value: function() { - return Nh.create(this, this._def); - } - }, - { - key: "or", - value: function(e) { - return Eh.create([this, e], this._def); - } - }, - { - key: "and", - value: function(e) { - return Ch.create(this, e, this._def); - } - }, - { - key: "transform", - value: function(e) { - return new zh(pn(pn({}, Pp(this._def)), {}, { - schema: this, - typeName: qh.ZodEffects, - effect: { - type: "transform", - transform: e - } - })); - } - }, - { - key: "default", - value: function(e) { - var t = "function" == typeof e ? e : function() { - return e; - }; - return new Zh(pn(pn({}, Pp(this._def)), {}, { - innerType: this, - defaultValue: t, - typeName: qh.ZodDefault - })); - } - }, - { - key: "brand", - value: function() { - return new Uh(pn({ - typeName: qh.ZodBranded, - type: this - }, Pp(this._def))); - } - }, - { - key: "catch", - value: function(e) { - var t = "function" == typeof e ? e : function() { - return e; - }; - return new Lh(pn(pn({}, Pp(this._def)), {}, { - innerType: this, - catchValue: t, - typeName: qh.ZodCatch - })); - } - }, - { - key: "describe", - value: function(e) { - return new this.constructor(pn(pn({}, this._def), {}, { description: e })); - } - }, - { - key: "pipe", - value: function(e) { - return Hh.create(this, e); - } - }, - { - key: "readonly", - value: function() { - return Vh.create(this); - } - }, - { - key: "isOptional", - value: function() { - return this.safeParse(void 0).success; - } - }, - { - key: "isNullable", - value: function() { - return this.safeParse(null).success; - } - } - ]); - var e; -}(), zp = /^c[^\s-]{8,}$/i, Rp = /^[0-9a-z]+$/, Mp = /^[0-9A-HJKMNP-TV-Z]{26}$/i, Zp = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i, Lp = /^[a-z0-9_-]{21}$/i, $p = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/, qp = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/, Up = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i, Hp = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Vp = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, Wp = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/, Kp = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Jp = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Qp = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, Gp = "((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))", Yp = new RegExp("^".concat(Gp, "$")); -function Xp(e) { - var t = "[0-5]\\d"; - e.precision ? t = "".concat(t, "\\.\\d{").concat(e.precision, "}") : null == e.precision && (t = "".concat(t, "(\\.\\d+)?")); - var n = e.precision ? "+" : "?"; - return "([01]\\d|2[0-3]):[0-5]\\d(:".concat(t, ")").concat(n); -} -function eh(e) { - return new RegExp("^".concat(Xp(e), "$")); -} -function th(e) { - var t = "".concat(Gp, "T").concat(Xp(e)), n = []; - return n.push(e.local ? "Z?" : "Z"), e.offset && n.push("([+-]\\d{2}:?\\d{2})"), t = "".concat(t, "(").concat(n.join("|"), ")"), new RegExp("^".concat(t, "$")); -} -function nh(e, t) { - return !("v4" !== t && t || !Hp.test(e)) || !("v6" !== t && t || !Wp.test(e)); -} -function rh(e, t) { - if (!$p.test(e)) return !1; - try { - var n = yn(e.split("."), 1)[0]; - if (!n) return !1; - var r = n.replace(/-/g, "+").replace(/_/g, "/").padEnd(n.length + (4 - n.length % 4) % 4, "="), u = JSON.parse(atob(r)); - return !("object" !== En(u) || null === u || "typ" in u && "JWT" !== (null == u ? void 0 : u.typ) || !u.alg || t && u.alg !== t); - } catch (e) { - return !1; - } -} -function uh(e, t) { - return !("v4" !== t && t || !Vp.test(e)) || !("v6" !== t && t || !Kp.test(e)); -} -var ah = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== hp.string) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.string, - received: t.parsedType - }), Cp; - } - var n, r = new kp(), u = void 0, a = an(this._def.checks); - try { - for (a.s(); !(n = a.n()).done;) { - var i = n.value; - if ("min" === i.kind) e.data.length < i.value && (bp(u = this._getOrReturnCtx(e, u), { - code: mp.too_small, - minimum: i.value, - type: "string", - inclusive: !0, - exact: !1, - message: i.message - }), r.dirty()); - else if ("max" === i.kind) e.data.length > i.value && (bp(u = this._getOrReturnCtx(e, u), { - code: mp.too_big, - maximum: i.value, - type: "string", - inclusive: !0, - exact: !1, - message: i.message - }), r.dirty()); - else if ("length" === i.kind) { - var o = e.data.length > i.value, s = e.data.length < i.value; - (o || s) && (u = this._getOrReturnCtx(e, u), o ? bp(u, { - code: mp.too_big, - maximum: i.value, - type: "string", - inclusive: !0, - exact: !0, - message: i.message - }) : s && bp(u, { - code: mp.too_small, - minimum: i.value, - type: "string", - inclusive: !0, - exact: !0, - message: i.message - }), r.dirty()); - } else if ("email" === i.kind) Up.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "email", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("emoji" === i.kind) jp || (jp = /* @__PURE__ */ new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), jp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "emoji", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("uuid" === i.kind) Zp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "uuid", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("nanoid" === i.kind) Lp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "nanoid", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("cuid" === i.kind) zp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "cuid", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("cuid2" === i.kind) Rp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "cuid2", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("ulid" === i.kind) Mp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "ulid", - code: mp.invalid_string, - message: i.message - }), r.dirty()); - else if ("url" === i.kind) try { - new URL(e.data); - } catch (t) { - bp(u = this._getOrReturnCtx(e, u), { - validation: "url", - code: mp.invalid_string, - message: i.message - }), r.dirty(); - } - else "regex" === i.kind ? (i.regex.lastIndex = 0, i.regex.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "regex", - code: mp.invalid_string, - message: i.message - }), r.dirty())) : "trim" === i.kind ? e.data = e.data.trim() : "includes" === i.kind ? e.data.includes(i.value, i.position) || (bp(u = this._getOrReturnCtx(e, u), { - code: mp.invalid_string, - validation: { - includes: i.value, - position: i.position - }, - message: i.message - }), r.dirty()) : "toLowerCase" === i.kind ? e.data = e.data.toLowerCase() : "toUpperCase" === i.kind ? e.data = e.data.toUpperCase() : "startsWith" === i.kind ? e.data.startsWith(i.value) || (bp(u = this._getOrReturnCtx(e, u), { - code: mp.invalid_string, - validation: { startsWith: i.value }, - message: i.message - }), r.dirty()) : "endsWith" === i.kind ? e.data.endsWith(i.value) || (bp(u = this._getOrReturnCtx(e, u), { - code: mp.invalid_string, - validation: { endsWith: i.value }, - message: i.message - }), r.dirty()) : "datetime" === i.kind ? th(i).test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - code: mp.invalid_string, - validation: "datetime", - message: i.message - }), r.dirty()) : "date" === i.kind ? Yp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - code: mp.invalid_string, - validation: "date", - message: i.message - }), r.dirty()) : "time" === i.kind ? eh(i).test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - code: mp.invalid_string, - validation: "time", - message: i.message - }), r.dirty()) : "duration" === i.kind ? qp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "duration", - code: mp.invalid_string, - message: i.message - }), r.dirty()) : "ip" === i.kind ? nh(e.data, i.version) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "ip", - code: mp.invalid_string, - message: i.message - }), r.dirty()) : "jwt" === i.kind ? rh(e.data, i.alg) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "jwt", - code: mp.invalid_string, - message: i.message - }), r.dirty()) : "cidr" === i.kind ? uh(e.data, i.version) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "cidr", - code: mp.invalid_string, - message: i.message - }), r.dirty()) : "base64" === i.kind ? Jp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "base64", - code: mp.invalid_string, - message: i.message - }), r.dirty()) : "base64url" === i.kind ? Qp.test(e.data) || (bp(u = this._getOrReturnCtx(e, u), { - validation: "base64url", - code: mp.invalid_string, - message: i.message - }), r.dirty()) : op.assertNever(i); - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - return { - status: r.value, - value: e.data - }; - } - }, - { - key: "_regex", - value: function(e, t, n) { - return this.refinement(function(t) { - return e.test(t); - }, pn({ - validation: t, - code: mp.invalid_string - }, _p.errToObj(n))); - } - }, - { - key: "_addCheck", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [t]) })); - } - }, - { - key: "email", - value: function(e) { - return this._addCheck(pn({ kind: "email" }, _p.errToObj(e))); - } - }, - { - key: "url", - value: function(e) { - return this._addCheck(pn({ kind: "url" }, _p.errToObj(e))); - } - }, - { - key: "emoji", - value: function(e) { - return this._addCheck(pn({ kind: "emoji" }, _p.errToObj(e))); - } - }, - { - key: "uuid", - value: function(e) { - return this._addCheck(pn({ kind: "uuid" }, _p.errToObj(e))); - } - }, - { - key: "nanoid", - value: function(e) { - return this._addCheck(pn({ kind: "nanoid" }, _p.errToObj(e))); - } - }, - { - key: "cuid", - value: function(e) { - return this._addCheck(pn({ kind: "cuid" }, _p.errToObj(e))); - } - }, - { - key: "cuid2", - value: function(e) { - return this._addCheck(pn({ kind: "cuid2" }, _p.errToObj(e))); - } - }, - { - key: "ulid", - value: function(e) { - return this._addCheck(pn({ kind: "ulid" }, _p.errToObj(e))); - } - }, - { - key: "base64", - value: function(e) { - return this._addCheck(pn({ kind: "base64" }, _p.errToObj(e))); - } - }, - { - key: "base64url", - value: function(e) { - return this._addCheck(pn({ kind: "base64url" }, _p.errToObj(e))); - } - }, - { - key: "jwt", - value: function(e) { - return this._addCheck(pn({ kind: "jwt" }, _p.errToObj(e))); - } - }, - { - key: "ip", - value: function(e) { - return this._addCheck(pn({ kind: "ip" }, _p.errToObj(e))); - } - }, - { - key: "cidr", - value: function(e) { - return this._addCheck(pn({ kind: "cidr" }, _p.errToObj(e))); - } - }, - { - key: "datetime", - value: function(e) { - var t, n; - return "string" == typeof e ? this._addCheck({ - kind: "datetime", - precision: null, - offset: !1, - local: !1, - message: e - }) : this._addCheck(pn({ - kind: "datetime", - precision: void 0 === (null == e ? void 0 : e.precision) ? null : null == e ? void 0 : e.precision, - offset: null !== (t = null == e ? void 0 : e.offset) && void 0 !== t && t, - local: null !== (n = null == e ? void 0 : e.local) && void 0 !== n && n - }, _p.errToObj(null == e ? void 0 : e.message))); - } - }, - { - key: "date", - value: function(e) { - return this._addCheck({ - kind: "date", - message: e - }); - } - }, - { - key: "time", - value: function(e) { - return "string" == typeof e ? this._addCheck({ - kind: "time", - precision: null, - message: e - }) : this._addCheck(pn({ - kind: "time", - precision: void 0 === (null == e ? void 0 : e.precision) ? null : null == e ? void 0 : e.precision - }, _p.errToObj(null == e ? void 0 : e.message))); - } - }, - { - key: "duration", - value: function(e) { - return this._addCheck(pn({ kind: "duration" }, _p.errToObj(e))); - } - }, - { - key: "regex", - value: function(e, t) { - return this._addCheck(pn({ - kind: "regex", - regex: e - }, _p.errToObj(t))); - } - }, - { - key: "includes", - value: function(e, t) { - return this._addCheck(pn({ - kind: "includes", - value: e, - position: null == t ? void 0 : t.position - }, _p.errToObj(null == t ? void 0 : t.message))); - } - }, - { - key: "startsWith", - value: function(e, t) { - return this._addCheck(pn({ - kind: "startsWith", - value: e - }, _p.errToObj(t))); - } - }, - { - key: "endsWith", - value: function(e, t) { - return this._addCheck(pn({ - kind: "endsWith", - value: e - }, _p.errToObj(t))); - } - }, - { - key: "min", - value: function(e, t) { - return this._addCheck(pn({ - kind: "min", - value: e - }, _p.errToObj(t))); - } - }, - { - key: "max", - value: function(e, t) { - return this._addCheck(pn({ - kind: "max", - value: e - }, _p.errToObj(t))); - } - }, - { - key: "length", - value: function(e, t) { - return this._addCheck(pn({ - kind: "length", - value: e - }, _p.errToObj(t))); - } - }, - { - key: "nonempty", - value: function(e) { - return this.min(1, _p.errToObj(e)); - } - }, - { - key: "trim", - value: function() { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [{ kind: "trim" }]) })); - } - }, - { - key: "toLowerCase", - value: function() { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [{ kind: "toLowerCase" }]) })); - } - }, - { - key: "toUpperCase", - value: function() { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [{ kind: "toUpperCase" }]) })); - } - }, - { - key: "isDatetime", - get: function() { - return !!this._def.checks.find(function(e) { - return "datetime" === e.kind; - }); - } - }, - { - key: "isDate", - get: function() { - return !!this._def.checks.find(function(e) { - return "date" === e.kind; - }); - } - }, - { - key: "isTime", - get: function() { - return !!this._def.checks.find(function(e) { - return "time" === e.kind; - }); - } - }, - { - key: "isDuration", - get: function() { - return !!this._def.checks.find(function(e) { - return "duration" === e.kind; - }); - } - }, - { - key: "isEmail", - get: function() { - return !!this._def.checks.find(function(e) { - return "email" === e.kind; - }); - } - }, - { - key: "isURL", - get: function() { - return !!this._def.checks.find(function(e) { - return "url" === e.kind; - }); - } - }, - { - key: "isEmoji", - get: function() { - return !!this._def.checks.find(function(e) { - return "emoji" === e.kind; - }); - } - }, - { - key: "isUUID", - get: function() { - return !!this._def.checks.find(function(e) { - return "uuid" === e.kind; - }); - } - }, - { - key: "isNANOID", - get: function() { - return !!this._def.checks.find(function(e) { - return "nanoid" === e.kind; - }); - } - }, - { - key: "isCUID", - get: function() { - return !!this._def.checks.find(function(e) { - return "cuid" === e.kind; - }); - } - }, - { - key: "isCUID2", - get: function() { - return !!this._def.checks.find(function(e) { - return "cuid2" === e.kind; - }); - } - }, - { - key: "isULID", - get: function() { - return !!this._def.checks.find(function(e) { - return "ulid" === e.kind; - }); - } - }, - { - key: "isIP", - get: function() { - return !!this._def.checks.find(function(e) { - return "ip" === e.kind; - }); - } - }, - { - key: "isCIDR", - get: function() { - return !!this._def.checks.find(function(e) { - return "cidr" === e.kind; - }); - } - }, - { - key: "isBase64", - get: function() { - return !!this._def.checks.find(function(e) { - return "base64" === e.kind; - }); - } - }, - { - key: "isBase64url", - get: function() { - return !!this._def.checks.find(function(e) { - return "base64url" === e.kind; - }); - } - }, - { - key: "minLength", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "min" === r.kind && (null === t || r.value > t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "maxLength", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "max" === r.kind && (null === t || r.value < t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - } - ]); -}(); -function ih(e, t) { - var n = (e.toString().split(".")[1] || "").length, r = (t.toString().split(".")[1] || "").length, u = n > r ? n : r; - return Number.parseInt(e.toFixed(u).replace(".", "")) % Number.parseInt(t.toFixed(u).replace(".", "")) / Math.pow(10, u); -} -ah.create = function(e) { - var t; - return new ah(pn({ - checks: [], - typeName: qh.ZodString, - coerce: null !== (t = null == e ? void 0 : e.coerce) && void 0 !== t && t - }, Pp(e))); -}; -var oh = function() { - function e() { - var t; - return tn(this, e), (t = en(this, e, arguments)).min = t.gte, t.max = t.lte, t.step = t.multipleOf, t; - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== hp.number) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.number, - received: t.parsedType - }), Cp; - } - var n, r = void 0, u = new kp(), a = an(this._def.checks); - try { - for (a.s(); !(n = a.n()).done;) { - var i = n.value; - "int" === i.kind ? op.isInteger(e.data) || (bp(r = this._getOrReturnCtx(e, r), { - code: mp.invalid_type, - expected: "integer", - received: "float", - message: i.message - }), u.dirty()) : "min" === i.kind ? (i.inclusive ? e.data < i.value : e.data <= i.value) && (bp(r = this._getOrReturnCtx(e, r), { - code: mp.too_small, - minimum: i.value, - type: "number", - inclusive: i.inclusive, - exact: !1, - message: i.message - }), u.dirty()) : "max" === i.kind ? (i.inclusive ? e.data > i.value : e.data >= i.value) && (bp(r = this._getOrReturnCtx(e, r), { - code: mp.too_big, - maximum: i.value, - type: "number", - inclusive: i.inclusive, - exact: !1, - message: i.message - }), u.dirty()) : "multipleOf" === i.kind ? 0 !== ih(e.data, i.value) && (bp(r = this._getOrReturnCtx(e, r), { - code: mp.not_multiple_of, - multipleOf: i.value, - message: i.message - }), u.dirty()) : "finite" === i.kind ? Number.isFinite(e.data) || (bp(r = this._getOrReturnCtx(e, r), { - code: mp.not_finite, - message: i.message - }), u.dirty()) : op.assertNever(i); - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - return { - status: u.value, - value: e.data - }; - } - }, - { - key: "gte", - value: function(e, t) { - return this.setLimit("min", e, !0, _p.toString(t)); - } - }, - { - key: "gt", - value: function(e, t) { - return this.setLimit("min", e, !1, _p.toString(t)); - } - }, - { - key: "lte", - value: function(e, t) { - return this.setLimit("max", e, !0, _p.toString(t)); - } - }, - { - key: "lt", - value: function(e, t) { - return this.setLimit("max", e, !1, _p.toString(t)); - } - }, - { - key: "setLimit", - value: function(t, n, r, u) { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [{ - kind: t, - value: n, - inclusive: r, - message: _p.toString(u) - }]) })); - } - }, - { - key: "_addCheck", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [t]) })); - } - }, - { - key: "int", - value: function(e) { - return this._addCheck({ - kind: "int", - message: _p.toString(e) - }); - } - }, - { - key: "positive", - value: function(e) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: !1, - message: _p.toString(e) - }); - } - }, - { - key: "negative", - value: function(e) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: !1, - message: _p.toString(e) - }); - } - }, - { - key: "nonpositive", - value: function(e) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: !0, - message: _p.toString(e) - }); - } - }, - { - key: "nonnegative", - value: function(e) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: !0, - message: _p.toString(e) - }); - } - }, - { - key: "multipleOf", - value: function(e, t) { - return this._addCheck({ - kind: "multipleOf", - value: e, - message: _p.toString(t) - }); - } - }, - { - key: "finite", - value: function(e) { - return this._addCheck({ - kind: "finite", - message: _p.toString(e) - }); - } - }, - { - key: "safe", - value: function(e) { - return this._addCheck({ - kind: "min", - inclusive: !0, - value: Number.MIN_SAFE_INTEGER, - message: _p.toString(e) - })._addCheck({ - kind: "max", - inclusive: !0, - value: Number.MAX_SAFE_INTEGER, - message: _p.toString(e) - }); - } - }, - { - key: "minValue", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "min" === r.kind && (null === t || r.value > t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "maxValue", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "max" === r.kind && (null === t || r.value < t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "isInt", - get: function() { - return !!this._def.checks.find(function(e) { - return "int" === e.kind || "multipleOf" === e.kind && op.isInteger(e.value); - }); - } - }, - { - key: "isFinite", - get: function() { - var e, t = null, n = null, r = an(this._def.checks); - try { - for (r.s(); !(e = r.n()).done;) { - var u = e.value; - if ("finite" === u.kind || "int" === u.kind || "multipleOf" === u.kind) return !0; - "min" === u.kind ? (null === n || u.value > n) && (n = u.value) : "max" === u.kind && (null === t || u.value < t) && (t = u.value); - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - return Number.isFinite(n) && Number.isFinite(t); - } - } - ]); -}(); -oh.create = function(e) { - return new oh(pn({ - checks: [], - typeName: qh.ZodNumber, - coerce: (null == e ? void 0 : e.coerce) || !1 - }, Pp(e))); -}; -var sh = function() { - function e() { - var t; - return tn(this, e), (t = en(this, e, arguments)).min = t.gte, t.max = t.lte, t; - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - if (this._def.coerce) try { - e.data = BigInt(e.data); - } catch (t) { - return this._getInvalidInput(e); - } - if (this._getType(e) !== hp.bigint) return this._getInvalidInput(e); - var t, n = void 0, r = new kp(), u = an(this._def.checks); - try { - for (u.s(); !(t = u.n()).done;) { - var a = t.value; - "min" === a.kind ? (a.inclusive ? e.data < a.value : e.data <= a.value) && (bp(n = this._getOrReturnCtx(e, n), { - code: mp.too_small, - type: "bigint", - minimum: a.value, - inclusive: a.inclusive, - message: a.message - }), r.dirty()) : "max" === a.kind ? (a.inclusive ? e.data > a.value : e.data >= a.value) && (bp(n = this._getOrReturnCtx(e, n), { - code: mp.too_big, - type: "bigint", - maximum: a.value, - inclusive: a.inclusive, - message: a.message - }), r.dirty()) : "multipleOf" === a.kind ? e.data % a.value !== BigInt(0) && (bp(n = this._getOrReturnCtx(e, n), { - code: mp.not_multiple_of, - multipleOf: a.value, - message: a.message - }), r.dirty()) : op.assertNever(a); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return { - status: r.value, - value: e.data - }; - } - }, - { - key: "_getInvalidInput", - value: function(e) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.bigint, - received: t.parsedType - }), Cp; - } - }, - { - key: "gte", - value: function(e, t) { - return this.setLimit("min", e, !0, _p.toString(t)); - } - }, - { - key: "gt", - value: function(e, t) { - return this.setLimit("min", e, !1, _p.toString(t)); - } - }, - { - key: "lte", - value: function(e, t) { - return this.setLimit("max", e, !0, _p.toString(t)); - } - }, - { - key: "lt", - value: function(e, t) { - return this.setLimit("max", e, !1, _p.toString(t)); - } - }, - { - key: "setLimit", - value: function(t, n, r, u) { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [{ - kind: t, - value: n, - inclusive: r, - message: _p.toString(u) - }]) })); - } - }, - { - key: "_addCheck", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [t]) })); - } - }, - { - key: "positive", - value: function(e) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: !1, - message: _p.toString(e) - }); - } - }, - { - key: "negative", - value: function(e) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: !1, - message: _p.toString(e) - }); - } - }, - { - key: "nonpositive", - value: function(e) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: !0, - message: _p.toString(e) - }); - } - }, - { - key: "nonnegative", - value: function(e) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: !0, - message: _p.toString(e) - }); - } - }, - { - key: "multipleOf", - value: function(e, t) { - return this._addCheck({ - kind: "multipleOf", - value: e, - message: _p.toString(t) - }); - } - }, - { - key: "minValue", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "min" === r.kind && (null === t || r.value > t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "maxValue", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "max" === r.kind && (null === t || r.value < t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - } - ]); -}(); -sh.create = function(e) { - var t; - return new sh(pn({ - checks: [], - typeName: qh.ZodBigInt, - coerce: null !== (t = null == e ? void 0 : e.coerce) && void 0 !== t && t - }, Pp(e))); -}; -var ch = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (this._def.coerce && (e.data = Boolean(e.data)), this._getType(e) !== hp.boolean) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.boolean, - received: t.parsedType - }), Cp; - } - return wp(e.data); - } - }]); -}(); -ch.create = function(e) { - return new ch(pn({ - typeName: qh.ZodBoolean, - coerce: (null == e ? void 0 : e.coerce) || !1 - }, Pp(e))); -}; -var lh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== hp.date) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.date, - received: t.parsedType - }), Cp; - } - if (Number.isNaN(e.data.getTime())) return bp(this._getOrReturnCtx(e), { code: mp.invalid_date }), Cp; - var n, r = new kp(), u = void 0, a = an(this._def.checks); - try { - for (a.s(); !(n = a.n()).done;) { - var i = n.value; - "min" === i.kind ? e.data.getTime() < i.value && (bp(u = this._getOrReturnCtx(e, u), { - code: mp.too_small, - message: i.message, - inclusive: !0, - exact: !1, - minimum: i.value, - type: "date" - }), r.dirty()) : "max" === i.kind ? e.data.getTime() > i.value && (bp(u = this._getOrReturnCtx(e, u), { - code: mp.too_big, - message: i.message, - inclusive: !0, - exact: !1, - maximum: i.value, - type: "date" - }), r.dirty()) : op.assertNever(i); - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - return { - status: r.value, - value: new Date(e.data.getTime()) - }; - } - }, - { - key: "_addCheck", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { checks: [].concat(gn(this._def.checks), [t]) })); - } - }, - { - key: "min", - value: function(e, t) { - return this._addCheck({ - kind: "min", - value: e.getTime(), - message: _p.toString(t) - }); - } - }, - { - key: "max", - value: function(e, t) { - return this._addCheck({ - kind: "max", - value: e.getTime(), - message: _p.toString(t) - }); - } - }, - { - key: "minDate", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "min" === r.kind && (null === t || r.value > t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return null != t ? new Date(t) : null; - } - }, - { - key: "maxDate", - get: function() { - var e, t = null, n = an(this._def.checks); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - "max" === r.kind && (null === t || r.value < t) && (t = r.value); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return null != t ? new Date(t) : null; - } - } - ]); -}(); -lh.create = function(e) { - return new lh(pn({ - checks: [], - coerce: (null == e ? void 0 : e.coerce) || !1, - typeName: qh.ZodDate - }, Pp(e))); -}; -var fh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (this._getType(e) !== hp.symbol) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.symbol, - received: t.parsedType - }), Cp; - } - return wp(e.data); - } - }]); -}(); -fh.create = function(e) { - return new fh(pn({ typeName: qh.ZodSymbol }, Pp(e))); -}; -var dh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (this._getType(e) !== hp.undefined) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.undefined, - received: t.parsedType - }), Cp; - } - return wp(e.data); - } - }]); -}(); -dh.create = function(e) { - return new dh(pn({ typeName: qh.ZodUndefined }, Pp(e))); -}; -var ph = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (this._getType(e) !== hp.null) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.null, - received: t.parsedType - }), Cp; - } - return wp(e.data); - } - }]); -}(); -ph.create = function(e) { - return new ph(pn({ typeName: qh.ZodNull }, Pp(e))); -}; -var hh = function() { - function e() { - var t; - return tn(this, e), (t = en(this, e, arguments))._any = !0, t; - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - return wp(e.data); - } - }]); -}(); -hh.create = function(e) { - return new hh(pn({ typeName: qh.ZodAny }, Pp(e))); -}; -var vh = function() { - function e() { - var t; - return tn(this, e), (t = en(this, e, arguments))._unknown = !0, t; - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - return wp(e.data); - } - }]); -}(); -vh.create = function(e) { - return new vh(pn({ typeName: qh.ZodUnknown }, Pp(e))); -}; -var mh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.never, - received: t.parsedType - }), Cp; - } - }]); -}(); -mh.create = function(e) { - return new mh(pn({ typeName: qh.ZodNever }, Pp(e))); -}; -var Dh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (this._getType(e) !== hp.undefined) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.void, - received: t.parsedType - }), Cp; - } - return wp(e.data); - } - }]); -}(); -Dh.create = function(e) { - return new Dh(pn({ typeName: qh.ZodVoid }, Pp(e))); -}; -var yh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e), n = t.ctx, r = t.status, u = this._def; - if (n.parsedType !== hp.array) return bp(n, { - code: mp.invalid_type, - expected: hp.array, - received: n.parsedType - }), Cp; - if (null !== u.exactLength) { - var a = n.data.length > u.exactLength.value, i = n.data.length < u.exactLength.value; - (a || i) && (bp(n, { - code: a ? mp.too_big : mp.too_small, - minimum: i ? u.exactLength.value : void 0, - maximum: a ? u.exactLength.value : void 0, - type: "array", - inclusive: !0, - exact: !0, - message: u.exactLength.message - }), r.dirty()); - } - if (null !== u.minLength && n.data.length < u.minLength.value && (bp(n, { - code: mp.too_small, - minimum: u.minLength.value, - type: "array", - inclusive: !0, - exact: !1, - message: u.minLength.message - }), r.dirty()), null !== u.maxLength && n.data.length > u.maxLength.value && (bp(n, { - code: mp.too_big, - maximum: u.maxLength.value, - type: "array", - inclusive: !0, - exact: !1, - message: u.maxLength.message - }), r.dirty()), n.common.async) return Promise.all(gn(n.data).map(function(e, t) { - return u.type._parseAsync(new Ip(n, e, n.path, t)); - })).then(function(e) { - return kp.mergeArray(r, e); - }); - var o = gn(n.data).map(function(e, t) { - return u.type._parseSync(new Ip(n, e, n.path, t)); - }); - return kp.mergeArray(r, o); - } - }, - { - key: "element", - get: function() { - return this._def.type; - } - }, - { - key: "min", - value: function(t, n) { - return new e(pn(pn({}, this._def), {}, { minLength: { - value: t, - message: _p.toString(n) - } })); - } - }, - { - key: "max", - value: function(t, n) { - return new e(pn(pn({}, this._def), {}, { maxLength: { - value: t, - message: _p.toString(n) - } })); - } - }, - { - key: "length", - value: function(t, n) { - return new e(pn(pn({}, this._def), {}, { exactLength: { - value: t, - message: _p.toString(n) - } })); - } - }, - { - key: "nonempty", - value: function(e) { - return this.min(1, e); - } - } - ]); -}(); -function gh(e) { - if (e instanceof Fh) { - var t = {}; - for (var n in e.shape) { - var r = e.shape[n]; - t[n] = Rh.create(gh(r)); - } - return new Fh(pn(pn({}, e._def), {}, { shape: function() { - return t; - } })); - } - return e instanceof yh ? new yh(pn(pn({}, e._def), {}, { type: gh(e.element) })) : e instanceof Rh ? Rh.create(gh(e.unwrap())) : e instanceof Mh ? Mh.create(gh(e.unwrap())) : e instanceof Ah ? Ah.create(e.items.map(function(e) { - return gh(e); - })) : e; -} -yh.create = function(e, t) { - return new yh(pn({ - type: e, - minLength: null, - maxLength: null, - exactLength: null, - typeName: qh.ZodArray - }, Pp(t))); -}; -var Fh = function() { - function e() { - var t; - return tn(this, e), (t = en(this, e, arguments))._cached = null, t.nonstrict = t.passthrough, t.augment = t.extend, t; - } - return ln(e, Np), un(e, [ - { - key: "_getCached", - value: function() { - if (null !== this._cached) return this._cached; - var e = this._def.shape(), t = op.objectKeys(e); - return this._cached = { - shape: e, - keys: t - }, this._cached; - } - }, - { - key: "_parse", - value: function(e) { - if (this._getType(e) !== hp.object) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.object, - received: t.parsedType - }), Cp; - } - var n = this._processInputParams(e), r = n.status, u = n.ctx, a = this._getCached(), i = a.shape, o = a.keys, s = []; - if (!(this._def.catchall instanceof mh && "strip" === this._def.unknownKeys)) for (var c in u.data) o.includes(c) || s.push(c); - var l, f = [], d = an(o); - try { - for (d.s(); !(l = d.n()).done;) { - var p = l.value, h = i[p], v = u.data[p]; - f.push({ - key: { - status: "valid", - value: p - }, - value: h._parse(new Ip(u, v, u.path, p)), - alwaysSet: p in u.data - }); - } - } catch (e) { - d.e(e); - } finally { - d.f(); - } - if (this._def.catchall instanceof mh) { - var m = this._def.unknownKeys; - if ("passthrough" === m) { - var D, y = an(s); - try { - for (y.s(); !(D = y.n()).done;) { - var g = D.value; - f.push({ - key: { - status: "valid", - value: g - }, - value: { - status: "valid", - value: u.data[g] - } - }); - } - } catch (e) { - y.e(e); - } finally { - y.f(); - } - } else if ("strict" === m) s.length > 0 && (bp(u, { - code: mp.unrecognized_keys, - keys: s - }), r.dirty()); - else if ("strip" !== m) throw new Error("Internal ZodObject error: invalid unknownKeys value."); - } else { - var F, E = this._def.catchall, b = an(s); - try { - for (b.s(); !(F = b.n()).done;) { - var _ = F.value, k = u.data[_]; - f.push({ - key: { - status: "valid", - value: _ - }, - value: E._parse(new Ip(u, k, u.path, _)), - alwaysSet: _ in u.data - }); - } - } catch (e) { - b.e(e); - } finally { - b.f(); - } - } - return u.common.async ? Promise.resolve().then(Xt(vn().m(function e() { - var t, n, r, u, a, i, o; - return vn().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: t = [], n = an(f), e.p = 1, n.s(); - case 2: - if ((r = n.n()).done) { - e.n = 6; - break; - } - return u = r.value, e.n = 3, u.key; - case 3: return a = e.v, e.n = 4, u.value; - case 4: i = e.v, t.push({ - key: a, - value: i, - alwaysSet: u.alwaysSet - }); - case 5: - e.n = 2; - break; - case 6: - e.n = 8; - break; - case 7: e.p = 7, o = e.v, n.e(o); - case 8: return e.p = 8, n.f(), e.f(8); - case 9: return e.a(2, t); - } - }, e, null, [[ - 1, - 7, - 8, - 9 - ]]); - }))).then(function(e) { - return kp.mergeObjectSync(r, e); - }) : kp.mergeObjectSync(r, f); - } - }, - { - key: "shape", - get: function() { - return this._def.shape(); - } - }, - { - key: "strict", - value: function(t) { - var n = this; - return _p.errToObj, new e(pn(pn({}, this._def), {}, { unknownKeys: "strict" }, void 0 !== t ? { errorMap: function(e, r) { - var u, a, i, o, s = null !== (u = null === (a = (i = n._def).errorMap) || void 0 === a ? void 0 : a.call(i, e, r).message) && void 0 !== u ? u : r.defaultError; - return "unrecognized_keys" === e.code ? { message: null !== (o = _p.errToObj(t).message) && void 0 !== o ? o : s } : { message: s }; - } } : {})); - } - }, - { - key: "strip", - value: function() { - return new e(pn(pn({}, this._def), {}, { unknownKeys: "strip" })); - } - }, - { - key: "passthrough", - value: function() { - return new e(pn(pn({}, this._def), {}, { unknownKeys: "passthrough" })); - } - }, - { - key: "extend", - value: function(t) { - var n = this; - return new e(pn(pn({}, this._def), {}, { shape: function() { - return pn(pn({}, n._def.shape()), t); - } })); - } - }, - { - key: "merge", - value: function(t) { - var n = this; - return new e({ - unknownKeys: t._def.unknownKeys, - catchall: t._def.catchall, - shape: function() { - return pn(pn({}, n._def.shape()), t._def.shape()); - }, - typeName: qh.ZodObject - }); - } - }, - { - key: "setKey", - value: function(e, t) { - return this.augment(on({}, e, t)); - } - }, - { - key: "catchall", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { catchall: t })); - } - }, - { - key: "pick", - value: function(t) { - var n, r = {}, u = an(op.objectKeys(t)); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value; - t[a] && this.shape[a] && (r[a] = this.shape[a]); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return new e(pn(pn({}, this._def), {}, { shape: function() { - return r; - } })); - } - }, - { - key: "omit", - value: function(t) { - var n, r = {}, u = an(op.objectKeys(this.shape)); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value; - t[a] || (r[a] = this.shape[a]); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return new e(pn(pn({}, this._def), {}, { shape: function() { - return r; - } })); - } - }, - { - key: "deepPartial", - value: function() { - return gh(this); - } - }, - { - key: "partial", - value: function(t) { - var n, r = {}, u = an(op.objectKeys(this.shape)); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value, i = this.shape[a]; - t && !t[a] ? r[a] = i : r[a] = i.optional(); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return new e(pn(pn({}, this._def), {}, { shape: function() { - return r; - } })); - } - }, - { - key: "required", - value: function(t) { - var n, r = {}, u = an(op.objectKeys(this.shape)); - try { - for (u.s(); !(n = u.n()).done;) { - var a = n.value; - if (t && !t[a]) r[a] = this.shape[a]; - else { - for (var i = this.shape[a]; i instanceof Rh;) i = i._def.innerType; - r[a] = i; - } - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return new e(pn(pn({}, this._def), {}, { shape: function() { - return r; - } })); - } - }, - { - key: "keyof", - value: function() { - return Th(op.objectKeys(this.shape)); - } - } - ]); -}(); -Fh.create = function(e, t) { - return new Fh(pn({ - shape: function() { - return e; - }, - unknownKeys: "strip", - catchall: mh.create(), - typeName: qh.ZodObject - }, Pp(t))); -}, Fh.strictCreate = function(e, t) { - return new Fh(pn({ - shape: function() { - return e; - }, - unknownKeys: "strict", - catchall: mh.create(), - typeName: qh.ZodObject - }, Pp(t))); -}, Fh.lazycreate = function(e, t) { - return new Fh(pn({ - shape: e, - unknownKeys: "strip", - catchall: mh.create(), - typeName: qh.ZodObject - }, Pp(t))); -}; -var Eh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this._processInputParams(e).ctx, n = this._def.options; - if (t.common.async) return Promise.all(n.map(function() { - var e = Xt(vn().m(function e(n) { - var r, u, a; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return r = pn(pn({}, t), {}, { - common: pn(pn({}, t.common), {}, { issues: [] }), - parent: null - }), e.n = 1, n._parseAsync({ - data: t.data, - path: t.path, - parent: r - }); - case 1: return u = e.v, a = r, e.a(2, { - result: u, - ctx: a - }); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; - }())).then(function(e) { - var n, r = an(e); - try { - for (r.s(); !(n = r.n()).done;) { - var u = n.value; - if ("valid" === u.result.status) return u.result; - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - var a, i = an(e); - try { - for (i.s(); !(a = i.n()).done;) { - var o, s = a.value; - if ("dirty" === s.result.status) return (o = t.common.issues).push.apply(o, gn(s.ctx.common.issues)), s.result; - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - var c = e.map(function(e) { - return new Dp(e.ctx.common.issues); - }); - return bp(t, { - code: mp.invalid_union, - unionErrors: c - }), Cp; - }); - var r, u, a = void 0, i = [], o = an(n); - try { - for (o.s(); !(r = o.n()).done;) { - var s = r.value, c = pn(pn({}, t), {}, { - common: pn(pn({}, t.common), {}, { issues: [] }), - parent: null - }), l = s._parseSync({ - data: t.data, - path: t.path, - parent: c - }); - if ("valid" === l.status) return l; - "dirty" !== l.status || a || (a = { - result: l, - ctx: c - }), c.common.issues.length && i.push(c.common.issues); - } - } catch (e) { - o.e(e); - } finally { - o.f(); - } - if (a) return (u = t.common.issues).push.apply(u, gn(a.ctx.common.issues)), a.result; - var f = i.map(function(e) { - return new Dp(e); - }); - return bp(t, { - code: mp.invalid_union, - unionErrors: f - }), Cp; - } - }, { - key: "options", - get: function() { - return this._def.options; - } - }]); -}(); -Eh.create = function(e, t) { - return new Eh(pn({ - options: e, - typeName: qh.ZodUnion - }, Pp(t))); -}; -var bh = function(e) { - return e instanceof Bh ? bh(e.schema) : e instanceof zh ? bh(e.innerType()) : e instanceof Ih ? [e.value] : e instanceof Ph ? e.options : e instanceof jh ? op.objectValues(e.enum) : e instanceof Zh ? bh(e._def.innerType) : e instanceof dh ? [void 0] : e instanceof ph ? [null] : e instanceof Rh ? [void 0].concat(gn(bh(e.unwrap()))) : e instanceof Mh ? [null].concat(gn(bh(e.unwrap()))) : e instanceof Uh || e instanceof Vh ? bh(e.unwrap()) : e instanceof Lh ? bh(e._def.innerType) : []; -}, _h = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e).ctx; - if (t.parsedType !== hp.object) return bp(t, { - code: mp.invalid_type, - expected: hp.object, - received: t.parsedType - }), Cp; - var n = this.discriminator, r = t.data[n], u = this.optionsMap.get(r); - return u ? t.common.async ? u._parseAsync({ - data: t.data, - path: t.path, - parent: t - }) : u._parseSync({ - data: t.data, - path: t.path, - parent: t - }) : (bp(t, { - code: mp.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [n] - }), Cp); - } - }, - { - key: "discriminator", - get: function() { - return this._def.discriminator; - } - }, - { - key: "options", - get: function() { - return this._def.options; - } - }, - { - key: "optionsMap", - get: function() { - return this._def.optionsMap; - } - } - ], [{ - key: "create", - value: function(t, n, r) { - var u, a = /* @__PURE__ */ new Map(), i = an(n); - try { - for (i.s(); !(u = i.n()).done;) { - var o = u.value, s = bh(o.shape[t]); - if (!s.length) throw new Error("A discriminator value for key `".concat(t, "` could not be extracted from all schema options")); - var c, l = an(s); - try { - for (l.s(); !(c = l.n()).done;) { - var f = c.value; - if (a.has(f)) throw new Error("Discriminator property ".concat(String(t), " has duplicate value ").concat(String(f))); - a.set(f, o); - } - } catch (e) { - l.e(e); - } finally { - l.f(); - } - } - } catch (e) { - i.e(e); - } finally { - i.f(); - } - return new e(pn({ - typeName: qh.ZodDiscriminatedUnion, - discriminator: t, - options: n, - optionsMap: a - }, Pp(r))); - } - }]); -}(); -function kh(e, t) { - var n = vp(e), r = vp(t); - if (e === t) return { - valid: !0, - data: e - }; - if (n === hp.object && r === hp.object) { - var u, a = op.objectKeys(t), i = op.objectKeys(e).filter(function(e) { - return -1 !== a.indexOf(e); - }), o = pn(pn({}, e), t), s = an(i); - try { - for (s.s(); !(u = s.n()).done;) { - var c = u.value, l = kh(e[c], t[c]); - if (!l.valid) return { valid: !1 }; - o[c] = l.data; - } - } catch (e) { - s.e(e); - } finally { - s.f(); - } - return { - valid: !0, - data: o - }; - } - if (n === hp.array && r === hp.array) { - if (e.length !== t.length) return { valid: !1 }; - for (var f = [], d = 0; d < e.length; d++) { - var p = kh(e[d], t[d]); - if (!p.valid) return { valid: !1 }; - f.push(p.data); - } - return { - valid: !0, - data: f - }; - } - return n === hp.date && r === hp.date && +e === +t ? { - valid: !0, - data: e - } : { valid: !1 }; -} -var Ch = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this._processInputParams(e), n = t.status, r = t.ctx, u = function(e, t) { - if (Sp(e) || Sp(t)) return Cp; - var u = kh(e.value, t.value); - return u.valid ? ((xp(e) || xp(t)) && n.dirty(), { - status: n.value, - value: u.data - }) : (bp(r, { code: mp.invalid_intersection_types }), Cp); - }; - return r.common.async ? Promise.all([this._def.left._parseAsync({ - data: r.data, - path: r.path, - parent: r - }), this._def.right._parseAsync({ - data: r.data, - path: r.path, - parent: r - })]).then(function(e) { - var t = yn(e, 2), n = t[0], r = t[1]; - return u(n, r); - }) : u(this._def.left._parseSync({ - data: r.data, - path: r.path, - parent: r - }), this._def.right._parseSync({ - data: r.data, - path: r.path, - parent: r - })); - } - }]); -}(); -Ch.create = function(e, t, n) { - return new Ch(pn({ - left: e, - right: t, - typeName: qh.ZodIntersection - }, Pp(n))); -}; -var Ah = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - var t = this, n = this._processInputParams(e), r = n.status, u = n.ctx; - if (u.parsedType !== hp.array) return bp(u, { - code: mp.invalid_type, - expected: hp.array, - received: u.parsedType - }), Cp; - if (u.data.length < this._def.items.length) return bp(u, { - code: mp.too_small, - minimum: this._def.items.length, - inclusive: !0, - exact: !1, - type: "array" - }), Cp; - !this._def.rest && u.data.length > this._def.items.length && (bp(u, { - code: mp.too_big, - maximum: this._def.items.length, - inclusive: !0, - exact: !1, - type: "array" - }), r.dirty()); - var a = gn(u.data).map(function(e, n) { - var r = t._def.items[n] || t._def.rest; - return r ? r._parse(new Ip(u, e, u.path, n)) : null; - }).filter(function(e) { - return !!e; - }); - return u.common.async ? Promise.all(a).then(function(e) { - return kp.mergeArray(r, e); - }) : kp.mergeArray(r, a); - } - }, - { - key: "items", - get: function() { - return this._def.items; - } - }, - { - key: "rest", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { rest: t })); - } - } - ]); -}(); -Ah.create = function(e, t) { - if (!Array.isArray(e)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - return new Ah(pn({ - items: e, - typeName: qh.ZodTuple, - rest: null - }, Pp(t))); -}; -var wh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "keySchema", - get: function() { - return this._def.keyType; - } - }, - { - key: "valueSchema", - get: function() { - return this._def.valueType; - } - }, - { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e), n = t.status, r = t.ctx; - if (r.parsedType !== hp.object) return bp(r, { - code: mp.invalid_type, - expected: hp.object, - received: r.parsedType - }), Cp; - var u = [], a = this._def.keyType, i = this._def.valueType; - for (var o in r.data) u.push({ - key: a._parse(new Ip(r, o, r.path, o)), - value: i._parse(new Ip(r, r.data[o], r.path, o)), - alwaysSet: o in r.data - }); - return r.common.async ? kp.mergeObjectAsync(n, u) : kp.mergeObjectSync(n, u); - } - }, - { - key: "element", - get: function() { - return this._def.valueType; - } - } - ], [{ - key: "create", - value: function(t, n, r) { - return new e(n instanceof Np ? pn({ - keyType: t, - valueType: n, - typeName: qh.ZodRecord - }, Pp(r)) : pn({ - keyType: ah.create(), - valueType: t, - typeName: qh.ZodRecord - }, Pp(n))); - } - }]); -}(), Sh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "keySchema", - get: function() { - return this._def.keyType; - } - }, - { - key: "valueSchema", - get: function() { - return this._def.valueType; - } - }, - { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e), n = t.status, r = t.ctx; - if (r.parsedType !== hp.map) return bp(r, { - code: mp.invalid_type, - expected: hp.map, - received: r.parsedType - }), Cp; - var u = this._def.keyType, a = this._def.valueType, i = gn(r.data.entries()).map(function(e, t) { - var n = yn(e, 2), i = n[0], o = n[1]; - return { - key: u._parse(new Ip(r, i, r.path, [t, "key"])), - value: a._parse(new Ip(r, o, r.path, [t, "value"])) - }; - }); - if (r.common.async) { - var o = /* @__PURE__ */ new Map(); - return Promise.resolve().then(Xt(vn().m(function e() { - var t, r, u, a, s, c; - return vn().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: t = an(i), e.p = 1, t.s(); - case 2: - if ((r = t.n()).done) { - e.n = 7; - break; - } - return u = r.value, e.n = 3, u.key; - case 3: return a = e.v, e.n = 4, u.value; - case 4: - if (s = e.v, "aborted" !== a.status && "aborted" !== s.status) { - e.n = 5; - break; - } - return e.a(2, Cp); - case 5: "dirty" !== a.status && "dirty" !== s.status || n.dirty(), o.set(a.value, s.value); - case 6: - e.n = 2; - break; - case 7: - e.n = 9; - break; - case 8: e.p = 8, c = e.v, t.e(c); - case 9: return e.p = 9, t.f(), e.f(9); - case 10: return e.a(2, { - status: n.value, - value: o - }); - } - }, e, null, [[ - 1, - 8, - 9, - 10 - ]]); - }))); - } - var s, c = /* @__PURE__ */ new Map(), l = an(i); - try { - for (l.s(); !(s = l.n()).done;) { - var f = s.value, d = f.key, p = f.value; - if ("aborted" === d.status || "aborted" === p.status) return Cp; - "dirty" !== d.status && "dirty" !== p.status || n.dirty(), c.set(d.value, p.value); - } - } catch (e) { - l.e(e); - } finally { - l.f(); - } - return { - status: n.value, - value: c - }; - } - } - ]); -}(); -Sh.create = function(e, t, n) { - return new Sh(pn({ - valueType: t, - keyType: e, - typeName: qh.ZodMap - }, Pp(n))); -}; -var xh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e), n = t.status, r = t.ctx; - if (r.parsedType !== hp.set) return bp(r, { - code: mp.invalid_type, - expected: hp.set, - received: r.parsedType - }), Cp; - var u = this._def; - null !== u.minSize && r.data.size < u.minSize.value && (bp(r, { - code: mp.too_small, - minimum: u.minSize.value, - type: "set", - inclusive: !0, - exact: !1, - message: u.minSize.message - }), n.dirty()), null !== u.maxSize && r.data.size > u.maxSize.value && (bp(r, { - code: mp.too_big, - maximum: u.maxSize.value, - type: "set", - inclusive: !0, - exact: !1, - message: u.maxSize.message - }), n.dirty()); - var a = this._def.valueType; - function i(e) { - var t, r = /* @__PURE__ */ new Set(), u = an(e); - try { - for (u.s(); !(t = u.n()).done;) { - var a = t.value; - if ("aborted" === a.status) return Cp; - "dirty" === a.status && n.dirty(), r.add(a.value); - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - return { - status: n.value, - value: r - }; - } - var o = gn(r.data.values()).map(function(e, t) { - return a._parse(new Ip(r, e, r.path, t)); - }); - return r.common.async ? Promise.all(o).then(function(e) { - return i(e); - }) : i(o); - } - }, - { - key: "min", - value: function(t, n) { - return new e(pn(pn({}, this._def), {}, { minSize: { - value: t, - message: _p.toString(n) - } })); - } - }, - { - key: "max", - value: function(t, n) { - return new e(pn(pn({}, this._def), {}, { maxSize: { - value: t, - message: _p.toString(n) - } })); - } - }, - { - key: "size", - value: function(e, t) { - return this.min(e, t).max(e, t); - } - }, - { - key: "nonempty", - value: function(e) { - return this.min(1, e); - } - } - ]); -}(); -xh.create = function(e, t) { - return new xh(pn({ - valueType: e, - minSize: null, - maxSize: null, - typeName: qh.ZodSet - }, Pp(t))); -}; -var Oh = function() { - function e() { - var t; - return tn(this, e), (t = en(this, e, arguments)).validate = t.implement, t; - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e).ctx; - if (t.parsedType !== hp.function) return bp(t, { - code: mp.invalid_type, - expected: hp.function, - received: t.parsedType - }), Cp; - function n(e, n) { - return Ep({ - data: e, - path: t.path, - errorMaps: [ - t.common.contextualErrorMap, - t.schemaErrorMap, - Fp(), - yp - ].filter(function(e) { - return !!e; - }), - issueData: { - code: mp.invalid_arguments, - argumentsError: n - } - }); - } - function r(e, n) { - return Ep({ - data: e, - path: t.path, - errorMaps: [ - t.common.contextualErrorMap, - t.schemaErrorMap, - Fp(), - yp - ].filter(function(e) { - return !!e; - }), - issueData: { - code: mp.invalid_return_type, - returnTypeError: n - } - }); - } - var u = { errorMap: t.common.contextualErrorMap }, a = t.data; - if (this._def.returns instanceof Nh) { - var i = this; - return wp(Xt(vn().m(function e() { - var t, o, s, c, l, f, d, p = arguments; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - for (t = p.length, o = new Array(t), s = 0; s < t; s++) o[s] = p[s]; - return c = new Dp([]), e.n = 1, i._def.args.parseAsync(o, u).catch(function(e) { - throw c.addIssue(n(o, e)), c; - }); - case 1: return l = e.v, e.n = 2, Reflect.apply(a, this, l); - case 2: return f = e.v, e.n = 3, i._def.returns._def.type.parseAsync(f, u).catch(function(e) { - throw c.addIssue(r(f, e)), c; - }); - case 3: return d = e.v, e.a(2, d); - } - }, e, this); - }))); - } - var o = this; - return wp(function() { - for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]; - var s = o._def.args.safeParse(t, u); - if (!s.success) throw new Dp([n(t, s.error)]); - var c = Reflect.apply(a, this, s.data), l = o._def.returns.safeParse(c, u); - if (!l.success) throw new Dp([r(c, l.error)]); - return l.data; - }); - } - }, - { - key: "parameters", - value: function() { - return this._def.args; - } - }, - { - key: "returnType", - value: function() { - return this._def.returns; - } - }, - { - key: "args", - value: function() { - for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++) n[r] = arguments[r]; - return new e(pn(pn({}, this._def), {}, { args: Ah.create(n).rest(vh.create()) })); - } - }, - { - key: "returns", - value: function(t) { - return new e(pn(pn({}, this._def), {}, { returns: t })); - } - }, - { - key: "implement", - value: function(e) { - return this.parse(e); - } - }, - { - key: "strictImplement", - value: function(e) { - return this.parse(e); - } - } - ], [{ - key: "create", - value: function(t, n, r) { - return new e(pn({ - args: t || Ah.create([]).rest(vh.create()), - returns: n || vh.create(), - typeName: qh.ZodFunction - }, Pp(r))); - } - }]); -}(), Bh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "schema", - get: function() { - return this._def.getter(); - } - }, { - key: "_parse", - value: function(e) { - var t = this._processInputParams(e).ctx; - return this._def.getter()._parse({ - data: t.data, - path: t.path, - parent: t - }); - } - }]); -}(); -Bh.create = function(e, t) { - return new Bh(pn({ - getter: e, - typeName: qh.ZodLazy - }, Pp(t))); -}; -var Ih = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (e.data !== this._def.value) { - var t = this._getOrReturnCtx(e); - return bp(t, { - received: t.data, - code: mp.invalid_literal, - expected: this._def.value - }), Cp; - } - return { - status: "valid", - value: e.data - }; - } - }, { - key: "value", - get: function() { - return this._def.value; - } - }]); -}(); -function Th(e, t) { - return new Ph(pn({ - values: e, - typeName: qh.ZodEnum - }, Pp(t))); -} -Ih.create = function(e, t) { - return new Ih(pn({ - value: e, - typeName: qh.ZodLiteral - }, Pp(t))); -}; -var Ph = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "_parse", - value: function(e) { - if ("string" != typeof e.data) { - var t = this._getOrReturnCtx(e), n = this._def.values; - return bp(t, { - expected: op.joinValues(n), - received: t.parsedType, - code: mp.invalid_type - }), Cp; - } - if (this._cache || (this._cache = new Set(this._def.values)), !this._cache.has(e.data)) { - var r = this._getOrReturnCtx(e), u = this._def.values; - return bp(r, { - received: r.data, - code: mp.invalid_enum_value, - options: u - }), Cp; - } - return wp(e.data); - } - }, - { - key: "options", - get: function() { - return this._def.values; - } - }, - { - key: "enum", - get: function() { - var e, t = {}, n = an(this._def.values); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - t[r] = r; - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "Values", - get: function() { - var e, t = {}, n = an(this._def.values); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - t[r] = r; - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "Enum", - get: function() { - var e, t = {}, n = an(this._def.values); - try { - for (n.s(); !(e = n.n()).done;) { - var r = e.value; - t[r] = r; - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - return t; - } - }, - { - key: "extract", - value: function(t) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._def; - return e.create(t, pn(pn({}, this._def), n)); - } - }, - { - key: "exclude", - value: function(t) { - var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : this._def; - return e.create(this.options.filter(function(e) { - return !t.includes(e); - }), pn(pn({}, this._def), n)); - } - } - ]); -}(); -Ph.create = Th; -var jh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = op.getValidEnumValues(this._def.values), n = this._getOrReturnCtx(e); - if (n.parsedType !== hp.string && n.parsedType !== hp.number) { - var r = op.objectValues(t); - return bp(n, { - expected: op.joinValues(r), - received: n.parsedType, - code: mp.invalid_type - }), Cp; - } - if (this._cache || (this._cache = new Set(op.getValidEnumValues(this._def.values))), !this._cache.has(e.data)) { - var u = op.objectValues(t); - return bp(n, { - received: n.data, - code: mp.invalid_enum_value, - options: u - }), Cp; - } - return wp(e.data); - } - }, { - key: "enum", - get: function() { - return this._def.values; - } - }]); -}(); -jh.create = function(e, t) { - return new jh(pn({ - values: e, - typeName: qh.ZodNativeEnum - }, Pp(t))); -}; -var Nh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "unwrap", - value: function() { - return this._def.type; - } - }, { - key: "_parse", - value: function(e) { - var t = this, n = this._processInputParams(e).ctx; - if (n.parsedType !== hp.promise && !1 === n.common.async) return bp(n, { - code: mp.invalid_type, - expected: hp.promise, - received: n.parsedType - }), Cp; - return wp((n.parsedType === hp.promise ? n.data : Promise.resolve(n.data)).then(function(e) { - return t._def.type.parseAsync(e, { - path: n.path, - errorMap: n.common.contextualErrorMap - }); - })); - } - }]); -}(); -Nh.create = function(e, t) { - return new Nh(pn({ - type: e, - typeName: qh.ZodPromise - }, Pp(t))); -}; -var zh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [ - { - key: "innerType", - value: function() { - return this._def.schema; - } - }, - { - key: "sourceType", - value: function() { - return this._def.schema._def.typeName === qh.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - }, - { - key: "_parse", - value: function(e) { - var t = this, n = this._processInputParams(e), r = n.status, u = n.ctx, a = this._def.effect || null, i = { - addIssue: function(e) { - bp(u, e), e.fatal ? r.abort() : r.dirty(); - }, - get path() { - return u.path; - } - }; - if (i.addIssue = i.addIssue.bind(i), "preprocess" === a.type) { - var o = a.transform(u.data, i); - if (u.common.async) return Promise.resolve(o).then(function() { - var e = Xt(vn().m(function e(n) { - var a; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if ("aborted" !== r.value) { - e.n = 1; - break; - } - return e.a(2, Cp); - case 1: return e.n = 2, t._def.schema._parseAsync({ - data: n, - path: u.path, - parent: u - }); - case 2: - if ("aborted" !== (a = e.v).status) { - e.n = 3; - break; - } - return e.a(2, Cp); - case 3: - if ("dirty" !== a.status) { - e.n = 4; - break; - } - return e.a(2, Ap(a.value)); - case 4: - if ("dirty" !== r.value) { - e.n = 5; - break; - } - return e.a(2, Ap(a.value)); - case 5: return e.a(2, a); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; - }()); - if ("aborted" === r.value) return Cp; - var s = this._def.schema._parseSync({ - data: o, - path: u.path, - parent: u - }); - return "aborted" === s.status ? Cp : "dirty" === s.status || "dirty" === r.value ? Ap(s.value) : s; - } - if ("refinement" === a.type) { - var c = function(e) { - var t = a.refinement(e, i); - if (u.common.async) return Promise.resolve(t); - if (t instanceof Promise) throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - return e; - }; - if (!1 === u.common.async) { - var l = this._def.schema._parseSync({ - data: u.data, - path: u.path, - parent: u - }); - return "aborted" === l.status ? Cp : ("dirty" === l.status && r.dirty(), c(l.value), { - status: r.value, - value: l.value - }); - } - return this._def.schema._parseAsync({ - data: u.data, - path: u.path, - parent: u - }).then(function(e) { - return "aborted" === e.status ? Cp : ("dirty" === e.status && r.dirty(), c(e.value).then(function() { - return { - status: r.value, - value: e.value - }; - })); - }); - } - if ("transform" === a.type) { - if (!1 === u.common.async) { - var f = this._def.schema._parseSync({ - data: u.data, - path: u.path, - parent: u - }); - if (!Op(f)) return Cp; - var d = a.transform(f.value, i); - if (d instanceof Promise) throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead."); - return { - status: r.value, - value: d - }; - } - return this._def.schema._parseAsync({ - data: u.data, - path: u.path, - parent: u - }).then(function(e) { - return Op(e) ? Promise.resolve(a.transform(e.value, i)).then(function(e) { - return { - status: r.value, - value: e - }; - }) : Cp; - }); - } - op.assertNever(a); - } - } - ]); -}(); -zh.create = function(e, t, n) { - return new zh(pn({ - schema: e, - typeName: qh.ZodEffects, - effect: t - }, Pp(n))); -}, zh.createWithPreprocess = function(e, t, n) { - return new zh(pn({ - schema: t, - effect: { - type: "preprocess", - transform: e - }, - typeName: qh.ZodEffects - }, Pp(n))); -}; -var Rh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - return this._getType(e) === hp.undefined ? wp(void 0) : this._def.innerType._parse(e); - } - }, { - key: "unwrap", - value: function() { - return this._def.innerType; - } - }]); -}(); -Rh.create = function(e, t) { - return new Rh(pn({ - innerType: e, - typeName: qh.ZodOptional - }, Pp(t))); -}; -var Mh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - return this._getType(e) === hp.null ? wp(null) : this._def.innerType._parse(e); - } - }, { - key: "unwrap", - value: function() { - return this._def.innerType; - } - }]); -}(); -Mh.create = function(e, t) { - return new Mh(pn({ - innerType: e, - typeName: qh.ZodNullable - }, Pp(t))); -}; -var Zh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this._processInputParams(e).ctx, n = t.data; - return t.parsedType === hp.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({ - data: n, - path: t.path, - parent: t - }); - } - }, { - key: "removeDefault", - value: function() { - return this._def.innerType; - } - }]); -}(); -Zh.create = function(e, t) { - return new Zh(pn({ - innerType: e, - typeName: qh.ZodDefault, - defaultValue: "function" == typeof t.default ? t.default : function() { - return t.default; - } - }, Pp(t))); -}; -var Lh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this, n = this._processInputParams(e).ctx, r = pn(pn({}, n), {}, { common: pn(pn({}, n.common), {}, { issues: [] }) }), u = this._def.innerType._parse({ - data: r.data, - path: r.path, - parent: pn({}, r) - }); - return Bp(u) ? u.then(function(e) { - return { - status: "valid", - value: "valid" === e.status ? e.value : t._def.catchValue({ - get error() { - return new Dp(r.common.issues); - }, - input: r.data - }) - }; - }) : { - status: "valid", - value: "valid" === u.status ? u.value : this._def.catchValue({ - get error() { - return new Dp(r.common.issues); - }, - input: r.data - }) - }; - } - }, { - key: "removeCatch", - value: function() { - return this._def.innerType; - } - }]); -}(); -Lh.create = function(e, t) { - return new Lh(pn({ - innerType: e, - typeName: qh.ZodCatch, - catchValue: "function" == typeof t.catch ? t.catch : function() { - return t.catch; - } - }, Pp(t))); -}; -var $h = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - if (this._getType(e) !== hp.nan) { - var t = this._getOrReturnCtx(e); - return bp(t, { - code: mp.invalid_type, - expected: hp.nan, - received: t.parsedType - }), Cp; - } - return { - status: "valid", - value: e.data - }; - } - }]); -}(); -$h.create = function(e) { - return new $h(pn({ typeName: qh.ZodNaN }, Pp(e))); -}; -var qh, Uh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this._processInputParams(e).ctx, n = t.data; - return this._def.type._parse({ - data: n, - path: t.path, - parent: t - }); - } - }, { - key: "unwrap", - value: function() { - return this._def.type; - } - }]); -}(), Hh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this, n = this._processInputParams(e), r = n.status, u = n.ctx; - if (u.common.async) return function() { - var e = Xt(vn().m(function e() { - var n; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, t._def.in._parseAsync({ - data: u.data, - path: u.path, - parent: u - }); - case 1: - if ("aborted" !== (n = e.v).status) { - e.n = 2; - break; - } - return e.a(2, Cp); - case 2: - if ("dirty" !== n.status) { - e.n = 3; - break; - } - return r.dirty(), e.a(2, Ap(n.value)); - case 3: return e.a(2, t._def.out._parseAsync({ - data: n.value, - path: u.path, - parent: u - })); - case 4: return e.a(2); - } - }, e); - })); - return function() { - return e.apply(this, arguments); - }; - }()(); - var i = this._def.in._parseSync({ - data: u.data, - path: u.path, - parent: u - }); - return "aborted" === i.status ? Cp : "dirty" === i.status ? (r.dirty(), { - status: "dirty", - value: i.value - }) : this._def.out._parseSync({ - data: i.value, - path: u.path, - parent: u - }); - } - }], [{ - key: "create", - value: function(t, n) { - return new e({ - in: t, - out: n, - typeName: qh.ZodPipeline - }); - } - }]); -}(), Vh = function() { - function e() { - return tn(this, e), en(this, e, arguments); - } - return ln(e, Np), un(e, [{ - key: "_parse", - value: function(e) { - var t = this._def.innerType._parse(e), n = function(e) { - return Op(e) && (e.value = Object.freeze(e.value)), e; - }; - return Bp(t) ? t.then(function(e) { - return n(e); - }) : n(t); - } - }, { - key: "unwrap", - value: function() { - return this._def.innerType; - } - }]); -}(); -Vh.create = function(e, t) { - return new Vh(pn({ - innerType: e, - typeName: qh.ZodReadonly - }, Pp(t))); -}, Fh.lazycreate, function(e) { - e.ZodString = "ZodString", e.ZodNumber = "ZodNumber", e.ZodNaN = "ZodNaN", e.ZodBigInt = "ZodBigInt", e.ZodBoolean = "ZodBoolean", e.ZodDate = "ZodDate", e.ZodSymbol = "ZodSymbol", e.ZodUndefined = "ZodUndefined", e.ZodNull = "ZodNull", e.ZodAny = "ZodAny", e.ZodUnknown = "ZodUnknown", e.ZodNever = "ZodNever", e.ZodVoid = "ZodVoid", e.ZodArray = "ZodArray", e.ZodObject = "ZodObject", e.ZodUnion = "ZodUnion", e.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", e.ZodIntersection = "ZodIntersection", e.ZodTuple = "ZodTuple", e.ZodRecord = "ZodRecord", e.ZodMap = "ZodMap", e.ZodSet = "ZodSet", e.ZodFunction = "ZodFunction", e.ZodLazy = "ZodLazy", e.ZodLiteral = "ZodLiteral", e.ZodEnum = "ZodEnum", e.ZodEffects = "ZodEffects", e.ZodNativeEnum = "ZodNativeEnum", e.ZodOptional = "ZodOptional", e.ZodNullable = "ZodNullable", e.ZodDefault = "ZodDefault", e.ZodCatch = "ZodCatch", e.ZodPromise = "ZodPromise", e.ZodBranded = "ZodBranded", e.ZodPipeline = "ZodPipeline", e.ZodReadonly = "ZodReadonly"; -}(qh || (qh = {})), ah.create, oh.create, $h.create, sh.create, ch.create, lh.create, fh.create, dh.create, ph.create, hh.create, vh.create, mh.create, Dh.create, yh.create, Fh.create, Fh.strictCreate, Eh.create, _h.create, Ch.create, Ah.create, wh.create, Sh.create, xh.create, Oh.create, Bh.create, Ih.create, Ph.create, jh.create, Nh.create, zh.create, Rh.create, Mh.create, zh.createWithPreprocess, Hh.create; -var Wh = function() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.prefix, n = e.size, r = void 0 === n ? 16 : n, u = e.alphabet, a = void 0 === u ? "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" : u, i = e.separator, o = void 0 === i ? "-" : i, s = function() { - for (var e = a.length, t = new Array(r), n = 0; n < r; n++) t[n] = a[Math.random() * e | 0]; - return t.join(""); - }; - if (null == t) return s; - if (a.includes(o)) throw new Xo({ - argument: "separator", - message: "The separator \"".concat(o, "\" must not be part of the alphabet \"").concat(a, "\".") - }); - return function() { - return "".concat(t).concat(o).concat(s()); - }; -}, Kh = Wh(); -function Jh() { - var e, t, n, r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : globalThis; - return r.window ? "runtime/browser" : (null == (e = r.navigator) ? void 0 : e.userAgent) ? "runtime/".concat(r.navigator.userAgent.toLowerCase()) : (null == (n = null == (t = r.process) ? void 0 : t.versions) ? void 0 : n.node) ? "runtime/node.js/".concat(r.process.version.substring(0)) : r.EdgeRuntime ? "runtime/vercel-edge" : "runtime/unknown"; -} -function Qh(e) { - if (null == e) return {}; - var t = {}; - if (e instanceof Headers) e.forEach(function(e, n) { - t[n.toLowerCase()] = e; - }); - else { - Array.isArray(e) || (e = Object.entries(e)); - var n, r = s(e); - try { - for (r.s(); !(n = r.n()).done;) { - var u = g(n.value, 2), a = u[0], i = u[1]; - null != i && (t[a.toLowerCase()] = i); - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - } - return t; -} -function Gh(e) { - for (var t = new Headers(Qh(e)), n = t.get("user-agent") || "", r = arguments.length, u = new Array(r > 1 ? r - 1 : 0), a = 1; a < r; a++) u[a - 1] = arguments[a]; - return t.set("user-agent", [n].concat(u).filter(Boolean).join(" ")), Object.fromEntries(t.entries()); -} -var Yh = /"__proto__"\s*:/, Xh = /"constructor"\s*:/; -function ev(e) { - var t = JSON.parse(e); - return null === t || "object" != b(t) || !1 === Yh.test(e) && !1 === Xh.test(e) ? t : function(e) { - for (var t = [e]; t.length;) { - var n = t; - t = []; - var r, u = s(n); - try { - for (u.s(); !(r = u.n()).done;) { - var a = r.value; - if (Object.prototype.hasOwnProperty.call(a, "__proto__")) throw new SyntaxError("Object contains forbidden prototype property"); - if (Object.prototype.hasOwnProperty.call(a, "constructor") && Object.prototype.hasOwnProperty.call(a.constructor, "prototype")) throw new SyntaxError("Object contains forbidden prototype property"); - for (var i in a) { - var o = a[i]; - o && "object" == b(o) && t.push(o); - } - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - } - return e; - }(t); -} -var tv = Symbol.for("vercel.ai.validator"); -function nv(e) { - return function(e) { - return "object" == b(e) && null !== e && tv in e && !0 === e[tv] && "validate" in e; - }(e) ? e : "function" == typeof e ? e() : (t = e, n = function() { - var e = r(m().m(function e(n) { - var r; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, t["~standard"].validate(n); - case 1: return r = e.v, e.a(2, null == r.issues ? { - success: !0, - value: r.value - } : { - success: !1, - error: new cs({ - value: n, - cause: r.issues - }) - }); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; - }(), c(c({}, tv, !0), "validate", n)); - var t, n; -} -function rv(e) { - return uv.apply(this, arguments); -} -function uv() { - return uv = r(m().m(function e(t) { - var n, r, u; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: return n = t.value, r = t.schema, e.n = 1, av({ - value: n, - schema: r - }); - case 1: - if ((u = e.v).success) { - e.n = 2; - break; - } - throw cs.wrap({ - value: n, - cause: u.error - }); - case 2: return e.a(2, u.value); - } - }, e); - })), uv.apply(this, arguments); -} -function av(e) { - return iv.apply(this, arguments); -} -function iv() { - return iv = r(m().m(function e(t) { - var n, r, u, a, i; - return m().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: - if (n = t.value, r = t.schema, u = nv(r), e.p = 1, null != u.validate) { - e.n = 2; - break; - } - return e.a(2, { - success: !0, - value: n, - rawValue: n - }); - case 2: return e.n = 3, u.validate(n); - case 3: return a = e.v, e.a(2, a.success ? { - success: !0, - value: a.value, - rawValue: n - } : { - success: !1, - error: cs.wrap({ - value: n, - cause: a.error - }), - rawValue: n - }); - case 4: return e.p = 4, i = e.v, e.a(2, { - success: !1, - error: cs.wrap({ - value: n, - cause: i - }), - rawValue: n - }); - } - }, e, null, [[1, 4]]); - })), iv.apply(this, arguments); -} -function ov(e) { - return sv.apply(this, arguments); -} -function sv() { - return sv = r(m().m(function e(t) { - var n, r, u, a, i; - return m().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: - if (n = t.text, r = t.schema, e.p = 1, u = function(e) { - var t = Error.stackTraceLimit; - try { - Error.stackTraceLimit = 0; - } catch (t) { - return ev(e); - } - try { - return ev(e); - } finally { - Error.stackTraceLimit = t; - } - }(n), null != r) { - e.n = 2; - break; - } - a = { - success: !0, - value: u, - rawValue: u - }, e.n = 4; - break; - case 2: return e.n = 3, av({ - value: u, - schema: r - }); - case 3: a = e.v; - case 4: return e.a(2, a); - case 5: return e.p = 5, i = e.v, e.a(2, { - success: !1, - error: us.isInstance(i) ? i : new us({ - text: n, - cause: i - }), - rawValue: void 0 - }); - } - }, e, null, [[1, 5]]); - })), sv.apply(this, arguments); -} -function cv(e) { - return lv.apply(this, arguments); -} -function lv() { - return lv = r(m().m(function e(t) { - return m().w(function(e) { - for (;;) if (0 === e.n) return e.a(2, ("function" == typeof t && (t = t()), Promise.resolve(t))); - }, e); - })), lv.apply(this, arguments); -} -var fv = function(e, t) { - for (var n = 0; n < e.length && n < t.length && e[n] === t[n]; n++); - return [(e.length - n).toString()].concat(F(t.slice(n))).join("/"); -}, dv = Symbol("Let zodToJsonSchema decide on which parser to use"), pv = { - name: void 0, - $refStrategy: "root", - basePath: ["#"], - effectStrategy: "input", - pipeStrategy: "all", - dateStrategy: "format:date-time", - mapStrategy: "entries", - removeAdditionalStrategy: "passthrough", - allowedAdditionalProperties: !0, - rejectedAdditionalProperties: !1, - definitionPath: "definitions", - strictUnions: !1, - definitions: {}, - errorMessages: !1, - patternStrategy: "escape", - applyRegexFlags: !1, - emailStrategy: "format:email", - base64Strategy: "contentEncoding:base64", - nameStrategy: "ref" -}; -function hv(e, t) { - return Mv(e.type._def, t); -} -function vv(e, t, n) { - var r = null != n ? n : t.dateStrategy; - if (Array.isArray(r)) return { anyOf: r.map(function(n, r) { - return vv(e, t, n); - }) }; - switch (r) { - case "string": - case "format:date-time": return { - type: "string", - format: "date-time" - }; - case "format:date": return { - type: "string", - format: "date" - }; - case "integer": return mv(e); - } -} -var mv = function(e) { - var t, n = { - type: "integer", - format: "unix-time" - }, r = s(e.checks); - try { - for (r.s(); !(t = r.n()).done;) { - var u = t.value; - switch (u.kind) { - case "min": - n.minimum = u.value; - break; - case "max": n.maximum = u.value; - } - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - return n; -}, Dv = void 0, yv = /^[cC][^\s-]{8,}$/, gv = /^[0-9a-z]+$/, Fv = /^[0-9A-HJKMNP-TV-Z]{26}$/, Ev = /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/, bv = function() { - return void 0 === Dv && (Dv = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u")), Dv; -}, _v = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/, kv = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Cv = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/, Av = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/, wv = /^[a-zA-Z0-9_-]{21}$/, Sv = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; -function xv(e, t) { - var n = { type: "string" }; - if (e.checks) { - var r, u = s(e.checks); - try { - for (u.s(); !(r = u.n()).done;) { - var a = r.value; - switch (a.kind) { - case "min": - n.minLength = "number" == typeof n.minLength ? Math.max(n.minLength, a.value) : a.value; - break; - case "max": - n.maxLength = "number" == typeof n.maxLength ? Math.min(n.maxLength, a.value) : a.value; - break; - case "email": - switch (t.emailStrategy) { - case "format:email": - Iv(n, "email", a.message, t); - break; - case "format:idn-email": - Iv(n, "idn-email", a.message, t); - break; - case "pattern:zod": Tv(n, Ev, a.message, t); - } - break; - case "url": - Iv(n, "uri", a.message, t); - break; - case "uuid": - Iv(n, "uuid", a.message, t); - break; - case "regex": - Tv(n, a.regex, a.message, t); - break; - case "cuid": - Tv(n, yv, a.message, t); - break; - case "cuid2": - Tv(n, gv, a.message, t); - break; - case "startsWith": - Tv(n, RegExp("^".concat(Ov(a.value, t))), a.message, t); - break; - case "endsWith": - Tv(n, RegExp("".concat(Ov(a.value, t), "$")), a.message, t); - break; - case "datetime": - Iv(n, "date-time", a.message, t); - break; - case "date": - Iv(n, "date", a.message, t); - break; - case "time": - Iv(n, "time", a.message, t); - break; - case "duration": - Iv(n, "duration", a.message, t); - break; - case "length": - n.minLength = "number" == typeof n.minLength ? Math.max(n.minLength, a.value) : a.value, n.maxLength = "number" == typeof n.maxLength ? Math.min(n.maxLength, a.value) : a.value; - break; - case "includes": - Tv(n, RegExp(Ov(a.value, t)), a.message, t); - break; - case "ip": - "v6" !== a.version && Iv(n, "ipv4", a.message, t), "v4" !== a.version && Iv(n, "ipv6", a.message, t); - break; - case "base64url": - Tv(n, Av, a.message, t); - break; - case "jwt": - Tv(n, Sv, a.message, t); - break; - case "cidr": - "v6" !== a.version && Tv(n, _v, a.message, t), "v4" !== a.version && Tv(n, kv, a.message, t); - break; - case "emoji": - Tv(n, bv(), a.message, t); - break; - case "ulid": - Tv(n, Fv, a.message, t); - break; - case "base64": - switch (t.base64Strategy) { - case "format:binary": - Iv(n, "binary", a.message, t); - break; - case "contentEncoding:base64": - n.contentEncoding = "base64"; - break; - case "pattern:zod": Tv(n, Cv, a.message, t); - } - break; - case "nanoid": Tv(n, wv, a.message, t); - } - } - } catch (e) { - u.e(e); - } finally { - u.f(); - } - } - return n; -} -function Ov(e, t) { - return "escape" === t.patternStrategy ? function(e) { - for (var t = "", n = 0; n < e.length; n++) Bv.has(e[n]) || (t += "\\"), t += e[n]; - return t; - }(e) : e; -} -var Bv = /* @__PURE__ */ new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789"); -function Iv(e, t, n, r) { - var u; - e.format || (null == (u = e.anyOf) ? void 0 : u.some(function(e) { - return e.format; - })) ? (e.anyOf || (e.anyOf = []), e.format && (e.anyOf.push({ format: e.format }), delete e.format), e.anyOf.push(h({ format: t }, n && r.errorMessages && { errorMessage: { format: n } }))) : e.format = t; -} -function Tv(e, t, n, r) { - var u; - e.pattern || (null == (u = e.allOf) ? void 0 : u.some(function(e) { - return e.pattern; - })) ? (e.allOf || (e.allOf = []), e.pattern && (e.allOf.push({ pattern: e.pattern }), delete e.pattern), e.allOf.push(h({ pattern: Pv(t, r) }, n && r.errorMessages && { errorMessage: { pattern: n } }))) : e.pattern = Pv(t, r); -} -function Pv(e, t) { - var n; - if (!t.applyRegexFlags || !e.flags) return e.source; - for (var r = e.flags.includes("i"), u = e.flags.includes("m"), a = e.flags.includes("s"), i = r ? e.source.toLowerCase() : e.source, o = "", s = !1, c = !1, l = !1, f = 0; f < i.length; f++) if (s) o += i[f], s = !1; - else { - if (r) { - if (c) { - if (i[f].match(/[a-z]/)) { - l ? (o += i[f], o += "".concat(i[f - 2], "-").concat(i[f]).toUpperCase(), l = !1) : "-" === i[f + 1] && (null == (n = i[f + 2]) ? void 0 : n.match(/[a-z]/)) ? (o += i[f], l = !0) : o += "".concat(i[f]).concat(i[f].toUpperCase()); - continue; - } - } else if (i[f].match(/[a-z]/)) { - o += "[".concat(i[f]).concat(i[f].toUpperCase(), "]"); - continue; - } - } - if (u) { - if ("^" === i[f]) { - o += "(^|(?<=[\r\n]))"; - continue; - } - if ("$" === i[f]) { - o += "($|(?=[\r\n]))"; - continue; - } - } - a && "." === i[f] ? o += c ? "".concat(i[f], "\r\n") : "[".concat(i[f], "\r\n]") : (o += i[f], "\\" === i[f] ? s = !0 : c && "]" === i[f] ? c = !1 : c || "[" !== i[f] || (c = !0)); - } - try { - new RegExp(o); - } catch (n) { - return console.warn("Could not convert regex pattern at ".concat(t.currentPath.join("/"), " to a flag-independent form! Falling back to the flag-ignorant source")), e.source; - } - return o; -} -function jv(e, t) { - var n, r, u, a, i, o, s = { - type: "object", - additionalProperties: null != (n = Mv(e.valueType._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["additionalProperties"]) }))) ? n : t.allowedAdditionalProperties - }; - if ((null == (r = e.keyType) ? void 0 : r._def.typeName) === qh.ZodString && (null == (u = e.keyType._def.checks) ? void 0 : u.length)) { - var c = xv(e.keyType._def, t); - c.type; - var l = v(c, Ut); - return h(h({}, s), {}, { propertyNames: l }); - } - if ((null == (a = e.keyType) ? void 0 : a._def.typeName) === qh.ZodEnum) return h(h({}, s), {}, { propertyNames: { enum: e.keyType._def.values } }); - if ((null == (i = e.keyType) ? void 0 : i._def.typeName) === qh.ZodBranded && e.keyType._def.type._def.typeName === qh.ZodString && (null == (o = e.keyType._def.type._def.checks) ? void 0 : o.length)) { - var f = hv(e.keyType._def, t); - f.type; - var d = v(f, Ht); - return h(h({}, s), {}, { propertyNames: d }); - } - return s; -} -var Nv = { - ZodString: "string", - ZodNumber: "number", - ZodBigInt: "integer", - ZodBoolean: "boolean", - ZodNull: "null" -}; -function zv(e) { - try { - return e.isOptional(); - } catch (e) { - return !0; - } -} -var Rv = function(e, t, n) { - switch (t) { - case qh.ZodString: return xv(e, n); - case qh.ZodNumber: return function(e) { - var t = { type: "number" }; - if (!e.checks) return t; - var n, r = s(e.checks); - try { - for (r.s(); !(n = r.n()).done;) { - var u = n.value; - switch (u.kind) { - case "int": - t.type = "integer"; - break; - case "min": - u.inclusive ? t.minimum = u.value : t.exclusiveMinimum = u.value; - break; - case "max": - u.inclusive ? t.maximum = u.value : t.exclusiveMaximum = u.value; - break; - case "multipleOf": t.multipleOf = u.value; - } - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - return t; - }(e); - case qh.ZodObject: return function(e, t) { - var n = { - type: "object", - properties: {} - }, r = [], u = e.shape(); - for (var a in u) { - var i = u[a]; - if (void 0 !== i && void 0 !== i._def) { - var o = zv(i), s = Mv(i._def, h(h({}, t), {}, { - currentPath: [].concat(F(t.currentPath), ["properties", a]), - propertyPath: [].concat(F(t.currentPath), ["properties", a]) - })); - void 0 !== s && (n.properties[a] = s, o || r.push(a)); - } - } - r.length && (n.required = r); - var c = function(e, t) { - if ("ZodNever" !== e.catchall._def.typeName) return Mv(e.catchall._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["additionalProperties"]) })); - switch (e.unknownKeys) { - case "passthrough": return t.allowedAdditionalProperties; - case "strict": return t.rejectedAdditionalProperties; - case "strip": return "strict" === t.removeAdditionalStrategy ? t.allowedAdditionalProperties : t.rejectedAdditionalProperties; - } - }(e, t); - return void 0 !== c && (n.additionalProperties = c), n; - }(e, n); - case qh.ZodBigInt: return function(e) { - var t = { - type: "integer", - format: "int64" - }; - if (!e.checks) return t; - var n, r = s(e.checks); - try { - for (r.s(); !(n = r.n()).done;) { - var u = n.value; - switch (u.kind) { - case "min": - u.inclusive ? t.minimum = u.value : t.exclusiveMinimum = u.value; - break; - case "max": - u.inclusive ? t.maximum = u.value : t.exclusiveMaximum = u.value; - break; - case "multipleOf": t.multipleOf = u.value; - } - } - } catch (e) { - r.e(e); - } finally { - r.f(); - } - return t; - }(e); - case qh.ZodBoolean: return { type: "boolean" }; - case qh.ZodDate: return vv(e, n); - case qh.ZodUndefined: return { not: {} }; - case qh.ZodNull: return { type: "null" }; - case qh.ZodArray: return function(e, t) { - var n, r, u, a = { type: "array" }; - return null != (n = e.type) && n._def && (null == (u = null == (r = e.type) ? void 0 : r._def) ? void 0 : u.typeName) !== qh.ZodAny && (a.items = Mv(e.type._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["items"]) }))), e.minLength && (a.minItems = e.minLength.value), e.maxLength && (a.maxItems = e.maxLength.value), e.exactLength && (a.minItems = e.exactLength.value, a.maxItems = e.exactLength.value), a; - }(e, n); - case qh.ZodUnion: - case qh.ZodDiscriminatedUnion: return function(e, t) { - var n = e.options instanceof Map ? Array.from(e.options.values()) : e.options; - if (n.every(function(e) { - return e._def.typeName in Nv && (!e._def.checks || !e._def.checks.length); - })) { - var r = n.reduce(function(e, t) { - var n = Nv[t._def.typeName]; - return n && !e.includes(n) ? [].concat(F(e), [n]) : e; - }, []); - return { type: r.length > 1 ? r : r[0] }; - } - if (n.every(function(e) { - return "ZodLiteral" === e._def.typeName && !e.description; - })) { - var u = n.reduce(function(e, t) { - var n = b(t._def.value); - switch (n) { - case "string": - case "number": - case "boolean": return [].concat(F(e), [n]); - case "bigint": return [].concat(F(e), ["integer"]); - case "object": if (null === t._def.value) return [].concat(F(e), ["null"]); - default: return e; - } - }, []); - if (u.length === n.length) { - var a = u.filter(function(e, t, n) { - return n.indexOf(e) === t; - }); - return { - type: a.length > 1 ? a : a[0], - enum: n.reduce(function(e, t) { - return e.includes(t._def.value) ? e : [].concat(F(e), [t._def.value]); - }, []) - }; - } - } else if (n.every(function(e) { - return "ZodEnum" === e._def.typeName; - })) return { - type: "string", - enum: n.reduce(function(e, t) { - return [].concat(F(e), F(t._def.values.filter(function(t) { - return !e.includes(t); - }))); - }, []) - }; - return function(e, t) { - var n = (e.options instanceof Map ? Array.from(e.options.values()) : e.options).map(function(e, n) { - return Mv(e._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["anyOf", "".concat(n)]) })); - }).filter(function(e) { - return !!e && (!t.strictUnions || "object" == b(e) && Object.keys(e).length > 0); - }); - return n.length ? { anyOf: n } : void 0; - }(e, t); - }(e, n); - case qh.ZodIntersection: return function(e, t) { - var n = [Mv(e.left._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["allOf", "0"]) })), Mv(e.right._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["allOf", "1"]) }))].filter(function(e) { - return !!e; - }), r = []; - return n.forEach(function(e) { - if ("type" in (n = e) && "string" === n.type || !("allOf" in n)) { - var t = e; - if ("additionalProperties" in e && !1 === e.additionalProperties) e.additionalProperties, t = v(e, Vt); - r.push(t); - } else r.push.apply(r, F(e.allOf)); - var n; - }), r.length ? { allOf: r } : void 0; - }(e, n); - case qh.ZodTuple: return function(e, t) { - return e.rest ? { - type: "array", - minItems: e.items.length, - items: e.items.map(function(e, n) { - return Mv(e._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["items", "".concat(n)]) })); - }).reduce(function(e, t) { - return void 0 === t ? e : [].concat(F(e), [t]); - }, []), - additionalItems: Mv(e.rest._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["additionalItems"]) })) - } : { - type: "array", - minItems: e.items.length, - maxItems: e.items.length, - items: e.items.map(function(e, n) { - return Mv(e._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["items", "".concat(n)]) })); - }).reduce(function(e, t) { - return void 0 === t ? e : [].concat(F(e), [t]); - }, []) - }; - }(e, n); - case qh.ZodRecord: return jv(e, n); - case qh.ZodLiteral: return function(e) { - var t = b(e.value); - return "bigint" !== t && "number" !== t && "boolean" !== t && "string" !== t ? { type: Array.isArray(e.value) ? "array" : "object" } : { - type: "bigint" === t ? "integer" : t, - const: e.value - }; - }(e); - case qh.ZodEnum: return function(e) { - return { - type: "string", - enum: Array.from(e.values) - }; - }(e); - case qh.ZodNativeEnum: return function(e) { - var t = e.values, n = Object.keys(e.values).filter(function(e) { - return "number" != typeof t[t[e]]; - }).map(function(e) { - return t[e]; - }), r = Array.from(new Set(n.map(function(e) { - return b(e); - }))); - return { - type: 1 === r.length ? "string" === r[0] ? "string" : "number" : ["string", "number"], - enum: n - }; - }(e); - case qh.ZodNullable: return function(e, t) { - if ([ - "ZodString", - "ZodNumber", - "ZodBigInt", - "ZodBoolean", - "ZodNull" - ].includes(e.innerType._def.typeName) && (!e.innerType._def.checks || !e.innerType._def.checks.length)) return { type: [Nv[e.innerType._def.typeName], "null"] }; - var n = Mv(e.innerType._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["anyOf", "0"]) })); - return n && { anyOf: [n, { type: "null" }] }; - }(e, n); - case qh.ZodOptional: return function(e, t) { - var n; - if (t.currentPath.toString() === (null == (n = t.propertyPath) ? void 0 : n.toString())) return Mv(e.innerType._def, t); - var r = Mv(e.innerType._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["anyOf", "1"]) })); - return r ? { anyOf: [{ not: {} }, r] } : {}; - }(e, n); - case qh.ZodMap: return function(e, t) { - return "record" === t.mapStrategy ? jv(e, t) : { - type: "array", - maxItems: 125, - items: { - type: "array", - items: [Mv(e.keyType._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), [ - "items", - "items", - "0" - ]) })) || {}, Mv(e.valueType._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), [ - "items", - "items", - "1" - ]) })) || {}], - minItems: 2, - maxItems: 2 - } - }; - }(e, n); - case qh.ZodSet: return function(e, t) { - var n = { - type: "array", - uniqueItems: !0, - items: Mv(e.valueType._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["items"]) })) - }; - return e.minSize && (n.minItems = e.minSize.value), e.maxSize && (n.maxItems = e.maxSize.value), n; - }(e, n); - case qh.ZodLazy: return function() { - return e.getter()._def; - }; - case qh.ZodPromise: return function(e, t) { - return Mv(e.type._def, t); - }(e, n); - case qh.ZodNaN: - case qh.ZodNever: return { not: {} }; - case qh.ZodEffects: return function(e, t) { - return "input" === t.effectStrategy ? Mv(e.schema._def, t) : {}; - }(e, n); - case qh.ZodAny: - case qh.ZodUnknown: return {}; - case qh.ZodDefault: return function(e, t) { - return h(h({}, Mv(e.innerType._def, t)), {}, { default: e.defaultValue() }); - }(e, n); - case qh.ZodBranded: return hv(e, n); - case qh.ZodReadonly: - case qh.ZodCatch: return function(e, t) { - return Mv(e.innerType._def, t); - }(e, n); - case qh.ZodPipeline: return function(e, t) { - if ("input" === t.pipeStrategy) return Mv(e.in._def, t); - if ("output" === t.pipeStrategy) return Mv(e.out._def, t); - var n = Mv(e.in._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["allOf", "0"]) })); - return { allOf: [n, Mv(e.out._def, h(h({}, t), {}, { currentPath: [].concat(F(t.currentPath), ["allOf", n ? "1" : "0"]) }))].filter(function(e) { - return void 0 !== e; - }) }; - }(e, n); - case qh.ZodFunction: - case qh.ZodVoid: - case qh.ZodSymbol: - default: return; - } -}; -function Mv(e, t) { - var n, r = arguments.length > 2 && void 0 !== arguments[2] && arguments[2], u = t.seen.get(e); - if (t.override) { - var a = null == (n = t.override) ? void 0 : n.call(t, e, t, u, r); - if (a !== dv) return a; - } - if (u && !r) { - var i = Zv(u, t); - if (void 0 !== i) return i; - } - var o = { - def: e, - path: t.currentPath, - jsonSchema: void 0 - }; - t.seen.set(e, o); - var s = Rv(e, e.typeName, t), c = "function" == typeof s ? Mv(s(), t) : s; - if (c && Lv(e, t, c), t.postProcess) { - var l = t.postProcess(c, e, t); - return o.jsonSchema = c, l; - } - return o.jsonSchema = c, c; -} -var Zv = function(e, t) { - switch (t.$refStrategy) { - case "root": return { $ref: e.path.join("/") }; - case "relative": return { $ref: fv(t.currentPath, e.path) }; - case "none": - case "seen": return e.path.length < t.currentPath.length && e.path.every(function(e, n) { - return t.currentPath[n] === e; - }) ? (console.warn("Recursive reference detected at ".concat(t.currentPath.join("/"), "! Defaulting to any")), {}) : "seen" === t.$refStrategy ? {} : void 0; - } -}, Lv = function(e, t, n) { - return e.description && (n.description = e.description), n; -}, $v = function(e, t) { - var n, r = function(e) { - var t = function(e) { - return "string" == typeof e ? h(h({}, pv), {}, { name: e }) : h(h({}, pv), e); - }(e), n = void 0 !== t.name ? [].concat(F(t.basePath), [t.definitionPath, t.name]) : t.basePath; - return h(h({}, t), {}, { - currentPath: n, - propertyPath: void 0, - seen: new Map(Object.entries(t.definitions).map(function(e) { - var n = g(e, 2), r = n[0], u = n[1]; - return [u._def, { - def: u._def, - path: [].concat(F(t.basePath), [t.definitionPath, r]), - jsonSchema: void 0 - }]; - })) - }); - }(t), u = "object" == b(t) && t.definitions ? Object.entries(t.definitions).reduce(function(e, t) { - var n, u = g(t, 2), a = u[0], i = u[1]; - return h(h({}, e), {}, c({}, a, null != (n = Mv(i._def, h(h({}, r), {}, { currentPath: [].concat(F(r.basePath), [r.definitionPath, a]) }), !0)) ? n : {})); - }, {}) : void 0, a = "string" == typeof t ? t : "title" === (null == t ? void 0 : t.nameStrategy) || null == t ? void 0 : t.name, i = null != (n = Mv(e._def, void 0 === a ? r : h(h({}, r), {}, { currentPath: [].concat(F(r.basePath), [r.definitionPath, a]) }), !1)) ? n : {}, o = "object" == b(t) && void 0 !== t.name && "title" === t.nameStrategy ? t.name : void 0; - void 0 !== o && (i.title = o); - var s = void 0 === a ? u ? h(h({}, i), {}, c({}, r.definitionPath, u)) : i : c({ $ref: [].concat(F("relative" === r.$refStrategy ? [] : r.basePath), [r.definitionPath, a]).join("/") }, r.definitionPath, h(h({}, u), {}, c({}, a, i))); - return s.$schema = "http://json-schema.org/draft-07/schema#", s; -}; -function qv(e, t) { - return function(e) { - return "_zod" in e; - }(e) ? function(e) { - return Hv(function() { - return function(e, t) { - if (e instanceof ff) { - var n, r = new Tf(t), u = {}, a = an(e._idmap.entries()); - try { - for (a.s(); !(n = a.n()).done;) { - var i = yn(n.value, 2), o = (i[0], i[1]); - r.process(o); - } - } catch (e) { - a.e(e); - } finally { - a.f(); - } - var s, c = {}, l = { - registry: e, - uri: null == t ? void 0 : t.uri, - defs: u - }, f = an(e._idmap.entries()); - try { - for (f.s(); !(s = f.n()).done;) { - var d = yn(s.value, 2), p = d[0], h = d[1]; - c[p] = r.emit(h, pn(pn({}, t), {}, { external: l })); - } - } catch (e) { - f.e(e); - } finally { - f.f(); - } - if (Object.keys(u).length > 0) c.__shared = on({}, "draft-2020-12" === r.target ? "$defs" : "definitions", u); - return { schemas: c }; - } - var m = new Tf(t); - return m.process(e), m.emit(e, t); - }(e, { - target: "draft-7", - io: "output", - reused: "inline" - }); - }, { validate: (t = r(m().m(function t(n) { - var r; - return m().w(function(t) { - for (;;) switch (t.n) { - case 0: return t.n = 1, Uf(e, n); - case 1: return r = t.v, t.a(2, r.success ? { - success: !0, - value: r.data - } : { - success: !1, - error: r.error - }); - } - }, t); - })), function(e) { - return t.apply(this, arguments); - }) }); - var t; - }(e) : function(e) { - return Hv(function() { - return $v(e, { $refStrategy: "none" }); - }, { validate: (t = r(m().m(function t(n) { - var r; - return m().w(function(t) { - for (;;) switch (t.n) { - case 0: return t.n = 1, e.safeParseAsync(n); - case 1: return r = t.v, t.a(2, r.success ? { - success: !0, - value: r.data - } : { - success: !1, - error: r.error - }); - } - }, t); - })), function(e) { - return t.apply(this, arguments); - }) }); - var t; - }(e); -} -var Uv = Symbol.for("vercel.ai.schema"); -function Hv(e) { - var t = (arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}).validate; - return c(function(e, t, n, r) { - var u = { - configurable: !0, - enumerable: !0 - }; - return u[e] = r, Object.defineProperty(t, n, u); - }("get", c(c(c({}, Uv, !0), "_type", void 0), tv, !0), "jsonSchema", function() { - return "function" == typeof e && (e = e()), e; - }), "validate", t); -} -var Vv, Wv = Object.defineProperty, Kv = "AI_NoObjectGeneratedError", Jv = "vercel.ai.error.".concat(Kv), Qv = Symbol.for(Jv), Gv = function() { - function e(t) { - var n, r = t.message, i = void 0 === r ? "No object generated." : r, o = t.cause, s = t.text, c = t.response, l = t.usage, f = t.finishReason; - return a(this, e), (n = u(this, e, [{ - name: Kv, - message: i, - cause: o - }]))[Vv] = !0, n.text = s, n.response = c, n.usage = l, n.finishReason = f, n; - } - return f(e, Wo), o(e, null, [{ - key: "isInstance", - value: function(e) { - return Wo.hasMarker(e, Jv); - } - }]); -}(); -Vv = Qv; -var Yv = "5.0.93", Xv = Ld([ - nd(), - pp(Uint8Array), - pp(ArrayBuffer), - dp(function(e) { - var t, n; - return null != (n = null == (t = globalThis.Buffer) ? void 0 : t.isBuffer(e)) && n; - }, { message: "Must be a Buffer" }) -]), em = new lp({ - type: "lazy", - getter: function() { - return Ld([ - Od(), - nd(), - kd(), - Sd(), - Hd(nd(), em), - Nd(em) - ]); - } -}), tm = Hd(nd(), Hd(nd(), em)), nm = Rd({ - type: Jd("text"), - text: nd(), - providerOptions: tm.optional() -}), rm = Rd({ - type: Jd("image"), - image: Ld([Xv, pp(URL)]), - mediaType: nd().optional(), - providerOptions: tm.optional() -}), um = Rd({ - type: Jd("file"), - data: Ld([Xv, pp(URL)]), - filename: nd().optional(), - mediaType: nd(), - providerOptions: tm.optional() -}), am = Rd({ - type: Jd("reasoning"), - text: nd(), - providerOptions: tm.optional() -}), im = Rd({ - type: Jd("tool-call"), - toolCallId: nd(), - toolName: nd(), - input: Id(), - providerOptions: tm.optional(), - providerExecuted: Sd().optional() -}), om = new $d(pn({ - type: "union", - options: [ - Rd({ - type: Jd("text"), - value: nd() - }), - Rd({ - type: Jd("json"), - value: em - }), - Rd({ - type: Jd("error-text"), - value: nd() - }), - Rd({ - type: Jd("error-json"), - value: em - }), - Rd({ - type: Jd("content"), - value: Nd(Ld([Rd({ - type: Jd("text"), - text: nd() - }), Rd({ - type: Jd("media"), - data: nd(), - mediaType: nd() - })])) - }) - ], - discriminator: "type" -}, Ns(void 0))), sm = Rd({ - type: Jd("tool-result"), - toolCallId: nd(), - toolName: nd(), - output: om, - providerOptions: tm.optional() -}); -Ld([ - Rd({ - role: Jd("system"), - content: nd(), - providerOptions: tm.optional() - }), - Rd({ - role: Jd("user"), - content: Ld([nd(), Nd(Ld([ - nm, - rm, - um - ]))]), - providerOptions: tm.optional() - }), - Rd({ - role: Jd("assistant"), - content: Ld([nd(), Nd(Ld([ - nm, - um, - am, - im, - sm - ]))]), - providerOptions: tm.optional() - }), - Rd({ - role: Jd("tool"), - content: Nd(sm), - providerOptions: tm.optional() - }) -]), Wh({ - prefix: "aitxt", - size: 24 -}), TransformStream; -var dm = function() { - var e; - return function() { - return null == e && (e = qv(Ld([ - Md({ - type: Jd("text-start"), - id: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("text-delta"), - id: nd(), - delta: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("text-end"), - id: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("error"), - errorText: nd() - }), - Md({ - type: Jd("tool-input-start"), - toolCallId: nd(), - toolName: nd(), - providerExecuted: Sd().optional(), - dynamic: Sd().optional() - }), - Md({ - type: Jd("tool-input-delta"), - toolCallId: nd(), - inputTextDelta: nd() - }), - Md({ - type: Jd("tool-input-available"), - toolCallId: nd(), - toolName: nd(), - input: Id(), - providerExecuted: Sd().optional(), - providerMetadata: tm.optional(), - dynamic: Sd().optional() - }), - Md({ - type: Jd("tool-input-error"), - toolCallId: nd(), - toolName: nd(), - input: Id(), - providerExecuted: Sd().optional(), - providerMetadata: tm.optional(), - dynamic: Sd().optional(), - errorText: nd() - }), - Md({ - type: Jd("tool-output-available"), - toolCallId: nd(), - output: Id(), - providerExecuted: Sd().optional(), - dynamic: Sd().optional(), - preliminary: Sd().optional() - }), - Md({ - type: Jd("tool-output-error"), - toolCallId: nd(), - errorText: nd(), - providerExecuted: Sd().optional(), - dynamic: Sd().optional() - }), - Md({ - type: Jd("reasoning-start"), - id: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("reasoning-delta"), - id: nd(), - delta: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("reasoning-end"), - id: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("source-url"), - sourceId: nd(), - url: nd(), - title: nd().optional(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("source-document"), - sourceId: nd(), - mediaType: nd(), - title: nd(), - filename: nd().optional(), - providerMetadata: tm.optional() - }), - Md({ - type: Jd("file"), - url: nd(), - mediaType: nd(), - providerMetadata: tm.optional() - }), - Md({ - type: dp(function(e) { - return "string" == typeof e && e.startsWith("data-"); - }, { message: "Type must start with \"data-\"" }), - id: nd().optional(), - data: Id(), - transient: Sd().optional() - }), - Md({ type: Jd("start-step") }), - Md({ type: Jd("finish-step") }), - Md({ - type: Jd("start"), - messageId: nd().optional(), - messageMetadata: Id().optional() - }), - Md({ - type: Jd("finish"), - finishReason: Wd([ - "stop", - "length", - "content-filter", - "tool-calls", - "error", - "other", - "unknown" - ]).optional(), - messageMetadata: Id().optional() - }), - Md({ type: Jd("abort") }), - Md({ - type: Jd("message-metadata"), - messageMetadata: Id() - }) - ]))), e; - }; -}(); -function pm(e, t) { - if (void 0 !== e || void 0 !== t) { - if (void 0 === e) return t; - if (void 0 === t) return e; - var n = h({}, e); - for (var r in t) if (Object.prototype.hasOwnProperty.call(t, r)) { - var u = t[r]; - if (void 0 === u) continue; - var a = r in e ? e[r] : void 0, i = !(null === u || "object" != b(u) || Array.isArray(u) || u instanceof Date || u instanceof RegExp), o = !(null == a || "object" != b(a) || Array.isArray(a) || a instanceof Date || a instanceof RegExp); - n[r] = i && o ? pm(a, u) : u; - } - return n; - } -} -function hm(e) { - var t = ["ROOT"], n = -1, r = null; - function u(e, u, a) { - switch (e) { - case "\"": - n = u, t.pop(), t.push(a), t.push("INSIDE_STRING"); - break; - case "f": - case "t": - case "n": - n = u, r = u, t.pop(), t.push(a), t.push("INSIDE_LITERAL"); - break; - case "-": - t.pop(), t.push(a), t.push("INSIDE_NUMBER"); - break; - case "0": - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": - case "8": - case "9": - n = u, t.pop(), t.push(a), t.push("INSIDE_NUMBER"); - break; - case "{": - n = u, t.pop(), t.push(a), t.push("INSIDE_OBJECT_START"); - break; - case "[": n = u, t.pop(), t.push(a), t.push("INSIDE_ARRAY_START"); - } - } - function a(e, r) { - switch (e) { - case ",": - t.pop(), t.push("INSIDE_OBJECT_AFTER_COMMA"); - break; - case "}": n = r, t.pop(); - } - } - function i(e, r) { - switch (e) { - case ",": - t.pop(), t.push("INSIDE_ARRAY_AFTER_COMMA"); - break; - case "]": n = r, t.pop(); - } - } - for (var o = 0; o < e.length; o++) { - var s = e[o]; - switch (t[t.length - 1]) { - case "ROOT": - u(s, o, "FINISH"); - break; - case "INSIDE_OBJECT_START": - switch (s) { - case "\"": - t.pop(), t.push("INSIDE_OBJECT_KEY"); - break; - case "}": n = o, t.pop(); - } - break; - case "INSIDE_OBJECT_AFTER_COMMA": - "\"" === s && (t.pop(), t.push("INSIDE_OBJECT_KEY")); - break; - case "INSIDE_OBJECT_KEY": - "\"" === s && (t.pop(), t.push("INSIDE_OBJECT_AFTER_KEY")); - break; - case "INSIDE_OBJECT_AFTER_KEY": - ":" === s && (t.pop(), t.push("INSIDE_OBJECT_BEFORE_VALUE")); - break; - case "INSIDE_OBJECT_BEFORE_VALUE": - u(s, o, "INSIDE_OBJECT_AFTER_VALUE"); - break; - case "INSIDE_OBJECT_AFTER_VALUE": - a(s, o); - break; - case "INSIDE_STRING": - switch (s) { - case "\"": - t.pop(), n = o; - break; - case "\\": - t.push("INSIDE_STRING_ESCAPE"); - break; - default: n = o; - } - break; - case "INSIDE_ARRAY_START": - "]" === s ? (n = o, t.pop()) : (n = o, u(s, o, "INSIDE_ARRAY_AFTER_VALUE")); - break; - case "INSIDE_ARRAY_AFTER_VALUE": - switch (s) { - case ",": - t.pop(), t.push("INSIDE_ARRAY_AFTER_COMMA"); - break; - case "]": - n = o, t.pop(); - break; - default: n = o; - } - break; - case "INSIDE_ARRAY_AFTER_COMMA": - u(s, o, "INSIDE_ARRAY_AFTER_VALUE"); - break; - case "INSIDE_STRING_ESCAPE": - t.pop(), n = o; - break; - case "INSIDE_NUMBER": - switch (s) { - case "0": - case "1": - case "2": - case "3": - case "4": - case "5": - case "6": - case "7": - case "8": - case "9": - n = o; - break; - case "e": - case "E": - case "-": - case ".": break; - case ",": - t.pop(), "INSIDE_ARRAY_AFTER_VALUE" === t[t.length - 1] && i(s, o), "INSIDE_OBJECT_AFTER_VALUE" === t[t.length - 1] && a(s, o); - break; - case "}": - t.pop(), "INSIDE_OBJECT_AFTER_VALUE" === t[t.length - 1] && a(s, o); - break; - case "]": - t.pop(), "INSIDE_ARRAY_AFTER_VALUE" === t[t.length - 1] && i(s, o); - break; - default: t.pop(); - } - break; - case "INSIDE_LITERAL": - var c = e.substring(r, o + 1); - "false".startsWith(c) || "true".startsWith(c) || "null".startsWith(c) ? n = o : (t.pop(), "INSIDE_OBJECT_AFTER_VALUE" === t[t.length - 1] ? a(s, o) : "INSIDE_ARRAY_AFTER_VALUE" === t[t.length - 1] && i(s, o)); - } - } - for (var l = e.slice(0, n + 1), f = t.length - 1; f >= 0; f--) switch (t[f]) { - case "INSIDE_STRING": - l += "\""; - break; - case "INSIDE_OBJECT_KEY": - case "INSIDE_OBJECT_AFTER_KEY": - case "INSIDE_OBJECT_AFTER_COMMA": - case "INSIDE_OBJECT_START": - case "INSIDE_OBJECT_BEFORE_VALUE": - case "INSIDE_OBJECT_AFTER_VALUE": - l += "}"; - break; - case "INSIDE_ARRAY_START": - case "INSIDE_ARRAY_AFTER_COMMA": - case "INSIDE_ARRAY_AFTER_VALUE": - l += "]"; - break; - case "INSIDE_LITERAL": - var d = e.substring(r, e.length); - "true".startsWith(d) ? l += "true".slice(d.length) : "false".startsWith(d) ? l += "false".slice(d.length) : "null".startsWith(d) && (l += "null".slice(d.length)); - } - return l; -} -function vm(e) { - return mm.apply(this, arguments); -} -function mm() { - return mm = r(m().m(function e(t) { - var n, r; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (void 0 !== t) { - e.n = 1; - break; - } - return e.a(2, { - value: void 0, - state: "undefined-input" - }); - case 1: return e.n = 2, ov({ text: t }); - case 2: - if (!(n = e.v).success) { - e.n = 3; - break; - } - r = { - value: n.value, - state: "successful-parse" - }, e.n = 5; - break; - case 3: return e.n = 4, ov({ text: hm(t) }); - case 4: n = e.v, r = n.success ? { - value: n.value, - state: "repaired-parse" - } : { - value: void 0, - state: "failed-parse" - }; - case 5: return e.a(2, r); - } - }, e); - })), mm.apply(this, arguments); -} -function Dm(e) { - return e.type.startsWith("tool-"); -} -function ym(e) { - return Dm(e) || function(e) { - return "dynamic-tool" === e.type; - }(e); -} -function gm(e) { - return e.type.split("-").slice(1).join("-"); -} -function Fm(e) { - var t = e.lastMessage, n = e.messageId; - return { - message: "assistant" === (null == t ? void 0 : t.role) ? t : { - id: n, - metadata: void 0, - role: "assistant", - parts: [] - }, - activeTextParts: {}, - activeReasoningParts: {}, - partialToolCalls: {} - }; -} -function Em(e) { - var t = e.stream, n = e.messageMetadataSchema, u = e.dataPartSchemas, a = e.runUpdateMessageJob, i = e.onError, o = e.onToolCall, s = e.onData; - return t.pipeThrough(new TransformStream({ transform: function(e, t) { - return r(m().m(function c() { - return m().w(function(c) { - for (;;) switch (c.n) { - case 0: return c.n = 1, a(function() { - var a = r(m().m(function a(c) { - var l, f, d, p, v, D, y, g, F, E, b, _, k, C, A, w, S, x, O, B, I, T, P, j, N, z, R, M, Z; - return m().w(function(a) { - for (;;) switch (a.n) { - case 0: - _ = function() { - return _ = r(m().m(function e(t) { - var r; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (null == t) { - e.n = 2; - break; - } - if (r = null != l.message.metadata ? pm(l.message.metadata, t) : t, !(null != n)) { - e.n = 1; - break; - } - return e.n = 1, rv({ - value: r, - schema: n - }); - case 1: l.message.metadata = r; - case 2: return e.a(2); - } - }, e); - })), _.apply(this, arguments); - }, b = function(e) { - return _.apply(this, arguments); - }, E = function(e) { - var t, n, r = l.message.parts.find(function(t) { - return "dynamic-tool" === t.type && t.toolCallId === e.toolCallId; - }), u = e, a = r; - null != r ? (r.state = e.state, a.toolName = e.toolName, a.input = u.input, a.output = u.output, a.errorText = u.errorText, a.rawInput = null != (t = u.rawInput) ? t : a.rawInput, a.preliminary = u.preliminary, a.providerExecuted = null != (n = u.providerExecuted) ? n : r.providerExecuted, null != u.providerMetadata && "input-available" === r.state && (r.callProviderMetadata = u.providerMetadata)) : l.message.parts.push(h({ - type: "dynamic-tool", - toolName: e.toolName, - toolCallId: e.toolCallId, - state: e.state, - input: u.input, - output: u.output, - errorText: u.errorText, - preliminary: u.preliminary, - providerExecuted: u.providerExecuted - }, null != u.providerMetadata ? { callProviderMetadata: u.providerMetadata } : {})); - }, F = function(e) { - var t, n = l.message.parts.find(function(t) { - return Dm(t) && t.toolCallId === e.toolCallId; - }), r = e, u = n; - null != n ? (n.state = e.state, u.input = r.input, u.output = r.output, u.errorText = r.errorText, u.rawInput = r.rawInput, u.preliminary = r.preliminary, u.providerExecuted = null != (t = r.providerExecuted) ? t : n.providerExecuted, null != r.providerMetadata && "input-available" === n.state && (n.callProviderMetadata = r.providerMetadata)) : l.message.parts.push(h({ - type: "tool-".concat(e.toolName), - toolCallId: e.toolCallId, - state: e.state, - input: r.input, - output: r.output, - rawInput: r.rawInput, - errorText: r.errorText, - providerExecuted: r.providerExecuted, - preliminary: r.preliminary - }, null != r.providerMetadata ? { callProviderMetadata: r.providerMetadata } : {})); - }, g = function(e) { - var t = l.message.parts.filter(function(e) { - return "dynamic-tool" === e.type; - }).find(function(t) { - return t.toolCallId === e; - }); - if (null == t) throw new Error("tool-output-error must be preceded by a tool-input-available"); - return t; - }, y = function(e) { - var t = l.message.parts.filter(Dm).find(function(t) { - return t.toolCallId === e; - }); - if (null == t) throw new Error("tool-output-error must be preceded by a tool-input-available"); - return t; - }, l = c.state, f = c.write, Z = e.type, a.n = "text-start" === Z ? 1 : "text-delta" === Z ? 2 : "text-end" === Z ? 3 : "reasoning-start" === Z ? 4 : "reasoning-delta" === Z ? 5 : "reasoning-end" === Z ? 6 : "file" === Z ? 7 : "source-url" === Z ? 8 : "source-document" === Z ? 9 : "tool-input-start" === Z ? 10 : "tool-input-delta" === Z ? 11 : "tool-input-available" === Z ? 13 : "tool-input-error" === Z ? 15 : "tool-output-available" === Z ? 16 : "tool-output-error" === Z ? 17 : "start-step" === Z ? 18 : "finish-step" === Z ? 19 : "start" === Z ? 20 : "finish" === Z ? 22 : "message-metadata" === Z ? 24 : "error" === Z ? 26 : 27; - break; - case 1: return k = { - type: "text", - text: "", - providerMetadata: e.providerMetadata, - state: "streaming" - }, l.activeTextParts[e.id] = k, l.message.parts.push(k), f(), a.a(3, 30); - case 2: return (C = l.activeTextParts[e.id]).text += e.delta, C.providerMetadata = null != (d = e.providerMetadata) ? d : C.providerMetadata, f(), a.a(3, 30); - case 3: return (A = l.activeTextParts[e.id]).state = "done", A.providerMetadata = null != (p = e.providerMetadata) ? p : A.providerMetadata, delete l.activeTextParts[e.id], f(), a.a(3, 30); - case 4: return w = { - type: "reasoning", - text: "", - providerMetadata: e.providerMetadata, - state: "streaming" - }, l.activeReasoningParts[e.id] = w, l.message.parts.push(w), f(), a.a(3, 30); - case 5: return (S = l.activeReasoningParts[e.id]).text += e.delta, S.providerMetadata = null != (v = e.providerMetadata) ? v : S.providerMetadata, f(), a.a(3, 30); - case 6: return (x = l.activeReasoningParts[e.id]).providerMetadata = null != (D = e.providerMetadata) ? D : x.providerMetadata, x.state = "done", delete l.activeReasoningParts[e.id], f(), a.a(3, 30); - case 7: return l.message.parts.push({ - type: "file", - mediaType: e.mediaType, - url: e.url - }), f(), a.a(3, 30); - case 8: return l.message.parts.push({ - type: "source-url", - sourceId: e.sourceId, - url: e.url, - title: e.title, - providerMetadata: e.providerMetadata - }), f(), a.a(3, 30); - case 9: return l.message.parts.push({ - type: "source-document", - sourceId: e.sourceId, - mediaType: e.mediaType, - title: e.title, - filename: e.filename, - providerMetadata: e.providerMetadata - }), f(), a.a(3, 30); - case 10: return O = l.message.parts.filter(Dm), l.partialToolCalls[e.toolCallId] = { - text: "", - toolName: e.toolName, - index: O.length, - dynamic: e.dynamic - }, e.dynamic ? E({ - toolCallId: e.toolCallId, - toolName: e.toolName, - state: "input-streaming", - input: void 0, - providerExecuted: e.providerExecuted - }) : F({ - toolCallId: e.toolCallId, - toolName: e.toolName, - state: "input-streaming", - input: void 0, - providerExecuted: e.providerExecuted - }), f(), a.a(3, 30); - case 11: return (B = l.partialToolCalls[e.toolCallId]).text += e.inputTextDelta, a.n = 12, vm(B.text); - case 12: return I = a.v, T = I.value, B.dynamic ? E({ - toolCallId: e.toolCallId, - toolName: B.toolName, - state: "input-streaming", - input: T - }) : F({ - toolCallId: e.toolCallId, - toolName: B.toolName, - state: "input-streaming", - input: T - }), f(), a.a(3, 30); - case 13: - if (e.dynamic ? E({ - toolCallId: e.toolCallId, - toolName: e.toolName, - state: "input-available", - input: e.input, - providerExecuted: e.providerExecuted, - providerMetadata: e.providerMetadata - }) : F({ - toolCallId: e.toolCallId, - toolName: e.toolName, - state: "input-available", - input: e.input, - providerExecuted: e.providerExecuted, - providerMetadata: e.providerMetadata - }), f(), !(o && !e.providerExecuted)) { - a.n = 14; - break; - } - return a.n = 14, o({ toolCall: e }); - case 14: return a.a(3, 30); - case 15: return e.dynamic ? E({ - toolCallId: e.toolCallId, - toolName: e.toolName, - state: "output-error", - input: e.input, - errorText: e.errorText, - providerExecuted: e.providerExecuted, - providerMetadata: e.providerMetadata - }) : F({ - toolCallId: e.toolCallId, - toolName: e.toolName, - state: "output-error", - input: void 0, - rawInput: e.input, - errorText: e.errorText, - providerExecuted: e.providerExecuted, - providerMetadata: e.providerMetadata - }), f(), a.a(3, 30); - case 16: return e.dynamic ? (P = g(e.toolCallId), E({ - toolCallId: e.toolCallId, - toolName: P.toolName, - state: "output-available", - input: P.input, - output: e.output, - preliminary: e.preliminary - })) : (j = y(e.toolCallId), F({ - toolCallId: e.toolCallId, - toolName: gm(j), - state: "output-available", - input: j.input, - output: e.output, - providerExecuted: e.providerExecuted, - preliminary: e.preliminary - })), f(), a.a(3, 30); - case 17: return e.dynamic ? (N = g(e.toolCallId), E({ - toolCallId: e.toolCallId, - toolName: N.toolName, - state: "output-error", - input: N.input, - errorText: e.errorText, - providerExecuted: e.providerExecuted - })) : (z = y(e.toolCallId), F({ - toolCallId: e.toolCallId, - toolName: gm(z), - state: "output-error", - input: z.input, - rawInput: z.rawInput, - errorText: e.errorText, - providerExecuted: e.providerExecuted - })), f(), a.a(3, 30); - case 18: return l.message.parts.push({ type: "step-start" }), a.a(3, 30); - case 19: return l.activeTextParts = {}, l.activeReasoningParts = {}, a.a(3, 30); - case 20: return null != e.messageId && (l.message.id = e.messageId), a.n = 21, b(e.messageMetadata); - case 21: return null == e.messageId && null == e.messageMetadata || f(), a.a(3, 30); - case 22: return null != e.finishReason && (l.finishReason = e.finishReason), a.n = 23, b(e.messageMetadata); - case 23: return null != e.messageMetadata && f(), a.a(3, 30); - case 24: return a.n = 25, b(e.messageMetadata); - case 25: return null != e.messageMetadata && f(), a.a(3, 30); - case 26: return null == i || i(new Error(e.errorText)), a.a(3, 30); - case 27: - if (!function(e) { - return e.type.startsWith("data-"); - }(e)) { - a.n = 30; - break; - } - if (!(null != (null == u ? void 0 : u[e.type]))) { - a.n = 28; - break; - } - return a.n = 28, rv({ - value: e.data, - schema: u[e.type] - }); - case 28: - if (!(R = e).transient) { - a.n = 29; - break; - } - return null == s || s(R), a.a(3, 30); - case 29: M = null != R.id ? l.message.parts.find(function(e) { - return R.type === e.type && R.id === e.id; - }) : void 0, null != M ? M.data = R.data : l.message.parts.push(R), null == s || s(R), f(); - case 30: t.enqueue(e); - case 31: return a.a(2); - } - }, a); - })); - return function(e) { - return a.apply(this, arguments); - }; - }()); - case 1: return c.a(2); - } - }, c); - }))(); - } })); -} -Wh({ - prefix: "aitxt", - size: 24 -}), Wh({ - prefix: "aiobj", - size: 24 -}); -var bm = function() { - return o(function e() { - a(this, e), this.queue = [], this.isProcessing = !1; - }, [{ - key: "processQueue", - value: (t = r(m().m(function e() { - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (this.isProcessing) { - e.n = 5; - break; - } - this.isProcessing = !0; - case 1: - if (!(this.queue.length > 0)) { - e.n = 4; - break; - } - return e.n = 2, this.queue[0](); - case 2: this.queue.shift(); - case 3: - e.n = 1; - break; - case 4: this.isProcessing = !1; - case 5: return e.a(2); - } - }, e, this); - })), function() { - return t.apply(this, arguments); - }) - }, { - key: "run", - value: (e = r(m().m(function e(t) { - var n = this; - return m().w(function(e) { - for (;;) if (0 === e.n) return e.a(2, new Promise(function(e, u) { - n.queue.push(r(m().m(function n() { - var r; - return m().w(function(n) { - for (;;) switch (n.p = n.n) { - case 0: return n.p = 0, n.n = 1, t(); - case 1: - e(), n.n = 3; - break; - case 2: n.p = 2, r = n.v, u(r); - case 3: return n.a(2); - } - }, n, null, [[0, 2]]); - }))), n.processQueue(); - })); - }, e); - })), function(t) { - return e.apply(this, arguments); - }) - }]); - var e, t; -}(); -Wh({ - prefix: "aiobj", - size: 24 -}), function(e, t) { - for (var n in t) Wv(e, n, { - get: t[n], - enumerable: !0 - }); -}({}, { - object: function() { - return Am; - }, - text: function() { - return Cm; - } -}); -var _m, km, Cm = function() { - return { - type: "text", - responseFormat: { type: "text" }, - parsePartial: (t = r(m().m(function e(t) { - var n; - return m().w(function(e) { - for (;;) if (0 === e.n) return n = t.text, e.a(2, { partial: n }); - }, e); - })), function(e) { - return t.apply(this, arguments); - }), - parseOutput: (e = r(m().m(function e(t) { - var n; - return m().w(function(e) { - for (;;) if (0 === e.n) return n = t.text, e.a(2, n); - }, e); - })), function(t) { - return e.apply(this, arguments); - }) - }; - var e, t; -}, Am = function(e) { - var t = function(e) { - return null == e ? Hv({ - properties: {}, - additionalProperties: !1 - }) : "object" == b(t = e) && null !== t && Uv in t && !0 === t[Uv] && "jsonSchema" in t && "validate" in t ? e : "function" == typeof e ? e() : qv(e); - var t; - }(e.schema); - return { - type: "object", - responseFormat: { - type: "json", - schema: t.jsonSchema - }, - parsePartial: function(e) { - return r(m().m(function t() { - var n, r, u, a; - return m().w(function(t) { - for (;;) switch (t.n) { - case 0: return n = e.text, t.n = 1, vm(n); - case 1: - r = t.v, a = r.state, t.n = "failed-parse" === a || "undefined-input" === a ? 2 : "repaired-parse" === a || "successful-parse" === a ? 3 : 4; - break; - case 2: - case 5: return t.a(2); - case 3: return t.a(2, { partial: r.value }); - case 4: throw u = r.state, new Error("Unsupported parse state: ".concat(u)); - } - }, t); - }))(); - }, - parseOutput: function(e, n) { - return r(m().m(function r() { - var u, a, i; - return m().w(function(r) { - for (;;) switch (r.n) { - case 0: return u = e.text, r.n = 1, ov({ text: u }); - case 1: - if ((a = r.v).success) { - r.n = 2; - break; - } - throw new Gv({ - message: "No object generated: could not parse the response.", - cause: a.error, - text: u, - response: n.response, - usage: n.usage, - finishReason: n.finishReason - }); - case 2: return r.n = 3, av({ - value: a.value, - schema: t - }); - case 3: - if ((i = r.v).success) { - r.n = 4; - break; - } - throw new Gv({ - message: "No object generated: response did not match schema.", - cause: i.error, - text: u, - response: n.response, - usage: n.usage, - finishReason: n.finishReason - }); - case 4: return r.a(2, i.value); - } - }, r); - }))(); - } - }; -}, wm = function() { - return o(function e(t) { - var n = t.api, r = void 0 === n ? "/api/chat" : n, u = t.credentials, i = t.headers, o = t.body, s = t.fetch, c = t.prepareSendMessagesRequest, l = t.prepareReconnectToStreamRequest; - a(this, e), this.api = r, this.credentials = u, this.headers = i, this.body = o, this.fetch = s, this.prepareSendMessagesRequest = c, this.prepareReconnectToStreamRequest = l; - }, [{ - key: "sendMessages", - value: (t = r(m().m(function e(t) { - var n, r, u, a, i, o, s, c, l, f, d, p, D, y, g, F, E, b, _, k; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: return n = t.abortSignal, r = v(t, Wt), e.n = 1, cv(this.body); - case 1: return c = e.v, e.n = 2, cv(this.headers); - case 2: return l = e.v, e.n = 3, cv(this.credentials); - case 3: return f = e.v, d = h(h({}, Qh(l)), Qh(r.headers)), e.n = 4, null == (u = this.prepareSendMessagesRequest) ? void 0 : u.call(this, { - api: this.api, - id: r.chatId, - messages: r.messages, - body: h(h({}, c), r.body), - headers: d, - credentials: f, - requestMetadata: r.metadata, - trigger: r.trigger, - messageId: r.messageId - }); - case 4: return p = e.v, D = null != (a = null == p ? void 0 : p.api) ? a : this.api, y = void 0 !== (null == p ? void 0 : p.headers) ? Qh(p.headers) : d, g = void 0 !== (null == p ? void 0 : p.body) ? p.body : h(h(h({}, c), r.body), {}, { - id: r.chatId, - messages: r.messages, - trigger: r.trigger, - messageId: r.messageId - }), F = null != (i = null == p ? void 0 : p.credentials) ? i : f, E = null != (o = this.fetch) ? o : globalThis.fetch, e.n = 5, E(D, { - method: "POST", - headers: Gh(h({ "Content-Type": "application/json" }, y), "ai-sdk/".concat(Yv), Jh()), - body: JSON.stringify(g), - credentials: F, - signal: n - }); - case 5: - if ((b = e.v).ok) { - e.n = 9; - break; - } - return _ = Error, e.n = 6, b.text(); - case 6: - if (null == (s = e.v)) { - e.n = 7; - break; - } - k = s, e.n = 8; - break; - case 7: k = "Failed to fetch the chat response."; - case 8: throw new _(k); - case 9: - if (b.body) { - e.n = 10; - break; - } - throw new Error("The response body is empty."); - case 10: return e.a(2, this.processResponseStream(b.body)); - } - }, e, this); - })), function(e) { - return t.apply(this, arguments); - }) - }, { - key: "reconnectToStream", - value: (e = r(m().m(function e(t) { - var n, r, u, a, i, o, s, c, l, f, d, p, v, D, y, g, F; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, cv(this.body); - case 1: return o = e.v, e.n = 2, cv(this.headers); - case 2: return s = e.v, e.n = 3, cv(this.credentials); - case 3: return c = e.v, l = h(h({}, Qh(s)), Qh(t.headers)), e.n = 4, null == (n = this.prepareReconnectToStreamRequest) ? void 0 : n.call(this, { - api: this.api, - id: t.chatId, - body: h(h({}, o), t.body), - headers: l, - credentials: c, - requestMetadata: t.metadata - }); - case 4: return f = e.v, d = null != (r = null == f ? void 0 : f.api) ? r : "".concat(this.api, "/").concat(t.chatId, "/stream"), p = void 0 !== (null == f ? void 0 : f.headers) ? Qh(f.headers) : l, v = null != (u = null == f ? void 0 : f.credentials) ? u : c, D = null != (a = this.fetch) ? a : globalThis.fetch, e.n = 5, D(d, { - method: "GET", - headers: Gh(p, "ai-sdk/".concat(Yv), Jh()), - credentials: v - }); - case 5: - if (204 !== (y = e.v).status) { - e.n = 6; - break; - } - return e.a(2, null); - case 6: - if (y.ok) { - e.n = 10; - break; - } - return g = Error, e.n = 7, y.text(); - case 7: - if (null == (i = e.v)) { - e.n = 8; - break; - } - F = i, e.n = 9; - break; - case 8: F = "Failed to fetch the chat response."; - case 9: throw new g(F); - case 10: - if (y.body) { - e.n = 11; - break; - } - throw new Error("The response body is empty."); - case 11: return e.a(2, this.processResponseStream(y.body)); - } - }, e, this); - })), function(t) { - return e.apply(this, arguments); - }) - }]); - var e, t; -}(), Sm = function() { - function e() { - var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; - return a(this, e), u(this, e, [t]); - } - return f(e, wm), o(e, [{ - key: "processResponseStream", - value: function(e) { - return function(e) { - var t = e.schema; - return e.stream.pipeThrough(new TextDecoderStream()).pipeThrough(new ds()).pipeThrough(new TransformStream({ transform: function(e, n) { - return r(m().m(function r() { - var u, a; - return m().w(function(r) { - for (;;) switch (r.n) { - case 0: - if (u = e.data, !("[DONE]" !== u)) { - r.n = 2; - break; - } - return a = n, r.n = 1, ov({ - text: u, - schema: t - }); - case 1: a.enqueue.call(a, r.v); - case 2: return r.a(2); - } - }, r); - }))(); - } })); - }({ - stream: e, - schema: dm - }).pipeThrough(new TransformStream({ transform: function(e, t) { - return r(m().m(function n() { - return m().w(function(n) { - for (;;) switch (n.n) { - case 0: - if (e.success) { - n.n = 1; - break; - } - throw e.error; - case 1: t.enqueue(e.value); - case 2: return n.a(2); - } - }, n); - }))(); - } })); - } - }]); -}(), xm = function() { - return o(function e(t) { - var n = this, u = t.generateId, i = void 0 === u ? Kh : u, o = t.id, s = void 0 === o ? i() : o, c = t.transport, l = void 0 === c ? new Sm() : c, f = t.messageMetadataSchema, d = t.dataPartSchemas, p = t.state, D = t.onError, y = t.onToolCall, g = t.onFinish, E = t.onData, b = t.sendAutomaticallyWhen; - a(this, e), this.activeResponse = void 0, this.jobExecutor = new bm(), this.sendMessage = function() { - var e = r(m().m(function e(t, u) { - var a, i, o, s, c, l, f; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (null != t) { - e.n = 2; - break; - } - return e.n = 1, n.makeRequest(h({ - trigger: "submit-message", - messageId: null == (a = n.lastMessage) ? void 0 : a.id - }, u)); - case 1: return e.a(2, void e.v); - case 2: - if (!("text" in t) && !("files" in t)) { - e.n = 6; - break; - } - if (!Array.isArray(t.files)) { - e.n = 3; - break; - } - f = t.files, e.n = 5; - break; - case 3: return e.n = 4, function() { - var e = r(m().m(function e(t) { - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (null != t) { - e.n = 1; - break; - } - return e.a(2, []); - case 1: - if (globalThis.FileList && t instanceof globalThis.FileList) { - e.n = 2; - break; - } - throw new Error("FileList is not supported in the current environment"); - case 2: return e.a(2, Promise.all(Array.from(t).map(function() { - var e = r(m().m(function e(t) { - var n, r, u, a, i; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: return n = t.name, r = t.type, u = r, a = n, e.n = 1, new Promise(function(e, n) { - var r = new FileReader(); - r.onload = function(t) { - var n; - e(null == (n = t.target) ? void 0 : n.result); - }, r.onerror = function(e) { - return n(e); - }, r.readAsDataURL(t); - }); - case 1: return i = e.v, e.a(2, { - type: "file", - mediaType: u, - filename: a, - url: i - }); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; - }()))); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; - }()(t.files); - case 4: f = e.v; - case 5: - c = { parts: [].concat(F(f), F("text" in t && null != t.text ? [{ - type: "text", - text: t.text - }] : [])) }, e.n = 7; - break; - case 6: c = t; - case 7: - if (null == t.messageId) { - e.n = 10; - break; - } - if (l = n.state.messages.findIndex(function(e) { - return e.id === t.messageId; - }), -1 !== l) { - e.n = 8; - break; - } - throw new Error("message with id ".concat(t.messageId, " not found")); - case 8: - if ("user" === n.state.messages[l].role) { - e.n = 9; - break; - } - throw new Error("message with id ".concat(t.messageId, " is not a user message")); - case 9: - n.state.messages = n.state.messages.slice(0, l + 1), n.state.replaceMessage(l, h(h({}, c), {}, { - id: t.messageId, - role: null != (i = c.role) ? i : "user", - metadata: t.metadata - })), e.n = 11; - break; - case 10: n.state.pushMessage(h(h({}, c), {}, { - id: null != (o = c.id) ? o : n.generateId(), - role: null != (s = c.role) ? s : "user", - metadata: t.metadata - })); - case 11: return e.n = 12, n.makeRequest(h({ - trigger: "submit-message", - messageId: t.messageId - }, u)); - case 12: return e.a(2); - } - }, e); - })); - return function(t, n) { - return e.apply(this, arguments); - }; - }(), this.regenerate = r(m().m(function e() { - var t, r, u, a, i = arguments; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (r = (t = i.length > 0 && void 0 !== i[0] ? i[0] : {}).messageId, u = v(t, Kt), a = null == r ? n.state.messages.length - 1 : n.state.messages.findIndex(function(e) { - return e.id === r; - }), -1 !== a) { - e.n = 1; - break; - } - throw new Error("message ".concat(r, " not found")); - case 1: return n.state.messages = n.state.messages.slice(0, "assistant" === n.messages[a].role ? a : a + 1), e.n = 2, n.makeRequest(h({ - trigger: "regenerate-message", - messageId: r - }, u)); - case 2: return e.a(2); - } - }, e); - })), this.resumeStream = r(m().m(function e() { - var t, r = arguments; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: return t = r.length > 0 && void 0 !== r[0] ? r[0] : {}, e.n = 1, n.makeRequest(h({ trigger: "resume-stream" }, t)); - case 1: return e.a(2); - } - }, e); - })), this.clearError = function() { - "error" === n.status && (n.state.error = void 0, n.setStatus({ status: "ready" })); - }, this.addToolOutput = function() { - var e = r(m().m(function e(t) { - var u, a, i, o, s; - return m().w(function(e) { - for (;;) if (0 === e.n) return u = t.state, a = void 0 === u ? "output-available" : u, t.tool, i = t.toolCallId, o = t.output, s = t.errorText, e.a(2, n.jobExecutor.run(r(m().m(function e() { - var t, r, u, c; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: u = n.state.messages, c = u[u.length - 1], n.state.replaceMessage(u.length - 1, h(h({}, c), {}, { parts: c.parts.map(function(e) { - return ym(e) && e.toolCallId === i ? h(h({}, e), {}, { - state: a, - output: o, - errorText: s - }) : e; - }) })), n.activeResponse && (n.activeResponse.state.message.parts = n.activeResponse.state.message.parts.map(function(e) { - return ym(e) && e.toolCallId === i ? h(h({}, e), {}, { - state: a, - output: o, - errorText: s - }) : e; - })), "streaming" !== n.status && "submitted" !== n.status && null != (t = n.sendAutomaticallyWhen) && t.call(n, { messages: n.state.messages }) && n.makeRequest({ - trigger: "submit-message", - messageId: null == (r = n.lastMessage) ? void 0 : r.id - }); - case 1: return e.a(2); - } - }, e); - })))); - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; - }(), this.addToolResult = this.addToolOutput, this.stop = r(m().m(function e() { - var t; - return m().w(function(e) { - for (;;) switch (e.n) { - case 0: "streaming" !== n.status && "submitted" !== n.status || null != (t = n.activeResponse) && t.abortController && n.activeResponse.abortController.abort(); - case 1: return e.a(2); - } - }, e); - })), this.id = s, this.transport = l, this.generateId = i, this.messageMetadataSchema = f, this.dataPartSchemas = d, this.state = p, this.onError = D, this.onToolCall = y, this.onFinish = g, this.onData = E, this.sendAutomaticallyWhen = b; - }, [ - { - key: "status", - get: function() { - return this.state.status; - } - }, - { - key: "setStatus", - value: function(e) { - var t = e.status, n = e.error; - this.status !== t && (this.state.status = t, this.state.error = n); - } - }, - { - key: "error", - get: function() { - return this.state.error; - } - }, - { - key: "messages", - get: function() { - return this.state.messages; - }, - set: function(e) { - this.state.messages = e; - } - }, - { - key: "lastMessage", - get: function() { - return this.state.messages[this.state.messages.length - 1]; - } - }, - { - key: "makeRequest", - value: (e = r(m().m(function e(t) { - var n, u, a, i, o, s, c, l, f, d, p, h, v, D, y, g, F, E, b = this; - return m().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: - if (n = t.trigger, u = t.metadata, a = t.headers, i = t.body, o = t.messageId, this.setStatus({ - status: "submitted", - error: void 0 - }), d = this.lastMessage, p = !1, h = !1, v = !1, e.p = 1, (D = { - state: Fm({ - lastMessage: this.state.snapshot(d), - messageId: this.generateId() - }), - abortController: new AbortController() - }).abortController.signal.addEventListener("abort", function() { - p = !0; - }), this.activeResponse = D, "resume-stream" !== n) { - e.n = 4; - break; - } - return e.n = 2, this.transport.reconnectToStream({ - chatId: this.id, - metadata: u, - headers: a, - body: i - }); - case 2: - if (null != (g = e.v)) { - e.n = 3; - break; - } - return e.a(2, void this.setStatus({ status: "ready" })); - case 3: - y = g, e.n = 6; - break; - case 4: return e.n = 5, this.transport.sendMessages({ - chatId: this.id, - messages: this.state.messages, - abortSignal: D.abortController.signal, - metadata: u, - headers: a, - body: i, - trigger: n, - messageId: o - }); - case 5: y = e.v; - case 6: return F = function(e) { - return b.jobExecutor.run(function() { - return e({ - state: D.state, - write: function() { - var e; - b.setStatus({ status: "streaming" }), D.state.message.id === (null == (e = b.lastMessage) ? void 0 : e.id) ? b.state.replaceMessage(b.state.messages.length - 1, D.state.message) : b.state.pushMessage(D.state.message); - } - }); - }); - }, e.n = 7, function() { - var e = r(m().m(function e(t) { - var n, r, u, a; - return m().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: n = t.stream, r = t.onError, u = n.getReader(), e.p = 1; - case 2: return e.n = 3, u.read(); - case 3: - if (!e.v.done) { - e.n = 4; - break; - } - return e.a(3, 5); - case 4: - e.n = 2; - break; - case 5: - e.n = 7; - break; - case 6: e.p = 6, a = e.v, null == r || r(a); - case 7: return e.p = 7, u.releaseLock(), e.f(7); - case 8: return e.a(2); - } - }, e, null, [[ - 1, - 6, - 7, - 8 - ]]); - })); - return function(t) { - return e.apply(this, arguments); - }; - }()({ - stream: Em({ - stream: y, - onToolCall: this.onToolCall, - onData: this.onData, - messageMetadataSchema: this.messageMetadataSchema, - dataPartSchemas: this.dataPartSchemas, - runUpdateMessageJob: F, - onError: function(e) { - throw e; - } - }), - onError: function(e) { - throw e; - } - }); - case 7: - this.setStatus({ status: "ready" }), e.n = 10; - break; - case 8: - if (e.p = 8, E = e.v, !p && "AbortError" !== E.name) { - e.n = 9; - break; - } - return e.a(2, (p = !0, this.setStatus({ status: "ready" }), null)); - case 9: v = !0, E instanceof TypeError && (E.message.toLowerCase().includes("fetch") || E.message.toLowerCase().includes("network")) && (h = !0), this.onError && E instanceof Error && this.onError(E), this.setStatus({ - status: "error", - error: E - }); - case 10: - e.p = 10; - try { - null == (c = this.onFinish) || c.call(this, { - message: this.activeResponse.state.message, - messages: this.state.messages, - isAbort: p, - isDisconnect: h, - isError: v, - finishReason: null == (s = this.activeResponse) ? void 0 : s.state.finishReason - }); - } catch (e) { - console.error(e); - } - return this.activeResponse = void 0, e.f(10); - case 11: - if (!(null == (l = this.sendAutomaticallyWhen) ? void 0 : l.call(this, { messages: this.state.messages })) || v) { - e.n = 12; - break; - } - return e.n = 12, this.makeRequest({ - trigger: "submit-message", - messageId: null == (f = this.lastMessage) ? void 0 : f.id, - metadata: u, - headers: a, - body: i - }); - case 12: return e.a(2); - } - }, e, this, [[ - 1, - 8, - 10, - 11 - ]]); - })), function(t) { - return e.apply(this, arguments); - }) - } - ]); - var e; -}(); -function Om(e) { - var t = e.messages, n = t[t.length - 1]; - if (!n) return !1; - if ("assistant" !== n.role) return !1; - var r = n.parts.reduce(function(e, t, n) { - return "step-start" === t.type ? n : e; - }, -1), u = n.parts.slice(r + 1).filter(ym).filter(function(e) { - return !e.providerExecuted; - }); - return u.length > 0 && u.every(function(e) { - return "output-available" === e.state || "output-error" === e.state; - }); -} -var Bm, Im, Tm, Pm, jm, Nm, zm, Rm, Mm, Zm, Lm = function(e) { - return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; -}((km || (km = 1, _m = function(e, t) { - if ("function" != typeof e) throw new TypeError("Expected the first argument to be a `function`, got `".concat(En(e), "`.")); - var n, r = 0; - return function() { - for (var u = this, a = arguments.length, i = new Array(a), o = 0; o < a; o++) i[o] = arguments[o]; - clearTimeout(n); - var s = Date.now(), c = t - (s - r); - c <= 0 ? (r = s, e.apply(this, i)) : n = setTimeout(function() { - r = Date.now(), e.apply(u, i); - }, c); - }; -}), _m)), $m = function(e, t, n) { - if (!t.has(e)) throw TypeError("Cannot " + n); -}, qm = function(e, t, n) { - return $m(e, t, "read from private field"), n ? n.call(e) : t.get(e); -}, Um = function(e, t, n) { - if (t.has(e)) throw TypeError("Cannot add the same private member more than once"); - t instanceof WeakSet ? t.add(e) : t.set(e, n); -}, Hm = function(e, t, n, r) { - return $m(e, t, "write to private field"), t.set(e, n), n; -}, Vm = function() { - return o(function e() { - var t = this, n = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : []; - a(this, e), Um(this, Bm, void 0), Um(this, Im, "ready"), Um(this, Tm, void 0), Um(this, Pm, /* @__PURE__ */ new Set()), Um(this, jm, /* @__PURE__ */ new Set()), Um(this, Nm, /* @__PURE__ */ new Set()), this.pushMessage = function(e) { - Hm(t, Bm, qm(t, Bm).concat(e)), qm(t, zm).call(t); - }, this.popMessage = function() { - Hm(t, Bm, qm(t, Bm).slice(0, -1)), qm(t, zm).call(t); - }, this.replaceMessage = function(e, n) { - Hm(t, Bm, [].concat(F(qm(t, Bm).slice(0, e)), [t.snapshot(n)], F(qm(t, Bm).slice(e + 1)))), qm(t, zm).call(t); - }, this.snapshot = function(e) { - return structuredClone(e); - }, this["~registerMessagesCallback"] = function(e, n) { - var r, u, a = n ? (r = e, null != (u = n) ? Lm(r, u) : r) : e; - return qm(t, Pm).add(a), function() { - qm(t, Pm).delete(a); - }; - }, this["~registerStatusCallback"] = function(e) { - return qm(t, jm).add(e), function() { - qm(t, jm).delete(e); - }; - }, this["~registerErrorCallback"] = function(e) { - return qm(t, Nm).add(e), function() { - qm(t, Nm).delete(e); - }; - }, Um(this, zm, function() { - qm(t, Pm).forEach(function(e) { - return e(); - }); - }), Um(this, Rm, function() { - qm(t, jm).forEach(function(e) { - return e(); - }); - }), Um(this, Mm, function() { - qm(t, Nm).forEach(function(e) { - return e(); - }); - }), Hm(this, Bm, n); - }, [ - { - key: "status", - get: function() { - return qm(this, Im); - }, - set: function(e) { - Hm(this, Im, e), qm(this, Rm).call(this); - } - }, - { - key: "error", - get: function() { - return qm(this, Tm); - }, - set: function(e) { - Hm(this, Tm, e), qm(this, Mm).call(this); - } - }, - { - key: "messages", - get: function() { - return qm(this, Bm); - }, - set: function(e) { - Hm(this, Bm, F(e)), qm(this, zm).call(this); - } - } - ]); -}(); -Bm = /* @__PURE__ */ new WeakMap(), Im = /* @__PURE__ */ new WeakMap(), Tm = /* @__PURE__ */ new WeakMap(), Pm = /* @__PURE__ */ new WeakMap(), jm = /* @__PURE__ */ new WeakMap(), Nm = /* @__PURE__ */ new WeakMap(), zm = /* @__PURE__ */ new WeakMap(), Rm = /* @__PURE__ */ new WeakMap(), Mm = /* @__PURE__ */ new WeakMap(); -var Wm = function() { - function e(n) { - var r, i = n.messages, o = v(n, Jt); - a(this, e); - var s = new Vm(i); - return r = u(this, e, [h(h({}, o), {}, { state: s })]), Um(t(r), Zm, void 0), r["~registerMessagesCallback"] = function(e, n) { - return qm(t(r), Zm)["~registerMessagesCallback"](e, n); - }, r["~registerStatusCallback"] = function(e) { - return qm(t(r), Zm)["~registerStatusCallback"](e); - }, r["~registerErrorCallback"] = function(e) { - return qm(t(r), Zm)["~registerErrorCallback"](e); - }, Hm(t(r), Zm, s), r; - } - return f(e, xm), o(e); -}(); -Zm = /* @__PURE__ */ new WeakMap(); -var Km = "askai_token", Jm = function(e) { - return "https://".concat(e, ".algolia.net/agent-studio/1"); -}, Qm = function(e) { - if (!e) return !0; - try { - var n = function(e) { - var t = yn(e.split("."), 1)[0]; - return JSON.parse(atob(t)); - }(e).exp; - return Date.now() / 1e3 > n - 30; - } catch (e) { - return !0; - } -}, Gm = null, Ym = function() { - var e = Xt(vn().m(function e(t) { - var n, r, u, a, i, o; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (n = t.assistantId, r = t.abortSignal, u = t.useStagingEnv, a = void 0 !== u && u, i = sessionStorage.getItem(Km), Qm(i)) { - e.n = 1; - break; - } - return e.a(2, i); - case 1: return o = a ? pa : da, Gm || (Gm = fetch("".concat(o, "/token"), { - method: "POST", - headers: { - "x-algolia-assistant-id": n, - "content-type": "application/json" - }, - signal: r - }).then(function(e) { - return e.json(); - }).then(function(e) { - var t = e.token, n = e.success, r = e.message; - if (!n && r) throw new Error(r); - return sessionStorage.setItem(Km, t), t; - }).finally(function() { - return Gm = null; - })), e.a(2, Gm); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; -}(), Xm = function() { - var e = Xt(vn().m(function e(t) { - var n, r, u, a, i, o, s, c, l, f; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return n = t.assistantId, r = t.thumbs, u = t.messageId, a = t.appId, i = t.abortSignal, o = t.useStagingEnv, s = void 0 !== o && o, (c = new Headers()).set("x-algolia-assistant-id", n), c.set("content-type", "application/json"), e.n = 1, Ym({ - assistantId: n, - abortSignal: i, - useStagingEnv: s - }); - case 1: return l = e.v, c.set("authorization", "TOKEN ".concat(l)), f = s ? pa : da, e.a(2, fetch("".concat(f, "/feedback"), { - method: "POST", - body: JSON.stringify({ - appId: a, - messageId: u, - thumbs: r - }), - headers: c - })); - } - }, e); - })); - return function(t) { - return e.apply(this, arguments); - }; -}(), eD = function(e) { - var t = e.agentId, n = e.vote, r = e.messageId, u = e.appId, a = e.apiKey, i = e.abortSignal, o = new Headers(); - o.set("x-algolia-application-id", u), o.set("x-algolia-api-key", a), o.set("content-type", "application/json"); - var s = "".concat(Jm(u), "/feedback"); - return fetch(s, { - method: "POST", - body: JSON.stringify({ - messageId: r, - agentId: t, - vote: n - }), - headers: o, - signal: i - }); -}, tD = [ - "assistantId", - "apiKey", - "appId", - "indexName", - "useStagingEnv" -], nD = function(e) { - var t = e.assistantId, n = e.apiKey, r = e.appId, u = e.indexName, a = e.useStagingEnv, i = void 0 !== a && a, o = hn(e, tD), s = Ie(new AbortController()), c = yn(Se(function() { - return Kh(); - }), 2), l = c[0], f = c[1], d = Ie(null), p = Ie(null), h = Ie(null), m = Pe(function() { - return o.agentStudio ? function(e) { - var t = e.appId, n = e.apiKey, r = e.assistantId, u = e.searchParameters; - return new Sm({ - api: "".concat(Jm(t), "/agents/").concat(r, "/completions?stream=true&compatibilityMode=ai-sdk-5"), - headers: { - "x-algolia-application-id": t, - "x-algolia-api-key": n - }, - body: u ? { algolia: { searchParameters: u } } : {} - }); - }({ - apiKey: n, - appId: r, - assistantId: null != t ? t : "", - searchParameters: o.searchParameters - }) : function(e) { - var t, n = e.assistantId, r = e.apiKey, u = e.indexName, a = e.searchParameters, i = e.appId, o = e.abortControllerRef, s = e.useStagingEnv; - return new Sm({ - api: s ? pa : da, - headers: (t = Xt(vn().m(function e() { - var t; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (n) { - e.n = 1; - break; - } - throw new Error("Ask AI assistant ID is required"); - case 1: return e.n = 2, Ym({ - assistantId: n, - abortSignal: o.current.signal, - useStagingEnv: s - }); - case 2: return t = e.v, e.a(2, pn(pn({}, t ? { authorization: "TOKEN ".concat(t) } : {}), {}, { - "X-Algolia-API-Key": r, - "X-Algolia-Application-Id": i, - "X-Algolia-Index-Name": u, - "X-Algolia-Assistant-Id": n || "", - "X-AI-SDK-Version": "v5" - })); - } - }, e); - })), function() { - return t.apply(this, arguments); - }), - body: a ? { searchParameters: a } : {} - }); - }({ - assistantId: null != t ? t : "", - apiKey: n, - appId: r, - indexName: u, - searchParameters: o.searchParameters, - abortControllerRef: s, - useStagingEnv: i - }); - }, [ - n, - r, - t, - u, - i, - o - ]), D = function() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, t = e.experimental_throttle, n = e.resume, r = void 0 !== n && n, u = v(e, Qt), a = Ie("chat" in u ? u.chat : new Wm(u)); - ("chat" in u && u.chat !== a.current || "id" in u && a.current.id !== u.id) && (a.current = "chat" in u ? u.chat : new Wm(u)); - var s = Ve(je(function(e) { - return a.current["~registerMessagesCallback"](e, t); - }, [t, "id" in u ? u.id : null]), function() { - return a.current.messages; - }), c = Ve(a.current["~registerStatusCallback"], function() { - return a.current.status; - }), l = Ve(a.current["~registerErrorCallback"], function() { - return a.current.error; - }), f = je(function(e) { - "function" == typeof e && (e = e(a.current.messages)), a.current.messages = e; - }, [a]); - return Oe(function() { - r && a.current.resumeStream(); - }, [r, a]), { - id: a.current.id, - messages: s, - setMessages: f, - sendMessage: a.current.sendMessage, - regenerate: a.current.regenerate, - clearError: a.current.clearError, - stop: a.current.stop, - error: l, - resumeStream: a.current.resumeStream, - status: c, - addToolResult: a.current.addToolOutput, - addToolOutput: a.current.addToolOutput - }; - }(Pe(function() { - return { - id: l, - sendAutomaticallyWhen: Om, - transport: m - }; - }, [l, m])), y = D.messages, g = D.sendMessage, F = D.status, E = D.setMessages, b = D.error, _ = D.stop, k = D.clearError; - p.current = g, h.current = E; - var C = Ie(function(e) { - var t = e.limit, n = void 0 === t ? 5 : t, r = Zo(e.key), u = r.getItem().slice(0, n); - return { - add: function(e) { - var t = e.objectID, a = e.query, i = u.findIndex(function(e) { - return e.objectID === t || e.query === a; - }); - i > -1 ? u[i] = e : (u.unshift(e), u = u.slice(0, n)), r.setItem(u); - }, - addFeedback: function(e, t) { - var n = u.find(function(t) { - var n; - return null === (n = t.messages) || void 0 === n ? void 0 : n.some(function(t) { - return t.id === e; - }); - }); - if (n && n.messages) { - var a = n.messages.find(function(t) { - return t.id === e; - }); - a && (a.feedback = t, r.setItem(u)); - } - }, - getOne: function(e) { - var t, n = u.find(function(t) { - var n; - return null === (n = t.messages) || void 0 === n ? void 0 : n.some(function(t) { - return t.id === e; - }); - }); - return null == n || null === (t = n.messages) || void 0 === t ? void 0 : t.find(function(t) { - return t.id === e; - }); - }, - getAll: function() { - return u; - }, - remove: function(e) { - u = u.filter(function(t) { - return t.objectID !== e.objectID; - }), r.setItem(u); - }, - getConversation: function(e) { - var t = u.find(function(t) { - var n; - return null === (n = t.messages) || void 0 === n ? void 0 : n.some(function(t) { - return t.id === e; - }); - }); - if (t && t.messages) return t; - } - }; - }({ - key: "__DOCSEARCH_ASKAI_CONVERSATIONS__".concat(u), - limit: 10 - })).current, A = je(function() { - var e = Xt(vn().m(function e(u, a) { - var c; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (t) { - e.n = 1; - break; - } - return e.a(2); - case 1: return e.n = 2, o.agentStudio ? eD({ - agentId: t, - vote: a, - messageId: u, - appId: r, - apiKey: n, - abortSignal: s.current.signal - }) : Xm({ - assistantId: t, - thumbs: a, - messageId: u, - appId: r, - abortSignal: s.current.signal, - useStagingEnv: i - }); - case 2: - if (!(e.v.status >= 300)) { - e.n = 3; - break; - } - throw new Error("Failed, try again later."); - case 3: null === (c = C.addFeedback) || void 0 === c || c.call(C, u, 1 === a ? "like" : "dislike"); - case 4: return e.a(2); - } - }, e); - })); - return function(t, n) { - return e.apply(this, arguments); - }; - }(), [ - t, - o.agentStudio, - r, - n, - i, - C - ]), w = je(function() { - s.current.abort(), s.current = new AbortController(); - }, []), S = je(function(e) { - w(), d.current = null != e ? e : null, f(Kh()); - }, [w]); - Oe(function() { - var e = d.current; - if (null !== e) { - var t = p.current, n = h.current; - if ("sendText" === e.kind) { - var r; - if (!t) return; - d.current = null, t({ text: e.text }, null !== (r = e.requestOptions) && void 0 !== r ? r : {}); - return; - } - if ("sendUserMessage" === e.kind) { - var u; - if (!t) return; - d.current = null, t(e.message, null !== (u = e.requestOptions) && void 0 !== u ? u : {}); - return; - } - n && (d.current = null, n(e.messages)); - } - }, [l]); - var x = function() { - var e = Xt(vn().m(function e() { - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return s.current.abort(), e.n = 1, _(); - case 1: s.current = new AbortController(); - case 2: return e.a(2); - } - }, e); - })); - return function() { - return e.apply(this, arguments); - }; - }(), O = Pe(function() { - for (var e = [], t = 0; t < y.length; t++) if ("user" === y[t].role) { - var n, r = y[t], u = "assistant" === (null === (n = y[t + 1]) || void 0 === n ? void 0 : n.role) ? y[t + 1] : null; - e.push({ - id: r.id, - userMessage: r, - assistantMessage: u - }), u && t++; - } - return e; - }, [y]), B = "streaming" === F || "submitted" === F; - return { - messages: y, - sendMessage: g, - status: F, - setMessages: E, - clearError: k, - resetAskAiAbortScope: w, - resetAskAiChatSession: S, - askAiError: Pe(function() { - if (b) return o.agentStudio ? function(e) { - var t, n, r = e.message; - try { - n = JSON.parse(r); - } catch (e) { - var u = Rn(r); - return new Error(null != u ? u : r); - } - for (; "string" == typeof n;) try { - n = JSON.parse(n.trim()); - } catch (e) { - var a = Rn(r); - return new Error(null != a ? a : n); - } - if ("object" !== En(n) || null === n || Array.isArray(n)) { - var i = Rn(r); - return new Error(null != i ? i : r); - } - var o, s = n; - if ("ValidationError" === s.name) { - var c = s, l = r; - if (c.detail && c.detail.length > 0) { - var f = c.detail[0], d = f.msg, p = f.loc.at(-1); - l = "".concat(d, ": ").concat(p); - } - return new Error(l); - } - o = Rn(r) || ("string" == typeof s.message && "" !== s.message.trim() ? s.message.trim() : "string" == typeof s.error && "" !== s.error.trim() ? s.error.trim() : r); - var h = null !== (t = s.code) && void 0 !== t ? t : s.errorCode; - if ("string" == typeof h && "" !== h.trim()) { - var v = h.trim(); - o.toUpperCase().includes(v.toUpperCase()) || (o = "".concat(o, " (").concat(v, ")")); - } - return new Error(o); - }(b) : b; - }, [b, o.agentStudio]), - stopAskAiStreaming: x, - isStreaming: B, - exchanges: O, - conversations: C, - sendFeedback: A - }; -}; -function rD(e) { - var t, n = "algolia-client-js-".concat(e.key); - function r() { - return void 0 === t && (t = e.localStorage || window.localStorage), t; - } - function u() { - return JSON.parse(r().getItem(n) || "{}"); - } - function a(e) { - r().setItem(n, JSON.stringify(e)); - } - return { - get: function(t, n) { - var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { miss: function() { - return Promise.resolve(); - } }; - return Promise.resolve().then(function() { - var n, r, i; - return n = e.timeToLive ? 1e3 * e.timeToLive : null, r = u(), a(i = Object.fromEntries(Object.entries(r).filter(function(e) { - return void 0 !== yn(e, 2)[1].timestamp; - }))), n && a(Object.fromEntries(Object.entries(i).filter(function(e) { - var t = yn(e, 2)[1], r = (/* @__PURE__ */ new Date()).getTime(); - return !(t.timestamp + n < r); - }))), u()[JSON.stringify(t)]; - }).then(function(e) { - return Promise.all([e ? e.value : n(), void 0 !== e]); - }).then(function(e) { - var t = yn(e, 2), n = t[0], u = t[1]; - return Promise.all([n, u || r.miss(n)]); - }).then(function(e) { - return yn(e, 1)[0]; - }); - }, - set: function(e, t) { - return Promise.resolve().then(function() { - var a = u(); - return a[JSON.stringify(e)] = { - timestamp: (/* @__PURE__ */ new Date()).getTime(), - value: t - }, r().setItem(n, JSON.stringify(a)), t; - }); - }, - delete: function(e) { - return Promise.resolve().then(function() { - var t = u(); - delete t[JSON.stringify(e)], r().setItem(n, JSON.stringify(t)); - }); - }, - clear: function() { - return Promise.resolve().then(function() { - r().removeItem(n); - }); - } - }; -} -function uD(e) { - var t = gn(e.caches), n = t.shift(); - return void 0 === n ? { - get: function(e, t) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { miss: function() { - return Promise.resolve(); - } }; - return t().then(function(e) { - return Promise.all([e, n.miss(e)]); - }).then(function(e) { - return yn(e, 1)[0]; - }); - }, - set: function(e, t) { - return Promise.resolve(t); - }, - delete: function(e) { - return Promise.resolve(); - }, - clear: function() { - return Promise.resolve(); - } - } : { - get: function(e, r) { - var u = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { miss: function() { - return Promise.resolve(); - } }; - return n.get(e, r, u).catch(function() { - return uD({ caches: t }).get(e, r, u); - }); - }, - set: function(e, r) { - return n.set(e, r).catch(function() { - return uD({ caches: t }).set(e, r); - }); - }, - delete: function(e) { - return n.delete(e).catch(function() { - return uD({ caches: t }).delete(e); - }); - }, - clear: function() { - return n.clear().catch(function() { - return uD({ caches: t }).clear(); - }); - } - }; -} -function aD() { - var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : { serializable: !0 }, t = {}; - return { - get: function(n, r) { - var u = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : { miss: function() { - return Promise.resolve(); - } }, a = JSON.stringify(n); - if (a in t) return Promise.resolve(e.serializable ? JSON.parse(t[a]) : t[a]); - var i = r(); - return i.then(function(e) { - return u.miss(e); - }).then(function() { - return i; - }); - }, - set: function(n, r) { - return t[JSON.stringify(n)] = e.serializable ? JSON.stringify(r) : r, Promise.resolve(r); - }, - delete: function(e) { - return delete t[JSON.stringify(e)], Promise.resolve(); - }, - clear: function() { - return t = {}, Promise.resolve(); - } - }; -} -function iD(e) { - var t = e.algoliaAgents, n = e.client, r = e.version, u = function(e) { - var t = { - value: "Algolia for JavaScript (".concat(e, ")"), - add: function(e) { - var n = "; ".concat(e.segment).concat(void 0 !== e.version ? " (".concat(e.version, ")") : ""); - return -1 === t.value.indexOf(n) && (t.value = "".concat(t.value).concat(n)), t; - } - }; - return t; - }(r).add({ - segment: n, - version: r - }); - return t.forEach(function(e) { - return u.add(e); - }), u; -} -var oD = 12e4; -function sD(e) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "up", n = Date.now(); - return pn(pn({}, e), {}, { - status: t, - lastUpdate: n, - isUp: function() { - return "up" === t || Date.now() - n > oD; - }, - isTimedOut: function() { - return "timed out" === t && Date.now() - n <= oD; - } - }); -} -var cD = function() { - function e(t, n) { - var r; - return tn(this, e), on(r = en(this, e, [t]), "name", "AlgoliaError"), n && (r.name = n), r; - } - return ln(e, _n(Error)), un(e); -}(), lD = function() { - function e(t, n, r) { - var u; - return tn(this, e), on(u = en(this, e, [t, r]), "stackTrace", void 0), u.stackTrace = n, u; - } - return ln(e, cD), un(e); -}(), fD = function() { - function e(t) { - return tn(this, e), en(this, e, [ - "Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support", - t, - "RetryError" - ]); - } - return ln(e, lD), un(e); -}(), dD = function() { - function e(t, n, r) { - var u, a = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : "ApiError"; - return tn(this, e), on(u = en(this, e, [ - t, - r, - a - ]), "status", void 0), u.status = n, u; - } - return ln(e, lD), un(e); -}(), pD = function() { - function e(t, n) { - var r; - return tn(this, e), on(r = en(this, e, [t, "DeserializationError"]), "response", void 0), r.response = n, r; - } - return ln(e, cD), un(e); -}(), hD = function() { - function e(t, n, r, u) { - var a; - return tn(this, e), on(a = en(this, e, [ - t, - n, - u, - "DetailedApiError" - ]), "error", void 0), a.error = r, a; - } - return ln(e, dD), un(e); -}(); -function vD(e, t, n) { - var r, u = (r = n, Object.keys(r).filter(function(e) { - return void 0 !== r[e]; - }).sort().map(function(e) { - return "".concat(e, "=").concat(encodeURIComponent("[object Array]" === Object.prototype.toString.call(r[e]) ? r[e].join(",") : r[e]).replace(/\+/g, "%20")); - }).join("&")), a = "".concat(e.protocol, "://").concat(e.url).concat(e.port ? ":".concat(e.port) : "", "/").concat("/" === t.charAt(0) ? t.substring(1) : t); - return u.length && (a += "?".concat(u)), a; -} -function mD(e, t) { - if ("GET" !== e.method && (void 0 !== e.data || void 0 !== t.data)) { - var n = Array.isArray(e.data) ? e.data : pn(pn({}, e.data), t.data); - return JSON.stringify(n); - } -} -function DD(e, t, n) { - var r = pn(pn(pn({ Accept: "application/json" }, e), t), n), u = {}; - return Object.keys(r).forEach(function(e) { - var t = r[e]; - u[e.toLowerCase()] = t; - }), u; -} -function yD(e) { - try { - return JSON.parse(e.content); - } catch (t) { - throw new pD(t.message, e); - } -} -function gD(e, t) { - var n = e.content, r = e.status; - try { - var u = JSON.parse(n); - return "error" in u ? new hD(u.message, r, u.error, t) : new dD(u.message, r, t); - } catch (e) {} - return new dD(n, r, t); -} -function FD(e) { - var t = e.isTimedOut, n = e.status; - return t || function(e) { - return !e.isTimedOut && 0 === ~~e.status; - }({ - isTimedOut: t, - status: n - }) || 2 != ~~(n / 100) && 4 != ~~(n / 100); -} -function ED(e) { - return 2 == ~~(e.status / 100); -} -function bD(e) { - return e.map(function(e) { - return _D(e); - }); -} -function _D(e) { - var t = e.request.headers["x-algolia-api-key"] ? { "x-algolia-api-key": "*****" } : {}; - return pn(pn({}, e), {}, { request: pn(pn({}, e.request), {}, { headers: pn(pn({}, e.request.headers), t) }) }); -} -var kD = [ - "appId", - "apiKey", - "authMode", - "algoliaAgents" -], CD = ["params"], AD = "5.43.0"; -function wD(e) { - return [{ - url: "".concat(e, "-dsn.algolia.net"), - accept: "read", - protocol: "https" - }, { - url: "".concat(e, ".algolia.net"), - accept: "write", - protocol: "https" - }].concat(function(e) { - for (var t = e, n = e.length - 1; n > 0; n--) { - var r = Math.floor(Math.random() * (n + 1)), u = e[n]; - t[n] = e[r], t[r] = u; - } - return t; - }([ - { - url: "".concat(e, "-1.algolianet.com"), - accept: "readWrite", - protocol: "https" - }, - { - url: "".concat(e, "-2.algolianet.com"), - accept: "readWrite", - protocol: "https" - }, - { - url: "".concat(e, "-3.algolianet.com"), - accept: "readWrite", - protocol: "https" - } - ])); -} -var SD = "4.6.3"; -function xD(e, t, n) { - return It.useMemo(function() { - var r = function(e, t) { - if (!e || "string" != typeof e) throw new Error("`appId` is missing."); - if (!t || "string" != typeof t) throw new Error("`apiKey` is missing."); - return function(e) { - var t = e.appId, n = e.apiKey, r = e.authMode, u = e.algoliaAgents, a = hn(e, kD), i = function(e, t) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "WithinHeaders", r = { - "x-algolia-api-key": t, - "x-algolia-application-id": e - }; - return { - headers: function() { - return "WithinHeaders" === n ? r : {}; - }, - queryParameters: function() { - return "WithinQueryParameters" === n ? r : {}; - } - }; - }(t, n, r), o = function(e) { - var t = e.hosts, n = e.hostsCache, r = e.baseHeaders, u = e.logger, a = e.baseQueryParameters, i = e.algoliaAgent, o = e.timeouts, s = e.requester, c = e.requestsCache, l = e.responsesCache; - function f(e) { - return d.apply(this, arguments); - } - function d() { - return (d = Xt(vn().m(function e(t) { - var r, u, a, i, o; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, Promise.all(t.map(function(e) { - return n.get(e, function() { - return Promise.resolve(sD(e)); - }); - })); - case 1: return r = e.v, u = r.filter(function(e) { - return e.isUp(); - }), a = r.filter(function(e) { - return e.isTimedOut(); - }), i = [].concat(gn(u), gn(a)), o = i.length > 0 ? i : t, e.a(2, { - hosts: o, - getTimeout: function(e, t) { - return (0 === a.length && 0 === e ? 1 : a.length + 3 + e) * t; - } - }); - } - }, e); - }))).apply(this, arguments); - } - function p(e, t) { - return h.apply(this, arguments); - } - function h() { - return h = Xt(vn().m(function e(c, l) { - var d, p, h, v, m, D, y, g, F, E, b, _, k, C = arguments; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (d = !(C.length > 2 && void 0 !== C[2]) || C[2], p = [], h = mD(c, l), v = DD(r, c.headers, l.headers), m = "GET" === c.method ? pn(pn({}, c.data), l.data) : {}, D = pn(pn(pn({}, a), c.queryParameters), m), i.value && (D["x-algolia-agent"] = i.value), l && l.queryParameters) for (y = 0, g = Object.keys(l.queryParameters); y < g.length; y++) F = g[y], l.queryParameters[F] && "[object Object]" !== Object.prototype.toString.call(l.queryParameters[F]) ? D[F] = l.queryParameters[F].toString() : D[F] = l.queryParameters[F]; - return E = 0, b = function() { - var e = Xt(vn().m(function e(t, r) { - var a, i, f, m, y, g; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (void 0 !== (a = t.pop())) { - e.n = 1; - break; - } - throw new fD(bD(p)); - case 1: return i = pn(pn({}, o), l.timeouts), f = { - data: h, - headers: v, - method: c.method, - url: vD(a, c.path, D), - connectTimeout: r(E, i.connect), - responseTimeout: r(E, d ? i.read : i.write) - }, m = function(e) { - var n = { - request: f, - response: e, - host: a, - triesLeft: t.length - }; - return p.push(n), n; - }, e.n = 2, s.send(f); - case 2: - if (!FD(y = e.v)) { - e.n = 4; - break; - } - return g = m(y), y.isTimedOut && E++, u.info("Retryable failure", _D(g)), e.n = 3, n.set(a, sD(a, y.isTimedOut ? "timed out" : "down")); - case 3: return e.a(2, b(t, r)); - case 4: - if (!ED(y)) { - e.n = 5; - break; - } - return e.a(2, yD(y)); - case 5: throw m(y), gD(y, p); - case 6: return e.a(2); - } - }, e); - })); - return function(t, n) { - return e.apply(this, arguments); - }; - }(), _ = t.filter(function(e) { - return "readWrite" === e.accept || (d ? "read" === e.accept : "write" === e.accept); - }), e.n = 1, f(_); - case 1: return k = e.v, e.a(2, b(gn(k.hosts).reverse(), k.getTimeout)); - } - }, e); - })), h.apply(this, arguments); - } - return { - hostsCache: n, - requester: s, - timeouts: o, - logger: u, - algoliaAgent: i, - baseHeaders: r, - baseQueryParameters: a, - hosts: t, - request: function(e) { - var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = e.useReadTransporter || "GET" === e.method; - if (!n) return p(e, t, n); - var u = function() { - return p(e, t); - }; - if (!0 !== (t.cacheable || e.cacheable)) return u(); - var i = { - request: e, - requestOptions: t, - transporter: { - queryParameters: a, - headers: r - } - }; - return l.get(i, function() { - return c.get(i, function() { - return c.set(i, u()).then(function(e) { - return Promise.all([c.delete(i), e]); - }, function(e) { - return Promise.all([c.delete(i), Promise.reject(e)]); - }).then(function(e) { - var t = yn(e, 2); - return t[0], t[1]; - }); - }); - }, { miss: function(e) { - return l.set(i, e); - } }); - }, - requestsCache: c, - responsesCache: l - }; - }(pn(pn({ hosts: wD(t) }, a), {}, { - algoliaAgent: iD({ - algoliaAgents: u, - client: "Lite", - version: AD - }), - baseHeaders: pn(pn({ "content-type": "text/plain" }, i.headers()), a.baseHeaders), - baseQueryParameters: pn(pn({}, i.queryParameters()), a.baseQueryParameters) - })); - return { - transporter: o, - appId: t, - apiKey: n, - clearCache: function() { - return Promise.all([o.requestsCache.clear(), o.responsesCache.clear()]).then(function() {}); - }, - get _ua() { - return o.algoliaAgent.value; - }, - addAlgoliaAgent: function(e, t) { - o.algoliaAgent.add({ - segment: e, - version: t - }); - }, - setClientApiKey: function(e) { - var t = e.apiKey; - r && "WithinHeaders" !== r ? o.baseQueryParameters["x-algolia-api-key"] = t : o.baseHeaders["x-algolia-api-key"] = t; - }, - searchForHits: function(e, t) { - return this.search(e, t); - }, - searchForFacets: function(e, t) { - return this.search(e, t); - }, - customPost: function(e, t) { - var n = e.path, r = e.parameters, u = e.body; - if (!n) throw new Error("Parameter `path` is required when calling `customPost`."); - var a = { - method: "POST", - path: "/{path}".replace("{path}", n), - queryParameters: r || {}, - headers: {}, - data: u || {} - }; - return o.request(a, t); - }, - getRecommendations: function(e, t) { - if (e && Array.isArray(e) && (e = { requests: e }), !e) throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`."); - if (!e.requests) throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`."); - var n = { - method: "POST", - path: "/1/indexes/*/recommendations", - queryParameters: {}, - headers: {}, - data: e, - useReadTransporter: !0, - cacheable: !0 - }; - return o.request(n, t); - }, - search: function(e, t) { - if (e && Array.isArray(e)) e = { requests: e.map(function(e) { - var t = e.params, n = hn(e, CD); - return "facet" === n.type ? pn(pn(pn({}, n), t), {}, { type: "facet" }) : pn(pn(pn({}, n), t), {}, { - facet: void 0, - maxFacetHits: void 0, - facetQuery: void 0 - }); - }) }; - if (!e) throw new Error("Parameter `searchMethodParams` is required when calling `search`."); - if (!e.requests) throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`."); - var r = { - method: "POST", - path: "/1/indexes/*/queries", - queryParameters: {}, - headers: {}, - data: e, - useReadTransporter: !0, - cacheable: !0 - }; - return o.request(r, t); - } - }; - }(pn({ - appId: e, - apiKey: t, - timeouts: { - connect: 1e3, - read: 2e3, - write: 3e4 - }, - logger: { - debug: function(e, t) { - return Promise.resolve(); - }, - info: function(e, t) { - return Promise.resolve(); - }, - error: function(e, t) { - return Promise.resolve(); - } - }, - requester: { send: function(e) { - return new Promise(function(t) { - var n = new XMLHttpRequest(); - n.open(e.method, e.url, !0), Object.keys(e.headers).forEach(function(t) { - return n.setRequestHeader(t, e.headers[t]); - }); - var r, u = function(e, r) { - return setTimeout(function() { - n.abort(), t({ - status: 0, - content: r, - isTimedOut: !0 - }); - }, e); - }, a = u(e.connectTimeout, "Connection timeout"); - n.onreadystatechange = function() { - n.readyState > n.OPENED && void 0 === r && (clearTimeout(a), r = u(e.responseTimeout, "Socket timeout")); - }, n.onerror = function() { - 0 === n.status && (clearTimeout(a), clearTimeout(r), t({ - content: n.responseText || "Network request failed", - status: n.status, - isTimedOut: !1 - })); - }, n.onload = function() { - clearTimeout(a), clearTimeout(r), t({ - content: n.responseText, - status: n.status, - isTimedOut: !1 - }); - }, n.send(e.data); - }); - } }, - algoliaAgents: [{ segment: "Browser" }], - authMode: "WithinQueryParameters", - responsesCache: aD(), - requestsCache: aD({ serializable: !1 }), - hostsCache: uD({ caches: [rD({ key: "".concat(AD, "-").concat(e) }), aD()] }) - }, void 0)); - }(e, t); - return r.addAlgoliaAgent("docsearch", SD), !1 === /docsearch.js \(.*\)/.test(r.transporter.algoliaAgent.value) && r.addAlgoliaAgent("docsearch-react", SD), n(r); - }, [ - e, - t, - n - ]); -} -var OD = [ - "appId", - "apiKey", - "askAi", - "maxResultsPerGroup", - "theme", - "onClose", - "transformItems", - "hitComponent", - "resultsFooterComponent", - "navigator", - "initialScrollY", - "transformSearchClient", - "disableUserPersonalization", - "initialQuery", - "translations", - "getMissingResultsUrl", - "insights", - "onAskAiToggle", - "interceptAskAiEvent", - "isAskAiActive", - "recentSearchesLimit", - "recentSearchesWithFavoritesLimit", - "indices", - "indexName", - "searchParameters", - "isHybridModeSupported" -], BD = ["footer", "searchBox"], ID = function() { - var e = Xt(vn().m(function e(t) { - var n, r, u, a, i, o, s, c, l, f, d, p, h, v, m, D, y, g, F; - return vn().w(function(e) { - for (;;) switch (e.p = e.n) { - case 0: return n = t.query, r = t.state, u = t.setContext, a = t.setStatus, i = t.searchClient, o = t.indexes, s = t.snippetLength, c = t.insights, l = t.appId, f = t.apiKey, d = t.maxResultsPerGroup, p = t.transformItems, h = void 0 === p ? Un : p, v = t.saveRecentSearch, m = t.onClose, D = c, e.p = 1, e.n = 2, i.search({ requests: o.map(function(e) { - var t, r, u, a, i, o, c, l = "string" == typeof e ? e : e.name, f = "string" == typeof e ? {} : e.searchParameters; - return pn({ - query: n, - indexName: l, - attributesToRetrieve: null !== (t = null == f ? void 0 : f.attributesToRetrieve) && void 0 !== t ? t : [ - "hierarchy.lvl0", - "hierarchy.lvl1", - "hierarchy.lvl2", - "hierarchy.lvl3", - "hierarchy.lvl4", - "hierarchy.lvl5", - "hierarchy.lvl6", - "content", - "type", - "url" - ], - attributesToSnippet: null !== (r = null == f ? void 0 : f.attributesToSnippet) && void 0 !== r ? r : [ - "hierarchy.lvl1:".concat(s.current), - "hierarchy.lvl2:".concat(s.current), - "hierarchy.lvl3:".concat(s.current), - "hierarchy.lvl4:".concat(s.current), - "hierarchy.lvl5:".concat(s.current), - "hierarchy.lvl6:".concat(s.current), - "content:".concat(s.current) - ], - snippetEllipsisText: null !== (u = null == f ? void 0 : f.snippetEllipsisText) && void 0 !== u ? u : "…", - highlightPreTag: null !== (a = null == f ? void 0 : f.highlightPreTag) && void 0 !== a ? a : "", - highlightPostTag: null !== (i = null == f ? void 0 : f.highlightPostTag) && void 0 !== i ? i : "", - hitsPerPage: null !== (o = null == f ? void 0 : f.hitsPerPage) && void 0 !== o ? o : 20, - clickAnalytics: null !== (c = null == f ? void 0 : f.clickAnalytics) && void 0 !== c ? c : D - }, null != f ? f : {}); - }) }); - case 2: return y = e.v, g = y.results, e.a(2, g.flatMap(function(e) { - var t, n = e, a = n.hits, i = n.nbHits, o = qn(h(a), function(e) { - return Qn(e); - }, d); - if (r.context.searchSuggestions.length < Object.keys(o).length && u({ searchSuggestions: pn(pn({}, null !== (t = r.context.searchSuggestions) && void 0 !== t ? t : []), Object.keys(o)) }), i) { - var s = r.context.nbHits; - u({ nbHits: (null != s ? s : 0) + i }); - } - var c = {}; - return D && (c = { - __autocomplete_indexName: n.index, - __autocomplete_queryID: n.queryID, - __autocomplete_algoliaCredentials: { - appId: l, - apiKey: f - } - }), Object.values(o).map(function(e, t) { - return { - sourceId: "hits_".concat(n.index, "_").concat(t), - onSelect: function(e) { - var t = e.item, n = e.event; - v(t), Hn(n) || m(); - }, - getItemUrl: function(e) { - return e.item.url; - }, - getItems: function() { - return Object.values(qn(e, function(e) { - return e.hierarchy.lvl1; - }, d)).map(function(e) { - return e.map(function(t) { - var n = null, r = e.find(function(e) { - return "lvl1" === e.type && e.hierarchy.lvl1 === t.hierarchy.lvl1; - }); - return "lvl1" !== t.type && r && (n = r), pn(pn({}, t), {}, { __docsearch_parent: n }, c); - }); - }).flat(); - } - }; - }); - })); - case 3: throw e.p = 3, "RetryError" === (F = e.v).name && a("error"), F; - case 4: return e.a(2); - } - }, e, null, [[1, 3]]); - })); - return function(t) { - return e.apply(this, arguments); - }; -}(); -function TD(e) { - var t, n, r, u, a = e.appId, i = e.apiKey, o = e.askAi, s = e.maxResultsPerGroup, c = e.theme, l = e.onClose, f = void 0 === l ? Wn : l, d = e.transformItems, p = void 0 === d ? Un : d, h = e.hitComponent, v = void 0 === h ? Da : h, m = e.resultsFooterComponent, D = void 0 === m ? function() { - return null; - } : m, y = e.navigator, g = e.initialScrollY, F = void 0 === g ? 0 : g, E = e.transformSearchClient, b = void 0 === E ? Un : E, _ = e.disableUserPersonalization, k = void 0 !== _ && _, C = e.initialQuery, A = void 0 === C ? "" : C, w = e.translations, S = void 0 === w ? {} : w, x = e.getMissingResultsUrl, O = e.insights, B = void 0 !== O && O, I = e.onAskAiToggle, T = e.interceptAskAiEvent, P = e.isAskAiActive, j = void 0 !== P && P, N = e.recentSearchesLimit, z = void 0 === N ? 7 : N, R = e.recentSearchesWithFavoritesLimit, M = void 0 === R ? 4 : R, Z = e.indices, L = void 0 === Z ? [] : Z, $ = e.indexName, q = e.searchParameters, U = e.isHybridModeSupported, H = void 0 !== U && U, V = hn(e, OD), W = S.footer, K = S.searchBox, J = hn(S, BD), Q = yn(It.useState({ - query: "", - collections: [], - completion: null, - context: {}, - isOpen: !1, - activeItemId: null, - status: "idle" - }), 2), G = Q[0], Y = Q[1], X = Boolean(o), ee = (null == S || null === (t = S.searchBox) || void 0 === t ? void 0 : t.placeholderText) || V.placeholder || "Search docs"; - X && (ee = (null == S || null === (r = S.searchBox) || void 0 === r ? void 0 : r.placeholderText) || "Search docs or ask AI a question"), j && (ee = (null == S || null === (u = S.searchBox) || void 0 === u ? void 0 : u.placeholderTextAskAi) || "Ask another question..."); - var te = It.useRef(null), ne = It.useRef(null), re = It.useRef(null), ue = It.useRef(null), ae = It.useRef(null), ie = It.useRef(15), oe = It.useRef("undefined" != typeof window ? window.getSelection().toString().slice(0, 512) : "").current, se = It.useRef(A || oe).current, ce = xD(a, i, b), le = "object" === En(o) ? o : null, fe = "string" == typeof o ? o : (null == le ? void 0 : le.assistantId) || null, de = null == le ? void 0 : le.searchParameters, pe = (null == le ? void 0 : le.useStagingEnv) || !1, he = yn(It.useState("initial"), 2), ve = he[0], me = he[1], De = function(e) { - var t = e.assistantId, n = e.searchClient, r = e.suggestedQuestionsEnabled, u = void 0 !== r && r, a = yn(Se([]), 2), i = a[0], o = a[1]; - return Oe(function() { - var e = function() { - var e = Xt(vn().m(function e() { - var r, u, a; - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return e.n = 1, n.search({ requests: [{ - indexName: "algolia_ask_ai_suggested_questions", - filters: "state:published AND assistantId:".concat(t), - hitsPerPage: 3 - }] }); - case 1: r = e.v, u = r.results, a = u[0], o(a.hits); - case 2: return e.a(2); - } - }, e); - })); - return function() { - return e.apply(this, arguments); - }; - }(); - u && t && "" !== t && e(); - }, [ - u, - t, - n - ]), i; - }({ - assistantId: fe, - searchClient: ce, - suggestedQuestionsEnabled: null == le ? void 0 : le.suggestedQuestions - }), ye = null !== (n = null == le ? void 0 : le.agentStudio) && void 0 !== n && n, ge = []; - if ($ && "" !== $ && ge.push({ - name: $, - searchParameters: q - }), L.length > 0 && L.forEach(function(e) { - ge.push("string" == typeof e ? { name: e } : e); - }), ge.length < 1) throw new Error("Must supply either `indexName` or `indices` for DocSearch to work"); - var Fe = ge[0].name, Ee = It.useRef($o({ - key: "__DOCSEARCH_FAVORITE_SEARCHES__".concat(Fe), - limit: 10 - })).current, be = It.useRef($o({ - key: "__DOCSEARCH_RECENT_SEARCHES__".concat(Fe), - limit: 0 === Ee.getAll().length ? z : M - })).current, _e = yn(It.useState(!1), 2), ke = _e[0], Ce = _e[1], Ae = nD({ - assistantId: fe, - apiKey: (null == le ? void 0 : le.apiKey) || i, - appId: (null == le ? void 0 : le.appId) || a, - indexName: (null == le ? void 0 : le.indexName) || Fe, - searchParameters: de, - useStagingEnv: pe, - agentStudio: ye - }), we = Ae.messages, xe = Ae.status, Be = Ae.sendMessage, Ie = Ae.stopAskAiStreaming, Te = Ae.askAiError, Pe = Ae.sendFeedback, je = Ae.conversations, Ne = Ae.clearError, ze = Ae.resetAskAiAbortScope, Re = Ae.resetAskAiChatSession, Me = It.useRef(xe); - It.useEffect(function() { - if (!k) { - if ("streaming" === Me.current && "ready" === xe) { - ke && we.at(-1) && (we.at(-1).metadata = { stopped: !0 }); - var e = we[0]; - if (null != e && e.parts) { - var t, n = an(e.parts); - try { - for (n.s(); !(t = n.n()).done;) { - var r = t.value; - "text" === r.type && je.add(In(r.text, we)); - } - } catch (e) { - n.e(e); - } finally { - n.f(); - } - } - } - Me.current = xe; - } - }, [ - xe, - we, - je, - k, - ke - ]); - var Ze = It.useMemo(function() { - return "error" === xe && Nn(Te, ye); - }, [ - xe, - Te, - ye - ]), Le = It.useMemo(function() { - if (Ze && "new-conversation" !== ve) return zn(Te) ? "minimal" : "thread-depth"; - }, [ - Ze, - ve, - Te - ]), $e = It.useCallback(function(e) { - var t = e.hierarchy, n = [ - "lvl6", - "lvl5", - "lvl4", - "lvl3", - "lvl2", - "lvl1", - "lvl0" - ].find(function(e) { - return t[e]; - }); - return pn(pn({}, e), {}, { - type: n || "lvl0", - content: null - }); - }, []), qe = It.useCallback(function(e) { - if (!k) { - var t = "content" === e.type ? e.__docsearch_parent || $e(e) : e; - t && -1 === Ee.getAll().findIndex(function(e) { - return e.objectID === t.objectID; - }) && be.add(t); - } - }, [ - Ee, - be, - k, - $e - ]), Ue = It.useCallback(function(e) { - if (G.context.algoliaInsightsPlugin && e.__autocomplete_id) { - var t = e, n = { - eventName: "Item Selected", - index: t.__autocomplete_indexName, - items: [t], - positions: [e.__autocomplete_id], - queryID: t.__autocomplete_queryID - }; - G.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(n); - } - }, [G.context.algoliaInsightsPlugin]), He = It.useRef(void 0), Ve = It.useCallback(function(e, t) { - var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : void 0; - if (e) { - var r = { - query: t, - suggestedQuestionId: null == n ? void 0 : n.objectID - }; - if (null != T && T(r)) return void (He.current && He.current.setQuery("")); - } - if (e && "new-conversation" === ve && me("initial"), I(e, { - query: t, - suggestedQuestionId: null == n ? void 0 : n.objectID - }), !H) { - Ce(!1), ze(), Ne(); - var u = {}; - if (n && (u.body = { suggestedQuestionId: n.objectID }), Be({ - role: "user", - parts: [{ - type: "text", - text: t - }] - }, u), ue.current) { - var a = ue.current; - "function" == typeof a.scrollTo ? a.scrollTo({ - top: 0, - behavior: "smooth" - }) : a.scrollTop = 0; - } - He.current && He.current.setQuery(""); - } - }, [ - I, - T, - ve, - me, - H, - Ne, - ze, - Be - ]), We = It.useCallback(function() { - var e = Xt(vn().m(function e(t, n) { - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: - if (fe && a) { - e.n = 1; - break; - } - return e.a(2); - case 1: return e.n = 2, Pe(t, n); - case 2: return e.a(2); - } - }, e); - })); - return function(t, n) { - return e.apply(this, arguments); - }; - }(), [ - fe, - a, - Pe - ]); - He.current || (He.current = fa({ - id: "docsearch", - defaultActiveItemId: 0, - openOnFocus: !0, - initialState: { - query: se, - context: { searchSuggestions: [] } - }, - insights: Boolean(B), - navigator: y, - onStateChange: function(e) { - Y(e.state); - }, - getSources: function(e) { - var t = e.query, n = e.state, r = e.setContext, u = e.setStatus; - if (!t) { - var o = function(e) { - var t = e.recentSearches, n = e.favoriteSearches, r = e.saveRecentSearch, u = e.onClose; - return e.disableUserPersonalization ? [] : [{ - sourceId: "recentSearches", - onSelect: function(e) { - var t = e.item, n = e.event; - r(t), Hn(n) || u(); - }, - getItemUrl: function(e) { - return e.item.url; - }, - getItems: function() { - return t.getAll(); - } - }, { - sourceId: "favoriteSearches", - onSelect: function(e) { - var t = e.item, n = e.event; - r(t), Hn(n) || u(); - }, - getItemUrl: function(e) { - return e.item.url; - }, - getItems: function() { - return n.getAll(); - } - }]; - }({ - recentSearches: be, - favoriteSearches: Ee, - saveRecentSearch: qe, - onClose: f, - disableUserPersonalization: k - }), c = X ? [{ - sourceId: "recentConversations", - getItems: function() { - return k ? [] : je.getAll(); - }, - onSelect: function(e) { - var t = e.item; - t.messages && (Re({ - kind: "setMessages", - messages: t.messages - }), I(!0)); - } - }] : []; - return [].concat(gn(o), c); - } - var d = ID({ - query: t, - state: { context: n.context }, - setContext: r, - setStatus: u, - searchClient: ce, - indexes: ge, - snippetLength: ie, - insights: Boolean(B), - appId: a, - apiKey: i, - maxResultsPerGroup: s, - transformItems: p, - saveRecentSearch: qe, - onClose: f - }), h = X ? [{ - sourceId: "askAI", - getItems: function() { - return [{ - type: "askAI", - query: t, - url_without_anchor: "", - objectID: "ask-ai-button", - content: null, - url: "", - anchor: null, - hierarchy: { - lvl0: "Ask AI", - lvl1: t, - lvl2: null, - lvl3: null, - lvl4: null, - lvl5: null, - lvl6: null - }, - _highlightResult: {}, - _snippetResult: {}, - __docsearch_parent: null - }]; - }, - onSelect: function(e) { - var t = e.item; - "askAI" === t.type && t.query && Ve(!0, t.query); - } - }] : []; - return d.then(function(e) { - return [].concat(h, gn(e)); - }); - } - })); - var Ke, Je, Qe = He.current, Ge = Qe.getEnvironmentProps, Ye = Qe.getRootProps, Xe = Qe.refresh; - (function(e) { - var t = e.getEnvironmentProps, n = e.panelElement, r = e.formElement, u = e.inputElement; - It.useEffect(function() { - if (n && r && u) { - var e = t({ - panelElement: n, - formElement: r, - inputElement: u - }), a = e.onTouchStart, i = e.onTouchMove; - return window.addEventListener("touchstart", a), window.addEventListener("touchmove", i), function() { - window.removeEventListener("touchstart", a), window.removeEventListener("touchmove", i); - }; - } - }, [ - t, - n, - r, - u - ]); - })({ - getEnvironmentProps: Ge, - panelElement: ue.current, - formElement: re.current, - inputElement: ae.current - }), Ke = { container: te.current }, Je = Ke.container, It.useEffect(function() { - if (Je) { - var e = Je.querySelectorAll("a[href]:not([disabled]), button:not([disabled]), input:not([disabled])"), t = e[0], n = e[e.length - 1]; - return Je.addEventListener("keydown", r), function() { - Je.removeEventListener("keydown", r); - }; - } - function r(e) { - "Tab" === e.key && (e.shiftKey ? document.activeElement === t && (e.preventDefault(), n.focus()) : document.activeElement === n && (e.preventDefault(), t.focus())); - } - }, [Je]), Zn({ theme: c }), It.useEffect(function() { - return document.body.classList.add("DocSearch--active"), function() { - var e, t; - document.body.classList.remove("DocSearch--active"), null === (e = (t = window).scrollTo) || void 0 === e || e.call(t, 0, F); - }; - }, []), It.useEffect(function() { - "undefined" != typeof window && window.localStorage && function() { - if ("undefined" == typeof window || !window.localStorage) return 0; - var e = 0; - for (var t in window.localStorage) window.localStorage.hasOwnProperty(t) && (e += window.localStorage[t].length + t.length); - return e; - }() > 4194304 && Mo(); - }, []), It.useLayoutEffect(function() { - var e = window.innerWidth - document.body.clientWidth; - return document.body.style.marginInlineEnd = "".concat(e, "px"), function() { - document.body.style.marginInlineEnd = "0px"; - }; - }, []), It.useEffect(function() { - window.matchMedia("(max-width: 768px)").matches && (ie.current = 5); - }, []), It.useEffect(function() { - var e; - ue.current && !j && ("function" == typeof (e = ue.current).scrollTo ? e.scrollTo({ - top: 0, - behavior: "smooth" - }) : e.scrollTop = 0); - }, [G.query, j]), It.useEffect(function() { - se.length > 0 && (Xe(), ae.current && ae.current.focus()); - }, [se, Xe]), It.useEffect(function() { - function e() { - if (ne.current) { - var e = .01 * window.innerHeight; - ne.current.style.setProperty("--docsearch-vh", "".concat(e, "px")); - } - } - return e(), window.addEventListener("resize", e), function() { - window.removeEventListener("resize", e); - }; - }, []); - var et = It.useRef(j); - It.useEffect(function() { - et.current && !j && (Qe.refresh(), Ne(), Re()), et.current = j; - }, [ - j, - Qe, - Ne, - Re - ]), It.useEffect(function() { - me("initial"); - }, [j, me]); - var tt = function() { - var e = Xt(vn().m(function e() { - return vn().w(function(e) { - for (;;) switch (e.n) { - case 0: return Ce(!0), e.n = 1, Ie(); - case 1: return e.a(2); - } - }, e); - })); - return function() { - return e.apply(this, arguments); - }; - }(), nt = function() { - Ne(), Re(), me("new-conversation"); - }, rt = !0, ut = G.collections.some(function(e) { - return e.items.length > 0; - }); - return "idle" !== G.status || !1 !== ut || 0 !== G.query.length || j || (rt = !1), It.createElement("div", sn({ ref: te }, Ye({ "aria-expanded": !0 }), { - className: [ - "DocSearch", - "DocSearch-Container", - "stalled" === G.status && "DocSearch-Container--Stalled", - "error" === G.status && "DocSearch-Container--Errored" - ].filter(Boolean).join(" "), - role: "button", - tabIndex: 0, - onMouseDown: function(e) { - e.target === e.currentTarget && f(); - } - }), It.createElement("div", { - className: "DocSearch-Modal", - ref: ne - }, It.createElement("header", { - className: "DocSearch-SearchBar", - ref: re - }, It.createElement(Ro, sn({}, Qe, { - state: G, - placeholder: ee || "Search docs", - autoFocus: 0 === se.length, - inputRef: ae, - isFromSelection: Boolean(se) && se === oe, - translations: K, - isAskAiActive: j, - askAiStatus: xe, - askAiError: Te, - askAiState: ve, - setAskAiState: me, - isThreadDepthError: Ze && "new-conversation" !== ve, - askAiBlockingChrome: Le, - onClose: f, - onAskAiToggle: I, - onAskAgain: function(e) { - Ve(!0, e); - }, - onStopAskAiStreaming: tt, - onNewConversation: nt, - onViewConversationHistory: function() { - me("conversation-history"); - } - }))), rt && It.createElement("div", { - className: "DocSearch-Dropdown", - ref: ue - }, It.createElement(Bo, sn({}, Qe, { - indexName: Fe, - state: G, - hitComponent: v, - resultsFooterComponent: D, - disableUserPersonalization: k, - recentSearches: be, - favoriteSearches: Ee, - conversations: je, - inputRef: ae, - translations: J, - getMissingResultsUrl: x, - isAskAiActive: j, - canHandleAskAi: X, - messages: we, - askAiError: Te, - status: xe, - hasCollections: ut, - askAiState: ve, - selectAskAiQuestion: Ve, - suggestedQuestions: De, - selectSuggestedQuestion: function(e) { - Ve(!0, e.question, e); - }, - agentStudio: ye, - onAskAiToggle: I, - onNewConversation: nt, - onItemClick: function(e, t) { - if ("askAI" === e.type && e.query) { - if ("stored" === e.anchor && "messages" in e) { - Re({ - kind: "setMessages", - messages: e.messages - }); - var n = { - query: e.query, - messageId: e.messages[0].id - }; - if (null != T && T(n)) return He.current && He.current.setQuery(""), void t.preventDefault(); - I(!0, n); - } else Ve(!0, e.query); - me("initial"), t.preventDefault(); - return; - } - Ue(e), qe(e), Hn(t) || f(); - }, - onFeedback: We - }))), It.createElement("footer", { className: "DocSearch-Footer" }, It.createElement(ma, { - translations: W, - isAskAiActive: j - })))); -} -var PD = It.forwardRef(function(e, t) { - return It.createElement(qt, sn({}, e, { ref: t }), It.createElement(jD, e)); -}); -function jD(e) { - var t, n, r, u = function() { - var e = It.useContext($t); - if (void 0 === e) throw new Error("`useDocSearch` must be used within the `DocSearch` provider"); - return e; - }(), a = u.searchButtonRef, i = u.keyboardShortcuts, o = u.isModalActive, s = u.isAskAiActive, c = u.initialQuery, l = u.onAskAiToggle, f = u.openModal, d = u.closeModal; - return It.createElement(It.Fragment, null, It.createElement(Yn, { - keyboardShortcuts: i, - ref: a, - translations: null === (t = e.translations) || void 0 === t ? void 0 : t.button, - onClick: f - }), o && pt(It.createElement(TD, sn({}, e, { - initialScrollY: window.scrollY, - initialQuery: c, - translations: null == e || null === (n = e.translations) || void 0 === n ? void 0 : n.modal, - isAskAiActive: s, - onAskAiToggle: l, - onClose: d - })), null !== (r = e.portalContainer) && void 0 !== r ? r : document.body)); -} -var ND = function(e, t, n, r) { - var u; - t[0] = 0; - for (var a = 1; a < t.length; a++) { - var i = t[a++], o = t[a] ? (t[0] |= i ? 1 : 2, n[t[a++]]) : t[++a]; - 3 === i ? r[0] = o : 4 === i ? r[1] = Object.assign(r[1] || {}, o) : 5 === i ? (r[1] = r[1] || {})[t[++a]] = o : 6 === i ? r[1][t[++a]] += o + "" : i ? (u = e.apply(o, ND(e, o, n, ["", null])), r.push(u), o[0] ? t[0] |= 2 : (t[a - 2] = 0, t[a] = u)) : r.push(o); - } - return r; -}, zD = /* @__PURE__ */ new Map(); -var RD = [ - "container", - "environment", - "transformSearchClient", - "hitComponent", - "resultsFooterComponent" -]; -var MD = function(e) { - var t = zD.get(this); - return t || (t = /* @__PURE__ */ new Map(), zD.set(this, t)), (t = ND(this, t.get(e) || (t.set(e, t = function(e) { - for (var t, n, r = 1, u = "", a = "", i = [0], o = function(e) { - 1 === r && (e || (u = u.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? i.push(0, e, u) : 3 === r && (e || u) ? (i.push(3, e, u), r = 2) : 2 === r && "..." === u && e ? i.push(4, e, 0) : 2 === r && u && !e ? i.push(5, 0, !0, u) : r >= 5 && ((u || !e && 5 === r) && (i.push(r, 0, u, n), r = 6), e && (i.push(r, e, 0, n), r = 6)), u = ""; - }, s = 0; s < e.length; s++) { - s && (1 === r && o(), o(s)); - for (var c = 0; c < e[s].length; c++) t = e[s][c], 1 === r ? "<" === t ? (o(), i = [i], r = 3) : u += t : 4 === r ? "--" === u && ">" === t ? (r = 1, u = "") : u = t + u[0] : a ? t === a ? a = "" : u += t : "\"" === t || "'" === t ? a = t : ">" === t ? (o(), r = 1) : r && ("=" === t ? (r = 5, n = u, u = "") : "/" === t && (r < 5 || ">" === e[s][c + 1]) ? (o(), 3 === r && (i = i[0]), r = i, (i = i[0]).push(2, 0, r), r = 0) : " " === t || " " === t || "\n" === t || "\r" === t ? (o(), r = 2) : u += t), 3 === r && "!--" === u && (r = 4, i = i[0]); - } - return o(), i; - }(e)), t), arguments, [])).length > 1 ? t : t[0]; -}.bind($); -function ZD(e) { - if (e) return function(t) { - var n = e(t, { html: MD }); - return Ot(n) ? n : "function" == typeof n ? n(t) : "string" == typeof n ? $("span", null, n) : n; - }; -} -function LD(e) { - var t = e.container, n = e.environment, r = e.transformSearchClient, u = e.hitComponent, a = e.resultsFooterComponent, i = v(e, RD), o = function(e, t) { - if ("string" != typeof e) return e; - if (!t) throw new Error("Cannot resolve a selector without a browser environment."); - var n = t.document.querySelector(e); - if (!n) throw new Error("Container selector did not match any element: \"".concat(e, "\"")); - return n; - }(t, n || ("undefined" != typeof window ? window : void 0)), s = { current: null }, c = !1; - return gt($(PD, h(h({}, i), {}, { - ref: s, - hitComponent: ZD(u), - resultsFooterComponent: ZD(a), - transformSearchClient: function(e) { - return null != e && e.addAlgoliaAgent && e.addAlgoliaAgent("docsearch.js", SD), "function" == typeof r ? r(e) : e; - } - })), o), c = !0, { - open: function() { - var e; - null === (e = s.current) || void 0 === e || e.open(); - }, - close: function() { - var e; - null === (e = s.current) || void 0 === e || e.close(); - }, - openAskAi: function(e) { - var t; - null === (t = s.current) || void 0 === t || t.openAskAi(e); - }, - get isReady() { - return c; - }, - get isOpen() { - var e, t; - return null !== (e = null === (t = s.current) || void 0 === t ? void 0 : t.isOpen) && void 0 !== e && e; - }, - destroy: function() { - Bt(o), c = !1; - } - }; -} -//#endregion -//#region js/docs.ts -LD({ - container: "#docsearch", - appId: "NE1EGTYLS9", - indexName: "tabler", - apiKey: "016353235ef1dd32a6c392be0e939058" -}); -//#endregion - -//# sourceMappingURL=docs.js.map \ No newline at end of file diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 0bb97a03e..1ad32d365 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -1,9 +1,12 @@ // @ts-check -import { defineConfig } from 'astro/config' +import { defineConfig, envField } from 'astro/config' +import vercel from '@astrojs/vercel' import mdx from '@astrojs/mdx' import { satteri } from '@astrojs/markdown-satteri' +import { unwrapJsxParagraphs } from './lib/satteri-unwrap-jsx-paragraphs.mjs' import { fileURLToPath } from 'node:url' import { copyAssets } from '../.build/copy-assets' +import { redirects } from './lib/redirects.ts' /** @param {string} p */ const path = (p) => fileURLToPath(new URL(p, import.meta.url)) @@ -11,8 +14,28 @@ const path = (p) => fileURLToPath(new URL(p, import.meta.url)) // https://astro.build/config export default defineConfig({ site: 'https://docs.tabler.io', + env: { + // DocSearch/Algolia config for the docs search (see DocsNavbar.astro). + // Values come from the environment only (.env locally, project settings on + // Vercel) — see .env.example. When unset, the search input is hidden. + schema: { + DOCSEARCH_APP_ID: envField.string({ context: 'client', access: 'public', optional: true }), + DOCSEARCH_INDEX_NAME: envField.string({ context: 'client', access: 'public', optional: true }), + DOCSEARCH_API_KEY: envField.string({ context: 'client', access: 'public', optional: true }), + }, + }, + // Static output + the Vercel adapter: turns `redirects` below into real HTTP + // redirects at Vercel's routing layer (no adapter = meta-refresh HTML pages). + adapter: vercel({ + webAnalytics: { + enabled: true, + }, + }), + // renamed/moved pages, shared with middleware.ts + redirects, // pages live at the package root (./pages) — content-first layout; all - // components/lib/data are shared (see the @shared alias) + // components/lib/data are shared (see the @shared alias). The docs content + // itself lives in ./content and is rendered by pages/[...slug].astro. srcDir: '.', server: { port: 3010, @@ -21,6 +44,9 @@ export default defineConfig({ host: true, }, vite: { + define: { + TABLER_STATIC_BASE: JSON.stringify('/static'), + }, resolve: { alias: { '@data': fileURLToPath(new URL('../shared/data', import.meta.url)), @@ -29,10 +55,10 @@ export default defineConfig({ '@ui': fileURLToPath(new URL('../shared/ui', import.meta.url)), // docs-only components (Example, DocsMenu, …) '@components': fileURLToPath(new URL('./components', import.meta.url)), - // docs-only layouts (DocsLayout + the MDX adapter, referenced by `layout:` front matter) + // docs-only layouts (DocsLayout) '@layouts': fileURLToPath(new URL('./layouts', import.meta.url)), - // this package's pages dir — used by @shared/lib/docs-children's glob - '@pages': fileURLToPath(new URL('./pages', import.meta.url)), + // docs-only helpers (docs collection queries) + '@lib': fileURLToPath(new URL('./lib', import.meta.url)), }, }, }, @@ -45,7 +71,17 @@ export default defineConfig({ from: path('./assets'), to: path('./public'), label: '@tabler/docs', - requiredFile: path('./assets/css/docs.css'), + requiredFile: path('./assets/favicon.ico'), + }, + { + // docs css built by this package's sass pipeline (see the `css` and + // `watch-css` scripts, which both write here). Source is tmp-assets/ + // (not public/) because copy-assets wipes public/ on every restart — + // anything a watcher writes straight into public/ is lost there. + from: path('./tmp-assets/css'), + to: path('./public/css'), + label: '@tabler/docs', + requiredFile: path('./tmp-assets/css/docs.css'), }, { from: path('../core/dist'), @@ -73,6 +109,7 @@ export default defineConfig({ { from: path('../core/dist'), to: path('./public/dist') }, { from: path('../preview/tmp-assets'), to: path('./public/preview') }, { from: path('./assets'), to: path('./public') }, + { from: path('./tmp-assets/css'), to: path('./public/css') }, { from: path('../shared/static'), to: path('./public/static') }, ], }), @@ -80,7 +117,7 @@ export default defineConfig({ ], markdown: { // No typographic quote rewriting. - processor: satteri({ features: { smartPunctuation: false } }), + processor: satteri({ features: { smartPunctuation: false }, mdastPlugins: [unwrapJsxParagraphs] }), shikiConfig: { theme: 'github-dark', }, diff --git a/docs/components/CdnImportPackage.astro b/docs/components/CdnImportPackage.astro index 2d22f933d..4c395245c 100644 --- a/docs/components/CdnImportPackage.astro +++ b/docs/components/CdnImportPackage.astro @@ -1,10 +1,6 @@ --- import { Code } from 'astro:components' -import { site } from '@shared/lib/site.ts' +import { cdnPackageSnippet } from '@lib/cdn-snippets.ts' --- - -`} -/> + diff --git a/docs/components/CdnImportPlugin.astro b/docs/components/CdnImportPlugin.astro index 724e155db..642d27188 100644 --- a/docs/components/CdnImportPlugin.astro +++ b/docs/components/CdnImportPlugin.astro @@ -1,6 +1,6 @@ --- import { Code } from 'astro:components' -import { site } from '@shared/lib/site.ts' +import { cdnPluginSnippet } from '@lib/cdn-snippets.ts' interface Props { plugins: string[] @@ -9,11 +9,4 @@ interface Props { const { plugins }: Props = Astro.props --- - { - return `` - }) - .join('\n')} -/> + diff --git a/docs/components/CodeSnippet.astro b/docs/components/CodeSnippet.astro index 6b5b92b4d..78e003078 100644 --- a/docs/components/CodeSnippet.astro +++ b/docs/components/CodeSnippet.astro @@ -16,9 +16,9 @@ const highlighted = await highlightCode(code, lang) --- diff --git a/docs/components/Colors.astro b/docs/components/Colors.astro index 9c9afd34f..054e68e69 100644 --- a/docs/components/Colors.astro +++ b/docs/components/Colors.astro @@ -10,7 +10,7 @@ const { colors }: Props = Astro.props { Object.values(colors).map((color) => { return ( -
+
{color.title}
diff --git a/docs/components/DocsCard.astro b/docs/components/DocsCard.astro index 40eb08af6..d936ea1f8 100644 --- a/docs/components/DocsCard.astro +++ b/docs/components/DocsCard.astro @@ -4,7 +4,7 @@ import Icon from '@ui/Icon.astro' interface Props { /** When omitted, the card renders as a non-interactive "Coming soon" tile. */ href?: string - icon?: string + icon?: string | undefined title: string description: string } diff --git a/docs/components/DocsChildrenCards.astro b/docs/components/DocsChildrenCards.astro new file mode 100644 index 000000000..2285e7ffd --- /dev/null +++ b/docs/components/DocsChildrenCards.astro @@ -0,0 +1,18 @@ +--- +// Cards for the direct child pages of a docs index url. MDX cannot await, so +// pages use this component instead of calling getDocsChildren() inline. +// Renders bare cards — the caller supplies the surrounding `.row`. +import DocsCard from '@components/DocsCard.astro' +import { getDocsChildren } from '@lib/docs-pages' + +interface Props { + /** docs url whose children are listed, e.g. "/ui/getting-started/frameworks" */ + url: string +} + +const { url } = Astro.props + +const children = await getDocsChildren(url) +--- + +{children.map((child) => )} diff --git a/docs/components/DocsClassnames.astro b/docs/components/DocsClassnames.astro new file mode 100644 index 000000000..42e2fa6be --- /dev/null +++ b/docs/components/DocsClassnames.astro @@ -0,0 +1,71 @@ +--- +// Class reference for a component, from the page's `classnames` front matter +// (see docs/content.config.ts). Groups are rendered in a fixed order so every +// page reads the same way, whatever order the front matter happens to use. +import Badge from '@ui/Badge.astro' + +type Entry = { class: string; desc: string; default: boolean } + +interface Props { + classnames: Record +} + +const { classnames }: Props = Astro.props + +const groupOrder = ['component', 'part', 'style', 'modifier', 'behavior', 'direction', 'color', 'size'] + +// One soft color per kind, so the type column can be scanned without reading it. +// `bg-*-lt` carries both the tint and a matching text color, and follows the +// color mode on its own. +const groupColors: Record = { + component: 'blue', + part: 'cyan', + style: 'purple', + modifier: 'indigo', + behavior: 'yellow', + direction: 'teal', + color: 'pink', + size: 'orange', +} + +const groupIcons: Record = { + component: 'box', + part: 'puzzle', + style: 'brush', + modifier: 'adjustments', + behavior: 'hand-click', + direction: 'arrows-move', + color: 'palette', + size: 'ruler-measure', +} +const groups = Object.entries(classnames).sort(([a], [b]) => (groupOrder.indexOf(a) + 1 || 99) - (groupOrder.indexOf(b) + 1 || 99)) +--- + + +

Class reference

+ +

Every class this component ships, grouped by what it changes. A name in braces stands for a family — {'{color}'} is any base color, {'{breakpoint}'} any responsive step.

+ + + + { + groups.map(([group, entries]) => + entries.map((entry) => ( + + + + + + )), + ) + } + +
+ {entry.class} + + + + {entry.desc} + {entry.default && } +
+ diff --git a/docs/components/DocsMenu.astro b/docs/components/DocsMenu.astro index a80ba9aac..48e3dee6b 100644 --- a/docs/components/DocsMenu.astro +++ b/docs/components/DocsMenu.astro @@ -9,7 +9,10 @@ interface MenuLeaf { url: string } -interface MenuGroup extends MenuLeaf { +interface MenuGroup { + title: string + /** omitted for groups that only label a set of pages, with no index page of their own */ + url?: string children?: MenuLeaf[] } @@ -19,12 +22,21 @@ interface MenuSection { } interface Props { - /** Page URL in the docs namespace (equivalent of page.url), e.g. "/ui/components/alert/". */ + /** Page URL in the docs namespace (equivalent of page.url), e.g. "/ui/components/alert". */ url: string } const { url } = Astro.props const menu = docs.menu as MenuSection[] + +// Keep declarations above this line: a value between the interfaces stops +// Astro's frontmatter scanner from picking up `Props`, leaving props untyped. + +/** Collapse target: from the group's url, or from its title when it has none. */ +const groupId = (group: MenuGroup) => + `collapse-${slug(group.url ?? group.title) + .toLowerCase() + .replace(/[^a-z0-9-]+/g, '-')}` --- @@ -42,23 +54,28 @@ const menu = docs.menu as MenuSection[] const expanded = url === level2.url || Boolean(level2.children?.some((child) => child.url === url)) return (
- {/* href/data-bs-* only when the element has children */} - {hasChildren ? ( - - {level2.title} + {/* href/data-bs-* only when the element has children; a group + without an index page toggles from a button instead */} + {hasChildren && level2.url ? ( + + {level2.title} + ) : hasChildren ? ( + ) : ( - - {level2.title} + + {level2.title} )} {hasChildren && ( -
+
{level2.children!.map((level3) => ( ))} diff --git a/docs/components/DocsNavbar.astro b/docs/components/DocsNavbar.astro index d2442be4d..28f33b9e2 100644 --- a/docs/components/DocsNavbar.astro +++ b/docs/components/DocsNavbar.astro @@ -1,60 +1,42 @@ --- import Icon from '@ui/Icon.astro' import DocsLogo from './DocsLogo.astro' +import docs from '@data/docs.json' import { site } from '@shared/lib/site' +// Website / Preview / Support come from shared/data/docs.json, the same list the +// sidebar used to render — keeping one source of truth for the product links. +const productLinks = docs.links as { title: string; url: string; icon: string }[] + // Eventually belongs in src/lib/site.ts (out of scope for this task). -const previewUrl = 'https://preview.tabler.io' const changelogUrl = 'https://tabler.io/changelog' ---