From 7285b329fa7dd5d0f2698235f0a8cc2920fe5a1d Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Mon, 9 Nov 2026 18:52:42 -0500 Subject: [PATCH 1/7] Regenerate artifacts. --- .gitignore | 4 + builds/msvc/vs2026/bs/bs.vcxproj | 104 +++++++ builds/msvc/vs2026/bs/bs.vcxproj.filters | 360 +++++++++++++++++++++++ 3 files changed, 468 insertions(+) diff --git a/.gitignore b/.gitignore index 5c78ea21e..e463430ec 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,7 @@ AI agent tooling .claude AGENTS.md CLAUDE.md + +# web +web/*/dist +web/*/node_modules diff --git a/builds/msvc/vs2026/bs/bs.vcxproj b/builds/msvc/vs2026/bs/bs.vcxproj index e2f6a0a9c..75bceb0ad 100644 --- a/builds/msvc/vs2026/bs/bs.vcxproj +++ b/builds/msvc/vs2026/bs/bs.vcxproj @@ -128,6 +128,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/builds/msvc/vs2026/bs/bs.vcxproj.filters b/builds/msvc/vs2026/bs/bs.vcxproj.filters index 302ca64e6..bc2658bd7 100644 --- a/builds/msvc/vs2026/bs/bs.vcxproj.filters +++ b/builds/msvc/vs2026/bs/bs.vcxproj.filters @@ -16,6 +16,54 @@ {F45B7D90-90BC-41EF-0000-000000000002} + + {F45B7D90-90BC-41EF-0000-000000000003} + + + {F45B7D90-90BC-41EF-0000-000000000004} + + + {F45B7D90-90BC-41EF-0000-000000000005} + + + {F45B7D90-90BC-41EF-0000-000000000006} + + + {F45B7D90-90BC-41EF-0000-000000000007} + + + {F45B7D90-90BC-41EF-0000-000000000008} + + + {F45B7D90-90BC-41EF-0000-000000000009} + + + {F45B7D90-90BC-41EF-0000-00000000000A} + + + {F45B7D90-90BC-41EF-0000-00000000000B} + + + {F45B7D90-90BC-41EF-0000-00000000000C} + + + {F45B7D90-90BC-41EF-0000-00000000000D} + + + {F45B7D90-90BC-41EF-0000-00000000000E} + + + {F45B7D90-90BC-41EF-0000-00000000000F} + + + {F45B7D90-90BC-41EF-0000-000000000001} + + + {F45B7D90-90BC-41EF-0000-000000000002} + + + {F45B7D90-90BC-41EF-0000-000000000003} + @@ -112,6 +160,318 @@ + + web\admin-dashboard + + + web\admin-dashboard + + + web\admin-dashboard + + + web\admin-dashboard\src\app + + + web\admin-dashboard\src\app + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src\components + + + web\admin-dashboard\src + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src\lib + + + web\admin-dashboard\src + + + web\admin-dashboard\src + + + web\admin-dashboard + + + web\admin-dashboard + + + web\admin-dashboard + + + web\admin-dashboard + + + web\blockexplorer + + + web\blockexplorer + + + web\blockexplorer + + + web\blockexplorer\src\app + + + web\blockexplorer\src\app + + + web\blockexplorer\src\app + + + web\blockexplorer\src\app + + + web\blockexplorer\src\app + + + web\blockexplorer\src\app + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src\components + + + web\blockexplorer\src + + + web\blockexplorer\src\lib\api + + + web\blockexplorer\src\lib\api\providers + + + web\blockexplorer\src\lib\api\providers + + + web\blockexplorer\src\lib\api\providers + + + web\blockexplorer\src\lib\api\providers + + + web\blockexplorer\src\lib\hooks + + + web\blockexplorer\src\lib\hooks + + + web\blockexplorer\src\lib\hooks + + + web\blockexplorer\src\lib\hooks + + + web\blockexplorer\src\lib\hooks + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src\lib\utils + + + web\blockexplorer\src + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src\routes + + + web\blockexplorer\src + + + web\blockexplorer + + + web\blockexplorer + + + web\blockexplorer + + + web\blockexplorer + + + web + From f54f42caebe798cfd15e5e4525cef5b345946106 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Mon, 9 Nov 2026 19:31:33 -0500 Subject: [PATCH 2/7] Add Vite plugin to prepend third-party notices to web bundles. --- builds/msvc/vs2026/bs/bs.vcxproj | 1 + builds/msvc/vs2026/bs/bs.vcxproj.filters | 3 + web/admin-dashboard/vite.config.ts | 6 +- web/blockexplorer/vite.config.ts | 3 +- web/licenses.mjs | 294 +++++++++++++++++++++++ 5 files changed, 305 insertions(+), 2 deletions(-) create mode 100644 web/licenses.mjs diff --git a/builds/msvc/vs2026/bs/bs.vcxproj b/builds/msvc/vs2026/bs/bs.vcxproj index 75bceb0ad..f40abc199 100644 --- a/builds/msvc/vs2026/bs/bs.vcxproj +++ b/builds/msvc/vs2026/bs/bs.vcxproj @@ -232,6 +232,7 @@ + diff --git a/builds/msvc/vs2026/bs/bs.vcxproj.filters b/builds/msvc/vs2026/bs/bs.vcxproj.filters index bc2658bd7..c52a06467 100644 --- a/builds/msvc/vs2026/bs/bs.vcxproj.filters +++ b/builds/msvc/vs2026/bs/bs.vcxproj.filters @@ -472,6 +472,9 @@ web + + web + diff --git a/web/admin-dashboard/vite.config.ts b/web/admin-dashboard/vite.config.ts index b6368382a..bcc1b54e4 100644 --- a/web/admin-dashboard/vite.config.ts +++ b/web/admin-dashboard/vite.config.ts @@ -2,9 +2,13 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import tsconfigPaths from "vite-tsconfig-paths"; +import { licenses, worker_licenses } from "../licenses.mjs"; export default defineConfig({ - plugins: [tailwindcss(), react(), tsconfigPaths()], + plugins: [tailwindcss(), react(), tsconfigPaths(), licenses()], + worker: { + plugins: () => [worker_licenses()], + }, build: { assetsDir: "", rollupOptions: { diff --git a/web/blockexplorer/vite.config.ts b/web/blockexplorer/vite.config.ts index 18c5063ae..9dbbfb0d1 100644 --- a/web/blockexplorer/vite.config.ts +++ b/web/blockexplorer/vite.config.ts @@ -2,9 +2,10 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import tsconfigPaths from "vite-tsconfig-paths"; +import { licenses } from "../licenses.mjs"; export default defineConfig({ - plugins: [tailwindcss(), react(), tsconfigPaths()], + plugins: [tailwindcss(), react(), tsconfigPaths(), licenses()], build: { assetsDir: "", // all files in dist root rollupOptions: { diff --git a/web/licenses.mjs b/web/licenses.mjs new file mode 100644 index 000000000..81e3128ee --- /dev/null +++ b/web/licenses.mjs @@ -0,0 +1,294 @@ +// Prepends to each built script and stylesheet the published notice of every +// third-party package whose code it contains. +// Usage: plugins: [..., licenses()], worker: { plugins: () => [worker_licenses()] } +import { existsSync, readdirSync, readFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; + +const worker = { builds: 0, packages: new Map() }; + +const notice_file = /^(licen[cs]e|copying)(\.md|\.txt)?$/i; +const vite_appendix = /^# Licenses of bundled dependencies/m; + +function fail(message) +{ + throw new Error(`licenses: ${message}`); +} + +function normal(path) +{ + return path.split('\\').join('/'); +} + +function clean(text) +{ + const lines = text.replace(/\r\n/g, '\n').split('\n').map((line) => line.trimEnd()); + while (lines.length > 0 && lines[0] === '') + lines.shift(); + + while (lines.length > 0 && lines[lines.length - 1] === '') + lines.pop(); + + return lines.join('\n'); +} + +function package_root(path) +{ + const match = normal(path).match(/^(.*\/node_modules\/(?:@[^/]+\/)?[^/]+)\//); + return match ? match[1] : undefined; +} + +function find_package(name, from) +{ + for (let directory = from; ; directory = dirname(directory)) + { + const root = join(directory, 'node_modules', name); + if (existsSync(join(root, 'package.json'))) + return normal(root); + + if (dirname(directory) === directory) + fail(`package '${name}' not found from ${from}`); + } +} + +function bare_specifier(specifier) +{ + if (specifier.startsWith('.') || specifier.startsWith('/')) + return undefined; + + const parts = specifier.split('/'); + return specifier.startsWith('@') ? parts.slice(0, 2).join('/') : parts[0]; +} + +function read_package(root) +{ + return JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')); +} + +// The leading comment of the package's main file, for packages that publish +// their notice there instead of in a license file. +function header_notice(root, manifest) +{ + const main = join(root, manifest.main ?? 'index.js'); + const lines = []; + for (const line of readFileSync(main, 'utf8').replace(/\r\n/g, '\n').split('\n')) + { + if (!line.startsWith('//')) + break; + + lines.push(line.replace(/^\/\/ ?/, '').replace(/^-+$/, '')); + } + + const text = clean(lines.join('\n')); + if (!/copyright/i.test(text)) + fail(`${manifest.name} has no license file and no notice in ${main}`); + + return text; +} + +// The quoted license text of a dependency recorded in vite's own notice. +function vite_bundled_notice(vite, name) +{ + const text = readFileSync(join(vite, 'LICENSE.md'), 'utf8').replace(/\r\n/g, '\n'); + const lines = text.split('\n'); + const start = lines.findIndex((line) => + line.startsWith('## ') && line.slice(3).split(', ').includes(name)); + + if (start < 0) + fail(`${name} not found in ${vite}/LICENSE.md`); + + const quoted = []; + for (const line of lines.slice(start + 1)) + { + if (line.startsWith('## ')) + break; + + if (line.startsWith('>')) + quoted.push(line.replace(/^> ?/, '')); + else if (quoted.length > 0) + break; + } + + return clean(quoted.join('\n')); +} + +function package_entry(root) +{ + const manifest = read_package(root); + const file = readdirSync(root).find((name) => notice_file.test(name)); + let text = file ? readFileSync(join(root, file), 'utf8') : header_notice(root, manifest); + + if (manifest.name === 'vite') + text = text.split(vite_appendix)[0]; + + return { name: manifest.name, version: manifest.version, text: clean(text) }; +} + +// Code generated by the build itself rather than imported from a package. +function generated_entry(id, base) +{ + if (id.startsWith('\0vite/') || /\?worker/.test(id)) + return package_entry(find_package('vite', base)); + + if (id === '\0commonjsHelpers.js') + { + const vite = find_package('vite', base); + const plugin = '@rollup/plugin-commonjs'; + const version = read_package(vite).version; + return { name: plugin, version: `bundled in vite ${version}`, text: vite_bundled_notice(vite, plugin) }; + } + + return undefined; +} + +function add(entries, entry) +{ + entries.set(`${entry.name}@${entry.version}`, entry); +} + +function collect_module(entries, id, base) +{ + const generated = generated_entry(id, base); + if (generated) + { + add(entries, generated); + return; + } + + if (id.startsWith('\0') && !package_root(id.slice(1))) + fail(`unattributed generated module ${JSON.stringify(id)}`); + + const root = package_root(id.replace(/^\0/, '').split('?')[0]); + if (root) + add(entries, package_entry(root)); +} + +// Packages reached from a stylesheet: @import and @plugin specifiers, and the +// imports of the config named by @config. +function collect_stylesheet(entries, id) +{ + const path = id.split('?')[0]; + const root = package_root(path); + if (root) + { + add(entries, package_entry(root)); + return; + } + + const source = readFileSync(path, 'utf8'); + const directory = dirname(path); + const specifiers = [...source.matchAll(/@(?:import|plugin)\s+['"]([^'"]+)['"]/g)].map((match) => match[1]); + + for (const [, config] of source.matchAll(/@config\s+['"]([^'"]+)['"]/g)) + { + const script = readFileSync(join(directory, config), 'utf8'); + for (const match of script.matchAll(/(?:from|import|require\()\s*['"]([^'"]+)['"]/g)) + specifiers.push(match[1]); + } + + for (const specifier of specifiers) + { + const name = bare_specifier(specifier); + if (name) + add(entries, package_entry(find_package(name, directory))); + } +} + +function comment(entries) +{ + const groups = new Map(); + for (const entry of [...entries.values()].sort((a, b) => a.name.localeCompare(b.name))) + { + const names = groups.get(entry.text) ?? []; + names.push(`${entry.name} ${entry.version}`); + groups.set(entry.text, names); + } + + const lines = ['/*!', ' * Third-party software contained in this file, with its published notices.']; + for (const [text, names] of groups) + { + lines.push(' *', ` * ---- ${names.join(', ')} ----`, ' *'); + for (const line of text.replace(/\*\//g, '*\\/').split('\n')) + lines.push(line ? ` * ${line}` : ' *'); + } + + lines.push(' */', ''); + return lines.join('\n'); +} + +function chunk_entries(chunk, base) +{ + const entries = new Map(); + const ids = Object.entries(chunk.modules) + .filter(([, module]) => module.renderedLength > 0) + .map(([id]) => id); + + for (const id of ids) + collect_module(entries, id, base); + + if (ids.some((id) => /\?worker/.test(id))) + { + if (worker.builds === 0) + fail(`${chunk.fileName} inlines a worker built without worker_licenses()`); + + for (const entry of worker.packages.values()) + add(entries, entry); + } + + return entries; +} + +export function licenses() +{ + let base; + return { + name: 'licenses', + apply: 'build', + enforce: 'post', + configResolved(config) + { + base = config.root; + }, + generateBundle(_, bundle) + { + const stylesheets = new Map(); + for (const id of this.getModuleIds()) + if (/\.css($|\?)/.test(id)) + collect_stylesheet(stylesheets, id); + + for (const file of Object.values(bundle)) + { + if (file.type === 'chunk') + { + const entries = chunk_entries(file, base); + if (entries.size > 0) + file.code = comment(entries) + file.code; + } + else if (file.fileName.endsWith('.css') && stylesheets.size > 0) + { + file.source = comment(stylesheets) + file.source; + } + } + } + }; +} + +export function worker_licenses() +{ + let base; + return { + name: 'worker-licenses', + apply: 'build', + configResolved(config) + { + base = config.root; + }, + generateBundle(_, bundle) + { + worker.builds++; + for (const file of Object.values(bundle)) + if (file.type === 'chunk') + for (const entry of chunk_entries(file, base).values()) + add(worker.packages, entry); + } + }; +} From 88b67cc02328e4aa5f8b42159ad11101a0196062 Mon Sep 17 00:00:00 2001 From: Eric Voskuil Date: Mon, 9 Nov 2026 19:31:33 -0500 Subject: [PATCH 3/7] Regenerate embedded web pages with third-party notices. --- console/embedded/admin_css.cpp | 62 +++- console/embedded/admin_ecma.cpp | 405 +++++++++++++++-------- console/embedded/native_css.cpp | 37 ++- console/embedded/native_ecma.cpp | 534 +++++++++++++++++++++++-------- 4 files changed, 767 insertions(+), 271 deletions(-) diff --git a/console/embedded/admin_css.cpp b/console/embedded/admin_css.cpp index efe464bc0..020145c1f 100644 --- a/console/embedded/admin_css.cpp +++ b/console/embedded/admin_css.cpp @@ -23,11 +23,63 @@ namespace server { // Simple test css for embedded page, links in font. DEFINE_EMBEDDED_PAGE(admin_pages, char, css, -R"DELIM(.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-950:oklch(27.9% .077 45.635);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-950:oklch(26.2% .051 172.552);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-500:oklch(60.6% .25 292.717);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-500:oklch(55.2% .016 285.938);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-md:.375rem;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-)DELIM" -R"DELIM(webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.top-0{top:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.order-1{order:1}.order-2{order:2}.order-3{order:3}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(va)DELIM" -R"DELIM(r(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-\[min\(60vh\,32rem\)\]{height:min(60vh,32rem)}.h-full{height:100%}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[92vh\]{max-height:92vh}.max-h-\[calc\(100vh-2rem\)\]{max-height:calc(100vh - 2rem)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-72{min-height:calc(var(--spacing) * 72)}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-24{width:calc(var(--spacing) * 24)}.w-\[min\(60rem\,90vw\)\]{width:min(60rem,90vw)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\[32rem\]{min-width:32rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[5\.5rem_4\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:5.5rem 4.5rem minmax(0,1fr)}.grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/20>:not(:last-child)){border-color:#c8563733}.self-center{align-self:center}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/10{border-color:#ffa0221a}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/35{border-color:#ffa02259}.border-accent\/40{border-color:#ffa02266}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-amber-400\/35{border-color:#fcbb0059}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/35{border-color:color-mix(in oklab,var(--color-amber-400) 35%,transparent)}}.border-amber-400\/60{border-color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/60{border-color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-400\/35{border-color:#00d29459}@supports (color:color-mix(in lab,red,red)){.border-emerald-400\/35{border-color:color-mix(in oklab,var(--color-emerald-400) 35%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accent\/15{background-color:#ffa02226}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-950\/95{background-color:#461901f2}@supports (color:color-mix(in lab,red,red)){.bg-amber-950\/95{background-color:color-mix(in oklab,var(--color-amber-950) 95%,transparent)}}.bg-background{background-color:#272822}.bg-background\/60{background-color:#27282299}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-e)DELIM" -R"DELIM(merald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-950\/95{background-color:#002c22f2}@supports (color:color-mix(in lab,red,red)){.bg-emerald-950\/95{background-color:color-mix(in oklab,var(--color-emerald-950) 95%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/15{background-color:color-mix(in oklab,var(--color-sky-500) 15%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface{background-color:#1f211c}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-zinc-500\/20{background-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/20{background-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-200{color:var(--color-emerald-200)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-violet-300{color:var(--color-violet-300)}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab,red,red)){.text-white\/75{color:color-mix(in oklab,var(--color-white) 75%,transparent)}}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/60{--tw-shadow-color:#0009}@supports (color:color-mix(in lab,red,red)){.shadow-black\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdro)DELIM" -R"DELIM(p-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-700{--tw-duration:.7s;transition-duration:.7s}.placeholder\:text-textMuted\/50::placeholder{color:#cfcfcf80}.placeholder\:text-textMuted\/60::placeholder{color:#cfcfcf99}.backdrop\:bg-black\/60::backdrop{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/60::backdrop{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}@media(hover:hover){.hover\:border-accent:hover{border-color:#ffa022}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus-visible\:bg-accentSecondary\/20:focus-visible{background-color:#c8563733}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-textMuted:disabled{color:#cfcfcf}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:left-auto{left:auto}.sm\:w-96{width:calc(var(--spacing) * 96)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[7\.5rem_7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:w-auto{width:auto}.md\:grid-cols-\[minmax\(0\,1fr\)_11rem_11rem\]{grid-template-columns:minmax(0,1fr) 11rem 11rem}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(12rem\,1\.2fr\)_minmax\(11rem\,1fr\)_minmax\(9rem\,0\.8fr\)_3\.5rem_auto\]{grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr) minmax(9rem,.8fr) 3.5rem auto}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark}body{color:#ededed;background-color:#272822;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}::selection{color:#272822;background-color:#ffa022}.uplot{color:var(--color-textMuted);font-family:var(--font-sans)}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:#ffa0221f;border:1px solid #ffa02259}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false} +R"DELIM(/*! + * Third-party software contained in this file, with its published notices. + * + * ---- @tailwindcss/forms 0.5.11, tailwindcss 4.3.5 ---- + * + * MIT License + * + * Copyright (c) Tailwind Labs, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- uplot 1.6.32 ---- + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Leon Sorokin + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +.uplot,.uplot *,.uplot *:before,.uplot *:after{box-sizing:border-box}.uplot{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5;width:min-content}.u-title{text-align:center;font-size:18px;font-weight:700}.u-wrap{position:relative;-webkit-user-select:none;user-select:none}.u-over,.u-under{position:absolute}.u-under{overflow:hidden}.uplot canvas{display:block;position:relative;width:100%;height:100%}.u-axis{position:absolute}.u-legend{font-size:14px;margin:auto;text-align:center}.u-inline{display:block}.u-inline *{display:inline-block}.u-inline tr{margin-right:16px}.u-legend th{font-weight:600}.u-legend th>*{vertical-align:middle;display:inline-block}.u-legend .u-marker{width:1em;height:1em;margin-right:4px;background-clip:padding-box!important}.u-inline.u-live th:after{content:":";vertical-align:middle}.u-inline:not(.u-live) .u-value{display:none}.u-series>*{padding:4px}.u-series th{cursor:pointer}.u-legend .u-off>*{opacity:.3}.u-select{background:#00000012;position:absolute;pointer-events:none}.u-cursor-x,.u-cursor-y{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}.u-hz .u-cursor-x,.u-vt .u-cursor-y{height:100%;border-right:1px dashed #607D8B}.u-hz .u-cursor-y,.u-vt .u-cursor-x{width:100%;border-bottom:1px dashed #607D8B}.u-cursor-pt{position:absolute;top:0;left:0;border-radius:50%;border:0 solid;pointer-events:none;will-change:transform;background-clip:padding-box!important}.u-axis.u-off,.u-select.u-off,.u-cursor-x.u-off,.u-cursor-y.u-off,.u-cursor-pt.u-off{display:none}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-300:oklch(80.8% .114 19.571);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-950:oklch(27.9% .077 45.635);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-emerald-950:oklch(26.2% .051 172.552);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-500:oklch(60.6% .25 292.717);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-500:oklch(55.2% .016 285.938);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xl:36rem;--container-4xl:56rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-md:.375rem;--radius-xl:.75rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-)DELIM" +R"DELIM(webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type)DELIM" +R"DELIM(=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:0}.inset-x-0{inset-inline:0}.top-0{top:0}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.order-1{order:1}.order-2{order:2}.order-3{order:3}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-10{height:calc(var(--spacing) * 10)}.h-\[min\(60vh\,32rem\)\]{height:min(60vh,32rem)}.h-full{height:100%}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[92vh\]{max-height:92vh}.max-h-\[calc\(100vh-2rem\)\]{max-height:calc(100vh - 2rem)}.min-h-32{min-height:calc(var(--spacing) * 32)}.min-h-72{min-height:calc(var(--spacing) * 72)}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-24{width:calc(var(--spacing) * 24)}.w-\[min\(60rem\,90vw\)\]{width:min(60rem,90vw)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-4xl{max-width:var(--container-4xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-56{min-width:calc(var(--spacing) * 56)}.min-w-\[32rem\]{min-width:32rem}.flex-1{flex:1}.shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[5\.5rem_4\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:5.5rem 4.5rem minmax(0,1fr)}.grid-cols-\[8\.5rem_10rem_minmax\(0\,1fr\)\]{grid-template-columns:8.5rem 10rem minmax(0,1fr)}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-px{gap:1px}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-5{column-gap:calc(var(--spacing) * 5)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.gap-y-4{row-gap:calc(var(--spacing) * 4)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/20>:not(:last-child)){border-color:#c8563733}.self-center{align-self:center}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-md{border-radius:var(--radius-md)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent\/10{border-color:#ffa0221a}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/35{border-color:#ffa02259}.border-accent\/40{border-color:#ffa02266}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-amber-400\/35{border-color:#fcbb0059}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/35{border-color:color-mix(in oklab,var(--color-amber-400) 35%,transparent)}}.border-amber-400\/60{border-color:#fcbb0099}@supports (color:color-mix(in lab,red,red)){.border-amber-400\/60{border-color:color-mix(in oklab,var(--color-amber-400) 60%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-400\/35{border-color:#00d29459}@suppo)DELIM" +R"DELIM(rts (color:color-mix(in lab,red,red)){.border-emerald-400\/35{border-color:color-mix(in oklab,var(--color-emerald-400) 35%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accent\/15{background-color:#ffa02226}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-950\/95{background-color:#461901f2}@supports (color:color-mix(in lab,red,red)){.bg-amber-950\/95{background-color:color-mix(in oklab,var(--color-amber-950) 95%,transparent)}}.bg-background{background-color:#272822}.bg-background\/60{background-color:#27282299}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-blue-500\/15{background-color:#3080ff26}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/15{background-color:color-mix(in oklab,var(--color-blue-500) 15%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-950\/95{background-color:#002c22f2}@supports (color:color-mix(in lab,red,red)){.bg-emerald-950\/95{background-color:color-mix(in oklab,var(--color-emerald-950) 95%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-sky-500\/15{background-color:#00a5ef26}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/15{background-color:color-mix(in oklab,var(--color-sky-500) 15%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface{background-color:#1f211c}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-zinc-500\/20{background-color:#71717b33}@supports (color:color-mix(in lab,red,red)){.bg-zinc-500\/20{background-color:color-mix(in oklab,var(--color-zinc-500) 20%,transparent)}}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.leading-none{--tw-leading:1;line-height:1}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-200{color:var(--color-amber-200)}.text-amber-300{color:var(--color-amber-300)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-300{color:var(--color-cyan-300)}.text-emerald-200{color:var(--color-emerald-200)}.text-emerald-300{color:var(--color-emerald-300)}.text-indigo-300{color:var(--color-indigo-300)}.text-orange-300{color:var(--color-orange-300)}.text-red-300{color:var(--color-red-300)}.text-sky-300{color:var(--color-sky-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-violet-300{color:var(--color-violet-300)}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab,red,red)){.text-white\/60{color:color-mix(in oklab,var(--color-white) 60%,transparent)}}.text-white\/75{color:#ffffffbf}@supports (color:color-mix(in lab,red,re)DELIM" +R"DELIM(d)){.text-white\/75{color:color-mix(in oklab,var(--color-white) 75%,transparent)}}.text-zinc-300{color:var(--color-zinc-300)}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black\/50{--tw-shadow-color:#00000080}@supports (color:color-mix(in lab,red,red)){.shadow-black\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/60{--tw-shadow-color:#0009}@supports (color:color-mix(in lab,red,red)){.shadow-black\/60{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 60%, transparent) var(--tw-shadow-alpha), transparent)}}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-700{--tw-duration:.7s;transition-duration:.7s}.placeholder\:text-textMuted\/50::placeholder{color:#cfcfcf80}.placeholder\:text-textMuted\/60::placeholder{color:#cfcfcf99}.backdrop\:bg-black\/60::backdrop{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/60::backdrop{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}@media(hover:hover){.hover\:border-accent:hover{border-color:#ffa022}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-white:hover{color:var(--color-white)}.hover\:underline:hover{text-decoration-line:underline}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-0:focus{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus-visible\:bg-accentSecondary\/20:focus-visible{background-color:#c8563733}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-textMuted:disabled{color:#cfcfcf}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(min-width:40rem){.sm\:left-auto{left:auto}.sm\:w-96{width:calc(var(--spacing) * 96)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-\[7\.5rem_7\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:7.5rem 7.5rem minmax(0,1fr)}.sm\:p-5{padding:calc(var(--spacing) * 5)}.sm\:px-5{padding-inline:calc(var(--spacing) * 5)}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:w-auto{width:auto}.md\:grid-cols-\[minmax\(0\,1fr\)_11rem_11rem\]{grid-template-columns:minmax(0,1fr) 11rem 11rem}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:grid-cols-\[minmax\(12rem\,1\.2fr\)_minmax\(11rem\,1fr\)_minmax\(9rem\,0\.8fr\)_3\.5rem_auto\]{grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr) minmax(9rem,.8fr) 3.5rem auto}}@media(min-width:80rem){.xl\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-\[1\.1fr_0\.9fr\]{grid-template-columns:1.1fr .9fr}}}:root{color-scheme:dark}body{color:#ededed;background-color:#272822;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}::selection{color:#272822;background-color:#ffa022}.uplot{color:var(--color-textMuted);font-family:var(--font-sans)}.uplot .u-legend{margin-bottom:.75rem;font-size:.75rem}.uplot .u-legend .u-series{padding:.2rem .45rem}.uplot .u-select{background:#ffa0221f;border:1px solid #ffa02259}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #000)DELIM" +R"DELIM(0}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false} )DELIM" ) diff --git a/console/embedded/admin_ecma.cpp b/console/embedded/admin_ecma.cpp index 4cea20165..56bd66446 100644 --- a/console/embedded/admin_ecma.cpp +++ b/console/embedded/admin_ecma.cpp @@ -23,148 +23,301 @@ namespace server { // Simple test ecma script for embedded page. DEFINE_EMBEDDED_PAGE(admin_pages, char, ecma, -R"DELIM((function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function s(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function r(o){if(o.ep)return;o.ep=!0;const f=s(o);fetch(o.href,f)}})();function N0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var eh={exports:{}},Eo={};var jv;function nS(){if(jv)return Eo;jv=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(r,o,f){var d=null;if(f!==void 0&&(d=""+f),o.key!==void 0&&(d=""+o.key),"key"in o){f={};for(var p in o)p!=="key"&&(f[p]=o[p])}else f=o;return o=f.ref,{$$typeof:n,type:r,key:d,ref:o!==void 0?o:null,props:f}}return Eo.Fragment=i,Eo.jsx=s,Eo.jsxs=s,Eo}var kv;function iS(){return kv||(kv=1,eh.exports=nS()),eh.exports}var b=iS(),th={exports:{}},Ce={};var Rv;function aS(){if(Rv)return Ce;Rv=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),S=Symbol.for("react.activity"),w=Symbol.iterator;function M(A){return A===null||typeof A!="object"?null:(A=w&&A[w]||A["@@iterator"],typeof A=="function"?A:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,B={};function V(A,H,Y){this.props=A,this.context=H,this.refs=B,this.updater=Y||T}V.prototype.isReactComponent={},V.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,H,"setState")},V.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function D(){}D.prototype=V.prototype;function ee(A,H,Y){this.props=A,this.context=H,this.refs=B,this.updater=Y||T}var G=ee.prototype=new D;G.constructor=ee,k(G,V.prototype),G.isPureReactComponent=!0;var W=Array.isArray;function ie(){}var ae={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function de(A,H,Y){var re=Y.ref;return{$$typeof:n,type:A,key:H,ref:re!==void 0?re:null,props:Y}}function me(A,H){return de(A.type,H,A.props)}function ne(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function pe(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(Y){return H[Y]})}var ce=/\/+/g;function Te(A,H){return typeof A=="object"&&A!==null&&A.key!=null?pe(""+A.key):H.toString(36)}function ge(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ie,ie):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function U(A,H,Y,re,we){var be=typeof A;(be==="undefined"||be==="boolean")&&(A=null);var _e=!1;if(A===null)_e=!0;else switch(be){case"bigint":case"string":case"number":_e=!0;break;case"object":switch(A.$$typeof){case n:case i:_e=!0;break;case x:return _e=A._init,U(_e(A._payload),H,Y,re,we)}}if(_e)return we=we(A),_e=re===""?"."+Te(A,0):re,W(we)?(Y="",_e!=null&&(Y=_e.replace(ce,"$&/")+"/"),U(we,H,Y,"",function(nt){return nt})):we!=null&&(ne(we)&&(we=me(we,Y+(we.key==null||A&&A.key===we.key?"":(""+we.key).replace(ce,"$&/")+"/")+_e)),H.push(we)),1;_e=0;var mt=re===""?".":re+":";if(W(A))for(var Ve=0;Ve>>1,xe=U[Me];if(0>>1;Meo(Y,ye))reo(we,Y)?(U[Me]=we,U[re]=ye,Me=re):(U[Me]=Y,U[H]=ye,Me=H);else if(reo(we,ye))U[Me]=we,U[re]=ye,Me=re;else break e}}return Q}function o(U,Q){var ye=U.sortIndex-Q.sortIndex;return ye!==0?ye:U.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,p=d.now();n.unstable_now=function(){return d.now()-p}}var m=[],v=[],x=1,S=null,w=3,M=!1,T=!1,k=!1,B=!1,V=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,ee=typeof setImmediate<"u"?setImmediate:null;function G(U){for(var Q=s(v);Q!==null;){if(Q.callback===null)r(v);else if(Q.startTime<=U)r(v),Q.sortIndex=Q.expirationTime,i(m,Q);else break;Q=s(v)}}function W(U){if(k=!1,G(U),!T)if(s(m)!==null)T=!0,ie||(ie=!0,pe());else{var Q=s(v);Q!==null&&ge(W,Q.startTime-U)}}var ie=!1,ae=-1,X=5,de=-1;function me(){return B?!0:!(n.unstable_now()-deU&&me());){var Me=S.callback;if(typeof Me=="function"){S.callback=null,w=S.priorityLevel;var xe=Me(S.expirationTime<=U);if(U=n.unstable_now(),typeof xe=="function"){S.callback=xe,G(U),Q=!0;break t}S===s(m)&&r(m),G(U)}else r(m);S=s(m)}if(S!==null)Q=!0;else{var A=s(v);A!==null&&ge(W,A.startTime-U),Q=!1}}break e}finally{S=null,w=ye,M=!1}Q=void 0}}finally{Q?pe():ie=!1}}}var pe;if(typeof ee=="function")pe=function(){ee(ne)};else if(typeof MessageChannel<"u"){var ce=new MessageChannel,Te=ce.port2;ce.port1.onmessage=ne,pe=function(){Te.postMessage(null)}}else pe=function(){V(ne,0)};function ge(U,Q){ae=V(function(){U(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(U){U.callback=null},n.unstable_forceFrameRate=function(U){0>U||125Me?(U.sortIndex=ye,i(v,U),s(m)===null&&U===s(v)&&(k?(D(ae),ae=-1):k=!0,ge(W,ye-Me))):(U.sortIndex=xe,i(m,U),T||M||(T=!0,ie||(ie=!0,pe()))),U},n.unstable_shouldYield=me,n.unstable_wrapCallback=function(U){var Q=w;return function(){var ye=w;w=Q;try{return U.apply(this,arguments)}finally{w=ye}}}})(ah)),ah}var Zv;function rS(){return Zv||(Zv=1,ih.exports=lS()),ih.exports}var sh={exports:{}},kn={};var Uv;function oS(){if(Uv)return kn;Uv=1;var n=Gh();function i(m){var v="https://react.dev/errors/"+m;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),sh.exports=oS(),sh.exports}var Lv;function cS(){if(Lv)return To;Lv=1;var n=rS(),i=Gh(),s=uS();function r(e){var t="https://react.dev/errors/"+e;if(1xe||(e.current=Me[xe],Me[xe]=null,xe--)}function Y(e,t){xe++,Me[xe]=e.current,e.current=t}var re=A(null),we=A(null),be=A(null),_e=A(null);function mt(e,t){switch(Y(be,t),Y(we,e),Y(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ev(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ev(t),e=tv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(re),Y(re,e)}function Ve(){H(re),H(we),H(be)}function nt(e){e.memoizedState!==null&&Y(_e,e);var t=re.current,a=tv(t,e.type);t!==a&&(Y(we,e),Y(re,a))}function Rn(e){we.current===e&&(H(re),H(we)),_e.current===e&&(H(_e),So._currentValue=ye)}var ii,Cn;function En(e){if(ii===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ii=t&&t[1]||"",Cn=-1)":-1u||N[l]!==$[u]){var K=` -`+N[l].replace(" at new "," at ");return e.displayName&&K.includes("")&&(K=K.replace("",e.displayName)),K}while(1<=l&&0<=u);break}}}finally{Ki=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?En(a):""}function Rs(e,t){switch(e.tag){case 26:case 27:case 5:return En(e.type);case 16:return En("Lazy");case 13:return e.child!==t&&t!==null?En("Suspense Fallback"):En("Suspense");case 19:return En("SuspenseList");case 0:case 15:return Fi(e.type,!1);case 11:return Fi(e.type.render,!1);case 1:return Fi(e.type,!0);case 31:return En("Activity");default:return""}}function Cs(e){try{var t="",a=null;do t+=Rs(e,a),a=e,e=e.return;while(e);return t}catch(l){return` -Error generating stack: `+l.message+` -`+l.stack}}var ki=Object.prototype.hasOwnProperty,Wt=n.unstable_scheduleCallback,Ji=n.unstable_cancelCallback,Ri=n.unstable_shouldYield,da=n.unstable_requestPaint,Ne=n.unstable_now,fe=n.unstable_getCurrentPriorityLevel,it=n.unstable_ImmediatePriority,Rt=n.unstable_UserBlockingPriority,Ci=n.unstable_NormalPriority,ha=n.unstable_LowPriority,ai=n.unstable_IdlePriority,ma=n.log,Dn=n.unstable_setDisableYieldValue,on=null,ot=null;function Gt(e){if(typeof ma=="function"&&Dn(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(on,e)}catch{}}var pn=Math.clz32?Math.clz32:pa,bl=Math.log,Ga=Math.LN2;function pa(e){return e>>>=0,e===0?32:31-(bl(e)/Ga|0)|0}var ga=256,gn=262144,Ya=4194304;function Ii(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case)DELIM" -R"DELIM( 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function _l(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var u=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var _=l&134217727;return _!==0?(l=_&~c,l!==0?u=Ii(l):(h&=_,h!==0?u=Ii(h):a||(a=_&~e,a!==0&&(u=Ii(a))))):(_=l&~c,_!==0?u=Ii(_):h!==0?u=Ii(h):a||(a=l&~e,a!==0&&(u=Ii(a)))),u===0?0:t!==0&&t!==u&&(t&c)===0&&(c=u&-u,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:u}function Ds(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function sf(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fo(){var e=Ya;return Ya<<=1,(Ya&62914560)===0&&(Ya=4194304),e}function Tr(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function si(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function un(e,t,a,l,u,c){var h=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var _=e.entanglements,N=e.expirationTimes,$=e.hiddenUpdates;for(a=h&~a;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var lf=/[\n"\\]/g;function Un(e){return e.replace(lf,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Tl(e,t,a,l,u,c,h,_){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Zn(t)):e.value!==""+Zn(t)&&(e.value=""+Zn(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?Nl(e,h,Zn(t)):a!=null?Nl(e,h,Zn(a)):l!=null&&e.removeAttribute("value"),u==null&&c!=null&&(e.defaultChecked=!!c),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+Zn(_):e.removeAttribute("name")}function Xo(e,t,a,l,u,c,h,_){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){wl(e);return}a=a!=null?""+Zn(a):"",t=t!=null?""+Zn(t):a,_||t===e.value||(e.value=t),e.defaultValue=t}l=l??u,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=_?e.checked:!!l,e.defaultChecked=!!l,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),wl(e)}function Nl(e,t,a){t==="number"&&El(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Wi(e,t,a,l){if(e=e.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jl=!1;if(An)try{var Pa={};Object.defineProperty(Pa,"passive",{get:function(){jl=!0}}),window.addEventListener("test",Pa,Pa),window.removeEventListener("test",Pa,Pa)}catch{jl=!1}var Ln=null,ta=null,Bs=null;function Zr(){if(Bs)return Bs;var e,t=ta,a=t.length,l,u="value"in Ln?Ln.value:Ln.textContent,c=u.length;for(e=0;e=ns),Gr=" ",za=!1;function Ys(e,t){switch(e){case"keyup":return ou.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ht(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wa=!1;function Dt(e,t){switch(e){case"compositionend":return Ht(t);case"keypress":return t.which!==32?null:(za=!0,Gr);case"textInput":return e=t.data,e===Gr&&za?null:e;default:return null}}function uu(e,t){if(wa)return e==="compositionend"||!kl&&Ys(e,t)?(e=Zr(),Bs=ta=Ln=null,wa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Oe(a)}}function ut(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ut(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function _t(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=El(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=El(e.document)}return t}function Zt(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var et=An&&"documentMode"in document&&11>=document.documentMode,st=null,yn=null,Bt=null,Mn=!1;function Kn(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Mn||st==null||st!==El(l)||(l=st,"selectionStart"in l&&Zt(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Bt&&De(Bt,l)||(Bt=l,l=Wu(yn,"onSelect"),0>=h,u-=h,aa=1<<32-pn(t)+u|a<Ue?(Be=Se,Se=null):Be=Se.sibling;var Fe=L(R,Se,Z[Ue],J);if(Fe===null){Se===null&&(Se=Be);break}e&&Se&&Fe.alternate===null&&t(R,Se),j=c(Fe,j,Ue),Ke===null?Ae=Fe:Ke.sibling=Fe,Ke=Fe,Se=Be}if(Ue===Z.length)retu)DELIM" -R"DELIM(rn a(R,Se),Ge&&Na(R,Ue),Ae;if(Se===null){for(;UeUe?(Be=Se,Se=null):Be=Se.sibling;var Es=L(R,Se,Fe.value,J);if(Es===null){Se===null&&(Se=Be);break}e&&Se&&Es.alternate===null&&t(R,Se),j=c(Es,j,Ue),Ke===null?Ae=Es:Ke.sibling=Es,Ke=Es,Se=Be}if(Fe.done)return a(R,Se),Ge&&Na(R,Ue),Ae;if(Se===null){for(;!Fe.done;Ue++,Fe=Z.next())Fe=P(R,Fe.value,J),Fe!==null&&(j=c(Fe,j,Ue),Ke===null?Ae=Fe:Ke.sibling=Fe,Ke=Fe);return Ge&&Na(R,Ue),Ae}for(Se=l(Se);!Fe.done;Ue++,Fe=Z.next())Fe=q(Se,R,Ue,Fe.value,J),Fe!==null&&(e&&Fe.alternate!==null&&Se.delete(Fe.key===null?Ue:Fe.key),j=c(Fe,j,Ue),Ke===null?Ae=Fe:Ke.sibling=Fe,Ke=Fe);return e&&Se.forEach(function(tS){return t(R,tS)}),Ge&&Na(R,Ue),Ae}function dt(R,j,Z,J){if(typeof Z=="object"&&Z!==null&&Z.type===k&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case M:e:{for(var Ae=Z.key;j!==null;){if(j.key===Ae){if(Ae=Z.type,Ae===k){if(j.tag===7){a(R,j.sibling),J=u(j,Z.props.children),J.return=R,R=J;break e}}else if(j.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===X&&Ws(Ae)===j.type){a(R,j.sibling),J=u(j,Z.props),Xr(J,Z),J.return=R,R=J;break e}a(R,j);break}else t(R,j);j=j.sibling}Z.type===k?(J=Fs(Z.props.children,R.mode,J,Z.key),J.return=R,R=J):(J=gu(Z.type,Z.key,Z.props,null,R.mode,J),Xr(J,Z),J.return=R,R=J)}return h(R);case T:e:{for(Ae=Z.key;j!==null;){if(j.key===Ae)if(j.tag===4&&j.stateNode.containerInfo===Z.containerInfo&&j.stateNode.implementation===Z.implementation){a(R,j.sibling),J=u(j,Z.children||[]),J.return=R,R=J;break e}else{a(R,j);break}else t(R,j);j=j.sibling}J=yf(Z,R.mode,J),J.return=R,R=J}return h(R);case X:return Z=Ws(Z),dt(R,j,Z,J)}if(ge(Z))return ve(R,j,Z,J);if(pe(Z)){if(Ae=pe(Z),typeof Ae!="function")throw Error(r(150));return Z=Ae.call(Z),je(R,j,Z,J)}if(typeof Z.then=="function")return dt(R,j,zu(Z),J);if(Z.$$typeof===ee)return dt(R,j,bu(R,Z),J);wu(R,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,j!==null&&j.tag===6?(a(R,j.sibling),J=u(j,Z),J.return=R,R=J):(a(R,j),J=vf(Z,R.mode,J),J.return=R,R=J),h(R)):a(R,j)}return function(R,j,Z,J){try{Ir=0;var Ae=dt(R,j,Z,J);return ql=null,Ae}catch(Se){if(Se===Bl||Se===Su)throw Se;var Ke=oi(29,Se,null,R.mode);return Ke.lanes=J,Ke.return=R,Ke}}}var tl=Ym(!0),Qm=Ym(!1),os=!1;function Of(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function jf(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function us(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function cs(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Xe&2)!==0){var u=l.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),l.pending=t,t=pu(e),Mm(e,null,a),t}return mu(e,l,t,a),pu(e)}function Pr(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,va(e,a)}}function kf(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var u=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var h={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?u=c=h:c=c.next=h,a=a.next}while(a!==null);c===null?u=c=t:c=c.next=t}else u=c=t;a={baseState:l.baseState,firstBaseUpdate:u,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Rf=!1;function Wr(){if(Rf){var e=Hl;if(e!==null)throw e}}function eo(e,t,a,l){Rf=!1;var u=e.updateQueue;os=!1;var c=u.firstBaseUpdate,h=u.lastBaseUpdate,_=u.shared.pending;if(_!==null){u.shared.pending=null;var N=_,$=N.next;N.next=null,h===null?c=$:h.next=$,h=N;var K=e.alternate;K!==null&&(K=K.updateQueue,_=K.lastBaseUpdate,_!==h&&(_===null?K.firstBaseUpdate=$:_.next=$,K.lastBaseUpdate=N))}if(c!==null){var P=u.baseState;h=0,K=$=N=null,_=c;do{var L=_.lane&-536870913,q=L!==_.lane;if(q?(He&L)===L:(l&L)===L){L!==0&&L===Ll&&(Rf=!0),K!==null&&(K=K.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=e,je=_;L=t;var dt=a;switch(je.tag){case 1:if(ve=je.payload,typeof ve=="function"){P=ve.call(dt,P,L);break e}P=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=je.payload,L=typeof ve=="function"?ve.call(dt,P,L):ve,L==null)break e;P=S({},P,L);break e;case 2:os=!0}}L=_.callback,L!==null&&(e.flags|=64,q&&(e.flags|=8192),q=u.callbacks,q===null?u.callbacks=[L]:q.push(L))}else q={lane:L,tag:_.tag,payload:_.payload,callback:_.callback,next:null},K===null?($=K=q,N=P):K=K.next=q,h|=L;if(_=_.next,_===null){if(_=u.shared.pending,_===null)break;q=_,_=q.next,q.next=null,u.lastBaseUpdate=q,u.shared.pending=null}}while(!0);K===null&&(N=P),u.baseState=N,u.firstBaseUpdate=$,u.lastBaseUpdate=K,c===null&&(u.shared.lanes=0),ps|=h,e.lanes=h,e.memoizedState=P}}function Km(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Fm(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;ec?c:8;var h=U.T,_={};U.T=_,Pf(e,!1,t,a);try{var N=u(),$=U.S;if($!==null&&$(_,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var K=G1(N,l);io(e,t,K,hi(e))}else io(e,t,l,hi(e))}catch(P){io(e,t,{then:function(){},status:"rejected",reason:P},hi())}finally{Q.p=c,h!==null&&_.types!==null&&(h.types=_.types),U.T=h}}function I1(){}function If(e,t,a,l){if(e.tag!==5)throw Error(r(476));var u=Tp(e).queue;Ep(e,u,t,ye,a===null?I1:function(){return Np(e),a(l)})}function Tp(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:ye},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ja,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Np(e){var t=Tp(e);t.next===null&&(t=e.alternate.memoizedState),io(e,t.next.queue,{},hi())}function Xf(){return Sn(So)}function Ap(){return Vt().memoizedState}function Mp(){return Vt().memoizedState}function X1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=hi();e=us(a);var l=cs(t,e,a);l!==null&&(Wn(l,t,a),Pr(l,t,a)),t={cache:Tf()},e.payload=t;return}t=t.return}}function P1(e,t,a){var l=hi();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Cu(e)?jp(t,a):(a=pf(e,t,a,l),a!==null&&(Wn(a,e,l),kp(a,t,l)))}function Op(e,t,a){var l=hi();io(e,t,a,l)}function io(e,t,a,l){var u={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Cu(e))jp(t,u);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,_=c(h,a);if(u.hasEagerState=!0,u.eagerState=_,Re(_,h))return mu(e,t,u,0),pt===null&&hu(),!1}catch{}if(a=pf(e,t,u,l),a!==null)return Wn(a,e,l),kp(a,t,l),!0}return!1}function Pf(e,t,a,l){if(l={lane:2,revertLane:Od(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Cu(e)){if(t)throw Error(r(479))}else t=pf(e,a,l,2),t!==null&&Wn(t,e,2)}function Cu(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function jp(e,t){Gl=Nu=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function kp(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,va(e,a)}}var ao={readContext:Sn,use:Ou,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};ao.useEffectEvent=Ut;var Rp={readContext:Sn,use:Ou,useCallback:function(e,t){return Bn().memoizedState=[e,t===void 0?null:t],e},useContext:Sn,useEffect:gp,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ku(4194308,4,_p.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ku(4194308,4,e,t)},useInsertionEffect:function(e,t){ku(4,2,e,t)},useMemo:function(e,t){var a=Bn();t=t===void 0?null:t;var l=e();if(nl){Gt(!0);try{e()}finally{Gt(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Bn();if(a!==void 0){var u=a(t);if(nl){Gt(!0);try{a(t)}finally{Gt(!1)}}}else u=t;return l.memoizedState=l.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},l.queue=e,e=e.dispatch=P1.bind(null,Ze,e),[l.memoizedState,e]},useRef:function(e){var t=Bn();return e={current:e},t.memoizedState=e},useState:function(e){e=Yf(e);var t=e.queue,a=Op.bind(null,Ze,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Ff,useDeferredValue:function(e,t){var a=Bn();return Jf(a,e,t)},useTransition:function(){var e=Yf(!1);return e=Ep.bind(null,Ze,e.queue,!0,!1),Bn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=Ze,u=Bn();if(Ge){if(a===void 0)throw Error(r(407));a=a()}else{if(a=t(),pt===null)throw Error(r(349));(He&127)!==0||ep(l,t,a)}u.memoizedState=a;var c={value:a,getSnapshot:t};return u.queue=c,gp(np.bind(null,l,c,e),[e]),l.flags|=2048,Ql(9,{destroy:void 0},tp.bind(null,l,c,a,t),null),a},useId:function(){var e=Bn(),t=pt.identifierPrefix;if(Ge){var a=sa,l=aa;a=(l&~(1<<32-pn(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=Au++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?h.createElement("select",{is:l.is}):h.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?h.createElement(u,{is:l.is}):h.createElement(u)}}c[en]=t,c[Nn]=l;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(zn(c,u,l),u){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ra(t)}}return xt(t),dd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&Ra(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=be.current,Ul(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,u=_n,u!==null)switch(u.tag){case 27:case 5:l=u.memoizedProps}e[en]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Pg(e.nodeValue,a)),e||ls(t,!0)}else e=ec(e).createTextNode(l),e[en]=t,t.stateNode=e}return xt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=Ul(t),a!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[en]=t}else Js(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),e=!1}else a=xf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ci(t),t):(ci(t),null);if((t.flags&128)!==0)throw Error(r(558))}return xt(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Ul(t),l!==null&&l.dehydrated!==null){if(e===null){if(!u)throw Error(r(31)DELIM" -R"DELIM(8));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));u[en]=t}else Js(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;xt(t),u=!1}else u=xf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(ci(t),t):(ci(t),null)}return ci(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,u=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(u=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==u&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Lu(t,t.updateQueue),xt(t),null);case 4:return Ve(),e===null&&Cd(t.stateNode.containerInfo),xt(t),null;case 10:return Ma(t.type),xt(t),null;case 19:if(H(qt),l=t.memoizedState,l===null)return xt(t),null;if(u=(t.flags&128)!==0,c=l.rendering,c===null)if(u)lo(l,!1);else{if($t!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Tu(e),c!==null){for(t.flags|=128,lo(l,!1),e=c.updateQueue,t.updateQueue=e,Lu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Om(a,e),a=a.sibling;return Y(qt,qt.current&1|2),Ge&&Na(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&Ne()>Gu&&(t.flags|=128,u=!0,lo(l,!1),t.lanes=4194304)}else{if(!u)if(e=Tu(c),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Lu(t,e),lo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ge)return xt(t),null}else 2*Ne()-l.renderingStartTime>Gu&&a!==536870912&&(t.flags|=128,u=!0,lo(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=Ne(),e.sibling=null,a=qt.current,Y(qt,u?a&1|2:a&1),Ge&&Na(t,l.treeForkCount),e):(xt(t),null);case 22:case 23:return ci(t),Df(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(xt(t),t.subtreeFlags&6&&(t.flags|=8192)):xt(t),a=t.updateQueue,a!==null&&Lu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&H(Ps),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ma(Qt),xt(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function i_(e,t){switch(_f(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ma(Qt),Ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Rn(t),null;case 31:if(t.memoizedState!==null){if(ci(t),t.alternate===null)throw Error(r(340));Js()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ci(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Js()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(qt),null;case 4:return Ve(),null;case 10:return Ma(t.type),null;case 22:case 23:return ci(t),Df(),e!==null&&H(Ps),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ma(Qt),null;case 25:return null;default:return null}}function ig(e,t){switch(_f(t),t.tag){case 3:Ma(Qt),Ve();break;case 26:case 27:case 5:Rn(t);break;case 4:Ve();break;case 31:t.memoizedState!==null&&ci(t);break;case 13:ci(t);break;case 19:H(qt);break;case 10:Ma(t.type);break;case 22:case 23:ci(t),Df(),e!==null&&H(Ps);break;case 24:Ma(Qt)}}function ro(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var u=l.next;a=u;do{if((a.tag&e)===e){l=void 0;var c=a.create,h=a.inst;l=c(),h.destroy=l}a=a.next}while(a!==u)}}catch(_){rt(t,t.return,_)}}function hs(e,t,a){try{var l=t.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var c=u.next;l=c;do{if((l.tag&e)===e){var h=l.inst,_=h.destroy;if(_!==void 0){h.destroy=void 0,u=t;var N=a,$=_;try{$()}catch(K){rt(u,N,K)}}}l=l.next}while(l!==c)}}catch(K){rt(t,t.return,K)}}function ag(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Fm(t,a)}catch(l){rt(e,e.return,l)}}}function sg(e,t,a){a.props=il(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){rt(e,t,l)}}function oo(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(u){rt(e,t,u)}}function la(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(u){rt(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){rt(e,t,u)}else a.current=null}function lg(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(u){rt(e,e.return,u)}}function hd(e,t,a){try{var l=e.stateNode;E_(l,e.type,a,t),l[Nn]=t}catch(u){rt(e,e.return,u)}}function rg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&_s(e.type)||e.tag===4}function md(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||rg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&_s(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pd(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=$n));else if(l!==4&&(l===27&&_s(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(pd(e,t,a),e=e.sibling;e!==null;)pd(e,t,a),e=e.sibling}function Hu(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&(l===27&&_s(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(Hu(e,t,a),e=e.sibling;e!==null;)Hu(e,t,a),e=e.sibling}function og(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);zn(t,l,a),t[en]=e,t[Nn]=a}catch(c){rt(e,e.return,c)}}var Ca=!1,Jt=!1,gd=!1,ug=typeof WeakSet=="function"?WeakSet:Set,hn=null;function a_(e,t){if(e=e.containerInfo,Ud=rc,e=_t(e),Zt(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var u=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var h=0,_=-1,N=-1,$=0,K=0,P=e,L=null;t:for(;;){for(var q;P!==a||u!==0&&P.nodeType!==3||(_=h+u),P!==c||l!==0&&P.nodeType!==3||(N=h+l),P.nodeType===3&&(h+=P.nodeValue.length),(q=P.firstChild)!==null;)L=P,P=q;for(;;){if(P===e)break t;if(L===a&&++$===u&&(_=h),L===c&&++K===l&&(N=h),(q=P.nextSibling)!==null)break;P=L,L=P.parentNode}P=q}a=_===-1||N===-1?null:{start:_,end:N}}else a=null}a=a||{start:0,end:0}}else a=null;for($d={focusedElem:e,selectionRange:a},rc=!1,hn=t;hn!==null;)if(t=hn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,hn=e;else for(;hn!==null;){switch(t=hn,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a title"))),zn(c,l,a),c[en]=e,Lt(c),l=c;break e;case"link":var h=pv("link","href",u).get(l+(a.href||""));if(h){for(var _=0;_dt&&(h=dt,dt=je,je=h);var R=ze(_,je),j=ze(_,dt);if(R&&j&&(q.rangeCount!==1||q.anchorNode!==R.node||q.anchorOffset!==R.offset||q.focusNode!==j.node||q.focusOffset!==j.offset)){var Z=P.createRange();Z.setStart(R.node,R.offset),q.removeAllRanges(),je>dt?(q.addRange(Z),q.extend(j.node,j.offset)):(Z.setEnd(j.node,j.offset),q.addRange(Z))}}}}for(P=[],q=_;q=q.parentNode;)q.nodeType===1&&P.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_a?32:a,U.T=null,a=zd,zd=null;var c=vs,h=La;if(tn=0,Xl=vs=null,La=0,(Xe&6)!==0)throw Error(r(331));var _=Xe;if(Xe|=4,_g(c.current),vg(c,c.current,h,a),Xe=_,po(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(on,c)}catch{}return!0}finally{Q.p=u,U.T=l,$g(e,t)}}function Hg(e,t,a){t=xi(a,t),t=nd(e.stateNode,t,2),e=cs(e,t,2),e!==null&&(si(e,2),ra(e))}function rt(e,t,a){if(e.tag===3)Hg(e,e,a);else for(;t!==null;){if(t.tag===3){Hg(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(gs===null||!gs.has(l))){e=xi(a,e),a=Bp(2),l=cs(t,a,2),l!==null&&(qp(a,l,t,e),si(l,2),ra(l));break}}t=t.return}}function Nd(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new r_;var u=new Set;l.set(t,u)}else u=l.get(t),u===void 0&&(u=new Set,l.set(t,u));u.has(a)||(bd=!0,u.add(a),e=d_.bind(null,e,t,a),t.then(e,e))}function d_(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,pt===e&&(He&a)===a&&($t===4||$t===3&&(He&62914560)===He&&300>Ne()-Vu?(Xe&2)===0&&Pl(e,0):_d|=a,Il===He&&(Il=0)),ra(e)}function Bg(e,t){t===0&&(t=Fo()),e=Ks(e,t),e!==null&&(si(e,t),ra(e))}function h_(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Bg(e,a)}function m_(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),Bg(e,a)}function p_(e,t){return Wt(e,t)}var Iu=null,er=null,Ad=!1,Xu=!1,Md=!1,bs=0;function ra(e){e!==er&&e.next===null&&(er===null?Iu=er=e:er=er.next=e),Xu=!0,Ad||(Ad=!0,v_())}function po(e,t){if(!Md&&Xu){Md=!0;do for(var a=!1,l=Iu;l!==null;){if(e!==0){var u=l.pendingLanes;if(u===0)var c=0;else{var h=l.suspendedLanes,_=l.pingedLanes;c=(1<<31-pn(42|e)+1)-1,c&=u&~(h&~_),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Yg(l,c))}else c=He,c=_l(l,l===pt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||Ds(l,c)||(a=!0,Yg(l,c));l=l.next}while(a);Md=!1}}function g_(){qg()}function qg(){Xu=Ad=!1;var e=0;bs!==0&&N_()&&(e=bs);for(var t=Ne(),a=null,l=Iu;l!==null;){var u=l.next,c=Vg(l,t);c===0?(l.next=null,a===null?Iu=u:a.next=u,u===null&&(er=a)):(a=l,(e!==0||(c&3)!==0)&&(Xu=!0)),l=u}tn!==0&&tn!==5||po(e),bs!==0&&(bs=0)}function Vg(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,u=e.expirationTimes,c=e.pendingLanes&-62914561;0_)break;var K=N.transferSize,P=N.initiatorType;K&&Wg(P)&&(N=N.responseEnd,h+=K*(N<_?1:(_-$)/(N-$)))}if(--l,t+=8*(c+h)/(u.duration/1e3),e++,10"u"?null:document;function fv(e,t,a){var l=tr;if(l&&typeof t=="string"&&t){var u=Un(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),cv.has(u)||(cv.add(u),e={rel:e,crossOrigin:a,href:t},l.querySelector(u)===null&&(t=l.createElement("link"),zn(t,"link",e),Lt(t),l.head.appendChild(t)))}}function Z_(e){Ha.D(e),fv("dns-prefetch",e,null)}function U_(e,t){Ha.C(e,t),fv("preconnect",e,t)}function $_(e,t,a){Ha.L(e,t,a);var l=tr;if(l&&e&&t){var u='link[rel="preload"][as="'+Un(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Un(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Un(a.imageSizes)+'"]')):u+='[href="'+Un(e)+'"]';var c=u;switch(t){case"style":c=nr(e);break;case"script":c=ir(e)}Ai.has(c)||(e=S({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ai.set(c,e),l.querySelector(u)!==null||t==="style"&&l.querySelector(bo(c))||t==="script"&&l.querySelector(_o(c))||(t=l.createElement("link"),zn(t,"link",e),Lt(t),l.head.appendChild(t)))}}function L_(e,t){Ha.m(e,t);var a=tr;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Un(l)+'"][href="'+Un(e)+'"]',c=u;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ir(e)}if(!Ai.has(c)&&(e=S({rel:"modulepreload",href:e},t),Ai.set(c,e),a.querySelector(u)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(_o(c)))return}l=a.createElement("link"),zn(l,"link",e),Lt(l),a.head.appendChild(l)}}}function H_(e,t,a){Ha.S(e,t,a);var l=tr;if(l&&e){var u=yi(l).hoistableStyles,c=nr(e);t=t||"default";var h=u.get(c);if(!h){var _={loading:0,preload:null};if(h=l.querySelector(bo(c)))_.loading=5;else{e=S({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ai.get(c))&&Yd(e,a);var N=h=l.createElement("link");Lt(N),zn(N,"link",e),N._p=new Promise(function($,K){N.onload=$,N.onerror=K}),N.addEventListener("load",function(){_.loading|=1}),N.addEventListener("error",function(){_.loading|=2}),_.loading|=4,nc(h,t,l)}h={type:"stylesheet",instance:h,count:1,state:_},u.set(c,h)}}}function B_(e,t){Ha.X(e,t);var a=tr;if(a&&e){var l=yi(a).hoistableScripts,u=ir(e),c=l.get(u);c||(c=a.querySelector(_o(u)),c||(e=S({src:e,async:!0},t),(t=Ai.get(u))&&Qd(e,t),c=a.createElement("script"),Lt(c),zn(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(u,c))}}function q_(e,t){Ha.M(e,t);var a=tr;if(a&&e){var l=yi(a).hoistableScripts,u=ir(e),c=l.get(u);c||(c=a.query)DELIM" -R"DELIM(Selector(_o(u)),c||(e=S({src:e,async:!0,type:"module"},t),(t=Ai.get(u))&&Qd(e,t),c=a.createElement("script"),Lt(c),zn(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(u,c))}}function dv(e,t,a,l){var u=(u=be.current)?tc(u):null;if(!u)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=nr(a.href),a=yi(u).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=nr(a.href);var c=yi(u).hoistableStyles,h=c.get(e);if(h||(u=u.ownerDocument||u,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=u.querySelector(bo(e)))&&!c._p&&(h.instance=c,h.state.loading=5),Ai.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ai.set(e,a),c||V_(u,e,a,h.state))),t&&l===null)throw Error(r(528,""));return h}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ir(a),a=yi(u).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function nr(e){return'href="'+Un(e)+'"'}function bo(e){return'link[rel="stylesheet"]['+e+"]"}function hv(e){return S({},e,{"data-precedence":e.precedence,precedence:null})}function V_(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),zn(t,"link",a),Lt(t),e.head.appendChild(t))}function ir(e){return'[src="'+Un(e)+'"]'}function _o(e){return"script[async]"+e}function mv(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Un(a.href)+'"]');if(l)return t.instance=l,Lt(l),l;var u=S({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),Lt(l),zn(l,"style",u),nc(l,a.precedence,e),t.instance=l;case"stylesheet":u=nr(a.href);var c=e.querySelector(bo(u));if(c)return t.state.loading|=4,t.instance=c,Lt(c),c;l=hv(a),(u=Ai.get(u))&&Yd(l,u),c=(e.ownerDocument||e).createElement("link"),Lt(c);var h=c;return h._p=new Promise(function(_,N){h.onload=_,h.onerror=N}),zn(c,"link",l),t.state.loading|=4,nc(c,a.precedence,e),t.instance=c;case"script":return c=ir(a.src),(u=e.querySelector(_o(c)))?(t.instance=u,Lt(u),u):(l=a,(u=Ai.get(c))&&(l=S({},a),Qd(l,u)),e=e.ownerDocument||e,u=e.createElement("script"),Lt(u),zn(u,"link",l),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,nc(l,a.precedence,e));return t.instance}function nc(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=l.length?l[l.length-1]:null,c=u,h=0;h title"):null)}function G_(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Y_(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=nr(l.href),c=t.querySelector(bo(u));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ac.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,Lt(c);return}c=t.ownerDocument||t,l=hv(l),(u=Ai.get(u))&&Yd(l,u),c=c.createElement("link"),Lt(c);var h=c;h._p=new Promise(function(_,N){h.onload=_,h.onerror=N}),zn(c,"link",l),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=ac.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Kd=0;function Q_(e,t){return e.stylesheets&&e.count===0&&lc(e,e.stylesheets),0Kd?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(u)}}:null}function ac(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sc=null;function lc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sc=new Map,t.forEach(K_,e),sc=null,ac.call(e))}function K_(e,t){if(!(t.state.loading&4)){var a=sc.get(e);if(a)var l=a.get(null);else{a=new Map,sc.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),nh.exports=cS(),nh.exports}var dS=fS();const hS=N0(dS),A0="libbitcoinAdminDashboardBrowserNotifications";function M0(){try{return globalThis.window?.localStorage??null}catch{return null}}function Yh(){const n=globalThis.Notification;return typeof n=="function"?n:null}function O0(){return Yh()?.permission??"unsupported"}async function mS(){const n=Yh();return n?n.permission!=="default"?n.permission:n.requestPermission():"unsupported"}function pS(n=M0()){try{return O0()==="granted"&&n?.getItem(A0)==="true"}catch{return!1}}function gS(n,i=M0()){try{i?.setItem(A0,String(n))}catch{}}function vS(n,i){const s=Yh();if(!s||s.permission!=="granted")return!1;try{return new s(n,i),!0}catch{return!1}}const Qh="libbitcoinAdminDashboardEndpoints";function Kh(){try{return globalThis.window?.localStorage??null}catch{return null}}function yS(){return globalThis.window?.location.origin??"http://localhost"}function ca(n){const i=n.trim();if(!i)throw new Error("Endpoint URL is required");const s=/^[a-z][a-z\d+\-.]*:\/\//iu.test(i)?i:`http://${i}`,r=new URL(s);if(r.protocol!=="http:"&&r.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return r.pathname=r.pathname.replace(/\/+$/u,"")||"/",r.search="",r.hash="",r.toString().replace(/\/$/u,"")}function bS(n){const i=new URL(ca(n));return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.pathname="/",i.search="",i.hash="",i.toString()}function _S(n,i=yS()){return new URL(ca(n)).origin===new URL(i).origin}function j0(){return{adminUrl:ca("http://172.20.208.1:8080"),nativeUrl:ca("http://172.20.208.1:80")}}function SS(n=Kh()){const i=j0();try{const s=n?.getItem(Qh);if(!s)return i;const r=JSON.parse(s);if(!r||typeof r!="object"||Array.isArray(r))return i;const o=r;return{adminUrl:typeof o.adminUrl=="string"?ca(o.adminUrl):i.adminUrl,nativeUrl:typeof o.nativeUrl=="string"?ca(o.nativeUrl):i.nativeUrl}}catch{return i}}function xS(n,i=Kh()){const s={adminUrl:ca(n.adminUrl),nativeUrl:ca(n.nativeUrl)};try{i?.setItem(Qh,JSON.stringify(s))}catch{}}function zS(n=Kh()){try{n?.removeItem(Qh)}catch{}}function wS({configuration:n,browserNotificationsEnabled:i,onClose:s,onBrowserNotificationsEnabledChange:r,onReset:o,onSave:f}){const[d,p]=le.useState(n.adminUrl),[m,v]=le.useState(n.nativeUrl),[x,S]=le.useState(null),[w,M]=le.useState(O0),[T,k]=le.useState(!1),[B,V]=le.useState(null),D=i&&w==="granted";async function ee(){if(D){r(!1);return}k(!0),V(null);try{const W=await mS();M(W),W==="granted"?r(!0):W==="denied"&&V("Permission was denied. It can be changed in your browser settings.")}catch{V("The browser could not enable notifications.")}finally{k(!1)}}function G(W){W.preventDefault();try{f({adminUrl:ca(d),nativeUrl:ca(m)})}catch(ie){S(ie instanceof Error?ie.message:"Invalid endpoint configuration")}}return b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:W=>{W.target===W.currentTarget&&s()},children:b.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"endpoint-settings-title",className:"border-accent/30 bg-surface/95 max-h-[calc(100vh-2rem)] w-full max-w-xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/50",children:[b.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Runtime configuration"}),b.jsx("h2",{id:"endpoint-settings-title",className:"text-accent mt-1 text-xl font-semibold",children:"Node endpoints"})]}),b.jsx("button",{type:"button",onClick:s,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close endpoint settings",children:"×"})]}),b.jsxs("form",{onSubmit:G,className:"space-y-5 p-5",children:[b.jsxs("label",{className:"block space-y-2",children:[b.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Admin endpoint"}),b.jsx("input",{value:d,onChange:W=>{p(W.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:admin-port",autoComplete:"url"})]}),b.jsxs("label",{className:"block space-y-2",children:[b.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Native endpoint"}),b.jsx("input",{value:m,onChange:W=>{v(W.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:native-port",autoComplete:"url"})]}),b.jsxs("div",{className:"border-accentSecondary/20 bg-accent/5 space-y-3 rounded-xl border p-4",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-textPrimary text-sm font-medium",children:"Browser notifications"}),b.jsx("p",{id:"browser-notifications-help",className:"text-textMuted mt-1 text-xs",children:TS(w,D,T)})]}),b.jsx("button",{type:"button","aria-describedby":"browser-notifications-help",disabled:T||w==="unsupported"||w==="denied",onClick:()=>{ee()},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:ES(w,D,T)}),B&&b.jsx("p",{className:"text-sm text-red-300",role:"alert",children:B})]}),x&&b.jsx("p",{className:"rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-300",children:x}),b.jsxs("div",{className:"flex flex-wrap justify-between gap-3 pt-2",children:[b.jsx("button",{type:"button",onClick:o,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-4 py-2 text-sm",children:"Reset defaults"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("button",{type:"button",onClick:s,className:"text-textMuted hover:text-accent rounded-md px-4 py-2 text-sm",children:"Cancel"}),b.jsx("button",{type:"submit",className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Save endpoints"})]})]})]})]}))DELIM" -R"DELIM(})}function ES(n,i,s){return s?"Requesting permission…":n==="unsupported"?"Notifications unavailable":n==="denied"?"Blocked by browser":i?"Disable notifications":"Enable notifications"}function TS(n,i,s){return s?"Waiting for your browser permission choice.":n==="unsupported"?"This browser does not support system notifications.":n==="denied"?"Notifications are blocked. Allow them in your browser settings to enable this feature.":i?"System notifications will appear when the node enters or leaves the near-current range.":"Get a system notification when the node enters or leaves the near-current range."}var Bv;function I(n,i,s){function r(p,m){if(p._zod||Object.defineProperty(p,"_zod",{value:{def:m,constr:d,traits:new Set},enumerable:!1}),p._zod.traits.has(n))return;p._zod.traits.add(n),i(p,m);const v=d.prototype,x=Object.keys(v);for(let S=0;Ss?.Parent&&p instanceof s.Parent?!0:p?._zod?.traits?.has(n)}),Object.defineProperty(d,"name",{value:n}),d}class fr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class k0 extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`),this.name="ZodEncodeError"}}(Bv=globalThis).__zod_globalConfig??(Bv.__zod_globalConfig={});const Fh=globalThis.__zod_globalConfig;function hl(n){return Fh}function R0(n){const i=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,o])=>i.indexOf(+r)===-1).map(([r,o])=>o)}function vh(n,i){return typeof i=="bigint"?i.toString():i}function Jh(n){return{get value(){{const i=n();return Object.defineProperty(this,"value",{value:i}),i}}}}function Ih(n){return n==null}function Xh(n){const i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;return n.slice(i,s)}function NS(n,i){const s=n/i,r=Math.round(s),o=Number.EPSILON*Math.max(Math.abs(s),1);return Math.abs(s-r){};function Ac(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const MS=Jh(()=>{if(Fh.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function $o(n){if(Ac(n)===!1)return!1;const i=n.constructor;if(i===void 0||typeof i!="function")return!0;const s=i.prototype;return!(Ac(s)===!1||Object.prototype.hasOwnProperty.call(s,"isPrototypeOf")===!1)}function D0(n){return $o(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const OS=new Set(["string","number","symbol"]);function pr(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ks(n,i,s){const r=new n._zod.constr(i??n._zod.def);return(!i||s?.parent)&&(r._zod.parent=n),r}function Ee(n){const i=n;if(!i)return{};if(typeof i=="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");i.error=i.message}return delete i.message,typeof i.error=="string"?{...i,error:()=>i.error}:i}function jS(n){return Object.keys(n).filter(i=>n[i]._zod.optin==="optional"&&n[i]._zod.optout==="optional")}const kS={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(n,i){const s=n._zod.def,r=s.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const f=js(n._zod.def,{get shape(){const d={};for(const p in i){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);i[p]&&(d[p]=s.shape[p])}return vl(this,"shape",d),d},checks:[]});return ks(n,f)}function CS(n,i){const s=n._zod.def,r=s.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const f=js(n._zod.def,{get shape(){const d={...n._zod.def.shape};for(const p in i){if(!(p in s.shape))throw new Error(`Unrecognized key: "${p}"`);i[p]&&delete d[p]}return vl(this,"shape",d),d},checks:[]});return ks(n,f)}function DS(n,i){if(!$o(i))throw new Error("Invalid input to extend: expected a plain object");const s=n._zod.def.checks;if(s&&s.length>0){const f=n._zod.def.shape;for(const d in i)if(Object.getOwnPropertyDescriptor(f,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=js(n._zod.def,{get shape(){const f={...n._zod.def.shape,...i};return vl(this,"shape",f),f}});return ks(n,o)}function ZS(n,i){if(!$o(i))throw new Error("Invalid input to safeExtend: expected a plain object");const s=js(n._zod.def,{get shape(){const r={...n._zod.def.shape,...i};return vl(this,"shape",r),r}});return ks(n,s)}function US(n,i){if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const s=js(n._zod.def,{get shape(){const r={...n._zod.def.shape,...i._zod.def.shape};return vl(this,"shape",r),r},get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return ks(n,s)}function $S(n,i,s){const o=i._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const d=js(i._zod.def,{get shape(){const p=i._zod.def.shape,m={...p};if(s)for(const v in s){if(!(v in p))throw new Error(`Unrecognized key: "${v}"`);s[v]&&(m[v]=n?new n({type:"optional",innerType:p[v]}):p[v])}else for(const v in p)m[v]=n?new n({type:"optional",innerType:p[v]}):p[v];return vl(this,"shape",m),m},checks:[]});return ks(i,d)}function LS(n,i,s){const r=js(i._zod.def,{get shape(){const o=i._zod.def.shape,f={...o};if(s)for(const d in s){if(!(d in f))throw new Error(`Unrecognized key: "${d}"`);s[d]&&(f[d]=new n({type:"nonoptional",innerType:o[d]}))}else for(const d in o)f[d]=new n({type:"nonoptional",innerType:o[d]});return vl(this,"shape",f),f}});return ks(i,r)}function cr(n,i=0){if(n.aborted===!0)return!0;for(let s=i;s{var r;return(r=s).path??(r.path=[]),s.path.unshift(n),s})}function mc(n){return typeof n=="string"?n:n?.message}function ml(n,i,s){const r=n.message?n.message:mc(n.inst?._zod.def?.error?.(n))??mc(i?.error?.(n))??mc(s.customError?.(n))??mc(s.localeError?.(n))??"Invalid input",{inst:o,continue:f,input:d,...p}=n;return p.path??(p.path=[]),p.message=r,i?.reportInput&&(p.input=d),p}function Ph(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Lo(...n){const[i,s,r]=n;return typeof i=="string"?{message:i,code:"custom",input:s,inst:r}:{...i}}const Z0=(n,i)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:i,enumerable:!1}),n.message=JSON.stringify(i,vh,2),Object.defineProperty(n,"toSt)DELIM" -R"DELIM(ring",{value:()=>n.message,enumerable:!1})},U0=I("$ZodError",Z0),$0=I("$ZodError",Z0,{Parent:Error});function BS(n,i=s=>s.message){const s={},r=[];for(const o of n.issues)o.path.length>0?(s[o.path[0]]=s[o.path[0]]||[],s[o.path[0]].push(i(o))):r.push(i(o));return{formErrors:r,fieldErrors:s}}function qS(n,i=s=>s.message){const s={_errors:[]},r=(o,f=[])=>{for(const d of o.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(p=>r({issues:p},[...f,...d.path]));else if(d.code==="invalid_key")r({issues:d.issues},[...f,...d.path]);else if(d.code==="invalid_element")r({issues:d.issues},[...f,...d.path]);else{const p=[...f,...d.path];if(p.length===0)s._errors.push(i(d));else{let m=s,v=0;for(;v(i,s,r,o)=>{const f=r?{...r,async:!1}:{async:!1},d=i._zod.run({value:s,issues:[]},f);if(d instanceof Promise)throw new fr;if(d.issues.length){const p=new(o?.Err??n)(d.issues.map(m=>ml(m,f,hl())));throw C0(p,o?.callee),p}return d.value},em=n=>async(i,s,r,o)=>{const f=r?{...r,async:!0}:{async:!0};let d=i._zod.run({value:s,issues:[]},f);if(d instanceof Promise&&(d=await d),d.issues.length){const p=new(o?.Err??n)(d.issues.map(m=>ml(m,f,hl())));throw C0(p,o?.callee),p}return d.value},qc=n=>(i,s,r)=>{const o=r?{...r,async:!1}:{async:!1},f=i._zod.run({value:s,issues:[]},o);if(f instanceof Promise)throw new fr;return f.issues.length?{success:!1,error:new(n??U0)(f.issues.map(d=>ml(d,o,hl())))}:{success:!0,data:f.value}},VS=qc($0),Vc=n=>async(i,s,r)=>{const o=r?{...r,async:!0}:{async:!0};let f=i._zod.run({value:s,issues:[]},o);return f instanceof Promise&&(f=await f),f.issues.length?{success:!1,error:new n(f.issues.map(d=>ml(d,o,hl())))}:{success:!0,data:f.value}},GS=Vc($0),YS=n=>(i,s,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Wh(n)(i,s,o)},QS=n=>(i,s,r)=>Wh(n)(i,s,r),KS=n=>async(i,s,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return em(n)(i,s,o)},FS=n=>async(i,s,r)=>em(n)(i,s,r),JS=n=>(i,s,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return qc(n)(i,s,o)},IS=n=>(i,s,r)=>qc(n)(i,s,r),XS=n=>async(i,s,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Vc(n)(i,s,o)},PS=n=>async(i,s,r)=>Vc(n)(i,s,r),WS=/^[cC][0-9a-z]{6,}$/,ex=/^[0-9a-z]+$/,tx=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nx=/^[0-9a-vA-V]{20}$/,ix=/^[A-Za-z0-9]{27}$/,ax=/^[a-zA-Z0-9_-]{21}$/,sx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lx=/^([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})$/,Gv=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,rx=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ox="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function ux(){return new RegExp(ox,"u")}const cx=/^(?:(?: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])$/,fx=/^(([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}|:))$/,dx=/^((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])$/,hx=/^(([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])$/,mx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,L0=/^[A-Za-z0-9_-]*$/,px=/^https?$/,gx=/^\+[1-9]\d{6,14}$/,H0="(?:(?:\\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])))",vx=new RegExp(`^${H0}$`);function B0(n){const i="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${i}`:n.precision===0?`${i}:[0-5]\\d`:`${i}:[0-5]\\d\\.\\d{${n.precision}}`:`${i}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yx(n){return new RegExp(`^${B0(n)}$`)}function bx(n){const i=B0({precision:n.precision}),s=["Z"];n.local&&s.push(""),n.offset&&s.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${i}(?:${s.join("|")})`;return new RegExp(`^${H0}T(?:${r})$`)}const _x=n=>{const i=n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${i}$`)},Sx=/^-?\d+$/,xx=/^-?\d+(?:\.\d+)?$/,zx=/^(?:true|false)$/i,wx=/^[^A-Z]*$/,Ex=/^[^a-z]*$/,ni=I("$ZodCheck",(n,i)=>{var s;n._zod??(n._zod={}),n._zod.def=i,(s=n._zod).onattach??(s.onattach=[])}),q0={number:"number",bigint:"bigint",object:"date"},V0=I("$ZodCheckLessThan",(n,i)=>{ni.init(n,i);const s=q0[typeof i.value];n._zod.onattach.push(r=>{const o=r._zod.bag,f=(i.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;i.value{(i.inclusive?r.value<=i.value:r.value{ni.init(n,i);const s=q0[typeof i.value];n._zod.onattach.push(r=>{const o=r._zod.bag,f=(i.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;i.value>f&&(i.inclusive?o.minimum=i.value:o.exclusiveMinimum=i.value)}),n._zod.check=r=>{(i.inclusive?r.value>=i.value:r.value>i.value)||r.issues.push({origin:s,code:"too_small",minimum:typeof i.value=="object"?i.value.getTime():i.value,input:r.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),Tx=I("$ZodCheckMultipleOf",(n,i)=>{ni.init(n,i),n._zod.onattach.push(s=>{var r;(r=s._zod.bag).multipleOf??(r.multipleOf=i.value)}),n._zod.check=s=>{if(typeof s.value!=typeof i.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof s.value=="bigint"?s.value%i.value===BigInt(0):NS(s.value,i.value)===0)||s.issues.push({origin:typeof s.value,code:"not_multiple_of",divisor:i.value,input:s.value,inst:n,continue:!i.abort})}}),Nx=I("$ZodCheckNumberFormat",(n,i)=>{ni.init(n,i),i.format=i.format||"float64";const s=i.format?.includes("int"),r=s?"int":"number",[o,f]=kS[i.format];n._zod.onattach.push(d=>{const p=d._zod.bag;p.format=i.format,p.minimum=o,p.maximum=f,s&&(p.pattern=Sx)}),n._zod.check=d=>{const p=d.value;if(s){if(!Number.isInteger(p)){d.issues.push({expected:r,format:i.format,code:"invalid_type",continue:!1,input:p,inst:n});return}if(!Number.isSafeInteger(p)){p>0?d.issues.push({input:p,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!i.abort}):d.issues.push({input:p,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!i.abort});return}}pf&&d.issues.push({origin:"number",input:p,code:"too_big",maximum:f,inclusive:!0,inst:n,continue:!i.abort})}}),Ax=I("$ZodCheckMaxLength",(n,i)=>{var s;ni.init(n,i),(s=n._zod.def).when??(s.when=r=>{const o=r.value;return!Ih(o)&&o.length!==void 0}),n._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;i.maximum{const o=r.value;if(o.length<=i.maximum)return;const d=Ph(o);r.issues.push({origin)DELIM" -R"DELIM(:d,code:"too_big",maximum:i.maximum,inclusive:!0,input:o,inst:n,continue:!i.abort})}}),Mx=I("$ZodCheckMinLength",(n,i)=>{var s;ni.init(n,i),(s=n._zod.def).when??(s.when=r=>{const o=r.value;return!Ih(o)&&o.length!==void 0}),n._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;i.minimum>o&&(r._zod.bag.minimum=i.minimum)}),n._zod.check=r=>{const o=r.value;if(o.length>=i.minimum)return;const d=Ph(o);r.issues.push({origin:d,code:"too_small",minimum:i.minimum,inclusive:!0,input:o,inst:n,continue:!i.abort})}}),Ox=I("$ZodCheckLengthEquals",(n,i)=>{var s;ni.init(n,i),(s=n._zod.def).when??(s.when=r=>{const o=r.value;return!Ih(o)&&o.length!==void 0}),n._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=i.length,o.maximum=i.length,o.length=i.length}),n._zod.check=r=>{const o=r.value,f=o.length;if(f===i.length)return;const d=Ph(o),p=f>i.length;r.issues.push({origin:d,...p?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!i.abort})}}),Gc=I("$ZodCheckStringFormat",(n,i)=>{var s,r;ni.init(n,i),n._zod.onattach.push(o=>{const f=o._zod.bag;f.format=i.format,i.pattern&&(f.patterns??(f.patterns=new Set),f.patterns.add(i.pattern))}),i.pattern?(s=n._zod).check??(s.check=o=>{i.pattern.lastIndex=0,!i.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:i.format,input:o.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})}):(r=n._zod).check??(r.check=()=>{})}),jx=I("$ZodCheckRegex",(n,i)=>{Gc.init(n,i),n._zod.check=s=>{i.pattern.lastIndex=0,!i.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:"regex",input:s.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),kx=I("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=wx),Gc.init(n,i)}),Rx=I("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=Ex),Gc.init(n,i)}),Cx=I("$ZodCheckIncludes",(n,i)=>{ni.init(n,i);const s=pr(i.includes),r=new RegExp(typeof i.position=="number"?`^.{${i.position}}${s}`:s);i.pattern=r,n._zod.onattach.push(o=>{const f=o._zod.bag;f.patterns??(f.patterns=new Set),f.patterns.add(r)}),n._zod.check=o=>{o.value.includes(i.includes,i.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:o.value,inst:n,continue:!i.abort})}}),Dx=I("$ZodCheckStartsWith",(n,i)=>{ni.init(n,i);const s=new RegExp(`^${pr(i.prefix)}.*`);i.pattern??(i.pattern=s),n._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(s)}),n._zod.check=r=>{r.value.startsWith(i.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:r.value,inst:n,continue:!i.abort})}}),Zx=I("$ZodCheckEndsWith",(n,i)=>{ni.init(n,i);const s=new RegExp(`.*${pr(i.suffix)}$`);i.pattern??(i.pattern=s),n._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(s)}),n._zod.check=r=>{r.value.endsWith(i.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:r.value,inst:n,continue:!i.abort})}}),Ux=I("$ZodCheckOverwrite",(n,i)=>{ni.init(n,i),n._zod.check=s=>{s.value=i.tx(s.value)}});class $x{constructor(i=[]){this.content=[],this.indent=0,this&&(this.args=i)}indented(i){this.indent+=1,i(this),this.indent-=1}write(i){if(typeof i=="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}const r=i.split(` -`).filter(d=>d),o=Math.min(...r.map(d=>d.length-d.trimStart().length)),f=r.map(d=>d.slice(o)).map(d=>" ".repeat(this.indent*2)+d);for(const d of f)this.content.push(d)}compile(){const i=Function,s=this?.args,o=[...(this?.content??[""]).map(f=>` ${f}`)];return new i(...s,o.join(` -`))}}const Lx={major:4,minor:4,patch:3},Tt=I("$ZodType",(n,i)=>{var s;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=Lx;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const o of r)for(const f of o._zod.onattach)f(n);if(r.length===0)(s=n._zod).deferred??(s.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const o=(d,p,m)=>{let v=cr(d),x;for(const S of p){if(S._zod.def.when){if(HS(d)||!S._zod.def.when(d))continue}else if(v)continue;const w=d.issues.length,M=S._zod.check(d);if(M instanceof Promise&&m?.async===!1)throw new fr;if(x||M instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await M,d.issues.length!==w&&(v||(v=cr(d,w)))});else{if(d.issues.length===w)continue;v||(v=cr(d,w))}}return x?x.then(()=>d):d},f=(d,p,m)=>{if(cr(d))return d.aborted=!0,d;const v=o(p,r,m);if(v instanceof Promise){if(m.async===!1)throw new fr;return v.then(x=>n._zod.parse(x,m))}return n._zod.parse(v,m)};n._zod.run=(d,p)=>{if(p.skipChecks)return n._zod.parse(d,p);if(p.direction==="backward"){const v=n._zod.parse({value:d.value,issues:[]},{...p,skipChecks:!0});return v instanceof Promise?v.then(x=>f(x,d,p)):f(v,d,p)}const m=n._zod.parse(d,p);if(m instanceof Promise){if(p.async===!1)throw new fr;return m.then(v=>o(v,r,p))}return o(m,r,p)}}ht(n,"~standard",()=>({validate:o=>{try{const f=VS(n,o);return f.success?{value:f.data}:{issues:f.error?.issues}}catch{return GS(n,o).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}))}),tm=I("$ZodString",(n,i)=>{Tt.init(n,i),n._zod.pattern=[...n?._zod.bag?.patterns??[]].pop()??_x(n._zod.bag),n._zod.parse=(s,r)=>{if(i.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:n}),s}}),Nt=I("$ZodStringFormat",(n,i)=>{Gc.init(n,i),tm.init(n,i)}),Hx=I("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=lx),Nt.init(n,i)}),Bx=I("$ZodUUID",(n,i)=>{if(i.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(r===void 0)throw new Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=Gv(r))}else i.pattern??(i.pattern=Gv());Nt.init(n,i)}),qx=I("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=rx),Nt.init(n,i)}),Vx=I("$ZodURL",(n,i)=>{Nt.init(n,i),n._zod.check=s=>{try{const r=s.value.trim();if(!i.normalize&&i.protocol?.source===px.source&&!/^https?:\/\//i.test(r)){s.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:s.value,inst:n,continue:!i.abort});return}const o=new URL(r);i.hostname&&(i.hostname.lastIndex=0,i.hostname.test(o.hostname)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:s.value,inst:n,continue:!i.abort})),i.protocol&&(i.protocol.lastIndex=0,i.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||s.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:s.value,inst:n,continue:!i.abort})),i.normalize?s.value=o.href:s.value=r;return}catch{s.issues.push({code:"invalid_format",format:"url",input:s.value,inst:n,continue:!i.abort})}}}),Gx=I("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=ux()),Nt.init(n,i)}),Yx=I("$ZodNanoID",(n,i)=>{i.pattern??(i.pattern=ax),Nt.init(n,i)}),Qx=I("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=WS),Nt.init(n,i)}),Kx=I("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=ex),Nt.init(n,i)}),Fx=I("$ZodULID",(n,i)=>{i.pattern??(i.pattern=tx),Nt.init(n,i)}),Jx=I("$ZodXID",(n,i)=>{i.pattern??(i.pattern=nx),Nt.init(n,i)}),Ix=I("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=ix),Nt.init(n,i)}),Xx=I("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=bx(i)),Nt.init(n,i)}),Px=I("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=vx),Nt.init(n,i)}),Wx=I("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=yx(i)),Nt.init(n,i)}),ez=I("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=sx),Nt.init(n,i)}),tz=I("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=cx),Nt.init(n,i),n._zod.bag.format="ipv4"}),nz=I("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=fx),Nt.init(n,i),n._zod.bag.format="ipv6",n._zod.check=s=>{try{new URL(`http://[${s.value}]`)}catch{s.issues.push({code:"invalid_format",format:"ipv6",input:s.value,inst:n,continue:!i.abort})}}}),iz=I("$ZodCIDRv)DELIM" -R"DELIM(4",(n,i)=>{i.pattern??(i.pattern=dx),Nt.init(n,i)}),az=I("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=hx),Nt.init(n,i),n._zod.check=s=>{const r=s.value.split("/");try{if(r.length!==2)throw new Error;const[o,f]=r;if(!f)throw new Error;const d=Number(f);if(`${d}`!==f)throw new Error;if(d<0||d>128)throw new Error;new URL(`http://[${o}]`)}catch{s.issues.push({code:"invalid_format",format:"cidrv6",input:s.value,inst:n,continue:!i.abort})}}});function Y0(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const sz=I("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=mx),Nt.init(n,i),n._zod.bag.contentEncoding="base64",n._zod.check=s=>{Y0(s.value)||s.issues.push({code:"invalid_format",format:"base64",input:s.value,inst:n,continue:!i.abort})}});function lz(n){if(!L0.test(n))return!1;const i=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),s=i.padEnd(Math.ceil(i.length/4)*4,"=");return Y0(s)}const rz=I("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=L0),Nt.init(n,i),n._zod.bag.contentEncoding="base64url",n._zod.check=s=>{lz(s.value)||s.issues.push({code:"invalid_format",format:"base64url",input:s.value,inst:n,continue:!i.abort})}}),oz=I("$ZodE164",(n,i)=>{i.pattern??(i.pattern=gx),Nt.init(n,i)});function uz(n,i=null){try{const s=n.split(".");if(s.length!==3)return!1;const[r]=s;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||i&&(!("alg"in o)||o.alg!==i))}catch{return!1}}const cz=I("$ZodJWT",(n,i)=>{Nt.init(n,i),n._zod.check=s=>{uz(s.value,i.alg)||s.issues.push({code:"invalid_format",format:"jwt",input:s.value,inst:n,continue:!i.abort})}}),Q0=I("$ZodNumber",(n,i)=>{Tt.init(n,i),n._zod.pattern=n._zod.bag.pattern??xx,n._zod.parse=(s,r)=>{if(i.coerce)try{s.value=Number(s.value)}catch{}const o=s.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return s;const f=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return s.issues.push({expected:"number",code:"invalid_type",input:o,inst:n,...f?{received:f}:{}}),s}}),fz=I("$ZodNumberFormat",(n,i)=>{Nx.init(n,i),Q0.init(n,i)}),dz=I("$ZodBoolean",(n,i)=>{Tt.init(n,i),n._zod.pattern=zx,n._zod.parse=(s,r)=>{if(i.coerce)try{s.value=!!s.value}catch{}const o=s.value;return typeof o=="boolean"||s.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:n}),s}}),hz=I("$ZodUnknown",(n,i)=>{Tt.init(n,i),n._zod.parse=s=>s}),mz=I("$ZodNever",(n,i)=>{Tt.init(n,i),n._zod.parse=(s,r)=>(s.issues.push({expected:"never",code:"invalid_type",input:s.value,inst:n}),s)});function Yv(n,i,s){n.issues.length&&i.issues.push(...Bc(s,n.issues)),i.value[s]=n.value}const pz=I("$ZodArray",(n,i)=>{Tt.init(n,i),n._zod.parse=(s,r)=>{const o=s.value;if(!Array.isArray(o))return s.issues.push({expected:"array",code:"invalid_type",input:o,inst:n}),s;s.value=Array(o.length);const f=[];for(let d=0;dYv(v,s,d))):Yv(m,s,d)}return f.length?Promise.all(f).then(()=>s):s}});function Mc(n,i,s,r,o,f){const d=s in r;if(n.issues.length){if(o&&f&&!d)return;i.issues.push(...Bc(s,n.issues))}if(!d&&!o){n.issues.length||i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[s]});return}n.value===void 0?d&&(i.value[s]=void 0):i.value[s]=n.value}function K0(n){const i=Object.keys(n.shape);for(const r of i)if(!n.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const s=jS(n.shape);return{...n,keys:i,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(s)}}function F0(n,i,s,r,o,f){const d=[],p=o.keySet,m=o.catchall._zod,v=m.def.type,x=m.optin==="optional",S=m.optout==="optional";for(const w in i){if(w==="__proto__"||p.has(w))continue;if(v==="never"){d.push(w);continue}const M=m.run({value:i[w],issues:[]},r);M instanceof Promise?n.push(M.then(T=>Mc(T,s,w,i,x,S))):Mc(M,s,w,i,x,S)}return d.length&&s.issues.push({code:"unrecognized_keys",keys:d,input:i,inst:f}),n.length?Promise.all(n).then(()=>s):s}const gz=I("$ZodObject",(n,i)=>{if(Tt.init(n,i),!Object.getOwnPropertyDescriptor(i,"shape")?.get){const p=i.shape;Object.defineProperty(i,"shape",{get:()=>{const m={...p};return Object.defineProperty(i,"shape",{value:m}),m}})}const r=Jh(()=>K0(i));ht(n._zod,"propValues",()=>{const p=i.shape,m={};for(const v in p){const x=p[v]._zod;if(x.values){m[v]??(m[v]=new Set);for(const S of x.values)m[v].add(S)}}return m});const o=Ac,f=i.catchall;let d;n._zod.parse=(p,m)=>{d??(d=r.value);const v=p.value;if(!o(v))return p.issues.push({expected:"object",code:"invalid_type",input:v,inst:n}),p;p.value={};const x=[],S=d.shape;for(const w of d.keys){const M=S[w],T=M._zod.optin==="optional",k=M._zod.optout==="optional",B=M._zod.run({value:v[w],issues:[]},m);B instanceof Promise?x.push(B.then(V=>Mc(V,p,w,v,T,k))):Mc(B,p,w,v,T,k)}return f?F0(x,v,p,m,r.value,n):x.length?Promise.all(x).then(()=>p):p}}),vz=I("$ZodObjectJIT",(n,i)=>{gz.init(n,i);const s=n._zod.parse,r=Jh(()=>K0(i)),o=w=>{const M=new $x(["shape","payload","ctx"]),T=r.value,k=ee=>{const G=Vv(ee);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};M.write("const input = payload.value;");const B=Object.create(null);let V=0;for(const ee of T.keys)B[ee]=`key_${V++}`;M.write("const newResult = {};");for(const ee of T.keys){const G=B[ee],W=Vv(ee),ie=w[ee],ae=ie?._zod?.optin==="optional",X=ie?._zod?.optout==="optional";M.write(`const ${G} = ${k(ee)};`),ae&&X?M.write(` - if (${G}.issues.length) { - if (${W} in input) { - payload.issues = payload.issues.concat(${G}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${W}, ...iss.path] : [${W}] - }))); +R"DELIM(/*! + * Third-party software contained in this file, with its published notices. + * + * ---- @rollup/plugin-commonjs bundled in vite 7.3.8 ---- + * + * The MIT License (MIT) + * + * Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * ---- @tanstack/query-core 5.107.1, @tanstack/react-query 5.107.1 ---- + * + * MIT License + * + * Copyright (c) 2021-present Tanner Linsley + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- react 19.3.1, react-dom 19.3.1, scheduler 0.28.0 ---- + * + * MIT License + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- uplot 1.6.32 ---- + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Leon Sorokin + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * ---- vite 7.3.8 ---- + * + * # Vite core license + * Vite is released under the MIT license: + * + * MIT License + * + * Copyright (c) 2019-present, VoidZero Inc. and Vite contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- zod 4.6.7 ---- + * + * MIT License + * + * Copyright (c) 2025 Colin McDonnell + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentia)DELIM" +R"DELIM(ls="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=a(u);fetch(u.href,f)}})();function J_(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Em={exports:{}},mu={};var K0;function _z(){if(K0)return mu;K0=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(l,u,f){var d=null;if(f!==void 0&&(d=""+f),u.key!==void 0&&(d=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:n,type:l,key:d,ref:u!==void 0?u:null,props:f}}return mu.Fragment=i,mu.jsx=a,mu.jsxs=a,mu}var G0;function Sz(){return G0||(G0=1,Em.exports=_z()),Em.exports}var S=Sz(),Tm={exports:{}},Ze={};var Y0;function xz(){if(Y0)return Ze;Y0=1;var n=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.for("react.view_transition"),N=Symbol.iterator;function E(M){return M===null||typeof M!="object"?null:(M=N&&M[N]||M["@@iterator"],typeof M=="function"?M:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,B={};function D(M,J,le){this.props=M,this.context=J,this.refs=B,this.updater=le||A}D.prototype.isReactComponent={},D.prototype.setState=function(M,J){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,J,"setState")},D.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function ie(){}ie.prototype=D.prototype;function K(M,J,le){this.props=M,this.context=J,this.refs=B,this.updater=le||A}var G=K.prototype=new ie;G.constructor=K,k(G,D.prototype),G.isPureReactComponent=!0;var F=Array.isArray;function te(){}var V={H:null,A:null,T:null,S:null},ye=Object.prototype.hasOwnProperty;function de(M,J,le){var ae=le.ref;return{$$typeof:n,type:M,key:J,ref:ae!==void 0?ae:null,props:le}}function ne(M,J){return de(M.type,J,M.props)}function xe(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}function ge(M){var J={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(le){return J[le]})}var Ae=/\/+/g;function ce(M,J){return typeof M=="object"&&M!==null&&M.key!=null?ge(""+M.key):J.toString(36)}function X(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(te,te):(M.status="pending",M.then(function(J){M.status==="pending"&&(M.status="fulfilled",M.value=J)},function(J){M.status==="pending"&&(M.status="rejected",M.reason=J)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function W(M,J,le,ae,$e){var Ue=typeof M;(Ue==="undefined"||Ue==="boolean")&&(M=null);var Ne=!1;if(M===null)Ne=!0;else switch(Ue){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(M.$$typeof){case n:case i:Ne=!0;break;case x:return Ne=M._init,W(Ne(M._payload),J,le,ae,$e)}}if(Ne)return $e=$e(M),Ne=ae===""?"."+ce(M,0):ae,F($e)?(le="",Ne!=null&&(le=Ne.replace(Ae,"$&/")+"/"),W($e,J,le,"",function(Bt){return Bt})):$e!=null&&(xe($e)&&($e=ne($e,le+($e.key==null||M&&M.key===$e.key?"":(""+$e.key).replace(Ae,"$&/")+"/")+Ne)),J.push($e)),1;Ne=0;var me=ae===""?".":ae+":";if(F(M))for(var Te=0;Te>>1,Se=X[Me];if(0>>1;Meu(be,we))Mu(J,be)?(X[Me]=J,X[M]=we,Me=M):(X[Me]=be,X[Ce]=we,Me=Ce);else if(Mu(J,we))X[Me]=J,X[M]=we,Me=M;else break e}}return W}function u(X,W){var we=X.sortIndex-W.sortIndex;return we!==0?we:X.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,m=d.now();n.unstable_now=function(){return d.now()-m}}var p=[],g=[],x=1,y=null,w=3,N=!1,E=!1,A=!1,k=!1,B=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,ie=typeof setImmediate<"u"?setImmediate:null;function K(X){for(var W=a(g);W!==null;){if(W.callback===null)l(g);else if(W.startTime<=X)l(g),W.sortIndex=W.expirationTime,i(p,W);else break;W=a(g)}}function G(X){if(A=!1,K(X),!E)if(a(p)!==null)E=!0,F||(F=!0,xe());else{var W=a(g);W!==null&&ce(G,W.startTime-X)}}var F=!1,te=-1,V=5,ye=-1;function de(){return k?!0:!(n.unstable_now()-yeX&&de());){var Me=y.callback;if(typeof Me=="function"){y.callback=null,w=y.priorityLevel;var Se=Me(y.expirationTime<=X);if(X=n.unstable_now(),typeof Se=="function"){y.callback=Se,K(X),W=!0;break t}y===a(p)&&l(p),K(X)}else l(p);y=a(p)}if(y!==null)W=!0;else{var Be=a(g);Be!==null&&ce(G,Be.startTime-X),W=!1}}break e}finally{y=null,w=we,N=!1}W=void 0}}finally{W?xe():F=!1}}}var xe;if(typeof ie=="function")xe=function(){ie(ne)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,Ae=ge.port2;ge.port1.onmessage=ne,xe=function(){Ae.postMessage(null)}}else xe=function(){B(ne,0)};function ce(X,W){te=B(function(){X(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(X){X.callback=null},n.unstable_forceFrameRate=function(X){0>X||125Me?(X.sortIndex=we,i(g,X),a(p)===null&&X===a(g)&&(A?(D(te),te=-1):A=!0,ce(G,we-Me))):(X.sortIndex=Se,i(p,X),E||N||(E=!0,F||(F=!0,xe()))),X},n.unstable_shouldYield=de,n.unstable_wrapCallback=function(X){var W=w;return function(){var we=w;w=W;try{return X.apply(this,arguments)}finally{w=we}}}})(Am)),Am}var Q0;function Ez(){return Q0||(Q0=1,Nm.exports=zz()),Nm.exports}var Mm={exports:{}},Cn={};var J0;function Tz(){if(J0)return Cn;J0=1;var n=xp();function i(x){var y="https://react.dev/errors/"+x;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Mm.exports=Tz(),Mm.exports}var W0;function Nz(){if(W0)return pu;W0=1;var n=Ez(),i=xp(),a=Oz();function l(e){var t="https://react.dev/errors/"+e;if(1gi||(e.current=Di[gi],Di[gi]=null,gi--)}function tt(e,t){gi++,Di[gi]=e.current,e.current=t}var gn=En(null),Gt=En(null),qn=En(null),ii=En(null);function Ui(e,t){switch(tt(qn,t),tt(Gt,e),tt(gn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?e0(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=e0(t),e=t0(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}kt(gn),tt(gn,e)}function ke(){kt(gn),kt(Gt),kt(qn)}function he(e){var t=e.memoizedState;t!==null&&(Kl._currentValue=t.memoizedState,tt(ii,e)),t=gn.current;var r=t0(t,e.type);t!==r&&(tt(Gt,e),tt(gn,r))}function nt(e){Gt.current===e&&(kt(gn),kt(Gt)),ii.current===e&&(kt(ii),Kl._currentValue=Bt)}var Dt,Hr;function Dn(e){if(Dt===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Dt=t&&t[1]||"",Hr=-1)":-1o||O[s]!==Z[o]){var q=` +`+O[s].replace(" at new "," at ");return e.displayName&&q.includes("")&&(q=q.replace("",e.displayName)),q}while(1<=s&&0<=o);break}}}finally{ri=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Dn(r):""}function Vn(e,t){switch(e.tag){case 26:case 27:case 5:return Dn(e.type);case 16:return Dn("Lazy");case 13:return e.child!==t&&t!==null?Dn("Suspense Fallback"):Dn("Suspense");case 19:return Dn("SuspenseList");case 0:case 15:return Qi(e.type,!1);case 11:return Qi(e.type.render,!1);case 1:return Qi(e.type,!0);case 31:return Dn("Activity");case 30:return Dn("ViewTransition");default:return""}}function In(e){try{var t="",r=null;do t+=Vn(e,r),r=e,e=e.return;while(e);return t}catch(s){return` +Error generating stack: `+s.message+` +`+s.stack}}var vn=Object.prototype.hasOwnProperty,Kn=n.unstable_scheduleCallback,Ws=n.unstable_cancelCallback,Wa=n.unstable_shouldYield,ds=n.unstable_requestPaint,Yt=n.unstable_now,el=n.unstable_getCurrentPriorityLevel,Gn=n.unstable_ImmediatePriority,tl=n.unstable_UserBlockingPriority,ea=n.unstable_NormalPriority,od=n.unstable_LowPriority,Lu=n.unstable_IdlePriority,ud=n.log,cd=n.unstable_setDisableYieldValue,ta=null,Pt=null;function Et(e){if(typeof ud=="function"&&cd(e),Pt&&typeof Pt.setStrictMode=="function")try{Pt.setStrictMode(ta,e)}catch{}}var Ot=Math.clz32?Math.clz32:si,hs=Math.log,ms=Math.LN2;function si(e){return e>>>=0,e===0?32:31-(hs(e)/ms|0)|0}var Ji=256,Xi=262144,na=4194304;function yr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function nl(e,t,r){var s=e.pendingLanes;if(s===0)return 0;var o=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=s&134217727;return b!==0?(s=b&~c,s!==0?o=yr(s):(h&=b,h!==0?o=yr(h):r||(r=b&~e,r!==0&&(o=yr(r))))):(b=s&~c,b!==0?o=yr(b):h!==0?o=yr(h):r||(r=s&~e,r!==0&&(o=yr(r)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,r=t&-t,c>=r||c===32&&(r&4194048)!==0)?t:o}function ia(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function br(e,t){(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0r;r++)t.push(e);return t}function ai(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function on(e,t,r,s,o,c){var h=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var b=e.entanglements,O=e.expirationTimes,Z=e.hiddenUpdates;for(r=h&~r;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Oo=!1;if(er)try{var da={};Object.defineProperty(da,"passive",{get:function(){Oo=!0}}),window.addEventListener("test",da,da),window.removeEventListener("test",da,da)}catch{Oo=!1}var wr=null,_i=null,Si=null;function zr(){if(Si)return Si;var e,t=_i,r=t.length,s,o="value"in wr?wr.value:wr.textContent,c=o.length;for(e=0;e=Y),ue=" ",fe=!1;function pe(e,t){switch(e){case"keyup":return R.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function De(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ie=!1;function Je(e,t){switch(e){case"compositionend":return De(t);case"keypress":return t.which!==32?null:(fe=!0,ue);case"textInput":return e=t.data,e===ue&&fe?null:e;default:return null}}function qe(e,t){if(Ie)return e==="compositionend"||!L&&pe(e,t)?(e=zr(),Si=_i=wr=null,Ie=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mg(e,t){var r=hg(e);e=0;for(var s;r;){if(r.nodeType===3){if(s=e+r.textContent.length,e<=t&&s>=t)return{node:r,offset:t-e};e=s}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hg(r)}}function pg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function gg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=vd(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=vd(e.document)}return t}function yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Nx=er&&"documentMode"in document&&11>=document.documentMode,ml=null,bd=null,ko=null,_d=!1;function vg(e,t,r){var s=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;_d||ml==null||ml!==vd(s)||(s=ml,"selectionStart"in s&&yd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ko&&bs(ko,s)||(ko=s,s=Jc(bd,"onSelect"),0>=h,o-=h,Tr=1<<32-Ot(t)+o|r<Re?(rn=Ee,Ee=null):rn=Ee.sibling;var Xe=C(U,Ee,$[Re],I);if(Xe===null){Ee===null&&(Ee=rn);break}e&&Ee&&Xe.alternate===null&&t(U,Ee),j=c(Xe,j,Re),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe,Ee=rn}if(Re===$.length)return r(U,Ee),Ve&&Wr(U,Re),ve;if(Ee===null){for(;Re<$.length;Re++)Ee=P(U,$[Re],I),Ee!==null&&(j=c(Ee,j,Re),Fe===null?ve=Ee:Fe.sibling=Ee,Fe=Ee);return Ve&&Wr(U,Re),ve}for(Ee=s(Ee);Re<$.length;Re++)rn=H(Ee,U,Re,$[Re],I),rn!==null&&(e&&(Xe=rn.alternate,Xe!==null&&Ee.delete(Xe.key===null?Re:Xe.key)),j=c(rn,j,Re),Fe===null?ve=rn:Fe.sibling=rn,Fe=rn);return e&&Ee.forEach(function(Vs){return t(U,Vs)}),Ve&&Wr(U,Re),ve}function _e(U,j,$,I){if($==null)throw Error(l(151));for(var ve=null,Fe=null,Ee=j,Re=j=0,rn=null,Xe=$.next();Ee!==null&&!Xe.done;Re++,Xe=$.next()){Ee.index>Re?(rn=Ee,Ee=null):rn=Ee.sibling;var Vs=C(U,Ee,Xe.value,I);if(Vs===null){Ee===null&&(Ee=rn);break}e&&Ee&&Vs.alternate===null&&t(U,Ee),j=c(Vs,j,Re),Fe===null?ve=Vs:Fe.sibling=Vs,Fe=Vs,Ee=rn}if(Xe.done)return r(U,Ee),Ve&&Wr(U,Re),ve;if(Ee===null){for(;!Xe.done;Re++,Xe=$.next())Xe=P(U,Xe.value,I),Xe!==null&&(j=c(Xe,j,Re),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe);return Ve&&Wr(U,Re),ve}for(Ee=s(Ee);!Xe.done;Re++,Xe=$.next())Xe=H(Ee,U,Re,Xe.value,I),Xe!==null&&(e&&(rn=Xe.alternate,rn!==null&&Ee.delete(rn.key===null?Re:rn.key)),j=c(Xe,j,Re),Fe===null?ve=Xe:Fe.sibling=Xe,Fe=Xe);return e&&Ee.forEach(function(bz){return t(U,bz)}),Ve&&Wr(U,Re),ve}function He(U,j,$,I){if(typeof $=="object"&&$!==null&&$.type===ne&&$.key===null&&$.props.ref===void 0&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case ye:e:{for(var ve=$.key;j!==null;){if(j.key===ve){if(ve=$.type,ve===ne){if(j.tag===7){r(U,j.sibling),I=o(j,$.props.children),zs(I,$),I.return=U,U=I;break e}}else if(j.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===Se&&Ma(ve)===j.type){r(U,j.sibling),I=o(j,$.props),zs(I,$),I.return=U,U=I;break e}r(U,j);break}else t(U,j);j=j.sibling}$.type===ne?(I=wa($.props.children,U.mode,I,$.key),zs(I,$),I.return=U,U=I):(I=nc($.type,$.key,$.props,null,U.mode,I),zs(I,$),I.return=U,U=I)}return h(U);case de:e:{for(ve=$.key;j!==null;){if(j.key===ve)if(j.tag===4&&j.stateNode.containerInfo===$.containerInfo&&j.stateNode.implementation===$.implementation){r(U,j.sibling),I=o(j,$.children||[]),I.return=U,U=I;break e}else{r(U,j);break}else t(U,j);j=j.sibling}I=Od($,U.mode,I),I.return=U,U=I}return h(U);case Se:return $=Ma($),He(U,j,$,I)}if(Ne($))return oe(U,j,$,I);if(ae($)){if(ve=ae($),typeof ve!="function")throw Error(l(150));return $=ve.call($),_e(U,j,$,I)}if(typeof $.then=="function")return He(U,j,dc($),I);if($.$$typeof===ce)return He(U,j,oc(U,$),I);hc(U,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,j!==null&&j.tag===6?(r(U,j.sibling),I=o(j,$),I.return=U,U=I):(r(U,j),I=Td($,U.mode,I),I.return=U,U=I),h(U)):r(U,j)}return function(U,j,$,I){try{Ho=0;var ve=He(U,j,$,I);return wl=null,ve}catch(Ee){if(Ee===xl||Ee===cc)throw Ee;var Fe=oi(29,Ee,null,U.mode);return Fe.lanes=I,Fe.return=U,Fe}}}var Ra=Bg(!0),qg=Bg(!1),Es=!1;function Zd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $d(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ts(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Os(e,t,r){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(it&2)!==0){var o=s.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),s.pending=t,t=tc(e),Eg(e,null,r),t}return ec(e,s,t,r),tc(e)}function Bo(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Qt(e,r)}}function Ld(e,t){var r=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,r===s)){var o=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var h={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};c===null?o=c=h:c=c.next=h,r=r.next}while(r!==null);c===null?o=c=t:c=c.next=t}else o=c=t;r={baseState:s.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:s.shared,callbacks:s.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Hd=!1;function qo(){if(Hd){var e=Sl;if(e!==null)throw e}}function Vo(e,t,r,s){Hd=!1;var o=e.updateQueue;Es=!1;var c=o.firstBaseUpdate,h=o.lastBaseUpdate,b=o.shared.pending;if(b!==null)DELIM" +R"DELIM(){o.shared.pending=null;var O=b,Z=O.next;O.next=null,h===null?c=Z:h.next=Z,h=O;var q=e.alternate;q!==null&&(q=q.updateQueue,b=q.lastBaseUpdate,b!==h&&(b===null?q.firstBaseUpdate=Z:b.next=Z,q.lastBaseUpdate=O))}if(c!==null){var P=o.baseState;h=0,q=Z=O=null,b=c;do{var C=b.lane&-536870913,H=C!==b.lane;if(H?(Pe&C)===C:(s&C)===C){C!==0&&C===Na&&(Hd=!0),q!==null&&(q=q.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var oe=e,_e=b;C=t;var He=r;switch(_e.tag){case 1:if(oe=_e.payload,typeof oe=="function"){P=oe.call(He,P,C);break e}P=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=_e.payload,C=typeof oe=="function"?oe.call(He,P,C):oe,C==null)break e;P=te({},P,C);break e;case 2:Es=!0}}C=b.callback,C!==null&&(e.flags|=64,H&&(e.flags|=8192),H=o.callbacks,H===null?o.callbacks=[C]:H.push(C))}else H={lane:C,tag:b.tag,payload:b.payload,callback:b.callback,next:null},q===null?(Z=q=H,O=P):q=q.next=H,h|=C;if(b=b.next,b===null){if(b=o.shared.pending,b===null)break;H=b,b=H.next,H.next=null,o.lastBaseUpdate=H,o.shared.pending=null}}while(!0);q===null&&(O=P),o.baseState=O,o.firstBaseUpdate=Z,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),ks|=h,e.lanes=h,e.memoizedState=P}}function Vg(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ig(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;ec?c:8;var h=me.T,b={};b.types=h!==null?h.types:null,me.T=b,ah(e,!1,t,r);try{var O=o(),Z=me.S;if(Z!==null&&Z(b,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var q=Lx(O,s);Yo(e,t,q,Ai(e))}else Yo(e,t,s,Ai(e))}catch(P){Yo(e,t,{then:function(){},status:"rejected",reason:P},Ai())}finally{Te.p=c,h!==null&&b.types!==null&&(h.types=b.types),me.T=h}}function Kx(){}function rh(e,t,r,s){if(e.tag!==5)throw Error(l(476));var o=xv(e).queue;Sv(e,o,t,Bt,r===null?Kx:function(){return wv(e),r(s)})}function xv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Bt,baseState:Bt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:Bt},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function wv(e){var t=xv(e);t.next===null&&(t=e.alternate.memoizedState),Yo(e,t.next.queue,{},Ai())}function sh(){return Nn(Kl)}function zv(){return Jt().memoizedState}function Ev(){return Jt().memoizedState}function Gx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=Ai();e=Ts(r);var s=Os(t,e,r);s!==null&&(di(s,t,r),Bo(s,t,r)),t={cache:Cd()},e.payload=t;return}t=t.return}}function Yx(e,t,r){var s=Ai();r={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},wc(e)?Ov(t,r):(r=zd(e,t,r,s),r!==null&&(di(r,e,s),Nv(r,t,s)))}function Tv(e,t,r){var s=Ai();Yo(e,t,r,s)}function Yo(e,t,r,s){var o={lane:s,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(wc(e))Ov(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,b=c(h,r);if(o.hasEagerState=!0,o.eagerState=b,ut(b,h))return ec(e,t,o,0),bt===null&&Wu(),!1}catch{}if(r=zd(e,t,o,s),r!==null)return di(r,e,s),Nv(r,t,s),!0}return!1}function ah(e,t,r,s){if(s={lane:2,revertLane:Qh(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},wc(e)){if(t)throw Error(l(479))}else t=zd(e,r,s,2),t!==null&&di(t,e,2)}function wc(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Ov(e,t){zl=gc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Nv(e,t,r){if((r&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,r|=s,t.lanes=r,Qt(e,r)}}var zc={readContext:Nn,use:bc,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It,useEffectEvent:It},Av={readContext:Nn,use:bc,useCallback:function(e,t){return Xn().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:dv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,Sc(4194308,4,gv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Sc(4194308,4,e,t)},useInsertionEffect:function(e,t){Sc(4,2,e,t)},useMemo:function(e,t){var r=Xn();t=t===void 0?null:t;var s=e();if(Ca){Et(!0);try{e()}finally{Et(!1)}}return r.memoizedState=[s,t],s},useReducer:function(e,t,r){var s=Xn();if(r!==void 0){var o=r(t);if(Ca){Et(!0);try{r(t)}finally{Et(!1)}}}else o=t;return s.memoizedState=s.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},s.queue=e,e=e.dispatch=Yx.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var t=Xn();return e={current:e},t.memoizedState=e},useState:function(e){e=Wd(e);var t=e.queue,r=Tv.bind(null,Le,t);retur)DELIM" +R"DELIM(n t.dispatch=r,[e.memoizedState,r]},useDebugValue:nh,useDeferredValue:function(e,t){var r=Xn();return ih(r,e,t)},useTransition:function(){var e=Wd(!1);return e=Sv.bind(null,Le,e.queue,!0,!1),Xn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var s=Le,o=Xn();if(Ve){if(r===void 0)throw Error(l(407));r=r()}else{if(r=t(),bt===null)throw Error(l(349));(Pe&127)!==0||Qg(s,t,r)}o.memoizedState=r;var c={value:r,getSnapshot:t};return o.queue=c,dv(Xg.bind(null,s,c,e),[e]),s.flags|=2048,Tl(9,{destroy:void 0},Jg.bind(null,s,c,r,t),null),r},useId:function(){var e=Xn(),t=bt.identifierPrefix;if(Ve){var r=Or,s=Tr;r=(s&~(1<<32-Ot(s)-1)).toString(32)+r,t="_"+t+"R_"+r,r=vc++,0<\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof s.is=="string"?h.createElement("select",{is:s.is}):h.createElement("select"),s.multiple?c.multiple=!0:s.size&&(c.size=s.size);break;default:c=typeof s.is=="string"?h.createElement(o,{is:s.is}):h.createElement(o)}}c[Nt]=t,c[yn]=s;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(Rn(c,o,s),o){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ss(t)}}return zt(t),t.subtreeFlags&=-33554433,bh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ss(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(l(166));if(e=qn.current,_l(t)){if(e=t.stateNode,r=t.memoizedProps,s=null,o=Sn,o!==null)switch(o.tag){case 27:case 5:s=o.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===r||s!==null&&s.suppressHydrationWarning===!0||Xy(e.nodeValue,r)),e||xs(t,!0)}else e=au(e).createTextNode(s),e[Nt]=t,t.stateNode=e}return zt(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(s=_l(t),r!==null){if(e===null){if(!s)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Nt]=t}else za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),e=!1}else r=Md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Ei(t),t):(Ei(t),null);if((t.flags&128)!==0)throw Error(l(558))}return zt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=_l(t),s!==null&&s.dehydrated!==null){if(e===null){if(!o)throw Error(l(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(l(317));o[Nt]=t}else za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;zt(t),o=!1}else o=Md(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Ei(t),t):(Ei(t),null)}return Ei(t),(t.flags&128)!==0?(t.lanes=r,t):(r=s!==null,e=e!==null&&e.memoizedState!==null,r&&(s=t.child,o=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(o=s.alternate.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==o&&(s.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),Mc(t,t.updateQueue),zt(t),null);case 4:return ke(),e===null&&em(t.stateNode.containerInfo),t.flags|=67108864,zt(t),null;case 10:return ts(t.type),zt(t),null;case 19:if(Id(t),s=t.memoizedState,s===null)return zt(t),null;if(o=(t.flags&128)!==0,c=s.rendering,c===null)if(o)Fo(s,!1);else{if(Kt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=pc(e),c!==null){for(t.flags|=128,Fo(s,!1),e=c.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Tg(r,e),r=r.sibling;return Io(t,Mn.current&1|2),Ve&&Wr(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Yt()>qc&&(t.flags|=128,o=!0,Fo(s,!1),t.lanes=4194304)}else{if(!o)if(e=pc(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Fo(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!c.alternate&&!Ve)return zt(t),null}else 2*Yt()-s.renderingStartTime>qc&&r!==536870912&&(t.flags|=128,o=!0,Fo(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(e=s.last,e!==null?e.sibling=c:t.child=c,s.last=c)}if(s.tail!==null){e=s.tail;e:{for(r=e;r!==null;){if(r.alternate!==null){r=!1;break e}r=r.sibling}r=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=Yt(),e.sibling=null,c=Mn.current,c=o?c&1|2:c&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!r||Ve?Io(t,c):(r=c,tt(An,t),tt(Mn,r),Bn===null&&(Bn=t)),Ve&&Wr(t,s.treeForkCount),e}return zt(t),null;case 22:case 23:return Ei(t),qd(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(r&536870912)!==0&&(t.flags&128)===0&&(zt(t),t.subtreeFlags&6&&(t.flags|=8192)):zt(t),r=t.updateQueue,r!==null&&Mc(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==r&&(t.flags|=2048),e!==null&&kt(Aa),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ts(en),zt(t),null;case 25:return null;case 30:return t.flags|=33554432,zt(t),null}throw Error(l(156,t.tag))}function ew(e,t){switch(Nd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ts(en),ke(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags)DELIM" +R"DELIM(=e&-65537|128,t):null;case 26:case 27:case 5:return nt(t),null;case 31:if(t.memoizedState!==null){if(Ei(t),t.alternate===null)throw Error(l(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ei(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Id(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return ts(t.type),null;case 22:case 23:return Ei(t),qd(),e!==null&&kt(Aa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ts(en),null;case 25:return null;default:return null}}function ey(e,t){switch(Nd(t),t.tag){case 3:ts(en),ke();break;case 26:case 27:case 5:nt(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Ei(t);break;case 13:Ei(t);break;case 19:Id(t);break;case 10:ts(t.type);break;case 22:case 23:Ei(t),qd(),e!==null&&kt(Aa);break;case 24:ts(en)}}function Qo(e,t){try{var r=t.updateQueue,s=r!==null?r.lastEffect:null;if(s!==null){var o=s.next;r=o;do{if((r.tag&e)===e){s=void 0;var c=r.create,h=r.inst;s=c(),h.destroy=s}r=r.next}while(r!==o)}}catch(b){ft(t,t.return,b)}}function js(e,t,r){try{var s=t.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var c=o.next;s=c;do{if((s.tag&e)===e){var h=s.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,o=t;var O=r,Z=b;try{Z()}catch(q){ft(o,O,q)}}}s=s.next}while(s!==c)}}catch(q){ft(t,t.return,q)}}function ty(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Ig(t,r)}catch(s){ft(e,e.return,s)}}}function ny(e,t,r){r.props=ka(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(s){ft(e,t,s)}}function Nr(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var o=e.stateNode,c=Qr(e.memoizedProps,o);(o.ref===null||o.ref.name!==c)&&(o.ref=u0(c)),s=o.ref;break;case 7:if(e.stateNode===null){var h=new Mi(e);y(e.child,!1,Iw,h,void 0,void 0),e.stateNode=h}s=e.stateNode;break;default:s=e.stateNode}typeof r=="function"?e.refCleanup=r(s):r.current=s}}catch(b){ft(e,t,b)}}function jn(e,t){var r=e.ref,s=e.refCleanup;if(r!==null)if(typeof s=="function")try{s()}catch(o){ft(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(o){ft(e,t,o)}else r.current=null}function jc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var r=0;r title"))),Rn(s,t,r),s[Nt]=e,Xt(s),t=s;break e;case"link":if(c=T0("link","href",o).get(t+(r.href||""))){for(h=0;hHe&&(h=He,He=_e,_e=h);var U=mg(b,_e),j=mg(b,He);if(U&&j&&(H.rangeCount!==1||H.anchorNode!==U.node||H.anchorOffset!==U.offset||H.focusNode!==j.node||H.focusOffset!==j.offset)){var $=P.createRange();$.setStart(U.node,U.offset),H.removeAllRanges(),_e>He?(H.addRange($),H.extend(j.node,j.offset)):($.setEnd(j.node,j.offset),H.addRange($))}}}}for(P=[],H=b;H=H.parentNode;)H.nodeType===1&&P.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;br?32:r,me.T=null,r=Hh,Hh=null;var c=ur,h=kr;if(Zt=0,$a=ur=null,kr=0,(it&6)!==0)throw Error(l(331));var b=it;if(it|=4,Ey(c.current),xy(c,c.current,h,r),it=b,iu(0,!1),Pt&&typeof Pt.onPostCommitFiberRoot=="function")try{Pt.onPostCommitFiberRoot(ta,c)}catch{}return!0}finally{Te.p=o,me.T=s,Hy(e,t)}}function By(e,t,r){t=Hi(r,t),t=uh(e.stateNode,t,2),e=Os(e,t,2),e!==null&&(ai(e,2),Dr(e))}function ft(e,t,r){if(e.tag===3)By(e,e,r);else for(;t!==null;){if(t.tag===3){By(t,e,r);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Ds===null||!Ds.has(s))){e=Hi(r,e),r=Zv(2),s=Os(t,r,2),s!==null&&($v(r,s,t,e),ai(s,2),Dr(s)))DELIM" +R"DELIM(;break}}t=t.return}}function Yh(e,t,r){var s=e.pingCache;if(s===null){s=e.pingCache=new rw;var o=new Set;s.set(t,o)}else o=s.get(t),o===void 0&&(o=new Set,s.set(t,o));o.has(r)||(Zh=!0,o.add(r),e=dw.bind(null,e,t,r),t.then(e,e))}function dw(e,t,r){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,bt===e&&(Pe&r)===r&&((Kt===4||Kt===3&&(Pe&62914560)===Pe&&300>Yt()-Bc)&&(it&2)===0?Zl(e,0):Hc|=r,Rl===Pe&&(Rl=0)),Dr(e)}function qy(e,t){t===0&&(t=ps()),e=xa(e,t),e!==null&&(ai(e,t),Dr(e))}function hw(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),qy(e,r)}function mw(e,t){var r=0;switch(e.tag){case 31:case 13:var s=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(l(314))}s!==null&&s.delete(t),qy(e,r)}function pw(e,t){return Kn(e,t)}var Ll=null,Hl=null,Ph=!1,Fc=!1,Fh=!1,Zs=0;function Dr(e){e!==Hl&&e.next===null&&(Hl===null?Ll=Hl=e:Hl=Hl.next=e),Fc=!0,Ph||(Ph=!0,vw())}function iu(e,t){if(!Fh&&Fc){Fh=!0;do for(var r=!1,s=Ll;s!==null;){if(e!==0){var o=s.pendingLanes;if(o===0)var c=0;else{var h=s.suspendedLanes,b=s.pingedLanes;c=(1<<31-Ot(42|e)+1)-1,c&=o&~(h&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(r=!0,Gy(s,c))}else c=Pe,c=nl(s,s===bt?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(c&3)===0||ia(s,c)||(r=!0,Gy(s,c));s=s.next}while(r);Fh=!1}}function gw(){Vy()}function Vy(){Fc=Ph=!1;var e=0;Zs!==0&&Nw()&&(e=Zs);for(var t=Yt(),r=null,s=Ll;s!==null;){var o=s.next,c=Iy(s,t);c===0?(s.next=null,r===null?Ll=o:r.next=o,o===null&&(Hl=r)):(r=s,(e!==0||(c&3)!==0)&&(Fc=!0)),s=o}Zt!==0&&Zt!==5||iu(e),Zs!==0&&(Zs=0)}function Iy(e,t){for(var r=e.suspendedLanes,s=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0b)break;var q=O.transferSize,P=O.initiatorType;q&&Wy(P)&&(O=O.responseEnd,h+=q*(Oef){_e.length=oe;break}$=new Promise(kw.bind($)),_e.push($)}}}if(0<_e.length)return C=Promise.race([Promise.all(_e),new Promise(function(ve){return setTimeout(ve,500)})]).then(o,o),(H?Promise.allSettled([H.finished,C]):C).then(c,c);if(o(),H)return H.finished.then(c,c);c()},types:r});Z.__reactViewTransition=q;var P=[];return q.ready.then(function(){for(var C=Z.documentElement.getAnimations({subtree:!0}),H=0;H"u"?null:document;function x0(e,t,r){var s=ql;if(s&&typeof t=="string"&&t){var o=Pn(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof r=="string"&&(o+='[crossorigin="'+r+'"]'),S0.has(o)||(S0.add(o),e={rel:e,crossOrigin:r,href:t},s.querySelector(o)===null&&(t=s.createElement("link"),Rn(t,"link",e),Xt(t),s.head.appendChild(t)))}}function Ww(e){ls.D(e),x0("dns-prefetch",e,null)}function ez(e,t){ls.C(e,t),x0("preconnect",e,t)}function tz(e,t,r){ls.L(e,t,r);var s=ql;if(s&&e&&t){var o='link[rel="preload"][as="'+Pn(t)+'"]';t==="image"&&r&&r.imageSrcSet?(o+='[imagesrcset="'+Pn(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(o+='[imagesizes="'+Pn(r.imageSizes)+'"]')):o+='[href="'+Pn(e)+'"]';var c=o;switch(t){case"style":c=Vl(e);break;case"script":c=Il(e)}if(!(Gi.has(c)||(e=te({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),Gi.set(c,e),s.querySelector(o)!==null||t==="style"&&s.querySelector(ou(c))||t==="script"&&s.querySelector(uu(c))))){var h=s.createElement("link");Rn(h,"link",e),t==="style"&&(h[un]=!0,h.onload=h.onerror=function(){Hu(h)}),Xt(h),s.head.appendChild(h)}}}function nz(e,t){ls.m(e,t);var r=ql;if(r&&e){var s=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+Pn(s)+'"][href="'+Pn(e)+'"]',c=o;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Il(e)}if(!Gi.has(c)&&(e=te({rel:"modulepreload",href:e},t),Gi.set(c,e),r.querySelector(o)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(uu(c)))return}s=r.createElement("link"),Rn(s,"link",e),Xt(s),r.head.appendChild(s)}}}function iz(e,t,r){ls.S(e,t,r);var s=ql;if(s&&e){var o=vs(s).hoistableStyles,c=Vl(e);t=t||"default";var h=o.get(c);if(!h){var b={loading:0,preload:null};if(h=s.querySelector(ou(c)))b.loading=5;else{e=te({rel:"stylesheet",href:e,"data-precedence":t},r),(r=Gi.get(c))&&gm(e,r);var O=h=s.createElement("link");Xt(O),Rn(O,"link",e),O._p=new Promise(function(Z,q){O.onload=Z,O.onerror=q}),O.addEventListener("load",function(){b.loading|=1}),O.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Xc(h,t,s)}h={type:"stylesheet",instance:h,count:1,state:b},o.set(c,h)}}}function rz(e,t){ls.X(e,t);var r=ql;if(r&&e){var s=vs(r).hoistableScripts,o=Il(e),c=s.get(o);c||(c=r.querySelector(uu(o)),c||(e=te({src:e,async:!0},t),(t=Gi.get(o))&&vm(e,t),c=r.createElement("script"),Xt(c),Rn(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function sz(e,t){ls.M(e,t);var r=ql;if(r&&e){var s=vs(r).hoistableScripts,o=Il(e),c=s.get(o);c||(c=r.querySelector(uu(o)),c||(e=te({src:e,async:!0,type:"module"},t),(t=Gi.get(o))&&vm(e,t),c=r.createElement("script"),Xt(c),Rn(c,"link",e),r.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},s.set(o,c))}}function w0(e,t,r,s){var o=(o=qn.current)?lu(o):null;if(!o)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(r=Vl(r.href),t=vs(o).hoistableStyles,s=t.get(r),s||(s={type:"style",instance:null,count:0,state:null},t.set(r,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Vl(r.href);var c=vs(o).hoistableStyles,h=c.get(e);if(h||(o=o.ownerDocument||o,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=o.querySelector(ou(e)))?c._p||(h.instance=c,h.state.loading=5):(c=Gi.get(e),c||(c={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Gi.set(e,c)),az(o,e,c,h.state))),t&&s===null)throw Error(l(528,""));return h}if(t&&s!==null)throw Error(l(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(r=Il(r),t=vs(o).hoistableScripts,s=t.get(r),s||(s={type:"script",instance:null,count:0,state:null},t.set(r,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Vl(e){return'href="'+Pn(e)+'"'}function ou(e){return'link[rel="stylesheet"]['+e+"]"}function z0(e){return te({},e,{"data-precedence":e.precedence,precedence:null})}function az(e,t,r,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[un]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[un]=!0,t.onload=t.onerror=Hu.bind(null,t),Rn(t,"link",r),Xt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function Il(e){return'[src="'+Pn(e)+'"]'}function uu(e){return"script[async]"+e}function E0(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Pn(r.href)+'"]');if(s)return t.instance=s,Xt(s),s;var o=te({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Xt(s),Rn(s,"style",o),Xc(s,r.precedence,e),t.instance=s;case"stylesheet":o=Vl(r.href);var c=e.querySelector(ou(o));if(c)return t.state.loading|=4,t.instance=c,Xt(c),c;s=z0(r),(o=Gi.get(o))&&gm(s,o),c=(e.ownerDocument||e).createElement("link"),Xt(c);var h=c;return h._p=new Promise(function(b,O){h.onload=b,h.onerror=O}),Rn(c,"link",s),t.state.loading|=4,Xc(c,r.precedence,e),t.instance=c;case"script":return c=Il(r.src),(o=e.querySelector(uu(c)))?(t.instance=o,Xt(o),o):(s=r,(o=Gi.get(c))&&(s=te({},r),vm(s,o)),e=e.ownerDocument||e,o=e.createElement("script"),Xt(o),Rn(o,"link",s),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Xc(s,r.precedence,e));return t.instance}function Xc(e,t,r){for(var s=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=s.length?s[s.length-1]:null,c=o,h=0;h title"):null)}function lz(e,t,r){if(r===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function O0(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function N0(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A0(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function M0(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=A0(t),e.suspenseyImages.push(t)),e=cz.bind(e),t.decode().then(e,e))}function oz(e,t,r,s){if(r.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var o=Vl(s.href),c=t.querySelector(ou(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=cu.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=c,Xt(c);return}c=t.ownerDocument||t,s=z0(s),(o=Gi.get(o))&&gm(s,o),c=c.createElement("link"),Xt(c);var h=c;h._p=new Promise(function(b,O){h.onload=b,h.onerror=O}),Rn(c,"link",s),r.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=cu.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var ef=0;function uz(e,t){return e.stylesheets&&e.count===0&&nf(e,e.stylesheets),0ef?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(o)}}:null}function j0(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)nf(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function cu(){this.count--,j0(this)}function cz(){this.imgCount--,j0(this)}var tf=null;function nf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tf=new Map,t.forEach(fz,e),tf=null,cu.call(e))}function fz(e,t){if(!(t.state.loading&4)){var r=tf.get(e);if(r)var s=r.get(null);else{r=new Map,tf.set(e,r);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(i){console.error(i)}}return n(),Om.exports=Nz(),Om.exports}var Mz=Az();const jz=J_(Mz),X_="libbitcoinAdminDashboardBrowserNotifications";function W_(){try{return globalThis.window?.localStorage??null}catch{return null}}function wp(){const n=globalThis.Notification;return typeof n=="function"?n:null}function e1(){return wp()?.permission??"unsupported"}async function Rz(){const n=wp();return n?n.permission!=="default"?n.permission:n.requestPermission():"unsupported"}function Cz(n=W_()){try{return e1()==="granted"&&n?.getItem(X_)==="true"}catch{return!1}}function kz(n,i=W_()){try{i?.setItem(X_,String(n))}catch{}}function Dz(n,i){const a=wp();if(!a||a.permission!=="granted")return!1;try{return new a(n,i),!0}catch{return!1}}const zp="libbitcoinAdminDashboardEndpoints";function Ep(){try{return globalThis.window?.localStorage??null}catch{return null}}function Tp(){return globalThis.window?.location.origin??"http://localhost"}function Uz(){const n=new URL(Tp());return n.port="",n.pathname="/",n.search="",n.hash="",n.origin}function $r(n){const i=n.trim();if(!i)throw new Error("Endpoint URL is required");const a=/^[a-z][a-z\d+\-.]*:\/\//iu.test(i)?i:`http://${i}`,l=new URL(a);if(l.protocol!=="http:"&&l.protocol!=="https:")throw new Error("Endpoint must use HTTP or HTTPS");return l.pathname=l.pathname.replace(/\/+$)DELIM" +R"DELIM(/u,"")||"/",l.search="",l.hash="",l.toString().replace(/\/$/u,"")}function Zz(n){const i=new URL($r(n));return i.protocol=i.protocol==="https:"?"wss:":"ws:",i.pathname="/",i.search="",i.hash="",i.toString()}function $z(n,i=Tp()){return new URL($r(n)).origin===new URL(i).origin}function t1(){return{adminUrl:$r(Tp()),nativeUrl:$r(Uz())}}function Lz(n=Ep()){const i=t1();try{const a=n?.getItem(zp);if(!a)return i;const l=JSON.parse(a);if(!l||typeof l!="object"||Array.isArray(l))return i;const u=l;return{adminUrl:typeof u.adminUrl=="string"?$r(u.adminUrl):i.adminUrl,nativeUrl:typeof u.nativeUrl=="string"?$r(u.nativeUrl):i.nativeUrl}}catch{return i}}function Hz(n,i=Ep()){const a={adminUrl:$r(n.adminUrl),nativeUrl:$r(n.nativeUrl)};try{i?.setItem(zp,JSON.stringify(a))}catch{}}function Bz(n=Ep()){try{n?.removeItem(zp)}catch{}}function qz({configuration:n,browserNotificationsEnabled:i,onClose:a,onBrowserNotificationsEnabledChange:l,onReset:u,onSave:f}){const[d,m]=se.useState(n.adminUrl),[p,g]=se.useState(n.nativeUrl),[x,y]=se.useState(null),[w,N]=se.useState(e1),[E,A]=se.useState(!1),[k,B]=se.useState(null),D=i&&w==="granted";async function ie(){if(D){l(!1);return}A(!0),B(null);try{const G=await Rz();N(G),G==="granted"?l(!0):G==="denied"&&B("Permission was denied. It can be changed in your browser settings.")}catch{B("The browser could not enable notifications.")}finally{A(!1)}}function K(G){G.preventDefault();try{f({adminUrl:$r(d),nativeUrl:$r(p)})}catch(F){y(F instanceof Error?F.message:"Invalid endpoint configuration")}}return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:G=>{G.target===G.currentTarget&&a()},children:S.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"endpoint-settings-title",className:"border-accent/30 bg-surface/95 max-h-[calc(100vh-2rem)] w-full max-w-xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/50",children:[S.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Runtime configuration"}),S.jsx("h2",{id:"endpoint-settings-title",className:"text-accent mt-1 text-xl font-semibold",children:"Node endpoints"})]}),S.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close endpoint settings",children:"×"})]}),S.jsxs("form",{onSubmit:K,className:"space-y-5 p-5",children:[S.jsxs("label",{className:"block space-y-2",children:[S.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Admin endpoint"}),S.jsx("input",{value:d,onChange:G=>{m(G.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:admin-port",autoComplete:"url"})]}),S.jsxs("label",{className:"block space-y-2",children:[S.jsx("span",{className:"text-textPrimary text-sm font-medium",children:"Native endpoint"}),S.jsx("input",{value:p,onChange:G=>{g(G.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 font-mono text-sm focus:ring-0",placeholder:"http://node-host:native-port",autoComplete:"url"})]}),S.jsxs("div",{className:"border-accentSecondary/20 bg-accent/5 space-y-3 rounded-xl border p-4",children:[S.jsxs("div",{children:[S.jsx("h3",{className:"text-textPrimary text-sm font-medium",children:"Browser notifications"}),S.jsx("p",{id:"browser-notifications-help",className:"text-textMuted mt-1 text-xs",children:Iz(w,D,E)})]}),S.jsx("button",{type:"button","aria-describedby":"browser-notifications-help",disabled:E||w==="unsupported"||w==="denied",onClick:()=>{ie()},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",children:Vz(w,D,E)}),k&&S.jsx("p",{className:"text-sm text-red-300",role:"alert",children:k})]}),x&&S.jsx("p",{className:"rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2 text-sm text-red-300",children:x}),S.jsxs("div",{className:"flex flex-wrap justify-between gap-3 pt-2",children:[S.jsx("button",{type:"button",onClick:u,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-4 py-2 text-sm",children:"Reset defaults"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded-md px-4 py-2 text-sm",children:"Cancel"}),S.jsx("button",{type:"submit",className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Save endpoints"})]})]})]})]})})}function Vz(n,i,a){return a?"Requesting permission…":n==="unsupported"?"Notifications unavailable":n==="denied"?"Blocked by browser":i?"Disable notifications":"Enable notifications"}function Iz(n,i,a){return a?"Waiting for your browser permission choice.":n==="unsupported"?"This browser does not support system notifications.":n==="denied"?"Notifications are blocked. Allow them in your browser settings to enable this feature.":i?"System notifications will appear when the node enters or leaves the near-current range.":"Get a system notification when the node enters or leaves the near-current range."}function Ym(n){const i=Object.values(n).filter(l=>typeof l=="number");return Object.entries(n).filter(([l,u])=>i.indexOf(+l)===-1).map(([l,u])=>u)}function tb(n,i="|"){return n.map(a=>l1(a)).join(i)}function Pm(n,i){return typeof i=="bigint"?i.toString():i}class Kz{constructor(i){this._getter=i,this._value=void 0}get value(){const i=this._getter;return i!==void 0&&(this._value=i(),this._getter=void 0),this._value}}function Op(n){return new Kz(n)}function Gz(n){return n==null}function Np(n){const i=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;return n.slice(i,a)}function Yz(n,i){const a=n/i,l=Math.round(a),u=4*Number.EPSILON*Math.max(Math.abs(a),1);return Math.abs(a-l){const m=i._zod.def.shape[f];return l?l(m,f):m}):r1(n,f,l?l(d.value,f):d.value))}}function Pz(n,i){for(const a of Reflect.ownKeys(i)){const l=Object.getOwnPropertyDescriptor(i,a);l.enumerable&&(l.get?i1(n,a,()=>i[a]):r1(n,a,l.value))}}function Ri(...n){const i={};for(const a of n){const l=Object.getOwnPropertyDescriptors(a);Object.assign(i,l)}return Object.defineProperties({},i)}function Fz(n){return JSON.stringify(n)}function Qz(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const s1="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Nf(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const Jz=Op(()=>{if(gr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const n=Function;return new n(""),!0}catch{return!1}});function ju(n){if(Nf(n)===!1)return!1;const i=n.constructor;if(i===void 0||typeof i!="function")return!0;const a=i.prototype;return!(Nf(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function a1(n){return ju(n)?{...n}:Array.isArray(n)?[...n]:n instanceof Map?new Map(n):n instanceof Set?new Set(n):n}const Xz=new Set(["string","number","symbol"]);function no(n)DELIM" +R"DELIM(){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Js(n,i,a){const l=new n._zod.constr(i??n._zod.def);return(!i||a?.parent)&&(l._zod.parent=n),l}function Oe(n){const i=n;if(!i)return{};if(typeof i=="string")return{error:()=>i};if(i?.message!==void 0){if(i?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");i.error=i.message}return delete i.message,typeof i.error=="string"?{...i,error:()=>i.error}:i}function l1(n){return typeof n=="bigint"?n.toString()+"n":typeof n=="string"?`"${n}"`:`${n}`}function Wz(n){return Object.keys(n).filter(i=>n[i]._zod.optin!==void 0&&n[i]._zod.optout==="optional")}const o1={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]},eE={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function tE(n,i){const a=n._zod.def,l=a.checks;if(l&&l.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const f={};return Pa(f,n,If(n,i)),Js(n,Ri(a,{shape:f,checks:[]}))}function If(n,i){const a=fs(n),l=[];for(const u of Reflect.ownKeys(i)){if(!Object.getOwnPropertyDescriptor(a,u)?.enumerable)throw new Error(`Unrecognized key: "${String(u)}"`);i[u]&&l.push(u)}return l}function nE(n,i){const a=n._zod.def,l=a.checks;if(l&&l.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const f=new Set(If(n,i)),d={};return Pa(d,n,Reflect.ownKeys(fs(n)).filter(m=>!f.has(m))),Js(n,Ri(a,{shape:d,checks:[]}))}function iE(n,i){if(!ju(i))throw new Error("Invalid input to extend: expected a plain object");const a=n._zod.def.checks;if(a&&a.length>0){const u=fs(n);for(const f of Reflect.ownKeys(i))if(Object.getOwnPropertyDescriptor(u,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Js(n,Ri(n._zod.def,{shape:u1(n,i)}))}function u1(n,i){const a={};return Pa(a,n,Reflect.ownKeys(fs(n))),Pz(a,i),a}function rE(n,i){if(!ju(i))throw new Error("Invalid input to safeExtend: expected a plain object");return Js(n,Ri(n._zod.def,{shape:u1(n,i)}))}function sE(n,i){if(!i?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(n._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const a={};Pa(a,n,Reflect.ownKeys(fs(n))),Pa(a,i,Reflect.ownKeys(fs(i)));const l=Ri(n._zod.def,{shape:a,get catchall(){return i._zod.def.catchall},checks:i._zod.def.checks??[]});return Js(n,l)}function nb(n,i,a,l="partial"){const f=i._zod.def.checks;if(f&&f.length>0)throw new Error(`.${l}() cannot be used on object schemas containing refinements`);const m=a?new Set(If(i,a)):void 0,p={};return Pa(p,i,Reflect.ownKeys(fs(i)),n&&((g,x)=>m&&!m.has(x)?g:new n({type:"optional",innerType:g}))),Js(i,Ri(i._zod.def,{shape:p,checks:[]}))}function aE(n,i,a){const l=a?new Set(If(i,a)):void 0,u={};return Pa(u,i,Reflect.ownKeys(fs(i)),(f,d)=>l&&!l.has(d)?f:new n({type:"nonoptional",innerType:f})),Js(i,Ri(i._zod.def,{shape:u}))}function mr(n,i=0){if(n.aborted===!0)return!0;for(let a=i;a{var l;return(l=a).path??(l.path=[]),a.path.unshift(n),a})}function gu(n){return typeof n=="string"?n:n?.message}function ib(n){const i=[];for(const a of n??[]){const l=a._zod.def;if(!/_(length|size)$|_equals$/.test(l.check))break;const u=l.maximum??l.length??l.size;u>=0&&i.push([u,a])}return i}function Fm(n,i,a){var l;for(let u=i;un;return i[pE]=!0,i}var rb;const Rm={value:void 0,enumerable:!1};let sb="captureStackTrace"in Error?Error:null;function vE(n){const i=sb;if(i){const a=i.stackTraceLimit;if(typeof a=="number"){try{i.stackTraceLimit=0}catch{return sb=null,new n}try{return new n}finally{i.stackTraceLimit=a}}}return new n}function Q(n,i,a,l){const u={};function f(w){this.def=w,this.constr=y,this.traits=new Set}f.prototype=u;const d=a,m=d&&new WeakSet;function p(w,N){if(w._zod){if(w._zod.traits.has(n))return}else{Rm.value=new f(N);try{Object.defineProperty(w,"_zod",Rm)}finally{Rm.value=void 0}}if(w._zod.traits.add(n),i(w,N),m){const A=Object.getPrototypeOf(w),k=w._zod.constr.prototype;let B=A;for(;B&&B!==k;)B=Object.getPrototypeOf(B);const D=B??A;m.has(D)||(m.add(D),cE(D,d))}const E=y.prototype;for(const A in E)Object.prototype.hasOwnProperty.call(E,A)&&(A in w||(w[A]=E[A].bind(w)))}const g=l?.Parent??Object;class x extends g{}Object.defineProperty(x,"name",{value:n});function y(w){const N=l?.Parent?vE(x):this;p(N,w);const E=N._zod.deferred;if(E){for(const k of E)k();N._zod.deferred=void 0}const A=globalThis.__zod_globalConfig?.postProcessor;return A&&A(N),N}return Object.defineProperty(y,"init",{value:p}),Object.defineProperty(y,Symbol.has)DELIM" +R"DELIM(Instance,{value:w=>l?.Parent&&w instanceof l.Parent?!0:w?._zod?.traits?.has(n)}),Object.defineProperty(y,"name",{value:n}),y}class Ga extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class d1 extends Error{constructor(i){super(`Encountered unidirectional transform during encode: ${i}`),this.name="ZodEncodeError"}}(rb=globalThis).__zod_globalConfig??(rb.__zod_globalConfig={});const gr=globalThis.__zod_globalConfig;function Xs(n){return n&&Object.assign(gr,n),gr}function yE(){const n=this._zod;return n.message??(n.message=JSON.stringify(n.def,Pm,2)),n.message}function bE(n){this._zod.message=n}const _E={get:yE,set:bE,enumerable:!0,configurable:!0},Cm={value:void 0,enumerable:!1},ab=new WeakSet([Object.prototype,Error.prototype]),SE=(n,i)=>{n.name="$ZodError",Cm.value=i,Object.defineProperty(n,"issues",Cm),Cm.value=void 0,Object.defineProperty(n,"message",_E);const a=Object.getPrototypeOf(n);ab.has(a)||(ab.add(a),Object.defineProperty(a,"toString",{configurable:!0,enumerable:!1,get(){const l=()=>this.message;return Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,"toString",{value:l,configurable:!0,writable:!0})}}))},xE=Q("$ZodError",SE);function wE(n,i,a){return Object.prototype.hasOwnProperty.call(n,i)||(i==="__proto__"?Object.defineProperty(n,i,{value:a(),writable:!0,enumerable:!0,configurable:!0}):n[i]=a()),n[i]}function zE(n,i=a=>a.message){const a={},l=[];for(const u of n.issues)u.path.length>0?wE(a,u.path[0],()=>[]).push(i(u)):l.push(i(u));return{formErrors:l,fieldErrors:a}}function EE(n,i=a=>a.message){const a={_errors:[]},l=(u,f=[])=>{for(const d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(m=>l({issues:m},[...f,...d.path]));else if(d.code==="invalid_key")l({issues:d.issues},[...f,...d.path]);else if(d.code==="invalid_element")l({issues:d.issues},[...f,...d.path]);else{const m=[...f,...d.path];if(m.length===0)a._errors.push(i(d));else{let p=a,g=0;for(;g{const i=(a,l,u,f)=>{const d=u?{...u,async:!1}:{async:!1},m=a._zod.run({value:l,issues:[]},d);if(m instanceof Promise)throw new Ga;if(m.issues.length){const p=new(f?.Err??n)(m.issues.map(g=>co(g,d,Xs())));throw s1(p,f?.callee??i),p}return m.value};return i},Rp=n=>{const i=async(a,l,u,f)=>{const d=u?{...u,async:!0}:{async:!0};let m=a._zod.run({value:l,issues:[]},d);if(m instanceof Promise&&(m=await m),m.issues.length){const p=new(f?.Err??n)(m.issues.map(g=>co(g,d,Xs())));throw s1(p,f?.callee??i),p}return m.value};return i},Cp=n=>(i,a,l)=>{const u=l?{...l,async:!1}:{async:!1},f=i._zod.run({value:a,issues:[]},u);if(f instanceof Promise)throw new Ga;return f.issues.length?h1(n,f.issues,u):{success:!0,data:f.value}};function h1(n,i,a){let l;return{success:!1,get error(){return l||(l=new n(i.map(u=>co(u,a,Xs()))),i=void 0,a=void 0),l},set error(u){l=u,i=void 0,a=void 0}}}const kp=n=>async(i,a,l)=>{const u=l?{...l,async:!0}:{async:!0};let f=i._zod.run({value:a,issues:[]},u);return f instanceof Promise&&(f=await f),f.issues.length?h1(n,f.issues,u):{success:!0,data:f.value}},TE=Symbol.for("zod.compile.invalid"),OE=Symbol.for("zod.compile.fallback"),NE=((n,i,a)=>{const l=n._zod.bag.validator;if(l!==void 0){if(l(i)!==TE)return!0;if(l.definite===!0&&a===void 0)return!1}return AE(n,i,a)});function AE(n,i,a){const l=a?{...a,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},u=n._zod.bag.fallbackRun;let f;if(u?(l[OE]=!0,f=u({value:i,issues:[]},l)):f=n._zod.run({value:i,issues:[]},l),f instanceof Promise)throw new Ga;return f.issues.length===0}const ME=async(n,i,a)=>{const l=a?{...a,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let u=n._zod.run({value:i,issues:[]},l);return u instanceof Promise&&(u=await u),u.issues.length===0},jE=n=>{const i=jp(n),a=(l,u,f,d)=>{const m=f?{...f,direction:"backward"}:{direction:"backward"};return i(l,u,m,Gf(a,d))};return a},RE=n=>{const i=jp(n),a=(l,u,f,d)=>i(l,u,f,Gf(a,d));return a},CE=n=>{const i=Rp(n),a=async(l,u,f,d)=>{const m=f?{...f,direction:"backward"}:{direction:"backward"};return await i(l,u,m,Gf(a,d))};return a},kE=n=>{const i=Rp(n),a=async(l,u,f,d)=>await i(l,u,f,Gf(a,d));return a},DE=n=>(i,a,l)=>{const u=l?{...l,direction:"backward"}:{direction:"backward"};return Cp(n)(i,a,u)},UE=n=>(i,a,l)=>Cp(n)(i,a,l),ZE=n=>async(i,a,l)=>{const u=l?{...l,direction:"backward"}:{direction:"backward"};return kp(n)(i,a,u)},$E=n=>async(i,a,l)=>kp(n)(i,a,l),LE=/^[cC][0-9a-z]{6,}$/,HE=/^[0-9a-z]+$/,BE=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,qE=/^[0-9a-vA-V]{20}$/,VE=/^[A-Za-z0-9]{27}$/,IE=/^[a-zA-Z0-9_-]{21}$/;function KE(n){return new RegExp(`^[a-zA-Z0-9_-]{${n}}$`)}const GE=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,YE=/^([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})$/,lb=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[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)$/,PE=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,FE="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function QE(){return new RegExp(FE,"u")}const JE=/^(?:(?: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])$/,XE=/^(([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}|:))$/,WE=/^((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])$/,eT=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tT=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nT=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,iT=/^https?$/,rT=/^\+[1-9]\d{6,14}$/,m1="(?:(?:\\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])))";function sT(n){return new RegExp(`^${n}$`)}const aT=sT(m1);function Qm(n){const i="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${i}`:n.precision===0?`${i}:[0-5]\\d`:`${i}:[0-5]\\d\\.\\d{${n.precision}}`:n.seconds?`${i}:[0-5]\\d(?:\\.\\d+)?`:`${i}(?::[0-5]\\d(?:\\.\\d+)?)?`}function lT(n){return new RegExp(`^${Qm(n)}$`)}function oT(n){const i=["Z"];n.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${Qm({precision:n.precision,seconds:!0})}(?:${i.join("|")})`,l=n.local?`${a}|${Qm({precision:n.precision})}`:a;return new RegExp(`^${m1}T(?:${l})$`)}const uT=/^[\s\S]{0,}$/,cT=/^-?\d+(?:\.\d+)?$/,fT=/^(?:true|false)$/i,dT=/^[^A-Z]*$/,hT=/^[^a-z]*$/,pi=Q("$ZodCheck",(n,i)=>{var a;n._zod??(n._zod={}),n._z)DELIM" +R"DELIM(od.def=i,(a=n._zod).onattach??(a.onattach=[])}),Dp=n=>{const i=n.value;return!Gz(i)&&i.length!==void 0},Af={number:"number",bigint:"bigint",object:"date"},p1=Q("$ZodCheckLessThan",(n,i)=>{pi.init(n,i);const a=Af[typeof i.value];n._zod.check=l=>{(i.inclusive?l.value<=i.value:l.value{pi.init(n,i);const a=Af[typeof i.value];n._zod.check=l=>{(i.inclusive?l.value>=i.value:l.value>i.value)||l.issues.push({origin:Af[typeof l.value]??a,code:"too_small",minimum:typeof i.value=="object"?i.value.getTime():i.value,input:l.value,inclusive:i.inclusive,inst:n,continue:!i.abort})}}),mT=Q("$ZodCheckMultipleOf",(n,i)=>{pi.init(n,i),n._zod.check=a=>{if(typeof a.value!=typeof i.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?i.value!==BigInt(0)&&a.value%i.value===BigInt(0):Yz(a.value,i.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:i.value,input:a.value,inst:n,continue:!i.abort})}}),pT=Q("$ZodCheckNumberFormat",(n,i)=>{pi.init(n,i),i.format=i.format||"float64";const a=i.format?.includes("int"),l=a?"int":"number",[u,f]=o1[i.format];n._zod.check=d=>{const m=d.value;if(a){if(!Number.isInteger(m)){d.issues.push({expected:l,format:i.format,code:"invalid_type",continue:!1,input:m,inst:n});return}if(!Number.isSafeInteger(m)){m>0?d.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:l,inclusive:!0,continue:!i.abort}):d.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:l,inclusive:!0,continue:!i.abort});return}}mf&&d.issues.push({origin:"number",input:m,code:"too_big",maximum:f,inclusive:!0,inst:n,continue:!i.abort})}}),gT=Q("$ZodCheckMaxLength",(n,i)=>{var a;pi.init(n,i),(a=n._zod.def).when??(a.when=Dp),n._zod.check=l=>{const u=l.value,f=u.length;if((typeof u=="string"&&f>i.maximum?Ap(u):f)<=i.maximum)return;const m=Mp(u);l.issues.push({origin:m,code:"too_big",maximum:i.maximum,inclusive:!0,input:u,inst:n,continue:!i.abort})}}),vT=Q("$ZodCheckMinLength",(n,i)=>{var a;pi.init(n,i),(a=n._zod.def).when??(a.when=Dp),n._zod.check=l=>{const u=l.value,f=u.length;if((typeof u=="string"&&f>=i.minimum&&f=i.minimum)return;const m=Mp(u);l.issues.push({origin:m,code:"too_small",minimum:i.minimum,inclusive:!0,input:u,inst:n,continue:!i.abort})}}),yT=Q("$ZodCheckLengthEquals",(n,i)=>{var a;pi.init(n,i),(a=n._zod.def).when??(a.when=Dp),n._zod.check=l=>{const u=l.value,f=u.length,d=typeof u=="string"&&f>=i.length&&f<=i.length*2?Ap(u):f;if(d===i.length)return;const m=Mp(u),p=d>i.length;l.issues.push({origin:m,...p?{code:"too_big",maximum:i.length}:{code:"too_small",minimum:i.length},inclusive:!0,exact:!0,input:l.value,inst:n,continue:!i.abort})}}),Yf=Q("$ZodCheckStringFormat",(n,i)=>{var a,l;pi.init(n,i),i.pattern?(a=n._zod).check??(a.check=u=>{i.pattern.lastIndex=0,!i.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:i.format,input:u.value,...i.pattern?{pattern:i.pattern.toString()}:{},inst:n,continue:!i.abort})}):(l=n._zod).check??(l.check=()=>{})}),bT=Q("$ZodCheckRegex",(n,i)=>{Yf.init(n,i),n._zod.check=a=>{i.pattern.lastIndex=0,!i.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:i.pattern.toString(),inst:n,continue:!i.abort})}}),_T=Q("$ZodCheckLowerCase",(n,i)=>{i.pattern??(i.pattern=dT),Yf.init(n,i)}),ST=Q("$ZodCheckUpperCase",(n,i)=>{i.pattern??(i.pattern=hT),Yf.init(n,i)}),xT=Q("$ZodCheckIncludes",(n,i)=>{pi.init(n,i);const a=no(i.includes),l=new RegExp(typeof i.position=="number"?`^.{${i.position},}${a}`:a);i.pattern=l,n._zod.check=u=>{u.value.includes(i.includes,i.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:i.includes,input:u.value,inst:n,continue:!i.abort})}}),wT=Q("$ZodCheckStartsWith",(n,i)=>{pi.init(n,i);const a=new RegExp(`^${no(i.prefix)}.*`);i.pattern??(i.pattern=a),n._zod.check=l=>{l.value.startsWith(i.prefix)||l.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:i.prefix,input:l.value,inst:n,continue:!i.abort})}}),zT=Q("$ZodCheckEndsWith",(n,i)=>{pi.init(n,i);const a=new RegExp(`.*${no(i.suffix)}$`);i.pattern??(i.pattern=a),n._zod.check=l=>{l.value.endsWith(i.suffix)||l.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:i.suffix,input:l.value,inst:n,continue:!i.abort})}}),ET=Q("$ZodCheckOverwrite",(n,i)=>{pi.init(n,i),n._zod.check=a=>{a.value=i.tx(a.value)}});class TT{constructor(i=[],a={}){this.content=[],this.indent=0,this.args=i,this.closed=a}indented(i){this.indent+=1;try{i(this)}finally{this.indent-=1}}write(i){if(typeof i=="function"){i(this,{execution:"sync"}),i(this,{execution:"async"});return}const l=i.split(` +`).filter(d=>d),u=Math.min(...l.map(d=>d.length-d.trimStart().length)),f=l.map(d=>d.slice(u)).map(d=>" ".repeat(this.indent*2)+d);for(const d of f)this.content.push(d)}compile(){const i=Function,a=this?.content??[""];return new i(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { +${a.join(` +`)} +};`)(...Object.values(this.closed))}}const OT={major:4,minor:6,patch:7},Rt=Q("$ZodType",(n,i)=>{var a;n??(n={}),n._zod.def=i,n._zod.bag=n._zod.bag||{},n._zod.version=OT;const l=n._zod.def.checks,u=n._zod.traits.has("$ZodCheck")?[n,...l??[]]:l?.length?[...l]:[];for(const f of u)for(const d of f._zod.onattach)d(n);if(u.length===0)(a=n._zod).deferred??(a.deferred=[]),n._zod.deferred?.push(()=>{n._zod.run=n._zod.parse});else{const f=(m,p,g)=>{if(m.memo)return m;let x=mr(m),y;for(const w of p){if(w._zod.def.when){if(lE(m)||!w._zod.def.when(m))continue}else if(x)continue;const N=m.issues.length,E=w._zod.check(m);if(E instanceof Promise&&g?.async===!1)throw new Ga;if(y||E instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await E,m.issues.length!==N&&(Fm(m.issues,N,n),x||(x=mr(m,N)))});else{if(m.issues.length===N)continue;Fm(m.issues,N,n),x||(x=mr(m,N))}}return y?y.then(()=>m):m},d=(m,p,g)=>{if(mr(m))return m.aborted=!0,m;const x=f(p,u,g);if(x instanceof Promise){if(g.async===!1)throw new Ga;return x.then(y=>n._zod.parse(y,g))}return n._zod.parse(x,g)};n._zod.run=(m,p)=>{if(p.skipChecks)return n._zod.parse(m,p);if(p.direction==="backward"){const x=n._zod.parse({value:m.value,issues:[]},{...p,skipChecks:!0});return x instanceof Promise?x.then(y=>d(y,m,p)):d(x,m,p)}const g=n._zod.parse(m,p);if(g instanceof Promise){if(p.async===!1)throw new Ga;return g.then(x=>f(x,u,p))}return f(g,u,p)}}},{get"~standard"(){return c1(this,"~standard",y1(this))},set"~standard"(n){Ps(this,"~standard",n)}}),v1=(n,i)=>n.issues.length?{issues:n.issues.map(a=>co(a,i,Xs()))}:{value:n.value};async function NT(n,i){const a={async:!0};return v1(await n._zod.run({value:i,issues:[]},a),a)}function y1(n){return{validate:i=>{const a={async:!1};try{const l=n._zod.run({value:i,issues:[]},a);if(!(l instanceof Promise))return v1(l,a)}catch{}return NT(n,i)},vendor:"zod",version:1}}const Up=Q("$ZodString",(n,i)=>{Rt.init(n,i),n._zod.pattern=i.pattern??uT,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=String(a.value)}catch{}return typeof a.value=="string"||a.issues.push({expected:"string",code:"invalid_type",input:a.value,inst:n}),a}}),Ct=Q("$ZodStringFormat",(n,i)=>{Yf.init(n,i),Up.init(n,i)}),AT=Q("$ZodGUID",(n,i)=>{i.pattern??(i.pattern=YE),Ct.init(n,i)}),MT=Q("$ZodUUID",(n,i)=>{if(i.version){const l={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[i.version];if(l===void 0)throw new Error(`Invalid UUID version: "${i.version}"`);i.pattern??(i.pattern=lb(l))}else i.pattern??(i.pattern=lb()DELIM" +R"DELIM());Ct.init(n,i)}),jT=Q("$ZodEmail",(n,i)=>{i.pattern??(i.pattern=PE),Ct.init(n,i)}),b1=1,Mf=2;function _1(n){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(n):(new URL(n),!0)}catch{return!1}}function RT(n,i){return!("normalize"in i)&&!("hostname"in i)&&!("protocol"in i)?_1(n)||Mf:CT(n,i)}function CT(n,i){if(!i.normalize&&i.protocol?.source===iT.source&&!/^https?:\/\//i.test(n))return b1;try{if(typeof URL<"u"){const a=URL;if(typeof a.parse=="function")return a.parse(n)??Mf}return new URL(n)}catch{return Mf}}const kT=/[\t\n\r]/g;function ob(n){return n.replace(kT,"")}function DT(n,i){return i.lastIndex=0,i.test(n.hostname)}function UT(n,i){return i.lastIndex=0,i.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)}const ZT=Q("$ZodURL",(n,i)=>{Ct.init(n,i),n._zod.check=a=>{try{const l=a.value.trim(),u=RT(l,i);if(u===b1){a.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:a.value,inst:n,continue:!i.abort});return}if(u===Mf){a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:n,continue:!i.abort});return}if(u===!0){a.value=ob(l);return}i.hostname&&!DT(u,i.hostname)&&a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:i.hostname.source,input:a.value,inst:n,continue:!i.abort}),i.protocol&&!UT(u,i.protocol)&&a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:i.protocol.source,input:a.value,inst:n,continue:!i.abort}),a.value=i.normalize?u.href:ob(l);return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:n,continue:!i.abort})}}}),$T=Q("$ZodEmoji",(n,i)=>{i.pattern??(i.pattern=QE()),Ct.init(n,i)}),LT=Q("$ZodNanoID",(n,i)=>{if(i.length!==void 0&&(!Number.isInteger(i.length)||i.length<1))throw new Error(`Invalid nanoid length: ${i.length}`);i.pattern??(i.pattern=i.length===void 0?IE:KE(i.length)),Ct.init(n,i)}),HT=Q("$ZodCUID",(n,i)=>{i.pattern??(i.pattern=LE),Ct.init(n,i)}),BT=Q("$ZodCUID2",(n,i)=>{i.pattern??(i.pattern=HE),Ct.init(n,i)}),qT=Q("$ZodULID",(n,i)=>{i.pattern??(i.pattern=BE),Ct.init(n,i)}),VT=Q("$ZodXID",(n,i)=>{i.pattern??(i.pattern=qE),Ct.init(n,i)}),IT=Q("$ZodKSUID",(n,i)=>{i.pattern??(i.pattern=VE),Ct.init(n,i)}),KT=Q("$ZodISODateTime",(n,i)=>{i.pattern??(i.pattern=oT(i)),Ct.init(n,i)}),GT=Q("$ZodISODate",(n,i)=>{i.pattern??(i.pattern=aT),Ct.init(n,i)}),YT=Q("$ZodISOTime",(n,i)=>{i.pattern??(i.pattern=lT(i)),Ct.init(n,i)}),PT=Q("$ZodISODuration",(n,i)=>{i.pattern??(i.pattern=GE),Ct.init(n,i)}),FT=Q("$ZodIPv4",(n,i)=>{i.pattern??(i.pattern=JE),Ct.init(n,i)}),QT=/^[0-9a-fA-F:.]+$/;function S1(n){return QT.test(n)?_1(`http://[${n}]`):!1}const JT=Q("$ZodIPv6",(n,i)=>{i.pattern??(i.pattern=XE),Ct.init(n,i),n._zod.check=a=>{S1(a.value)||a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:n,continue:!i.abort})}}),XT=Q("$ZodCIDRv4",(n,i)=>{i.pattern??(i.pattern=WE),Ct.init(n,i)});function WT(n){const i=n.split("/");if(i.length!==2)return!1;const[a,l]=i;if(!l)return!1;const u=Number(l);return`${u}`!==l||u<0||u>128?!1:S1(a)}const e2=Q("$ZodCIDRv6",(n,i)=>{i.pattern??(i.pattern=eT),Ct.init(n,i),n._zod.check=a=>{WT(a.value)||a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:n,continue:!i.abort})}});function x1(n){if(n==="")return!0;if(/\s/.test(n)||n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const w1=/^[0-9a-zA-Z+/]*={0,2}$/,t2=Q("$ZodBase64",(n,i)=>{i.pattern??(i.pattern=w1),Ct.init(n,i),n._zod.check=a=>{x1(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:n,continue:!i.abort})}}),Zp=/^[A-Za-z0-9_-]*$/;function n2(n){if(!Zp.test(n))return!1;const i=n.replace(/[-_]/g,l=>l==="-"?"+":"/"),a=i.padEnd(Math.ceil(i.length/4)*4,"=");return x1(a)}const i2=Q("$ZodBase64URL",(n,i)=>{i.pattern??(i.pattern=Zp),Ct.init(n,i),n._zod.check=a=>{n2(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:n,continue:!i.abort})}}),r2=Q("$ZodE164",(n,i)=>{i.pattern??(i.pattern=rT),Ct.init(n,i)});function s2(n,i=null){try{const a=n.split(".");if(a.length!==3)return!1;const[l]=a;if(!l)return!1;const u=JSON.parse(atob(l));return!("typ"in u&&u?.typ!=="JWT"||!u.alg||i&&(!("alg"in u)||u.alg!==i))}catch{return!1}}const a2=Q("$ZodJWT",(n,i)=>{Ct.init(n,i),n._zod.check=a=>{s2(a.value,i.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:n,continue:!i.abort})}}),z1=Q("$ZodNumber",(n,i)=>{Rt.init(n,i),n._zod.pattern=cT,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=Number(a.value)}catch{}const u=a.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return a;const f=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:String(u):void 0;return a.issues.push({expected:"number",code:"invalid_type",input:u,inst:n,...f?{received:f}:{}}),a}}),l2=Q("$ZodNumberFormat",(n,i)=>{pT.init(n,i),z1.init(n,i)}),o2=Q("$ZodBoolean",(n,i)=>{Rt.init(n,i),n._zod.pattern=fT,n._zod.parse=(a,l)=>{if(i.coerce)try{a.value=!!a.value}catch{}const u=a.value;return typeof u=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:n}),a}}),u2=Q("$ZodUnknown",(n,i)=>{Rt.init(n,i),n._zod.parse=a=>a}),c2=Q("$ZodNever",(n,i)=>{Rt.init(n,i),n._zod.parse=(a,l)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:n}),a)});function f2(n,i){const a=ib(n._zod.def.checks);if(!a.length)return;const l=Math.min(...a.map(f=>f[0])),u=n._zod.parse;n._zod.parse=(f,d)=>{const m=i(f.value);if(m>l&&!d?.skipChecks&&d?.direction!=="backward"){for(const[p,g]of ib(n._zod.def.checks))if(m>p&&g._zod.def.when(f)){const x=f.issues.length;return g._zod.check(f),f.issues[x].continue=!1,Fm(f.issues,x,n),f}}return u(f,d)}}const d2=n=>Array.isArray(n)?n.length:-1;function ub(n,i,a){n.issues.length&&i.issues.push(...Kf(a,n.issues)),i.value[a]=n.value}const h2=Q("$ZodArray",(n,i)=>{Rt.init(n,i);const a=gr.memoizer;a?.attach(n),n._zod.parse=(l,u)=>{const f=l.value;if(!Array.isArray(f))return l.issues.push({expected:"array",code:"invalid_type",input:f,inst:n}),l;l.value=a?a.alloc(n,l,Array(f.length),u):Array(f.length);const d=[],m=u?.abortEarly;for(let p=0;pub(y,l,p)));else if(ub(x,l,p),m&&x.issues.length!==0&&mr(x))break}return d.length?Promise.all(d).then(()=>l):l},f2(n,d2)});function jf(n,i,a,l,u,f){const d=a in l,m=f==="optional";if(!(!d&&m&&u==="optional")){if(n.issues.length){if(u!==void 0&&m&&!d)return;i.issues.push(...Kf(a,n.issues))}if(!d&&u===void 0){n.issues.length||i.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[a]});return}n.value===void 0?(d||u==="defaulted"&&!m)&&(i.value[a]=void 0):i.value[a]=n.value}}const m2=[];function E1(n){const i=Object.keys(n.shape),a=Object.getOwnPropertySymbols(n.shape),l=a.length?a:m2,u=l.length?[...i,...l]:i;for(const d of u)if(!n.shape?.[d]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(d)}": expected a Zod schema`);const f=Wz(n.shape);return{...n,allKeys:u,symbolKeys:l,keySet:new Set(i),numKeys:i.length,optionalKeys:new Set(f)}}function T1(n,i,a,l,u,f,d){const m=[],p=u.keySet,g=u.catchall._zod,x=g.def.type,y=g.optin,w=g.optout;let N=0;for(const E in i){if(d&&a.issues.length!==N){if(mr(a,N))break;N=a.issues.length}if(p.has(E))continue;if(E==="__proto__"){x==="never"&&m.push(E);continue}if(x==="never"){m.push(E);continue}const A=g.run({value:i[E],issues:[]},l);A instanceof Promise?n.push(A.then(k=>jf(k,a,E,i,y,w))):jf(A,a,E,i,y,w)}return m.length&&a.issues.push({code:"unrecognized_keys",keys:m,input:i,inst:f,continue:!0}),n.length?Promise.all(n).then(()=>a):a}const p2=Q("$ZodObject",(n,i)=>{Rt.init(n,i);const a=Object.getOwnPropertyDescriptor(i,"shape"),l=a?.get?a.get.raw:i.shape??{};if(l){const g=()=>{const x={...l};return Object.defineProperty(i,"shape",{value:x}),g.raw=x,x};g.raw=l,Object.defineProperty(i,"shape",{get:g})}const u=Op(()=>E1(i));ot(n,"propValues",g=)DELIM" +R"DELIM(>{const x=g.def.shape,y={};for(const w in x){const N=x[w]._zod;if(N.values){Object.prototype.hasOwnProperty.call(y,w)||Ja(y,w,new Set);for(const E of N.values)y[w].add(E);N.optin!==void 0&&y[w].add(void 0)}}return y});const f=Nf,d=i.catchall;let m;const p=gr.memoizer;p?.attach(n),n._zod.parse=(g,x)=>{m??(m=u.value);const y=g.value;if(!f(y))return g.issues.push({expected:"object",code:"invalid_type",input:y,inst:n}),g;g.value=p?p.alloc(n,g,{},x):{};const w=[],N=m.shape,E=x?.abortEarly;let A=g.issues.length;for(const k of m.allKeys){if(E&&g.issues.length!==A){if(mr(g,A))break;A=g.issues.length}if(k==="__proto__")continue;const B=N[k],D=B._zod.optin,ie=B._zod.optout,K=B._zod.run({value:y[k],issues:[]},x);K instanceof Promise?w.push(K.then(G=>jf(G,g,k,y,D,ie))):jf(K,g,k,y,D,ie)}return d?T1(w,y,g,x,u.value,n,E===!0):w.length?Promise.all(w).then(()=>g):g}}),g2=Q("$ZodObjectJIT",(n,i)=>{p2.init(n,i);const a=n._zod.parse,l=Op(()=>E1(i)),u=gr.memoizer,f=N=>{const E=l.value,A=E.symbolKeys,k=new TT(["payload","ctx"],{shape:N,inst:n,memo:u,syms:A}),B=G=>`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`,D=(G,F)=>` + let ${G}_ab = false; + for (let i = 0; i < ${G}.issues.length; i++) { + const iss = ${G}.issues[i]; + iss.path = iss.path ? [${F}, ...iss.path] : [${F}]; + payload.issues.push(iss); + if (iss.continue !== true) ${G}_ab = true; } - } - - if (${G}.value === undefined) { - if (${W} in input) { - newResult[${W}] = undefined; + if (${G}_ab && ctx && ctx.abortEarly) { + payload.value = newResult; + return payload; + }`;k.write("const input = payload.value;");const ie=Object.create(null);let K=0;for(const G of E.allKeys)ie[G]=`key_${K++}`;k.write(u?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const G of E.allKeys){if(G==="__proto__")continue;const F=ie[G],te=typeof G=="symbol"?`syms[${A.indexOf(G)}]`:Fz(G),V=`${te} in input`,ye=N[G],de=ye?._zod?.optin,ne=de!==void 0,xe=ye?._zod?.optout==="optional";if(k.write(`const ${F} = ${B(te)};`),ne&&xe){const ge=de==="optional"?`${F}_present`:`${F}.value !== undefined || ${F}_present`;k.write(` + const ${F}_present = ${V}; + if (!${F}.issues.length || ${F}_present) { + if (${F}.issues.length) {${D(F,te)} + } + + if (${ge}) { + newResult[${te}] = ${F}.value; } - } else { - newResult[${W}] = ${G}.value; } - - `):ae?M.write(` - if (${G}.issues.length) { - payload.issues = payload.issues.concat(${G}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${W}, ...iss.path] : [${W}] - }))); + + `)}else ne?(k.write(` + if (${F}.issues.length) {${D(F,te)} } - - if (${G}.value === undefined) { - if (${W} in input) { - newResult[${W}] = undefined; - } - } else { - newResult[${W}] = ${G}.value; + `),de==="defaulted"?k.write(`newResult[${te}] = ${F}.value;`):k.write(` + if (${F}.value !== undefined || ${V}) { + newResult[${te}] = ${F}.value; } - - `):M.write(` - const ${G}_present = ${W} in input; - if (${G}.issues.length) { - payload.issues = payload.issues.concat(${G}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${W}, ...iss.path] : [${W}] - }))); + `)):k.write(` + const ${F}_present = ${V}; + if (${F}.issues.length) {${D(F,te)} } - if (!${G}_present && !${G}.issues.length) { + if (!${F}_present && !${F}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${W}] + path: [${te}] }); + if (ctx && ctx.abortEarly) { + payload.value = newResult; + return payload; + } } - if (${G}_present) { - if (${G}.value === undefined) { - newResult[${W}] = undefined; - } else { - newResult[${W}] = ${G}.value; - } + if (${F}_present) { + newResult[${te}] = ${F}.value; } - `)}M.write("payload.value = newResult;"),M.write("return payload;");const D=M.compile();return(ee,G)=>D(w,ee,G)};let f;const d=Ac,p=!Fh.jitless,v=p&&MS.value,x=i.catchall;let S;n._zod.parse=(w,M)=>{S??(S=r.value);const T=w.value;return d(T)?p&&v&&M?.async===!1&&M.jitless!==!0?(f||(f=o(i.shape)),w=f(w,M),x?F0([],T,w,M,S,n):w):s(w,M):(w.issues.push({expected:"object",code:"invalid_type",input:T,inst:n}),w)}});function Qv(n,i,s,r){for(const f of n)if(f.issues.length===0)return i.value=f.value,i;const o=n.filter(f=>!cr(f));return o.length===1?(i.value=o[0].value,o[0]):(i.issues.push({code:"invalid_union",input:i.value,inst:s,errors:n.map(f=>f.issues.map(d=>ml(d,r,hl())))}),i)}const yz=I("$ZodUnion",(n,i)=>{Tt.init(n,i),ht(n._zod,"optin",()=>i.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ht(n._zod,"optout",()=>i.options.some(r=>r._zod.optout==="opt)DELIM" -R"DELIM(ional")?"optional":void 0),ht(n._zod,"values",()=>{if(i.options.every(r=>r._zod.values))return new Set(i.options.flatMap(r=>Array.from(r._zod.values)))}),ht(n._zod,"pattern",()=>{if(i.options.every(r=>r._zod.pattern)){const r=i.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>Xh(o.source)).join("|")})$`)}});const s=i.options.length===1?i.options[0]._zod.run:null;n._zod.parse=(r,o)=>{if(s)return s(r,o);let f=!1;const d=[];for(const p of i.options){const m=p._zod.run({value:r.value,issues:[]},o);if(m instanceof Promise)d.push(m),f=!0;else{if(m.issues.length===0)return m;d.push(m)}}return f?Promise.all(d).then(p=>Qv(p,r,n,o)):Qv(d,r,n,o)}}),bz=I("$ZodIntersection",(n,i)=>{Tt.init(n,i),n._zod.parse=(s,r)=>{const o=s.value,f=i.left._zod.run({value:o,issues:[]},r),d=i.right._zod.run({value:o,issues:[]},r);return f instanceof Promise||d instanceof Promise?Promise.all([f,d]).then(([m,v])=>Kv(s,m,v)):Kv(s,f,d)}});function yh(n,i){if(n===i)return{valid:!0,data:n};if(n instanceof Date&&i instanceof Date&&+n==+i)return{valid:!0,data:n};if($o(n)&&$o(i)){const s=Object.keys(i),r=Object.keys(n).filter(f=>s.indexOf(f)!==-1),o={...n,...i};for(const f of r){const d=yh(n[f],i[f]);if(!d.valid)return{valid:!1,mergeErrorPath:[f,...d.mergeErrorPath]};o[f]=d.data}return{valid:!0,data:o}}if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return{valid:!1,mergeErrorPath:[]};const s=[];for(let r=0;rp.l&&p.r).map(([p])=>p);if(f.length&&o&&n.issues.push({...o,keys:f}),cr(n))return n;const d=yh(i.value,s.value);if(!d.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(d.mergeErrorPath)}`);return n.value=d.data,n}const _z=I("$ZodTuple",(n,i)=>{Tt.init(n,i);const s=i.items;n._zod.parse=(r,o)=>{const f=r.value;if(!Array.isArray(f))return r.issues.push({input:f,inst:n,expected:"tuple",code:"invalid_type"}),r;r.value=[];const d=[],p=Fv(s,"optin"),m=Fv(s,"optout");if(!i.rest){if(f.lengths.length&&r.issues.push({code:"too_big",maximum:s.length,inclusive:!0,input:f,inst:n,origin:"array"})}const v=new Array(s.length);for(let x=0;x{v[x]=w})):v[x]=S}if(i.rest){let x=s.length-1;const S=f.slice(s.length);for(const w of S){x++;const M=i.rest._zod.run({value:w,issues:[]},o);M instanceof Promise?d.push(M.then(T=>Jv(T,r,x))):Jv(M,r,x)}}return d.length?Promise.all(d).then(()=>Iv(v,r,s,f,m)):Iv(v,r,s,f,m)}});function Fv(n,i){for(let s=n.length-1;s>=0;s--)if(n[s]._zod[i]!=="optional")return s+1;return 0}function Jv(n,i,s){n.issues.length&&i.issues.push(...Bc(s,n.issues)),i.value[s]=n.value}function Iv(n,i,s,r,o){for(let f=0;f=o){i.value.length=f;break}i.issues.push(...Bc(f,d.issues))}i.value[f]=d.value}for(let f=i.value.length-1;f>=r.length&&(s[f]._zod.optout==="optional"&&i.value[f]===void 0);f--)i.value.length=f;return i}const Sz=I("$ZodEnum",(n,i)=>{Tt.init(n,i);const s=R0(i.entries),r=new Set(s);n._zod.values=r,n._zod.pattern=new RegExp(`^(${s.filter(o=>OS.has(typeof o)).map(o=>typeof o=="string"?pr(o):o.toString()).join("|")})$`),n._zod.parse=(o,f)=>{const d=o.value;return r.has(d)||o.issues.push({code:"invalid_value",values:s,input:d,inst:n}),o}}),xz=I("$ZodLiteral",(n,i)=>{if(Tt.init(n,i),i.values.length===0)throw new Error("Cannot create literal schema with no valid values");const s=new Set(i.values);n._zod.values=s,n._zod.pattern=new RegExp(`^(${i.values.map(r=>typeof r=="string"?pr(r):r?pr(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,o)=>{const f=r.value;return s.has(f)||r.issues.push({code:"invalid_value",values:i.values,input:f,inst:n}),r}}),zz=I("$ZodTransform",(n,i)=>{Tt.init(n,i),n._zod.optin="optional",n._zod.parse=(s,r)=>{if(r.direction==="backward")throw new k0(n.constructor.name);const o=i.transform(s.value,s);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(d=>(s.value=d,s.fallback=!0,s));if(o instanceof Promise)throw new fr;return s.value=o,s.fallback=!0,s}});function Xv(n,i){return i===void 0&&(n.issues.length||n.fallback)?{issues:[],value:void 0}:n}const J0=I("$ZodOptional",(n,i)=>{Tt.init(n,i),n._zod.optin="optional",n._zod.optout="optional",ht(n._zod,"values",()=>i.innerType._zod.values?new Set([...i.innerType._zod.values,void 0]):void 0),ht(n._zod,"pattern",()=>{const s=i.innerType._zod.pattern;return s?new RegExp(`^(${Xh(s.source)})?$`):void 0}),n._zod.parse=(s,r)=>{if(i.innerType._zod.optin==="optional"){const o=s.value,f=i.innerType._zod.run(s,r);return f instanceof Promise?f.then(d=>Xv(d,o)):Xv(f,o)}return s.value===void 0?s:i.innerType._zod.run(s,r)}}),wz=I("$ZodExactOptional",(n,i)=>{J0.init(n,i),ht(n._zod,"values",()=>i.innerType._zod.values),ht(n._zod,"pattern",()=>i.innerType._zod.pattern),n._zod.parse=(s,r)=>i.innerType._zod.run(s,r)}),Ez=I("$ZodNullable",(n,i)=>{Tt.init(n,i),ht(n._zod,"optin",()=>i.innerType._zod.optin),ht(n._zod,"optout",()=>i.innerType._zod.optout),ht(n._zod,"pattern",()=>{const s=i.innerType._zod.pattern;return s?new RegExp(`^(${Xh(s.source)}|null)$`):void 0}),ht(n._zod,"values",()=>i.innerType._zod.values?new Set([...i.innerType._zod.values,null]):void 0),n._zod.parse=(s,r)=>s.value===null?s:i.innerType._zod.run(s,r)}),Tz=I("$ZodDefault",(n,i)=>{Tt.init(n,i),n._zod.optin="optional",ht(n._zod,"values",()=>i.innerType._zod.values),n._zod.parse=(s,r)=>{if(r.direction==="backward")return i.innerType._zod.run(s,r);if(s.value===void 0)return s.value=i.defaultValue,s;const o=i.innerType._zod.run(s,r);return o instanceof Promise?o.then(f=>Pv(f,i)):Pv(o,i)}});function Pv(n,i){return n.value===void 0&&(n.value=i.defaultValue),n}const Nz=I("$ZodPrefault",(n,i)=>{Tt.init(n,i),n._zod.optin="optional",ht(n._zod,"values",()=>i.innerType._zod.values),n._zod.parse=(s,r)=>(r.direction==="backward"||s.value===void 0&&(s.value=i.defaultValue),i.innerType._zod.run(s,r))}),Az=I("$ZodNonOptional",(n,i)=>{Tt.init(n,i),ht(n._zod,"values",()=>{const s=i.innerType._zod.values;return s?new Set([...s].filter(r=>r!==void 0)):void 0}),n._zod.parse=(s,r)=>{const o=i.innerType._zod.run(s,r);return o instanceof Promise?o.then(f=>Wv(f,n)):Wv(o,n)}});function Wv(n,i){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:i}),n}const Mz=I("$ZodCatch",(n,i)=>{Tt.init(n,i),n._zod.optin="optional",ht(n._zod,"optout",()=>i.innerType._zod.optout),ht(n._zod,"values",()=>i.innerType._zod.values),n._zod.parse=(s,r)=>{if(r.direction==="backward")return i.innerType._zod.run(s,r);const o=i.innerType._zod.run(s,r);return o instanceof Promise?o.then(f=>(s.value=f.value,f.issues.length&&(s.value=i.catchValue({...s,error:{issues:f.issues.map(d=>ml(d,r,hl()))},input:s.value}),s.issues=[],s.fallback=!0),s)):(s.value=o.value,o.issues.length&&(s.value=i.catchValue({...s,error:{issues:o.issues.map(f=>ml(f,r,hl()))},input:s.value}),s.issues=[],s.fallback=!0),s)}}),Oz=I("$ZodPipe",(n,i)=>{Tt.init(n,i),ht(n._zod,"values",()=>i.in._zod.values),ht(n._zod,"optin",()=>i.in._zod.optin),ht(n._zod,"optout",()=>i.out._zod.optout),ht(n._zod,"propValues",()=>i.in._zod.propValues),n._zod.parse=(s,r)=>{if(r.direction==="backward"){const f=i.out._zod.run(s,r);return f instanceof Promise?f.then(d=>pc(d,i.in,r)):pc(f,i.in,r)}const o=i.in._zod.run(s,r);return o instanceof P)DELIM" -R"DELIM(romise?o.then(f=>pc(f,i.out,r)):pc(o,i.out,r)}});function pc(n,i,s){return n.issues.length?(n.aborted=!0,n):i._zod.run({value:n.value,issues:n.issues,fallback:n.fallback},s)}const jz=I("$ZodReadonly",(n,i)=>{Tt.init(n,i),ht(n._zod,"propValues",()=>i.innerType._zod.propValues),ht(n._zod,"values",()=>i.innerType._zod.values),ht(n._zod,"optin",()=>i.innerType?._zod?.optin),ht(n._zod,"optout",()=>i.innerType?._zod?.optout),n._zod.parse=(s,r)=>{if(r.direction==="backward")return i.innerType._zod.run(s,r);const o=i.innerType._zod.run(s,r);return o instanceof Promise?o.then(ey):ey(o)}});function ey(n){return n.value=Object.freeze(n.value),n}const kz=I("$ZodCustom",(n,i)=>{ni.init(n,i),Tt.init(n,i),n._zod.parse=(s,r)=>s,n._zod.check=s=>{const r=s.value,o=i.fn(r);if(o instanceof Promise)return o.then(f=>ty(f,s,r,n));ty(o,s,r,n)}});function ty(n,i,s,r){if(!n){const o={code:"custom",input:s,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),i.issues.push(Lo(o))}}var ny;class Rz{constructor(){this._map=new WeakMap,this._idmap=new Map}add(i,...s){const r=s[0];return this._map.set(i,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,i),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(i){const s=this._map.get(i);return s&&typeof s=="object"&&"id"in s&&this._idmap.delete(s.id),this._map.delete(i),this}get(i){const s=i._zod.parent;if(s){const r={...this.get(s)??{}};delete r.id;const o={...r,...this._map.get(i)};return Object.keys(o).length?o:void 0}return this._map.get(i)}has(i){return this._map.has(i)}}function Cz(){return new Rz}(ny=globalThis).__zod_globalRegistry??(ny.__zod_globalRegistry=Cz());const Oo=globalThis.__zod_globalRegistry;function Dz(n,i){return new n({type:"string",...Ee(i)})}function Zz(n,i){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Ee(i)})}function iy(n,i){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(i)})}function Uz(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(i)})}function $z(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(i)})}function Lz(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(i)})}function Hz(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(i)})}function Bz(n,i){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Ee(i)})}function qz(n,i){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(i)})}function Vz(n,i){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(i)})}function Gz(n,i){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(i)})}function Yz(n,i){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(i)})}function Qz(n,i){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(i)})}function Kz(n,i){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(i)})}function Fz(n,i){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(i)})}function Jz(n,i){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(i)})}function Iz(n,i){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(i)})}function Xz(n,i){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(i)})}function Pz(n,i){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(i)})}function Wz(n,i){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(i)})}function ew(n,i){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(i)})}function tw(n,i){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(i)})}function nw(n,i){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(i)})}function iw(n,i){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(i)})}function aw(n,i){return new n({type:"string",format:"date",check:"string_format",...Ee(i)})}function sw(n,i){return new n({type:"string",format:"time",check:"string_format",precision:null,...Ee(i)})}function lw(n,i){return new n({type:"string",format:"duration",check:"string_format",...Ee(i)})}function rw(n,i){return new n({type:"number",checks:[],...Ee(i)})}function ow(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(i)})}function uw(n,i){return new n({type:"boolean",...Ee(i)})}function cw(n){return new n({type:"unknown"})}function fw(n,i){return new n({type:"never",...Ee(i)})}function ay(n,i){return new V0({check:"less_than",...Ee(i),value:n,inclusive:!1})}function lh(n,i){return new V0({check:"less_than",...Ee(i),value:n,inclusive:!0})}function sy(n,i){return new G0({check:"greater_than",...Ee(i),value:n,inclusive:!1})}function rh(n,i){return new G0({check:"greater_than",...Ee(i),value:n,inclusive:!0})}function ly(n,i){return new Tx({check:"multiple_of",...Ee(i),value:n})}function I0(n,i){return new Ax({check:"max_length",...Ee(i),maximum:n})}function Oc(n,i){return new Mx({check:"min_length",...Ee(i),minimum:n})}function X0(n,i){return new Ox({check:"length_equals",...Ee(i),length:n})}function dw(n,i){return new jx({check:"string_format",format:"regex",...Ee(i),pattern:n})}function hw(n){return new kx({check:"string_format",format:"lowercase",...Ee(n)})}function mw(n){return new Rx({check:"string_format",format:"uppercase",...Ee(n)})}function pw(n,i){return new Cx({check:"string_format",format:"includes",...Ee(i),includes:n})}function gw(n,i){return new Dx({check:"string_format",format:"starts_with",...Ee(i),prefix:n})}function vw(n,i){return new Zx({check:"string_format",format:"ends_with",...Ee(i),suffix:n})}function Sr(n){return new Ux({check:"overwrite",tx:n})}function yw(n){return Sr(i=>i.normalize(n))}function bw(){return Sr(n=>n.trim())}function _w(){return Sr(n=>n.toLowerCase())}function Sw(){return Sr(n=>n.toUpperCase())}function xw(){return Sr(n=>AS(n))}function zw(n,i,s){return new n({type:"array",element:i,...Ee(s)})}function ww(n,i,s){return new n({type:"custom",check:"custom",fn:i,...Ee(s)})}function Ew(n,i){const s=Tw(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Lo(o,r.value,s._zod.def));else{const f=o;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=r.value),f.inst??(f.inst=s),f.continue??(f.continue=!s._zod.def.abort),r.issues.push(Lo(f))}},n(r.value,r)),i);return s}function Tw(n,i){const s=new ni({check:"custom",...Ee(i)});return s._zod.check=n,s}function P0(n){let i=n?.target??"draft-2020-12";return i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Oo,target:i,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0}}function ln(n,i,s={path:[],schemaPath:[]}){var r;const o=n._zod.def,f=i.seen.get(n);if(f)return f.count++,s.schemaPath.includes(n)&&(f.cycle=s.path),f.schema;const d={schema:{},count:1,cycle:void 0,path:s.path};i.seen.set(n,d);const p=n._zod.toJSONSchema?.();if(p)d.schema=p;else{const x={...s,schemaPath:[...s.schemaPath,n],path:s.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(i,d.schema,x);else{const w=d.schema,M=i.processors[o.type];if(!M)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);M(n,i,w,x)}const S=n._zod.parent;S&&(d.ref||(d.ref=S),ln(S,i,x),i.seen.get(S).isParent=!0)}const m=i.metadataRegistry.get(n);return m&&Object.assign(d.schema,m),i.io==="input"&&qn(n)&&(delete d.schema.examples,delete d.schema.default),i.io==="input"&&"_prefault"in d.schema&&((r=d.schema).defau)DELIM" -R"DELIM(lt??(r.default=d.schema._prefault)),delete d.schema._prefault,i.seen.get(n).schema}function W0(n,i){const s=n.seen.get(i);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const d of n.seen.entries()){const p=n.metadataRegistry.get(d[0])?.id;if(p){const m=r.get(p);if(m&&m!==d[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(p,d[0])}}const o=d=>{const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const S=n.external.registry.get(d[0])?.id,w=n.external.uri??(T=>T);if(S)return{ref:w(S)};const M=d[1].defId??d[1].schema.id??`schema${n.counter++}`;return d[1].defId=M,{defId:M,ref:`${w("__shared")}#/${p}/${M}`}}if(d[1]===s)return{ref:"#"};const v=`#/${p}/`,x=d[1].schema.id??`__schema${n.counter++}`;return{defId:x,ref:v+x}},f=d=>{if(d[1].schema.$ref)return;const p=d[1],{ref:m,defId:v}=o(d);p.def={...p.schema},v&&(p.defId=v);const x=p.schema;for(const S in x)delete x[S];x.$ref=m};if(n.cycles==="throw")for(const d of n.seen.entries()){const p=d[1];if(p.cycle)throw new Error(`Cycle detected: #/${p.cycle?.join("/")}/ + `)}return k.write("payload.value = newResult;"),k.write("return payload;"),k.compile()};let d;const m=Nf,p=!gr.jitless,x=p&&Jz.value,y=i.catchall;let w;n._zod.parse=(N,E)=>{w??(w=l.value);const A=N.value;return m(A)?p&&x&&E?.async===!1&&E.jitless!==!0?(d||(d=f(i.shape)),N=d(N,E),y?T1([],A,N,E,w,n,E?.abortEarly===!0):N):a(N,E):(N.issues.push({expected:"object",code:"invalid_type",input:A,inst:n}),N)}});function cb(n,i,a,l){for(const f of n)if(f.issues.length===0)return i.value=f.value,i;const u=n.filter(f=>!mr(f));return u.length===1?(i.value=u[0].value,u[0]):(i.issues.push({code:"invalid_union",input:i.value,inst:a,errors:n.map(f=>f.issues.map(d=>co(d,l,Xs())))}),i)}const v2=Q("$ZodUnion",(n,i)=>{Rt.init(n,i),ot(n,"optin",l=>l.def.options.some(u=>u._zod.optin==="defaulted")?"defaulted":l.def.options.some(u=>u._zod.optin!==void 0)?"optional":void 0),ot(n,"optout",l=>l.def.options.some(u=>u._zod.optout==="optional")?"optional":void 0),ot(n,"values",l=>{if(l.def.options.every(u=>u._zod.values))return new Set(l.def.options.flatMap(u=>Array.from(u._zod.values)))}),ot(n,"pattern",l=>{if(l.def.options.every(u=>u._zod.pattern)){const u=l.def.options.map(f=>f._zod.pattern);return new RegExp(`^(${u.map(f=>Np(f.source)).join("|")})$`)}});const a=i.options.length===1?i.options[0]._zod.run:null;n._zod.parse=(l,u)=>{if(a)return a(l,u);let f=!1;const d=[];for(const m of i.options){const p=m._zod.run({value:l.value,issues:[]},u);if(p instanceof Promise)d.push(p),f=!0;else{if(p.issues.length===0)return p;d.push(p)}}return f?Promise.all(d).then(m=>cb(m,l,n,u)):cb(d,l,n,u)}}),y2=Q("$ZodIntersection",(n,i)=>{Rt.init(n,i),n._zod.parse=(a,l)=>{const u=a.value,f=i.left._zod.run({value:u,issues:[]},l),d=i.right._zod.run({value:u,issues:[]},l);return f instanceof Promise||d instanceof Promise?Promise.all([f,d]).then(([p,g])=>fb(a,p,g)):fb(a,f,d)}});function Jm(n,i){if(n===i)return{valid:!0,data:n};if(n instanceof Date&&i instanceof Date&&+n==+i)return{valid:!0,data:n};if(ju(n)&&ju(i)){const a=Object.keys(i),l=Object.keys(n).filter(f=>a.indexOf(f)!==-1),u={...n,...i};Object.prototype.hasOwnProperty.call(u,"__proto__")&&delete u.__proto__;for(const f of l){if(f==="__proto__")continue;const d=Jm(n[f],i[f]);if(!d.valid)return{valid:!1,mergeErrorPath:[f,...d.mergeErrorPath]};u[f]=d.data}return{valid:!0,data:u}}if(Array.isArray(n)&&Array.isArray(i)){if(n.length!==i.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let l=0;l{let y;if(g.code==="unrecognized_keys"&&!g.path?.length)u??(u=g),y=g.keys;else if(g.code==="invalid_key"&&g.origin==="record"&&g.path?.length===1){const w=String(g.path[0]);f.has(w)||f.set(w,g),y=[w]}else return!1;for(const w of y)l.has(w)||l.set(w,{}),l.get(w)[x]=!0;return!0};for(const g of i.issues)d(g,"l")||n.issues.push(g);for(const g of a.issues)d(g,"r")||n.issues.push(g);const m=[...l].filter(([,g])=>g.l&&g.r).map(([g])=>g);if(m.length){const g=u?m.filter(x=>u.keys.includes(x)):[];g.length&&n.issues.push({...u,keys:g});for(const x of m)!g.includes(x)&&f.has(x)&&n.issues.push(f.get(x))}const p=Jm(i.value,a.value);if(!p.valid){if(mr(n))return n;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(p.mergeErrorPath)}`)}return n.value=p.data,n}const b2=Q("$ZodTuple",(n,i)=>{Rt.init(n,i);const a=i.items,l=gr.memoizer;l?.attach(n),n._zod.parse=(u,f)=>{const d=u.value;if(!Array.isArray(d))return u.issues.push({input:d,inst:n,expected:"tuple",code:"invalid_type"}),u;u.value=l?l.alloc(n,u,[],f):[];const m=[],p=db(a,"optin"),g=db(a,"optout");if(!i.rest){if(d.lengtha.length&&u.issues.push({code:"too_big",maximum:a.length,inclusive:!0,input:d,inst:n,origin:"array"})}const x=new Array(a.length),y=i.rest?f?.abortEarly:void 0;let w=!1;for(let N=0;N{x[N]=A})):(x[N]=E,y&&!w&&E.issues.length&&(w=mr(E)))}if(i.rest&&!w){let N=a.length-1;const E=d.slice(a.length);let A=u.issues.length;for(const k of E){if(y&&u.issues.length!==A){if(mr(u,A))break;A=u.issues.length}N++;const B=i.rest._zod.run({value:k,issues:[]},f);B instanceof Promise?m.push(B.then(D=>hb(D,u,N))):hb(B,u,N)}}return m.length?Promise.all(m).then(()=>mb(x,u,a,d,g)):mb(x,u,a,d,g)}});function db(n,i){for(let a=n.length-1;a>=0;a--)if(!(i==="optin"?n[a]._zod.optin!==void 0:n[a]._zod.optout==="optional"))return a+1;return 0}function hb(n,i,a){n.issues.length&&i.issues.push(...Kf(a,n.issues)),i.value[a]=n.value}function mb(n,i,a,l,u){for()DELIM" +R"DELIM(let f=0;f=u&&a[f]._zod.optin==="optional"){i.value.length=f;break}if(d.issues.length){if(!m&&f>=u){i.value.length=f;break}i.issues.push(...Kf(f,d.issues))}i.value[f]=d.value}for(let f=i.value.length-1;f>=l.length&&(a[f]._zod.optout==="optional"&&i.value[f]===void 0);f--)i.value.length=f;return i}const _2=Q("$ZodEnum",(n,i)=>{Rt.init(n,i);const a=Ym(i.entries),l=new Set(a);n._zod.values=l,ot(n,"pattern",u=>{const f=Ym(u.def.entries).filter(d=>Xz.has(typeof d));return new RegExp(f.length?`^(${f.map(d=>no(d.toString())).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(u,f)=>{const d=u.value;return l.has(d)||u.issues.push({code:"invalid_value",values:a,input:d,inst:n}),u}}),S2=Q("$ZodLiteral",(n,i)=>{Rt.init(n,i);const a=new Set(i.values);n._zod.values=a,ot(n,"pattern",l=>{const u=l.def.values;return new RegExp(u.length?`^(${u.map(f=>typeof f=="string"?no(f):f?no(f.toString()):String(f)).join("|")})$`:"^[^\\s\\S]$")}),n._zod.parse=(l,u)=>{const f=l.value;return a.has(f)||l.issues.push({code:"invalid_value",values:i.values,input:f,inst:n}),l}}),x2=Q("$ZodTransform",(n,i)=>{Rt.init(n,i),n._zod.optin="optional",gr.memoizer?.guard(n),n._zod.parse=(a,l)=>{if(l.direction==="backward")throw new d1(n.constructor.name);const u=i.transform(a.value,a);if(l.async)return(u instanceof Promise?u:Promise.resolve(u)).then(d=>(a.value=d,a));if(u instanceof Promise)throw new Ga;return a.value=u,a}});function pb(n,i){return n.value=i.issues.length?void 0:i.value,n}const O1=Q("$ZodOptional",(n,i)=>{Rt.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),n._zod.optout="optional",ot(n,"values",a=>{const l=a.def.innerType._zod.values;return l?new Set([...l,void 0]):void 0}),ot(n,"pattern",a=>{const l=a.def.innerType._zod.pattern;return l?new RegExp(`^(${Np(l.source)})?$`):void 0}),n._zod.parse=(a,l)=>{if(a.value===void 0){if(i.innerType._zod.optin!=="defaulted")return a;const u=i.innerType._zod.run({value:a.value,issues:[]},l);return u instanceof Promise?u.then(f=>pb(a,f)):pb(a,u)}return i.innerType._zod.run(a,l)}}),w2=Q("$ZodExactOptional",(n,i)=>{O1.init(n,i),ot(n,"values",a=>a.def.innerType._zod.values),ot(n,"pattern",a=>a.def.innerType._zod.pattern),n._zod.parse=(a,l)=>i.innerType._zod.run(a,l)}),z2=Q("$ZodNullable",(n,i)=>{Rt.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin),ot(n,"optout",a=>a.def.innerType._zod.optout),ot(n,"pattern",a=>{const l=a.def.innerType._zod.pattern;return l?new RegExp(`^(${Np(l.source)}|null)$`):void 0}),ot(n,"values",a=>a.def.innerType._zod.values?new Set([...a.def.innerType._zod.values,null]):void 0),n._zod.parse=(a,l)=>a.value===null?a:i.innerType._zod.run(a,l)}),E2=Q("$ZodDefault",(n,i)=>{Rt.init(n,i),n._zod.optin="defaulted",ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);if(a.value===void 0)return a.value=i.defaultValue,a;const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(f=>gb(f,i)):gb(u,i)}});function gb(n,i){return n.value===void 0&&(n.value=i.defaultValue),n}const T2=Q("$ZodPrefault",(n,i)=>{Rt.init(n,i),n._zod.optin="defaulted",ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>(l.direction==="backward"||a.value===void 0&&(a.value=i.defaultValue),i.innerType._zod.run(a,l))}),O2=Q("$ZodNonOptional",(n,i)=>{Rt.init(n,i),ot(n,"values",a=>{const l=a.def.innerType._zod.values;return l?new Set([...l].filter(u=>u!==void 0)):void 0}),n._zod.parse=(a,l)=>{const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(f=>vb(f,n)):vb(u,n)}});function vb(n,i){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:i}),n}function yb(n,i,a,l){return i.issues.length?(n.value=a.catchValue({...i,value:n.value,error:{issues:i.issues.map(u=>co(u,l,Xs()))},input:n.value}),n):(n.value=i.value,i.memo&&(n.memo=!0),n)}const N2=Q("$ZodCatch",(n,i)=>{Rt.init(n,i),ot(n,"optin",a=>a.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ot(n,"optout",a=>a.def.innerType._zod.optout),ot(n,"values",a=>a.def.innerType._zod.values),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);const u=i.innerType._zod.run({value:a.value,issues:[]},l);return u instanceof Promise?u.then(f=>yb(a,f,i,l)):yb(a,u,i,l)}}),A2=Q("$ZodPipe",(n,i)=>{Rt.init(n,i),ot(n,"values",a=>a.def.in._zod.values),ot(n,"optin",a=>a.def.in._zod.optin),ot(n,"optout",a=>a.def.out._zod.optout),ot(n,"propValues",a=>a.def.in._zod.propValues),n._zod.parse=(a,l)=>{if(l.direction==="backward"){const f=i.out._zod.run(a,l);return f instanceof Promise?f.then(d=>cf(d,i.in,l)):cf(f,i.in,l)}const u=i.in._zod.run(a,l);return u instanceof Promise?u.then(f=>cf(f,i.out,l)):cf(u,i.out,l)}});function cf(n,i,a){return n.issues.some(l=>l.code!=="unrecognized_keys")?(n.aborted=!0,n):i._zod.run({value:n.value,issues:n.issues},a)}const M2=Q("$ZodReadonly",(n,i)=>{Rt.init(n,i),ot(n,"propValues",a=>a.def.innerType._zod.propValues),ot(n,"values",a=>a.def.innerType._zod.values),ot(n,"optin",a=>a.def.innerType?._zod?.optin),ot(n,"optout",a=>a.def.innerType?._zod?.optout),n._zod.parse=(a,l)=>{if(l.direction==="backward")return i.innerType._zod.run(a,l);const u=i.innerType._zod.run(a,l);return u instanceof Promise?u.then(bb):bb(u)}});function bb(n){return n.memo||(n.value=Object.freeze(n.value)),n}const j2=Q("$ZodCustom",(n,i)=>{pi.init(n,i),Rt.init(n,i),n._zod.parse=(a,l)=>a,n._zod.check=a=>{const l=a.value,u=i.fn(l);if(u instanceof Promise)return u.then(f=>_b(f,a,l,n));_b(u,a,l,n)}});function _b(n,i,a,l){if(!n){const u={code:"custom",input:a,inst:l,path:[...l._zod.def.path??[]],continue:!l._zod.def.abort};l._zod.def.params&&(u.params=l._zod.def.params),i.issues.push(Ru(u))}}class R2 extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Xm="~memo",Sb=[];function N1(n){return n!==null&&typeof n=="object"}function km(n){return n.map(i=>i.path?{...i,path:i.path.slice()}:{...i})}const A1=new WeakMap,_u=0,xf=1,Eu=2;function wf(n,i,a){const l=A1.get(n);if(l!==void 0)return l?Eu:_u;if(i.has(n))return Eu;i.add(n);let u=_u;const f=x=>{if(u!==Eu&&x?._zod){const y=wf(x,i);y>u&&(u=y)}},d=(x,y)=>{let w=_u;for(const N of Reflect.ownKeys(x)){const E=Object.getOwnPropertyDescriptor(x,N);if(!E.enumerable)continue;const A=E.get?xf:E.value?._zod?wf(E.value,i):_u;A>w&&(w=A)}return w},m=x=>{x>u&&(u=x)},p=n._zod.def;switch(p.type){case"object":{const x=n1(p);m(x?d(x):xf),f(p.catchall);break}case"array":f(p.element);break;case"tuple":for(const x of p.items)f(x);f(p.rest);break;case"record":case"map":f(p.keyType),f(p.valueType);break;case"set":f(p.valueType);break;case"union":for(const x of p.options)f(x);break;case"intersection":f(p.left),f(p.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":f(p.innerType);break;case"pipe":f(p.in),f(p.out);break;case"function":f(p.input),f(p.output);break;case"lazy":{const x=p._cachedInner??void 0;m(x?wf(x,i):xf);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const x in p){const y=Object.getOwnPropertyDescriptor(p,x);if(!y||y.get)continue;const w=y.value;if(!(!w||typeof w!="object")){if(w._zod)f(w);else if(Array.isArray(w))for(const N of w)f(N)}}}return i.delete(n),C2(n,u)}function C2(n,i){return i!==xf&&A1.set(n,i===Eu),i}function k2(n,i){let a=n.buckets.get(i);return a||(a=new WeakMap,n.buckets.set(i,a)),a}let ff;const df=[],D2={alloc(n,i,a){const l=ff;if(!l)return a;ff=void 0;const u={value:a,issues:null};return l.set(i.value,u),df.push(u),a},guard(n){var i;(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred.push)DELIM" +R"DELIM((()=>{const a=n._zod.parse,l=(u,f)=>{if(f.direction!=="backward"&&Z2(f,u.value))throw new R2;return a(u,f)};n._zod.parse=l,n._zod.run===a&&(n._zod.run=l)})},attach(n){var i;let a,l=!1,u,f;(i=n._zod).deferred??(i.deferred=[]),n._zod.deferred.push(()=>{const d=n._zod.parse,m=(p,g)=>{if(a===void 0){const B=wf(n,new Set);if(B===_u)return n._zod.parse=d,n._zod.run===m&&(n._zod.run=d),d(p,g);B===Eu||l?a=!0:l=!0}const x=p.value;if(!N1(x))return d(p,g);let y=g[Xm];y||(y={buckets:new WeakMap,backEdges:void 0},g[Xm]=y);let w;u===g?w=f:(w=k2(y,n),u=g,f=w);const N=w.get(x);if(N)return p.value=N.value,N.issues?N.issues.length&&p.issues.push(...km(N.issues)):(p.memo=!0,y.backEdges??(y.backEdges=new WeakSet),y.backEdges.add(N.value)),p;ff=w;const E=df.length,A=d(p,g);ff=void 0;const k=df.length>E?df.pop():void 0;return A instanceof Promise?A.then(B=>(k&&(k.issues=B.issues.length?km(B.issues):Sb),B)):(k&&(k.issues=A.issues.length?km(A.issues):Sb),A)};n._zod.parse=m,n._zod.run===d&&(n._zod.run=m)})}};function U2(){return D2}function Z2(n,i){const a=n[Xm]?.backEdges;return a!==void 0&&N1(i)&&a.has(i)}const $2=()=>{const n={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function i(f){return n[f]??null}const a={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},l={nan:"NaN"};function u(f,d){return f==="number"&&typeof d=="number"&&!Number.isFinite(d)?String(d):l[f]??f}return f=>{switch(f.code){case"invalid_type":{const d=u(f.expected),m=uE(f.input),p=u(m,f.input);return`Invalid input: expected ${d}, received ${p}`}case"invalid_value":return f.values.length===1?`Invalid input: expected ${l1(f.values[0])}`:`Invalid option: expected one of ${tb(f.values,"|")}`;case"too_big":{const d=f.exact?"exactly ":f.inclusive?"<=":"<",m=i(f.origin);return m?`Too big: expected ${f.origin??"value"} to have ${d}${f.maximum.toString()} ${m.unit??"elements"}`:`Too big: expected ${f.origin??"value"} to be ${d}${f.maximum.toString()}`}case"too_small":{const d=f.exact?"exactly ":f.inclusive?">=":">",m=i(f.origin);return m?`Too small: expected ${f.origin} to have ${d}${f.minimum.toString()} ${m.unit}`:`Too small: expected ${f.origin} to be ${d}${f.minimum.toString()}`}case"invalid_format":{const d=f;return d.format==="starts_with"?`Invalid string: must start with "${d.prefix}"`:d.format==="ends_with"?`Invalid string: must end with "${d.suffix}"`:d.format==="includes"?`Invalid string: must include "${d.includes}"`:d.format==="regex"?`Invalid string: must match pattern ${d.pattern}`:`Invalid ${a[d.format]??f.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${f.divisor}`;case"unrecognized_keys":return`Unrecognized key${f.keys.length>1?"s":""}: ${tb(f.keys,", ")}`;case"invalid_key":return`Invalid key in ${f.origin}`;case"invalid_union":return f.options&&Array.isArray(f.options)&&f.options.length>0?`Invalid discriminator value. Expected ${f.options.map(m=>`'${m}'`).join(" | ")}`:f.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${f.origin}`;default:return"Invalid input"}}};function L2(){return{localeError:$2()}}var xb;class H2{constructor(){this._map=new WeakMap,this._idmap=new Map}add(i,...a){const l=a[0];return this._map.set(i,l),l&&typeof l=="object"&&"id"in l&&this._idmap.set(l.id,i),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(i){const a=this._map.get(i);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(i),this}get(i){const a=i._zod.parent;if(a){const l={...this.get(a)??{}};delete l.id;const u={...l,...this._map.get(i)};return Object.keys(u).length?u:void 0}return this._map.get(i)}has(i){return this._map.has(i)}}function B2(){return new H2}(xb=globalThis).__zod_globalRegistry??(xb.__zod_globalRegistry=B2());const Su=globalThis.__zod_globalRegistry;function M1(n){return n.checks&&(n.checks=[...n.checks]),n}function q2(n,i){return new n(M1({type:"string",...Oe(i)}))}function V2(n,i){return new n({type:"string",format:"email",check:"string_format",abort:!1,...Oe(i)})}function I2(n,i){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...Oe(i)})}function K2(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...Oe(i)})}function G2(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Oe(i)})}function Y2(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Oe(i)})}function P2(n,i){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Oe(i)})}function F2(n,i){return new n({type:"string",format:"url",check:"string_format",abort:!1,...Oe(i)})}function Q2(n,i){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...Oe(i)})}function J2(n,i){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...Oe(i)})}function X2(n,i){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...Oe(i)})}function W2(n,i){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...Oe(i)})}function eO(n,i){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...Oe(i)})}function tO(n,i){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...Oe(i)})}function nO(n,i){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...Oe(i)})}function iO(n,i){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...Oe(i)})}function rO(n,i){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...Oe(i)})}function sO(n,i){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Oe(i)})}function aO(n,i){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Oe(i)})}function lO(n,i){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...Oe(i)})}function oO(n,i){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...Oe(i)})}function uO(n,i){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...Oe(i)})}function cO(n,i){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...Oe(i)})}function fO(n,i){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Oe(i)})}function dO(n,i){return new n({type:"string",format:"date",check:"string_format",...Oe(i)})}function hO(n,i){return new n({type:"string",format:"time",check:"string_format",precision:null,...Oe(i)})}function mO(n,i){return new n({type:"string",format:"duration",check:"string_format",...Oe(i)})}function pO(n,i){return new n(M1({type:"number",checks:[],...Oe(i)}))}function gO(n,i){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...Oe(i)})}function vO(n,i){return new n({type:"boolean",...Oe(i)})}function yO(n){return new n({type:"unknown"})}function bO(n,i){return new n({type:"never",...Oe(i)})}function wb(n,i){return new p1({check:"less_than",...Oe(i),value:n,inclusive:!1})}function Dm(n,i){return new p1({check:"less_than",...Oe(i),value:n,inclusive:!0})}function zb(n,i){return new g1({check:"greater_than",...Oe(i),value:n,inclusive:!1})}function Um(n,i){return new g1({check:"greater_than",...Oe(i),value:n,inclusive:!0})DELIM" +R"DELIM()}function Eb(n,i){return new mT({check:"multiple_of",...Oe(i),value:n})}function j1(n,i){return new gT({check:"max_length",...Oe(i),maximum:n})}function Rf(n,i){return new vT({check:"min_length",...Oe(i),minimum:n})}function R1(n,i){return new yT({check:"length_equals",...Oe(i),length:n})}function _O(n,i){return new bT({check:"string_format",format:"regex",...Oe(i),pattern:n})}function SO(n){return new _T({check:"string_format",format:"lowercase",...Oe(n)})}function xO(n){return new ST({check:"string_format",format:"uppercase",...Oe(n)})}function wO(n,i){return new xT({check:"string_format",format:"includes",...Oe(i),includes:n})}function zO(n,i){return new wT({check:"string_format",format:"starts_with",...Oe(i),prefix:n})}function EO(n,i){return new zT({check:"string_format",format:"ends_with",...Oe(i),suffix:n})}function fo(n){return new ET({check:"overwrite",tx:n})}function TO(n){return fo(i=>i.normalize(n))}function OO(){return fo(n=>n.trim())}function NO(){return fo(n=>n.toLowerCase())}function AO(){return fo(n=>n.toUpperCase())}function MO(){return fo(n=>Qz(n))}function jO(n,i,a){return new n({type:"array",element:i,...Oe(a)})}function RO(n,i,a){return new n({type:"custom",check:"custom",fn:i,...Oe(a)})}function CO(n,i){const a=kO(l=>(l.addIssue=u=>{if(typeof u=="string")l.issues.push(Ru(u,l.value,a._zod.def));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=l.value),f.inst??(f.inst=a),f.continue??(f.continue=!a._zod.def.abort),l.issues.push(Ru(f))}},n(l.value,l)),i);return a}function kO(n,i){const a=new pi({check:"custom",...Oe(i)});return a._zod.check=n,a}function Tu(n,...i){for(const a of i)for(const l of Reflect.ownKeys(a))Object.prototype.propertyIsEnumerable.call(a,l)&&Ja(n,l,a[l]);return n}function C1(n){let i=n?.target??"draft-2020-12";return i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),{processors:n.processors??{},metadataRegistry:n?.metadata??Su,target:i,unrepresentable:n?.unrepresentable??"throw",override:n?.override??(()=>{}),io:n?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:n?.cycles??"ref",reused:n?.reused??"inline",intersections:[],deferred:[],external:n?.external??void 0}}function Fs(n,i,a,l,u){const f=typeof i.unrepresentable=="function"?i.unrepresentable({zodSchema:n,path:l.path,message:u}):i.unrepresentable;if(f==="any")return!1;if(f===void 0||f==="throw")throw new Error(u);return Object.assign(a,f),!0}function mn(n,i,a={path:[],schemaPath:[]}){var l;const u=n._zod.def,f=i.seen.get(n);if(f)return f.count++,a.schemaPath.includes(n)&&(f.cycle=a.path),f.schema;const d={schema:{},count:1,cycle:void 0,path:a.path};i.seen.set(n,d),i.sharedDefsExtractedFor=void 0,i.sharedEmitDoneFor=void 0;const m=n._zod.toJSONSchema?.();if(m)d.schema=m;else{const x={...a,schemaPath:[...a.schemaPath,n],path:a.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(i,d.schema,x);else{const w=d.schema,N=i.processors[u.type];if(!N)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);N(n,i,w,x)}const y=n._zod.parent;y&&(d.ref||(d.ref=y),mn(y,i,x),i.seen.get(y).isParent=!0)}const p=i.metadataRegistry.get(n);return p&&Tu(d.schema,p),i.io==="input"&&ti(n)&&(delete d.schema.examples,delete d.schema.default),i.io==="input"&&"_prefault"in d.schema&&((l=d.schema).default??(l.default=d.schema._prefault)),delete d.schema._prefault,i.seen.get(n).schema}function Tb(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}function k1(n,i){const a=n.seen.get(i);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");if(n.external&&n.sharedDefsExtractedFor===n.external)return;const l=new Map;for(const d of n.seen.entries()){const m=n.metadataRegistry.get(d[0])?.id;if(m){const p=l.get(m);if(p&&p!==d[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);l.set(m,d[0])}}const u=d=>{const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const y=n.external.registry.get(d[0])?.id,w=n.external.uri??(E=>E);if(y)return{ref:w(y)};const N=d[1].defId??d[1].schema.id??`schema${n.counter++}`;return d[1].defId=N,{defId:N,ref:`${w("__shared")}#/${m}/${Tb(N)}`}}const p="#",g=`${p}/${m}/`;if(d[1]===a&&!d[1].schema.id)return{ref:p};const x=d[1].schema.id??`__schema${n.counter++}`;return{defId:x,ref:g+Tb(x)}},f=d=>{if(d[1].schema.$ref)return;const m=d[1],{ref:p,defId:g}=u(d);m.def={...m.schema},g&&(m.defId=g);const x=m.schema;for(const y in x)delete x[y];x.$ref=p};if(n.cycles==="throw")for(const d of n.seen.entries()){const m=d[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of n.seen.entries()){const p=d[1];if(i===d[0]){f(d);continue}if(n.external){const v=n.external.registry.get(d[0])?.id;if(i!==d[0]&&v){f(d);continue}}if(n.metadataRegistry.get(d[0])?.id){f(d);continue}if(p.cycle){f(d);continue}if(p.count>1&&n.reused==="ref"){f(d);continue}}}function eb(n,i){const s=n.seen.get(i);if(!s)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=p=>{const m=n.seen.get(p);if(m.ref===null)return;const v=m.def??m.schema,x={...v},S=m.ref;if(m.ref=null,S){r(S);const M=n.seen.get(S),T=M.schema;if(T.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(v.allOf=v.allOf??[],v.allOf.push(T)):Object.assign(v,T),Object.assign(v,x),p._zod.parent===S)for(const B in v)B==="$ref"||B==="allOf"||B in x||delete v[B];if(T.$ref&&M.def)for(const B in v)B==="$ref"||B==="allOf"||B in M.def&&JSON.stringify(v[B])===JSON.stringify(M.def[B])&&delete v[B]}const w=p._zod.parent;if(w&&w!==S){r(w);const M=n.seen.get(w);if(M?.schema.$ref&&(v.$ref=M.schema.$ref,M.def))for(const T in v)T==="$ref"||T==="allOf"||T in M.def&&JSON.stringify(v[T])===JSON.stringify(M.def[T])&&delete v[T]}n.override({zodSchema:p,jsonSchema:v,path:m.path??[]})};for(const p of[...n.seen.entries()].reverse())r(p[0]);const o={};if(n.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const p=n.external.registry.get(i)?.id;if(!p)throw new Error("Schema is missing an `id` property");o.$id=n.external.uri(p)}Object.assign(o,s.def??s.schema);const f=n.metadataRegistry.get(i)?.id;f!==void 0&&o.id===f&&delete o.id;const d=n.external?.defs??{};for(const p of n.seen.entries()){const m=p[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,d[m.defId]=m.def)}n.external||Object.keys(d).length>0&&(n.target==="draft-2020-12"?o.$defs=d:o.definitions=d);try{const p=JSON.parse(JSON.stringify(o));return Object.defineProperty(p,"~standard",{value:{...i["~standard"],jsonSchema:{input:jc(i,"input",n.processors),output:jc(i,"output",n.processors)}},enumerable:!1,writable:!1}),p}catch{throw new Error("Error converting schema to JSON.")}}function qn(n,i){const s=i??{seen:new Set};if(s.seen.has(n))return!1;s.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return qn(r.element,s);if(r.type==="set")return qn(r.valueType,s);if(r.type==="lazy")return qn(r.getter(),s);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return qn(r.innerType,s);if(r.type==="intersection")return qn(r.left,s)||qn(r.right,s);if(r.type==="record"||r.type==="map")return qn(r.keyType,s)||qn(r.valueType,s);if(r.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:qn(r.in,s)||qn(r.out,s);if(r.type==="object"){for(const o in r.shape)if(qn(r.shape[o],s))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(qn(o,s))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(qn(o,s))return!0;return!!(r.rest&&qn(r.rest,s))}return!1}const Nw=(n,i={})=>s=>{const r=P0({...s,processors:i});return ln(n,r),W0(r,n),eb(r,n)},jc=(n,i,s={})=>r=>{const{libraryOptions:o,target:f}=r??{},d=P0({...o??{},target:f,io:i,processors:s});return ln(n,d),W0(d,n),eb(d,n)},Aw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mw=(n,i,s,r)=>{const o=s;o.type="string";const{minimum:f,maximum:d,format:p,patterns:m,contentEncoding:v}=n._zod.bag;if(typeof f=="number"&&(o.minLength=f),typeof d=="number"&&(o.maxLength=d),p&&(o.format=Aw[p]??p,o.format===""&&delete o.format,p==="time"&&delete o.format),v&&(o.contentEncoding=v),m&&m.size>0){const x=[...m];x.length===1?o.pattern=x[0].source:x.length>1&&(o.allOf=[...x.map(S=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:S.source}))])}},Ow=(n,i,s,r)=>{const o=s,{minimum:f,maximum:d,format:p,multipleOf:m,exclusiveMaximum:v,exclusiveMinimum:x}=n._zod.bag;typeof p=="string"&&p.includes("int")?o.type="integer":o.type="number";const S=typeof x=="number"&&x>=(f??Number.NEGATIVE_INFINITY),w=typeof v=="number"&&v<=(d??Number.POSITIVE_INFINITY),M=i.target==="draft-04"||i.target==="openapi-3.0";S?M?(o.minimum=x,o.exclusiveMinimum=!0):o.exclusiveMinimum=x:typeof f=="number"&&(o.minimum=f),w?M?(o.maximum=v,o.exclusiveMaximum=!0):o.exclusiveMaximum=v:typeof d=="number"&&(o.maximum=d),typeof m=="number"&&(o.multipleOf=m)},jw=(n,i,s,r)=>{s.type="boolean"},kw=(n,i,s,r)=>{s.not={}},Rw=(n,i,s,r)=>{},Cw=(n,i,s,r)=>{const o=n._zod.def,f=R0(o.entries);f.every(d=>typeof d=="number")&&(s.type="number"),f.every(d=>typeof d=="string")&&(s.type="string"),s.enum=f},Dw=(n,i,s,r)=>{const o=n._zod.def,f=[];for(const d of o.values)if(d===void 0){if(i.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof d=="bigint"){if(i.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");f.push(Number(d))}else f.push(d);if(f.length!==0)if(f.length===1){const d=f[0];s.type=d===null?"null":typeof d,i.target==="draft-04"||i.target==="openapi-3.0"?s.enum=[d]:s.const=d}else f.every(d=>typeof d=="number")&&(s.type="number"),f.every(d=>typeof d=="string")&&(s.type="string"),f.every(d=>typeof d=="boolean")&&(s.type="boolean"),f.every(d=>d===null)&&(s.type="null"),s.enum=f},Zw=(n,i,s,r)=>{if(i.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Uw=(n,i,s,r)=>{if(i.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},$w=(n,i,s,r)=>{const o=s,f=n._zod.def,{minimum:d,maximum:p}=n._zod.bag;typeof d=="number"&&(o.minItems=d),typeof p=="number"&&(o.maxItems=p),o.type="array",o.items=ln(f.element,i,{...r,path:[...r.path,"items"]})},Lw=(n,i,s,r)=>{const o=s,f=n._zod.def;o.type="object",o.properties={};const d=f.shape;for(const v in d)o.properties[v]=ln(d[v],i,{...r,path:[...r.path,"properties",v]});const p=new Set(Object.keys(d)),m=new Set([...p].filter(v=>{const x=f.shape[v]._zod;return i.io==="input"?x.optin===void 0:x.optout===void 0}));m.size>0&&(o.required=Array.from(m)),f.catchall?._zod.def.type==="never"?o.additionalProperties=!1:f.catchall?f.catchall&&(o.additionalProperties=ln(f.catchall,i,{...r,path:[...r.path,"additionalProperties"]})):i.io==="output"&&(o.additionalProperties=!1)},Hw=(n,i,s,r)=>{const o=n._zod.def,f=o.inclusive===!1,d=o.options.map((p,m)=>ln(p,i,{...r,path:[...r.path,f?"oneOf":"anyOf",m]}));f?s.oneOf=d:s.anyOf=d},Bw=(n,i,s,r)=>)DELIM" -R"DELIM({const o=n._zod.def,f=ln(o.left,i,{...r,path:[...r.path,"allOf",0]}),d=ln(o.right,i,{...r,path:[...r.path,"allOf",1]}),p=v=>"allOf"in v&&Object.keys(v).length===1,m=[...p(f)?f.allOf:[f],...p(d)?d.allOf:[d]];s.allOf=m},qw=(n,i,s,r)=>{const o=s,f=n._zod.def;o.type="array";const d=i.target==="draft-2020-12"?"prefixItems":"items",p=i.target==="draft-2020-12"||i.target==="openapi-3.0"?"items":"additionalItems",m=f.items.map((w,M)=>ln(w,i,{...r,path:[...r.path,d,M]})),v=f.rest?ln(f.rest,i,{...r,path:[...r.path,p,...i.target==="openapi-3.0"?[f.items.length]:[]]}):null;i.target==="draft-2020-12"?(o.prefixItems=m,v&&(o.items=v)):i.target==="openapi-3.0"?(o.items={anyOf:m},v&&o.items.anyOf.push(v),o.minItems=m.length,v||(o.maxItems=m.length)):(o.items=m,v&&(o.additionalItems=v));const{minimum:x,maximum:S}=n._zod.bag;typeof x=="number"&&(o.minItems=x),typeof S=="number"&&(o.maxItems=S)},Vw=(n,i,s,r)=>{const o=n._zod.def,f=ln(o.innerType,i,r),d=i.seen.get(n);i.target==="openapi-3.0"?(d.ref=o.innerType,s.nullable=!0):s.anyOf=[f,{type:"null"}]},Gw=(n,i,s,r)=>{const o=n._zod.def;ln(o.innerType,i,r);const f=i.seen.get(n);f.ref=o.innerType},Yw=(n,i,s,r)=>{const o=n._zod.def;ln(o.innerType,i,r);const f=i.seen.get(n);f.ref=o.innerType,s.default=JSON.parse(JSON.stringify(o.defaultValue))},Qw=(n,i,s,r)=>{const o=n._zod.def;ln(o.innerType,i,r);const f=i.seen.get(n);f.ref=o.innerType,i.io==="input"&&(s._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},Kw=(n,i,s,r)=>{const o=n._zod.def;ln(o.innerType,i,r);const f=i.seen.get(n);f.ref=o.innerType;let d;try{d=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}s.default=d},Fw=(n,i,s,r)=>{const o=n._zod.def,f=o.in._zod.traits.has("$ZodTransform"),d=i.io==="input"?f?o.out:o.in:o.out;ln(d,i,r);const p=i.seen.get(n);p.ref=d},Jw=(n,i,s,r)=>{const o=n._zod.def;ln(o.innerType,i,r);const f=i.seen.get(n);f.ref=o.innerType,s.readOnly=!0},tb=(n,i,s,r)=>{const o=n._zod.def;ln(o.innerType,i,r);const f=i.seen.get(n);f.ref=o.innerType},Iw=I("ZodISODateTime",(n,i)=>{Xx.init(n,i),kt.init(n,i)});function Xw(n){return iw(Iw,n)}const Pw=I("ZodISODate",(n,i)=>{Px.init(n,i),kt.init(n,i)});function Ww(n){return aw(Pw,n)}const e2=I("ZodISOTime",(n,i)=>{Wx.init(n,i),kt.init(n,i)});function t2(n){return sw(e2,n)}const n2=I("ZodISODuration",(n,i)=>{ez.init(n,i),kt.init(n,i)});function i2(n){return lw(n2,n)}const a2=(n,i)=>{U0.init(n,i),n.name="ZodError",Object.defineProperties(n,{format:{value:s=>qS(n,s)},flatten:{value:s=>BS(n,s)},addIssue:{value:s=>{n.issues.push(s),n.message=JSON.stringify(n.issues,vh,2)}},addIssues:{value:s=>{n.issues.push(...s),n.message=JSON.stringify(n.issues,vh,2)}},isEmpty:{get(){return n.issues.length===0}}})},ji=I("ZodError",a2,{Parent:Error}),s2=Wh(ji),l2=em(ji),r2=qc(ji),o2=Vc(ji),u2=YS(ji),c2=QS(ji),f2=KS(ji),d2=FS(ji),h2=JS(ji),m2=IS(ji),p2=XS(ji),g2=PS(ji),ry=new WeakMap;function Yo(n,i,s){const r=Object.getPrototypeOf(n);let o=ry.get(r);if(o||(o=new Set,ry.set(r,o)),!o.has(i)){o.add(i);for(const f in s){const d=s[f];Object.defineProperty(r,f,{configurable:!0,enumerable:!1,get(){const p=d.bind(this);return Object.defineProperty(this,f,{configurable:!0,writable:!0,enumerable:!0,value:p}),p},set(p){Object.defineProperty(this,f,{configurable:!0,writable:!0,enumerable:!0,value:p})}})}}}const jt=I("ZodType",(n,i)=>(Tt.init(n,i),Object.assign(n["~standard"],{jsonSchema:{input:jc(n,"input"),output:jc(n,"output")}}),n.toJSONSchema=Nw(n,{}),n.def=i,n.type=i.type,Object.defineProperty(n,"_def",{value:i}),n.parse=(s,r)=>s2(n,s,r,{callee:n.parse}),n.safeParse=(s,r)=>r2(n,s,r),n.parseAsync=async(s,r)=>l2(n,s,r,{callee:n.parseAsync}),n.safeParseAsync=async(s,r)=>o2(n,s,r),n.spa=n.safeParseAsync,n.encode=(s,r)=>u2(n,s,r),n.decode=(s,r)=>c2(n,s,r),n.encodeAsync=async(s,r)=>f2(n,s,r),n.decodeAsync=async(s,r)=>d2(n,s,r),n.safeEncode=(s,r)=>h2(n,s,r),n.safeDecode=(s,r)=>m2(n,s,r),n.safeEncodeAsync=async(s,r)=>p2(n,s,r),n.safeDecodeAsync=async(s,r)=>g2(n,s,r),Yo(n,"ZodType",{check(...s){const r=this.def;return this.clone(js(r,{checks:[...r.checks??[],...s.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...s){return this.check(...s)},clone(s,r){return ks(this,s,r)},brand(){return this},register(s,r){return s.add(this,r),this},refine(s,r){return this.check(cE(s,r))},superRefine(s,r){return this.check(fE(s,r))},overwrite(s){return this.check(Sr(s))},optional(){return fy(this)},exactOptional(){return X2(this)},nullable(){return dy(this)},nullish(){return fy(dy(this))},nonoptional(s){return iE(this,s)},array(){return Yc(this)},or(s){return Qc([this,s])},and(s){return G2(this,s)},transform(s){return hy(this,J2(s))},default(s){return eE(this,s)},prefault(s){return nE(this,s)},catch(s){return sE(this,s)},pipe(s){return hy(this,s)},readonly(){return oE(this)},describe(s){const r=this.clone();return Oo.add(r,{description:s}),r},meta(...s){if(s.length===0)return Oo.get(this);const r=this.clone();return Oo.add(r,s[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(s){return s(this)}}),Object.defineProperty(n,"description",{get(){return Oo.get(n)?.description},configurable:!0}),n)),nb=I("_ZodString",(n,i)=>{tm.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(r,o,f)=>Mw(n,r,o);const s=n._zod.bag;n.format=s.format??null,n.minLength=s.minimum??null,n.maxLength=s.maximum??null,Yo(n,"_ZodString",{regex(...r){return this.check(dw(...r))},includes(...r){return this.check(pw(...r))},startsWith(...r){return this.check(gw(...r))},endsWith(...r){return this.check(vw(...r))},min(...r){return this.check(Oc(...r))},max(...r){return this.check(I0(...r))},length(...r){return this.check(X0(...r))},nonempty(...r){return this.check(Oc(1,...r))},lowercase(r){return this.check(hw(r))},uppercase(r){return this.check(mw(r))},trim(){return this.check(bw())},normalize(...r){return this.check(yw(...r))},toLowerCase(){return this.check(_w())},toUpperCase(){return this.check(Sw())},slugify(){return this.check(xw())}})}),v2=I("ZodString",(n,i)=>{tm.init(n,i),nb.init(n,i),n.email=s=>n.check(Zz(y2,s)),n.url=s=>n.check(Bz(b2,s)),n.jwt=s=>n.check(nw(C2,s)),n.emoji=s=>n.check(qz(_2,s)),n.guid=s=>n.check(iy(oy,s)),n.uuid=s=>n.check(Uz(gc,s)),n.uuidv4=s=>n.check($z(gc,s)),n.uuidv6=s=>n.check(Lz(gc,s)),n.uuidv7=s=>n.check(Hz(gc,s)),n.nanoid=s=>n.check(Vz(S2,s)),n.guid=s=>n.check(iy(oy,s)),n.cuid=s=>n.check(Gz(x2,s)),n.cuid2=s=>n.check(Yz(z2,s)),n.ulid=s=>n.check(Qz(w2,s)),n.base64=s=>n.check(Wz(j2,s)),n.base64url=s=>n.check(ew(k2,s)),n.xid=s=>n.check(Kz(E2,s)),n.ksuid=s=>n.check(Fz(T2,s)),n.ipv4=s=>n.check(Jz(N2,s)),n.ipv6=s=>n.check(Iz(A2,s)),n.cidrv4=s=>n.check(Xz(M2,s)),n.cidrv6=s=>n.check(Pz(O2,s)),n.e164=s=>n.check(tw(R2,s)),n.datetime=s=>n.check(Xw(s)),n.date=s=>n.check(Ww(s)),n.time=s=>n.check(t2(s)),n.duration=s=>n.check(i2(s))});function ua(n){return Dz(v2,n)}const kt=I("ZodStringFormat",(n,i)=>{Nt.init(n,i),nb.init(n,i)}),y2=I("ZodEmail",(n,i)=>{qx.init(n,i),kt.init(n,i)}),oy=I("ZodGUID",(n,i)=>{Hx.init(n,i),kt.init(n,i)}),gc=I("ZodUUID",(n,i)=>{Bx.init(n,i),kt.init(n,i)}),b2=I("ZodURL",(n,i)=>{Vx.init(n,i),kt.init(n,i)}),_2=I("ZodEmoji",(n,i)=>{Gx.init(n,i),kt.init(n,i)}),S2=I("ZodNanoID",(n,i)=>{Yx.init(n,i),kt.init(n,i)}),x2=I("ZodCUID",(n,i)=>{Qx.init(n,i),kt.init(n,i)}),z2=I("ZodCUID2",(n,i)=>{Kx.init(n,i),kt.init(n,i)}),w2=I("ZodULID",(n,i)=>{Fx.init(n,i),kt.init(n,i)}),E2=I("ZodXID",(n,i)=>{Jx.init(n,i),kt.init(n,i)}),T2=I("ZodKSUID",(n,i)=>{Ix.init(n,i),kt.init(n,i)}),N2=I("ZodIPv4",(n,i)=>{tz.init(n,i),kt.init(n,i)}),A2=I("ZodIPv6",(n,i)=>{nz.init(n,i),kt.init(n,i)}),M2=I("ZodCIDRv4",(n,i)=>{iz.init(n,i),kt.init(n,i)}),O2=I("ZodCIDRv6",(n,i)=>{az.init(n,i),kt.init(n,i)}),j2=I("ZodBase64",(n,i)=>{sz.init(n,i),kt.init(n,i)}),k2=I("ZodBase64URL",(n,i)=>{rz.init(n,i),kt.init(n,i)}),R2=I("ZodE164",(n,i)=>{oz.init(n,i),kt.init(n,i)}),C2=I("ZodJWT",(n,i)=>{cz.init(n,i),kt.init(n,i)}),ib=I("ZodNumber",(n,i)=)DELIM" -R"DELIM(>{Q0.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(r,o,f)=>Ow(n,r,o),Yo(n,"ZodNumber",{gt(r,o){return this.check(sy(r,o))},gte(r,o){return this.check(rh(r,o))},min(r,o){return this.check(rh(r,o))},lt(r,o){return this.check(ay(r,o))},lte(r,o){return this.check(lh(r,o))},max(r,o){return this.check(lh(r,o))},int(r){return this.check(uy(r))},safe(r){return this.check(uy(r))},positive(r){return this.check(sy(0,r))},nonnegative(r){return this.check(rh(0,r))},negative(r){return this.check(ay(0,r))},nonpositive(r){return this.check(lh(0,r))},multipleOf(r,o){return this.check(ly(r,o))},step(r,o){return this.check(ly(r,o))},finite(){return this}});const s=n._zod.bag;n.minValue=Math.max(s.minimum??Number.NEGATIVE_INFINITY,s.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(s.maximum??Number.POSITIVE_INFINITY,s.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(s.format??"").includes("int")||Number.isSafeInteger(s.multipleOf??.5),n.isFinite=!0,n.format=s.format??null});function Qi(n){return rw(ib,n)}const D2=I("ZodNumberFormat",(n,i)=>{fz.init(n,i),ib.init(n,i)});function uy(n){return ow(D2,n)}const Z2=I("ZodBoolean",(n,i)=>{dz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>jw(n,s,r)});function sr(n){return uw(Z2,n)}const U2=I("ZodUnknown",(n,i)=>{hz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Rw()});function cy(){return cw(U2)}const $2=I("ZodNever",(n,i)=>{mz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>kw(n,s,r)});function L2(n){return fw($2,n)}const H2=I("ZodArray",(n,i)=>{pz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>$w(n,s,r,o),n.element=i.element,Yo(n,"ZodArray",{min(s,r){return this.check(Oc(s,r))},nonempty(s){return this.check(Oc(1,s))},max(s,r){return this.check(I0(s,r))},length(s,r){return this.check(X0(s,r))},unwrap(){return this.element}})});function Yc(n,i){return zw(H2,n,i)}const B2=I("ZodObject",(n,i)=>{vz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Lw(n,s,r,o),ht(n,"shape",()=>i.shape),Yo(n,"ZodObject",{keyof(){return Ho(Object.keys(this._zod.def.shape))},catchall(s){return this.clone({...this._zod.def,catchall:s})},passthrough(){return this.clone({...this._zod.def,catchall:cy()})},loose(){return this.clone({...this._zod.def,catchall:cy()})},strict(){return this.clone({...this._zod.def,catchall:L2()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(s){return DS(this,s)},safeExtend(s){return ZS(this,s)},merge(s){return US(this,s)},pick(s){return RS(this,s)},omit(s){return CS(this,s)},partial(...s){return $S(ab,this,s[0])},required(...s){return LS(sb,this,s[0])}})});function fa(n,i){const s={type:"object",shape:n??{},...Ee(i)};return new B2(s)}const q2=I("ZodUnion",(n,i)=>{yz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Hw(n,s,r,o),n.options=i.options});function Qc(n,i){return new q2({type:"union",options:n,...Ee(i)})}const V2=I("ZodIntersection",(n,i)=>{bz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Bw(n,s,r,o)});function G2(n,i){return new V2({type:"intersection",left:n,right:i})}const Y2=I("ZodTuple",(n,i)=>{_z.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>qw(n,s,r,o),n.rest=s=>n.clone({...n._zod.def,rest:s})});function Q2(n,i,s){const r=i instanceof Tt,o=r?s:i,f=r?i:null;return new Y2({type:"tuple",items:n,rest:f,...Ee(o)})}const bh=I("ZodEnum",(n,i)=>{Sz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(r,o,f)=>Cw(n,r,o),n.enum=i.entries,n.options=Object.values(i.entries);const s=new Set(Object.keys(i.entries));n.extract=(r,o)=>{const f={};for(const d of r)if(s.has(d))f[d]=i.entries[d];else throw new Error(`Key ${d} not found in enum`);return new bh({...i,checks:[],...Ee(o),entries:f})},n.exclude=(r,o)=>{const f={...i.entries};for(const d of r)if(s.has(d))delete f[d];else throw new Error(`Key ${d} not found in enum`);return new bh({...i,checks:[],...Ee(o),entries:f})}});function Ho(n,i){const s=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new bh({type:"enum",entries:s,...Ee(i)})}const K2=I("ZodLiteral",(n,i)=>{xz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Dw(n,s,r),n.values=new Set(i.values),Object.defineProperty(n,"value",{get(){if(i.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return i.values[0]}})});function Co(n,i){return new K2({type:"literal",values:Array.isArray(n)?n:[n],...Ee(i)})}const F2=I("ZodTransform",(n,i)=>{zz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Uw(n,s),n._zod.parse=(s,r)=>{if(r.direction==="backward")throw new k0(n.constructor.name);s.addIssue=f=>{if(typeof f=="string")s.issues.push(Lo(f,s.value,i));else{const d=f;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=s.value),d.inst??(d.inst=n),s.issues.push(Lo(d))}};const o=i.transform(s.value,s);return o instanceof Promise?o.then(f=>(s.value=f,s.fallback=!0,s)):(s.value=o,s.fallback=!0,s)}});function J2(n){return new F2({type:"transform",transform:n})}const ab=I("ZodOptional",(n,i)=>{J0.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>tb(n,s,r,o),n.unwrap=()=>n._zod.def.innerType});function fy(n){return new ab({type:"optional",innerType:n})}const I2=I("ZodExactOptional",(n,i)=>{wz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>tb(n,s,r,o),n.unwrap=()=>n._zod.def.innerType});function X2(n){return new I2({type:"optional",innerType:n})}const P2=I("ZodNullable",(n,i)=>{Ez.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Vw(n,s,r,o),n.unwrap=()=>n._zod.def.innerType});function dy(n){return new P2({type:"nullable",innerType:n})}const W2=I("ZodDefault",(n,i)=>{Tz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Yw(n,s,r,o),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function eE(n,i){return new W2({type:"default",innerType:n,get defaultValue(){return typeof i=="function"?i():D0(i)}})}const tE=I("ZodPrefault",(n,i)=>{Nz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Qw(n,s,r,o),n.unwrap=()=>n._zod.def.innerType});function nE(n,i){return new tE({type:"prefault",innerType:n,get defaultValue(){return typeof i=="function"?i():D0(i)}})}const sb=I("ZodNonOptional",(n,i)=>{Az.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Gw(n,s,r,o),n.unwrap=()=>n._zod.def.innerType});function iE(n,i){return new sb({type:"nonoptional",innerType:n,...Ee(i)})}const aE=I("ZodCatch",(n,i)=>{Mz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Kw(n,s,r,o),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function sE(n,i){return new aE({type:"catch",innerType:n,catchValue:typeof i=="function"?i:()=>i})}const lE=I("ZodPipe",(n,i)=>{Oz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Fw(n,s,r,o),n.in=i.in,n.out=i.out});function hy(n,i){return new lE({type:"pipe",in:n,out:i})}const rE=I("ZodReadonly",(n,i)=>{jz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Jw(n,s,r,o),n.unwrap=()=>n._zod.def.innerType});function oE(n){return new rE({type:"readonly",innerType:n})}const uE=I("ZodCustom",(n,i)=>{kz.init(n,i),jt.init(n,i),n._zod.processJSONSchema=(s,r,o)=>Zw(n,s)});function cE(n,i={}){return ww(uE,n,i)}function fE(n,i){return Ew(n,i)}const Qo=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],kc=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",cat)DELIM" -R"DELIM(egory:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],lb=Qi().int().nonnegative().max(864e13),dE=fa({level:Qi().int().nonnegative(),time:lb,message:ua()}),hE=fa({event:Qi().int().nonnegative(),value:Qi().nonnegative(),time:lb}),mE=fa({previous:Qi().nonnegative()});Qc([dE,hE,mE]);const nm=2**Qo.length-1,dr=nm,pE=2**0+2**1+2**2+2**6+2**7;function gE(n,i){return Number.isInteger(i)&&i>=0&&i0?`${String(s)}d ${String(r)}h`:r>0?`${String(r)}h ${String(o)}m`:o>0?`${String(o)}m ${String(f)}s`:`${String(f)}s`}function ob(n,i){switch(xr(n).valueKind){case"height":return`height ${sn(i)}`;case"seconds":return`${cl(i)} s`;case"milliseconds":return`${cl(i)} ms`;case"microseconds":return`${cl(i)} µs`;case"count":return sn(i);case"fee-rate":return`${cl(i/1e3,3)} sat/vB`;default:return String(i)}}function zE(n){return n>=100?`${cl(n,0)}/s`:n>=10?`${cl(n,1)}/s`:`${cl(n,2)}/s`}function wE(n){try{const i=new URL(n),s=i.pathname==="/"?"":i.pathname.replace(/\/$/u,"");return`${i.host}${s}`}catch{return n}}const Rc=32,EE=[{value:"all",label:"All categories"},{value:"headers",label:"Headers"},{value:"blocks",label:"Blocks"},{value:"transactions",label:"Transactions"},{value:"chain",label:"Confirmed chain"},{value:"mining",label:"Mining"},{value:"timing",label:"Timing"}],TE={headers:"bg-violet-500/15 text-violet-300",blocks:"bg-accent/15 text-accent",transactions:"bg-sky-500/15 text-sky-300",chain:"bg-emerald-500/15 text-emerald-300",mining:"bg-amber-500/15 text-amber-300",timing:"bg-cyan-500/15 text-cyan-300"};function NE({metrics:n,paused:i,onPausedChange:s,onClear:r}){const[o,f]=le.useState(""),[d,p]=le.useState("all"),[m,v]=le.useState({offset:0,search:o,category:d}),x=m.search===o&&m.category===d?m.offset:0,S=le.useRef(null),w=le.useSyncExternalStore(n.subscribeEvents,n.getEventWindow,n.getEventWindow);return le.useEffect(()=>{n.setEventQuery({search:o,category:d,offset:x})},[n,o,d,x]),le.useEffect(()=>{S.current&&(S.current.scrollTop=0)},[o,d]),b.jsxs("section",{className:"space-y-4",children:[b.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node lifecycle"}),b.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Live events"}),b.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."}),b.jsx("p",{className:"text-textMuted mt-1 text-xs",children:"Pause freezes this view; collection and charts continue."})]}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("button",{type:"button",onClick:()=>{i&&(S.current&&(S.current.scrollTop=0),v({offset:0,search:o,category:d})),s(!i)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:i?"Resume display":"Pause display"}),b.jsx("button",{type:"button",onClick:r,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),b.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[b.jsxs("label",{className:"min-w-56 flex-1",children:[b.jsx("span",{className:"sr-only",children:"Search events"}),b.jsx("input",{type:"search",value:o,onChange:M=>{f(M.target.value)},placeholder:"Search event names or values…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),b.jsxs("label",{children:[b.jsx("span",{className:"sr-only",children:"Filter event category"}),b.jsx("select",{value:d,onChange:M=>{p(M.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent rounded-md border px-3 py-2 text-sm focus:ring-0",children:EE.map(M=>b.jsx("option",{value:M.value,children:M.label},M.value))})]})]}),b.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[b.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[b.jsx("span",{children:i?"Display paused · collection continues":x>0?"Viewing older rows · collection continues":"Live stream · newest first"}),b.jsxs("span",{children:[String(w.matched)," matching · ",String(w.retained)," retained"]})]}),b.jsx("div",{ref:S,)DELIM" -R"DELIM(role:"region","aria-label":"Scrollable event history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:M=>{v({offset:Math.max(0,Math.floor(M.currentTarget.scrollTop/Rc)-8),search:o,category:d})},children:w.matched===0?b.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):b.jsx("ol",{"aria-label":"Received events",className:"relative min-w-[32rem]",style:{height:w.matched*Rc},children:w.events.map((M,T)=>b.jsx(AE,{event:M,index:w.offset+T,total:w.matched},M.id))})})]}),!i&&b.jsx("div",{className:"flex justify-end text-xs",children:b.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{S.current&&(S.current.scrollTop=0),v({offset:0,search:o,category:d})},children:"Jump to latest"})}),b.jsxs("details",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[b.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String(kc.length)," identifiers)"]}),b.jsx("div",{className:"border-accentSecondary/20 grid gap-2 border-t p-4 sm:grid-cols-2 lg:grid-cols-3",children:kc.map(M=>b.jsxs("div",{className:"text-xs",children:[b.jsx("span",{className:"text-textMuted font-mono",children:String(M.id).padStart(2,"0")}),b.jsx("span",{className:"text-textPrimary ml-2",children:M.name})]},M.id))})]})]})}const AE=le.memo(function({event:i,index:s,total:r}){const o=xr(i.event);return b.jsxs("li",{"aria-setsize":r,"aria-posinset":s+1,className:"border-accentSecondary/20 absolute inset-x-0 grid grid-cols-[8.5rem_10rem_minmax(0,1fr)] items-center gap-2 border-b px-4 text-xs",style:{top:s*Rc,height:Rc},children:[b.jsx("time",{dateTime:im(i.time),className:"text-textMuted font-mono tabular-nums",children:hr(i.time)}),b.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${TE[o.category]}`,children:o.name}),b.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:ob(i.event,i.value)})]})}),Cc=32,my={0:"bg-sky-500/15 text-sky-300",1:"bg-emerald-500/15 text-emerald-300",2:"bg-violet-500/15 text-violet-300",3:"bg-cyan-500/15 text-cyan-300",4:"bg-indigo-500/15 text-indigo-300",5:"bg-blue-500/15 text-blue-300",6:"bg-red-500/20 text-red-300",7:"bg-orange-500/20 text-orange-300",8:"bg-slate-500/20 text-slate-300",9:"bg-zinc-500/20 text-zinc-300"};function ME({metrics:n,delivery:i,status:s,logFilter:r,paused:o,onLogFilterChange:f,onPausedChange:d,onClear:p}){const[m,v]=le.useState(""),[x,S]=le.useState({offset:0,search:m,filter:r}),w=x.search===m&&x.filter===r?x.offset:0,[M,T]=le.useState(null),k=le.useRef(null),B=le.useSyncExternalStore(n.subscribeLogs,n.getLogWindow,n.getLogWindow);return le.useEffect(()=>{n.setLogQuery({search:m,filter:r,offset:w})},[n,m,r,w]),le.useEffect(()=>{k.current&&(k.current.scrollTop=0)},[m,r]),b.jsxs("section",{className:"space-y-4",children:[b.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Diagnostic stream"}),b.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Node logs"}),b.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx("button",{type:"button",onClick:()=>{o&&(k.current&&(k.current.scrollTop=0),S({offset:0,search:m,filter:r})),d(!o)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:o?"Resume display":"Pause display"}),b.jsx("button",{type:"button",onClick:p,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),b.jsxs("fieldset",{className:"border-accent/30 bg-surface/80 space-y-3 rounded-2xl border p-4",children:[b.jsx("legend",{className:"text-textPrimary px-1 text-sm font-medium",children:"Requested log levels"}),b.jsx("p",{className:"text-textMuted text-xs",children:"Only checked levels are sent by the server. Pause freezes this view; collection and charts continue. Skipped log levels are not replayed."}),b.jsx("div",{className:"flex flex-wrap gap-x-5 gap-y-3",children:Qo.map(V=>b.jsxs("label",{className:"text-textPrimary flex items-center gap-2 text-sm",children:[b.jsx("input",{type:"checkbox",checked:gE(r,V.id),onChange:()=>{f(r^1<{f(pE)},className:"text-accent hover:underline",children:"Operational levels"}),b.jsx("button",{type:"button",onClick:()=>{f(nm)},className:"text-accent hover:underline",children:"All levels"}),b.jsx("button",{type:"button",onClick:()=>{f(0)},className:"text-accent hover:underline",children:"No levels"}),b.jsx("span",{className:"text-textMuted",children:"Selection is saved in this browser."})]})]}),b.jsxs("div",{className:"border-accent/30 bg-surface/80 space-y-2 rounded-2xl border p-4 text-xs",children:[b.jsx("dl",{"aria-label":"Log delivery statistics",className:"flex flex-wrap gap-x-6 gap-y-2",children:[["Received logs",i.totalLogs],["Rolled out of history",i.evictedLogs],["Cleared from history",i.clearedLogs],["Invalid admin frames",i.invalidFrames],["Reconnects",s.reconnects]].map(([V,D])=>b.jsxs("div",{children:[b.jsx("dt",{className:"text-textMuted",children:V}),b.jsx("dd",{className:"text-textPrimary mt-1 font-mono tabular-nums",children:D.toLocaleString()})]},V))}),b.jsx("p",{className:"text-textMuted",children:"Live rows refresh every 100 ms and can skip intermediate messages on screen. Every valid log at a requested level is counted; older messages leave the 1,000-message history as new ones arrive. These counters continue while display is paused. Reconnects can leave gaps that the server does not replay."}),b.jsxs("p",{className:"text-textMuted",role:"status",children:["Admin connection: ",s.phase,s.error?` · ${s.error}`:""]})]}),b.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[b.jsxs("label",{className:"min-w-56 flex-1",children:[b.jsx("span",{className:"sr-only",children:"Search logs"}),b.jsx("input",{type:"search",value:m,onChange:V=>{v(V.target.value)},placeholder:"Search received messages…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),b.jsx("p",{className:"text-textMuted self-center text-xs",children:"Search filters received messages only."})]}),b.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[b.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[b.jsx("span",{children:o?"Display paused · collection continues":r===0?"Log delivery disabled":w>0?"Viewing older rows · collection continues":"Live stream · newest first"}),b.jsxs("span",{children:[String(B.matched)," matching · ",String(B.retained)," retained"]})]}),b.jsx("div",{ref:k,role:"region","aria-label":"Scrollable log history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:V=>{S({offset:Math.max(0,Math.floor(V.currentTarget.scrollTop/Cc)-8),search:m,filter:r})},children:B.matched===0?b.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):b.jsx("ol",{"aria-label":"Received logs",className:"relative",style:{height:B.matched*Cc},children:B.logs.map((V,D)=>b.jsx(OE,{log:V,index:B.offset+D,total:B.matched,onSelect:T},V.id))})})]}),b.jsxs("div",{className)DELIM" -R"DELIM(:"flex items-center justify-between gap-3 text-xs",children:[b.jsx("p",{className:"text-textMuted",children:"Select a row to read its full message."}),!o&&b.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{k.current&&(k.current.scrollTop=0),S({offset:0,search:m,filter:r})},children:"Jump to latest"})]}),M&&b.jsx(jE,{log:M,onClose:()=>{T(null)}})]})}const OE=le.memo(function({log:i,index:s,total:r,onSelect:o}){return b.jsx("li",{"aria-setsize":r,"aria-posinset":s+1,className:"border-accentSecondary/20 absolute inset-x-0 border-b",style:{top:s*Cc,height:Cc},children:b.jsxs("button",{type:"button",onClick:()=>{o(i)},className:"hover:bg-accentSecondary/10 focus-visible:bg-accentSecondary/20 grid h-full w-full grid-cols-[5.5rem_4.5rem_minmax(0,1fr)] items-center gap-2 px-4 text-left text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[b.jsx("time",{dateTime:im(i.time),className:"text-textMuted font-mono tabular-nums",children:hr(i.time,!1)}),b.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${my[i.level]??my[8]}`,children:rb(i.level).name}),b.jsx("span",{className:"text-textPrimary min-w-0 truncate font-mono",children:i.message.replaceAll(` -`," ↵ ")})]})})});function jE({log:n,onClose:i}){const s=le.useRef(null);return le.useEffect(()=>{const r=s.current;return r?.showModal(),()=>{r?.close()}},[]),b.jsxs("dialog",{ref:s,onClose:i,"aria-labelledby":"log-detail-title",className:"border-accent/30 bg-surface/95 text-textPrimary fixed inset-0 m-auto max-h-[80vh] w-[min(60rem,90vw)] rounded-2xl border p-5 shadow-xl backdrop:bg-black/60",children:[b.jsxs("header",{className:"mb-4 flex items-center justify-between gap-4",children:[b.jsxs("h3",{id:"log-detail-title",className:"text-accent text-lg font-semibold",children:[rb(n.level).label," · ",im(n.time)??"Invalid time"]}),b.jsx("button",{type:"button",onClick:i,className:"text-accent rounded px-3 py-2",children:"Close"})]}),b.jsx("pre",{className:"text-sm break-words whitespace-pre-wrap",children:n.message})]})}const ub=fa({address:sr(),filter:sr(),turbo:sr(),witness:sr(),retarget:sr(),difficult:sr(),pruned:Qi().int().nonnegative()}),cb=fa({height:Qi().int().nonnegative(),timestamp:Qi().int().positive().max(4294967295)}),vc=Qi().int().nonnegative().max(Number.MAX_SAFE_INTEGER),fb=fa({count:vc,virtual:vc,fee:vc,histogram:Yc(Q2([Qi().nonnegative(),vc]))}),db="/v1/fees?format=json",hb=5e3,Bo=15e3,mb=Qi().int().nonnegative();function kE(n){try{const i=JSON.parse(n),s=ub.safeParse(i);if(s.success)return{type:"configuration",payload:s.data};const r=cb.safeParse(i);if(r.success)return{type:"header",payload:r.data};const o=fb.safeParse(i);if(o.success)return{type:"fees",payload:o.data};const f=mb.safeParse(i);return f.success?{type:"top",payload:f.data}:null}catch{return null}}function wc(n,i){return new URL(i,`${n.replace(/\/+$/u,"")}/`).toString()}async function Ec(n,i){const s=await fetch(n,{headers:{Accept:"application/json"},signal:i});if(!s.ok)throw new Error(`Native API request failed with status ${String(s.status)}`);return await s.json()}async function RE(n,i){const[s,r]=await Promise.all([Ec(wc(n,"/v1/configuration?format=json"),i),Ec(wc(n,"/v1/top?format=json"),i)]),o=ub.parse(s),f=mb.parse(r),d=Date.now();let p=null;try{const m=cb.parse(await Ec(wc(n,pb(f)),i));m.height===f&&(p=m)}catch{i?.throwIfAborted()}return{configuration:o,top:f,topHeader:p,receivedAt:d}}function pb(n){return`/v1/block/height/${String(n)}/header?format=json`}async function CE(n,i){return{data:fb.parse(await Ec(wc(n,db),i)),receivedAt:Date.now()}}const oh=["line","area","bar"],py=["line","step","area"],DE=["line","step","area"],gb={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:oh},"occurrence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:oh},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:py},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:DE},"payload-average":{id:"payload-average",label:"Average value",description:"Average payload value within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-minimum":{id:"payload-minimum",label:"Minimum value",description:"Minimum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-maximum":{id:"payload-maximum",label:"Maximum value",description:"Maximum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-sum":{id:"payload-sum",label:"Value per bucket",description:"Sum of count payloads within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-cumulative":{id:"payload-cumulative",label:"Cumulative value",description:"Running sum of count payloads during this browser session.",unit:"count",chartTypes:py},"payload-change-rate":{id:"payload-change-rate",label:"Height change rate",description:"Change in the latest observed height per second.",unit:"height-per-second",chartTypes:oh}},pl=["occurrence-rate","occurrence-count","cumulative-occurrences"],ZE=["payload-latest","payload-maximum","payload-change-rate",...pl],UE=["payload-average","payload-latest","payload-minimum","payload-maximum",...pl],$E=["payload-sum","payload-cumulative","payload-latest","payload-average",...pl],vb=["payload-latest","payload-average","payload-minimum","payload-maximum"],yb=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function ti(n){return`event:${String(n)}`}function Ts(n){return`log:${String(n)}`}const Dc="native:top";function LE(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function HE(n){switch(n){case"height":return ZE;case"duration":return UE;case"count":return $E;case"fee-rate":return[...vb,...pl];default:return pl}}function BE(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function bb(n){const i=xr(n),s=LE(i.valueKind);return{id:ti(n),source:"event",sourceId:n,name:i.name,label:i.label,category:i.category,payloadKind:s,allowedMeasures:HE(s),defaultMeasure:BE(s),description:n===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":s==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${i.label} event with a ${s} payload.`}}const qE=[...yb.map(n=>({id:n.id,source:"pool",sourceId:n.field,name:n.field,label:n.label,category:"pool",payloadKind:n.payloadKind,allowedMeasures:vb,defaultMeasure:"payload-latest",description:n.description})),...kc.map(n=>bb(n.id)),...Qo.map(n=>({id:Ts(n.id),source:"log",sourceId:n.id,name:n.name,label:`${n.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:pl,defaultMeasure:"occurrence-rate",description:`${n.label} log message volume. Message text is not interpreted as numeric data.`})),{id:Dc,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate)DELIM" -R"DELIM("],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}],am=qE,VE=new Map(am.map(n=>[n.id,n]));function Ba(n){const i=VE.get(n);if(i)return i;const s=/^event:(\d+)$/u.exec(n);return s?bb(Number(s[1])):{id:n,source:"event",sourceId:-1,name:n,label:n,category:"unknown",payloadKind:"unknown",allowedMeasures:pl,defaultMeasure:"occurrence-rate",description:"Unknown signal; only occurrence measurements are available."}}function As(n,i){const s=gb[i];if(i.startsWith("occurrence")||i==="cumulative-occurrences")return s;const r=i==="payload-change-rate"?"height-per-second":n.payloadKind==="height"?"height":n.payloadKind==="duration"?"milliseconds":n.payloadKind==="fee-rate"?"sat-per-vbyte":n.payloadKind==="transactions"||n.payloadKind==="vbytes"||n.payloadKind==="satoshis"?n.payloadKind:"count";return{...s,unit:r}}function GE(n,i){return n.allowedMeasures.includes(i)}function YE(n,i){return xr(n).valueKind==="fee-rate"?i/1e3:_E(n,i)??i}const QE=3600*1e3,KE=1e3,FE=1e3,JE=1e3;class gy{constructor(i){this.capacity=i,this.#e=Array.from({length:i})}capacity;#e;#t=0;#n=0;#i=null;get size(){return this.#n}push(i){const s=this.#n===this.capacity;return this.#i=null,this.#e[this.#t]=i,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity),s}clear(){this.#i=null,this.#e.fill(void 0),this.#t=0,this.#n=0}newestFirst(){if(this.#i)return this.#i;const i=[];for(let s=0;sthis.#R;getRecentLogs=()=>this.#i.newestFirst();getRecentEvents=()=>this.#l.newestFirst();subscribe=i=>(this.#n.add(i),()=>{this.#n.delete(i)});start(){this.#M||(this.tick(),this.#M=setInterval(()=>{this.tick()},1e3))}stop(){this.#M&&(clearInterval(this.#M),this.#M=null),this.#v&&(clearTimeout(this.#v),this.#v=null)}ingest(i,s=this.#e()){const r=this.#j(s);this.#d+=1,vE(i)?this.#O(i,r):yE(i)?this.#Z(i,r):bE(i)&&(this.#w+=1),this.#N()}recordInvalidFrame(){this.#z+=1,this.#N()}recordNativeTop(i,s=this.#e()){const r=this.#j(s),o=this.#m[Dc];o?.value===i&&r-o.time<15e3||(this.#C(Dc,r,i),this.#D(r),this.#N())}recordNativeFees(i,s=this.#e()){if(!Number.isFinite(s)||s=Bo||this.#T!==null&&s<=this.#T.receivedAt)return;const r=this.#j(s);this.#T={data:i,receivedAt:s};for(const o of yb)this.#C(o.id,r,i[o.field]);this.#D(r),this.#N()}clearLogs(){this.#y+=this.#i.size,this.#i.clear(),this.flush()}clearEvents(){this.#l.clear(),this.flush()}reset(){this.#i.clear(),this.#l.clear(),this.#a.clear(),this.#o={},this.#s={},this.#u={},this.#r={},this.#p={},this.#m={},this.#c={},this.#f=this.#j(this.#e()),this.#d=0,this.#b=0,this.#S=0,this.#y=0,this.#x=0,this.#w=0,this.#z=0,this.#_=null,this.#E=null,this.#T=null,this.#A=0,this.#g(this.#f),this.flush()}tick(){const i=this.#j(this.#e());this.#g(i),this.#D(i),this.#N()}flush(){this.#v&&(clearTimeout(this.#v),this.#v=null),this.#R=this.#k();for(const i of this.#n)i()}#O(i,s){this.#b+=1,this.#_=s,this.#A+=1,this.#i.push({...i,id:this.#A,receivedAt:s})&&(this.#S+=1),this.#C(Ts(i.level),s,null)}#Z(i,s){this.#x+=1,this.#E=s,this.#A+=1,this.#l.push({...i,id:this.#A,receivedAt:s}),this.#C(ti(i.event),s,YE(i.event,i.value))}#j(i){return Number.isFinite(i)?(this.#h=Math.max(this.#h,i),this.#h):this.#h}#C(i,s,r){const o=this.#g(s);o.snapshot=null;const f=o.signals.get(i)??IE();if(f.count+=1,yc(this.#r,i,1),r!==null){f.samples+=1,f.sum+=r,f.minimum=f.minimum===null?r:Math.min(f.minimum,r),f.maximum=f.maximum===null?r:Math.max(f.maximum,r),(f.firstAt===null||s=f.lastAt)&&(f.last=r,f.lastAt=s),yc(this.#p,i,r);const d=this.#m[i];(!d||s>=d.time)&&(this.#m[i]={value:r,time:s}),this.#c[i]=Math.max(this.#c[i]??r,r)}o.signals.set(i,f)}#g(i){const s=Math.floor(i/1e3)*1e3,r=this.#a.get(s);if(r)return r;const o={time:s,signals:new Map,snapshot:null};return this.#a.set(s,o),o}#D(i){const s=i-QE;for(const[r,o]of this.#a){if(r>=s)break;for(const[f,d]of o.signals)if(yc(this.#o,f,d.count),yc(this.#s,f,d.sum),d.last!==null&&d.lastAt!==null){const p=this.#u[f];(!p||d.lastAt>=p.time)&&(this.#u[f]={value:d.last,time:d.lastAt})}this.#a.delete(r)}}#N(){!this.#t||this.#v||(this.#v=setTimeout(()=>{this.#v=null,this.flush()},KE))}#k(){const i=[...this.#a.values()].map(s=>(s.snapshot??={time:s.time,signals:Object.fromEntries([...s.signals].map(([r,o])=>[r,{...o}]))},s.snapshot));return{now:this.#j(this.#e()),sessionStartedAt:this.#f,totalFrames:this.#d,totalLogs:this.#b,evictedLogs:this.#S,clearedLogs:this.#y,totalEvents:this.#x,totalAcks:this.#w,invalidFrames:this.#z,buckets:i,priorSignalCounts:{...this.#o},priorSignalSums:{...this.#s},priorSignalLatest:vy(this.#u),signalTotals:{...this.#r},signalSums:{...this.#p},signalLatest:vy(this.#m),signalMaximums:{...this.#c},recentLogs:this.#i.newestFirst(),recentEvents:this.#l.newestFirst(),lastLogAt:this.#_,lastEventAt:this.#E,poolSnapshot:this.#T}}}function XE(n,i,s,r,o=n[0]?.time??s){const f=s-r*1e3,d=f<=o,p=d?Math.floor(o/1e3)*1e3:Math.ceil(f/1e3)*1e3,m=d?o:p,v=Math.floor(s/1e3)*1e3,S=n.filter(M=>M.time>=p&&M.time<=v).reduce((M,T)=>M+(T.signals[i]?.count??0),0),w=Math.max(0,(s-m)/1e3);return w>0?S/w:0}function PE(n,i){const s=d=>XE(n.buckets,ti(d),n.now,i,n.sessionStartedAt),r=s(2)+s(14);if(r>0)return{label:"Reorganizing",rate:r};const f=[{label:"Confirming blocks",rate:s(6)},{label:"Validating blocks",rate:s(5)},{label:"Archiving blocks",rate:s(3)},{label:"Synchronizing headers",rate:Math.max(s(0),s(1))}].reduce((d,p)=>p.rate>d.rate?p:d);return f.rate>0?f:{label:"Idle",rate:0}}const Kc=18,WE=600*1e3;function eT(n,i,s){if(n===null||!Number.isSafeInteger(n)||n<0||i===null||!Number.isSafeInteger(i.height)||i.height<0||i.height>n||!Number.isFinite(i.timestamp)||i.timestamp<=0||!Number.isFinite(s)||s<0)return null;const r=Math.max(0,s-i.timestamp*1e3),o=Math.max(n,i.height+Math.ceil(r/WE));return{blocksRemaining:o-n,estimatedTop:o,progress:o===0?100:n/o*100}}const tT={idle:"border-slate-500/50 bg-slate-500/20 text-slate-300",connecting:"border-amber-500/50 bg-amber-500/20 text-amber-300",connected:"border-emerald-500/50 bg-emerald-500/20 text-emerald-300",reconnecting:"border-amber-500/50 bg-amber-500/20 text-amber-300"},nT={idle:"bg-slate-400",connecting:"bg-amber-400",connected:"bg-emerald-400",reconnecting:"bg-amber-400"};function iT({phase:n,label:i}){return b.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full border px-2 py-1 text-xs font-medium tracking-wide uppercase ${tT[n]}`,children:[b.jsx("span",{className:`h-2 w-2 rounded-full ${nT[n]}`,"aria-hidden":"true"}),i]})}function bc({label:n,value:i,detail:s,numeric:r=!0,emphasized:o=!1}){return b.jsxs("div",{className:"border-accent/30 bg-surface/80 min-w-0 space-y-2 rounded-2xl border p-5",children:[b.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),b.jsx("dd",{className:`text-2xl font-semibold break-words ${r?"tabular-nums":""} ${o?"text-accent":"text-textPrimary"}`,children:i}),b.jsx("dd",{className:"text-textMuted text-sm break-words",children:s})]})}function aT({confirmed:n,estimate:i}){if(n===null||i===null||i.blocksRemaining<=Kc)return null;const s=Math.min(99.99,Math.max(0,i.progress)),r=`${s.toFixed(2)}%`;return b.jsxs("section",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border","aria-labelledby":"node-sync-)DELIM" -R"DELIM(progress-title",children:[b.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3 px-5 pt-5",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node synchronization"}),b.jsx("h2",{id:"node-sync-progress-title",className:"text-accent mt-1 text-lg font-semibold",children:"Catching up to estimated chain tip"})]}),b.jsx("p",{className:"text-accent text-2xl font-semibold tabular-nums",children:r})]}),b.jsx("div",{className:"px-5 pt-4",children:b.jsx("div",{role:"progressbar","aria-label":"Node synchronization progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(s.toFixed(2)),"aria-valuetext":`Approximately ${sn(i.blocksRemaining)} blocks remaining`,className:"bg-background border-accentSecondary/20 h-3 overflow-hidden rounded-full border",children:b.jsx("div",{className:"bg-accent h-full rounded-full transition-[width] duration-700",style:{width:`${String(s)}%`}})})}),b.jsxs("dl",{className:"bg-accentSecondary/10 mt-5 grid gap-px text-sm sm:grid-cols-3",children:[b.jsx(uh,{label:"Confirmed top",value:sn(n)}),b.jsx(uh,{label:"Estimated chain tip",value:sn(i.estimatedTop)}),b.jsx(uh,{label:"Estimated blocks remaining",value:sn(i.blocksRemaining)})]}),b.jsx("p",{className:"bg-surface text-textMuted border-accentSecondary/20 border-t px-5 py-2 text-[11px]",children:"Estimated from the confirmed block timestamp and your browser clock, assuming one block every 10 minutes. Actual block counts may differ."})]})}function uh({label:n,value:i}){return b.jsxs("div",{className:"bg-surface px-5 py-3",children:[b.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),b.jsx("dd",{className:"text-textPrimary mt-1 text-lg font-semibold tabular-nums",children:i})]})}const or=16,_h=8,Fc=80,sT=[300,900,3600],Sh=["line","step","area","bar"],_b=["linear","compressed"],Ot=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],lT=Ho(["occurrence-count","occurrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),rT=fa({id:ua().min(1).max(100),signalId:ua().min(1).max(100),measure:lT,color:ua().regex(/^#[\da-f]{6}$/iu),label:ua().max(80).optional()}).strict(),oT=fa({id:ua().min(1).max(100),title:ua().trim().min(1).max(Fc),visualization:Ho(Sh),scale:Ho(_b).default("linear"),range:Qc([Co(300),Co(900),Co(3600)]),series:Yc(rT).min(1).max(_h)}).strict(),uT=fa({id:ua().min(1).max(100),title:ua().trim().min(1).max(Fc),visualization:Co("histogram"),scale:Ho(_b).default("linear"),color:ua().regex(/^#[\da-f]{6}$/iu)}).strict(),Sb=Qc([oT,uT]),cT=fa({version:Co(1),charts:Yc(Sb).max(or)}).strict();function Xt(n){return n.visualization!=="histogram"}const sm={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",scale:"linear",range:900,series:[mn("sync-header",ti(0),"occurrence-rate",Ot[3]),mn("sync-archive",ti(3),"occurrence-rate",Ot[0]),mn("sync-validate",ti(5),"occurrence-rate",Ot[1]),mn("sync-confirm",ti(6),"occurrence-rate",Ot[2])]},xb={id:"default-chain-progress",title:"Chain progress",visualization:"step",scale:"linear",range:900,series:[mn("progress-top",Dc,"payload-latest",Ot[0]),mn("progress-organized",ti(13),"payload-latest",Ot[2]),mn("progress-confirmed",ti(6),"payload-latest",Ot[1])]},zb={id:"default-log-volume",title:"Log volume",visualization:"bar",scale:"linear",range:900,series:[mn("logs-news",Ts(1),"occurrence-rate",Ot[2]),mn("logs-session",Ts(2),"occurrence-rate",Ot[3]),mn("logs-protocol",Ts(3),"occurrence-rate",Ot[1]),mn("logs-remote",Ts(5),"occurrence-rate",Ot[7]),mn("logs-fault",Ts(6),"occurrence-rate",Ot[4]),mn("logs-quitting",Ts(7),"occurrence-rate",Ot[0])]},Jc={id:"default-pool-transactions",title:"Pool transactions",visualization:"step",scale:"linear",range:900,series:[mn("pool-count","pool:count","payload-latest",Ot[0])]},wb={...Jc,id:"default-pool-fees",title:"Pool total fees",series:[mn("pool-fees","pool:total_fee","payload-latest",Ot[3])]},Eb={...Jc,id:"default-pool-virtual-size",title:"Pool virtual size",series:[mn("pool-size","pool:vsize","payload-latest",Ot[1])]},by={id:"default-transaction-archive-rate",title:"Transactions archived / second",visualization:"line",scale:"linear",range:900,series:[mn("tx-archived",ti(10),"occurrence-rate",Ot[2])]},Tb={id:"default-pool-fee-histogram",title:"Pool fee distribution",visualization:"histogram",scale:"linear",color:Ot[0]},Nb=[{id:"pool-fee-histogram",label:"Pool fee distribution",description:"Current pool virtual size grouped by fee rate.",chart:Tb},{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:sm},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:xb},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:zb},{id:"pool-transactions",label:"Pool transactions",description:"Current pool transaction count, sampled every five seconds.",chart:Jc},{id:"transaction-archive-rate",label:"Transaction archive rate",description:"Newly archived transactions per second, including compact-block recovery.",chart:by},{id:"pool-virtual-size",label:"Pool virtual size",description:"Current pool virtual size in vbytes.",chart:Eb},{id:"pool-fees",label:"Pool total fees",description:"Total fees currently in the pool, in satoshis.",chart:wb},{id:"transaction-fee-rate",label:"Archived transaction fee rate",description:"Average fee rate of newly archived transactions, in sat/vB.",chart:{...by,id:"template-tx-fees",title:"Archived transaction fee rate",series:[mn("tx-fee-rate",ti(10),"payload-average",Ot[0])]}}],Ab="libbitcoinAdminDashboardCharts";let _y=0;function mn(n,i,s,r){return{id:n,signalId:i,measure:s,color:r}}function Do(n){return _y+=1,`${n}-${Date.now().toString(36)}-${String(_y)}`}function lm(n,i=!1){return Xt(n)?{...n,id:i?Do("chart"):n.id,series:n.series.map(s=>({...s,id:i?Do("series"):s.id}))}:{...n,id:i?Do("chart"):n.id}}function Tc(){return[sm,xb,zb,Jc,wb,Eb,Tb].map(n=>lm(n))}function fT(n){const i=Nb.find(s=>s.id===n);return lm(i?.chart??sm,!0)}function Mb(){return{id:Do("chart"),title:"Custom chart",visualization:"line",scale:"linear",range:900,series:[{id:Do("series"),signalId:ti(3),measure:"occurrence-rate",color:Ot[0]}]}}function dT(n){const i=" copy",s=`${n.title.slice(0,Fc-i.length).trimEnd()}${i}`;return{...lm(n,!0),title:s}}function xh(n){if(!Xt(n))return"vbytes";const i=new Set(n.series.map(s=>As(Ba(s.signalId),s.measure).unit));return i.size===1?[...i][0]??null:null}function Ob(n){const i=Sb.safeParse(n);if(!i.success)return i.error.issues[0]?.message??"Invalid chart configuration";if(!Xt(n))return null;for(const s of n.series){const r=Ba(s.signalId);if(!GE(r,s.measure))return`${gb[s.measure].label} is not valid for ${r.label}.`;const o=As(r,s.measure);if(!o.chartTypes.includes(n.visualization))return`${o.label} cannot be displayed as a ${n.visualization} chart.`}return xh(n)===null?"All series on a chart must use compatible units.":null}function jb(n){const i=cT.safeParse(n);return!i.success||new Set(i.data.charts.map(s=>s.id)).size!==i.data.charts.length||i.data.charts.some(s=>Xt(s)&&new Set(s.series.map(r=>r.id)).size!==s.series.length)?null:i.data.charts.every(s=>Ob(s)===null)?i.data.charts:null}function kb(){try{return globalThis.window?.localStorage??null}catch{return null}}function hT(n=kb()){try{const i=n?.getItem(Ab);return i?jb(JSON.parse(i))??Tc():Tc()}catch{return Tc()}}function mT(n,i=kb()){try{const s={version:1,charts:n};if(!jb(s))return;i?.setItem(Ab,JSON.stringify(s))}catch{}}function rm(n,i){return n.signals[i]}function Sy(n,i,s,r){let o=r==="count"?n.priorSignalCounts[i]??0:n.priorSignalSums[i]??0;for(const f of n.buckets){if(f.time>=s)break;const d=rm(f,i);o+=r==="count"?d?.count??0:d?.sum??0}return o}function pT(n,i,s){let r=n.priorSignalLatest[i]??null;for(con)DELIM" -R"DELIM(st o of n.buckets){if(o.time>=s)break;const f=rm(o,i);f?.last!==null&&f?.last!==void 0&&f.lastAt!==null&&(r={value:f.last,time:f.lastAt})}return r}function gT(n,i){const s=i<=n.sessionStartedAt?Math.floor(n.sessionStartedAt/1e3)*1e3:Math.ceil(i/1e3)*1e3,r=Math.floor(n.now/1e3)*1e3,o=new Map(n.buckets.map(d=>[d.time,d])),f=[];for(let d=s;d<=r;d+=1e3)f.push(o.get(d)??{time:d,signals:{}});return f}function vT(n,i,s){const r=Math.max(n.time,s),o=Math.min(i,n.time+1e3);return Math.max(0,(o-r)/1e3)}function yT(n,i,s,r){const o=Ba(r.signalId);let f=r.measure==="cumulative-occurrences"?Sy(n,r.signalId,s,"count"):r.measure==="payload-cumulative"?Sy(n,r.signalId,s,"sum"):0,d=pT(n,r.signalId,s);return i.map(p=>{const m=rm(p,r.signalId);switch(r.measure){case"occurrence-count":return m?.count??0;case"occurrence-rate":{const v=vT(p,n.now,n.sessionStartedAt);return v>0?(m?.count??0)/v:0}case"cumulative-occurrences":return f+=m?.count??0,f;case"payload-sum":return m&&m.samples>0?m.sum:null;case"payload-cumulative":return f+=m?.sum??0,f;case"payload-average":return m&&m.samples>0?m.sum/m.samples:null;case"payload-minimum":return m?.minimum??null;case"payload-maximum":return m?.maximum??null;case"payload-latest":{if(m?.last!==null&&m?.last!==void 0&&m.lastAt!==null)return d={value:m.last,time:m.lastAt},m.last;if(o.source==="pool"){const v=Math.min(p.time+1e3,n.now);return d&&v-d.time0?(m.last-v.value)/x:null}}})}function bT(n,i){const s=n.now-i.range*1e3,r=gT(n,s),o=r[0]?.time??Math.floor(n.now/1e3)*1e3,f=i.series[0],d=As(Ba(f.signalId),f.measure).unit,p=i.series.filter(m=>(n.signalTotals[m.signalId]??0)===0).map(m=>m.label??Ba(m.signalId).label);return{data:[r.map(m=>m.time/1e3),...i.series.map(m=>yT(n,r,o,m))],unit:d,hasObservedData:p.length{const s=()=>{i(Date.now())},r=setInterval(s,1e3);return window.addEventListener("focus",s),document.addEventListener("visibilitychange",s),()=>{clearInterval(r),window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",s)}},[]),n}const xT={300:"5 minutes",900:"15 minutes",3600:"1 hour"},zT={line:"Line",step:"Step",area:"Area",bar:"Bar"};function wT(n){return Xt(n)?{...n,series:n.series.map(i=>({...i}))}:{...n}}function ET(){const n=new Map;for(const i of am){const s=n.get(i.category)??[];s.push(i),n.set(i.category,s)}return[...n]}const TT=ET();function NT({chart:n,mode:i,onCancel:s,onSave:r}){const[o,f]=le.useState(()=>wT(n)),d=Ob(o),p=xh(o);le.useEffect(()=>{function T(k){k.key==="Escape"&&s()}return globalThis.addEventListener("keydown",T),()=>{globalThis.removeEventListener("keydown",T)}},[s]);const m=le.useMemo(()=>new Set(Sh.filter(T=>Xt(o)&&o.series.every(k=>As(Ba(k.signalId),k.measure).chartTypes.includes(T)))),[o]);function v(T){f(k=>Xt(k)?T(k):k)}function x(T,k){v(B=>({...B,series:B.series.map((V,D)=>D===T?k:V)}))}function S(T,k){if(!Xt(o))return;const B=o.series[T],V=Ba(k);x(T,{...B,signalId:k,measure:V.defaultMeasure})}function w(){if(!Xt(o)||o.series.length>=_h)return;const T=xh(o),k=am.find(D=>D.allowedMeasures.some(ee=>T===null||As(D,ee).unit===T));if(!k)return;const B=k.allowedMeasures.find(D=>T===null||As(k,D).unit===T)??k.defaultMeasure,V={id:`series-${Date.now().toString(36)}-${String(o.series.length+1)}`,signalId:k.id,measure:B,color:Ot[o.series.length%Ot.length]??Ot[0]};v(D=>({...D,series:[...D.series,V]}))}function M(T){T.preventDefault(),!d&&r({...o,title:o.title.trim()})}return b.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:T=>{T.target===T.currentTarget&&s()},children:b.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"chart-editor-title",className:"border-accent/30 bg-surface/95 max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/60",children:[b.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Dashboard builder"}),b.jsx("h2",{id:"chart-editor-title",className:"text-accent mt-1 text-xl font-semibold",children:i==="add"?"Add chart":"Edit chart"})]}),b.jsx("button",{type:"button",onClick:s,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close chart editor",children:"×"})]}),i==="add"&&b.jsxs("div",{className:"border-accentSecondary/20 border-b p-5",children:[b.jsx("p",{className:"text-accentSecondary mb-3 text-xs tracking-wide uppercase",children:"Start from a template"}),b.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-5",children:[Nb.map(T=>b.jsxs("button",{type:"button",onClick:()=>{f(fT(T.id))},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[b.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:T.label}),b.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:T.description})]},T.id)),b.jsxs("button",{type:"button",onClick:()=>{f(Mb())},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[b.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:"Custom"}),b.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:"Begin with one editable series."})]})]})]}),b.jsxs("form",{onSubmit:M,className:"space-y-6 p-5",children:[b.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_11rem_11rem]",children:[b.jsxs("label",{className:"space-y-2",children:[b.jsx("span",{className:"text-sm font-medium",children:"Chart title"}),b.jsx("input",{value:o.title,maxLength:Fc,onChange:T=>{f(k=>({...k,title:T.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),Xt(o)?b.jsxs(b.Fragment,{children:[b.jsxs("label",{className:"space-y-2",children:[b.jsx("span",{className:"text-sm font-medium",children:"Chart type"}),b.jsx("select",{value:o.visualization,onChange:T=>{v(k=>({...k,visualization:T.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:Sh.map(T=>b.jsx("option",{value:T,disabled:!m.has(T),children:zT[T]},T))})]}),b.jsxs("label",{className:"space-y-2",children:[b.jsx("span",{className:"text-sm font-medium",children:"Time range"}),b.jsx("select",{value:o.range,onChange:T=>{v(k=>({...k,range:Number(T.target.value)}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:sT.map(T=>b.jsx("option",{value:T,children:xT[T]},T))})]})]}):b.jsxs("label",{className:"space-y-2",children:[b.jsx("span",{className:"text-sm font-medium",)DELIM" -R"DELIM(children:"Bar color"}),b.jsx("input",{type:"color",value:o.color,onChange:T=>{const k=T.target.value;f(B=>Xt(B)?B:{...B,color:k})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]})]}),Xt(o)?b.jsxs("section",{className:"space-y-3",children:[b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("h3",{className:"text-accent text-lg font-semibold",children:"Series"}),b.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:["One chart uses one axis unit",p===null?".":`: ${Rb(p)}.`]})]}),b.jsx("button",{type:"button",onClick:w,disabled:o.series.length>=_h,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary disabled:text-textMuted rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",children:"Add series"})]}),b.jsx("div",{className:"space-y-3",children:o.series.map((T,k)=>{const B=Ba(T.signalId),V=As(B,T.measure);return b.jsxs("article",{className:"border-accentSecondary/20 bg-accent/5 grid gap-3 rounded-xl border p-4 lg:grid-cols-[minmax(12rem,1.2fr)_minmax(11rem,1fr)_minmax(9rem,0.8fr)_3.5rem_auto]",children:[b.jsxs("label",{className:"space-y-1.5",children:[b.jsxs("span",{className:"text-textMuted text-xs",children:["Signal ",String(k+1)]}),b.jsx("select",{"aria-label":`Signal ${String(k+1)}`,value:T.signalId,onChange:D=>{S(k,D.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",children:TT.map(([D,ee])=>b.jsx("optgroup",{label:D,children:ee.map(G=>b.jsx("option",{value:G.id,children:G.label},G.id))},D))})]}),b.jsxs("label",{className:"space-y-1.5",children:[b.jsx("span",{className:"text-textMuted text-xs",children:"Measurement"}),b.jsx("select",{"aria-label":`Measurement ${String(k+1)}`,value:T.measure,onChange:D=>{x(k,{...T,measure:D.target.value})},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",title:V.description,children:B.allowedMeasures.map(D=>b.jsx("option",{value:D,children:As(B,D).label},D))})]}),b.jsxs("label",{className:"space-y-1.5",children:[b.jsx("span",{className:"text-textMuted text-xs",children:"Display label"}),b.jsx("input",{"aria-label":`Display label ${String(k+1)}`,value:T.label??"",onChange:D=>{x(k,{...T,label:D.target.value||void 0})},placeholder:B.label,className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/50 focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0"})]}),b.jsxs("label",{className:"space-y-1.5",children:[b.jsx("span",{className:"text-textMuted text-xs",children:"Color"}),b.jsx("input",{"aria-label":`Series color ${String(k+1)}`,type:"color",value:T.color,onChange:D=>{x(k,{...T,color:D.target.value})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]}),b.jsx("button",{type:"button",onClick:()=>{v(D=>({...D,series:D.series.filter((ee,G)=>G!==k)}))},disabled:o.series.length===1,"aria-label":`Remove series ${String(k+1)}`,className:"text-textMuted self-end rounded-md px-3 py-2 text-sm hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-30",children:"Remove"})]},T.id)})})]}):b.jsx("p",{className:"text-textMuted text-sm",children:"Shows the latest transaction-pool fee distribution, refreshed every five seconds. Each bar shows the virtual size of one fee-rate group, labeled by its minimum fee rate in sat/vB."}),d&&b.jsx("p",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:d}),b.jsxs("div",{className:"border-accentSecondary/20 flex justify-end gap-2 border-t pt-4",children:[b.jsx("button",{type:"button",onClick:s,className:"text-textMuted hover:text-accent rounded-md px-4 py-2 text-sm",children:"Cancel"}),b.jsx("button",{type:"submit",disabled:d!==null,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:i==="add"?"Add chart":"Save changes"})]})]})]})})}const AT=!0,rn="u-",MT="uplot",OT=rn+"hz",jT=rn+"vt",kT=rn+"title",RT=rn+"wrap",CT=rn+"under",DT=rn+"over",ZT=rn+"axis",ul=rn+"off",UT=rn+"select",$T=rn+"cursor-x",LT=rn+"cursor-y",HT=rn+"cursor-pt",BT=rn+"legend",qT=rn+"live",VT=rn+"inline",GT=rn+"series",YT=rn+"marker",xy=rn+"label",QT=rn+"value",jo="width",ko="height",No="top",zy="bottom",lr="left",ch="right",om="#000",wy=om+"0",fh="mousemove",Ey="mousedown",dh="mouseup",Ty="mouseenter",Ny="mouseleave",Ay="dblclick",KT="resize",FT="scroll",My="change",Zc="dppxchange",um="--",zr=typeof window<"u",zh=zr?document:null,mr=zr?window:null,JT=zr?navigator:null;let Pe,_c;function wh(){let n=devicePixelRatio;Pe!=n&&(Pe=n,_c&&Th(My,_c,wh),_c=matchMedia(`(min-resolution: ${Pe-.001}dppx) and (max-resolution: ${Pe+.001}dppx)`),dl(My,_c,wh),mr.dispatchEvent(new CustomEvent(Zc)))}function mi(n,i){if(i!=null){let s=n.classList;!s.contains(i)&&s.add(i)}}function Eh(n,i){let s=n.classList;s.contains(i)&&s.remove(i)}function zt(n,i,s){n.style[i]=s+"px"}function Vi(n,i,s,r){let o=zh.createElement(n);return i!=null&&mi(o,i),s?.insertBefore(o,r),o}function Mi(n,i){return Vi("div",n,i)}const Oy=new WeakMap;function oa(n,i,s,r,o){let f="translate("+i+"px,"+s+"px)",d=Oy.get(n);f!=d&&(n.style.transform=f,Oy.set(n,f),i<0||s<0||i>r||s>o?mi(n,ul):Eh(n,ul))}const jy=new WeakMap;function ky(n,i,s){let r=i+s,o=jy.get(n);r!=o&&(jy.set(n,r),n.style.background=i,n.style.borderColor=s)}const Ry=new WeakMap;function Cy(n,i,s,r){let o=i+""+s,f=Ry.get(n);o!=f&&(Ry.set(n,o),n.style.height=s+"px",n.style.width=i+"px",n.style.marginLeft=r?-i/2+"px":0,n.style.marginTop=r?-s/2+"px":0)}const cm={passive:!0},IT={...cm,capture:!0};function dl(n,i,s,r){i.addEventListener(n,s,r?IT:cm)}function Th(n,i,s,r){i.removeEventListener(n,s,cm)}zr&&wh();function Gi(n,i,s,r){let o;s=s||0,r=r||i.length-1;let f=r<=2147483647;for(;r-s>1;)o=f?s+r>>1:gi((s+r)/2),i[o]{let f=-1,d=-1;for(let p=r;p<=o;p++)if(n(s[p])){f=p;break}for(let p=o;p>=r;p--)if(n(s[p])){d=p;break}return[f,d]}}const Zb=n=>n!=null,Ub=n=>n!=null&&n>0,Ic=Db(Zb),XT=Db(Ub);function PT(n,i,s,r=0,o=!1){let f=o?XT:Ic,d=o?Ub:Zb;[i,s]=f(n,i,s);let p=n[i],m=n[i];if(i>-1)if(r==1)p=n[i],m=n[s];else if(r==-1)p=n[s],m=n[i];else for(let v=i;v<=s;v++){let x=n[v];d(x)&&(xm&&(m=x))}return[p??gt,m??-gt]}function Xc(n,i,s,r){let o=Uy(n),f=Uy(i);n==i&&(o==-1?(n*=s,i/=s):(n/=s,i*=s));let d=s==10?qa:$b,p=o==1?gi:Oi,m=f==1?Oi:gi,v=p(d(an(n))),x=m(d(an(i))),S=gr(s,v),w=gr(s,x);return s==10&&(v<0&&(S=vt(S,-v)),x<0&&(w=vt(w,-x))),r||s==2?(n=S*o,i=w*f):(n=qb(n,S),i=Pc(i,w)),[n,i]}function fm(n,i,s,r){let o=Xc(n,i,s,r);return n==0&&(o[0]=0),i==0&&(o[1]=0),o}const dm=.1,Dy={mode:3,pad:dm},Zo={pad:0,soft:null,mode:0},WT={min:Zo,max:Zo};function Uc(n,i,s,r){return Wc(s)?Zy(n,i,s):(Zo.pad=s,Zo.soft=r?0:null,Zo.mode=r?3:0,Zy(n,i,WT))}function Je(n,i){return n??i}function eN(n,i,s){for(i=Je(i,0),s=Je(s,n.length-1);i<=s;){if(n[i]!=null)return!0;i++}return!1}function Zy(n,i,s){let r=s.min,o=s.max,f=Je(r.pad,0),d=Je(o.pad,0),p=Je(r.hard,-gt),m=Je(o.hard,gt),v=Je(r.soft,gt),x=Je(o.soft,-gt),S=Je(r.mode,0),w=Je(o.mode,0),M=i-n,T=qa(M),k=Vn(an(n),an(i)),B=qa(k),V=an(B-T);(M<1e-24||V>10)&&(M=0,(n==0||i==0)&&(M=1e-24,S==2&&v!=gt&&(f=0),w==2&&x!=-gt&&(d=0)));let D=M||k||1e3,ee=qa(D),G=gr(10,gi(ee)),W=D*(M==0?n==0?.1:1:f),ie=vt(qb(n-W,G/10),24),ae=n>=v&&(S==1||S==3&&ie<=v||S==2&&ie>=v)?v:gt,X=Vn(p,ie=ae?ae:Yi(ae,ie)),de=D*(M==0?i==0?.1:1:d),me=vt(Pc(i+de,G/10),24),ne=i<=x&&(w==1||w==3&&me>=x||w==2&&me<=x)?x:-gt,pe=Yi(m,me>ne&&i<=ne?ne:Vn(ne,me));return X==pe&&X==0&&(pe=100),[X,pe]}const tN=new Intl.NumberFormat(zr?JT.language:"en-US"),hm=n=>tN.format(n),vi=Math,Nc=vi.PI,an=vi.abs,gi=vi.floor,nn=vi.round,Oi=vi.ceil,Yi=vi.min,Vn=vi.)DELIM" -R"DELIM(max,gr=vi.pow,Uy=vi.sign,qa=vi.log10,$b=vi.log2,nN=(n,i=1)=>vi.sinh(n)*i,hh=(n,i=1)=>vi.asinh(n/i),gt=1/0;function $y(n){return(qa((n^n>>31)-(n>>31))|0)+1}function Nh(n,i,s){return Yi(Vn(n,i),s)}function Lb(n){return typeof n=="function"}function qe(n){return Lb(n)?n:()=>n}const iN=()=>{},Hb=n=>n,Bb=(n,i)=>i,aN=n=>null,Ly=n=>!0,Hy=(n,i)=>n==i,sN=/\.\d*?(?=9{6,}|0{6,})/gm,gl=n=>{if(Gb(n)||Os.has(n))return n;const i=`${n}`,s=i.match(sN);if(s==null)return n;let r=s[0].length-1;if(i.indexOf("e-")!=-1){let[o,f]=i.split("e");return+`${gl(o)}e${f}`}return vt(n,r)};function rl(n,i){return gl(vt(gl(n/i))*i)}function Pc(n,i){return gl(Oi(gl(n/i))*i)}function qb(n,i){return gl(gi(gl(n/i))*i)}function vt(n,i=0){if(Gb(n))return n;let s=10**i,r=n*s*(1+Number.EPSILON);return nn(r)/s}const Os=new Map;function Vb(n){return((""+n).split(".")[1]||"").length}function qo(n,i,s,r){let o=[],f=r.map(Vb);for(let d=i;d=0?0:p)+(d>=f[v]?0:f[v]),w=n==10?x:vt(x,S);o.push(w),Os.set(w,S)}}return o}const Uo={},mm=[],vr=[null,null],Ns=Array.isArray,Gb=Number.isInteger,lN=n=>n===void 0;function By(n){return typeof n=="string"}function Wc(n){let i=!1;if(n!=null){let s=n.constructor;i=s==null||s==Object}return i}function rN(n){return n!=null&&typeof n=="object"}const oN=Object.getPrototypeOf(Uint8Array),Yb="__proto__";function yr(n,i=Wc){let s;if(Ns(n)){let r=n.find(o=>o!=null);if(Ns(r)||i(r)){s=Array(n.length);for(let o=0;of){for(o=d-1;o>=0&&n[o]==null;)n[o--]=null;for(o=d+1;od-p)],o=r[0].length,f=new Map;for(let d=0;d"u"?n=>Promise.resolve().then(n):queueMicrotask;function pN(n){let i=n[0],s=i.length,r=Array(s);for(let f=0;fi[f]-i[d]);let o=[];for(let f=0;f=r&&n[o]==null;)o--;if(o<=r)return!0;const f=Vn(1,gi((o-r+1)/i));for(let d=n[r],p=r+f;p<=o;p+=f){const m=n[p];if(m!=null){if(m<=d)return!1;d=m}}return!0}const Qb=["January","February","March","April","May","June","July","August","September","October","November","December"],Kb=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Fb(n){return n.slice(0,3)}const yN=Kb.map(Fb),bN=Qb.map(Fb),_N={MMMM:Qb,MMM:bN,WWWW:Kb,WWW:yN};function Ao(n){return(n<10?"0":"")+n}function SN(n){return(n<10?"00":n<100?"0":"")+n}const xN={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,i)=>i.MMMM[n.getMonth()],MMM:(n,i)=>i.MMM[n.getMonth()],MM:n=>Ao(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>Ao(n.getDate()),D:n=>n.getDate(),WWWW:(n,i)=>i.WWWW[n.getDay()],WWW:(n,i)=>i.WWW[n.getDay()],HH:n=>Ao(n.getHours()),H:n=>n.getHours(),h:n=>{let i=n.getHours();return i==0?12:i>12?i-12:i},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>Ao(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>Ao(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>SN(n.getMilliseconds())};function pm(n,i){i=i||_N;let s=[],r=/\{([a-z]+)\}|[^{]+/gi,o;for(;o=r.exec(n);)s.push(o[0][0]=="{"?xN[o[1]]:o[0]);return f=>{let d="";for(let p=0;pn%1==0,$c=[1,2,2.5,5],EN=qo(10,-32,0,$c),Ib=qo(10,0,32,$c),TN=Ib.filter(Jb),ol=EN.concat(Ib),gm=` -`,Xb="{YYYY}",qy=gm+Xb,Pb="{M}/{D}",Ro=gm+Pb,Sc=Ro+"/{YY}",Wb="{aa}",NN="{h}:{mm}",ur=NN+Wb,Vy=gm+ur,Gy=":{ss}",tt=null;function e1(n){let i=n*1e3,s=i*60,r=s*60,o=r*24,f=o*30,d=o*365,m=(n==1?qo(10,0,3,$c).filter(Jb):qo(10,-3,0,$c)).concat([i,i*5,i*10,i*15,i*30,s,s*5,s*10,s*15,s*30,r,r*2,r*3,r*4,r*6,r*8,r*12,o,o*2,o*3,o*4,o*5,o*6,o*7,o*8,o*9,o*10,o*15,f,f*2,f*3,f*4,f*6,d,d*2,d*5,d*10,d*25,d*50,d*100]);const v=[[d,Xb,tt,tt,tt,tt,tt,tt,1],[o*28,"{MMM}",qy,tt,tt,tt,tt,tt,1],[o,Pb,qy,tt,tt,tt,tt,tt,1],[r,"{h}"+Wb,Sc,tt,Ro,tt,tt,tt,1],[s,ur,Sc,tt,Ro,tt,tt,tt,1],[i,Gy,Sc+" "+ur,tt,Ro+" "+ur,tt,Vy,tt,1],[n,Gy+".{fff}",Sc+" "+ur,tt,Ro+" "+ur,tt,Vy,tt,1]];function x(S){return(w,M,T,k,B,V)=>{let D=[],ee=B>=d,G=B>=f&&B=o?o:B,me=gi(T)-gi(ie),ne=X+me+Pc(ie-X,de);D.push(ne);let pe=S(ne),ce=pe.getHours()+pe.getMinutes()/s+pe.getSeconds()/r,Te=B/r,ge=w.axes[M]._space,U=V/ge;for(;ne=vt(ne+B,n==1?0:3),!(ne>k);)if(Te>1){let Q=gi(vt(ce+Te,6))%24,xe=S(ne).getHours()-Q;xe>1&&(xe=-1),ne-=xe*r,ce=(ce+Te)%24;let A=D[D.length-1];vt((ne-A)/B,3)*U>=.7&&D.push(ne)}else D.push(ne)}return D}}return[m,v,x]}const[AN,MN,ON]=e1(1),[jN,kN,RN]=e1(.001);qo(2,-53,53,[1]);function Yy(n,i){return n.map(s=>s.map((r,o)=>o==0||o==8||r==null?r:i(o==1||s[8]==0?r:s[1]+r)))}function Qy(n,i){return(s,r,o,f,d)=>{let p=i.find(T=>d>=T[0])||i[i.length-1],m,v,x,S,w,M;return r.map(T=>{let k=n(T),B=k.getFullYear(),V=k.getMonth(),D=k.getDate(),ee=k.getHours(),G=k.getMinutes(),W=k.getSeconds(),ie=B!=m&&p[2]||V!=v&&p[3]||D!=x&&p[4]||ee!=S&&p[5]||G!=w&&p[6]||W!=M&&p[7]||p[1];return m=B,v=V,x=D,S=ee,w=G,M=W,ie(k)})}}function CN(n,i){let s=pm(i);return(r,o,f,d,p)=>o.map(m=>s(n(m)))}function mh(n,i,s){return new Date(n,i,s)}function Ky(n,i){return i(n)}const DN="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function Fy(n,i){return(s,r,o,f)=>f==null?um:i(n(r))}function ZN(n,i){let s=n.series[i];return s.width?s.stroke(n,i):s.points.width?s.points.stroke(n,i):null}function UN(n,i){return n.series[i].fill(n,i)}const $N={show:!0,live:!0,isolate:!1,mount:iN,markers:{show:!0,width:2,stroke:ZN,fill:UN,dash:"solid"},idx:null,idxs:null,values:[]};function LN(n,i){let s=n.cursor.points,r=Mi(),o=s.size(n,i);zt(r,jo,o),zt(r,ko,o);let f=o/-2;zt(r,"marginLeft",f),zt(r,"marginTop",f);let d=s.width(n,i,o);return d&&zt(r,"borderWidth",d),r}function HN(n,i){let s=n.series[i].points;return s._fill||s._stroke}function BN(n,i){let s=n.series[i].points;return s._stroke||s._fill}function qN(n,i){return n.series[i].points.size}const ph=[0,0];function VN(n,i,s){return ph[0]=i,ph[1]=s,ph}function xc(n,i,s,r=!0){return o=>{o.button==0&&(!r||o.target==i)&&s(o)}}function gh(n,i,s,r=!0){return o=>{(!r||o.target==i)&&s(o)}}const GN={show:!0,x:!0,y:!0,lock:!1,move:VN,points:{one:!1,show:LN,size:qN,width:0,stroke:BN,fill)DELIM" -R"DELIM(:HN},bind:{mousedown:xc,mouseup:xc,click:xc,dblclick:xc,mousemove:gh,mouseleave:gh,mouseenter:gh},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,i)=>{i.stopPropagation(),i.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,i,s,r,o)=>r-o,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},t1={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},vm=It({},t1,{filter:Bb}),n1=It({},vm,{size:10}),i1=It({},t1,{show:!1}),ym='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',a1="bold "+ym,s1=1.5,Jy={show:!0,scale:"x",stroke:om,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:a1,side:2,grid:vm,ticks:n1,border:i1,font:ym,lineGap:s1,rotate:0},YN="Value",QN="Time",Iy={show:!0,scale:"x",auto:!1,sorted:1,min:gt,max:-gt,idxs:[]};function KN(n,i,s,r,o){return i.map(f=>f==null?"":hm(f))}function FN(n,i,s,r,o,f,d){let p=[],m=Os.get(o)||0;s=d?s:vt(Pc(s,o),m);for(let v=s;v<=r;v=vt(v+o,m))p.push(Object.is(v,-0)?0:v);return p}function Ah(n,i,s,r,o,f,d){const p=[],m=n.scales[n.axes[i].scale].log,v=m==10?qa:$b,x=gi(v(s));o=gr(m,x),m==10&&(o=ol[Gi(o,ol)]);let S=s,w=o*m;m==10&&(w=ol[Gi(w,ol)]);do p.push(S),S=S+o,m==10&&!Os.has(S)&&(S=vt(S,Os.get(o))),S>=w&&(o=S,w=o*m,m==10&&(w=ol[Gi(w,ol)]));while(S<=r);return p}function JN(n,i,s,r,o,f,d){let m=n.scales[n.axes[i].scale].asinh,v=r>m?Ah(n,i,Vn(m,s),r,o):[m],x=r>=0&&s<=0?[0]:[];return(s<-m?Ah(n,i,Vn(m,-r),-s,o):[m]).reverse().map(w=>-w).concat(x,v)}const l1=/./,IN=/[12357]/,XN=/[125]/,Xy=/1/,Mh=(n,i,s,r)=>n.map((o,f)=>i==4&&o==0||f%r==0&&s.test(o.toExponential()[o<0?1:0])?o:null);function PN(n,i,s,r,o){let f=n.axes[s],d=f.scale,p=n.scales[d],m=n.valToPos,v=f._space,x=m(10,d),S=m(9,d)-x>=v?l1:m(7,d)-x>=v?IN:m(5,d)-x>=v?XN:Xy;if(S==Xy){let w=an(m(1,d)-x);if(wo,e0={show:!0,auto:!0,sorted:0,gaps:r1,alpha:1,facets:[It({},Wy,{scale:"x"}),It({},Wy,{scale:"y"})]},t0={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:r1,alpha:1,points:{show:nA,filter:null},values:null,min:gt,max:-gt,idxs:[],path:null,clip:null};function iA(n,i,s,r,o){return s/10}const o1={time:AT,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},aA=It({},o1,{time:!1,ori:1}),n0={};function u1(n,i){let s=n0[n];return s||(s={key:n,plots:[],sub(r){s.plots.push(r)},unsub(r){s.plots=s.plots.filter(o=>o!=r)},pub(r,o,f,d,p,m,v){for(let x=0;x{let V=d.pxRound;const D=v.dir*(v.ori==0?1:-1),ee=v.ori==0?wr:Er;let G,W;D==1?(G=s,W=r):(G=r,W=s);let ie=V(S(p[G],v,k,M)),ae=V(w(m[G],x,B,T)),X=V(S(p[W],v,k,M)),de=V(w(f==1?x.max:x.min,x,B,T)),me=new Path2D(o);return ee(me,X,de),ee(me,ie,de),ee(me,ie,ae),me})}function ef(n,i,s,r,o,f){let d=null;if(n.length>0){d=new Path2D;const p=i==0?af:Sm;let m=s;for(let S=0;Sw[0]){let M=w[0]-m;M>0&&p(d,m,r,M,r+f),m=w[1]}}let v=s+o-m,x=10;v>0&&p(d,m,r-x/2,v,r+f+x)}return d}function lA(n,i,s){let r=n[n.length-1];r&&r[0]==i?r[1]=s:n.push([i,s])}function _m(n,i,s,r,o,f,d){let p=[],m=n.length;for(let v=o==1?s:r;v>=s&&v<=r;v+=o)if(i[v]===null){let S=v,w=v;if(o==1)for(;++v<=r&&i[v]===null;)w=v;else for(;--v>=s&&i[v]===null;)w=v;let M=f(n[S]),T=w==S?M:f(n[w]),k=S-o;M=d<=0&&k>=0&&k=0&&V>=0&&V=M&&p.push([M,T])}return p}function i0(n){return n==0?Hb:n==1?nn:i=>rl(i,n)}function c1(n){let i=n==0?tf:nf,s=n==0?(o,f,d,p,m,v)=>{o.arcTo(f,d,p,m,v)}:(o,f,d,p,m,v)=>{o.arcTo(d,f,m,p,v)},r=n==0?(o,f,d,p,m)=>{o.rect(f,d,p,m)}:(o,f,d,p,m)=>{o.rect(d,f,m,p)};return(o,f,d,p,m,v=0,x=0)=>{v==0&&x==0?r(o,f,d,p,m):(v=Yi(v,p/2,m/2),x=Yi(x,p/2,m/2),i(o,f+v,d),s(o,f+p,d,f+p,d+m,v),s(o,f+p,d+m,f,d+m,x),s(o,f,d+m,f,d,x),s(o,f,d,f+p,d,v),o.closePath())}}const tf=(n,i,s)=>{n.moveTo(i,s)},nf=(n,i,s)=>{n.moveTo(s,i)},wr=(n,i,s)=>{n.lineTo(i,s)},Er=(n,i,s)=>{n.lineTo(s,i)},af=c1(0),Sm=c1(1),f1=(n,i,s,r,o,f)=>{n.arc(i,s,r,o,f)},d1=(n,i,s,r,o,f)=>{n.arc(s,i,r,o,f)},h1=(n,i,s,r,o,f,d)=>{n.bezierCurveTo(i,s,r,o,f,d)},m1=(n,i,s,r,o,f,d)=>{n.bezierCurveTo(s,i,o,r,d,f)};function p1(n){return(i,s,r,o,f)=>yl(i,s,(d,p,m,v,x,S,w,M,T,k,B)=>{let{pxRound:V,points:D}=d,ee,G;v.ori==0?(ee=tf,G=f1):(ee=nf,G=d1);const W=vt(D.width*Pe,3);let ie=(D.size-D.width)/2*Pe,ae=vt(ie*2,3),X=new Path2D,de=new Path2D,{left:me,top:ne,width:pe,height:ce}=i.bbox;af(de,me-ae,ne-ae,pe+ae*2,ce+ae*2);const Te=ge=>{if(m[ge]!=null){let U=V(S(p[ge],v,k,M)),Q=V(w(m[ge],x,B,T));ee(X,U+ie,Q),G(X,U,Q,ie,0,Nc*2)}};if(f)f.forEach(Te);else for(let ge=r;ge<=o;ge++)Te(ge);return{stroke:W>0?X:null,fill:X,clip:de,flags:br|Oh}})}function g1(n){return(i,s,r,o,f,d)=>{r!=o&&(f!=r&&d!=r&&n(i,s,r),f!=o&&d!=o&&n(i,s,o),n(i,s,d))}}const rA=g1(wr),oA=g1(Er);function v1(n){const i=Je(n?.alignGaps,0);return(s,r,o,f)=>yl(s,r,(d,p,m,v,x,S,w,M,T,k,B)=>{[o,f]=Ic(m,o,f);let V=d.pxRound,D=ce=>V(S(ce,v,k,M)),ee=ce=>V(w(ce,x,B,T)),G,W;v.ori==0?(G=wr,W=rA):(G=Er,W=oA);const ie=v.dir*(v.ori==0?1:-1),ae={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:br},X=ae.stroke;let de=!1;if(f-o>=k*4){let ce=Y=>s.posToVal(Y,v.key,!0),Te=null,ge=null,U,Q,ye,Me=D(p[ie==1?o:f]),xe=D(p[o]),A=D(p[f]),H=ce(ie==1?xe+1:A-1);for(let Y=ie==1?o:f;Y>=o&&Y<=f;Y+=ie){let re=p[Y],be=(ie==1?reH)?Me:D(re),_e=m[Y];be==Me?_e!=null?(Q=_e,Te==null?(G(X,be,ee(Q)),U=Te=ge=Q):Qge&&(ge=Q)):_e===null&&(de=!0):(Te!=null&&W(X,Me,ee(Te),ee(ge),ee(U),ee(Q)),_e!=null?(Q=_e,G(X,be,ee(Q)),Te=ge=U=Q):(Te=ge=null,_e===null&&(de=!0)),Me=be,H=ce(Me+ie))}Te!=null&&Te!=ge&&ye!=Me&&W(X,Me,ee(Te),ee(ge),ee(U),ee(Q))}else for(let ce=ie==1?o:f;ce>=o&&ce<=f;ce+=ie){let Te=m[ce];Te===null?de=!0:Te!=null&&G(X,D(p[ce]),ee(Te))}let[ne,pe]=bm(s,r);if(d.fill!=null||ne!=0){let ce=ae.fill=new Path2D(X),Te=d.fillTo(s,r,d.min,d.max,ne),ge=ee(Te),U=D(p[o]),Q=D(p[f]);ie==-1&&([Q,U]=[U,Q]),G(ce,Q,ge),G(ce,U,ge)}if(!d.spanGaps){let ce=[];de&&ce.push(..._m(p,m,o,f,ie,D,i)),ae.gaps=ce=d.gaps(s,r,o,f,ce),ae.clip=ef(ce,v.ori,M,T,k,B)}return pe!=0&&(ae.band=pe==2?[Va(s,r,o,f,X,-1),Va(s,r,o,f,X,1)]:Va(s,r,o,f,X,pe)),ae})}function uA(n){const i=Je(n.align,1),s=Je(n.ascDesc,!1),r=Je(n.alignGaps,0),o=Je(n.extend,!1);return(f,d,p,m)=>yl(f,d,(v,x,S,w,M,T,k,B,V,D,ee)=>{[p,m]=Ic(S,p,m);let G=v.pxRound,{left:W,width:ie}=f.bbox,ae=xe=>G(T(xe,w,D,B)),X=xe=>G(k(xe,M,ee,V)),de=w.ori==0?wr:Er;const me={st)DELIM" -R"DELIM(roke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:br},ne=me.stroke,pe=w.dir*(w.ori==0?1:-1);let ce=X(S[pe==1?p:m]),Te=ae(x[pe==1?p:m]),ge=Te,U=Te;o&&i==-1&&(U=W,de(ne,U,ce)),de(ne,Te,ce);for(let xe=pe==1?p:m;xe>=p&&xe<=m;xe+=pe){let A=S[xe];if(A==null)continue;let H=ae(x[xe]),Y=X(A);i==1?de(ne,H,ce):de(ne,ge,Y),de(ne,H,Y),ce=Y,ge=H}let Q=ge;o&&i==1&&(Q=W+ie,de(ne,Q,ce));let[ye,Me]=bm(f,d);if(v.fill!=null||ye!=0){let xe=me.fill=new Path2D(ne),A=v.fillTo(f,d,v.min,v.max,ye),H=X(A);de(xe,Q,H),de(xe,U,H)}if(!v.spanGaps){let xe=[];xe.push(..._m(x,S,p,m,pe,ae,r));let A=v.width*Pe/2,H=s||i==1?A:-A,Y=s||i==-1?-A:A;xe.forEach(re=>{re[0]+=H,re[1]+=Y}),me.gaps=xe=v.gaps(f,d,p,m,xe),me.clip=ef(xe,w.ori,B,V,D,ee)}return Me!=0&&(me.band=Me==2?[Va(f,d,p,m,ne,-1),Va(f,d,p,m,ne,1)]:Va(f,d,p,m,ne,Me)),me})}function a0(n,i,s,r,o,f,d=gt){if(n.length>1){let p=null;for(let m=0,v=1/0;m{}),{fill:S,stroke:w}=v;return(M,T,k,B)=>yl(M,T,(V,D,ee,G,W,ie,ae,X,de,me,ne)=>{let pe=V.pxRound,ce=s,Te=r*Pe,ge=p*Pe,U=m*Pe,Q,ye;G.ori==0?[Q,ye]=f(M,T):[ye,Q]=f(M,T);const Me=G.dir*(G.ori==0?1:-1);let xe=G.ori==0?af:Sm,A=G.ori==0?x:(fe,it,Rt,Ci,ha,ai,ma)=>{x(fe,it,Rt,ha,Ci,ma,ai)},H=Je(M.bands,mm).find(fe=>fe.series[0]==T),Y=H!=null?H.dir:0,re=V.fillTo(M,T,V.min,V.max,Y),we=pe(ae(re,W,ne,de)),be,_e,mt,Ve=me,nt=pe(V.width*Pe),Rn=!1,ii=null,Cn=null,En=null,Ki=null;S!=null&&(nt==0||w!=null)&&(Rn=!0,ii=S.values(M,T,k,B),Cn=new Map,new Set(ii).forEach(fe=>{fe!=null&&Cn.set(fe,new Path2D)}),nt>0&&(En=w.values(M,T,k,B),Ki=new Map,new Set(En).forEach(fe=>{fe!=null&&Ki.set(fe,new Path2D)})));let{x0:Fi,size:Rs}=v;if(Fi!=null&&Rs!=null){ce=1,D=Fi.values(M,T,k,B),Fi.unit==2&&(D=D.map(Rt=>M.posToVal(X+Rt*me,G.key,!0)));let fe=Rs.values(M,T,k,B);Rs.unit==2?_e=fe[0]*me:_e=ie(fe[0],G,me,X)-ie(0,G,me,X),Ve=a0(D,ee,ie,G,me,X,Ve),mt=Ve-_e+Te}else Ve=a0(D,ee,ie,G,me,X,Ve),mt=Ve*d+Te,_e=Ve-mt;mt<1&&(mt=0),nt>=_e/2&&(nt=0),mt<5&&(pe=Hb);let Cs=mt>0,ki=Ve-mt-(Cs?nt:0);_e=pe(Nh(ki,U,ge)),be=(ce==0?_e/2:ce==Me?0:_e)-ce*Me*((ce==0?Te/2:0)+(Cs?nt/2:0));const Wt={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},Ji=Rn?null:new Path2D;let Ri=null;if(H!=null)Ri=M.data[H.series[1]];else{let{y0:fe,y1:it}=v;fe!=null&&it!=null&&(ee=it.values(M,T,k,B),Ri=fe.values(M,T,k,B))}let da=Q*_e,Ne=ye*_e;for(let fe=Me==1?k:B;fe>=k&&fe<=B;fe+=Me){let it=ee[fe];if(it==null)continue;if(Ri!=null){let ot=Ri[fe]??0;if(it-ot==0)continue;we=ae(ot,W,ne,de)}let Rt=G.distr!=2||v!=null?D[fe]:fe,Ci=ie(Rt,G,me,X),ha=ae(Je(it,re),W,ne,de),ai=pe(Ci-be),ma=pe(Vn(ha,we)),Dn=pe(Yi(ha,we)),on=ma-Dn;if(it!=null){let ot=it<0?Ne:da,Gt=it<0?da:Ne;Rn?(nt>0&&En[fe]!=null&&xe(Ki.get(En[fe]),ai,Dn+gi(nt/2),_e,Vn(0,on-nt),ot,Gt),ii[fe]!=null&&xe(Cn.get(ii[fe]),ai,Dn+gi(nt/2),_e,Vn(0,on-nt),ot,Gt)):xe(Ji,ai,Dn+gi(nt/2),_e,Vn(0,on-nt),ot,Gt),A(M,T,fe,ai-nt/2,Dn,_e+nt,on)}}return nt>0?Wt.stroke=Rn?Ki:Ji:Rn||(Wt._fill=V.width==0?V._fill:V._stroke??V._fill,Wt.width=0),Wt.fill=Rn?Cn:Ji,Wt})}function fA(n,i){const s=Je(i?.alignGaps,0);return(r,o,f,d)=>yl(r,o,(p,m,v,x,S,w,M,T,k,B,V)=>{[f,d]=Ic(v,f,d);let D=p.pxRound,ee=Q=>D(w(Q,x,B,T)),G=Q=>D(M(Q,S,V,k)),W,ie,ae;x.ori==0?(W=tf,ae=wr,ie=h1):(W=nf,ae=Er,ie=m1);const X=x.dir*(x.ori==0?1:-1);let de=ee(m[X==1?f:d]),me=de,ne=[],pe=[];for(let Q=X==1?f:d;Q>=f&&Q<=d;Q+=X)if(v[Q]!=null){let Me=m[Q],xe=ee(Me);ne.push(me=xe),pe.push(G(v[Q]))}const ce={stroke:n(ne,pe,W,ae,ie,D),fill:null,clip:null,band:null,gaps:null,flags:br},Te=ce.stroke;let[ge,U]=bm(r,o);if(p.fill!=null||ge!=0){let Q=ce.fill=new Path2D(Te),ye=p.fillTo(r,o,p.min,p.max,ge),Me=G(ye);ae(Q,me,Me),ae(Q,de,Me)}if(!p.spanGaps){let Q=[];Q.push(..._m(m,v,f,d,X,ee,s)),ce.gaps=Q=p.gaps(r,o,f,d,Q),ce.clip=ef(Q,x.ori,T,k,B,V)}return U!=0&&(ce.band=U==2?[Va(r,o,f,d,Te,-1),Va(r,o,f,d,Te,1)]:Va(r,o,f,d,Te,U)),ce})}function dA(n){return fA(hA,n)}function hA(n,i,s,r,o,f){const d=n.length;if(d<2)return null;const p=new Path2D;if(s(p,n[0],i[0]),d==2)r(p,n[1],i[1]);else{let m=Array(d),v=Array(d-1),x=Array(d-1),S=Array(d-1);for(let w=0;w0!=v[w]>0?m[w]=0:(m[w]=3*(S[w-1]+S[w])/((2*S[w]+S[w-1])/v[w-1]+(S[w]+2*S[w-1])/v[w]),isFinite(m[w])||(m[w]=0));m[d-1]=v[d-2];for(let w=0;w{Pt.pxRatio=Pe}));const mA=v1(),pA=p1();function l0(n,i,s,r){return(r?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((f,d)=>kh(f,d,i,s))}function gA(n,i){return n.map((s,r)=>r==0?{}:It({},i,s))}function kh(n,i,s,r){return It({},i==0?s:r,n)}function y1(n,i,s){return i==null?vr:[i,s]}const vA=y1;function yA(n,i,s){return i==null?vr:Uc(i,s,dm,!0)}function b1(n,i,s,r){return i==null?vr:Xc(i,s,n.scales[r].log,!1)}const bA=b1;function _1(n,i,s,r){return i==null?vr:fm(i,s,n.scales[r].log,!1)}const _A=_1;function SA(n,i,s,r,o){let f=Vn($y(n),$y(i)),d=i-n,p=Gi(o/r*d,s);do{let m=s[p],v=r*m/d;if(v>=o&&f+(m<5?Os.get(m):0)<=17)return[m,v]}while(++p(i=nn((s=+o)*Pe))+"px"),[n,i,s]}function xA(n){n.show&&[n.font,n.labelFont].forEach(i=>{let s=vt(i[2]*Pe,1);i[0]=i[0].replace(/[0-9.]+px/,s+"px"),i[1]=s})}function Pt(n,i,s){const r={mode:Je(n.mode,1)},o=r.mode;function f(g,y,z,E){let O=y.valToPct(g);return E+z*(y.dir==-1?1-O:O)}function d(g,y,z,E){let O=y.valToPct(g);return E+z*(y.dir==-1?O:1-O)}function p(g,y,z,E){return y.ori==0?f(g,y,z,E):d(g,y,z,E)}r.valToPosH=f,r.valToPosV=d;let m=!1;r.status=0;const v=r.root=Mi(MT);if(n.id!=null&&(v.id=n.id),mi(v,n.class),n.title){let g=Mi(kT,v);g.textContent=n.title}const x=Vi("canvas"),S=r.ctx=x.getContext("2d"),w=Mi(RT,v);dl("click",w,g=>{g.target===T&&(We!=Ln||at!=ta)&&Qe.click(r,g)},!0);const M=r.under=Mi(CT,w);w.appendChild(x);const T=r.over=Mi(DT,w);n=yr(n);const k=+Je(n.pxAlign,1),B=i0(k);(n.plugins||[]).forEach(g=>{g.opts&&(n=g.opts(r,n)||n)});const V=n.ms||.001,D=r.series=o==1?l0(n.series||[],Iy,t0,!1):gA(n.series||[null],e0),ee=r.axes=l0(n.axes||[],Jy,Py,!0),G=r.scales={},W=r.bands=n.bands||[];W.forEach(g=>{g.fill=qe(g.fill||null),g.dir=Je(g.dir,-1)});const ie=o==2?D[1].facets[0].scale:D[0].scale,ae={axes:Cr,series:lf},X=(n.drawOrder||["axes","series"]).map(g=>ae[g]);function de(g){const y=g.distr==3?z=>qa(z>0?z:g.clamp(r,z,g.min,g.max,g.key)):g.distr==4?z=>hh(z,g.asinh):g.distr==100?z=>g.fwd(z):z=>z;return z=>{let E=y(z),{_min:O,_max:C}=g,F=C-O;return(E-O)/F}}function me(g){let y=G[g];if(y==null){let z=(n.scales||Uo)[g]||Uo;if(z.from!=null){me(z.from);let E=It({},G[z.from],z,{key:g});E.valToPct=de(E),G[g]=E}else{y=G[g]=It({},g==ie?o1:aA,z),y.key=g;let E=y.time,O=y.range,C=Ns(O);if((g!=ie||o==2&&!E)&&(C&&(O[0]==null||O[1]==null)&&(O={min:O[0]==null?Dy:{mode:1,hard:O[0],soft:O[0]},max:O[1]==null?Dy:{mode:1,hard:O[1],soft:O[1]}},C=!1),!C&&Wc(O))){let F=O;O=(te,se,oe)=>se==null?vr:Uc(se,oe,F)}y.range=qe(O||(E?vA:g==ie?y.distr==3?bA:y.distr==4?_A:y1:y.distr==3?b1:y.distr==4?_1:yA)),y.auto=qe(C?!1:y.auto),y.clamp=qe(y.clamp||iA),y._min=y._max=null,y.valToPct=de(y)}}}me("x"),me("y"),o==1&&D.forEach(g=>{me(g.scale)}),ee.forEach(g=>{me(g.scale)});for(let g in n.scales)me(g);const ne=G[ie],pe=ne.distr;let ce,Te;ne.ori==0?(mi(v,OT),ce=f,Te=d):(mi(v,jT),ce=d,Te=f);const ge={};for(let g in G){let y=G[g];(y.min!=null||y.max!=null)&&(ge[g]={min:y.min,max:y.max},y.min=y.max=null)}const U=n.tzDate||(g=>new Date(nn(g/V))),Q=n.fmtDate||pm,ye=V==1?ON(U):RN(U),Me=Qy(U,Yy(V==1?MN:kN,Q)),xe=Fy(U,Ky(DN,Q)),A=[],H=r.legend=It({},$N,n.lege)DELIM" -R"DELIM(nd),Y=r.cursor=It({},GN,{drag:{y:o==2}},n.cursor),re=H.show,we=Y.show,be=H.markers;H.idxs=A,be.width=qe(be.width),be.dash=qe(be.dash),be.stroke=qe(be.stroke),be.fill=qe(be.fill);let _e,mt,Ve,nt=[],Rn=[],ii,Cn=!1,En={};if(H.live){const g=D[1]?D[1].values:null;Cn=g!=null,ii=Cn?g(r,1,0):{_:0};for(let y in ii)En[y]=um}if(re)if(_e=Vi("table",BT,v),Ve=Vi("tbody",null,_e),H.mount(r,_e),Cn){mt=Vi("thead",null,_e,Ve);let g=Vi("tr",null,mt);Vi("th",null,g);for(var Ki in ii)Vi("th",xy,g).textContent=Ki}else mi(_e,VT),H.live&&mi(_e,qT);const Fi={show:!0},Rs={show:!1};function Cs(g,y){if(y==0&&(Cn||!H.live||o==2))return vr;let z=[],E=Vi("tr",GT,Ve,Ve.childNodes[y]);mi(E,g.class),g.show||mi(E,ul);let O=Vi("th",null,E);if(be.show){let te=Mi(YT,O);if(y>0){let se=be.width(r,y);se&&(te.style.border=se+"px "+be.dash(r,y)+" "+be.stroke(r,y)),te.style.background=be.fill(r,y)}}let C=Mi(xy,O);g.label instanceof HTMLElement?C.appendChild(g.label):C.textContent=g.label,y>0&&(be.show||(C.style.color=g.width>0?be.stroke(r,y):be.fill(r,y)),Wt("click",O,te=>{if(Y._lock)return;si(te);let se=D.indexOf(g);if((te.ctrlKey||te.metaKey)!=H.isolate){let oe=D.some((ue,he)=>he>0&&he!=se&&ue.show);D.forEach((ue,he)=>{he>0&&Hn(he,oe?he==se?Fi:Rs:Fi,!0,Dt.setSeries)})}else Hn(se,{show:!g.show},!0,Dt.setSeries)},!1),va&&Wt(Ty,O,te=>{Y._lock||(si(te),Hn(D.indexOf(g),ts,!0,Dt.setSeries))},!1));for(var F in ii){let te=Vi("td",QT,E);te.textContent="--",z.push(te)}return[E,z]}const ki=new Map;function Wt(g,y,z,E=!0){const O=ki.get(y)||{},C=Y.bind[g](r,y,z,E);C&&(dl(g,y,O[g]=C),ki.set(y,O))}function Ji(g,y,z){const E=ki.get(y)||{};for(let O in E)(g==null||O==g)&&(Th(O,y,E[O]),delete E[O]);g==null&&ki.delete(y)}let Ri=0,da=0,Ne=0,fe=0,it=0,Rt=0,Ci=it,ha=Rt,ai=Ne,ma=fe,Dn=0,on=0,ot=0,Gt=0;r.bbox={};let pn=!1,bl=!1,Ga=!1,pa=!1,ga=!1,gn=!1;function Ya(g,y,z){(z||g!=r.width||y!=r.height)&&Ii(g,y),Ja(!1),Ga=!0,bl=!0,ea()}function Ii(g,y){r.width=Ri=Ne=g,r.height=da=fe=y,it=Rt=0,Fo(),Tr();let z=r.bbox;Dn=z.left=rl(it*Pe,.5),on=z.top=rl(Rt*Pe,.5),ot=z.width=rl(Ne*Pe,.5),Gt=z.height=rl(fe*Pe,.5)}const _l=3;function Ds(){let g=!1,y=0;for(;!g;){y++;let z=Po(y),E=Wo(y);g=y==_l||z&&E,g||(Ii(r.width,r.height),bl=!0)}}function sf({width:g,height:y}){Ya(g,y)}r.setSize=sf;function Fo(){let g=!1,y=!1,z=!1,E=!1;ee.forEach((O,C)=>{if(O.show&&O._show){let{side:F,_size:te}=O,se=F%2,oe=O.label!=null?O.labelSize:0,ue=te+oe;ue>0&&(se?(Ne-=ue,F==3?(it+=ue,E=!0):z=!0):(fe-=ue,F==0?(Rt+=ue,g=!0):y=!0))}}),Gn[0]=g,Gn[1]=z,Gn[2]=y,Gn[3]=E,Ne-=Zi[1]+Zi[3],it+=Zi[3],fe-=Zi[2]+Zi[0],Rt+=Zi[0]}function Tr(){let g=it+Ne,y=Rt+fe,z=it,E=Rt;function O(C,F){switch(C){case 1:return g+=F,g-F;case 2:return y+=F,y-F;case 3:return z-=F,z+F;case 0:return E-=F,E+F}}ee.forEach((C,F)=>{if(C.show&&C._show){let te=C.side;C._pos=O(te,C._size),C.label!=null&&(C._lpos=O(te,C.labelSize))}})}if(Y.dataIdx==null){let g=Y.hover,y=g.skip=new Set(g.skip??[]);y.add(void 0);let z=g.prox=qe(g.prox),E=g.bias??=0;Y.dataIdx=(O,C,F,te)=>{if(C==0)return F;let se=F,oe=z(O,C,F,te)??gt,ue=oe>=0&&oe0;)y.has(Re[ze])||(De=ze);if(E==0||E==1)for(ze=F;Oe==null&&ze++oe&&(se=null);return se}}const si=g=>{Y.event=g};Y.idxs=A,Y._lock=!1;let un=Y.points;un.show=qe(un.show),un.size=qe(un.size),un.stroke=qe(un.stroke),un.width=qe(un.width),un.fill=qe(un.fill);const li=r.focus=It({},n.focus||{alpha:.3},Y.focus),va=li.prox>=0,ya=va&&un.one;let Tn=[],Xi=[],ba=[];function Nr(g,y){let z=un.show(r,y);if(z instanceof HTMLElement)return mi(z,HT),mi(z,g.class),oa(z,-10,-10,Ne,fe),T.insertBefore(z,Tn[y]),z}function Di(g,y){if(o==1||y>0){let z=o==1&&G[g.scale].time,E=g.value;g.value=z?By(E)?Fy(U,Ky(E,Q)):E||xe:E||eA,g.label=g.label||(z?QN:YN)}if(ya||y>0){g.width=g.width==null?1:g.width,g.paths=g.paths||mA||aN,g.fillTo=qe(g.fillTo||sA),g.pxAlign=+Je(g.pxAlign,k),g.pxRound=i0(g.pxAlign),g.stroke=qe(g.stroke||null),g.fill=qe(g.fill||null),g._stroke=g._fill=g._paths=g._focus=null;let z=tA(Vn(1,g.width),1),E=g.points=It({},{size:z,width:Vn(1,z*.2),stroke:g.stroke,space:z*2,paths:pA,_stroke:null,_fill:null},g.points);E.show=qe(E.show),E.filter=qe(E.filter),E.fill=qe(E.fill),E.stroke=qe(E.stroke),E.paths=qe(E.paths),E.pxAlign=g.pxAlign}if(re){let z=Cs(g,y);nt.splice(y,0,z[0]),Rn.splice(y,0,z[1]),H.values.push(null)}if(we){A.splice(y,0,null);let z=null;ya?y==0&&(z=Nr(g,y)):y>0&&(z=Nr(g,y)),Tn.splice(y,0,z),Xi.splice(y,0,0),ba.splice(y,0,0)}Ht("addSeries",y)}function en(g,y){y=y??D.length,g=o==1?kh(g,y,Iy,t0):kh(g,y,{},e0),D.splice(y,0,g),Di(D[y],y)}r.addSeries=en;function Nn(g){if(D.splice(g,1),re){H.values.splice(g,1),Rn.splice(g,1);let y=nt.splice(g,1)[0];Ji(null,y.firstChild),y.remove()}we&&(A.splice(g,1),Tn.splice(g,1)[0].remove(),Xi.splice(g,1),ba.splice(g,1)),Ht("delSeries",g)}r.delSeries=Nn;const Gn=[!1,!1,!1,!1];function Ar(g,y){if(g._show=g.show,g.show){let z=g.side%2,E=G[g.scale];E==null&&(g.scale=z?D[1].scale:ie,E=G[g.scale]);let O=E.time;g.size=qe(g.size),g.space=qe(g.space),g.rotate=qe(g.rotate),Ns(g.incrs)&&g.incrs.forEach(F=>{!Os.has(F)&&Os.set(F,Vb(F))}),g.incrs=qe(g.incrs||(E.distr==2?TN:O?V==1?AN:jN:ol)),g.splits=qe(g.splits||(O&&E.distr==1?ye:E.distr==3?Ah:E.distr==4?JN:FN)),g.stroke=qe(g.stroke),g.grid.stroke=qe(g.grid.stroke),g.ticks.stroke=qe(g.ticks.stroke),g.border.stroke=qe(g.border.stroke);let C=g.values;g.values=Ns(C)&&!Ns(C[0])?qe(C):O?Ns(C)?Qy(U,Yy(C,Q)):By(C)?CN(U,C):C||Me:C||KN,g.filter=qe(g.filter||(E.distr>=3&&E.log==10?PN:E.distr==3&&E.log==2?WN:Bb)),g.font=r0(g.font),g.labelFont=r0(g.labelFont),g._size=g.size(r,null,y,0),g._space=g._rotate=g._incrs=g._found=g._splits=g._values=null,g._size>0&&(Gn[y]=!0,g._el=Mi(ZT,w))}}function Zs(g,y,z,E){let[O,C,F,te]=z,se=y%2,oe=0;return se==0&&(te||C)&&(oe=y==0&&!O||y==2&&!F?nn(Jy.size/3):0),se==1&&(O||F)&&(oe=y==1&&!C||y==3&&!te?nn(Py.size/2):0),oe}const Jo=r.padding=(n.padding||[Zs,Zs,Zs,Zs]).map(g=>qe(Je(g,Zs))),Zi=r._padding=Jo.map((g,y)=>g(r,y,Gn,0));let At,Ct=null,bt=null;const Ui=o==1?D[0].idxs:null;let vn=null,yi=!1;function Lt(g,y){if(i=g??[],r.data=r._data=i,o==2){At=0;for(let z=1;z=0,gn=!0,ea()}}r.setData=Lt;function Sl(){yi=!0;let g,y;o==1&&(At>0?(Ct=Ui[0]=0,bt=Ui[1]=At-1,g=i[0][Ct],y=i[0][bt],pe==2?(g=Ct,y=bt):g==y&&(pe==3?[g,y]=Xc(g,g,ne.log,!1):pe==4?[g,y]=fm(g,g,ne.log,!1):ne.time?y=g+nn(86400/V):[g,y]=Uc(g,y,dm,!0))):(Ct=Ui[0]=g=null,bt=Ui[1]=y=null)),Qn(ie,g,y)}let Us,Yn,Pi,Mr,xl,zl,Or,Qa,Ka,wt;function Zn(g,y,z,E,O,C){g??=wy,z??=mm,E??="butt",O??=wy,C??="round",g!=Us&&(S.strokeStyle=Us=g),O!=Yn&&(S.fillStyle=Yn=O),y!=Pi&&(S.lineWidth=Pi=y),C!=xl&&(S.lineJoin=xl=C),E!=zl&&(S.lineCap=zl=E),z!=Mr&&S.setLineDash(Mr=z)}function jr(g,y,z,E){y!=Yn&&(S.fillStyle=Yn=y),g!=Or&&(S.font=Or=g),z!=Qa&&(S.textAlign=Qa=z),E!=Ka&&(S.textBaseline=Ka=E)}function kr(g,y,z,E,O=0){if(E.length>0&&g.auto(r,yi)&&(y==null||y.min==null)){let C=Je(Ct,0),F=Je(bt,E.length-1),te=z.min==null?PT(E,C,F,O,g.distr==3):[z.min,z.max];g.min=Yi(g.min,z.min=te[0]),g.max=Vn(g.max,z.max=te[1])}}const wl={min:null,max:null};function Io(){for(let E in G){let O=G[E];ge[E]==null&&(O.min==null||ge[ie]!=null&&O.auto(r,yi))&&(ge[E]=wl)}for(let E in G){let O=G[E];ge[E]==null&&O.from!=null&&ge[O.from]!=null&&(ge[E]=wl)}ge[ie]!=null&&Ja(!0);let g={};for(let E in ge){let O=ge[E];if(O!=null){let C=g[E]=yr(G[E],rN);if(O.min!=null)It(C,O);else if(E!=ie||o==2)if(At==0)DELIM" -R"DELIM(&&C.from==null){let F=C.range(r,null,null,E);C.min=F[0],C.max=F[1]}else C.min=gt,C.max=-gt}}if(At>0){D.forEach((E,O)=>{if(o==1){let C=E.scale,F=ge[C];if(F==null)return;let te=g[C];if(O==0){let se=te.range(r,te.min,te.max,C);te.min=se[0],te.max=se[1],Ct=Gi(te.min,i[0]),bt=Gi(te.max,i[0]),bt-Ct>1&&(i[0][Ct]te.max&&bt--),E.min=vn[Ct],E.max=vn[bt]}else E.show&&E.auto&&kr(te,F,E,i[O],E.sorted);E.idxs[0]=Ct,E.idxs[1]=bt}else if(O>0&&E.show&&E.auto){let[C,F]=E.facets,te=C.scale,se=F.scale,[oe,ue]=i[O],he=g[te],ke=g[se];he!=null&&kr(he,ge[te],C,oe,C.sorted),ke!=null&&kr(ke,ge[se],F,ue,F.sorted),E.min=F.min,E.max=F.max}});for(let E in g){let O=g[E],C=ge[E];if(O.from==null&&(C==null||C.min==null)){let F=O.range(r,O.min==gt?null:O.min,O.max==-gt?null:O.max,E);O.min=F[0],O.max=F[1]}}}for(let E in g){let O=g[E];if(O.from!=null){let C=g[O.from];if(C.min==null)O.min=O.max=null;else{let F=O.range(r,C.min,C.max,E);O.min=F[0],O.max=F[1]}}}let y={},z=!1;for(let E in g){let O=g[E],C=G[E];if(C.min!=O.min||C.max!=O.max){C.min=O.min,C.max=O.max;let F=C.distr;C._min=F==3?qa(C.min):F==4?hh(C.min,C.asinh):F==100?C.fwd(C.min):C.min,C._max=F==3?qa(C.max):F==4?hh(C.max,C.asinh):F==100?C.fwd(C.max):C.max,y[E]=z=!0}}if(z){D.forEach((E,O)=>{o==2?O>0&&y.y&&(E._paths=null):y[E.scale]&&(E._paths=null)});for(let E in y)Ga=!0,Ht("setScale",E);we&&Y.left>=0&&(pa=gn=!0)}for(let E in ge)ge[E]=null}function El(g){let y=Nh(Ct-1,0,At-1),z=Nh(bt+1,0,At-1);for(;g[y]==null&&y>0;)y--;for(;g[z]==null&&z0){let g=D.some(y=>y._focus)&&wt!=li.alpha;g&&(S.globalAlpha=wt=li.alpha),D.forEach((y,z)=>{if(z>0&&y.show&&(Un(z,!1),Un(z,!0),y._paths==null)){let E=wt;wt!=y.alpha&&(S.globalAlpha=wt=y.alpha);let O=o==2?[0,i[z][0].length-1]:El(i[z]);y._paths=y.paths(r,z,O[0],O[1]),wt!=E&&(S.globalAlpha=wt=E)}}),D.forEach((y,z)=>{if(z>0&&y.show){let E=wt;wt!=y.alpha&&(S.globalAlpha=wt=y.alpha),y._paths!=null&&Tl(z,!1);{let O=y._paths!=null?y._paths.gaps:null,C=y.points.show(r,z,Ct,bt,O),F=y.points.filter(r,z,C,O);(C||F)&&(y.points._paths=y.points.paths(r,z,Ct,bt,F),Tl(z,!0))}wt!=E&&(S.globalAlpha=wt=E),Ht("drawSeries",z)}}),g&&(S.globalAlpha=wt=1)}}function Un(g,y){let z=y?D[g].points:D[g];z._stroke=z.stroke(r,g),z._fill=z.fill(r,g)}function Tl(g,y){let z=y?D[g].points:D[g],{stroke:E,fill:O,clip:C,flags:F,_stroke:te=z._stroke,_fill:se=z._fill,_width:oe=z.width}=z._paths;oe=vt(oe*Pe,3);let ue=null,he=oe%2/2;y&&se==null&&(se=oe>0?"#fff":te);let ke=z.pxAlign==1&&he>0;if(ke&&S.translate(he,he),!y){let Ye=Dn-oe/2,Re=on-oe/2,De=ot+oe,Oe=Gt+oe;ue=new Path2D,ue.rect(Ye,Re,De,Oe)}y?Wi(te,oe,z.dash,z.cap,se,E,O,F,C):Xo(g,te,oe,z.dash,z.cap,se,E,O,F,ue,C),ke&&S.translate(-he,-he)}function Xo(g,y,z,E,O,C,F,te,se,oe,ue){let he=!1;se!=0&&W.forEach((ke,Ye)=>{if(ke.series[0]==g){let Re=D[ke.series[1]],De=i[ke.series[1]],Oe=(Re._paths||Uo).band;Ns(Oe)&&(Oe=ke.dir==1?Oe[0]:Oe[1]);let ze,ut=null;Re.show&&Oe&&eN(De,Ct,bt)?(ut=ke.fill(r,Ye)||C,ze=Re._paths.clip):Oe=null,Wi(y,z,E,O,ut,F,te,se,oe,ue,ze,Oe),he=!0}}),he||Wi(y,z,E,O,C,F,te,se,oe,ue)}const Nl=br|Oh;function Wi(g,y,z,E,O,C,F,te,se,oe,ue,he){Zn(g,y,z,E,O),(se||oe||he)&&(S.save(),se&&S.clip(se),oe&&S.clip(oe)),he?(te&Nl)==Nl?(S.clip(he),ue&&S.clip(ue),Ls(O,F),$s(g,C,y)):te&Oh?(Ls(O,F),S.clip(he),$s(g,C,y)):te&br&&(S.save(),S.clip(he),ue&&S.clip(ue),Ls(O,F),S.restore(),$s(g,C,y)):(Ls(O,F),$s(g,C,y)),(se||oe||he)&&S.restore()}function $s(g,y,z){z>0&&(y instanceof Map?y.forEach((E,O)=>{S.strokeStyle=Us=O,S.stroke(E)}):y!=null&&g&&S.stroke(y))}function Ls(g,y){y instanceof Map?y.forEach((z,E)=>{S.fillStyle=Yn=E,S.fill(z)}):y!=null&&g&&S.fill(y)}function Fa(g,y,z,E){let O=ee[g],C;if(E<=0)C=[0,0];else{let F=O._space=O.space(r,g,y,z,E),te=O._incrs=O.incrs(r,g,y,z,E,F);C=SA(y,z,te,E,F)}return O._found=C}function Rr(g,y,z,E,O,C,F,te,se,oe){let ue=F%2/2;k==1&&S.translate(ue,ue),Zn(te,F,se,oe,te),S.beginPath();let he,ke,Ye,Re,De=O+(E==0||E==3?-C:C);z==0?(ke=O,Re=De):(he=O,Ye=De);for(let Oe=0;Oe{if(!z.show)return;let O=G[z.scale];if(O.min==null){z._show&&(y=!1,z._show=!1,Ja(!1));return}else z._show||(y=!1,z._show=!0,Ja(!1));let C=z.side,F=C%2,{min:te,max:se}=O,[oe,ue]=Fa(E,te,se,F==0?Ne:fe);if(ue==0)return;let he=O.distr==2,ke=z._splits=z.splits(r,E,te,se,oe,ue,he),Ye=O.distr==2?ke.map(ze=>vn[ze]):ke,Re=O.distr==2?vn[ke[1]]-vn[ke[0]]:oe,De=z._values=z.values(r,z.filter(r,Ye,E,ue,Re),E,ue,Re);z._rotate=C==2?z.rotate(r,De,E,ue):0;let Oe=z._size;z._size=Oi(z.size(r,De,E,g)),Oe!=null&&z._size!=Oe&&(y=!1)}),y}function Wo(g){let y=!0;return Jo.forEach((z,E)=>{let O=z(r,E,Gn,g);O!=Zi[E]&&(y=!1),Zi[E]=O}),y}function Cr(){for(let g=0;gvn[dn]):Ye,De=ue.distr==2?vn[Ye[1]]-vn[Ye[0]]:se,Oe=y.ticks,ze=y.border,ut=Oe.show?Oe.size:0,_t=nn(ut*Pe),Zt=nn((y.alignTo==2?y._size-ut-y.gap:y.gap)*Pe),et=y._rotate*-Nc/180,st=B(y._pos*Pe),yn=(_t+Zt)*te,Bt=st+yn;C=E==0?Bt:0,O=E==1?Bt:0;let Mn=y.font[0],Kn=y.align==1?lr:y.align==2?ch:et>0?lr:et<0?ch:E==0?"center":z==3?ch:lr,cn=et||E==1?"middle":z==2?No:zy;jr(Mn,F,Kn,cn);let Yt=y.font[1]*y.lineGap,On=Ye.map(dn=>B(p(dn,ue,he,ke))),Fn=y._values;for(let dn=0;dn{z>0&&(y._paths=null,g&&(o==1?(y.min=null,y.max=null):y.facets.forEach(E=>{E.min=null,E.max=null})))})}let Al=!1,Ia=!1,$n=[];function Dr(){Ia=!1;for(let g=0;g<$n.length;g++)Ht(...$n[g]);$n.length=0}function ea(){Al||(mN(_a),Al=!0)}function Xa(g,y=!1){Al=!0,Ia=y,g(r),_a(),y&&$n.length>0&&queueMicrotask(Dr)}r.batch=Xa;function _a(){if(pn&&(Io(),pn=!1),Ga&&(Ds(),Ga=!1),bl){if(zt(M,lr,it),zt(M,No,Rt),zt(M,jo,Ne),zt(M,ko,fe),zt(T,lr,it),zt(T,No,Rt),zt(T,jo,Ne),zt(T,ko,fe),zt(w,jo,Ri),zt(w,ko,da),x.width=nn(Ri*Pe),x.height=nn(da*Pe),ee.forEach(({_el:g,_show:y,_size:z,_pos:E,side:O})=>{if(g!=null)if(y){let C=O===3||O===0?z:0,F=O%2==1;zt(g,F?"left":"top",E-C),zt(g,F?"width":"height",z),zt(g,F?"top":"left",F?Rt:it),zt(g,F?"height":"width",F?fe:Ne),Eh(g,ul)}else mi(g,ul)}),Us=Yn=Pi=xl=zl=Or=Qa=Ka=Mr=null,wt=1,Gs(!0),it!=Ci||Rt!=ha||Ne!=ai||fe!=ma){Ja(!1);let g=Ne/ai,y=fe/ma;if(we&&!pa&&Y.left>=0){Y.left*=g,Y.top*=y,bi&&oa(bi,nn(Y.left),0,Ne,fe),An&&oa(An,0,nn(Y.top),Ne,fe);for(let z=0;z=0&&Ie.width>0){Ie.left*=g,Ie.width*=g,Ie.top*=y,Ie.height*=y;for(let z in Br)zt(Wa,z,Ie[z])}Ci=it,ha=Rt,ai=Ne,ma=fe}Ht("setSize"),bl=!1}Ri>0&&da>0&&(S.clearRect(0,0,x.width,x.height),Ht("drawClear"),X.forEach(g=>g()),Ht("draw")),Ie.show&&ga&&(es(Ie),ga=!1),we&&pa&&(xa(null,!0,!1),pa=!1),H.show&&H.live&&gn&&(Lr(),gn=!1),m||(m=!0,r.status=1,Ht("ready")),yi=!1,Al=!1}r.redraw=(g,y)=>{Ga=y||!1,g!==!1?Qn(ie,ne.min,ne.max):ea()};function)DELIM" -R"DELIM( Ml(g,y){let z=G[g];if(z.from==null){if(At==0){let E=z.range(r,y.min,y.max,g);y.min=E[0],y.max=E[1]}if(y.min>y.max){let E=y.min;y.min=y.max,y.max=E}if(At>1&&y.min!=null&&y.max!=null&&y.max-y.min<1e-16)return;g==ie&&z.distr==2&&At>0&&(y.min=Gi(y.min,i[0]),y.max=Gi(y.max,i[0]),y.min==y.max&&y.max++),ge[g]=y,pn=!0,ea()}}r.setScale=Ml;let Hs,Ol,bi,An,jl,Pa,Ln,ta,Bs,Zr,We,at,$i=!1;const Qe=Y.drag;let yt=Qe.x,Mt=Qe.y;we&&(Y.x&&(Hs=Mi($T,T)),Y.y&&(Ol=Mi(LT,T)),ne.ori==0?(bi=Hs,An=Ol):(bi=Ol,An=Hs),We=Y.left,at=Y.top);const Ie=r.select=It({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),Wa=Ie.show?Mi(UT,Ie.over?T:M):null;function es(g,y){if(Ie.show){for(let z in g)Ie[z]=g[z],z in Br&&zt(Wa,z,g[z]);y!==!1&&Ht("setSelect")}}r.setSelect=es;function Ur(g){if(D[g].show)re&&Eh(nt[g],ul);else if(re&&mi(nt[g],ul),we){let z=ya?Tn[0]:Tn[g];z!=null&&oa(z,-10,-10,Ne,fe)}}function Qn(g,y,z){Ml(g,{min:y,max:z})}function Hn(g,y,z,E){y.focus!=null&&cf(g),y.show!=null&&D.forEach((O,C)=>{C>0&&(g==C||g==null)&&(O.show=y.show,Ur(C),o==2?(Qn(O.facets[0].scale,null,null),Qn(O.facets[1].scale,null,null)):Qn(O.scale,null,null),ea())}),z!==!1&&Ht("setSeries",g,y),E&&is("setSeries",r,g,y)}r.setSeries=Hn;function eu(g,y){It(W[g],y)}function rf(g,y){g.fill=qe(g.fill||null),g.dir=Je(g.dir,-1),y=y??W.length,W.splice(y,0,g)}function of(g){g==null?W.length=0:W.splice(g,1)}r.addBand=rf,r.setBand=eu,r.delBand=of;function uf(g,y){D[g].alpha=y,we&&Tn[g]!=null&&(Tn[g].style.opacity=y),re&&nt[g]&&(nt[g].style.opacity=y)}let ri,na,Sa;const ts={focus:!0};function cf(g){if(g!=Sa){let y=g==null,z=li.alpha!=1;D.forEach((E,O)=>{if(o==1||O>0){let C=y||O==0||O==g;E._focus=y?null:C,z&&uf(O,C?1:li.alpha)}}),Sa=g,z&&ea()}}re&&va&&Wt(Ny,_e,g=>{Y._lock||(si(g),Sa!=null&&Hn(null,ts,!0,Dt.setSeries))});function _i(g,y,z){let E=G[y];z&&(g=g/Pe-(E.ori==1?Rt:it));let O=Ne;E.ori==1&&(O=fe,g=O-g),E.dir==-1&&(g=O-g);let C=E._min,F=E._max,te=g/O,se=C+(F-C)*te,oe=E.distr;return oe==3?gr(10,se):oe==4?nN(se,E.asinh):oe==100?E.bwd(se):se}function tu(g,y){let z=_i(g,ie,y);return Gi(z,i[0],Ct,bt)}r.valToIdx=g=>Gi(g,i[0]),r.posToIdx=tu,r.posToVal=_i,r.valToPos=(g,y,z)=>G[y].ori==0?f(g,G[y],z?ot:Ne,z?Dn:0):d(g,G[y],z?Gt:fe,z?on:0),r.setCursor=(g,y,z)=>{We=g.left,at=g.top,xa(null,y,z)};function nu(g,y){zt(Wa,lr,Ie.left=g),zt(Wa,jo,Ie.width=y)}function iu(g,y){zt(Wa,No,Ie.top=g),zt(Wa,ko,Ie.height=y)}let qs=ne.ori==0?nu:iu,Vs=ne.ori==1?nu:iu;function $r(){if(re&&H.live)for(let g=o==2?1:0;g{A[E]=z}):lN(g.idx)||A.fill(g.idx),H.idx=A[0]),re&&H.live){for(let z=0;z0||o==1&&!Cn)&&ff(z,A[z]);$r()}gn=!1,y!==!1&&Ht("setLegend")}r.setLegend=Lr;function ff(g,y){let z=D[g],E=g==0&&pe==2?vn:i[g],O;Cn?O=z.values(r,g,y)??En:(O=z.value(r,y==null?null:E[y],g,y),O=O==null?En:{_:O}),H.values[g]=O}function xa(g,y,z){Bs=We,Zr=at,[We,at]=Y.move(r,We,at),Y.left=We,Y.top=at,we&&(bi&&oa(bi,nn(We),0,Ne,fe),An&&oa(An,0,nn(at),Ne,fe));let E,O=Ct>bt;ri=gt,na=null;let C=ne.ori==0?Ne:fe,F=ne.ori==1?Ne:fe;if(We<0||At==0||O){E=Y.idx=null;for(let te=0;te0&&ut.show){let yn=et==null?-10:et==E?oe:ce(o==1?i[0][et]:i[ze][0][et],ne,C,0),Bt=st==null?-10:Te(st,o==1?G[ut.scale]:G[ut.facets[1].scale],F,0);if(va&&st!=null){let Mn=ne.ori==1?We:at,Kn=an(li.dist(r,ze,et,Bt,Mn));if(Kn=0?1:-1,Fn=Yt>=0?1:-1;Fn==On&&(Fn==1?cn==1?st>=Yt:st<=Yt:cn==1?st<=Yt:st>=Yt)&&(ri=Kn,na=ze)}else ri=Kn,na=ze}}if(gn||ya){let Mn,Kn;ne.ori==0?(Mn=yn,Kn=Bt):(Mn=Bt,Kn=yn);let cn,Yt,On,Fn,fn,dn,jn=!0,ia=un.bbox;if(ia!=null){jn=!1;let bn=ia(r,ze);On=bn.left,Fn=bn.top,cn=bn.width,Yt=bn.height}else On=Mn,Fn=Kn,cn=Yt=un.size(r,ze);if(dn=un.fill(r,ze),fn=un.stroke(r,ze),ya)ze==na&&ri<=li.prox&&(ue=On,he=Fn,ke=cn,Ye=Yt,Re=jn,De=dn,Oe=fn);else{let bn=Tn[ze];bn!=null&&(Xi[ze]=On,ba[ze]=Fn,Cy(bn,cn,Yt,jn),ky(bn,dn,fn),oa(bn,Oi(On),Oi(Fn),Ne,fe))}}}}if(ya){let ze=li.prox,ut=Sa==null?ri<=ze:ri>ze||na!=Sa;if(gn||ut){let _t=Tn[0];_t!=null&&(Xi[0]=ue,ba[0]=he,Cy(_t,ke,Ye,Re),ky(_t,De,Oe),oa(_t,Oi(ue),Oi(he),Ne,fe))}}}if(Ie.show&&$i)if(g!=null){let[te,se]=Dt.scales,[oe,ue]=Dt.match,[he,ke]=g.cursor.sync.scales,Ye=g.cursor.drag;if(yt=Ye._x,Mt=Ye._y,yt||Mt){let{left:Re,top:De,width:Oe,height:ze}=g.select,ut=g.scales[he].ori,_t=g.posToVal,Zt,et,st,yn,Bt,Mn=te!=null&&oe(te,he),Kn=se!=null&&ue(se,ke);Mn&&yt?(ut==0?(Zt=Re,et=Oe):(Zt=De,et=ze),st=G[te],yn=ce(_t(Zt,he),st,C,0),Bt=ce(_t(Zt+et,he),st,C,0),qs(Yi(yn,Bt),an(Bt-yn))):qs(0,C),Kn&&Mt?(ut==1?(Zt=Re,et=Oe):(Zt=De,et=ze),st=G[se],yn=Te(_t(Zt,ke),st,F,0),Bt=Te(_t(Zt+et,ke),st,F,0),Vs(Yi(yn,Bt),an(Bt-yn))):Vs(0,F)}else qr()}else{let te=an(Bs-jl),se=an(Zr-Pa);if(ne.ori==1){let ke=te;te=se,se=ke}yt=Qe.x&&te>=Qe.dist,Mt=Qe.y&&se>=Qe.dist;let oe=Qe.uni;oe!=null?yt&&Mt&&(yt=te>=oe,Mt=se>=oe,!yt&&!Mt&&(se>te?Mt=!0:yt=!0)):Qe.x&&Qe.y&&(yt||Mt)&&(yt=Mt=!0);let ue,he;yt&&(ne.ori==0?(ue=Ln,he=We):(ue=ta,he=at),qs(Yi(ue,he),an(he-ue)),Mt||Vs(0,F)),Mt&&(ne.ori==1?(ue=Ln,he=We):(ue=ta,he=at),Vs(Yi(ue,he),an(he-ue)),yt||qs(0,C)),!yt&&!Mt&&(qs(0,0),Vs(0,0))}if(Qe._x=yt,Qe._y=Mt,g==null){if(z){if(uu!=null){let[te,se]=Dt.scales;Dt.values[0]=te!=null?_i(ne.ori==0?We:at,te):null,Dt.values[1]=se!=null?_i(ne.ori==1?We:at,se):null}is(fh,r,We,at,Ne,fe,E)}if(va){let te=z&&Dt.setSeries,se=li.prox;Sa==null?ri<=se&&Hn(na,ts,!0,te):ri>se?Hn(null,ts,!0,te):na!=Sa&&Hn(na,ts,!0,te)}}gn&&(H.idx=E,Lr()),y!==!1&&Ht("setCursor")}let Li=null;Object.defineProperty(r,"rect",{get(){return Li==null&&Gs(!1),Li}});function Gs(g=!1){g?Li=null:(Li=T.getBoundingClientRect(),Ht("syncRect",Li))}function au(g,y,z,E,O,C,F){Y._lock||$i&&g!=null&&g.movementX==0&&g.movementY==0||(Hr(g,y,z,E,O,C,F,!1,g!=null),g!=null?xa(null,!0,!0):xa(y,!0,!1))}function Hr(g,y,z,E,O,C,F,te,se){if(Li==null&&Gs(!1),si(g),g!=null)z=g.clientX-Li.left,E=g.clientY-Li.top;else{if(z<0||E<0){We=-10,at=-10;return}let[oe,ue]=Dt.scales,he=y.cursor.sync,[ke,Ye]=he.values,[Re,De]=he.scales,[Oe,ze]=Dt.match,ut=y.axes[0].side%2==1,_t=ne.ori==0?Ne:fe,Zt=ne.ori==1?Ne:fe,et=ut?C:O,st=ut?O:C,yn=ut?E:z,Bt=ut?z:E;if(Re!=null?z=Oe(oe,Re)?p(ke,G[oe],_t,0):-10:z=_t*(yn/et),De!=null?E=ze(ue,De)?p(Ye,G[ue],Zt,0):-10:E=Zt*(Bt/st),ne.ori==1){let Mn=z;z=E,E=Mn}}se&&(y==null||y.cursor.event.type==fh)&&((z<=1||z>=Ne-1)&&(z=rl(z,Ne)),(E<=1||E>=fe-1)&&(E=rl(E,fe))),te?(jl=z,Pa=E,[Ln,ta]=Y.move(r,z,E)):(We=z,at=E)}const Br={width:0,height:0,left:0,top:0};function qr(){es(Br,!1)}let su,lu,ru,ou;function kl(g,y,z,E,O,C,F){$i=!0,yt=Mt=Qe._x=Qe._y=!1,Hr(g,y,z,E,O,C,F,!0,!1),g!=null&&(Wt(dh,zh,ns,!1),is(Ey,r,Ln,ta,Ne,fe,null));let{left:te,top:se,width:oe,height:ue}=Ie;su=te,lu=se,ru=oe,ou=ue}function ns(g,y,z,E,O,C,F){$i=Qe._x=Qe._y=!1,Hr(g,y,z,E,O,C,F,!1,!0);let{left:te,top:se,width:oe,height:ue}=Ie,he=oe>0||ue>0,ke=su!=te||lu!=se||ru!=oe||ou!=ue;if(he&&ke&&es(Ie),Qe.setScale&&he&&ke){let Ye=te,Re=oe,De=se,Oe=ue;if(ne.ori==1&&(Ye=se,Re=ue,De=te,Oe=oe),yt&&Qn(ie,_i(Ye,ie),_i(Ye+Re,ie)),Mt)for(let ze in G){let ut=G[ze];ze!=ie&&ut.from==null&&ut.min!=gt&&Qn(ze,_i(De+Oe,ze),_i(De,ze))}qr()}else Y.lock&&(Y._lock=!Y._lock,xa(y,!0,g!=null));g!=null&&(Ji(dh,zh),is(dh,r,We,at,Ne,fe,null))}function df(g,y,z,E,O,C,F){if(Y._lock)return;si(g);let te=$i;if($i){let se=!0,oe=!0,ue=10,he,ke;ne.ori==0?(he=yt,ke=Mt):(he=Mt,ke=yt),he&&ke&&(se=We<=ue||We>=Ne-ue,oe=at<=ue||at>=fe-ue),he&&se&&(We=We{let O=Dt.match[2];z=O(r,y,z),z!=-1&&Hn(z,E,!0,!1)},we&&(Wt(Ey,T,kl),Wt(fh,T,au),Wt(Ty,T,g=>{si(g),Gs(!1)}),Wt(Ny,T,df),Wt(Ay,T,Vr),jh.add(r),r.syncRect=Gs);const Ys=r.hooks=n.hooks||{};function Ht(g,y,z){Ia?$n.push([g,y,z]):g in Ys&&Ys[g].forEach(E=>{E.call(null,r,y,z)})}(n.plugins||[]).forEach(g=>{for(let y in g.hooks)Ys[y]=(Ys[y]||[]).concat(g.hooks[y])});const wa=(g,y,z)=>z,Dt=It({key:null,setSeries:!1,filters:{pub:Ly,sub:Ly},scales:[ie,D[1]?D[1].scale:null],match:[Hy,Hy,wa],values:[null,null]},Y.sync);Dt.match.length==2&&Dt.match.push(wa),Y.sync=Dt;const uu=Dt.key,Yr=u1(uu);function is(g,y,z,E,O,C,F){Dt.filters.pub(g,y,z,E,O,C,F)&&Yr.pub(g,y,z,E,O,C,F)}Yr.sub(r);function cu(g,y,z,E,O,C,F){Dt.filters.sub(g,y,z,E,O,C,F)&&za[g](null,y,z,E,O,C,F)}r.pub=cu;function Qs(){Yr.unsub(r),jh.delete(r),ki.clear(),Th(Zc,mr,Gr),v.remove(),_e?.remove(),Ht("destroy")}r.destroy=Qs;function Ea(){Ht("init",n,i),Lt(i||n.data,!1),ge[ie]?Ml(ie,ge[ie]):Sl(),ga=Ie.show&&(Ie.width>0||Ie.height>0),pa=gn=!0,Ya(n.width,n.height)}return D.forEach(Di),ee.forEach(Ar),s?s instanceof HTMLElement?(s.appendChild(v),Ea()):s(r,Ea):Ea(),r}Pt.assign=It;Pt.fmtNum=hm;Pt.rangeNum=Uc;Pt.rangeLog=Xc;Pt.rangeAsinh=fm;Pt.orient=yl;Pt.pxRatio=Pe;Pt.join=hN;Pt.fmtDate=pm,Pt.tzDate=wN;Pt.sync=u1;{Pt.addGap=lA,Pt.clipGaps=ef;let n=Pt.paths={points:p1};n.linear=v1,n.stepped=uA,n.bars=cA,n.spline=dA}const S1=(n,i,s,r,o)=>{if(!Number.isFinite(s)||!Number.isFinite(r)||r<=s)return[];const f=[];if(Math.asinh(r)-Math.asinh(s)<1.5){const m=Number.isFinite(o)&&o>0?o:(r-s)/4,v=Math.ceil(s/m)*m;for(let x=0;x<100;x++){const S=Number((v+x*m).toPrecision(14));if(S>r)break;f.push({value:S,priority:S===0?0:1})}}else{const m=Math.ceil(Math.log10(Math.max(Math.abs(s),Math.abs(r))));for(let v=Math.min(-1,m-1);v<=m;v++)for(const x of[1,2,5]){const S=x*10**v;for(const w of[-S,S])Number.isFinite(w)&&w>=s&&w<=r&&f.push({value:w,priority:x===1?1:2})}s<=0&&r>=0&&f.push({value:0,priority:0})}f.sort((m,v)=>m.priority-v.priority||m.value-v.value);const d=[],p=[];for(const{value:m}of f){const v=n.valToPos(m,"y");Number.isFinite(v)&&p.every(x=>Math.abs(v-x)>=36)&&(d.push(m),p.push(v))}return d.sort((m,v)=>m-v),d};function zA(n){const i=n.filter(([,s])=>s>0).map(([s,r])=>({minimumRate:s,virtualSize:r}));return i.sort((s,r)=>s.minimumRate-r.minimumRate),i}const wA=new Intl.NumberFormat(void 0,{maximumSignificantDigits:8}),EA=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function Rh(n){return wA.format(n)}function x1(n){return`${EA.format(n)} vB`}function TA({snapshot:n,now:i,color:s,scale:r}){const o=le.useMemo(()=>zA(n?.data.histogram??[]),[n]),f=n!==null&&i-n.receivedAt>=Bo,d=n===null?"Waiting for transaction-pool fee data…":f?"Fee distribution is stale. Waiting for a fresh pool snapshot…":n.data.count===0?"The transaction pool is empty.":o.length===0?"No fee distribution is available for this pool snapshot.":null;return b.jsxs("div",{className:"space-y-3",children:[d?b.jsx("p",{role:"status",className:"text-textMuted flex min-h-72 items-center justify-center px-4 text-center text-sm",children:d}):b.jsxs(b.Fragment,{children:[b.jsx(NA,{bins:o,color:s,scale:r}),b.jsx("p",{className:"text-textMuted text-xs",children:"Each bar is a fee-rate group, labeled by its minimum rate. Bar height is virtual size, not transaction count. Groups are spaced evenly."}),b.jsxs("details",{className:"border-accentSecondary/20 rounded-md border text-xs",children:[b.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-3 py-2",children:["View ",sn(o.length)," fee-rate ",o.length===1?"group":"groups"]}),b.jsx("div",{className:"border-accentSecondary/20 max-h-56 overflow-auto border-t",children:b.jsxs("table",{className:"w-full text-left tabular-nums",children:[b.jsx("caption",{className:"sr-only",children:"Transaction-pool fee-rate groups"}),b.jsx("thead",{className:"bg-surface text-textMuted sticky top-0",children:b.jsxs("tr",{children:[b.jsx("th",{scope:"col",className:"px-3 py-2",children:"Minimum rate (sat/vB)"}),b.jsx("th",{scope:"col",className:"px-3 py-2 text-right",children:"Virtual size (vB)"})]})}),b.jsx("tbody",{className:"divide-accentSecondary/20 divide-y",children:o.map((p,m)=>b.jsxs("tr",{children:[b.jsx("td",{className:"px-3 py-2",children:Rh(p.minimumRate)}),b.jsx("td",{className:"px-3 py-2 text-right",children:sn(p.virtualSize)})]},m))})]})})]})]}),n&&b.jsxs("p",{className:"text-textMuted text-xs",children:[f?"Last snapshot":"Snapshot"," ",hr(n.receivedAt),!f&&` · ${sn(n.data.count)} transactions · ${x1(n.data.virtual)}`]})]})}function NA({bins:n,color:i,scale:s}){const r=le.useRef(null),o=le.useRef(null),f=le.useRef(n);return le.useLayoutEffect(()=>{f.current=n;const d=o.current;d&&(d.setData([n.map((p,m)=>m),n.map(p=>p.virtualSize)]),d.redraw(!1,!0))},[n]),le.useLayoutEffect(()=>{const d=r.current;if(!d)return;const p=getComputedStyle(d),m=`12px ${p.fontFamily}`,v=[f.current.map((M,T)=>T),f.current.map(M=>M.virtualSize)],x={width:Math.max(240,d.clientWidth),height:280,padding:[12,12,0,0],cursor:{drag:{x:!1,y:!1}},legend:{show:!0,live:!0},scales:{x:{time:!1,range:()=>[-.5,f.current.length-.5]},y:{distr:s==="compressed"?4:1,asinh:1,range:(M,T,k)=>[0,Math.max(1,k*1.08)]}},axes:[{stroke:p.color,font:m,grid:{show:!1},ticks:{stroke:"#ffa0224d",width:1},splits:M=>{const T=f.current,k=Math.max(1,Math.ceil(T.length/Math.max(1,Math.floor(M.width/80))));return T.map((B,V)=>V).filter(B=>B%k===0)},values:(M,T)=>T.map(k=>Rh(f.current[k].minimumRate))},{size:76,stroke:p.color,font:m,grid:{stroke:"#c8563733",width:1},ticks:{stroke:"#ffa0224d",width:1},values:(M,T)=>T.map(k=>sn(k)),...s==="compressed"?{splits:S1,filter:(M,T)=>T}:{}}],series:[{label:"Min rate",value:(M,T)=>{const k=T===null?void 0:f.current[T];return k?`${Rh(k.minimumRate)} sat/vB`:"—"}},{label:"Virtual size",stroke:i,fill:`${i}90`,width:1,points:{show:!1},paths:Pt.paths.bars?.({size:[.85,48]}),value:(M,T)=>T===null?"—":x1(T)}]},S=new Pt(x,v,d);o.current=S;const w=new ResizeObserver(M=>{const T=M[0]?.contentRect.width;T&&T>0&&S.setSize({width:Math.round(T),height:280})});return w.observe(d),()=>{w.disconnect(),S.destroy(),o.current=null}},[i,s]),b.jsxs("div",{role:"img","aria-label":"Transaction-pool fee distribution: virtual size in vbytes by minimum fee rate in satoshis per vbyte",children:[b.jsx("p",{className:"text-textMuted mb-2 text-xs",children:"Virtual size (vB)"}),b.jsx("div",{ref:r,className:"text-textMuted min-w-0 overflow-hidden"}),b.jsx("p",{className:"text-textMuted text-center text-xs",children:"Minimum fee rate per group (sat/vB)"})]})}function AA({data:n,series:i,height:s=280,emptyMessage:r="Waiting for live data…",valueSuffix:o="",zeroBased:f=!0,valueFormatter:d=kA,visualization:p="line",scale:m="linear",forceEmpty:v=!1}){const x=le.useRef(null),S=le.useRef(null),w=le.useRef(!1),M=le.useRef(null),T=le.useMemo(()=>jA(n),[n]),k=le.useRef(T),B=!v&&n[0]?.length>0;return le.useLayoutEffect(()=>{k.current=T},[T]),le.useLayoutEffect(()=>{const V=x.current;if(!V)return;const D=getComputedStyle(V),ee=`12px ${D.fontFamily}`,G={width:Math.max(240,V.clientWidth),height:s,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},hooks:{setSelect:[X=>{X.select.width>0&&(w.current=!0)}]},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,distr:m==="compressed"?4:1,asinh:1,...f?{range:(X,de,me)=>[Math.min(0,de),me===0?1:me*1.08]}:{range:(X,de,me)=>{const ne=me-de,pe=ne===0?Math.max(1,Math.abs(me)*5e-4):ne*.08;return[de-pe,me+pe]}}}},axes:[{stroke:D.color,grid:{stroke:"#c8563733",width:1},ticks:{stroke:"#ffa0224d",width:1},font:ee},{size:72,stroke:D.color,grid:{stroke:"#c8563733",width:1},ticks:{stroke:"#ffa0224d",width:)DELIM" -R"DELIM(1},font:ee,values:(X,de)=>de.map(me=>me===null?null:`${d(me)}${o}`),...m==="compressed"?{splits:S1,filter:(X,de)=>de}:{}}],series:[{},...i.map((X,de)=>{const me=p==="step"?Pt.paths.stepped?.({align:1}):p==="bar"?MA(de,i.length):void 0;return{label:X.label,stroke:X.color,fill:p==="area"||p==="bar"?X.fill??`${X.color}24`:X.fill,width:X.width??2,paths:me,points:{show:p==="line"?X.points??!1:!1},value:(ne,pe)=>pe===null?"—":`${d(pe)}${o}`}})]},W=new Pt(G,k.current,V),ie=M.current;ie&&W.setScale("x",ie),S.current=W;const ae=new ResizeObserver(X=>{const de=X[0]?.contentRect.width;de&&de>0&&W.setSize({width:Math.round(de),height:s})});return ae.observe(V),()=>{M.current=w.current&&W.scales.x.min!=null&&W.scales.x.max!=null?{min:W.scales.x.min,max:W.scales.x.max}:null,ae.disconnect(),W.destroy(),S.current=null}},[s,i,d,o,p,f,m]),le.useEffect(()=>{const V=S.current;if(!V)return;const D=!w.current;V.setData(T,D),D||V.redraw()},[T]),b.jsxs("div",{className:"relative min-w-0",children:[b.jsx("div",{ref:x,className:"text-textMuted min-w-0 overflow-hidden"}),!B&&b.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:r})]})}function MA(n,i){const s=Math.max(1,i);return Pt.paths.bars?.({size:[1,48/s,0],disp:{x0:{unit:1,values:r=>{const o=o0(r,s),f=-o.groupWidth/2+o.barWidth*n;return Array.from(r.data[0],d=>d+f)}},size:{unit:1,values:r=>[o0(r,s).barWidth]}}})}function o0(n,i){const s=OA(n.data[0]),r=Math.abs(n.posToVal(48,"x")-n.posToVal(0,"x")),o=Math.min(s*.72,r);return{groupWidth:o,barWidth:o/i}}function OA(n){let i=Number.POSITIVE_INFINITY,s;for(const r of n)if(Number.isFinite(r)){if(s!==void 0){const o=Math.abs(r-s);o>0&&o=2)return n;const s=Date.now()/1e3,r=i[0]??s,o=[r-1,r],f=n.slice(1).map(d=>{const p=d[0]??null;return[p,p]});return[o,...f]}function kA(n){return Math.abs(n)>=1e6?`${(n/1e6).toFixed(1)}m`:Math.abs(n)>=1e3?`${(n/1e3).toFixed(1)}k`:Math.abs(n)>=10?n.toFixed(0):Math.abs(n)>=1?n.toFixed(1):n.toFixed(2)}const RA={300:"5m",900:"15m",3600:"1h"},CA=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),DA=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function ZA(n){return CA.format(n)}function UA(n){return DA.format(n)}function $A(n){return n==="height"||n==="occurrences"?ZA:UA}function LA({metrics:n}){const i=Cb(),[s,r]=le.useState(hT),[o,f]=le.useState(null),[d,p]=le.useState(!1);le.useEffect(()=>{mT(s)},[s]);function m(S){r(w=>o?.mode==="add"?w.length>=or?w:[...w,S]:w.map(M=>M.id===S.id?S:M)),f(null)}function v(S,w){r(M=>{const T=S+w;if(T<0||T>=M.length)return M;const k=[...M],B=k[S],V=k[T];return k[S]=V,k[T]=B,k})}function x(){if(!d){p(!0);return}r(Tc()),p(!1)}return b.jsxs("section",{className:"space-y-4",children:[b.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Live telemetry"}),b.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Custom charts"}),b.jsxs("p",{className:"text-textMuted mt-1 text-sm",children:["Session data only · ",String(s.length)," of ",String(or)," charts"]})]}),b.jsxs("div",{className:"flex flex-wrap gap-2",children:[b.jsx("button",{type:"button",onClick:()=>{p(!1),f({mode:"add",chart:Mb()})},disabled:s.length>=or,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:"Add chart"}),b.jsx("button",{type:"button",onClick:x,onBlur:()=>{p(!1)},className:`rounded-md border px-3 py-2 text-sm font-medium ${d?"border-amber-400/60 text-amber-200":"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary"}`,children:d?"Confirm reset":"Reset defaults"})]})]}),s.length===0?b.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border border-dashed px-6 py-16 text-center",children:[b.jsx("p",{className:"text-textPrimary font-medium",children:"No charts in this dashboard."}),b.jsx("p",{className:"text-textMuted mt-2 text-sm",children:"Add a custom chart or start from a template."})]}):b.jsx("div",{className:"grid gap-6 xl:grid-cols-2",children:s.map((S,w)=>b.jsx(HA,{chart:S,metrics:n,now:i,canMoveEarlier:w>0,canMoveLater:w{r(M=>M.map(T=>T.id===S.id?{...T,scale:T.scale==="compressed"?"linear":"compressed"}:T))},onDelete:()=>{r(M=>M.filter(T=>T.id!==S.id))},onDuplicate:()=>{r(M=>M.length>=or?M:[...M,dT(S)])},onEdit:()=>{f({mode:"edit",chart:S})},onMoveEarlier:()=>{v(w,-1)},onMoveLater:()=>{v(w,1)}},S.id))}),o&&b.jsx(NT,{chart:o.chart,mode:o.mode,onCancel:()=>{f(null)},onSave:m},`${o.mode}-${o.chart.id}`)]})}function HA({chart:n,metrics:i,now:s,canMoveEarlier:r,canMoveLater:o,canDuplicate:f,onDelete:d,onDuplicate:p,onEdit:m,onMoveEarlier:v,onMoveLater:x,onToggleScale:S}){const[w,M]=le.useState(null),[T,k]=le.useState(0),B=w??i,V=le.useMemo(()=>Xt(n)?bT(B,n):null,[n,B]),D=le.useMemo(()=>Xt(n)?n.series.map(W=>({label:W.label??Ba(W.signalId).label,color:W.color})):[],[n]),ee=$A(V?.unit??"vbytes"),G=`Waiting for ${D.length===1?D[0]?.label?.toLowerCase():"the selected signals"}…`;return b.jsxs("article",{className:"border-accent/30 bg-surface/80 min-w-0 overflow-hidden rounded-2xl border",children:[b.jsx("header",{className:"border-accentSecondary/20 space-y-3 border-b px-4 py-4 sm:px-5",children:b.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[b.jsxs("div",{className:"min-w-0",children:[b.jsx("h3",{className:"text-accent truncate text-lg font-semibold",title:n.title,children:n.title}),b.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:[Xt(n)&&V?`${Rb(V.unit)} · ${RA[n.range]} · ${n.visualization}`:"Virtual size by fee-rate group · latest snapshot",n.scale==="compressed"?" · compressed scale":"",w?" · paused":""]})]}),b.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[b.jsx("button",{type:"button","aria-label":`Compress peaks for ${n.title}`,"aria-pressed":n.scale==="compressed",title:"Use a log-like Y axis to compress large peaks. Zero, negative values, and original measurements are preserved.",onClick:S,className:`rounded-md border px-2 py-1.5 ${n.scale==="compressed"?"border-accent/40 bg-accentSecondary/20 text-accent":"border-accent/30 text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:"Compress peaks"}),b.jsx(ll,{label:w?"Resume chart":"Pause chart",onClick:()=>{M(W=>W?null:Xt(n)?i:{...i,now:s})},children:w?"Resume":"Pause"}),Xt(n)&&b.jsx(ll,{label:"Reset chart zoom",onClick:()=>{k(W=>W+1)},children:"Reset zoom"}),b.jsx(ll,{label:"Edit chart",onClick:m,children:"Edit"}),b.jsx(ll,{label:"Duplicate chart",onClick:p,disabled:!f,children:"Duplicate"}),b.jsx(ll,{label:`Move ${n.title} earlier`,onClick:v,disabled:!r,children:"←"}),b.jsx(ll,{label:`Move ${n.title} later`,onClick:x,disabled:!o,children:"→"}),b.jsx(ll,{label:"Delete chart",onClick:d,danger:!0,children:"Delete"})]})]})}),b.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:Xt(n)&&V?b.jsx(AA,{data:V.data,series:D,visualization:n.visualization,scale:n.scale,zeroBased:ST(V.unit),valueFormatter:ee,valueSuffix:_T(V.unit),forceEmpty:!V.hasObservedData,emptyMessage:G},T):!Xt(n)&&b.jsx(TA,{snapshot:B.poolSnapshot,now:w?.now??s,color:n.color,scale:n.scale})}),n.scale==="compressed"&&b.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Log-like Y axis · peaks compressed · labels and hover values show original measurements."}),Xt(n)&&n.series.some(W=>W.signalId==="event:10")&&b.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Archival includes compact-block recovery; rejected and duplicate submissions are excluded."}),V&&V.unobservedLabels.length>0&&V.hasObservedData&&b.jsxs("footer",{clas)DELIM" -R"DELIM(sName:"border-accent/10 text-textMuted border-t px-5 py-2 text-[11px]",children:["Not observed this session: ",V.unobservedLabels.join(", ")]})]})}function ll({label:n,children:i,onClick:s,disabled:r=!1,danger:o=!1}){return b.jsx("button",{type:"button","aria-label":n,onClick:s,disabled:r,className:`rounded-md px-2 py-1.5 disabled:cursor-not-allowed disabled:opacity-30 ${o?"text-textMuted hover:bg-red-500/10 hover:text-red-300":"text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:i})}const BA=[{event:0,label:"Header archived"},{event:3,label:"Block archived"},{event:5,label:"Block validated"},{event:6,label:"Block confirmed"},{event:13,label:"Block organized"},{event:14,label:"Block reorganized"}];function qA({adminStatus:n,endpoints:i,metrics:s,native:r,syncEstimate:o}){const f=PE(s,10),d=r.configuration,p=ti(6),m=[n.error?`Admin: ${n.error}`:null,r.status.error?`Native: ${r.status.error}`:null,r.transport==="none"&&r.restError?`Native REST: ${r.restError}`:null,s.invalidFrames>0?`${String(s.invalidFrames)} malformed admin frame${s.invalidFrames===1?"":"s"} ignored`:null,r.live.invalidFrames>0?`${String(r.live.invalidFrames)} malformed native frame${r.live.invalidFrames===1?"":"s"} ignored`:null,r.status.phase==="connected"&&r.transport==="none"?"Native: Connected, but no fresh valid state has been received":null].filter(v=>v!==null);return b.jsxs("div",{className:"space-y-6",children:[m.length>0&&b.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[b.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),b.jsx("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:m.map(v=>b.jsx("li",{children:v},v))})]}),b.jsx(aT,{confirmed:r.top,estimate:o}),b.jsxs("dl",{"aria-label":"Node summary",className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[b.jsx(bc,{label:"Canonical top",value:r.top===null?"—":sn(r.top),detail:r.transport==="none"?"Waiting for native API":`${GA(o)} · via ${r.transport==="websocket"?"native WebSocket":"REST fallback"}`,emphasized:!0}),b.jsx(bc,{label:"Current activity",value:f.label,detail:f.rate>0?`${zE(f.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",numeric:!1}),b.jsx(bc,{label:"Highest confirmed",value:s.signalMaximums[p]===void 0?"—":sn(s.signalMaximums[p]),detail:`${sn(s.signalTotals[p]??0)} confirmations observed`}),b.jsx(bc,{label:"Collection uptime",value:xE(s.now-s.sessionStartedAt),detail:`${sn(s.totalEvents)} events · ${sn(s.totalLogs)} logs`})]}),b.jsxs("section",{className:"grid gap-4 lg:grid-cols-2",children:[b.jsx(u0,{title:"Admin stream",endpoint:i.adminUrl,status:n,detail:n.lastMessageAt?`Last frame ${hr(n.lastMessageAt)}`:"Waiting for the first frame"}),b.jsx(u0,{title:"Native interface",endpoint:i.nativeUrl,status:r.status,detail:r.receivedAt?`Last state ${hr(r.receivedAt)} · ${r.transport}`:"Waiting for node state"})]}),b.jsx(LA,{metrics:s}),b.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[b.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border",children:[b.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle heights"}),b.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Highest observed event values"})]}),b.jsx("div",{className:"bg-accentSecondary/10 grid gap-px sm:grid-cols-2 lg:grid-cols-3",children:BA.map(({event:v,label:x})=>{const S=s.signalMaximums[ti(v)];return b.jsxs("div",{className:"bg-surface px-5 py-4",children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:x}),b.jsx("p",{className:"text-textPrimary mt-2 text-xl font-semibold tabular-nums",children:S===void 0?"—":sn(S)})]},v)})})]}),b.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[b.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),b.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Native configuration"})]}),d?b.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 p-5 text-sm",children:[b.jsx(rr,{label:"Address index",enabled:d.address}),b.jsx(rr,{label:"Client filters",enabled:d.filter}),b.jsx(rr,{label:"Turbo",enabled:d.turbo}),b.jsx(rr,{label:"Witness",enabled:d.witness}),b.jsx(rr,{label:"Retarget",enabled:d.retarget}),b.jsx(rr,{label:"Difficulty",enabled:d.difficult}),b.jsxs("div",{className:"border-accentSecondary/20 col-span-2 border-t pt-3",children:[b.jsx("span",{className:"text-textMuted",children:"Pruned below"}),b.jsx("span",{className:"text-textPrimary float-right font-mono",children:d.pruned>0?sn(d.pruned):"Not pruned"})]})]}):b.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),b.jsx("section",{children:b.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[b.jsx("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),s.recentEvents.length===0?b.jsx(VA,{text:"No events observed yet."}):b.jsx("ul",{className:"divide-accentSecondary/20 divide-y",children:s.recentEvents.slice(0,6).map(v=>b.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[b.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:hr(v.time)}),b.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:xr(v.event).name}),b.jsx("span",{className:"text-accent tabular-nums",children:ob(v.event,v.value)})]},v.id))})]})})]})}function u0({title:n,endpoint:i,status:s,detail:r}){return b.jsxs("article",{className:"border-accent/30 bg-surface/80 min-w-0 rounded-2xl border p-5",children:[b.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[b.jsxs("div",{children:[b.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),b.jsx("p",{className:"text-textPrimary mt-2 font-mono text-sm break-all",children:wE(i)})]}),b.jsx(iT,{phase:s.phase,label:s.phase})]}),b.jsxs("div",{className:"text-textMuted border-accentSecondary/20 mt-4 flex flex-wrap justify-between gap-2 border-t pt-3 text-xs",children:[b.jsx("span",{children:r}),b.jsxs("span",{children:[String(s.reconnects)," reconnect",s.reconnects===1?"":"s"]})]})]})}function rr({label:n,enabled:i}){return b.jsxs("div",{className:"flex items-center justify-between gap-3",children:[b.jsx("span",{className:"text-textMuted",children:n}),b.jsx("span",{className:i?"text-emerald-300":"text-textMuted",children:i?"Enabled":"Disabled"})]})}function VA({text:n}){return b.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}function GA(n){return n?n.blocksRemaining<=Kc?"Near current (estimated)":`${sn(n.blocksRemaining)} blocks remaining (estimated)`:"Waiting for confirmed block timestamp"}const YA=8e3;function QA({estimate:n,browserNotificationsEnabled:i}){const s=le.useRef(null),[r,o]=le.useState(null),f=n?.blocksRemaining??null;if(le.useEffect(()=>{const p=FA(f);if(!p)return;const m=s.current;if(s.current=p.state,!(m===null||m===p.state)&&(o(p),i)){const v=KA(p);vS(v.title,{body:v.body,tag:"libbitcoin-sync-status"})}},[i,f]),le.useEffect(()=>{if(!r)return;const p=setTimeout(()=>{o(m=>m===r?null:m)},YA);return()=>{clearTimeout(p)}},[r]),!r)return null;const d=r.state==="near-current";return b.jsx("aside",{role:"status","aria-live":"polite","aria-atomic":"true",className:`fixed right-4 bottom-4 left-4 z-[60] rounded-xl border p-4 shadow-2xl shadow-black/50 sm:left-auto sm:w-96 ${d?"border-emerald-400/35 bg-emerald-950/95":"border-amber-400/35 bg-amber-950/95"}`,children:b.jsxs("div")DELIM" -R"DELIM(,{className:"flex items-start gap-4",children:[b.jsxs("div",{className:"min-w-0 flex-1",children:[b.jsx("p",{className:d?"font-semibold text-emerald-200":"font-semibold text-amber-200",children:d?"Node near current (estimated)":"Node fell behind (estimated)"}),b.jsx("p",{className:"mt-1 text-sm text-white/75",children:Ch(r)})]}),b.jsx("button",{type:"button","aria-label":"Dismiss synchronization notification",onClick:()=>{o(null)},className:"text-lg leading-none text-white/60 hover:text-white",children:"×"})]})})}function KA(n){return n.state==="near-current"?{title:"Libbitcoin node near current (estimated)",body:Ch(n)}:{title:"Libbitcoin node fell behind (estimated)",body:Ch(n)}}function FA(n){return n===null?null:{state:n<=Kc?"near-current":"behind",blocksBehind:n}}function Ch(n){return n.state==="near-current"?`Confirmed top is estimated to be within ${String(Kc)} blocks of the chain tip, based on block time.`:`Confirmed top is estimated to be ${sn(n.blocksBehind)} blocks behind the chain tip, based on block time.`}const z1='(function(){"use strict";var Ee;function u(e,t,n){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=o.prototype,h=Object.keys(l);for(let m=0;mn?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class R extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ie extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Ee=globalThis).__zod_globalConfig??(Ee.__zod_globalConfig={});const le=globalThis.__zod_globalConfig;function A(e){return le}function Te(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function he(e,t){return typeof t=="bigint"?t.toString():t}function fe(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function de(e){return e==null}function pe(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Bt(e,t){const n=e/t,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r){};function W(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Gt=fe(()=>{if(le.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function U(e){if(W(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(W(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Ae(e){return U(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const qt=new Set(["string","number","symbol"]);function G(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function N(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function f(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Ht(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Yt={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 Xt(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=P(e._zod.def,{get shape(){const o={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=n.shape[a])}return M(this,"shape",o),o},checks:[]});return N(e,s)}function Qt(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=P(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return M(this,"shape",o),o},checks:[]});return N(e,s)}function en(e,t){if(!U(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=P(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return M(this,"shape",s),s}});return N(e,i)}function tn(e,t){if(!U(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=P(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return M(this,"shape",r),r}});return N(e,n)}function nn(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=P(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return M(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return N(e,n)}function rn(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=P(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return M(this,"shape",c),c},checks:[]});return N(t,o)}function sn(e,t,n){const r=P(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new e({type:"nonoptional",innerType:i[o]});return M(this,"shape",s),s}});return N(t,r)}function L(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function H(e){return typeof e=="string"?e:e?.message}function j(e,t,n){const r=e.message?e.message:H(e.inst?._zod.def?.error?.(e))??H(t?.error?.(e))??H(n.customError?.(e))??H(n.localeError?.(e))??"Invalid input",{inst:i,continue:s,input:o,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&)DELIM" -R"DELIM(&(a.input=o),a}function me(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function J(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Me=(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,he,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},je=u("$ZodError",Me),Re=u("$ZodError",Me,{Parent:Error});function an(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cn(e,t=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const a=[...s,...o.path];if(a.length===0)n._errors.push(t(o));else{let c=n,l=0;for(;l(t,n,r,i)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new R;if(o.issues.length){const a=new(i?.Err??e)(o.issues.map(c=>j(c,s,A())));throw Ne(a,i?.callee),a}return o.value},_e=e=>async(t,n,r,i)=>{const s=r?{...r,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(i?.Err??e)(o.issues.map(c=>j(c,s,A())));throw Ne(a,i?.callee),a}return o.value},Y=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new R;return s.issues.length?{success:!1,error:new(e??je)(s.issues.map(o=>j(o,i,A())))}:{success:!0,data:s.value}},un=Y(Re),X=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>j(o,i,A())))}:{success:!0,data:s.value}},ln=X(Re),hn=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return ge(e)(t,n,i)},fn=e=>(t,n,r)=>ge(e)(t,n,r),dn=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return _e(e)(t,n,i)},pn=e=>async(t,n,r)=>_e(e)(t,n,r),mn=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Y(e)(t,n,i)},gn=e=>(t,n,r)=>Y(e)(t,n,r),_n=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return X(e)(t,n,i)},vn=e=>async(t,n,r)=>X(e)(t,n,r),bn=/^[cC][0-9a-z]{6,}$/,yn=/^[0-9a-z]+$/,wn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zn=/^[0-9a-vA-V]{20}$/,kn=/^[A-Za-z0-9]{27}$/,$n=/^[a-zA-Z0-9_-]{21}$/,Sn=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,Zn=/^([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})$/,Le=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${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)$/,En=/^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_\'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,In="^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$";function Tn(){return new RegExp(In,"u")}const On=/^(?:(?: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])$/,Pn=/^(([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}|:))$/,Nn=/^((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])$/,An=/^(([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])$/,Mn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Fe=/^[A-Za-z0-9_-]*$/,jn=/^https?$/,Rn=/^\\+[1-9]\\d{6,14}$/,xe="(?:(?:\\\\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])))",Ln=new RegExp(`^${xe}$`);function Ce(e){const t="(?:[01]\\\\d|2[0-3]):[0-5]\\\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function Fn(e){return new RegExp(`^${Ce(e)}$`)}function xn(e){const t=Ce({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${xe}T(?:${r})$`)}const Cn=e=>{const t=e?`[\\\\s\\\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\\\s\\\\S]*";return new RegExp(`^${t}$`)},Dn=/^-?\\d+$/,Un=/^-?\\d+(?:\\.\\d+)?$/,Jn=/^(?:true|false)$/i,Kn=/^[^A-Z]*$/,Vn=/^[^a-z]*$/,E=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),De={number:"number",bigint:"bigint",object:"date"},Ue=u("$ZodCheckLessThan",(e,t)=>{E.init(e,t);const n=De[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value{(t.inclusive?r.value<=t.value:r.value{E.init(e,t);const n=De[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bn=u("$ZodCheckMultipleOf",(e,t)=>{E.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Bt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wn=u("$ZodCheckNumberFormat",(e,t)=>{E.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=Yt[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=i,a.maximum=s,n&&(a.pattern=Dn)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}as&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Gn=u("$ZodCheckMaxLength",(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!de(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum{const i=r.value;if(i.length<=t.maximum)return;const o=me(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),qn=u("$ZodCheckMinLength",(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!de(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=me(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Hn=u("$ZodCheckLengthEquals",(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!de(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=me(i),a=s>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Q=u("$ZodCheckStringFormat",(e,t)=>{var n,r;E.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Yn=u("$ZodCheckRegex",(e,t)=>{Q.init(e,t),e._zod.check=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})}}),Xn=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Kn),Q.init(e,t)}),Qn=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Vn),Q.init(e,t)}),er=u("$ZodCheckIncludes",(e,t)=>{E.init(e,t);const n=G(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),tr=u("$ZodCheckStartsWith",(e,t)=>{E.init(e,t);const n=new RegExp(`^${G(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),nr=u("$ZodCheckEndsWith",(e,t)=>{E.init(e,t);const n=new RegExp(`.*${G(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),rr=u("$ZodCheckOverwrite",(e,t)=>{E.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class ir{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`\n`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`\n`))}}const sr={major:4,minor:4,patch:3},b=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=sr;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,a,c)=>{let l=L(o),h;for(const m of a){if(m._zod.def.when){if(on(o)||!m._zod.def.when(o))continue}else if(l)continue;const p=o.issues.length,d=m._zod.check(o);if(d instanceof Promise&&c?.async===!1)throw new R;if(h||d instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await d,o.issues.length!==p&&(l||(l=L(o,p)))});else{if(o.issues.length===p)continue;l||(l=L(o,p))}}return h?h.then(()=>o):o},s=(o,a,c)=>{if(L(o))return o.aborted=!0,o;const l=i(a,r,c);if(l instanceof Promise){if(c.async===!1)throw new R;return l.then(h=>e._zod.parse(h,c))}return e._zod.parse(l,c)};e._zod.run=(o,a)=>{if(a.skipChecks)return e._zod.parse(o,a);if(a.direction==="backward"){const l=e._zod.parse({value:o.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(h=>s(h,o,a)):s(l,o,a)}const c=e._zod.parse(o,a);if(c instanceof Promise){if(a.async===!1)throw new R;return c.then(l=>i(l,r,a))}return i(c,r,a)}}_(e,"~standard",()=>({validate:i=>{try{const s=un(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ln(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ve=u("$ZodString",(e,t)=>{b.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Cn(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),v=u("$ZodStringFormat",(e,t)=>{Q.init(e,t),ve.init(e,t)}),or=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Zn),v.init(e,t)}),ar=u("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Le(r))}else t.pattern??(t.pattern=Le());v.init(e,t)}),cr=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=En),v.init(e,t)}),ur=u("$ZodURL",(e,t)=>{v.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===jn.source&&!/^https?:\\/\\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.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=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),lr=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Tn()),v.init(e,t)}),hr=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=$n),v.init(e,t)}),fr=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=bn),v.init(e,t)}),dr=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yn),v.init(e,t)}),pr=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wn),v.init(e,t)}),mr=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zn),v.init(e,t)}),gr=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kn),v.init(e,t)}),_r=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xn(t)),v.init(e,t)}),vr=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ln),v.init(e,t)}),br=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pa)DELIM" -R"DELIM(ttern=Fn(t)),v.init(e,t)}),yr=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Sn),v.init(e,t)}),wr=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=On),v.init(e,t),e._zod.bag.format="ipv4"}),zr=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Pn),v.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),kr=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Nn),v.init(e,t)}),$r=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=An),v.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function Ke(e){if(e==="")return!0;if(/\\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Sr=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Mn),v.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{Ke(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Zr(e){if(!Fe.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Ke(n)}const Er=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fe),v.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Zr(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ir=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rn),v.init(e,t)});function Tr(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Or=u("$ZodJWT",(e,t)=>{v.init(e,t),e._zod.check=n=>{Tr(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ve=u("$ZodNumber",(e,t)=>{b.init(e,t),e._zod.pattern=e._zod.bag.pattern??Un,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),Pr=u("$ZodNumberFormat",(e,t)=>{Wn.init(e,t),Ve.init(e,t)}),Nr=u("$ZodBoolean",(e,t)=>{b.init(e,t),e._zod.pattern=Jn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Ar=u("$ZodUnknown",(e,t)=>{b.init(e,t),e._zod.parse=n=>n}),Mr=u("$ZodNever",(e,t)=>{b.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Be(e,t,n){e.issues.length&&t.issues.push(...q(n,e.issues)),t.value[n]=e.value}const jr=u("$ZodArray",(e,t)=>{b.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let o=0;oBe(l,n,o))):Be(c,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function ee(e,t,n,r,i,s){const o=n in r;if(e.issues.length){if(i&&s&&!o)return;t.issues.push(...q(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function We(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Ht(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ge(e,t,n,r,i,s){const o=[],a=i.keySet,c=i.catchall._zod,l=c.def.type,h=c.optin==="optional",m=c.optout==="optional";for(const p in t){if(p==="__proto__"||a.has(p))continue;if(l==="never"){o.push(p);continue}const d=c.run({value:t[p],issues:[]},r);d instanceof Promise?e.push(d.then(g=>ee(g,n,p,t,h,m))):ee(d,n,p,t,h,m)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Rr=u("$ZodObject",(e,t)=>{if(b.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=fe(()=>We(t));_(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const h=a[l]._zod;if(h.values){c[l]??(c[l]=new Set);for(const m of h.values)c[l].add(m)}}return c});const i=W,s=t.catchall;let o;e._zod.parse=(a,c)=>{o??(o=r.value);const l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const h=[],m=o.shape;for(const p of o.keys){const d=m[p],g=d._zod.optin==="optional",B=d._zod.optout==="optional",$=d._zod.run({value:l[p],issues:[]},c);$ instanceof Promise?h.push($.then(Ze=>ee(Ze,a,p,l,g,B))):ee($,a,p,l,g,B)}return s?Ge(h,l,a,c,r.value,e):h.length?Promise.all(h).then(()=>a):a}}),Lr=u("$ZodObjectJIT",(e,t)=>{Rr.init(e,t);const n=e._zod.parse,r=fe(()=>We(t)),i=p=>{const d=new ir(["shape","payload","ctx"]),g=r.value,B=O=>{const z=Pe(O);return`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`};d.write("const input = payload.value;");const $=Object.create(null);let Ze=0;for(const O of g.keys)$[O]=`key_${Ze++}`;d.write("const newResult = {};");for(const O of g.keys){const z=$[O],S=Pe(O),Kt=p[O],Vt=Kt?._zod?.optin==="optional",ha=Kt?._zod?.optout==="optional";d.write(`const ${z} = ${B(O)};`),Vt&&ha?d.write(`\n if (${z}.issues.length) {\n if (${S} in input) {\n payload.issues = payload.issues.concat(${z}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${S}, ...iss.path] : [${S}]\n })));\n }\n }\n \n if (${z}.value === undefined) {\n if (${S} in input) {\n newResult[${S}] = undefined;\n }\n } else {\n newResult[${S}] = ${z}.value;\n }\n \n `):Vt?d.write(`\n if (${z}.issues.length) {\n payload.issues = payload.issues.concat(${z}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${S}, ...iss.path] : [${S}]\n })));\n }\n \n if (${z}.value === undefined) {\n if (${S} in input) {\n newResult[${S}] = undefined;\n }\n } else {\n newResult[${S}] = ${z}.value;\n }\n \n `):d.write(`\n const ${z}_present = ${S} in input;\n if (${z}.issues.length) {\n payload.issues = payload.issues.concat(${z}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${S}, ...iss.path] : [${S}]\n })));\n }\n if (!${z}_present && !${z}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${S}]\n });\n }\n\n if (${z}_present) {\n if (${z}.value === undefined) {\n newResult[${S}] = undefined;\n } else {\n newResult[${S}] = ${z}.value;\n }\n }\n\n `)}d.write("payload.value = newResult;"),d.write("return payload;");const la=d.compile();return(O,z)=>la(p,O,z)};let s;const o=W,a=!le.jitless,l=a&&Gt.value,h=t.catchall;let m;e._zod.parse=(p,d)=>{m??(m=r.value);const g=p.value;return o(g)?a&&l&&d?.async===!1&&d.jitless!==!0?(s||(s=i(t.shape)),p=s(p,d),h?Ge([],g,p,d,m,e):p):n(p,d):(p.issues.push({expected:"object",code:"invalid_type",i)DELIM" -R"DELIM(nput:g,inst:e}),p)}});function qe(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!L(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>j(o,r,A())))}),t)}const Fr=u("$ZodUnion",(e,t)=>{b.init(e,t),_(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),_(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),_(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>pe(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1;const o=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(a=>qe(a,r,e,i)):qe(o,r,e,i)}}),xr=u("$ZodIntersection",(e,t)=>{b.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,l])=>He(n,c,l)):He(n,s,o)}});function be(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(U(e)&&U(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const o=be(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;ra.l&&a.r).map(([a])=>a);if(s.length&&i&&e.issues.push({...i,keys:s}),L(e))return e;const o=be(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const Cr=u("$ZodTuple",(e,t)=>{b.init(e,t);const n=t.items;e._zod.parse=(r,i)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const o=[],a=Ye(n,"optin"),c=Ye(n,"optout");if(!t.rest){if(s.lengthn.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:s,inst:e,origin:"array"})}const l=new Array(n.length);for(let h=0;h{l[h]=p})):l[h]=m}if(t.rest){let h=n.length-1;const m=s.slice(n.length);for(const p of m){h++;const d=t.rest._zod.run({value:p,issues:[]},i);d instanceof Promise?o.push(d.then(g=>Xe(g,r,h))):Xe(d,r,h)}}return o.length?Promise.all(o).then(()=>Qe(l,r,n,s,c)):Qe(l,r,n,s,c)}});function Ye(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function Xe(e,t,n){e.issues.length&&t.issues.push(...q(n,e.issues)),t.value[n]=e.value}function Qe(e,t,n,r,i){for(let s=0;s=i){t.value.length=s;break}t.issues.push(...q(s,o.issues))}t.value[s]=o.value}for(let s=t.value.length-1;s>=r.length&&(n[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}const Dr=u("$ZodEnum",(e,t)=>{b.init(e,t);const n=Te(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>qt.has(typeof i)).map(i=>typeof i=="string"?G(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),Ur=u("$ZodTransform",(e,t)=>{b.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ie(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n.fallback=!0,n));if(i instanceof Promise)throw new R;return n.value=i,n.fallback=!0,n}});function et(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const tt=u("$ZodOptional",(e,t)=>{b.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${pe(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>et(o,i)):et(s,i)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Jr=u("$ZodExactOptional",(e,t)=>{tt.init(e,t),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Kr=u("$ZodNullable",(e,t)=>{b.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${pe(n.source)}|null)$`):void 0}),_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Vr=u("$ZodDefault",(e,t)=>{b.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>nt(s,t)):nt(i,t)}});function nt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Br=u("$ZodPrefault",(e,t)=>{b.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Wr=u("$ZodNonOptional",(e,t)=>{b.init(e,t),_(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>rt(s,e)):rt(i,e)}});function rt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Gr=u("$ZodCatch",(e,t)=>{b.init(e,t),e._zod.optin="optional",_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>j(o,r,A()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>j(s,r,A()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),qr=u("$ZodPipe",(e,t)=>{b.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(o=>te(o,t.in,r)):te(s,t.in,r)}const i=t.in._zod.run(n,r);retu)DELIM" -R"DELIM(rn i instanceof Promise?i.then(s=>te(s,t.out,r)):te(i,t.out,r)}});function te(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Hr=u("$ZodReadonly",(e,t)=>{b.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>t.innerType?._zod?.optin),_(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(it):it(i)}});function it(e){return e.value=Object.freeze(e.value),e}const Yr=u("$ZodCustom",(e,t)=>{E.init(e,t),b.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>st(s,n,r,e));st(i,n,r,e)}});function st(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(J(i))}}var ot;class Xr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Qr(){return new Xr}(ot=globalThis).__zod_globalRegistry??(ot.__zod_globalRegistry=Qr());const K=globalThis.__zod_globalRegistry;function ei(e,t){return new e({type:"string",...f(t)})}function ti(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...f(t)})}function at(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...f(t)})}function ni(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...f(t)})}function ri(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...f(t)})}function ii(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...f(t)})}function si(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...f(t)})}function oi(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...f(t)})}function ai(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...f(t)})}function ci(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...f(t)})}function ui(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...f(t)})}function li(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...f(t)})}function hi(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...f(t)})}function fi(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...f(t)})}function di(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...f(t)})}function pi(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...f(t)})}function mi(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...f(t)})}function gi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...f(t)})}function _i(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...f(t)})}function vi(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...f(t)})}function bi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...f(t)})}function yi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...f(t)})}function wi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...f(t)})}function zi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...f(t)})}function ki(e,t){return new e({type:"string",format:"date",check:"string_format",...f(t)})}function $i(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...f(t)})}function Si(e,t){return new e({type:"string",format:"duration",check:"string_format",...f(t)})}function Zi(e,t){return new e({type:"number",checks:[],...f(t)})}function Ei(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...f(t)})}function Ii(e,t){return new e({type:"boolean",...f(t)})}function Ti(e){return new e({type:"unknown"})}function Oi(e,t){return new e({type:"never",...f(t)})}function ct(e,t){return new Ue({check:"less_than",...f(t),value:e,inclusive:!1})}function ye(e,t){return new Ue({check:"less_than",...f(t),value:e,inclusive:!0})}function ut(e,t){return new Je({check:"greater_than",...f(t),value:e,inclusive:!1})}function we(e,t){return new Je({check:"greater_than",...f(t),value:e,inclusive:!0})}function lt(e,t){return new Bn({check:"multiple_of",...f(t),value:e})}function ht(e,t){return new Gn({check:"max_length",...f(t),maximum:e})}function ne(e,t){return new qn({check:"min_length",...f(t),minimum:e})}function ft(e,t){return new Hn({check:"length_equals",...f(t),length:e})}function Pi(e,t){return new Yn({check:"string_format",format:"regex",...f(t),pattern:e})}function Ni(e){return new Xn({check:"string_format",format:"lowercase",...f(e)})}function Ai(e){return new Qn({check:"string_format",format:"uppercase",...f(e)})}function Mi(e,t){return new er({check:"string_format",format:"includes",...f(t),includes:e})}function ji(e,t){return new tr({check:"string_format",format:"starts_with",...f(t),prefix:e})}function Ri(e,t){return new nr({check:"string_format",format:"ends_with",...f(t),suffix:e})}function F(e){return new rr({check:"overwrite",tx:e})}function Li(e){return F(t=>t.normalize(e))}function Fi(){return F(e=>e.trim())}function xi(){return F(e=>e.toLowerCase())}function Ci(){return F(e=>e.toUpperCase())}function Di(){return F(e=>Wt(e))}function Ui(e,t,n){return new e({type:"array",element:t,...f(n)})}function Ji(e,t,n){return new e({type:"custom",check:"custom",fn:t,...f(n)})}function Ki(e,t){const n=Vi(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(J(i,r.value,n._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(J(s))}},e(r.value,r)),t);return n}function Vi(e,t){const n=new E({check:"custom",...f(t)});return n._zod.check=e,n}function dt(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??K,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function k(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{const h={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const p=o.schema,d=t.processors[i.type];if(!d)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);d(e,t,p,h)}const m=e._zod.parent;m&&(o.ref||(o.ref=m),k(m,t,h),t.seen.get(m).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io==="input"&&Z(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._)DELIM" -R"DELIM(prefault,t.seen.get(e).schema}function pt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const a=e.metadataRegistry.get(o[0])?.id;if(a){const c=r.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,o[0])}}const i=o=>{const a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=e.external.registry.get(o[0])?.id,p=e.external.uri??(g=>g);if(m)return{ref:p(m)};const d=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=d,{defId:d,ref:`${p("__shared")}#/${a}/${d}`}}if(o[1]===n)return{ref:"#"};const l=`#/${a}/`,h=o[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:l+h}},s=o=>{if(o[1].schema.$ref)return;const a=o[1],{ref:c,defId:l}=i(o);a.def={...a.schema},l&&(a.defId=l);const h=a.schema;for(const m in h)delete h[m];h.$ref=c};if(e.cycles==="throw")for(const o of e.seen.entries()){const a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/\n\nSet the \\`cycles\\` parameter to \\`"ref"\\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const a=o[1];if(t===o[0]){s(o);continue}if(e.external){const l=e.external.registry.get(o[0])?.id;if(t!==o[0]&&l){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&e.reused==="ref"){s(o);continue}}}function mt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=a=>{const c=e.seen.get(a);if(c.ref===null)return;const l=c.def??c.schema,h={...l},m=c.ref;if(c.ref=null,m){r(m);const d=e.seen.get(m),g=d.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,h),a._zod.parent===m)for(const $ in l)$==="$ref"||$==="allOf"||$ in h||delete l[$];if(g.$ref&&d.def)for(const $ in l)$==="$ref"||$==="allOf"||$ in d.def&&JSON.stringify(l[$])===JSON.stringify(d.def[$])&&delete l[$]}const p=a._zod.parent;if(p&&p!==m){r(p);const d=e.seen.get(p);if(d?.schema.$ref&&(l.$ref=d.schema.$ref,d.def))for(const g in l)g==="$ref"||g==="allOf"||g in d.def&&JSON.stringify(l[g])===JSON.stringify(d.def[g])&&delete l[g]}e.override({zodSchema:a,jsonSchema:l,path:c.path??[]})};for(const a of[...e.seen.entries()].reverse())r(a[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(a)}Object.assign(i,n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const o=e.external?.defs??{};for(const a of e.seen.entries()){const c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const a=JSON.parse(JSON.stringify(i));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:re(t,"input",e.processors),output:re(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function Z(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Z(r.element,n);if(r.type==="set")return Z(r.valueType,n);if(r.type==="lazy")return Z(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Z(r.innerType,n);if(r.type==="intersection")return Z(r.left,n)||Z(r.right,n);if(r.type==="record"||r.type==="map")return Z(r.keyType,n)||Z(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Z(r.in,n)||Z(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Z(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Z(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Z(i,n))return!0;return!!(r.rest&&Z(r.rest,n))}return!1}const Bi=(e,t={})=>n=>{const r=dt({...n,processors:t});return k(e,r),pt(r,e),mt(r,e)},re=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=dt({...i??{},target:s,io:t,processors:n});return k(e,o),pt(o,e),mt(o,e)},Wi={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gi=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),a&&(i.format=Wi[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){const h=[...c];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},qi=(e,t,n,r)=>{const i=n,{minimum:s,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:h}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number";const m=typeof h=="number"&&h>=(s??Number.NEGATIVE_INFINITY),p=typeof l=="number"&&l<=(o??Number.POSITIVE_INFINITY),d=t.target==="draft-04"||t.target==="openapi-3.0";m?d?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h:typeof s=="number"&&(i.minimum=s),p?d?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},Hi=(e,t,n,r)=>{n.type="boolean"},Yi=(e,t,n,r)=>{n.not={}},Xi=(e,t,n,r)=>{},Qi=(e,t,n,r)=>{const i=e._zod.def,s=Te(i.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},es=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ts=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ns=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:a}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=k(s.element,t,{...r,path:[...r.path,"items"]})},rs=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const o=s.shape;for(const l in o)i.properties[l]=k(o[l],t,{...r,path:[...r.path,"properties",l]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{const h=s.shape[l]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));c.size>0&&(i.required=Array.from(c)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=k(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},is=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,o=i.options.map((a,c)=>k(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=o:n.anyOf=o},ss=(e,t,n,r)=>{const i=e._zod.def,s=k(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=k(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];n.allOf=c},os=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((p,d)=>k(p,t,{...r,path:[...r.path,o,d]})),l=s.rest?k(s.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,l&&(i.items=l)):t.target==="openapi-3.0"?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalIte)DELIM" -R"DELIM(ms=l));const{minimum:h,maximum:m}=e._zod.bag;typeof h=="number"&&(i.minItems=h),typeof m=="number"&&(i.maxItems=m)},as=(e,t,n,r)=>{const i=e._zod.def,s=k(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},cs=(e,t,n,r)=>{const i=e._zod.def;k(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},us=(e,t,n,r)=>{const i=e._zod.def;k(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},ls=(e,t,n,r)=>{const i=e._zod.def;k(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},hs=(e,t,n,r)=>{const i=e._zod.def;k(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},fs=(e,t,n,r)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?s?i.out:i.in:i.out;k(o,t,r);const a=t.seen.get(e);a.ref=o},ds=(e,t,n,r)=>{const i=e._zod.def;k(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},gt=(e,t,n,r)=>{const i=e._zod.def;k(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},ps=u("ZodISODateTime",(e,t)=>{_r.init(e,t),y.init(e,t)});function ms(e){return zi(ps,e)}const gs=u("ZodISODate",(e,t)=>{vr.init(e,t),y.init(e,t)});function _s(e){return ki(gs,e)}const vs=u("ZodISOTime",(e,t)=>{br.init(e,t),y.init(e,t)});function bs(e){return $i(vs,e)}const ys=u("ZodISODuration",(e,t)=>{yr.init(e,t),y.init(e,t)});function ws(e){return Si(ys,e)}const I=u("ZodError",(e,t)=>{je.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>cn(e,n)},flatten:{value:n=>an(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,he,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,he,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),zs=ge(I),ks=_e(I),$s=Y(I),Ss=X(I),Zs=hn(I),Es=fn(I),Is=dn(I),Ts=pn(I),Os=mn(I),Ps=gn(I),Ns=_n(I),As=vn(I),_t=new WeakMap;function V(e,t,n){const r=Object.getPrototypeOf(e);let i=_t.get(r);if(i||(i=new Set,_t.set(r,i)),!i.has(t)){i.add(t);for(const s in n){const o=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const a=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}const w=u("ZodType",(e,t)=>(b.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:re(e,"input"),output:re(e,"output")}}),e.toJSONSchema=Bi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>zs(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$s(e,n,r),e.parseAsync=async(n,r)=>ks(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ss(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Zs(e,n,r),e.decode=(n,r)=>Es(e,n,r),e.encodeAsync=async(n,r)=>Is(e,n,r),e.decodeAsync=async(n,r)=>Ts(e,n,r),e.safeEncode=(n,r)=>Os(e,n,r),e.safeDecode=(n,r)=>Ps(e,n,r),e.safeEncodeAsync=async(n,r)=>Ns(e,n,r),e.safeDecodeAsync=async(n,r)=>As(e,n,r),V(e,"ZodType",{check(...n){const r=this.def;return this.clone(P(r,{checks:[...r.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return N(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(To(n,r))},superRefine(n,r){return this.check(Oo(n,r))},overwrite(n){return this.check(F(n))},optional(){return Zt(this)},exactOptional(){return go(this)},nullable(){return Et(this)},nullish(){return Zt(Et(this))},nonoptional(n){return zo(this,n)},array(){return kt(this)},or(n){return $t([this,n])},and(n){return co(this,n)},transform(n){return Tt(this,po(n))},default(n){return bo(this,n)},prefault(n){return wo(this,n)},catch(n){return $o(this,n)},pipe(n){return Tt(this,n)},readonly(){return Eo(this)},describe(n){const r=this.clone();return K.add(r,{description:n}),r},meta(...n){if(n.length===0)return K.get(this);const r=this.clone();return K.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return K.get(e)?.description},configurable:!0}),e)),vt=u("_ZodString",(e,t)=>{ve.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Gi(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,V(e,"_ZodString",{regex(...r){return this.check(Pi(...r))},includes(...r){return this.check(Mi(...r))},startsWith(...r){return this.check(ji(...r))},endsWith(...r){return this.check(Ri(...r))},min(...r){return this.check(ne(...r))},max(...r){return this.check(ht(...r))},length(...r){return this.check(ft(...r))},nonempty(...r){return this.check(ne(1,...r))},lowercase(r){return this.check(Ni(r))},uppercase(r){return this.check(Ai(r))},trim(){return this.check(Fi())},normalize(...r){return this.check(Li(...r))},toLowerCase(){return this.check(xi())},toUpperCase(){return this.check(Ci())},slugify(){return this.check(Di())}})}),Ms=u("ZodString",(e,t)=>{ve.init(e,t),vt.init(e,t),e.email=n=>e.check(ti(Rs,n)),e.url=n=>e.check(oi(Ls,n)),e.jwt=n=>e.check(wi(Xs,n)),e.emoji=n=>e.check(ai(Fs,n)),e.guid=n=>e.check(at(bt,n)),e.uuid=n=>e.check(ni(ie,n)),e.uuidv4=n=>e.check(ri(ie,n)),e.uuidv6=n=>e.check(ii(ie,n)),e.uuidv7=n=>e.check(si(ie,n)),e.nanoid=n=>e.check(ci(xs,n)),e.guid=n=>e.check(at(bt,n)),e.cuid=n=>e.check(ui(Cs,n)),e.cuid2=n=>e.check(li(Ds,n)),e.ulid=n=>e.check(hi(Us,n)),e.base64=n=>e.check(vi(qs,n)),e.base64url=n=>e.check(bi(Hs,n)),e.xid=n=>e.check(fi(Js,n)),e.ksuid=n=>e.check(di(Ks,n)),e.ipv4=n=>e.check(pi(Vs,n)),e.ipv6=n=>e.check(mi(Bs,n)),e.cidrv4=n=>e.check(gi(Ws,n)),e.cidrv6=n=>e.check(_i(Gs,n)),e.e164=n=>e.check(yi(Ys,n)),e.datetime=n=>e.check(ms(n)),e.date=n=>e.check(_s(n)),e.time=n=>e.check(bs(n)),e.duration=n=>e.check(ws(n))});function js(e){return ei(Ms,e)}const y=u("ZodStringFormat",(e,t)=>{v.init(e,t),vt.init(e,t)}),Rs=u("ZodEmail",(e,t)=>{cr.init(e,t),y.init(e,t)}),bt=u("ZodGUID",(e,t)=>{or.init(e,t),y.init(e,t)}),ie=u("ZodUUID",(e,t)=>{ar.init(e,t),y.init(e,t)}),Ls=u("ZodURL",(e,t)=>{ur.init(e,t),y.init(e,t)}),Fs=u("ZodEmoji",(e,t)=>{lr.init(e,t),y.init(e,t)}),xs=u("ZodNanoID",(e,t)=>{hr.init(e,t),y.init(e,t)}),Cs=u("ZodCUID",(e,t)=>{fr.init(e,t),y.init(e,t)}),Ds=u("ZodCUID2",(e,t)=>{dr.init(e,t),y.init(e,t)}),Us=u("ZodULID",(e,t)=>{pr.init(e,t),y.init(e,t)}),Js=u("ZodXID",(e,t)=>{mr.init(e,t),y.init(e,t)}),Ks=u("ZodKSUID",(e,t)=>{gr.init(e,t),y.init(e,t)}),Vs=u("ZodIPv4",(e,t)=>{wr.init(e,t),y.init(e,t)}),Bs=u("ZodIPv6",(e,t)=>{zr.init(e,t),y.init(e,t)}),Ws=u("ZodCIDRv4",(e,t)=>{kr.init(e,t),y.init(e,t)}),Gs=u("ZodCIDRv6",(e,t)=>{$r.init(e,t),y.init(e,t)}),qs=u("ZodBase64",(e,t)=>{Sr.init(e,t),y.init(e,t)}),Hs=u("ZodBase64URL",(e,t)=>{Er.init(e,t),y.init(e,t)}),Ys=u("ZodE164",(e,t)=>{Ir.init(e,t),y.init(e,t)}),Xs=u("ZodJWT",(e,t)=>{Or.init(e,t),y.init(e,t)}),yt=u("ZodNumber",(e,t)=>{Ve.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,i,s)=>qi(e,r,i),V(e,"ZodNumber",{gt(r,i){return this.check(ut(r,i))},gte(r,i){return this.check(we(r,i))},min(r,i){return this.check(we(r,i))},lt(r,i){return this.check(ct(r,i))},lte(r,i){return this.check(ye(r,i))},max(r,i){return this.check(ye(r,i))},int(r){return this.check(wt(r))},safe(r){return this.check(wt(r))},positive(r){return this.check(ut(0,r))},nonnegative(r){return this.check(we(0,r))},negative(r){return this.check(ct(0,r))},nonpositive(r){return this.check(ye(0,r))},multipleOf(r,i){return this.check(lt(r,i))},step(r,i){return this.check(lt(r,i))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiv)DELIM" -R"DELIM(eMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function T(e){return Zi(yt,e)}const Qs=u("ZodNumberFormat",(e,t)=>{Pr.init(e,t),yt.init(e,t)});function wt(e){return Ei(Qs,e)}const eo=u("ZodBoolean",(e,t)=>{Nr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Hi(e,n,r)});function x(e){return Ii(eo,e)}const to=u("ZodUnknown",(e,t)=>{Ar.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Xi()});function zt(){return Ti(to)}const no=u("ZodNever",(e,t)=>{Mr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Yi(e,n,r)});function ro(e){return Oi(no,e)}const io=u("ZodArray",(e,t)=>{jr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ns(e,n,r,i),e.element=t.element,V(e,"ZodArray",{min(n,r){return this.check(ne(n,r))},nonempty(n){return this.check(ne(1,n))},max(n,r){return this.check(ht(n,r))},length(n,r){return this.check(ft(n,r))},unwrap(){return this.element}})});function kt(e,t){return Ui(io,e,t)}const so=u("ZodObject",(e,t)=>{Lr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rs(e,n,r,i),_(e,"shape",()=>t.shape),V(e,"ZodObject",{keyof(){return ho(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:zt()})},loose(){return this.clone({...this._zod.def,catchall:zt()})},strict(){return this.clone({...this._zod.def,catchall:ro()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return en(this,n)},safeExtend(n){return tn(this,n)},merge(n){return nn(this,n)},pick(n){return Xt(this,n)},omit(n){return Qt(this,n)},partial(...n){return rn(St,this,n[0])},required(...n){return sn(It,this,n[0])}})});function C(e,t){const n={type:"object",shape:e??{},...f(t)};return new so(n)}const oo=u("ZodUnion",(e,t)=>{Fr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>is(e,n,r,i),e.options=t.options});function $t(e,t){return new oo({type:"union",options:e,...f(t)})}const ao=u("ZodIntersection",(e,t)=>{xr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ss(e,n,r,i)});function co(e,t){return new ao({type:"intersection",left:e,right:t})}const uo=u("ZodTuple",(e,t)=>{Cr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>os(e,n,r,i),e.rest=n=>e.clone({...e._zod.def,rest:n})});function lo(e,t,n){const r=t instanceof b,i=r?n:t,s=r?t:null;return new uo({type:"tuple",items:e,rest:s,...f(i)})}const ze=u("ZodEnum",(e,t)=>{Dr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Qi(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new ze({...t,checks:[],...f(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new ze({...t,checks:[],...f(i),entries:s})}});function ho(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new ze({type:"enum",entries:n,...f(t)})}const fo=u("ZodTransform",(e,t)=>{Ur.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ts(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Ie(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(J(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(J(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function po(e){return new fo({type:"transform",transform:e})}const St=u("ZodOptional",(e,t)=>{tt.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gt(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Zt(e){return new St({type:"optional",innerType:e})}const mo=u("ZodExactOptional",(e,t)=>{Jr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gt(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function go(e){return new mo({type:"optional",innerType:e})}const _o=u("ZodNullable",(e,t)=>{Kr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>as(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Et(e){return new _o({type:"nullable",innerType:e})}const vo=u("ZodDefault",(e,t)=>{Vr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>us(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bo(e,t){return new vo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ae(t)}})}const yo=u("ZodPrefault",(e,t)=>{Br.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ls(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function wo(e,t){return new yo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ae(t)}})}const It=u("ZodNonOptional",(e,t)=>{Wr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cs(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function zo(e,t){return new It({type:"nonoptional",innerType:e,...f(t)})}const ko=u("ZodCatch",(e,t)=>{Gr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hs(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $o(e,t){return new ko({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const So=u("ZodPipe",(e,t)=>{qr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fs(e,n,r,i),e.in=t.in,e.out=t.out});function Tt(e,t){return new So({type:"pipe",in:e,out:t})}const Zo=u("ZodReadonly",(e,t)=>{Hr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ds(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Eo(e){return new Zo({type:"readonly",innerType:e})}const Io=u("ZodCustom",(e,t)=>{Yr.init(e,t),w.init(e,t),e._zod.processJSONSchema=(n,r,i)=>es(e,n)});function To(e,t={}){return Ji(Io,e,t)}function Oo(e,t){return Ki(e,t)}const se=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],ke=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:1)DELIM" -R"DELIM(8,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],Ot=T().int().nonnegative().max(864e13),Pt=C({level:T().int().nonnegative(),time:Ot,message:js()}),Nt=C({event:T().int().nonnegative(),value:T().nonnegative(),time:Ot}),At=C({previous:T().nonnegative()});$t([Pt,Nt,At]);const Po=2**se.length-1,Mt=2**ke.length-1;function jt(e,t){return Number.isInteger(t)&&t>=0&&tnew WebSocket(n))},this.#c=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=t=>(this.#r.add(t),()=>{this.#r.delete(t)});start(){this.#o||(this.#o=!0,this.#c=this.#e.retryMinimumMs,this.#h())}stop(){this.#o=!1,this.#g();const t=this.#n;if(this.#n=null,t)try{t.readyState===1&&this.#e.onBeforeStop?.(t),t.close()}catch{}this.#u(Lt)}send(t){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(t),!0}catch{return!1}}#h(){if(!this.#o||this.#n)return;const t=this.#t.reconnects>0;this.#u({...this.#t,phase:t?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let n;try{n=this.#e.webSocketFactory(this.#e.url),this.#n=n}catch(r){this.#u({...this.#t,error:Do(r)}),this.#d();return}this.#s=setTimeout(()=>{if(this.#n===n){this.#u({...this.#t,error:"Connection timed out"});try{n.close()}catch{this.#n=null,this.#d()}}},this.#e.connectTimeoutMs),n.addEventListener("open",()=>{this.#n!==n||!this.#o||(this.#p(),this.#c=this.#e.retryMinimumMs,this.#u({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(n),this.#m(n))}),n.addEventListener("message",r=>{if(this.#n!==n||!this.#o)return;const i=Co(r.data);if(i===null)return;const s=this.#e.now();(this.#t.lastMessageAt===null||s-this.#t.lastMessageAt>=1e3)&&this.#u({...this.#t,lastMessageAt:s}),this.#e.onMessage(i)}),n.addEventListener("error",()=>{if(!(this.#n!==n||!this.#o)){this.#u({...this.#t,error:"WebSocket connection failed"});try{n.close()}catch{this.#n=null,this.#d()}}}),n.addEventListener("close",()=>{this.#n===n&&(this.#n=null,this.#p(),this.#l(),this.#o&&this.#d())})}#d(){if(!this.#o||this.#i)return;const t=1+(this.#e.random()*2-1)*this.#e.jitterRatio,n=Math.max(0,Math.round(this.#c*t));this.#c=Math.min(this.#c*2,this.#e.retryMaximumMs),this.#u({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#i=setTimeout(()=>{this.#i=null,this.#h()},n)}#m(t){this.#l(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#a=setInterval(()=>{this.#n===t&&t.readyState===1&&this.#e.onHeartbeat?.(t)},this.#e.heartbeatMs))}#p(){this.#s&&(clearTimeout(this.#s),this.#s=null)}#l(){this.#a&&(clearInterval(this.#a),this.#a=null)}#g(){this.#p(),this.#l(),this.#i&&(clearTimeout(this.#i),this.#i=null)}#u(t){this.#t=t;for(const n of this.#r)n()}}function Co(e){return typeof e=="string"?e:e instanceof ArrayBuffer?new TextDecoder().decode(e):null}function Do(e){return e instanceof Error?e.message:"Unable to create WebSocket"}class Uo{#e;#t;#n=new Set;#r=new Set;#s;constructor(t,n={}){this.#e=n.logFilter??Po,this.#t=n.eventFilter??Mt,this.#s=new xo({url:Fo(t),webSocketFactory:n.webSocketFactory,retryMinimumMs:n.retryMinimumMs,retryMaximumMs:n.retryMaximumMs,jitterRatio:n.jitterRatio,onOpen:r=>{this.#i(r)},onHeartbeat:r=>{this.#i(r)},onBeforeStop:r=>{r.send("/v1/log/subscribe?filter=0"),r.send("/v1/event/subscribe?filter=0")},onMessage:r=>{const i=Mo(r);if(!i){for(const s of this.#r)s(r);return}if(!(Rt(i)&&!jt(this.#e,i.level)))for(const s of this.#n)s(i)}})}getStatus=()=>this.#s.getStatus();subscribeStatus=t=>this.#s.subscribeStatus(t);start(){this.#s.start()}stop(){this.#s.stop()}subscribeFrames(t){return this.#n.add(t),()=>{this.#n.delete(t)}}subscribeInvalidFrames(t){return this.#r.add(t),()=>{this.#r.delete(t)}}setFilters(t,n){this.#e!==t&&(this.#e=t,this.#s.send(`/v1/log/subscribe?filter=${String(t)}`)),this.#t!==n&&(this.#t=n,this.#s.send(`/v1/event/subscribe?filter=${String(n)}`))}#i(t){t.send(`/v1/log/subscribe?filter=${String(this.#e)}`),t.send(`/v1/event/subscribe?filter=${String(this.#t)}`)}}C({address:x(),filter:x(),turbo:x(),witness:x(),retarget:x(),difficult:x(),pruned:T().int().nonnegative()}),C({height:T().int().nonnegative(),timestamp:T().int().positive().max(4294967295)});const ae=T().int().nonnegative().max(Number.MAX_SAFE_INTEGER);C({count:ae,virtual:ae,fee:ae,histogram:kt(lo([T().nonnegative(),ae]))});const Jo=15e3;T().int().nonnegative();const D=["occurrence-rate","occurrence-count","cumulative-occurrences"],Ko=["payload-latest","payload-maximum","payload-change-rate",...D],Vo=["payload-average","payload-latest","payload-minimum","payload-maximum",...D],Bo=["payload-sum","payload-cumulative","payload-latest","payload-average",...D],Ft=["payload-latest","payload-average","payload-minimum","payload-maximum"],xt=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function Ct(e){return`event:${String(e)}`}function Dt(e){return`log:${String(e)}`}const $e="native:top";function Wo(e){switch(e){case"height":return"height";case"seconds":case"m)DELIM" -R"DELIM(illiseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function Go(e){switch(e){case"height":return Ko;case"duration":return Vo;case"count":return Bo;case"fee-rate":return[...Ft,...D];default:return D}}function qo(e){switch(e){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function Ho(e){const t=oe(e),n=Wo(t.valueKind);return{id:Ct(e),source:"event",sourceId:e,name:t.name,label:t.label,category:t.category,payloadKind:n,allowedMeasures:Go(n),defaultMeasure:qo(n),description:e===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":n==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${t.label} event with a ${n} payload.`}}const Yo=[...xt.map(e=>({id:e.id,source:"pool",sourceId:e.field,name:e.field,label:e.label,category:"pool",payloadKind:e.payloadKind,allowedMeasures:Ft,defaultMeasure:"payload-latest",description:e.description})),...ke.map(e=>Ho(e.id)),...se.map(e=>({id:Dt(e.id),source:"log",sourceId:e.id,name:e.name,label:`${e.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:D,defaultMeasure:"occurrence-rate",description:`${e.label} log message volume. Message text is not interpreted as numeric data.`})),{id:$e,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}];new Map(Yo.map(e=>[e.id,e]));function Xo(e,t){return oe(e).valueKind==="fee-rate"?t/1e3:Ro(e,t)??t}const Qo=3600*1e3,ea=1e3,ta=1e3,na=1e3;class Ut{constructor(t){this.capacity=t,this.#e=Array.from({length:t})}capacity;#e;#t=0;#n=0;#r=null;get size(){return this.#n}push(t){const n=this.#n===this.capacity;return this.#r=null,this.#e[this.#t]=t,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity),n}clear(){this.#r=null,this.#e.fill(void 0),this.#t=0,this.#n=0}newestFirst(){if(this.#r)return this.#r;const t=[];for(let n=0;nthis.#N;getRecentLogs=()=>this.#r.newestFirst();getRecentEvents=()=>this.#s.newestFirst();subscribe=t=>(this.#n.add(t),()=>{this.#n.delete(t)});start(){this.#y||(this.tick(),this.#y=setInterval(()=>{this.tick()},1e3))}stop(){this.#y&&(clearInterval(this.#y),this.#y=null),this.#f&&(clearTimeout(this.#f),this.#f=null)}ingest(t,n=this.#e()){const r=this.#_(n);this.#u+=1,Rt(t)?this.#j(t,r):No(t)?this.#R(t,r):Ao(t)&&(this.#I+=1),this.#w()}recordInvalidFrame(){this.#T+=1,this.#w()}recordNativeTop(t,n=this.#e()){const r=this.#_(n),i=this.#m[$e];i?.value===t&&r-i.time<15e3||(this.#z($e,r,t),this.#A(r),this.#w())}recordNativeFees(t,n=this.#e()){if(!Number.isFinite(n)||n=Jo||this.#v!==null&&n<=this.#v.receivedAt)return;const r=this.#_(n);this.#v={data:t,receivedAt:n};for(const i of xt)this.#z(i.id,r,t[i.field]);this.#A(r),this.#w()}clearLogs(){this.#Z+=this.#r.size,this.#r.clear(),this.flush()}clearEvents(){this.#s.clear(),this.flush()}reset(){this.#r.clear(),this.#s.clear(),this.#i.clear(),this.#a={},this.#c={},this.#o={},this.#h={},this.#d={},this.#m={},this.#p={},this.#l=this.#_(this.#e()),this.#u=0,this.#$=0,this.#S=0,this.#Z=0,this.#E=0,this.#I=0,this.#T=0,this.#O=null,this.#P=null,this.#v=null,this.#b=0,this.#k(this.#l),this.flush()}tick(){const t=this.#_(this.#e());this.#k(t),this.#A(t),this.#w()}flush(){this.#f&&(clearTimeout(this.#f),this.#f=null),this.#N=this.#M();for(const t of this.#n)t()}#j(t,n){this.#$+=1,this.#O=n,this.#b+=1,this.#r.push({...t,id:this.#b,receivedAt:n})&&(this.#S+=1),this.#z(Dt(t.level),n,null)}#R(t,n){this.#E+=1,this.#P=n,this.#b+=1,this.#s.push({...t,id:this.#b,receivedAt:n}),this.#z(Ct(t.event),n,Xo(t.event,t.value))}#_(t){return Number.isFinite(t)?(this.#g=Math.max(this.#g,t),this.#g):this.#g}#z(t,n,r){const i=this.#k(n);i.snapshot=null;const s=i.signals.get(t)??ra();if(s.count+=1,ce(this.#h,t,1),r!==null){s.samples+=1,s.sum+=r,s.minimum=s.minimum===null?r:Math.min(s.minimum,r),s.maximum=s.maximum===null?r:Math.max(s.maximum,r),(s.firstAt===null||n=s.lastAt)&&(s.last=r,s.lastAt=n),ce(this.#d,t,r);const o=this.#m[t];(!o||n>=o.time)&&(this.#m[t]={value:r,time:n}),this.#p[t]=Math.max(this.#p[t]??r,r)}i.signals.set(t,s)}#k(t){const n=Math.floor(t/1e3)*1e3,r=this.#i.get(n);if(r)return r;const i={time:n,signals:new Map,snapshot:null};return this.#i.set(n,i),i}#A(t){const n=t-Qo;for(const[r,i]of this.#i){if(r>=n)break;for(const[s,o]of i.signals)if(ce(this.#a,s,o.count),ce(this.#c,s,o.sum),o.last!==null&&o.lastAt!==null){const a=this.#o[s];(!a||o.lastAt>=a.time)&&(this.#o[s]={value:o.last,time:o.lastAt})}this.#i.delete(r)}}#w(){!this.#t||this.#f||(this.#f=setTimeout(()=>{this.#f=null,this.flush()},ea))}#M(){const t=[...this.#i.values()].map(n=>(n.snapshot??={time:n.time,signals:Object.fromEntries([...n.signals].map(([r,i])=>[r,{...i}]))},n.snapshot));return{now:this.#_(this.#e()),sessionStartedAt:this.#l,totalFrames:this.#u,totalLogs:this.#$,evictedLogs:this.#S,clearedLogs:this.#Z,totalEvents:this.#E,totalAcks:this.#I,invalidFrames:this.#T,buckets:t,priorSignalCounts:{...this.#a},priorSignalSums:{...this.#c},priorSignalLatest:Jt(this.#o),signalTotals:{...this.#h},signalSums:{...this.#d},signalLatest:Jt(this.#m),signalMaximums:{...this.#p},recentLogs:this.#r.newestFirst(),recentEvents:this.#s.newestFirst(),lastLogAt:this.#O,lastEventAt:this.#P,poolSnapshot:this.#v}}}const ue=40;function sa(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>jt(t.filter,o.level)&&(!n||o.message.toLowerCase().includes(n)||jo(o.level).name.includes(n))),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-ue));return{logs:r.slice(s,s+ue),retained:e.length,matched:r.length,offset:s}}function oa(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>{const a=oe(o.event);return(t.category==="all"||a.category===t.category)&&(!n||a.name.includes(n)||a.label.toLowerCase().includes(n)||String(o.value).includes(n))}),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-ue));return{events:r.slice(s,s+ue),retained:e.length,matched:r.length,offset:s}}function aa(e,t){const{buckets:n,recentLogs:r,recentEvents:i,...s}=e,o=new Map(t?.buckets.map(a=>[a.time,a]));return{summary:s,reset:t===null,firstBucketTime:n[0]?.time??e.now,buckets:n.filter(a=>o.get(a.time)!==a),recentLogs:r===t?.recentLogs?null:r,recentEvents:i===t?.recentEvents?null:i}}class ca{constructor(t,n=(i,s)=>new Uo(i,{logFilter:s}),r=Date.now){this.send=t,this.createClient=n,this.#e=new ia(r,!1)}send;createClient;#e;#t=null;#n=null;#r=0;#s=null;#i=null;#a=null;#c=[];handle(t){if(t.type==="stop"){this.#h(),this.#e.stop(),this.send({type:"stopped"});return}if(t.type==="configure"){if(t.generation{this.#e.ingest(n)}),this.#t.subscribeInvalidFrames(()=>{this.#e.recordInvalidFrame()})],this.#t.start(),this.#e.start()):this.#t.setFilters(t.logFilter,Mt);return}if(t.type==="reset"){t.generation>=this.#r&&this.#o(t.generation);return}if(t.generation===this.#r)switch(t.type){case"pause-display":{t.stream==="logs"?this.#i=t.paused?this.#i??this.#e.getRecentLogs():null:this.#a=t.paused?this.#a??this.#e.getRecentEvents():null;break}case"poll-events":{this.send({type:"events",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:oa(this.#a??this.#e.getRecentEvents(),t.query)});break}case"poll-logs":{this.send({type:"logs",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:sa(this.#i??this.#e.getRecentLogs(),t.query)});break}case"native-top":{this.#e.recordNativeTop(t.height,t.receivedAt);break}case"native-fees":{this.#e.recordNativeFees(t.fees,t.receivedAt);break}case"clear-logs":{this.#e.clearLogs(),this.#i!==null&&(this.#i=[]);break}case"clear-events":{this.#e.clearEvents(),this.#a!==null&&(this.#a=[]);break}case"poll":{if(!this.#t)return;this.#e.flush();const n=this.#e.getSnapshot();this.send({type:"snapshot",generation:this.#r,requestId:t.requestId,status:this.#t.getStatus(),update:aa(n,this.#s)}),this.#s=n;break}}}#o(t){this.#r=t,this.#s=null,this.#i!==null&&(this.#i=[]),this.#a!==null&&(this.#a=[]),this.#e.reset()}#h(){for(const t of this.#c)t();this.#c=[],this.#t?.stop(),this.#t=null}}const Se=globalThis,ua=new ca(e=>{Se.postMessage(e)});Se.addEventListener("message",e=>{ua.handle(e.data),e.data.type==="stop"&&Se.close()})})();\n',c0=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",z1],{type:"text/javascript;charset=utf-8"});function JA(n){let i;try{if(i=c0&&(self.URL||self.webkitURL).createObjectURL(c0),!i)throw"";const s=new Worker(i,{name:n?.name});return s.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(i)}),s}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(z1),{name:n?.name})}}const f0=100;function IA(n,i){const s=new Map((i.reset?[]:n.buckets).filter(r=>r.time>=i.firstBucketTime).map(r=>[r.time,r]));for(const r of i.buckets)s.set(r.time,r);return{...i.summary,buckets:[...s.values()],recentLogs:Lc(i.reset?[]:n.recentLogs,i.recentLogs),recentEvents:Lc(i.reset?[]:n.recentEvents,i.recentEvents)}}function Lc(n,i){if(i===null)return n;const s=new Map(n.map(r=>[r.id,r]));return i.map(r=>s.get(r.id)??r)}const Mo={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class XA{constructor(i=()=>new JA){this.createWorker=i}createWorker;#e=null;#t=new yy().getSnapshot();#n=Mo;#i=new Set;#l=new Set;#a=null;#o=dr;#s=0;#u=0;#r=null;#p=null;#m=null;#c=new Set;#f={logs:[],retained:0,matched:0,offset:0};#h={search:"",filter:dr,offset:0};#d=0;#b=null;#S=null;#y=new Set;#x={events:[],retained:0,matched:0,offset:0};#w={search:"",category:"all",offset:0};#z=0;#_=null;#E=!1;#T=!1;getSnapshot=()=>this.#t;getStatus=()=>this.#n;getLogWindow=()=>this.#f;getEventWindow=()=>this.#x;subscribeEvents=i=>(this.#y.add(i),this.#v(),this.#A(),()=>{this.#y.delete(i),this.#y.size===0&&this.#M()});subscribeLogs=i=>(this.#c.add(i),this.#O(),this.#R(),()=>{this.#c.delete(i),this.#c.size===0&&this.#Z()});subscribe=i=>(this.#i.add(i),()=>{this.#i.delete(i)});subscribeStatus=i=>(this.#l.add(i),()=>{this.#l.delete(i)});configure(i,s){i===this.#a&&s===this.#o||(this.#a!==null&&i!==this.#a&&(this.reset(),this.#k({...Mo,phase:"connecting"})),this.#a=i,this.#o=s,this.#j())}start(){if(!(this.#e||this.#a===null))try{const i=this.createWorker();this.#e=i,this.#f={logs:[],retained:0,matched:0,offset:0},this.#x={events:[],retained:0,matched:0,offset:0};for(const s of this.#c)s();for(const s of this.#y)s();this.#k({...Mo,phase:"connecting"}),i.onmessage=s=>{if(this.#e!==i)return;const r=s.data;if(r.type==="events"){if(r.requestId!==this.#_||(this.#_=null,r.generation!==this.#s))return;if(r.queryVersion!==this.#z){this.#v();return}this.#x={...r.window,events:Lc(this.#x.events,r.window.events)};for(const o of this.#y)o();return}if(r.type==="logs"){if(r.requestId!==this.#b||(this.#b=null,r.generation!==this.#s))return;if(r.queryVersion!==this.#d){this.#O();return}this.#f={...r.window,logs:Lc(this.#f.logs,r.window.logs)};for(const o of this.#c)o();return}if(r.type==="snapshot"&&r.requestId===this.#r&&(this.#r=null,r.generation===this.#s)){this.#t=IA(this.#t,r.update),this.#k(r.status);for(const o of this.#i)o()}},i.onerror=()=>{this.#N("Telemetry worker failed. Reload the dashboard to reconnect.")},i.onmessageerror=()=>{this.#N("Unable to read telemetry worker data. Reload the dashboard to reconnect.")},this.#j(),this.#E&&this.#g({type:"pause-display",generation:this.#s,stream:"logs",paused:!0}),this.#T&&this.#g({type:"pause-display",generation:this.#s,stream:"events",paused:!0}),this.#C(),this.getStatus().error===null&&(this.#p=setInterval(()=>{this.#C()},1e3)),this.#R(),this.#A()}catch(i){this.#N(`Unable to start telemetry worker: ${i instanceof Error?i.message:String(i)}`)}}stop(){this.#D();const i=this.#e;if(this.#e=null,i){const s=setTimeout(()=>{i.terminate()},500),r=()=>{clearTimeout(s),i.terminate()};i.onmessage=o=>{o.data.type==="stopped"&&r()},i.onerror=r,i.onmessageerror=r;try{i.postMessage({type:"stop"})}catch{r()}}this.#k(Mo)}recordNativeTop(i,s=Date.now()){this.#g({type:"native-top",generation:this.#s,height:i,receivedAt:s})}recordNativeFees(i,s=Date.now()){this.#g({type:"native-fees",generation:this.#s,fees:i,receivedAt:s})}clearLogs(){this.#g({type:"clear-logs",generation:this.#s}),this.#d+=1,this.#O()}clearEvents(){this.#g({type:"clear-events",generation:this.#s}),this.#z+=1,this.#v()}setLogsPaused(i){i!==this.#E&&(this.#E=i,this.#Z(),this.#g({type:"pause-display",generation:this.#s,stream:"logs",paused:i}),this.#d+=1,this.#O(),this.#R())}setEventsPaused(i){i!==this.#T&&(this.#T=i,this.#M(),this.#g({type:"pause-display",generation:this.#s,stream:"events",paused:i}),this.#z+=1,this.#v(),this.#A())}reset(){this.#s+=1,this.#r=null,this.#b=null,this.#_=null,this.#f={logs:[],retained:0,matched:0,offset:0},this.#x={events:[],retained:0,matched:0,offset:0},this.#t=new yy().getSnapshot(),this.#g({type:"reset",generation:this.#s});for(const i of this.#i)i();for(const i of this.#c)i();for(const i of this.#y)i()}setLogQuery(i){JSON.stringify(i)!==JSON.stringify(this.#h)&&(this.#h=i,this.#d+=1,this.#O())}setEventQuery(i){JSON.stringify(i)!==JSON.stringify(this.#w)&&(this.#w=i,this.#z+=1,this.#v())}#A(){!this.#e||this.#y.size===0||this.#S||this.#T||(this.#S=setInterval(()=>{this.#v()},f0),this.#v())}#v(){this.#_!==null||!this.#e||this.#y.size===0||(this.#_=++this.#u,this.#g({type:"poll-events",generation:this.#s,requestId:this.#_,queryVersion:this.#z,query:this.#w}))}#M(){this.#S&&clearInterval(this.#S),this.#S=null,this.#_=null}#R(){!this.#e||this.#c.size===0||this.#m||this.#E||(this.#m=setInterval(()=>{this.#O()},f0),this.#O())}#O(){this.#b!==null||!this.#e||this.#c.size===0||(this.#b=++this.#u,this.#g({type:"poll-logs",generation:this.#s,requestId:this.#b,queryVersion:this.#d,query:this.#h}))}#Z(){this.#m&&clearInterval(this.#m),this.#m=null,this.#b=null}#j(){this.#a!==null&&this.#g({type:"configure",generation:this.#s,endpoint:this.#a,logFilter:this.#o})}#C(){this.#r!==null||!this.#e||(this.#r=++this.#u,this.#g({type:"poll",generation:this.#s,requestId:this.#r}))}#g(i){try{this.#e?.postMessage(i)}catch{this.#N("Unable to communicate with telemetry worker. Reload the dashboard to reconnect.")}}#D(){this.#Z(),this.#M(),this.#p&&clearInterval(this.#p),this.#p=null,this.#r=null}#N(i){this.#D(),this.#e?.terminate(),this.#e=null,this.#k({...Mo,error:i})}#k(i){if(JSON.stringify(i)!==JSON.stringify(this.#n)){this.#n=i;for(const s of this.#l)s()}}}const w1="libbitcoinAdminDashboardLogFilter";function E1(){try{return globalThis.localStorage}catch{return null}}function PA(n=E1()){try{const i=n?.)DELIM" -R"DELIM(getItem(w1);if(!i)return dr;const s=JSON.parse(i);return typeof s=="number"&&Number.isInteger(s)&&s>=0&&s<=nm?s:dr}catch{return dr}}function WA(n,i=E1()){try{i?.setItem(w1,String(n))}catch{}}var Ko=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},eM=class extends Ko{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},xm=new eM,tM={setTimeout:(n,i)=>setTimeout(n,i),clearTimeout:n=>clearTimeout(n),setInterval:(n,i)=>setInterval(n,i),clearInterval:n=>clearInterval(n)},nM=class{#e=tM;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,i){return this.#e.setTimeout(n,i)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,i){return this.#e.setInterval(n,i)}clearInterval(n){this.#e.clearInterval(n)}},fl=new nM;function iM(n){setTimeout(n,0)}var aM=typeof window>"u"||"Deno"in globalThis;function ei(){}function sM(n,i){return typeof n=="function"?n(i):n}function Dh(n){return typeof n=="number"&&n>=0&&n!==1/0}function T1(n,i){return Math.max(n+(i||0)-Date.now(),0)}function Ms(n,i){return typeof n=="function"?n(i):n}function pi(n,i){return typeof n=="function"?n(i):n}function d0(n,i){const{type:s="all",exact:r,fetchStatus:o,predicate:f,queryKey:d,stale:p}=n;if(d){if(r){if(i.queryHash!==zm(d,i.options))return!1}else if(!_r(i.queryKey,d))return!1}if(s!=="all"){const m=i.isActive();if(s==="active"&&!m||s==="inactive"&&m)return!1}return!(typeof p=="boolean"&&i.isStale()!==p||o&&o!==i.state.fetchStatus||f&&!f(i))}function h0(n,i){const{exact:s,status:r,predicate:o,mutationKey:f}=n;if(f){if(!i.options.mutationKey)return!1;if(s){if(Vo(i.options.mutationKey)!==Vo(f))return!1}else if(!_r(i.options.mutationKey,f))return!1}return!(r&&i.state.status!==r||o&&!o(i))}function zm(n,i){return(i?.queryKeyHashFn||Vo)(n)}function Vo(n){return JSON.stringify(n,(i,s)=>Uh(s)?Object.keys(s).sort().reduce((r,o)=>(r[o]=s[o],r),{}):s)}function _r(n,i){if(n===i)return!0;if(typeof n!=typeof i)return!1;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(Array.isArray(n)&&Array.isArray(i)){for(let r=0;r500)return i;const r=m0(n)&&m0(i);if(!r&&!(Uh(n)&&Uh(i)))return i;const f=(r?n:Object.keys(n)).length,d=r?i:Object.keys(i),p=d.length,m=r?new Array(p):{};let v=0;for(let x=0;x{fl.setTimeout(i,n)})}function $h(n,i,s){return typeof s.structuralSharing=="function"?s.structuralSharing(n,i):s.structuralSharing!==!1?N1(n,i):i}function oM(n,i,s=0){const r=[...n,i];return s&&r.length>s?r.slice(1):r}function uM(n,i,s=0){const r=[i,...n];return s&&r.length>s?r.slice(0,-1):r}var wm=Symbol();function A1(n,i){return!n.queryFn&&i?.initialPromise?()=>i.initialPromise:!n.queryFn||n.queryFn===wm?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function M1(n,i){return typeof n=="function"?n(...i):!!n}function cM(n,i,s){let r=!1,o;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(o??=i(),r||(r=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)}),n}var Go=(()=>{let n=()=>aM;return{isServer(){return n()},setIsServer(i){n=i}}})();function Lh(){let n,i;const s=new Promise((o,f)=>{n=o,i=f});s.status="pending",s.catch(()=>{});function r(o){Object.assign(s,o),delete s.resolve,delete s.reject}return s.resolve=o=>{r({status:"fulfilled",value:o}),n(o)},s.reject=o=>{r({status:"rejected",reason:o}),i(o)},s}var fM=iM;function dM(){let n=[],i=0,s=p=>{p()},r=p=>{p()},o=fM;const f=p=>{i?n.push(p):o(()=>{s(p)})},d=()=>{const p=n;n=[],p.length&&o(()=>{r(()=>{p.forEach(m=>{s(m)})})})};return{batch:p=>{let m;i++;try{m=p()}finally{i--,i||d()}return m},batchCalls:p=>(...m)=>{f(()=>{p(...m)})},schedule:f,setNotifyFunction:p=>{s=p},setBatchNotifyFunction:p=>{r=p},setScheduler:p=>{o=p}}}var wn=dM(),hM=class extends Ko{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n(!0),s=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(s=>{s(n)}))}isOnline(){return this.#e}},Hc=new hM;function mM(n){return Math.min(1e3*2**n,3e4)}function O1(n){return(n??"online")==="online"?Hc.isOnline():!0}var Hh=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function j1(n){let i=!1,s=0,r;const o=Lh(),f=()=>o.status!=="pending",d=k=>{if(!f()){const B=new Hh(k);w(B),n.onCancel?.(B)}},p=()=>{i=!0},m=()=>{i=!1},v=()=>xm.isFocused()&&(n.networkMode==="always"||Hc.isOnline())&&n.canRun(),x=()=>O1(n.networkMode)&&n.canRun(),S=k=>{f()||(r?.(),o.resolve(k))},w=k=>{f()||(r?.(),o.reject(k))},M=()=>new Promise(k=>{r=B=>{(f()||v())&&k(B)},n.onPause?.()}).then(()=>{r=void 0,f()||n.onContinue?.()}),T=()=>{if(f())return;let k;const B=s===0?n.initialPromise:void 0;try{k=B??n.fn()}catch(V){k=Promise.reject(V)}Promise.resolve(k).then(S).catch(V=>{if(f())return;const D=n.retry??(Go.isServer()?0:3),ee=n.retryDelay??mM,G=typeof ee=="function"?ee(s,V):ee,W=D===!0||typeof D=="number"&&sv()?void 0:M()).then(()=>{i?w(V):T()})})};return{promise:o,status:()=>o.status,cancel:d,continue:()=>(r?.(),o),cancelRetry:p,continueRetry:m,canStart:x,start:()=>(x()?T():M().then(T),o)}}var k1=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dh(this.gcTime)&&(this.#e=fl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Go.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(fl.clearTimeout(this.#e),this.#e=void 0)}};function pM(n){return{onFetch:(i,s)=>{const r=i.options,o=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],d=i.state.data?.pageParams||[];let p={pages:[],pageParams:[]},m=0;const v=async()=>{let x=!1;const S=T=>{cM(T,()=>i.signal,()=>x=!0)},w=A1(i.options,i.fetchOptions),M=async(T,k,B)=>{if(x)return Promise.reject(i.signal.reason);if(k==null&&T.pages.length)return Pro)DELIM" -R"DELIM(mise.resolve(T);const D=(()=>{const ie={client:i.client,queryKey:i.queryKey,pageParam:k,direction:B?"backward":"forward",meta:i.options.meta};return S(ie),ie})(),ee=await w(D),{maxPages:G}=i.options,W=B?uM:oM;return{pages:W(T.pages,ee,G),pageParams:W(T.pageParams,k,G)}};if(o&&f.length){const T=o==="backward",k=T?gM:g0,B={pages:f,pageParams:d},V=k(r,B);p=await M(B,V,T)}else{const T=n??f.length;do{const k=m===0?d[0]??r.initialPageParam:g0(r,p);if(m>0&&k==null)break;p=await M(p,k),m++}while(mi.options.persister?.(v,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},s):i.fetchFn=v}}}function g0(n,{pages:i,pageParams:s}){const r=i.length-1;return i.length>0?n.getNextPageParam(i[r],i,s[r],s):void 0}function gM(n,{pages:i,pageParams:s}){return i.length>0?n.getPreviousPageParam?.(i[0],i,s[0],s):void 0}var vM=class extends k1{#e;#t;#n;#i;#l;#a;#o;#s;constructor(n){super(),this.#s=!1,this.#o=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#l=n.client,this.#i=this.#l.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=y0(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(n){if(this.options={...this.#o,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=y0(this.options);i.data!==void 0&&(this.setState(v0(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(n,i){const s=$h(this.state.data,n,this.options);return this.#r({data:s,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),s}setState(n){this.#r({type:"setState",state:n})}cancel(n){const i=this.#a?.promise;return this.#a?.cancel(n),i?i.then(ei).catch(ei):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>pi(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===wm||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Ms(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!T1(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(i=>i.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(i=>i.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(i=>i!==n),this.observers.length||(this.#a&&(this.#s||this.#u()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#r({type:"invalidate"})}async fetch(n,i){if(this.state.fetchStatus!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(n&&this.setOptions(n),!this.options.queryFn){const m=this.observers.find(v=>v.options.queryFn);m&&this.setOptions(m.options)}const s=new AbortController,r=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#s=!0,s.signal)})},o=()=>{const m=A1(this.options,i),x=(()=>{const S={client:this.#l,queryKey:this.queryKey,meta:this.meta};return r(S),S})();return this.#s=!1,this.options.persister?this.options.persister(m,x,this):m(x)},d=(()=>{const m={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#l,state:this.state,fetchFn:o};return r(m),m})();(this.#e==="infinite"?pM(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#r({type:"fetch",meta:d.fetchOptions?.meta}),this.#a=j1({initialPromise:i?.initialPromise,fn:d.fetchFn,onCancel:m=>{m instanceof Hh&&m.revert&&this.setState({...this.#n,fetchStatus:"idle"}),s.abort()},onFail:(m,v)=>{this.#r({type:"failed",failureCount:m,error:v})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0});try{const m=await this.#a.start();if(m===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(m),this.#i.config.onSuccess?.(m,this),this.#i.config.onSettled?.(m,this.state.error,this),m}catch(m){if(m instanceof Hh){if(m.silent)return this.#a.promise;if(m.revert){if(this.state.data===void 0)throw m;return this.state.data}}throw this.#r({type:"error",error:m}),this.#i.config.onError?.(m,this),this.#i.config.onSettled?.(this.state.data,m,this),m}finally{this.scheduleGc()}}#r(n){const i=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...R1(s.data,this.options),fetchMeta:n.meta??null};case"success":const r={...s,...v0(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?r:void 0,r;case"error":const o=n.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=i(this.state),wn.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:n})})}};function R1(n,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:O1(i.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function v0(n,i){return{data:n,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function y0(n){const i=typeof n.initialData=="function"?n.initialData():n.initialData,s=i!==void 0,r=s?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var yM=class extends Ko{constructor(n,i){super(),this.options=i,this.#e=n,this.#s=null,this.#o=Lh(),this.bindMethods(),this.setOptions(i)}#e;#t=void 0;#n=void 0;#i=void 0;#l;#a;#o;#s;#u;#r;#p;#m;#c;#f;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),b0(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bh(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#w(),this.#z(),this.#t.removeObserver(this)}setOptions(n){const i=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled)DELIM" -R"DELIM(!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof pi(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),i._defaulted&&!Zh(this.options,i)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const r=this.hasListeners();r&&_0(this.#t,s,this.options,i)&&this.#d(),this.updateResult(),r&&(this.#t!==s||pi(this.options.enabled,this.#t)!==pi(i.enabled,this.#t)||Ms(this.options.staleTime,this.#t)!==Ms(i.staleTime,this.#t))&&this.#b();const o=this.#S();r&&(this.#t!==s||pi(this.options.enabled,this.#t)!==pi(i.enabled,this.#t)||o!==this.#f)&&this.#y(o)}getOptimisticResult(n){const i=this.#e.getQueryCache().build(this.#e,n),s=this.createResult(i,n);return _M(this,s)&&(this.#i=s,this.#a=this.options,this.#l=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(n,i){return new Proxy(n,{get:(s,r)=>(this.trackProp(r),i?.(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,r))})}trackProp(n){this.#h.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const i=this.#e.defaultQueryOptions(n),s=this.#e.getQueryCache().build(this.#e,i);return s.fetch().then(()=>this.createResult(s,i))}fetch(n){return this.#d({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#d(n){this.#_();let i=this.#t.fetch(this.options,n);return n?.throwOnError||(i=i.catch(ei)),i}#b(){this.#w();const n=Ms(this.options.staleTime,this.#t);if(Go.isServer()||this.#i.isStale||!Dh(n))return;const s=T1(this.#i.dataUpdatedAt,n)+1;this.#m=fl.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#S(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(n){this.#z(),this.#f=n,!(Go.isServer()||pi(this.options.enabled,this.#t)===!1||!Dh(this.#f)||this.#f===0)&&(this.#c=fl.setInterval(()=>{(this.options.refetchIntervalInBackground||xm.isFocused())&&this.#d()},this.#f))}#x(){this.#b(),this.#y(this.#S())}#w(){this.#m!==void 0&&(fl.clearTimeout(this.#m),this.#m=void 0)}#z(){this.#c!==void 0&&(fl.clearInterval(this.#c),this.#c=void 0)}createResult(n,i){const s=this.#t,r=this.options,o=this.#i,f=this.#l,d=this.#a,m=n!==s?n.state:this.#n,{state:v}=n;let x={...v},S=!1,w;if(i._optimisticResults){const X=this.hasListeners(),de=!X&&b0(n,i),me=X&&_0(n,s,i,r);(de||me)&&(x={...x,...R1(v.data,n.options)}),i._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:M,errorUpdatedAt:T,status:k}=x;w=x.data;let B=!1;if(i.placeholderData!==void 0&&w===void 0&&k==="pending"){let X;o?.isPlaceholderData&&i.placeholderData===d?.placeholderData?(X=o.data,B=!0):X=typeof i.placeholderData=="function"?i.placeholderData(this.#p?.state.data,this.#p):i.placeholderData,X!==void 0&&(k="success",w=$h(o?.data,X,i),S=!0)}if(i.select&&w!==void 0&&!B)if(o&&w===f?.data&&i.select===this.#u)w=this.#r;else try{this.#u=i.select,w=i.select(w),w=$h(o?.data,w,i),this.#r=w,this.#s=null}catch(X){this.#s=X}this.#s&&(M=this.#s,w=this.#r,T=Date.now(),k="error");const V=x.fetchStatus==="fetching",D=k==="pending",ee=k==="error",G=D&&V,W=w!==void 0,ae={status:k,fetchStatus:x.fetchStatus,isPending:D,isSuccess:k==="success",isError:ee,isInitialLoading:G,isLoading:G,data:w,dataUpdatedAt:x.dataUpdatedAt,error:M,errorUpdatedAt:T,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:x.dataUpdateCount>m.dataUpdateCount||x.errorUpdateCount>m.errorUpdateCount,isFetching:V,isRefetching:V&&!D,isLoadingError:ee&&!W,isPaused:x.fetchStatus==="paused",isPlaceholderData:S,isRefetchError:ee&&W,isStale:Em(n,i),refetch:this.refetch,promise:this.#o,isEnabled:pi(i.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const X=ae.data!==void 0,de=ae.status==="error"&&!X,me=ce=>{de?ce.reject(ae.error):X&&ce.resolve(ae.data)},ne=()=>{const ce=this.#o=ae.promise=Lh();me(ce)},pe=this.#o;switch(pe.status){case"pending":n.queryHash===s.queryHash&&me(pe);break;case"fulfilled":(de||ae.data!==pe.value)&&ne();break;case"rejected":(!de||ae.error!==pe.reason)&&ne();break}}return ae}updateResult(){const n=this.#i,i=this.createResult(this.#t,this.options);if(this.#l=this.#t.state,this.#a=this.options,this.#l.data!==void 0&&(this.#p=this.#t),Zh(i,n))return;this.#i=i;const s=()=>{if(!n)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!this.#h.size)return!0;const f=new Set(o??this.#h);return this.options.throwOnError&&f.add("error"),Object.keys(this.#i).some(d=>{const p=d;return this.#i[p]!==n[p]&&f.has(p)})};this.#E({listeners:s()})}#_(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const i=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(i?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}#E(n){wn.batch(()=>{n.listeners&&this.listeners.forEach(i=>{i(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function bM(n,i){return pi(i.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&pi(i.retryOnMount,n)===!1)}function b0(n,i){return bM(n,i)||n.state.data!==void 0&&Bh(n,i,i.refetchOnMount)}function Bh(n,i,s){if(pi(i.enabled,n)!==!1&&Ms(i.staleTime,n)!=="static"){const r=typeof s=="function"?s(n):s;return r==="always"||r!==!1&&Em(n,i)}return!1}function _0(n,i,s,r){return(n!==i||pi(r.enabled,n)===!1)&&(!s.suspense||n.state.status!=="error")&&Em(n,s)}function Em(n,i){return pi(i.enabled,n)!==!1&&n.isStaleByTime(Ms(i.staleTime,n))}function _M(n,i){return!Zh(n.getCurrentResult(),i)}var SM=class extends k1{#e;#t;#n;#i;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||xM(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(i=>i!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(n){const i=()=>{this.#l({type:"continue"})},s={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=j1({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(f,d)=>{this.#l({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#l({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const r=this.state.status==="pending",o=!this.#i.canStart();try{if(r)i();else{this.#l({type:"pending",variables:n,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,s);const d=await this.options.onMutate?.(n,s);d!==this.state.context&&this.#l({type:"pending",context:d,variables:n,isPaused:o})}const f=await this.#i.start();return await this.#n.config.onSuccess?.(f,n,this.state.context,this,s),await this.options.onSuccess?.(f,n,this.state.context,s),await this.#n.config.onSettled?.(f,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(f,null,n,this.state.context,s),this.#l({type:"success",data:f}),f}catch(f){try{await this.#n.config.onError?.(f,n,this.state.context,this,s)}cat)DELIM" -R"DELIM(ch(d){Promise.reject(d)}try{await this.options.onError?.(f,n,this.state.context,s)}catch(d){Promise.reject(d)}try{await this.#n.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,s)}catch(d){Promise.reject(d)}try{await this.options.onSettled?.(void 0,f,n,this.state.context,s)}catch(d){Promise.reject(d)}throw this.#l({type:"error",error:f}),f}finally{this.#n.runNext(this)}}#l(n){const i=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),wn.batch(()=>{this.#t.forEach(s=>{s.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function xM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zM=class extends Ko{constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(n,i,s){const r=new SM({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(i),state:s});return this.add(r),r}add(n){this.#e.add(n);const i=zc(n);if(typeof i=="string"){const s=this.#t.get(i);s?s.push(n):this.#t.set(i,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const i=zc(n);if(typeof i=="string"){const s=this.#t.get(i);if(s)if(s.length>1){const r=s.indexOf(n);r!==-1&&s.splice(r,1)}else s[0]===n&&this.#t.delete(i)}}this.notify({type:"removed",mutation:n})}canRun(n){const i=zc(n);if(typeof i=="string"){const r=this.#t.get(i)?.find(o=>o.state.status==="pending");return!r||r===n}else return!0}runNext(n){const i=zc(n);return typeof i=="string"?this.#t.get(i)?.find(r=>r!==n&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){wn.batch(()=>{this.#e.forEach(n=>{this.notify({type:"removed",mutation:n})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(n){const i={exact:!0,...n};return this.getAll().find(s=>h0(i,s))}findAll(n={}){return this.getAll().filter(i=>h0(n,i))}notify(n){wn.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return wn.batch(()=>Promise.all(n.map(i=>i.continue().catch(ei))))}};function zc(n){return n.options.scope?.id}var wM=class extends Ko{constructor(n={}){super(),this.config=n,this.#e=new Map}#e;build(n,i,s){const r=i.queryKey,o=i.queryHash??zm(r,i);let f=this.get(o);return f||(f=new vM({client:n,queryKey:r,queryHash:o,options:n.defaultQueryOptions(i),state:s,defaultOptions:n.getQueryDefaults(r)}),this.add(f)),f}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const i=this.#e.get(n.queryHash);i&&(n.destroy(),i===n&&this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){wn.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const i={exact:!0,...n};return this.getAll().find(s=>d0(i,s))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(s=>d0(n,s)):i}notify(n){wn.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){wn.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){wn.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},EM=class{#e;#t;#n;#i;#l;#a;#o;#s;constructor(n={}){this.#e=n.queryCache||new wM,this.#t=n.mutationCache||new zM,this.#n=n.defaultOptions||{},this.#i=new Map,this.#l=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=xm.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Hc.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(n){const i=this.defaultQueryOptions(n),s=this.#e.build(this,i),r=s.state.data;return r===void 0?this.fetchQuery(n):(n.revalidateIfStale&&s.isStaleByTime(Ms(i.staleTime,s))&&this.prefetchQuery(i),Promise.resolve(r))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:i,state:s})=>{const r=s.data;return[i,r]})}setQueryData(n,i,s){const r=this.defaultQueryOptions({queryKey:n}),f=this.#e.get(r.queryHash)?.state.data,d=sM(i,f);if(d!==void 0)return this.#e.build(this,r).setData(d,{...s,manual:!0})}setQueriesData(n,i,s){return wn.batch(()=>this.#e.findAll(n).map(({queryKey:r})=>[r,this.setQueryData(r,i,s)]))}getQueryState(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state}removeQueries(n){const i=this.#e;wn.batch(()=>{i.findAll(n).forEach(s=>{i.remove(s)})})}resetQueries(n,i){const s=this.#e;return wn.batch(()=>(s.findAll(n).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...n},i)))}cancelQueries(n,i={}){const s={revert:!0,...i},r=wn.batch(()=>this.#e.findAll(n).map(o=>o.cancel(s)));return Promise.all(r).then(ei).catch(ei)}invalidateQueries(n,i={}){return wn.batch(()=>(this.#e.findAll(n).forEach(s=>{s.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},i)))}refetchQueries(n,i={}){const s={...i,cancelRefetch:i.cancelRefetch??!0},r=wn.batch(()=>this.#e.findAll(n).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let f=o.fetch(void 0,s);return s.throwOnError||(f=f.catch(ei)),o.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(r).then(ei)}fetchQuery(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const s=this.#e.build(this,i);return s.isStaleByTime(Ms(i.staleTime,s))?s.fetch(i):Promise.resolve(s.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(ei).catch(ei)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(ei).catch(ei)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Hc.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,i){this.#i.set(Vo(n),{queryKey:n,defaultOptions:i})}getQueryDefaults(n){const i=[...this.#i.values()],s={};return i.forEach(r=>{_r(n,r.queryKey)&&Object.assign(s,r.defaultOptions)}),s}setMutationDefaults(n,i){this.#l.set(Vo(n),{mutationKey:n,defaultOptions:i})}getMutationDefaults(n){const i=[...this.#l.values()],s={};return i.forEach(r=>{_r(n,r.mutationKey)&&Object.assign(s,r.defaultOptions)}),s}defaultQueryOptions(n){if(n._defaulted)return n;const i={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return i.queryHash||(i.queryHash=zm(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===wm&&(i.enabled=!1),i}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},C1=le.createContext(void 0),TM=n=>{const i=le.useContext(C1);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one)DELIM" -R"DELIM(");return i},NM=({client:n,children:i})=>(le.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),b.jsx(C1.Provider,{value:n,children:i})),D1=le.createContext(!1),AM=()=>le.useContext(D1);D1.Provider;function MM(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var OM=le.createContext(MM()),jM=()=>le.useContext(OM),kM=(n,i,s)=>{const r=s?.state.error&&typeof n.throwOnError=="function"?M1(n.throwOnError,[s.state.error,s]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||r)&&(i.isReset()||(n.retryOnMount=!1))},RM=n=>{le.useEffect(()=>{n.clearReset()},[n])},CM=({result:n,errorResetBoundary:i,throwOnError:s,query:r,suspense:o})=>n.isError&&!i.isReset()&&!n.isFetching&&r&&(o&&n.data===void 0||M1(s,[n.error,r])),DM=n=>{if(n.suspense){const s=o=>o==="static"?o:Math.max(o??1e3,1e3),r=n.staleTime;n.staleTime=typeof r=="function"?(...o)=>s(r(...o)):s(r),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},ZM=(n,i)=>n.isLoading&&n.isFetching&&!i,UM=(n,i)=>n?.suspense&&i.isPending,S0=(n,i,s)=>i.fetchOptimistic(n).catch(()=>{s.clearReset()});function $M(n,i,s){const r=AM(),o=jM(),f=TM(),d=f.defaultQueryOptions(n);f.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const p=f.getQueryCache().get(d.queryHash),m=n.subscribed!==!1;d._optimisticResults=r?"isRestoring":m?"optimistic":void 0,DM(d),kM(d,o,p),RM(o);const v=!f.getQueryCache().get(d.queryHash),[x]=le.useState(()=>new i(f,d)),S=x.getOptimisticResult(d),w=!r&&m;if(le.useSyncExternalStore(le.useCallback(M=>{const T=w?x.subscribe(wn.batchCalls(M)):ei;return x.updateResult(),T},[x,w]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),le.useEffect(()=>{x.setOptions(d)},[d,x]),UM(d,S))throw S0(d,x,o);if(CM({result:S,errorResetBoundary:o,throwOnError:d.throwOnError,query:p,suspense:d.suspense}))throw S.error;return f.getDefaultOptions().queries?._experimental_afterQuery?.(d,S),d.experimental_prefetchInRender&&!Go.isServer()&&ZM(S,r)&&(v?S0(d,x,o):p?.promise)?.catch(ei).finally(()=>{x.updateResult()}),d.notifyOnChangeProps?S:x.trackResult(S)}function x0(n,i){return $M(n,yM)}const z0={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class LM{#e;#t=z0;#n=null;#i=new Set;#l=null;#a=null;#o=null;#s;#u=!1;constructor(i){this.#e={...i,connectTimeoutMs:i.connectTimeoutMs??5e3,retryMinimumMs:i.retryMinimumMs??1e3,retryMaximumMs:i.retryMaximumMs??3e4,heartbeatMs:i.heartbeatMs??24e4,jitterRatio:i.jitterRatio??.2,now:i.now??Date.now,random:i.random??Math.random,webSocketFactory:i.webSocketFactory??(s=>new WebSocket(s))},this.#s=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=i=>(this.#i.add(i),()=>{this.#i.delete(i)});start(){this.#u||(this.#u=!0,this.#s=this.#e.retryMinimumMs,this.#r())}stop(){this.#u=!1,this.#h();const i=this.#n;if(this.#n=null,i)try{i.readyState===1&&this.#e.onBeforeStop?.(i),i.close()}catch{}this.#d(z0)}send(i){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(i),!0}catch{return!1}}#r(){if(!this.#u||this.#n)return;const i=this.#t.reconnects>0;this.#d({...this.#t,phase:i?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let s;try{s=this.#e.webSocketFactory(this.#e.url),this.#n=s}catch(r){this.#d({...this.#t,error:BM(r)}),this.#p();return}this.#l=setTimeout(()=>{if(this.#n===s){this.#d({...this.#t,error:"Connection timed out"});try{s.close()}catch{this.#n=null,this.#p()}}},this.#e.connectTimeoutMs),s.addEventListener("open",()=>{this.#n!==s||!this.#u||(this.#c(),this.#s=this.#e.retryMinimumMs,this.#d({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(s),this.#m(s))}),s.addEventListener("message",r=>{if(this.#n!==s||!this.#u)return;const o=HM(r.data);if(o===null)return;const f=this.#e.now();(this.#t.lastMessageAt===null||f-this.#t.lastMessageAt>=1e3)&&this.#d({...this.#t,lastMessageAt:f}),this.#e.onMessage(o)}),s.addEventListener("error",()=>{if(!(this.#n!==s||!this.#u)){this.#d({...this.#t,error:"WebSocket connection failed"});try{s.close()}catch{this.#n=null,this.#p()}}}),s.addEventListener("close",()=>{this.#n===s&&(this.#n=null,this.#c(),this.#f(),this.#u&&this.#p())})}#p(){if(!this.#u||this.#a)return;const i=1+(this.#e.random()*2-1)*this.#e.jitterRatio,s=Math.max(0,Math.round(this.#s*i));this.#s=Math.min(this.#s*2,this.#e.retryMaximumMs),this.#d({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#a=setTimeout(()=>{this.#a=null,this.#r()},s)}#m(i){this.#f(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#o=setInterval(()=>{this.#n===i&&i.readyState===1&&this.#e.onHeartbeat?.(i)},this.#e.heartbeatMs))}#c(){this.#l&&(clearTimeout(this.#l),this.#l=null)}#f(){this.#o&&(clearInterval(this.#o),this.#o=null)}#h(){this.#c(),this.#f(),this.#a&&(clearTimeout(this.#a),this.#a=null)}#d(i){this.#t=i;for(const s of this.#i)s()}}function HM(n){return typeof n=="string"?n:n instanceof ArrayBuffer?new TextDecoder().decode(n):null}function BM(n){return n instanceof Error?n.message:"Unable to create WebSocket"}const Tm=15e3,qh=3*Tm,w0={configuration:null,configurationReceivedAt:null,top:null,topReceivedAt:null,topHeader:null,headerReceivedAt:null,fees:null,invalidFrames:0};class qM{#e=w0;#t=new Set;#n;#i;#l=null;#a=null;#o=null;#s;#u=null;#r=null;constructor(i,s={}){this.#i=s.now??Date.now,this.#s=s.pollIntervalMs??Tm,this.#n=new LM({url:bS(i),webSocketFactory:s.webSocketFactory,retryMinimumMs:s.retryMinimumMs,retryMaximumMs:s.retryMaximumMs,jitterRatio:s.jitterRatio,heartbeatMs:this.#s,now:this.#i,onOpen:r=>{this.#l=this.#i(),r.send("/v1/configuration?format=json"),r.send("/v1/top/subscribe?format=json"),this.#r=null,this.#c()},onHeartbeat:r=>{const o=this.#e.topReceivedAt??this.#l;if(o!==null&&this.#i()-o>=qh){try{r.close(4e3,"Native top response timed out")}catch{}return}r.send("/v1/top?format=json")},onBeforeStop:r=>{r.send("/v1/top/subscribe?format=json&stop=true")},onMessage:r=>{const o=kE(r);if(!o){this.#h({...this.#e,invalidFrames:this.#e.invalidFrames+1});return}this.#p(o)}}),this.#n.subscribeStatus(()=>{this.#n.getStatus().phase!=="connected"&&(this.#l=null,this.#r=null,this.#a=null,this.#o=null,this.#f())})}getStatus=()=>this.#n.getStatus();subscribeStatus=i=>this.#n.subscribeStatus(i);getState=()=>this.#e;subscribeState=i=>(this.#t.add(i),()=>{this.#t.delete(i)});start(){this.#u??=setInterval(()=>{this.#c()},hb),this.#n.start()}stop(){this.#u!==null&&clearInterval(this.#u),this.#u=null,this.#r=null,this.#n.stop()}#p(i){const s=this.#i();if(i.type==="fees"){this.#r=null,this.#h({...this.#e,fees:{data:i.payload,receivedAt:s}});return}if(i.type==="top"){const r=this.#e.top!==null&&i.payload{i.configure(n,s)},[n,i,s]),le.useEffect(()=>(i.start(),()=>{i.stop()}),[i]),r}function GM(n,i,s){const r=le.useMemo(()=>new qM(n),[n]),o=le.useMemo(()=>_S(n),[n]),f=le.useSyncExternalStore(r.subscribeStatus,r.getStatus,r.getStatus),d=le.useSyncE)DELIM" -R"DELIM(xternalStore(r.subscribeState,r.getState,r.getState),p=Z1(f,d,s);le.useEffect(()=>(r.start(),()=>{r.stop()}),[r]);const m=x0({queryKey:["native-snapshot",n],queryFn:({signal:M})=>RE(n,M),enabled:o&&!p,refetchInterval:Tm,retry:!1}),v=YM(f,d,m.data??null,s),x=E0(f,d,null,s),S=x0({queryKey:["native-fees",n],queryFn:({signal:M})=>CE(n,M),enabled:o&&x===null,refetchInterval:hb,retry:!1}),w=E0(f,d,S.data??null,s);return le.useEffect(()=>{w!==null&&i.recordNativeFees(w.data,w.receivedAt)},[w,i]),le.useEffect(()=>{v.top!==null&&i.recordNativeTop(v.top,v.receivedAt??Date.now())},[i,v.receivedAt,v.top]),{status:f,live:d,...v,restError:m.error instanceof Error?m.error.message:null}}function Z1(n,i,s){return n.phase==="connected"&&i.top!==null&&i.topReceivedAt!==null&&i.configuration!==null&&i.configurationReceivedAt!==null&&Vh(i.topReceivedAt,s)}function YM(n,i,s,r){return Z1(n,i,r)?{top:i.top,topHeader:i.headerReceivedAt!==null&&Vh(i.headerReceivedAt,r)?i.topHeader:null,configuration:i.configuration,receivedAt:i.topReceivedAt,transport:"websocket"}:s&&Vh(s.receivedAt,r)?{top:s.top,topHeader:s.topHeader,configuration:s.configuration,receivedAt:s.receivedAt,transport:"rest"}:{top:null,topHeader:null,configuration:null,receivedAt:null,transport:"none"}}function E0(n,i,s,r){return n.phase==="connected"&&i.fees!==null&&r-i.fees.receivedAtnew XA,[]),i=Cb(),[s,r]=le.useState(SS),[o,f]=le.useState("overview"),[d,p]=le.useState(!1),[m,v]=le.useState(PA),[x,S]=le.useState(!1),[w,M]=le.useState(!1),[T,k]=le.useState(pS),B=le.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),V=VM(s.adminUrl,n,m),D=GM(s.nativeUrl,n,i),ee=eT(D.top,D.topHeader,i);function G(X){xS(X),(X.adminUrl!==s.adminUrl||X.nativeUrl!==s.nativeUrl)&&n.reset(),r(X),p(!1)}function W(){zS();const X=j0();(X.adminUrl!==s.adminUrl||X.nativeUrl!==s.nativeUrl)&&n.reset(),r(X),p(!1)}function ie(X){gS(X),k(X)}function ae(X){WA(X),v(X)}return b.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[b.jsx("header",{className:"border-accent/30 bg-surface/90 border-b backdrop-blur",children:b.jsx("div",{className:"mx-auto max-w-7xl px-4 py-4",children:b.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[b.jsx("button",{type:"button",onClick:()=>{f("overview")},className:"text-accent order-1 text-lg font-semibold tracking-tight",children:"Libbitcoin Server"}),b.jsx("nav",{className:"text-textMuted order-3 flex w-full items-center gap-3 text-sm md:order-2 md:w-auto",children:QM.map(X=>b.jsxs("button",{type:"button",onClick:()=>{f(X.id)},className:`text-textMuted hover:text-accent rounded-md px-3 py-1 text-sm transition ${o===X.id?"bg-accentSecondary/20 text-accent":""}`,children:[X.label,X.id==="logs"&&B.totalLogs>0&&b.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:B.totalLogs>999?"999+":String(B.totalLogs)}),X.id==="events"&&B.totalEvents>0&&b.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:B.totalEvents>999?"999+":String(B.totalEvents)})]},X.id))}),b.jsxs("div",{className:"order-2 ml-auto flex items-center gap-3 md:order-3",children:[b.jsxs("div",{className:"hidden items-center gap-2 lg:flex","aria-label":"Connection summary",children:[b.jsx(T0,{connected:V.phase==="connected",label:"Admin"}),b.jsx(T0,{connected:D.transport!=="none",label:"Native"})]}),b.jsx("button",{type:"button",onClick:()=>{p(!0)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Endpoints"})]})]})})}),b.jsxs("main",{className:"mx-auto min-h-[calc(100vh-4rem)] max-w-7xl min-w-0 space-y-6 px-4 py-8",children:[b.jsxs("header",{children:[b.jsx("p",{className:"text-accentSecondary text-sm tracking-wide uppercase",children:"Administration"}),b.jsx("h1",{className:"text-accent text-3xl font-semibold",children:"Admin Dashboard"})]}),o==="overview"&&b.jsx(qA,{adminStatus:V,endpoints:s,metrics:B,native:D,syncEstimate:ee}),o==="logs"&&b.jsx(ME,{metrics:n,delivery:B,status:V,logFilter:m,paused:x,onLogFilterChange:ae,onPausedChange:X=>{n.setLogsPaused(X),S(X)},onClear:()=>{n.clearLogs()}}),o==="events"&&b.jsx(NE,{metrics:n,paused:w,onPausedChange:X=>{n.setEventsPaused(X),M(X)},onClear:()=>{n.clearEvents()}})]}),b.jsx(QA,{estimate:ee,browserNotificationsEnabled:T},s.nativeUrl),d&&b.jsx(wS,{configuration:s,browserNotificationsEnabled:T,onClose:()=>{p(!1)},onReset:W,onSave:G,onBrowserNotificationsEnabledChange:ie},`${s.adminUrl}|${s.nativeUrl}`)]})}function T0({connected:n,label:i}){return b.jsxs("span",{className:"text-textMuted inline-flex items-center gap-1.5 text-xs",children:[b.jsx("span",{className:`h-2 w-2 rounded-full ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":"true"}),i]})}function FM({children:n}){const[i]=le.useState(()=>new EM({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return b.jsxs(NM,{client:i,children:[n,null]})}const U1=document.querySelector("#root");if(!U1)throw new Error("Root element not found");hS.createRoot(U1).render(b.jsx(sS.StrictMode,{children:b.jsx(FM,{children:b.jsx(KM,{})})})); +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of n.seen.entries()){const m=d[1];if(i===d[0]){f(d);continue}if(n.external){const g=n.external.registry.get(d[0])?.id;if(i!==d[0]&&g){f(d);continue}}if(n.metadataRegistry.get(d[0])?.id){f(d);continue}if(m.cycle){f(d);continue}m.count>1&&n.reused==="ref"&&f(d)}n.external&&(n.sharedDefsExtractedFor=n.external)}function D1(n){const i=n.anyOf;if(!Array.isArray(i)||i.length===0||n.type!==void 0)return;const a=[];for(const l of i){if(!l||typeof l!="object")return;D1(l);const u=Object.keys(l);if(u.length!==1||u[0]!=="type")return;const f=l.type;for(const d of Array.isArray(f)?f:[f]){if(typeof d!="string")return;a.includes(d)||a.push(d)}}delete n.anyOf,n.type=a.length===1?a[0]:a}const U1=new Set(["type","properties","required","additionalProperties"]),Ob=["oneOf","anyOf"];function Nb(n){const i=n.additionalProperties;return i===void 0||i===!1||typeof i!="object"||i===null?null:Object.keys(i).length?i:null}function Wm(n){const i=[];for(const f of n){if(typeof f!="object"||f.type!=="object")return null;for(const d in f)if(!U1.has(d))return null;i.push(f)}const a={},l=new Set;for(const f of i){for(const d in f.properties){if(Object.prototype.hasOwnProperty.call(a,d))continue;const m=[];for(const g of i){const x=g.properties?.[d]??Nb(g);x!=null&&(m.some(y=>JSON.stringify(y)===JSON.stringify(x))||m.push(x))}const p=m.length===1?m[0]:Wm(m)??{allOf:m};Ja(a,d,p)}for(const d of f.required??[])l.add(d)}const u={type:"object",properties:a};if(l.size&&(u.required=[...l]),i.every(f=>f.additionalProperties===!1))u.additionalProperties=!1;else{const f=[];for(const d of i){const m=Nb(d);m&&!f.some(p=>JSON.stringify(p)===JSON.stringify(m))&&f.push(m)}f.length===1?u.additionalProperties=f[0]:f.length>1&&(u.additionalProperties={allOf:f})}return u}function DO(n){const i=n.allOf;if(!Array.isArray(i)||i.length<2)return;for(const u of U1)if(u in n)return;const a=i.filter(u=>Ob.some(f=>Array.isArray(u[f])));let l=null;if(!a.length)l=Wm(i);else{const u=a[0],f=Ob.find(p=>Array.isArray(u[p]));if(Object.keys(u).length!==1)return;const d=i.filter(p=>p!==u),m=u[f].map(p=>Wm([...d,p]));if(m.some(p=>!p))return;l={[f]:m}}l&&(delete n.allOf,Tu(n,l))}function Z1(n,i){const a=n.seen.get(i);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const l=m=>{const p=n.seen.get(m);if(p.ref===null)return;const g=p.def??p.schema,x={...g},y=p.ref;if(p.ref=null,y){l(y);const N=n.seen.get(y),E=N.schema;if(E.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(E)):Tu(g,E),Tu(g,x),m._zod.parent===y)for(const k in g)k==="$ref"||k==="allOf"||k in x||delete g[k];if(E.$ref&&N.def)for(const k in g)k==="$ref"||k==="allOf"||k in N.def&&JSON.stringify(g[k])===JSON.stringify(N.def[k])&&delete g[k]}const w=m._zod.parent;if(w&&w!==y){l(w);const N=n.seen.get(w);if(N?.schema.$ref&&(g.$ref=N.schema.$ref,N.def))for(const E in g)E==="$ref"||E==="allOf"||E in N.def&&JSON.stringify(g[E])===JSON.stringify(N.def[E])&&delete g[E]}n.override({zodSchema:m,jsonSchema:g,path:p.path??[]})};if(!n.external||n.sharedEmitDoneFor!==n.external){for(const m of[...n.seen.entries()].reverse())l(m[0]);if(n.target!=="openapi-3.0")for(const m of n)DELIM" +R"DELIM(.seen.entries())D1(m[1].def??m[1].schema);for(const m of n.deferred)m();if(n.intersections.length){const m=new Map;for(const p of n.seen.values())for(const g of[p.schema,p.def]){const x=g?.allOf;if(!Array.isArray(x))continue;const y=m.get(x);y?y.push(g):m.set(x,[g])}for(const p of n.intersections)for(const g of m.get(p)??[])DO(g)}}const u={};if(n.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":n.target,n.external?.uri){const m=n.external.registry.get(i)?.id;if(!m)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(m)}Tu(u,a.defId?a.schema:a.def??a.schema);const f=n.metadataRegistry.get(i)?.id;f!==void 0&&u.id===f&&delete u.id;const d=n.external?.defs??{};if(!n.external||n.sharedEmitDoneFor!==n.external)for(const m of n.seen.entries()){const p=m[1];p.def&&p.defId&&(p.def.id===p.defId&&delete p.def.id,Ja(d,p.defId,p.def))}n.external&&(n.sharedEmitDoneFor=n.external),n.external||Object.keys(d).length>0&&(n.target==="draft-2020-12"?u.$defs=d:u.definitions=d);try{const m=JSON.parse(JSON.stringify(u));return Object.defineProperty(m,"~standard",{value:{...i["~standard"],jsonSchema:{input:Cf(i,"input",n.processors),output:Cf(i,"output",n.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function ti(n,i){const a=i??{seen:new Set};if(a.seen.has(n))return!1;a.seen.add(n);const l=n._zod.def;if(l.type==="transform")return!0;if(l.type==="array")return ti(l.element,a);if(l.type==="set")return ti(l.valueType,a);if(l.type==="lazy")return ti(l.getter(),a);if(l.type==="promise"||l.type==="optional"||l.type==="nonoptional"||l.type==="nullable"||l.type==="readonly"||l.type==="default"||l.type==="prefault"||l.type==="catch")return ti(l.innerType,a);if(l.type==="intersection")return ti(l.left,a)||ti(l.right,a);if(l.type==="record"||l.type==="map")return ti(l.keyType,a)||ti(l.valueType,a);if(l.type==="pipe")return n._zod.traits.has("$ZodCodec")?!0:ti(l.in,a)||ti(l.out,a);if(l.type==="object"){for(const u in l.shape)if(ti(l.shape[u],a))return!0;return!1}if(l.type==="union"){for(const u of l.options)if(ti(u,a))return!0;return!1}if(l.type==="tuple"){for(const u of l.items)if(ti(u,a))return!0;return!!(l.rest&&ti(l.rest,a))}return!1}const UO=(n,i={})=>a=>{const l=C1({...a,processors:i});return mn(n,l),k1(l,n),Z1(l,n)},Cf=(n,i,a={})=>l=>{const{libraryOptions:u,target:f}=l??{},d=C1({...u??{},target:f,io:i,processors:a});return mn(n,d),k1(d,n),Z1(d,n)},io=(n,i,a)=>{(n[i]===void 0||a>n[i])&&(n[i]=a)},ro=(n,i,a)=>{(n[i]===void 0||a{io(n,"minimum",i),ro(n,"maximum",i)},$1=(n,i)=>{n.multipleOf??(n.multipleOf=[]),n.multipleOf.includes(i)||n.multipleOf.push(i)},L1=(n,i)=>{n.patterns??(n.patterns=new Set),n.patterns.add(i)},H1=(n,i)=>{n.mime=n.mime?n.mime.filter(a=>i.includes(a)):[...i]},B1=(n,i)=>{n.format=i,i.includes("int")&&(n.isInt=!0)},Mb=(n,i)=>io(n,"minimum",i.minimum),jb=(n,i)=>ro(n,"maximum",i.maximum),Rb=n=>(i,a)=>{B1(i,a.format);const[l,u]=n[a.format];io(i,"minimum",l),ro(i,"maximum",u)},ZO={greater_than:(n,i)=>io(n,i.inclusive?"minimum":"exclusiveMinimum",i.value),less_than:(n,i)=>ro(n,i.inclusive?"maximum":"exclusiveMaximum",i.value),multiple_of:(n,i)=>$1(n,i.value),number_format:Rb(o1),bigint_format:Rb(eE),min_length:Mb,max_length:jb,length_equals:(n,i)=>Ab(n,i.length),min_size:Mb,max_size:jb,size_equals:(n,i)=>Ab(n,i.size),string_format:(n,i)=>{B1(n,i.format),i.pattern&&L1(n,i.pattern),(i.format==="base64"||i.format==="base64url")&&(n.contentEncoding=i.format),(i.local||i.precision===-1)&&(n.laxFormat=!0)},mime_type:(n,i)=>H1(n,i.mime)};function pr(n){const i={},a=n._zod.def,l=n._zod.traits.has("$ZodCheck")?[n,...a.checks??[]]:a.checks??[];for(const f of l)ZO[f._zod.def.check]?.(i,f._zod.def);const u=n._zod.bag;u.minimum!==void 0&&io(i,"minimum",u.minimum),u.exclusiveMinimum!==void 0&&io(i,"exclusiveMinimum",u.exclusiveMinimum),u.maximum!==void 0&&ro(i,"maximum",u.maximum),u.exclusiveMaximum!==void 0&&ro(i,"exclusiveMaximum",u.exclusiveMaximum),u.multipleOf!==void 0&&$1(i,u.multipleOf),u.format!==void 0&&(i.format??(i.format=u.format),u.format.includes("int")&&(i.isInt=!0)),u.mime&&H1(i,u.mime);for(const f of u.patterns??[])L1(i,f);return i}const $O={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},LO=new Map([[w1,tT],[Zp,nT]]),HO=n=>LO.get(n)??n,BO=(n,i,a,l)=>{const u=a;u.type="string";const{minimum:f,maximum:d,format:m,patterns:p,contentEncoding:g,laxFormat:x}=pr(n);if(typeof f=="number"&&(u.minLength=f),typeof d=="number"&&(u.maxLength=d),m&&(u.format=$O[m]??m,u.format===""&&delete u.format,(m==="time"||x)&&delete u.format),g&&(u.contentEncoding=g),p&&p.size>0){const y=[...p].map(HO);y.length===1?u.pattern=y[0].source:y.length>1&&(u.allOf=[...y.map(w=>({...i.target==="draft-07"||i.target==="draft-04"||i.target==="openapi-3.0"?{type:"string"}:{},pattern:w.source}))])}},qO=(n,i,a,l)=>{const u=a,{minimum:f,maximum:d,multipleOf:m,exclusiveMaximum:p,exclusiveMinimum:g,isInt:x}=pr(n);u.type=x?"integer":"number";const y=typeof g=="number"&&g>=(f??Number.NEGATIVE_INFINITY),w=typeof p=="number"&&p<=(d??Number.POSITIVE_INFINITY),N=i.target==="draft-04"||i.target==="openapi-3.0";if(y?N?(u.minimum=g,u.exclusiveMinimum=!0):u.exclusiveMinimum=g:typeof f=="number"&&(u.minimum=f),w?N?(u.maximum=p,u.exclusiveMaximum=!0):u.exclusiveMaximum=p:typeof d=="number"&&(u.maximum=d),m){const E=new Set;for(const B of m)Number.isFinite(B)&&B!==0?E.add(Math.abs(B)):Fs(n,i,u,l,`A multipleOf divisor of ${B} cannot be represented in JSON Schema`);const[A,...k]=E;A!==void 0&&(u.multipleOf=A),k.length&&(u.allOf=[...u.allOf??[],...k.map(B=>({multipleOf:B}))])}},VO=(n,i,a,l)=>{a.type="boolean"},IO=(n,i,a,l)=>{a.not={}},KO=(n,i,a,l)=>{},GO=(n,i,a,l)=>{const u=n._zod.def,f=Ym(u.entries);if(f.length===0){a.not={};return}f.every(d=>typeof d=="number")&&(a.type="number"),f.every(d=>typeof d=="string")&&(a.type="string"),a.enum=f},YO=(n,i,a,l)=>{const u=n._zod.def;if(u.values.length===0){a.not={};return}const f=[];for(const d of u.values)if(d===void 0){if(Fs(n,i,a,l,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof d=="bigint"){if(Fs(n,i,a,l,"BigInt literals cannot be represented in JSON Schema"))return;f.push(Number(d))}else f.push(d);if(f.length!==0)if(f.length===1){const d=f[0];a.type=d===null?"null":typeof d,i.target==="draft-04"||i.target==="openapi-3.0"?a.enum=[d]:a.const=d}else f.every(d=>typeof d=="number")&&(a.type="number"),f.every(d=>typeof d=="string")&&(a.type="string"),f.every(d=>typeof d=="boolean")&&(a.type="boolean"),f.every(d=>d===null)&&(a.type="null"),a.enum=f},PO=(n,i,a,l)=>{Fs(n,i,a,l,"Custom types cannot be represented in JSON Schema")},FO=(n,i,a,l)=>{Fs(n,i,a,l,"Transforms cannot be represented in JSON Schema")},QO=(n,i,a,l)=>{const u=a,f=n._zod.def,{minimum:d,maximum:m}=pr(n);typeof d=="number"&&(u.minItems=d),typeof m=="number"&&(u.maxItems=m),u.type="array",u.items=mn(f.element,i,{...l,path:[...l.path,"items"]})};function kf(n){const i=n._zod.def;return i.type==="pipe"&&i.in._zod.traits.has("$ZodTransform")?kf(i.out):i.type==="catch"?kf(i.innerType):n._zod.optin}const JO=(n,i,a,l)=>{const u=a,f=n._zod.def,d=f.shape;if(Object.getOwnPropertySymbols(d).length&&Fs(n,i,u,l,"Symbol keys cannot be represented in JSON Schema"))return;u.type="object",u.properties={};for(const g in d)Ja(u.properties,g,mn(d[g],i,{...l,path:[...l.path,"properties",g]}));const p=[];for(const g of Object.keys(d)){const x=f.shape[g];(i.io==="input"?kf(x)===void 0:x._zod.optout===void 0)&&p.push(g)}p.length>0&&(u.required=p),f.catchall?._zod.def.type==="never"?u.additionalProperties=!1:f.catchall?f.catchall&&(u.additionalProperties=mn(f.catchall,i,{...l,path:[...l.path,"additionalProperties"]})):i.io==="output"&&(u.additionalProperties=!1)},XO=(n,i,a,l)=>{const u=n._zod.def)DELIM" +R"DELIM(,f=u.inclusive===!1,d=u.options.map((m,p)=>mn(m,i,{...l,path:[...l.path,f?"oneOf":"anyOf",p]}));f?a.oneOf=d:a.anyOf=d},WO=(n,i,a,l)=>{const u=n._zod.def,f=mn(u.left,i,{...l,path:[...l.path,"allOf",0]}),d=mn(u.right,i,{...l,path:[...l.path,"allOf",1]}),m=g=>"allOf"in g&&Object.keys(g).length===1,p=[...m(f)?f.allOf:[f],...m(d)?d.allOf:[d]];a.allOf=p,i.intersections.push(p)},eN=(n,i,a,l)=>{const u=a,f=n._zod.def;u.type="array";const d=i.target==="draft-2020-12"?"prefixItems":"items",m=i.target==="draft-2020-12"||i.target==="openapi-3.0"?"items":"additionalItems",p=f.items.map((A,k)=>mn(A,i,{...l,path:[...l.path,d,k]})),g=f.rest?mn(f.rest,i,{...l,path:[...l.path,m,...i.target==="openapi-3.0"?[f.items.length]:[]]}):null;let x=f.items.length;for(;x>0;){const A=f.items[x-1];if(!(i.io==="input"?kf(A)!==void 0:A._zod.optout==="optional"))break;x--}const y=f.items.length,w=!f.rest;i.target==="draft-2020-12"?(u.prefixItems=p,w?u.items=!1:g&&(u.items=g),x>0&&(u.minItems=x),w&&(u.maxItems=y)):i.target==="openapi-3.0"?(u.items={anyOf:p},g&&u.items.anyOf.push(g),x>0&&(u.minItems=x),w&&(u.maxItems=y)):(u.items=p,w?u.additionalItems=!1:g&&(u.additionalItems=g),x>0&&(u.minItems=x),w&&(u.maxItems=y));const{minimum:N,maximum:E}=pr(n);typeof N=="number"&&(u.minItems=N),typeof E=="number"&&(u.maxItems=E)},tN=(n,i,a,l)=>{const u=n._zod.def,f=mn(u.innerType,i,l),d=i.seen.get(n);i.target==="openapi-3.0"?(d.ref=u.innerType,a.nullable=!0):a.anyOf=[f,{type:"null"}]},nN=(n,i,a,l)=>{const u=n._zod.def;mn(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType},$p=Symbol();function q1(n,i,a,l,u){let f=!1;const d=JSON.stringify(n,(m,p)=>typeof p!="bigint"?p:(f=!0,null));return f?(Fs(i,a,l,u,"BigInt defaults cannot be represented in JSON Schema"),$p):JSON.parse(d)}const iN=(n,i,a,l)=>{const u=n._zod.def;mn(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType;const d=q1(u.defaultValue,n,i,a,l);d!==$p&&(a.default=d)},rN=(n,i,a,l)=>{const u=n._zod.def;mn(u.innerType,i,l);const f=i.seen.get(n);if(f.ref=u.innerType,i.io!=="input")return;const d=q1(u.defaultValue,n,i,a,l);d!==$p&&(a._prefault=d)},sN=(n,i,a,l)=>{const u=n._zod.def;mn(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType;let d;try{d=u.catchValue(void 0)}catch{Fs(n,i,a,l,"Dynamic catch values are not supported in JSON Schema");return}a.default=d},aN=(n,i,a,l)=>{const u=n._zod.def,f=u.in._zod.traits.has("$ZodTransform"),d=i.io==="input"?f?u.out:u.in:u.out;mn(d,i,l);const m=i.seen.get(n);m.ref=d},lN=(n,i,a,l)=>{const u=n._zod.def;mn(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType,a.readOnly=!0},V1=(n,i,a,l)=>{const u=n._zod.def;mn(u.innerType,i,l);const f=i.seen.get(n);f.ref=u.innerType},Cb=new WeakSet([Object.prototype,Error.prototype]);function hf(n,i,a){Object.defineProperty(n,i,{configurable:!0,enumerable:!1,get(){const l=a(this);return Object.defineProperty(this,i,{value:l,configurable:!0,writable:!0}),l},set(l){Object.defineProperty(this,i,{value:l,configurable:!0,writable:!0})}})}const oN=(n,i)=>{xE.init(n,i),n.name="ZodError";const a=Object.getPrototypeOf(n);Cb.has(a)||(Cb.add(a),hf(a,"format",l=>u=>EE(l,u)),hf(a,"flatten",l=>u=>zE(l,u)),hf(a,"addIssue",l=>u=>{l.issues.push(u),l.message=JSON.stringify(l.issues,Pm,2)}),hf(a,"addIssues",l=>u=>{l.issues.push(...u),l.message=JSON.stringify(l.issues,Pm,2)}),Object.defineProperty(a,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Fi=Q("ZodError",oN,void 0,{Parent:Error}),uN=jp(Fi),cN=Rp(Fi),fN=Cp(Fi),dN=kp(Fi),hN=jE(Fi),mN=RE(Fi),pN=CE(Fi),gN=kE(Fi),vN=DE(Fi),yN=UE(Fi),bN=ZE(Fi),_N=$E(Fi);function SN(){gr.localeError||Xs(L2())}function Pf(){gr.memoizer||Xs({memoizer:U2()})}const Lt=Q("ZodType",(n,i)=>(SN(),Rt.init(n,i),n.def=i,n.type=i.type,n),{check(...n){const i=this.def;return this.clone(Ri(i,{checks:[...i.checks??[],...n.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,i){return Js(this,n,i)},brand(){return this},register(n,i){return n.add(this,i),this},refine(n,i){return this.check(bA(n,i))},superRefine(n,i){return this.check(_A(n,i))},overwrite(n){return this.check(fo(n))},optional(){return Ub(this)},exactOptional(){return aA(this)},nullable(){return Zb(this)},nullish(){return Ub(Zb(this))},nonoptional(n){return dA(this,n)},array(){return Ff(this)},or(n){return Qf([this,n])},and(n){return eA(this,n)},transform(n){return $b(this,sA(n))},default(n){return uA(this,n)},prefault(n){return fA(this,n)},catch(n){return mA(this,n)},pipe(n){return $b(this,n)},readonly(){return vA(this)},describe(n){const i=this.clone();return Su.add(i,{description:n}),i},meta(...n){if(n.length===0)return Su.get(this);const i=this.clone();return Su.add(i,n[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n,...i){return i.length===0?n(this):n(this,...i)},get"~standard"(){return c1(this,"~standard",{...y1(this),jsonSchema:{input:Cf(this,"input"),output:Cf(this,"output")}})},set"~standard"(n){Ps(this,"~standard",n)},parse:function n(i,a){return uN(this,i,a,{callee:n})},parseAsync:async function n(i,a){return await cN(this,i,a,{callee:n})},safeParse(n,i){return fN(this,n,i)},async safeParseAsync(n,i){return dN(this,n,i)},get spa(){return this?.safeParseAsync},set spa(n){Ps(this,"spa",n)},validate(n,i){return NE(this,n,i)},validateAsync(n,i){return ME(this,n,i)},encode:function n(i,a){return hN(this,i,a,{callee:n})},decode:function n(i,a){return mN(this,i,a,{callee:n})},encodeAsync:async function n(i,a){return await pN(this,i,a,{callee:n})},decodeAsync:async function n(i,a){return await gN(this,i,a,{callee:n})},safeEncode(n,i){return vN(this,n,i)},safeDecode(n,i){return yN(this,n,i)},async safeEncodeAsync(n,i){return bN(this,n,i)},async safeDecodeAsync(n,i){return _N(this,n,i)},toJSONSchema(n){return UO(this,{})(n)},get description(){return Su.get(this)?.description},get _def(){return this._zod.def}}),I1=Q("_ZodString",(n,i)=>{Up.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>BO(n,a,l)},f1({format:n=>pr(n).format??null,minLength:n=>pr(n).minimum??null,maxLength:n=>pr(n).maximum??null},{regex(...n){return this.check(_O(...n))},includes(...n){return this.check(wO(...n))},startsWith(...n){return this.check(zO(...n))},endsWith(...n){return this.check(EO(...n))},min(...n){return this.check(Rf(...n))},max(...n){return this.check(j1(...n))},length(...n){return this.check(R1(...n))},nonempty(...n){return this.check(Rf(1,...n))},lowercase(n){return this.check(SO(n))},uppercase(n){return this.check(xO(n))},trim(){return this.check(OO())},normalize(...n){return this.check(TO(...n))},toLowerCase(){return this.check(NO())},toUpperCase(){return this.check(AO())},slugify(){return this.check(MO())}})),xN=Q("ZodString",(n,i)=>{Up.init(n,i),I1.init(n,i)},{email(n){return this.check(V2(ON,n))},url(n){return this.check(F2(AN,n))},jwt(n){return this.check(cO(IN,n))},emoji(n){return this.check(Q2(MN,n))},guid(n){return this.check(I2(NN,n))},uuid(n){return this.check(K2(mf,n))},uuidv4(n){return this.check(G2(mf,n))},uuidv6(n){return this.check(Y2(mf,n))},uuidv7(n){return this.check(P2(mf,n))},nanoid(n){return this.check(J2(jN,n))},cuid(n){return this.check(X2(RN,n))},cuid2(n){return this.check(W2(CN,n))},ulid(n){return this.check(eO(kN,n))},base64(n){return this.check(lO(BN,n))},base64url(n){return this.check(oO(qN,n))},xid(n){return this.check(tO(DN,n))},ksuid(n){return this.check(nO(UN,n))},ipv4(n){return this.check(iO(ZN,n))},ipv6(n){return this.check(rO($N,n))},cidrv4(n){return this.check(sO(LN,n))},cidrv6(n){return this.check(aO(HN,n))},e164(n){return this.check(uO(VN,n))},datetime(n){return this.check(fO(wN,n))},date(n){return this.check(dO(zN,n))},time(n){return this.check(hO(EN,n))},duration(n){return this.check(mO(TN,n))}});function Zr(n){return q2(xN,n)}const Ht=Q("ZodStringFormat",(n,i)=>{Ct.init(n,i),I1.init(n,i)}),wN=Q("ZodISODateTime",(n,i)=>{KT.init(n,i),Ht.init(n,i)}),zN=Q("ZodISODate",(n,i))DELIM" +R"DELIM(=>{GT.init(n,i),Ht.init(n,i)}),EN=Q("ZodISOTime",(n,i)=>{YT.init(n,i),Ht.init(n,i)}),TN=Q("ZodISODuration",(n,i)=>{PT.init(n,i),Ht.init(n,i)}),ON=Q("ZodEmail",(n,i)=>{jT.init(n,i),Ht.init(n,i)}),NN=Q("ZodGUID",(n,i)=>{AT.init(n,i),Ht.init(n,i)}),mf=Q("ZodUUID",(n,i)=>{MT.init(n,i),Ht.init(n,i)}),AN=Q("ZodURL",(n,i)=>{ZT.init(n,i),Ht.init(n,i)}),MN=Q("ZodEmoji",(n,i)=>{$T.init(n,i),Ht.init(n,i)}),jN=Q("ZodNanoID",(n,i)=>{LT.init(n,i),Ht.init(n,i)}),RN=Q("ZodCUID",(n,i)=>{HT.init(n,i),Ht.init(n,i)}),CN=Q("ZodCUID2",(n,i)=>{BT.init(n,i),Ht.init(n,i)}),kN=Q("ZodULID",(n,i)=>{qT.init(n,i),Ht.init(n,i)}),DN=Q("ZodXID",(n,i)=>{VT.init(n,i),Ht.init(n,i)}),UN=Q("ZodKSUID",(n,i)=>{IT.init(n,i),Ht.init(n,i)}),ZN=Q("ZodIPv4",(n,i)=>{FT.init(n,i),Ht.init(n,i)}),$N=Q("ZodIPv6",(n,i)=>{JT.init(n,i),Ht.init(n,i)}),LN=Q("ZodCIDRv4",(n,i)=>{XT.init(n,i),Ht.init(n,i)}),HN=Q("ZodCIDRv6",(n,i)=>{e2.init(n,i),Ht.init(n,i)}),BN=Q("ZodBase64",(n,i)=>{t2.init(n,i),Ht.init(n,i)}),qN=Q("ZodBase64URL",(n,i)=>{i2.init(n,i),Ht.init(n,i)}),VN=Q("ZodE164",(n,i)=>{r2.init(n,i),Ht.init(n,i)}),IN=Q("ZodJWT",(n,i)=>{a2.init(n,i),Ht.init(n,i)}),K1=Q("ZodNumber",(n,i)=>{z1.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>qO(n,a,l,u),n.isFinite=!0},f1({minValue:n=>{const{minimum:i,exclusiveMinimum:a}=pr(n);return Math.max(i??Number.NEGATIVE_INFINITY,a??Number.NEGATIVE_INFINITY)},maxValue:n=>{const{maximum:i,exclusiveMaximum:a}=pr(n);return Math.min(i??Number.POSITIVE_INFINITY,a??Number.POSITIVE_INFINITY)},isInt:n=>{const{isInt:i,multipleOf:a}=pr(n);return!!i||!!a?.some(Number.isSafeInteger)},format:n=>pr(n).format??null},{gt(n,i){return this.check(zb(n,i))},gte(n,i){return this.check(Um(n,i))},min(n,i){return this.check(Um(n,i))},lt(n,i){return this.check(wb(n,i))},lte(n,i){return this.check(Dm(n,i))},max(n,i){return this.check(Dm(n,i))},int(n){return this.check(kb(n))},safe(n){return this.check(kb(n))},positive(n){return this.check(zb(0,n))},nonnegative(n){return this.check(Um(0,n))},negative(n){return this.check(wb(0,n))},nonpositive(n){return this.check(Dm(0,n))},multipleOf(n,i){return this.check(Eb(n,i))},step(n,i){return this.check(Eb(n,i))},finite(){return this}}));function vr(n){return pO(K1,n)}const KN=Q("ZodNumberFormat",(n,i)=>{l2.init(n,i),K1.init(n,i)});function kb(n){return gO(KN,n)}const GN=Q("ZodBoolean",(n,i)=>{o2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>VO(n,a,l)});function Pl(n){return vO(GN,n)}const YN=Q("ZodUnknown",(n,i)=>{u2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>KO()});function Db(){return yO(YN)}const PN=Q("ZodNever",(n,i)=>{c2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>IO(n,a,l)});function FN(n){return bO(PN,n)}const QN=Q("ZodArray",(n,i)=>{Pf(),h2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>QO(n,a,l,u),n.element=i.element},{min(n,i){return this.check(Rf(n,i))},nonempty(n){return this.check(Rf(1,n))},max(n,i){return this.check(j1(n,i))},length(n,i){return this.check(R1(n,i))},unwrap(){return this.element}});function Ff(n,i){return jO(QN,n,i)}const JN=Q("ZodObject",(n,i)=>{Pf(),g2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>JO(n,a,l,u),mE(n,"shape",a=>a._zod.def.shape,!1)},{keyof(){return Cu(Object.keys(this._zod.def.shape))},catchall(n){return this.clone(Ri(this._zod.def,{catchall:n}))},passthrough(){return this.clone(Ri(this._zod.def,{catchall:Db()}))},loose(){return this.clone(Ri(this._zod.def,{catchall:Db()}))},strict(){return this.clone(Ri(this._zod.def,{catchall:FN()}))},strip(){return this.clone(Ri(this._zod.def,{catchall:void 0}))},extend(n){return iE(this,n)},safeExtend(n){return rE(this,n)},merge(n){return sE(this,n)},pick(n){return tE(this,n)},omit(n){return nE(this,n)},partial(...n){return nb(Lp,this,n[0])},exactPartial(...n){return nb(G1,this,n[0],"exactPartial")},required(...n){return aE(Y1,this,n[0])}});function Lr(n,i){const a={type:"object",shape:n??{},...Oe(i)};return new JN(a)}const XN=Q("ZodUnion",(n,i)=>{v2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>XO(n,a,l,u),n.options=i.options});function Qf(n,i){return new XN({type:"union",options:n,...Oe(i)})}const WN=Q("ZodIntersection",(n,i)=>{y2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>WO(n,a,l,u)});function eA(n,i){return new WN({type:"intersection",left:n,right:i})}const tA=Q("ZodTuple",(n,i)=>{Pf(),b2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>eN(n,a,l,u)},{rest(n){return this.clone({...this._zod.def,rest:n})},partial(){const n=this._zod.def;if(n.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...n,items:n.items.map(i=>new Lp({type:"optional",innerType:i}))})}});function nA(n,i,a){const l=i instanceof Rt,u=l?a:i,f=l?i:null;return new tA({type:"tuple",items:n,rest:f,...Oe(u)})}const ep=Q("ZodEnum",(n,i)=>{_2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(l,u,f)=>GO(n,l,u),n.enum=i.entries,n.options=[...n._zod.values];const a=new Set(Object.keys(i.entries));n.extract=(l,u)=>{const f={};for(const d of l)if(a.has(d))f[d]=i.entries[d];else throw new Error(`Key ${d} not found in enum`);return new ep({...i,checks:[],...Oe(u),entries:f})},n.exclude=(l,u)=>{const f={...i.entries};for(const d of l)if(a.has(d))delete f[d];else throw new Error(`Key ${d} not found in enum`);return new ep({...i,checks:[],...Oe(u),entries:f})}});function Cu(n,i){const a=Array.isArray(n)?Object.fromEntries(n.map(l=>[l,l])):n;return new ep({type:"enum",entries:a,...Oe(i)})}const iA=Q("ZodLiteral",(n,i)=>{S2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>YO(n,a,l,u),n.values=new Set(i.values),Object.defineProperty(n,"value",{get(){if(i.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return i.values[0]}})});function Ou(n,i){return new iA({type:"literal",values:Array.isArray(n)?n:[n],...Oe(i)})}const rA=Q("ZodTransform",(n,i)=>{Pf(),x2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>FO(n,a,l,u),n._zod.parse=(a,l)=>{if(l.direction==="backward")throw new d1(n.constructor.name);a.addIssue=f=>{if(typeof f=="string")a.issues.push(Ru(f,a.value,i));else{const d=f;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),"input"in d||(d.input=a.value),d.inst??(d.inst=n),a.issues.push(Ru(d))}};const u=i.transform(a.value,a);return u instanceof Promise?u.then(f=>(a.value=f,a)):(a.value=u,a)}});function sA(n){return new rA({type:"transform",transform:n})}const Lp=Q("ZodOptional",(n,i)=>{O1.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>V1(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function Ub(n){return new Lp({type:"optional",innerType:n})}const G1=Q("ZodExactOptional",(n,i)=>{w2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>V1(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function aA(n){return new G1({type:"optional",innerType:n})}const lA=Q("ZodNullable",(n,i)=>{z2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>tN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function Zb(n){return new lA({type:"nullable",innerType:n})}const oA=Q("ZodDefault",(n,i)=>{E2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>iN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function uA(n,i){return new oA({type:"default",innerType:n,get defaultValue(){return typeof i=="function"?i():a1(i)}})}const cA=Q("ZodPrefault",(n,i)=>{T2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>rN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function fA(n,i){return new cA({type:"prefault",innerType:n,get defaultValue(){return typeof i=="function"?i():a1(i)}})}const Y1=Q("ZodNonOptional",(n,i)=>{O2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>nN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function dA(n,i){return new Y1({type:"nonoptional",innerType:n,...Oe(i)})}const hA=Q("ZodCatch",(n,i)=>{N2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>sN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function mA(n,i){retu)DELIM" +R"DELIM(rn new hA({type:"catch",innerType:n,catchValue:typeof i=="function"?i:gE(i)})}const pA=Q("ZodPipe",(n,i)=>{A2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>aN(n,a,l,u),n.in=i.in,n.out=i.out});function $b(n,i){return new pA({type:"pipe",in:n,out:i})}const gA=Q("ZodReadonly",(n,i)=>{M2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>lN(n,a,l,u),n.unwrap=()=>n._zod.def.innerType});function vA(n){return new gA({type:"readonly",innerType:n})}const yA=Q("ZodCustom",(n,i)=>{j2.init(n,i),Lt.init(n,i),n._zod.processJSONSchema=(a,l,u)=>PO(n,a,l,u)});function bA(n,i={}){return RO(yA,n,i)}function _A(n,i){return CO(n,i)}const Zu=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],Df=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],P1=vr().int().nonnegative().max(864e13),SA=Lr({level:vr().int().nonnegative(),time:P1,message:Zr()}),xA=Lr({event:vr().int().nonnegative(),value:vr().nonnegative(),time:P1}),wA=Lr({previous:vr().nonnegative()});Qf([SA,xA,wA]);const Hp=2**Zu.length-1,Wl=Hp,zA=2**0+2**1+2**2+2**6+2**7;function EA(n,i){return Number.isInteger(i)&&i>=0&&i0?`${String(a)}d ${String(l)}h`:l>0?`${String(l)}h ${String(u)}m`:u>0?`${String(u)}m ${String(f)}s`:`${String(f)}s`}function Q1(n,i){switch(ho(n).valueKind){case"height":return`height ${hn(i)}`;case"seconds":return`${Ia(i)} s`;case"milliseconds":return`${Ia(i)} ms`;case"microseconds":return`${Ia(i)} µs`;case"count":return hn(i);case"fee-rate":return`${Ia(i/1e3,3)} sat/vB`;default:return String(i)}}function RA(n){return n>=100?`${Ia(n,0)}/s`:n>=10?`${Ia(n,1)}/s`:`${Ia(n,2)}/s`}function CA(n){try{const i=new URL(n),a=i.pathname==="/"?"":i.pathname.replace(/\/$/u,"");return`${i.host}${a}`}catch{return n}}const Uf=32,kA=[{value:"all",label:"All categories"},{value:"headers",label:"Headers"},{value:"blocks",label:"Blocks"},{value:"transactions",label:"Transactions"},{value:"chain",label:"Confirmed chain"},{value:"mining",label:"Mining"},{value:"timing",label:"Timing"}],DA={headers:"bg-violet-500/15 text-violet-300",blocks:"bg-accent/15 text-accent",transactions:"bg-sky-500/15 text-sky-300",chain:"bg-emerald-500/15 text-emerald-300",mining:"bg-amber-500/15 text-amber-300",timing:"bg-cyan-500/15 text-cyan-300"};function UA({metrics:n,paused:i,onPausedChange:a,onClear:l}){const[u,f]=se.useState(""),[d,m]=se.useState("all"),[p,g]=se.useState({offset:0,search:u,category:d}),x=p.search===u&&p.category===d?p.offset:0,y=se.useRef(null),w=se.useSyncExternalStore(n.subscribeEvents,n.getEventWindow,n.getEventWindow);return se.useEffect(()=>{n.setEventQuery({search:u,category:d,offset:x})},[n,u,d,x]),se.useEffect(()=>{y.current&&(y.current.scrollTop=0)},[u,d]),S.jsxs("section",{className:"space-y-4",children:[S.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node lifecycle"}),S.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Live events"}),S.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"Heights are event payloads; timing values retain their source units."}),S.jsx("p",{className:"text-textMuted mt-1 text-xs",children:"Pause freezes this view; collection and charts continue."})]}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{type:"button",onClick:()=>{i&&(y.current&&(y.current.scrollTop=0),g({offset:0,search:u,category:d})),a(!i)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:i?"Resume display":"Pause display"}),S.jsx("button",{type:"button",onClick:l,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded)DELIM" +R"DELIM(-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),S.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[S.jsxs("label",{className:"min-w-56 flex-1",children:[S.jsx("span",{className:"sr-only",children:"Search events"}),S.jsx("input",{type:"search",value:u,onChange:N=>{f(N.target.value)},placeholder:"Search event names or values…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),S.jsxs("label",{children:[S.jsx("span",{className:"sr-only",children:"Filter event category"}),S.jsx("select",{value:d,onChange:N=>{m(N.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent rounded-md border px-3 py-2 text-sm focus:ring-0",children:kA.map(N=>S.jsx("option",{value:N.value,children:N.label},N.value))})]})]}),S.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[S.jsx("span",{children:i?"Display paused · collection continues":x>0?"Viewing older rows · collection continues":"Live stream · newest first"}),S.jsxs("span",{children:[String(w.matched)," matching · ",String(w.retained)," retained"]})]}),S.jsx("div",{ref:y,role:"region","aria-label":"Scrollable event history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:N=>{g({offset:Math.max(0,Math.floor(N.currentTarget.scrollTop/Uf)-8),search:u,category:d})},children:w.matched===0?S.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching events."}):S.jsx("ol",{"aria-label":"Received events",className:"relative min-w-[32rem]",style:{height:w.matched*Uf},children:w.events.map((N,E)=>S.jsx(ZA,{event:N,index:w.offset+E,total:w.matched},N.id))})})]}),!i&&S.jsx("div",{className:"flex justify-end text-xs",children:S.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{y.current&&(y.current.scrollTop=0),g({offset:0,search:u,category:d})},children:"Jump to latest"})}),S.jsxs("details",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[S.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-4 py-3 text-sm",children:["Event contract (",String(Df.length)," identifiers)"]}),S.jsx("div",{className:"border-accentSecondary/20 grid gap-2 border-t p-4 sm:grid-cols-2 lg:grid-cols-3",children:Df.map(N=>S.jsxs("div",{className:"text-xs",children:[S.jsx("span",{className:"text-textMuted font-mono",children:String(N.id).padStart(2,"0")}),S.jsx("span",{className:"text-textPrimary ml-2",children:N.name})]},N.id))})]})]})}const ZA=se.memo(function({event:i,index:a,total:l}){const u=ho(i.event);return S.jsxs("li",{"aria-setsize":l,"aria-posinset":a+1,className:"border-accentSecondary/20 absolute inset-x-0 grid grid-cols-[8.5rem_10rem_minmax(0,1fr)] items-center gap-2 border-b px-4 text-xs",style:{top:a*Uf,height:Uf},children:[S.jsx("time",{dateTime:Bp(i.time),className:"text-textMuted font-mono tabular-nums",children:eo(i.time)}),S.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${DA[u.category]}`,children:u.name}),S.jsx("span",{className:"text-textPrimary font-mono tabular-nums",children:Q1(i.event,i.value)})]})}),Zf=32,Lb={0:"bg-sky-500/15 text-sky-300",1:"bg-emerald-500/15 text-emerald-300",2:"bg-violet-500/15 text-violet-300",3:"bg-cyan-500/15 text-cyan-300",4:"bg-indigo-500/15 text-indigo-300",5:"bg-blue-500/15 text-blue-300",6:"bg-red-500/20 text-red-300",7:"bg-orange-500/20 text-orange-300",8:"bg-slate-500/20 text-slate-300",9:"bg-zinc-500/20 text-zinc-300"};function $A({metrics:n,delivery:i,status:a,logFilter:l,paused:u,onLogFilterChange:f,onPausedChange:d,onClear:m}){const[p,g]=se.useState(""),[x,y]=se.useState({offset:0,search:p,filter:l}),w=x.search===p&&x.filter===l?x.offset:0,[N,E]=se.useState(null),A=se.useRef(null),k=se.useSyncExternalStore(n.subscribeLogs,n.getLogWindow,n.getLogWindow);return se.useEffect(()=>{n.setLogQuery({search:p,filter:l,offset:w})},[n,p,l,w]),se.useEffect(()=>{A.current&&(A.current.scrollTop=0)},[p,l]),S.jsxs("section",{className:"space-y-4",children:[S.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Diagnostic stream"}),S.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Node logs"}),S.jsx("p",{className:"text-textMuted mt-1 text-sm",children:"The newest 1,000 messages are retained in this browser session."})]}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("button",{type:"button",onClick:()=>{u&&(A.current&&(A.current.scrollTop=0),y({offset:0,search:p,filter:l})),d(!u)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:u?"Resume display":"Pause display"}),S.jsx("button",{type:"button",onClick:m,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Clear"})]})]}),S.jsxs("fieldset",{className:"border-accent/30 bg-surface/80 space-y-3 rounded-2xl border p-4",children:[S.jsx("legend",{className:"text-textPrimary px-1 text-sm font-medium",children:"Requested log levels"}),S.jsx("p",{className:"text-textMuted text-xs",children:"Only checked levels are sent by the server. Pause freezes this view; collection and charts continue. Skipped log levels are not replayed."}),S.jsx("div",{className:"flex flex-wrap gap-x-5 gap-y-3",children:Zu.map(B=>S.jsxs("label",{className:"text-textPrimary flex items-center gap-2 text-sm",children:[S.jsx("input",{type:"checkbox",checked:EA(l,B.id),onChange:()=>{f(l^1<{f(zA)},className:"text-accent hover:underline",children:"Operational levels"}),S.jsx("button",{type:"button",onClick:()=>{f(Hp)},className:"text-accent hover:underline",children:"All levels"}),S.jsx("button",{type:"button",onClick:()=>{f(0)},className:"text-accent hover:underline",children:"No levels"}),S.jsx("span",{className:"text-textMuted",children:"Selection is saved in this browser."})]})]}),S.jsxs("div",{className:"border-accent/30 bg-surface/80 space-y-2 rounded-2xl border p-4 text-xs",children:[S.jsx("dl",{"aria-label":"Log delivery statistics",className:"flex flex-wrap gap-x-6 gap-y-2",children:[["Received logs",i.totalLogs],["Rolled out of history",i.evictedLogs],["Cleared from history",i.clearedLogs],["Invalid admin frames",i.invalidFrames],["Reconnects",a.reconnects]].map(([B,D])=>S.jsxs("div",{children:[S.jsx("dt",{className:"text-textMuted",children:B}),S.jsx("dd",{className:"text-textPrimary mt-1 font-mono tabular-nums",children:D.toLocaleString()})]},B))}),S.jsx("p",{className:"text-textMuted",children:"Live rows refresh every 100 ms and can skip intermediate messages on screen. Every valid log at a requested level is counted; older messages leave the 1,000-message history as new ones arrive. These counters continue while display is paused. Reconnects can leave gaps that the server does not replay."}),S.jsxs("p",{className:"text-textMuted",role:"status",children:["Admin connection: ",a.phase,a.error?` · ${a.error}`:""]})]}),S.jsxs("div",{className:"border-accent/30 bg-surface/80 flex flex-wrap gap-3 rounded-2xl border p-4",children:[S.jsxs("label",{className:"min-w-56 flex-1",children:[S.jsx("span",{className:"sr-only",children:"Search logs"}),S.jsx("input",{type:"search",value:p,onChange:B=>{g(B.target.value)},place)DELIM" +R"DELIM(holder:"Search received messages…",className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/60 focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),S.jsx("p",{className:"text-textMuted self-center text-xs",children:"Search filters received messages only."})]}),S.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-xl border",children:[S.jsxs("div",{className:"border-accentSecondary/30 bg-accentSecondary/20 text-textMuted flex justify-between border-b px-4 py-3 text-xs",children:[S.jsx("span",{children:u?"Display paused · collection continues":l===0?"Log delivery disabled":w>0?"Viewing older rows · collection continues":"Live stream · newest first"}),S.jsxs("span",{children:[String(k.matched)," matching · ",String(k.retained)," retained"]})]}),S.jsx("div",{ref:A,role:"region","aria-label":"Scrollable log history",tabIndex:0,className:"h-[min(60vh,32rem)] min-h-32 overflow-auto",style:{overflowAnchor:"none"},onScroll:B=>{y({offset:Math.max(0,Math.floor(B.currentTarget.scrollTop/Zf)-8),search:p,filter:l})},children:k.matched===0?S.jsx("p",{className:"text-textMuted px-4 py-12 text-center text-sm",children:"No matching log messages."}):S.jsx("ol",{"aria-label":"Received logs",className:"relative",style:{height:k.matched*Zf},children:k.logs.map((B,D)=>S.jsx(LA,{log:B,index:k.offset+D,total:k.matched,onSelect:E},B.id))})})]}),S.jsxs("div",{className:"flex items-center justify-between gap-3 text-xs",children:[S.jsx("p",{className:"text-textMuted",children:"Select a row to read its full message."}),!u&&S.jsx("button",{type:"button",className:"text-accent hover:underline",onClick:()=>{A.current&&(A.current.scrollTop=0),y({offset:0,search:p,filter:l})},children:"Jump to latest"})]}),N&&S.jsx(HA,{log:N,onClose:()=>{E(null)}})]})}const LA=se.memo(function({log:i,index:a,total:l,onSelect:u}){return S.jsx("li",{"aria-setsize":l,"aria-posinset":a+1,className:"border-accentSecondary/20 absolute inset-x-0 border-b",style:{top:a*Zf,height:Zf},children:S.jsxs("button",{type:"button",onClick:()=>{u(i)},className:"hover:bg-accentSecondary/10 focus-visible:bg-accentSecondary/20 grid h-full w-full grid-cols-[5.5rem_4.5rem_minmax(0,1fr)] items-center gap-2 px-4 text-left text-xs sm:grid-cols-[7.5rem_7.5rem_minmax(0,1fr)]",children:[S.jsx("time",{dateTime:Bp(i.time),className:"text-textMuted font-mono tabular-nums",children:eo(i.time,!1)}),S.jsx("span",{className:`w-fit rounded px-2 py-0.5 font-medium ${Lb[i.level]??Lb[8]}`,children:F1(i.level).name}),S.jsx("span",{className:"text-textPrimary min-w-0 truncate font-mono",children:i.message.replaceAll(` +`," ↵ ")})]})})});function HA({log:n,onClose:i}){const a=se.useRef(null);return se.useEffect(()=>{const l=a.current;return l?.showModal(),()=>{l?.close()}},[]),S.jsxs("dialog",{ref:a,onClose:i,"aria-labelledby":"log-detail-title",className:"border-accent/30 bg-surface/95 text-textPrimary fixed inset-0 m-auto max-h-[80vh] w-[min(60rem,90vw)] rounded-2xl border p-5 shadow-xl backdrop:bg-black/60",children:[S.jsxs("header",{className:"mb-4 flex items-center justify-between gap-4",children:[S.jsxs("h3",{id:"log-detail-title",className:"text-accent text-lg font-semibold",children:[F1(n.level).label," · ",Bp(n.time)??"Invalid time"]}),S.jsx("button",{type:"button",onClick:i,className:"text-accent rounded px-3 py-2",children:"Close"})]}),S.jsx("pre",{className:"text-sm break-words whitespace-pre-wrap",children:n.message})]})}const J1=Lr({address:Pl(),filter:Pl(),turbo:Pl(),witness:Pl(),retarget:Pl(),difficult:Pl(),pruned:vr().int().nonnegative()}),X1=Lr({height:vr().int().nonnegative(),timestamp:vr().int().positive().max(4294967295)}),pf=vr().int().nonnegative().max(Number.MAX_SAFE_INTEGER),W1=Lr({count:pf,virtual:pf,fee:pf,histogram:Ff(nA([vr().nonnegative(),pf]))}),eS="/v1/fees?format=json",tS=5e3,ku=15e3,nS=vr().int().nonnegative();function BA(n){try{const i=JSON.parse(n),a=J1.safeParse(i);if(a.success)return{type:"configuration",payload:a.data};const l=X1.safeParse(i);if(l.success)return{type:"header",payload:l.data};const u=W1.safeParse(i);if(u.success)return{type:"fees",payload:u.data};const f=nS.safeParse(i);return f.success?{type:"top",payload:f.data}:null}catch{return null}}function zf(n,i){return new URL(i,`${n.replace(/\/+$/u,"")}/`).toString()}async function Ef(n,i){const a=await fetch(n,{headers:{Accept:"application/json"},signal:i});if(!a.ok)throw new Error(`Native API request failed with status ${String(a.status)}`);return await a.json()}async function qA(n,i){const[a,l]=await Promise.all([Ef(zf(n,"/v1/configuration?format=json"),i),Ef(zf(n,"/v1/top?format=json"),i)]),u=J1.parse(a),f=nS.parse(l),d=Date.now();let m=null;try{const p=X1.parse(await Ef(zf(n,iS(f)),i));p.height===f&&(m=p)}catch{i?.throwIfAborted()}return{configuration:u,top:f,topHeader:m,receivedAt:d}}function iS(n){return`/v1/block/height/${String(n)}/header?format=json`}async function VA(n,i){return{data:W1.parse(await Ef(zf(n,eS),i)),receivedAt:Date.now()}}const Zm=["line","area","bar"],Hb=["line","step","area"],IA=["line","step","area"],rS={"occurrence-count":{id:"occurrence-count",label:"Occurrences per bucket",description:"Number of frames observed in each one-second bucket.",unit:"occurrences",chartTypes:Zm},"occurrence-rate":{id:"occurrence-rate",label:"Occurrence rate",description:"Frames observed per second.",unit:"occurrences-per-second",chartTypes:Zm},"cumulative-occurrences":{id:"cumulative-occurrences",label:"Cumulative occurrences",description:"Running number of frames observed during this browser session.",unit:"occurrences",chartTypes:Hb},"payload-latest":{id:"payload-latest",label:"Latest value",description:"Most recently observed payload value.",unit:"count",chartTypes:IA},"payload-average":{id:"payload-average",label:"Average value",description:"Average payload value within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-minimum":{id:"payload-minimum",label:"Minimum value",description:"Minimum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-maximum":{id:"payload-maximum",label:"Maximum value",description:"Maximum payload value within each one-second bucket.",unit:"count",chartTypes:["line","step"]},"payload-sum":{id:"payload-sum",label:"Value per bucket",description:"Sum of count payloads within each one-second bucket.",unit:"count",chartTypes:["line","area","bar"]},"payload-cumulative":{id:"payload-cumulative",label:"Cumulative value",description:"Running sum of count payloads during this browser session.",unit:"count",chartTypes:Hb},"payload-change-rate":{id:"payload-change-rate",label:"Height change rate",description:"Change in the latest observed height per second.",unit:"height-per-second",chartTypes:Zm}},Fa=["occurrence-rate","occurrence-count","cumulative-occurrences"],KA=["payload-latest","payload-maximum","payload-change-rate",...Fa],GA=["payload-average","payload-latest","payload-minimum","payload-maximum",...Fa],YA=["payload-sum","payload-cumulative","payload-latest","payload-average",...Fa],sS=["payload-latest","payload-average","payload-minimum","payload-maximum"],aS=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function mi(n){return`event:${String(n)}`}function Ks(n){return`log:${String(n)}`}const $f="native:top";function PA(n){switch(n){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function FA(n){switch(n){case"height":return KA;case"du)DELIM" +R"DELIM(ration":return GA;case"count":return YA;case"fee-rate":return[...sS,...Fa];default:return Fa}}function QA(n){switch(n){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function lS(n){const i=ho(n),a=PA(i.valueKind);return{id:mi(n),source:"event",sourceId:n,name:i.name,label:i.label,category:i.category,payloadKind:a,allowedMeasures:FA(a),defaultMeasure:QA(a),description:n===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":a==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${i.label} event with a ${a} payload.`}}const JA=[...aS.map(n=>({id:n.id,source:"pool",sourceId:n.field,name:n.field,label:n.label,category:"pool",payloadKind:n.payloadKind,allowedMeasures:sS,defaultMeasure:"payload-latest",description:n.description})),...Df.map(n=>lS(n.id)),...Zu.map(n=>({id:Ks(n.id),source:"log",sourceId:n.id,name:n.name,label:`${n.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:Fa,defaultMeasure:"occurrence-rate",description:`${n.label} log message volume. Message text is not interpreted as numeric data.`})),{id:$f,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}],qp=JA,XA=new Map(qp.map(n=>[n.id,n]));function os(n){const i=XA.get(n);if(i)return i;const a=/^event:(\d+)$/u.exec(n);return a?lS(Number(a[1])):{id:n,source:"event",sourceId:-1,name:n,label:n,category:"unknown",payloadKind:"unknown",allowedMeasures:Fa,defaultMeasure:"occurrence-rate",description:"Unknown signal; only occurrence measurements are available."}}function Ys(n,i){const a=rS[i];if(i.startsWith("occurrence")||i==="cumulative-occurrences")return a;const l=i==="payload-change-rate"?"height-per-second":n.payloadKind==="height"?"height":n.payloadKind==="duration"?"milliseconds":n.payloadKind==="fee-rate"?"sat-per-vbyte":n.payloadKind==="transactions"||n.payloadKind==="vbytes"||n.payloadKind==="satoshis"?n.payloadKind:"count";return{...a,unit:l}}function WA(n,i){return n.allowedMeasures.includes(i)}function e3(n,i){return ho(n).valueKind==="fee-rate"?i/1e3:AA(n,i)??i}const t3=3600*1e3,n3=1e3,i3=1e3,r3=1e3;class Bb{constructor(i){this.capacity=i,this.#e=Array.from({length:i})}capacity;#e;#t=0;#n=0;#i=null;get size(){return this.#n}push(i){const a=this.#n===this.capacity;return this.#i=null,this.#e[this.#t]=i,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity),a}clear(){this.#i=null,this.#e.fill(void 0),this.#t=0,this.#n=0}newestFirst(){if(this.#i)return this.#i;const i=[];for(let a=0;athis.#C;getRecentLogs=()=>this.#i.newestFirst();getRecentEvents=()=>this.#a.newestFirst();subscribe=i=>(this.#n.add(i),()=>{this.#n.delete(i)});start(){this.#N||(this.tick(),this.#N=setInterval(()=>{this.tick()},1e3))}stop(){this.#N&&(clearInterval(this.#N),this.#N=null),this.#v&&(clearTimeout(this.#v),this.#v=null)}ingest(i,a=this.#e()){const l=this.#M(a);this.#h+=1,TA(i)?this.#A(i,l):OA(i)?this.#U(i,l):NA(i)&&(this.#z+=1),this.#T()}recordInvalidFrame(){this.#w+=1,this.#T()}recordNativeTop(i,a=this.#e()){const l=this.#M(a),u=this.#p[$f];u?.value===i&&l-u.time<15e3||(this.#k($f,l,i),this.#D(l),this.#T())}recordNativeFees(i,a=this.#e()){if(!Number.isFinite(a)||a=ku||this.#E!==null&&a<=this.#E.receivedAt)return;const l=this.#M(a);this.#E={data:i,receivedAt:a};for(const u of aS)this.#k(u.id,l,i[u.field]);this.#D(l),this.#T()}clearLogs(){this.#y+=this.#i.size,this.#i.clear(),this.flush()}clearEvents(){this.#a.clear(),this.flush()}reset(){this.#i.clear(),this.#a.clear(),this.#r.clear(),this.#l={},this.#s={},this.#u={},this.#o={},this.#m={},this.#p={},this.#c={},this.#f=this.#M(this.#e()),this.#h=0,this.#b=0,this.#S=0,this.#y=0,this.#x=0,this.#z=0,this.#w=0,this.#_=null,this.#j=null,this.#E=null,this.#O=0,this.#g(this.#f),this.flush()}tick(){const i=this.#M(this.#e());this.#g(i),this.#D(i),this.#T()}flush(){this.#v&&(clearTimeout(this.#v),this.#v=null),this.#C=this.#R();for(const i of this.#n)i()}#A(i,a){this.#b+=1,this.#_=a,this.#O+=1,this.#i.push({...i,id:this.#O,receivedAt:a})&&(this.#S+=1),this.#k(Ks(i.level),a,null)}#U(i,a){this.#x+=1,this.#j=a,this.#O+=1,this.#a.push({...i,id:this.#O,receivedAt:a}),this.#k(mi(i.event),a,e3(i.event,i.value))}#M(i){return Number.isFinite(i)?(this.#d=Math.max(this.#d,i),this.#d):this.#d}#k(i,a,l){const u=this.#g(a);u.snapshot=null;const f=u.signals.get(i)??s3();if(f.count+=1,gf(this.#o,i,1),l!==null){f.samples+=1,f.sum+=l,f.minimum=f.minimum===null?l:Math.min(f.minimum,l),f.maximum=f.maximum===null?l:Math.max(f.maximum,l),(f.firstAt===null||a=f.lastAt)&&(f.last=l,f.lastAt=a),gf(this.#m,i,l);const d=this.#p[i];(!d||a>=d.time)&&(this.#p[i]={value:l,time:a}),this.#c[i]=Math.max(this.#c[i]??l,l)}u.signals.set(i,f)}#g(i){const a=Math.floor(i/1e3)*1e3,l=this.#r.get(a);if(l)return l;const u={time:a,signals:new Map,snapshot:null};return this.#r.set(a,u),u}#D(i){const a=i-t3;for(const[l,u]of this.#r){if(l>=a)break;for(const[f,d]of u.signals)if(gf(this.#l,f,d.count),gf(this.#s,f,d.sum),d.last!==null&&d.lastAt!==null){const m=this.#u[f];(!m||d.lastAt>=m.time)&&(this.#u[f]={value:d.last,time:d.lastAt})}this.#r.delete(l)}}#T(){!this.#t||this.#v||(this.#v=setTimeout(()=>{this.#v=null,this.flush()},n3))}#R(){const i=[...this.#r.values()].map(a=>(a.snapshot??={time:a.time,signals:Object.fromEntries([...a.signals].map(([l,u])=>[l,{...u}]))},a.snapshot));return{now:this.#M(this.#e()),sessionStartedAt:this.#f,totalFrames:this.#h,totalLogs:this.#b,evictedLogs:this.#S,clearedLogs:this.#y,totalEvents:this.#x,totalAcks:this.#z,invalidFrames:this.#w,buckets:i,priorSignalCounts:{...this.#l},priorSignalSums:{...this.#s},priorSignalLatest:qb(this.#u),signalTotals:{...this.#o},signalSums:{...this.#m},signalLatest:qb(this.#p),signalMaximums:{...this.#c},recentLogs:this.#i.newestFirst(),recentEvents:this.#a.newestFirst(),lastLogAt:this.#_,lastEventAt:this.#j,poolSnapshot:this.#E}}}function a3(n,i,a,l,u=n[0]?.time??a){const f=a-l*1e3,d=f<=u,m=d?Math.floor(u/1e3)*1e3:Math.ceil(f/1e3)*1e3,p=d?u:m,g=Math.floor(a/1e3)*1e3,y=n.filter(N=>N.time>=m&&N.time<=g).reduce((N,E)=>N+(E.signals[i]?.count??0),0),w=Math.max(0,(a-p)/1e3);return w>0?y/w:0}function l3(n,i){const a=d=>a3(n.buckets,mi(d),n.now,i,n.sessionStartedAt),l=a(2)+a(14);if(l>0)return{label:"Reorganizing",rate:l};const f=[{label:"Confirming blocks",rate:a(6)},{label:"Validating blocks",rate:a(5)},{label:"Archiving blocks",rate:a(3)},{label:"Synchronizing headers",rate:Math.max(a(0),a(1))}].reduce((d,m)=>m.rate>d.rate?m:d);return f.rate>0?f:{label:"Idle",rate:0}}const Jf=18,o3=600*1e3;function u3(n,i,a){if(n===null||!Number.isSafeInteger(n)||n<0||i===null||!Number.isSafeInteger(i.height)||i.height<0||i.height>n||!Number.isFinite(i.timestamp)||i.timestamp<=0||!Number.isFinite(a)||a<0)return null;const l=Math.max(0,a-i.timestamp*1e3),u=Math.max(n,i.height+Math.ceil(l/o3));return{blocksRemaining:u-n,estimatedTop:)DELIM" +R"DELIM(u,progress:u===0?100:n/u*100}}const c3={idle:"border-slate-500/50 bg-slate-500/20 text-slate-300",connecting:"border-amber-500/50 bg-amber-500/20 text-amber-300",connected:"border-emerald-500/50 bg-emerald-500/20 text-emerald-300",reconnecting:"border-amber-500/50 bg-amber-500/20 text-amber-300"},f3={idle:"bg-slate-400",connecting:"bg-amber-400",connected:"bg-emerald-400",reconnecting:"bg-amber-400"};function d3({phase:n,label:i}){return S.jsxs("span",{className:`inline-flex items-center gap-2 rounded-full border px-2 py-1 text-xs font-medium tracking-wide uppercase ${c3[n]}`,children:[S.jsx("span",{className:`h-2 w-2 rounded-full ${f3[n]}`,"aria-hidden":"true"}),i]})}function vf({label:n,value:i,detail:a,numeric:l=!0,emphasized:u=!1}){return S.jsxs("div",{className:"border-accent/30 bg-surface/80 min-w-0 space-y-2 rounded-2xl border p-5",children:[S.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),S.jsx("dd",{className:`text-2xl font-semibold break-words ${l?"tabular-nums":""} ${u?"text-accent":"text-textPrimary"}`,children:i}),S.jsx("dd",{className:"text-textMuted text-sm break-words",children:a})]})}function h3({confirmed:n,estimate:i}){if(n===null||i===null||i.blocksRemaining<=Jf)return null;const a=Math.min(99.99,Math.max(0,i.progress)),l=`${a.toFixed(2)}%`;return S.jsxs("section",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border","aria-labelledby":"node-sync-progress-title",children:[S.jsxs("header",{className:"flex flex-wrap items-end justify-between gap-3 px-5 pt-5",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Node synchronization"}),S.jsx("h2",{id:"node-sync-progress-title",className:"text-accent mt-1 text-lg font-semibold",children:"Catching up to estimated chain tip"})]}),S.jsx("p",{className:"text-accent text-2xl font-semibold tabular-nums",children:l})]}),S.jsx("div",{className:"px-5 pt-4",children:S.jsx("div",{role:"progressbar","aria-label":"Node synchronization progress","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Number(a.toFixed(2)),"aria-valuetext":`Approximately ${hn(i.blocksRemaining)} blocks remaining`,className:"bg-background border-accentSecondary/20 h-3 overflow-hidden rounded-full border",children:S.jsx("div",{className:"bg-accent h-full rounded-full transition-[width] duration-700",style:{width:`${String(a)}%`}})})}),S.jsxs("dl",{className:"bg-accentSecondary/10 mt-5 grid gap-px text-sm sm:grid-cols-3",children:[S.jsx($m,{label:"Confirmed top",value:hn(n)}),S.jsx($m,{label:"Estimated chain tip",value:hn(i.estimatedTop)}),S.jsx($m,{label:"Estimated blocks remaining",value:hn(i.blocksRemaining)})]}),S.jsx("p",{className:"bg-surface text-textMuted border-accentSecondary/20 border-t px-5 py-2 text-[11px]",children:"Estimated from the confirmed block timestamp and your browser clock, assuming one block every 10 minutes. Actual block counts may differ."})]})}function $m({label:n,value:i}){return S.jsxs("div",{className:"bg-surface px-5 py-3",children:[S.jsx("dt",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),S.jsx("dd",{className:"text-textPrimary mt-1 text-lg font-semibold tabular-nums",children:i})]})}const Jl=16,tp=8,Xf=80,m3=[300,900,3600],np=["line","step","area","bar"],oS=["linear","compressed"],$t=["#ffa022","#38bdf8","#34d399","#c084fc","#fb7185","#e879f9","#facc15","#60a5fa"],p3=Cu(["occurrence-count","occurrence-rate","cumulative-occurrences","payload-latest","payload-average","payload-minimum","payload-maximum","payload-sum","payload-cumulative","payload-change-rate"]),g3=Lr({id:Zr().min(1).max(100),signalId:Zr().min(1).max(100),measure:p3,color:Zr().regex(/^#[\da-f]{6}$/iu),label:Zr().max(80).optional()}).strict(),v3=Lr({id:Zr().min(1).max(100),title:Zr().trim().min(1).max(Xf),visualization:Cu(np),scale:Cu(oS).default("linear"),range:Qf([Ou(300),Ou(900),Ou(3600)]),series:Ff(g3).min(1).max(tp)}).strict(),y3=Lr({id:Zr().min(1).max(100),title:Zr().trim().min(1).max(Xf),visualization:Ou("histogram"),scale:Cu(oS).default("linear"),color:Zr().regex(/^#[\da-f]{6}$/iu)}).strict(),uS=Qf([v3,y3]),b3=Lr({version:Ou(1),charts:Ff(uS).max(Jl)}).strict();function an(n){return n.visualization!=="histogram"}const Vp={id:"default-sync-pipeline",title:"Sync pipeline",visualization:"line",scale:"linear",range:900,series:[zn("sync-header",mi(0),"occurrence-rate",$t[3]),zn("sync-archive",mi(3),"occurrence-rate",$t[0]),zn("sync-validate",mi(5),"occurrence-rate",$t[1]),zn("sync-confirm",mi(6),"occurrence-rate",$t[2])]},cS={id:"default-chain-progress",title:"Chain progress",visualization:"step",scale:"linear",range:900,series:[zn("progress-top",$f,"payload-latest",$t[0]),zn("progress-organized",mi(13),"payload-latest",$t[2]),zn("progress-confirmed",mi(6),"payload-latest",$t[1])]},fS={id:"default-log-volume",title:"Log volume",visualization:"bar",scale:"linear",range:900,series:[zn("logs-news",Ks(1),"occurrence-rate",$t[2]),zn("logs-session",Ks(2),"occurrence-rate",$t[3]),zn("logs-protocol",Ks(3),"occurrence-rate",$t[1]),zn("logs-remote",Ks(5),"occurrence-rate",$t[7]),zn("logs-fault",Ks(6),"occurrence-rate",$t[4]),zn("logs-quitting",Ks(7),"occurrence-rate",$t[0])]},Wf={id:"default-pool-transactions",title:"Pool transactions",visualization:"step",scale:"linear",range:900,series:[zn("pool-count","pool:count","payload-latest",$t[0])]},dS={...Wf,id:"default-pool-fees",title:"Pool total fees",series:[zn("pool-fees","pool:total_fee","payload-latest",$t[3])]},hS={...Wf,id:"default-pool-virtual-size",title:"Pool virtual size",series:[zn("pool-size","pool:vsize","payload-latest",$t[1])]},Ib={id:"default-transaction-archive-rate",title:"Transactions archived / second",visualization:"line",scale:"linear",range:900,series:[zn("tx-archived",mi(10),"occurrence-rate",$t[2])]},mS={id:"default-pool-fee-histogram",title:"Pool fee distribution",visualization:"histogram",scale:"linear",color:$t[0]},pS=[{id:"pool-fee-histogram",label:"Pool fee distribution",description:"Current pool virtual size grouped by fee rate.",chart:mS},{id:"sync-pipeline",label:"Sync pipeline",description:"Header and block lifecycle throughput.",chart:Vp},{id:"chain-progress",label:"Chain progress",description:"Canonical, organized, and confirmed heights.",chart:cS},{id:"log-volume",label:"Log volume",description:"Message rates grouped by log level.",chart:fS},{id:"pool-transactions",label:"Pool transactions",description:"Current pool transaction count, sampled every five seconds.",chart:Wf},{id:"transaction-archive-rate",label:"Transaction archive rate",description:"Newly archived transactions per second, including compact-block recovery.",chart:Ib},{id:"pool-virtual-size",label:"Pool virtual size",description:"Current pool virtual size in vbytes.",chart:hS},{id:"pool-fees",label:"Pool total fees",description:"Total fees currently in the pool, in satoshis.",chart:dS},{id:"transaction-fee-rate",label:"Archived transaction fee rate",description:"Average fee rate of newly archived transactions, in sat/vB.",chart:{...Ib,id:"template-tx-fees",title:"Archived transaction fee rate",series:[zn("tx-fee-rate",mi(10),"payload-average",$t[0])]}}],gS="libbitcoinAdminDashboardCharts";let Kb=0;function zn(n,i,a,l){return{id:n,signalId:i,measure:a,color:l}}function Nu(n){return Kb+=1,`${n}-${Date.now().toString(36)}-${String(Kb)}`}function Ip(n,i=!1){return an(n)?{...n,id:i?Nu("chart"):n.id,series:n.series.map(a=>({...a,id:i?Nu("series"):a.id}))}:{...n,id:i?Nu("chart"):n.id}}function Tf(){return[Vp,cS,fS,Wf,dS,hS,mS].map(n=>Ip(n))}function _3(n){const i=pS.find(a=>a.id===n);return Ip(i?.chart??Vp,!0)}function vS(){return{id:Nu("chart"),title:"Custom chart",visualization:"line",scale:"linear",range:900,series:[{id:Nu("series"),signalId:mi(3),measure:"occurrence-rate",color:$t[0]}]}}function S3(n){const i=" copy",a=`${n.title.slice(0,Xf-i.length).trimEnd()}${i}`;return{...Ip(n,!0),title:a}}function ip(n){if(!an(n))return"vb)DELIM" +R"DELIM(ytes";const i=new Set(n.series.map(a=>Ys(os(a.signalId),a.measure).unit));return i.size===1?[...i][0]??null:null}function yS(n){const i=uS.safeParse(n);if(!i.success)return i.error.issues[0]?.message??"Invalid chart configuration";if(!an(n))return null;for(const a of n.series){const l=os(a.signalId);if(!WA(l,a.measure))return`${rS[a.measure].label} is not valid for ${l.label}.`;const u=Ys(l,a.measure);if(!u.chartTypes.includes(n.visualization))return`${u.label} cannot be displayed as a ${n.visualization} chart.`}return ip(n)===null?"All series on a chart must use compatible units.":null}function bS(n){const i=b3.safeParse(n);return!i.success||new Set(i.data.charts.map(a=>a.id)).size!==i.data.charts.length||i.data.charts.some(a=>an(a)&&new Set(a.series.map(l=>l.id)).size!==a.series.length)?null:i.data.charts.every(a=>yS(a)===null)?i.data.charts:null}function _S(){try{return globalThis.window?.localStorage??null}catch{return null}}function x3(n=_S()){try{const i=n?.getItem(gS);return i?bS(JSON.parse(i))??Tf():Tf()}catch{return Tf()}}function w3(n,i=_S()){try{const a={version:1,charts:n};if(!bS(a))return;i?.setItem(gS,JSON.stringify(a))}catch{}}function Kp(n,i){return n.signals[i]}function Gb(n,i,a,l){let u=l==="count"?n.priorSignalCounts[i]??0:n.priorSignalSums[i]??0;for(const f of n.buckets){if(f.time>=a)break;const d=Kp(f,i);u+=l==="count"?d?.count??0:d?.sum??0}return u}function z3(n,i,a){let l=n.priorSignalLatest[i]??null;for(const u of n.buckets){if(u.time>=a)break;const f=Kp(u,i);f?.last!==null&&f?.last!==void 0&&f.lastAt!==null&&(l={value:f.last,time:f.lastAt})}return l}function E3(n,i){const a=i<=n.sessionStartedAt?Math.floor(n.sessionStartedAt/1e3)*1e3:Math.ceil(i/1e3)*1e3,l=Math.floor(n.now/1e3)*1e3,u=new Map(n.buckets.map(d=>[d.time,d])),f=[];for(let d=a;d<=l;d+=1e3)f.push(u.get(d)??{time:d,signals:{}});return f}function T3(n,i,a){const l=Math.max(n.time,a),u=Math.min(i,n.time+1e3);return Math.max(0,(u-l)/1e3)}function O3(n,i,a,l){const u=os(l.signalId);let f=l.measure==="cumulative-occurrences"?Gb(n,l.signalId,a,"count"):l.measure==="payload-cumulative"?Gb(n,l.signalId,a,"sum"):0,d=z3(n,l.signalId,a);return i.map(m=>{const p=Kp(m,l.signalId);switch(l.measure){case"occurrence-count":return p?.count??0;case"occurrence-rate":{const g=T3(m,n.now,n.sessionStartedAt);return g>0?(p?.count??0)/g:0}case"cumulative-occurrences":return f+=p?.count??0,f;case"payload-sum":return p&&p.samples>0?p.sum:null;case"payload-cumulative":return f+=p?.sum??0,f;case"payload-average":return p&&p.samples>0?p.sum/p.samples:null;case"payload-minimum":return p?.minimum??null;case"payload-maximum":return p?.maximum??null;case"payload-latest":{if(p?.last!==null&&p?.last!==void 0&&p.lastAt!==null)return d={value:p.last,time:p.lastAt},p.last;if(u.source==="pool"){const g=Math.min(m.time+1e3,n.now);return d&&g-d.time0?(p.last-g.value)/x:null}}})}function N3(n,i){const a=n.now-i.range*1e3,l=E3(n,a),u=l[0]?.time??Math.floor(n.now/1e3)*1e3,f=i.series[0],d=Ys(os(f.signalId),f.measure).unit,m=i.series.filter(p=>(n.signalTotals[p.signalId]??0)===0).map(p=>p.label??os(p.signalId).label);return{data:[l.map(p=>p.time/1e3),...i.series.map(p=>O3(n,l,u,p))],unit:d,hasObservedData:m.length{const a=()=>{i(Date.now())},l=setInterval(a,1e3);return window.addEventListener("focus",a),document.addEventListener("visibilitychange",a),()=>{clearInterval(l),window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",a)}},[]),n}const j3={300:"5 minutes",900:"15 minutes",3600:"1 hour"},R3={line:"Line",step:"Step",area:"Area",bar:"Bar"};function C3(n){return an(n)?{...n,series:n.series.map(i=>({...i}))}:{...n}}function k3(){const n=new Map;for(const i of qp){const a=n.get(i.category)??[];a.push(i),n.set(i.category,a)}return[...n]}const D3=k3();function U3({chart:n,mode:i,onCancel:a,onSave:l}){const[u,f]=se.useState(()=>C3(n)),d=yS(u),m=ip(u);se.useEffect(()=>{function E(A){A.key==="Escape"&&a()}return globalThis.addEventListener("keydown",E),()=>{globalThis.removeEventListener("keydown",E)}},[a]);const p=se.useMemo(()=>new Set(np.filter(E=>an(u)&&u.series.every(A=>Ys(os(A.signalId),A.measure).chartTypes.includes(E)))),[u]);function g(E){f(A=>an(A)?E(A):A)}function x(E,A){g(k=>({...k,series:k.series.map((B,D)=>D===E?A:B)}))}function y(E,A){if(!an(u))return;const k=u.series[E],B=os(A);x(E,{...k,signalId:A,measure:B.defaultMeasure})}function w(){if(!an(u)||u.series.length>=tp)return;const E=ip(u),A=qp.find(D=>D.allowedMeasures.some(ie=>E===null||Ys(D,ie).unit===E));if(!A)return;const k=A.allowedMeasures.find(D=>E===null||Ys(A,D).unit===E)??A.defaultMeasure,B={id:`series-${Date.now().toString(36)}-${String(u.series.length+1)}`,signalId:A.id,measure:k,color:$t[u.series.length%$t.length]??$t[0]};g(D=>({...D,series:[...D.series,B]}))}function N(E){E.preventDefault(),!d&&l({...u,title:u.title.trim()})}return S.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"presentation",onMouseDown:E=>{E.target===E.currentTarget&&a()},children:S.jsxs("section",{role:"dialog","aria-modal":"true","aria-labelledby":"chart-editor-title",className:"border-accent/30 bg-surface/95 max-h-[92vh] w-full max-w-4xl overflow-y-auto rounded-2xl border shadow-2xl shadow-black/60",children:[S.jsxs("header",{className:"border-accent/20 flex items-start justify-between border-b p-5",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Dashboard builder"}),S.jsx("h2",{id:"chart-editor-title",className:"text-accent mt-1 text-xl font-semibold",children:i==="add"?"Add chart":"Edit chart"})]}),S.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded p-1 text-xl","aria-label":"Close chart editor",children:"×"})]}),i==="add"&&S.jsxs("div",{className:"border-accentSecondary/20 border-b p-5",children:[S.jsx("p",{className:"text-accentSecondary mb-3 text-xs tracking-wide uppercase",children:"Start from a template"}),S.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-5",children:[pS.map(E=>S.jsxs("button",{type:"button",onClick:()=>{f(_3(E.id))},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[S.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:E.label}),S.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:E.description})]},E.id)),S.jsxs("button",{type:"button",onClick:()=>{f(vS())},className:"border-accent/30 bg-background hover:border-accent rounded-md border p-3 text-left",children:[S.jsx("span",{className:"text-textPrimary block text-sm font-medium",children:"Custom"}),S.jsx("span",{className:"text-textMuted mt-1 block text-xs leading-4",children:"Begin with one editable series."})]})]})]}),S.jsxs("form",{onSubmit:N,c)DELIM" +R"DELIM(lassName:"space-y-6 p-5",children:[S.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_11rem_11rem]",children:[S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Chart title"}),S.jsx("input",{value:u.title,maxLength:Xf,onChange:E=>{f(A=>({...A,title:E.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0"})]}),an(u)?S.jsxs(S.Fragment,{children:[S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Chart type"}),S.jsx("select",{value:u.visualization,onChange:E=>{g(A=>({...A,visualization:E.target.value}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:np.map(E=>S.jsx("option",{value:E,disabled:!p.has(E),children:R3[E]},E))})]}),S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Time range"}),S.jsx("select",{value:u.range,onChange:E=>{g(A=>({...A,range:Number(E.target.value)}))},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-3 py-2 text-sm focus:ring-0",children:m3.map(E=>S.jsx("option",{value:E,children:j3[E]},E))})]})]}):S.jsxs("label",{className:"space-y-2",children:[S.jsx("span",{className:"text-sm font-medium",children:"Bar color"}),S.jsx("input",{type:"color",value:u.color,onChange:E=>{const A=E.target.value;f(k=>an(k)?k:{...k,color:A})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]})]}),an(u)?S.jsxs("section",{className:"space-y-3",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[S.jsxs("div",{children:[S.jsx("h3",{className:"text-accent text-lg font-semibold",children:"Series"}),S.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:["One chart uses one axis unit",m===null?".":`: ${SS(m)}.`]})]}),S.jsx("button",{type:"button",onClick:w,disabled:u.series.length>=tp,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary disabled:text-textMuted rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-50",children:"Add series"})]}),S.jsx("div",{className:"space-y-3",children:u.series.map((E,A)=>{const k=os(E.signalId),B=Ys(k,E.measure);return S.jsxs("article",{className:"border-accentSecondary/20 bg-accent/5 grid gap-3 rounded-xl border p-4 lg:grid-cols-[minmax(12rem,1.2fr)_minmax(11rem,1fr)_minmax(9rem,0.8fr)_3.5rem_auto]",children:[S.jsxs("label",{className:"space-y-1.5",children:[S.jsxs("span",{className:"text-textMuted text-xs",children:["Signal ",String(A+1)]}),S.jsx("select",{"aria-label":`Signal ${String(A+1)}`,value:E.signalId,onChange:D=>{y(A,D.target.value)},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",children:D3.map(([D,ie])=>S.jsx("optgroup",{label:D,children:ie.map(K=>S.jsx("option",{value:K.id,children:K.label},K.id))},D))})]}),S.jsxs("label",{className:"space-y-1.5",children:[S.jsx("span",{className:"text-textMuted text-xs",children:"Measurement"}),S.jsx("select",{"aria-label":`Measurement ${String(A+1)}`,value:E.measure,onChange:D=>{x(A,{...E,measure:D.target.value})},className:"border-accent/40 bg-background text-textPrimary focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0",title:B.description,children:k.allowedMeasures.map(D=>S.jsx("option",{value:D,children:Ys(k,D).label},D))})]}),S.jsxs("label",{className:"space-y-1.5",children:[S.jsx("span",{className:"text-textMuted text-xs",children:"Display label"}),S.jsx("input",{"aria-label":`Display label ${String(A+1)}`,value:E.label??"",onChange:D=>{x(A,{...E,label:D.target.value||void 0})},placeholder:k.label,className:"border-accent/40 bg-background text-textPrimary placeholder:text-textMuted/50 focus:border-accent w-full rounded-md border px-2 py-2 text-sm focus:ring-0"})]}),S.jsxs("label",{className:"space-y-1.5",children:[S.jsx("span",{className:"text-textMuted text-xs",children:"Color"}),S.jsx("input",{"aria-label":`Series color ${String(A+1)}`,type:"color",value:E.color,onChange:D=>{x(A,{...E,color:D.target.value})},className:"border-accent/40 bg-background h-10 w-full rounded-md border p-1"})]}),S.jsx("button",{type:"button",onClick:()=>{g(D=>({...D,series:D.series.filter((ie,K)=>K!==A)}))},disabled:u.series.length===1,"aria-label":`Remove series ${String(A+1)}`,className:"text-textMuted self-end rounded-md px-3 py-2 text-sm hover:text-red-300 disabled:cursor-not-allowed disabled:opacity-30",children:"Remove"})]},E.id)})})]}):S.jsx("p",{className:"text-textMuted text-sm",children:"Shows the latest transaction-pool fee distribution, refreshed every five seconds. Each bar shows the virtual size of one fee-rate group, labeled by its minimum fee rate in sat/vB."}),d&&S.jsx("p",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-200",children:d}),S.jsxs("div",{className:"border-accentSecondary/20 flex justify-end gap-2 border-t pt-4",children:[S.jsx("button",{type:"button",onClick:a,className:"text-textMuted hover:text-accent rounded-md px-4 py-2 text-sm",children:"Cancel"}),S.jsx("button",{type:"submit",disabled:d!==null,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:i==="add"?"Add chart":"Save changes"})]})]})]})})}const Z3=!0,pn="u-",$3="uplot",L3=pn+"hz",H3=pn+"vt",B3=pn+"title",q3=pn+"wrap",V3=pn+"under",I3=pn+"over",K3=pn+"axis",Va=pn+"off",G3=pn+"select",Y3=pn+"cursor-x",P3=pn+"cursor-y",F3=pn+"cursor-pt",Q3=pn+"legend",J3=pn+"live",X3=pn+"inline",W3=pn+"series",eM=pn+"marker",Yb=pn+"label",tM=pn+"value",xu="width",wu="height",vu="top",Pb="bottom",Fl="left",Lm="right",Gp="#000",Fb=Gp+"0",Hm="mousemove",Qb="mousedown",Bm="mouseup",Jb="mouseenter",Xb="mouseleave",Wb="dblclick",nM="resize",iM="scroll",e_="change",Lf="dppxchange",Yp="--",mo=typeof window<"u",rp=mo?document:null,to=mo?window:null,rM=mo?navigator:null;let rt,yf;function sp(){let n=devicePixelRatio;rt!=n&&(rt=n,yf&&lp(e_,yf,sp),yf=matchMedia(`(min-resolution: ${rt-.001}dppx) and (max-resolution: ${rt+.001}dppx)`),Ya(e_,yf,sp),to.dispatchEvent(new CustomEvent(Lf)))}function ji(n,i){if(i!=null){let a=n.classList;!a.contains(i)&&a.add(i)}}function ap(n,i){let a=n.classList;a.contains(i)&&a.remove(i)}function Tt(n,i,a){n.style[i]=a+"px"}function fr(n,i,a,l){let u=rp.createElement(n);return i!=null&&ji(u,i),a?.insertBefore(u,l),u}function Yi(n,i){return fr("div",n,i)}const t_=new WeakMap;function Ur(n,i,a,l,u){let f="translate("+i+"px,"+a+"px)",d=t_.get(n);f!=d&&(n.style.transform=f,t_.set(n,f),i<0||a<0||i>l||a>u?ji(n,Va):ap(n,Va))}const n_=new WeakMap;function i_(n,i,a){let l=i+a,u=n_.get(n);l!=u&&(n_.set(n,l),n.style.background=i,n.style.borderColor=a)}const r_=new WeakMap;function s_(n,i,a,l){let u=i+""+a,f=r_.get(n);u!=f&&(r_.set(n,u),n.style.height=a+"px",n.style.width=i+"px",n.style.marginLeft=l?-i/2+"px":0,n.style.marginTop=l?-a/2+"px":0)}const Pp={passive:!0},sM={...Pp,capture:!0};function Ya(n,i,a,l){i.addEventListener(n,a,l?sM:Pp)}function lp(n,i,a,l){i.removeEventListener(n,a,Pp)}mo&&sp();function dr(n,i,a,l){let u;a=a||0,l=l||i.length-1;let f=l<=2147483647;for(;l-a>1;)u=f?a+l>>1:Ci((a+l)/2),i[u]{let f=-1,d=-1;for(let m=l;m<=u;m++)if(n(a[m])){f=m;break}for(let m=u;m>=l;m--)if(n(a[m])){d=m;break}return[f,d]}}const zS=n=>n!=null,ES=n=>n!=null&&n>0,ed=wS(zS),aM=wS(ES);function lM(n,i,a,l=0,u=!1){let f=u?aM:ed,d=u?ES:zS;[i,a]=f(n,i,a);let m=n[i],p=n[i];if(i>-1)if(l==1)m=n[i],p=n[a];else if(l==-1)m=n[a],p=n[i];else for(let g=i;g<=a;g++){let x=n[g];d(x)&&(xp&&(p=x))}ret)DELIM" +R"DELIM(urn[m??_t,p??-_t]}function td(n,i,a,l){let u=o_(n),f=o_(i);n==i&&(u==-1?(n*=a,i/=a):(n/=a,i*=a));let d=a==10?us:TS,m=u==1?Ci:Pi,p=f==1?Pi:Ci,g=m(d(dn(n))),x=p(d(dn(i))),y=so(a,g),w=so(a,x);return a==10&&(g<0&&(y=St(y,-g)),x<0&&(w=St(w,-x))),l||a==2?(n=y*u,i=w*f):(n=MS(n,y),i=nd(i,w)),[n,i]}function Fp(n,i,a,l){let u=td(n,i,a,l);return n==0&&(u[0]=0),i==0&&(u[1]=0),u}const Qp=.1,a_={mode:3,pad:Qp},Au={pad:0,soft:null,mode:0},oM={min:Au,max:Au};function Hf(n,i,a,l){return id(a)?l_(n,i,a):(Au.pad=a,Au.soft=l?0:null,Au.mode=l?3:0,l_(n,i,oM))}function et(n,i){return n??i}function uM(n,i,a){for(i=et(i,0),a=et(a,n.length-1);i<=a;){if(n[i]!=null)return!0;i++}return!1}function l_(n,i,a){let l=a.min,u=a.max,f=et(l.pad,0),d=et(u.pad,0),m=et(l.hard,-_t),p=et(u.hard,_t),g=et(l.soft,_t),x=et(u.soft,-_t),y=et(l.mode,0),w=et(u.mode,0),N=i-n,E=us(N),A=ni(dn(n),dn(i)),k=us(A),B=dn(k-E);(N<1e-24||B>10)&&(N=0,(n==0||i==0)&&(N=1e-24,y==2&&g!=_t&&(f=0),w==2&&x!=-_t&&(d=0)));let D=N||A||1e3,ie=us(D),K=so(10,Ci(ie)),G=D*(N==0?n==0?.1:1:f),F=St(MS(n-G,K/10),24),te=n>=g&&(y==1||y==3&&F<=g||y==2&&F>=g)?g:_t,V=ni(m,F=te?te:hr(te,F)),ye=D*(N==0?i==0?.1:1:d),de=St(nd(i+ye,K/10),24),ne=i<=x&&(w==1||w==3&&de>=x||w==2&&de<=x)?x:-_t,xe=hr(p,de>ne&&i<=ne?ne:ni(ne,de));return V==xe&&V==0&&(xe=100),[V,xe]}const cM=new Intl.NumberFormat(mo?rM.language:"en-US"),Jp=n=>cM.format(n),ki=Math,Of=ki.PI,dn=ki.abs,Ci=ki.floor,fn=ki.round,Pi=ki.ceil,hr=ki.min,ni=ki.max,so=ki.pow,o_=ki.sign,us=ki.log10,TS=ki.log2,fM=(n,i=1)=>ki.sinh(n)*i,qm=(n,i=1)=>ki.asinh(n/i),_t=1/0;function u_(n){return(us((n^n>>31)-(n>>31))|0)+1}function op(n,i,a){return hr(ni(n,i),a)}function OS(n){return typeof n=="function"}function Qe(n){return OS(n)?n:()=>n}const dM=()=>{},NS=n=>n,AS=(n,i)=>i,hM=n=>null,c_=n=>!0,f_=(n,i)=>n==i,mM=/\.\d*?(?=9{6,}|0{6,})/gm,Qa=n=>{if(RS(n)||Qs.has(n))return n;const i=`${n}`,a=i.match(mM);if(a==null)return n;let l=a[0].length-1;if(i.indexOf("e-")!=-1){let[u,f]=i.split("e");return+`${Qa(u)}e${f}`}return St(n,l)};function Ba(n,i){return Qa(St(Qa(n/i))*i)}function nd(n,i){return Qa(Pi(Qa(n/i))*i)}function MS(n,i){return Qa(Ci(Qa(n/i))*i)}function St(n,i=0){if(RS(n))return n;let a=10**i,l=n*a*(1+Number.EPSILON);return fn(l)/a}const Qs=new Map;function jS(n){return((""+n).split(".")[1]||"").length}function Du(n,i,a,l){let u=[],f=l.map(jS);for(let d=i;d=0?0:m)+(d>=f[g]?0:f[g]),w=n==10?x:St(x,y);u.push(w),Qs.set(w,y)}}return u}const Mu={},Xp=[],ao=[null,null],Gs=Array.isArray,RS=Number.isInteger,pM=n=>n===void 0;function d_(n){return typeof n=="string"}function id(n){let i=!1;if(n!=null){let a=n.constructor;i=a==null||a==Object}return i}function gM(n){return n!=null&&typeof n=="object"}const vM=Object.getPrototypeOf(Uint8Array),CS="__proto__";function lo(n,i=id){let a;if(Gs(n)){let l=n.find(u=>u!=null);if(Gs(l)||i(l)){a=Array(n.length);for(let u=0;uf){for(u=d-1;u>=0&&n[u]==null;)n[u--]=null;for(u=d+1;ud-m)],u=l[0].length,f=new Map;for(let d=0;d"u"?n=>Promise.resolve().then(n):queueMicrotask;function zM(n){let i=n[0],a=i.length,l=Array(a);for(let f=0;fi[f]-i[d]);let u=[];for(let f=0;f=l&&n[u]==null;)u--;if(u<=l)return!0;const f=ni(1,Ci((u-l+1)/i));for(let d=n[l],m=l+f;m<=u;m+=f){const p=n[m];if(p!=null){if(p<=d)return!1;d=p}}return!0}const kS=["January","February","March","April","May","June","July","August","September","October","November","December"],DS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function US(n){return n.slice(0,3)}const OM=DS.map(US),NM=kS.map(US),AM={MMMM:kS,MMM:NM,WWWW:DS,WWW:OM};function yu(n){return(n<10?"0":"")+n}function MM(n){return(n<10?"00":n<100?"0":"")+n}const jM={YYYY:n=>n.getFullYear(),YY:n=>(n.getFullYear()+"").slice(2),MMMM:(n,i)=>i.MMMM[n.getMonth()],MMM:(n,i)=>i.MMM[n.getMonth()],MM:n=>yu(n.getMonth()+1),M:n=>n.getMonth()+1,DD:n=>yu(n.getDate()),D:n=>n.getDate(),WWWW:(n,i)=>i.WWWW[n.getDay()],WWW:(n,i)=>i.WWW[n.getDay()],HH:n=>yu(n.getHours()),H:n=>n.getHours(),h:n=>{let i=n.getHours();return i==0?12:i>12?i-12:i},AA:n=>n.getHours()>=12?"PM":"AM",aa:n=>n.getHours()>=12?"pm":"am",a:n=>n.getHours()>=12?"p":"a",mm:n=>yu(n.getMinutes()),m:n=>n.getMinutes(),ss:n=>yu(n.getSeconds()),s:n=>n.getSeconds(),fff:n=>MM(n.getMilliseconds())};function Wp(n,i){i=i||AM;let a=[],l=/\{([a-z]+)\}|[^{]+/gi,u;for(;u=l.exec(n);)a.push(u[0][0]=="{"?jM[u[1]]:u[0]);return f=>{let d="";for(let m=0;mn%1==0,Bf=[1,2,2.5,5],kM=Du(10,-32,0,Bf),$S=Du(10,0,32,Bf),DM=$S.filter(ZS),qa=kM.concat($S),eg=` +`,LS="{YYYY}",h_=eg+LS,HS="{M}/{D}",zu=eg+HS,bf=zu+"/{YY}",BS="{aa}",UM="{h}:{mm}",Xl=UM+BS,m_=eg+Xl,p_=":{ss}",lt=null;function qS(n){let i=n*1e3,a=i*60,l=a*60,u=l*24,f=u*30,d=u*365,p=(n==1?Du(10,0,3,Bf).filter(ZS):Du(10,-3,0,Bf)).concat([i,i*5,i*10,i*15,i*30,a,a*5,a*10,a*15,a*30,l,l*2,l*3,l*4,l*6,l*8,l*12,u,u*2,u*3,u*4,u*5,u*6,u*7,u*8,u*9,u*10,u*15,f,f*2,f*3,f*4,f*6,d,d*2,d*5,d*10,d*25,d*50,d*100]);const g=[[d,LS,lt,lt,lt,lt,lt,lt,1],[u*28,"{MMM}",h_,lt,lt,lt,lt,lt,1],[u,HS,h_,lt,lt,lt,lt,lt,1],[l,"{h}"+BS,bf,lt,zu,lt,lt,lt,1],[a,Xl,bf,lt,zu,lt,lt,lt,1],[i,p_,bf+" "+Xl,lt,zu+" "+Xl,lt,m_,lt,1],[n,p_+".{fff}",bf+" "+Xl,lt,zu+" "+Xl,lt,m_,lt,1]];function x(y){return(w,N,E,A,k,B)=>{let D=[],ie=k>=d,K=k>=f&&k=u?u:k,de=Ci(E)-Ci(F),ne=V+de+nd(F-V,ye);D.push(ne);let xe=y(ne),ge=xe.getHours()+xe.getMinutes()/a+xe.getSeconds()/l,Ae=k/l,ce=w.axes[N]._space,X=B/ce;for(;ne=St(ne+k,n==1?0:3),!(ne>A);)if(Ae>1){let W=Ci(St(ge+Ae,6))%24,Se=y(ne).getHours()-W;Se>1&&(Se=-1),ne-=Se*l,ge=(ge+Ae)%24;let Be=D[D.length-1];St((ne-Be)/k,3)*X>=.7&&D.push(ne)}else D.push(ne)}return D}}return[p,g,x]}const[ZM,$M,LM]=qS(1),[HM,BM,qM]=qS(.001);Du(2,-53,53,[1]);function g_(n,i){return n.map(a=>a.map((l,u)=>u==0||u==8||l==null?l:i(u==1||a[8]==0?l:a[1]+l)))}function v_(n,i){return(a,l,u,f,d)=>{let m=i.find(E=>d>=E[0])||i[i.l)DELIM" +R"DELIM(ength-1],p,g,x,y,w,N;return l.map(E=>{let A=n(E),k=A.getFullYear(),B=A.getMonth(),D=A.getDate(),ie=A.getHours(),K=A.getMinutes(),G=A.getSeconds(),F=k!=p&&m[2]||B!=g&&m[3]||D!=x&&m[4]||ie!=y&&m[5]||K!=w&&m[6]||G!=N&&m[7]||m[1];return p=k,g=B,x=D,y=ie,w=K,N=G,F(A)})}}function VM(n,i){let a=Wp(i);return(l,u,f,d,m)=>u.map(p=>a(n(p)))}function Vm(n,i,a){return new Date(n,i,a)}function y_(n,i){return i(n)}const IM="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function b_(n,i){return(a,l,u,f)=>f==null?Yp:i(n(l))}function KM(n,i){let a=n.series[i];return a.width?a.stroke(n,i):a.points.width?a.points.stroke(n,i):null}function GM(n,i){return n.series[i].fill(n,i)}const YM={show:!0,live:!0,isolate:!1,mount:dM,markers:{show:!0,width:2,stroke:KM,fill:GM,dash:"solid"},idx:null,idxs:null,values:[]};function PM(n,i){let a=n.cursor.points,l=Yi(),u=a.size(n,i);Tt(l,xu,u),Tt(l,wu,u);let f=u/-2;Tt(l,"marginLeft",f),Tt(l,"marginTop",f);let d=a.width(n,i,u);return d&&Tt(l,"borderWidth",d),l}function FM(n,i){let a=n.series[i].points;return a._fill||a._stroke}function QM(n,i){let a=n.series[i].points;return a._stroke||a._fill}function JM(n,i){return n.series[i].points.size}const Im=[0,0];function XM(n,i,a){return Im[0]=i,Im[1]=a,Im}function _f(n,i,a,l=!0){return u=>{u.button==0&&(!l||u.target==i)&&a(u)}}function Km(n,i,a,l=!0){return u=>{(!l||u.target==i)&&a(u)}}const WM={show:!0,x:!0,y:!0,lock:!1,move:XM,points:{one:!1,show:PM,size:JM,width:0,stroke:QM,fill:FM},bind:{mousedown:_f,mouseup:_f,click:_f,dblclick:_f,mousemove:Km,mouseleave:Km,mouseenter:Km},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(n,i)=>{i.stopPropagation(),i.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(n,i,a,l,u)=>l-u,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},VS={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},tg=sn({},VS,{filter:AS}),IS=sn({},tg,{size:10}),KS=sn({},VS,{show:!1}),ng='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',GS="bold "+ng,YS=1.5,__={show:!0,scale:"x",stroke:Gp,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:GS,side:2,grid:tg,ticks:IS,border:KS,font:ng,lineGap:YS,rotate:0},e4="Value",t4="Time",S_={show:!0,scale:"x",auto:!1,sorted:1,min:_t,max:-_t,idxs:[]};function n4(n,i,a,l,u){return i.map(f=>f==null?"":Jp(f))}function i4(n,i,a,l,u,f,d){let m=[],p=Qs.get(u)||0;a=d?a:St(nd(a,u),p);for(let g=a;g<=l;g=St(g+u,p))m.push(Object.is(g,-0)?0:g);return m}function up(n,i,a,l,u,f,d){const m=[],p=n.scales[n.axes[i].scale].log,g=p==10?us:TS,x=Ci(g(a));u=so(p,x),p==10&&(u=qa[dr(u,qa)]);let y=a,w=u*p;p==10&&(w=qa[dr(w,qa)]);do m.push(y),y=y+u,p==10&&!Qs.has(y)&&(y=St(y,Qs.get(u))),y>=w&&(u=y,w=u*p,p==10&&(w=qa[dr(w,qa)]));while(y<=l);return m}function r4(n,i,a,l,u,f,d){let p=n.scales[n.axes[i].scale].asinh,g=l>p?up(n,i,ni(p,a),l,u):[p],x=l>=0&&a<=0?[0]:[];return(a<-p?up(n,i,ni(p,-l),-a,u):[p]).reverse().map(w=>-w).concat(x,g)}const PS=/./,s4=/[12357]/,a4=/[125]/,x_=/1/,cp=(n,i,a,l)=>n.map((u,f)=>i==4&&u==0||f%l==0&&a.test(u.toExponential()[u<0?1:0])?u:null);function l4(n,i,a,l,u){let f=n.axes[a],d=f.scale,m=n.scales[d],p=n.valToPos,g=f._space,x=p(10,d),y=p(9,d)-x>=g?PS:p(7,d)-x>=g?s4:p(5,d)-x>=g?a4:x_;if(y==x_){let w=dn(p(1,d)-x);if(wu,E_={show:!0,auto:!0,sorted:0,gaps:FS,alpha:1,facets:[sn({},z_,{scale:"x"}),sn({},z_,{scale:"y"})]},T_={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:FS,alpha:1,points:{show:f4,filter:null},values:null,min:_t,max:-_t,idxs:[],path:null,clip:null};function d4(n,i,a,l,u){return a/10}const QS={time:Z3,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},h4=sn({},QS,{time:!1,ori:1}),O_={};function JS(n,i){let a=O_[n];return a||(a={key:n,plots:[],sub(l){a.plots.push(l)},unsub(l){a.plots=a.plots.filter(u=>u!=l)},pub(l,u,f,d,m,p,g){for(let x=0;x{let B=d.pxRound;const D=g.dir*(g.ori==0?1:-1),ie=g.ori==0?po:go;let K,G;D==1?(K=a,G=l):(K=l,G=a);let F=B(y(m[K],g,A,N)),te=B(w(p[K],x,k,E)),V=B(y(m[G],g,A,N)),ye=B(w(f==1?x.max:x.min,x,k,E)),de=new Path2D(u);return ie(de,V,ye),ie(de,F,ye),ie(de,F,te),de})}function rd(n,i,a,l,u,f){let d=null;if(n.length>0){d=new Path2D;const m=i==0?ld:sg;let p=a;for(let y=0;yw[0]){let N=w[0]-p;N>0&&m(d,p,l,N,l+f),p=w[1]}}let g=a+u-p,x=10;g>0&&m(d,p,l-x/2,g,l+f+x)}return d}function p4(n,i,a){let l=n[n.length-1];l&&l[0]==i?l[1]=a:n.push([i,a])}function rg(n,i,a,l,u,f,d){let m=[],p=n.length;for(let g=u==1?a:l;g>=a&&g<=l;g+=u)if(i[g]===null){let y=g,w=g;if(u==1)for(;++g<=l&&i[g]===null;)w=g;else for(;--g>=a&&i[g]===null;)w=g;let N=f(n[y]),E=w==y?N:f(n[w]),A=y-u;N=d<=0&&A>=0&&A=0&&B>=0&&B=N&&m.push([N,E])}return m}function N_(n){return n==0?NS:n==1?fn:i=>Ba(i,n)}function XS(n){let i=n==0?sd:ad,a=n==0?(u,f,d,m,p,g)=>{u.arcTo(f,d,m,p,g)}:(u,f,d,m,p,g)=>{u.arcTo(d,f,p,m,g)},l=n==0?(u,f,d,m,p)=>{u.rect(f,d,m,p)}:(u,f,d,m,p)=>{u.rect(d,f,p,m)};return(u,f,d,m,p,g=0,x=0)=>{g==0&&x==0?l(u,f,d,m,p):(g=hr(g,m/2,p/2),x=hr(x,m/2,p/2),i(u,f+g,d),a(u,f+m,d,f+m,d+p,g),a(u,f+m,d+p,f,d+p,x),a(u,f,d+p,f,d,x),a(u,f,d,f+m,d,g),u.closePath())}}const sd=(n,i,a)=>{n.moveTo(i,a)},ad=(n,i,a)=>{n.moveTo(a,i)},po=(n,i,a)=>{n.lineTo(i,a)},go=(n,i,a)=>{n.lineTo(a,i)},ld=XS(0),sg=XS(1),WS=(n,i,a,l,u,f)=>{n.arc(i,a,l,u,f)},ex=(n,i,a,l,u,f)=>{n.arc(a,i,l,u,f)},tx=(n,i,a,l,u,f,d)=>{n.bezierCurveTo(i,a,l,u,f,d)},nx=(n,i,a,l,u,f,d)=>{n.bezierCurveTo(a,i,u,l,d,f)};function ix(n){return(i,a,l,u,f)=>Xa(i,a,(d,m,p,g,x,y,w,N,E,A,k)=>{let{pxRound:B,points:D}=d,ie,K;g.ori==0?(ie=sd,K=WS):(ie=ad,K=ex);const G=St(D.width*rt,3);let F=(D.size-D.width)/2*rt,te=St(F*2,3),V=new Path2D,ye=new Path2D,{left:de,top:ne,width:xe,height:ge}=i.bbox;ld(ye,de-te,ne-te,xe+te*2,ge+te*2);const Ae=ce=>{if(p[ce]!=null){let X=B(y(m[ce],g,A,N)),W=B(w(p[ce],x,k,E));ie(V,X+F,W),K(V,X,W,F,0,Of*2)}};if(f)f.forEach(Ae);else for(let ce=l;ce<=u;ce++)Ae(ce);return{stroke:G>0?V:null,fill:V,clip:ye,flags:oo|fp}})}function rx(n){return(i,a,l,u,f,d)=>{l!=u&&(f!=l&&d!=l&&n(i,a,l),f!=u&&d!=u&&n(i,a,u),n(i,a,d))}}const g4=rx(po),v4=rx(go);function sx(n){const i=et(n?.alignGaps,0);return(a,l,u,f)=>Xa(a,l,(d,m,p,g,x,y,w,N,E,A,k)=>{[u,f]=ed(p,u,f);let B=d.pxRound,D=ge=>B(y(ge,g,A,N)),ie=ge=>B(w(ge,x,k,E)),K,G;g.o)DELIM" +R"DELIM(ri==0?(K=po,G=g4):(K=go,G=v4);const F=g.dir*(g.ori==0?1:-1),te={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:oo},V=te.stroke;let ye=!1;if(f-u>=A*4){let ge=be=>a.posToVal(be,g.key,!0),Ae=null,ce=null,X,W,we,Me=D(m[F==1?u:f]),Se=D(m[u]),Be=D(m[f]),Ce=ge(F==1?Se+1:Be-1);for(let be=F==1?u:f;be>=u&&be<=f;be+=F){let M=m[be],le=(F==1?MCe)?Me:D(M),ae=p[be];le==Me?ae!=null?(W=ae,Ae==null?(K(V,le,ie(W)),X=Ae=ce=W):Wce&&(ce=W)):ae===null&&(ye=!0):(Ae!=null&&G(V,Me,ie(Ae),ie(ce),ie(X),ie(W)),ae!=null?(W=ae,K(V,le,ie(W)),Ae=ce=X=W):(Ae=ce=null,ae===null&&(ye=!0)),Me=le,Ce=ge(Me+F))}Ae!=null&&Ae!=ce&&we!=Me&&G(V,Me,ie(Ae),ie(ce),ie(X),ie(W))}else for(let ge=F==1?u:f;ge>=u&&ge<=f;ge+=F){let Ae=p[ge];Ae===null?ye=!0:Ae!=null&&K(V,D(m[ge]),ie(Ae))}let[ne,xe]=ig(a,l);if(d.fill!=null||ne!=0){let ge=te.fill=new Path2D(V),Ae=d.fillTo(a,l,d.min,d.max,ne),ce=ie(Ae),X=D(m[u]),W=D(m[f]);F==-1&&([W,X]=[X,W]),K(ge,W,ce),K(ge,X,ce)}if(!d.spanGaps){let ge=[];ye&&ge.push(...rg(m,p,u,f,F,D,i)),te.gaps=ge=d.gaps(a,l,u,f,ge),te.clip=rd(ge,g.ori,N,E,A,k)}return xe!=0&&(te.band=xe==2?[cs(a,l,u,f,V,-1),cs(a,l,u,f,V,1)]:cs(a,l,u,f,V,xe)),te})}function y4(n){const i=et(n.align,1),a=et(n.ascDesc,!1),l=et(n.alignGaps,0),u=et(n.extend,!1);return(f,d,m,p)=>Xa(f,d,(g,x,y,w,N,E,A,k,B,D,ie)=>{[m,p]=ed(y,m,p);let K=g.pxRound,{left:G,width:F}=f.bbox,te=Se=>K(E(Se,w,D,k)),V=Se=>K(A(Se,N,ie,B)),ye=w.ori==0?po:go;const de={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:oo},ne=de.stroke,xe=w.dir*(w.ori==0?1:-1);let ge=V(y[xe==1?m:p]),Ae=te(x[xe==1?m:p]),ce=Ae,X=Ae;u&&i==-1&&(X=G,ye(ne,X,ge)),ye(ne,Ae,ge);for(let Se=xe==1?m:p;Se>=m&&Se<=p;Se+=xe){let Be=y[Se];if(Be==null)continue;let Ce=te(x[Se]),be=V(Be);i==1?ye(ne,Ce,ge):ye(ne,ce,be),ye(ne,Ce,be),ge=be,ce=Ce}let W=ce;u&&i==1&&(W=G+F,ye(ne,W,ge));let[we,Me]=ig(f,d);if(g.fill!=null||we!=0){let Se=de.fill=new Path2D(ne),Be=g.fillTo(f,d,g.min,g.max,we),Ce=V(Be);ye(Se,W,Ce),ye(Se,X,Ce)}if(!g.spanGaps){let Se=[];Se.push(...rg(x,y,m,p,xe,te,l));let Be=g.width*rt/2,Ce=a||i==1?Be:-Be,be=a||i==-1?-Be:Be;Se.forEach(M=>{M[0]+=Ce,M[1]+=be}),de.gaps=Se=g.gaps(f,d,m,p,Se),de.clip=rd(Se,w.ori,k,B,D,ie)}return Me!=0&&(de.band=Me==2?[cs(f,d,m,p,ne,-1),cs(f,d,m,p,ne,1)]:cs(f,d,m,p,ne,Me)),de})}function A_(n,i,a,l,u,f,d=_t){if(n.length>1){let m=null;for(let p=0,g=1/0;p{}),{fill:y,stroke:w}=g;return(N,E,A,k)=>Xa(N,E,(B,D,ie,K,G,F,te,V,ye,de,ne)=>{let xe=B.pxRound,ge=a,Ae=l*rt,ce=m*rt,X=p*rt,W,we;K.ori==0?[W,we]=f(N,E):[we,W]=f(N,E);const Me=K.dir*(K.ori==0?1:-1);let Se=K.ori==0?ld:sg,Be=K.ori==0?x:(he,nt,Dt,Hr,Dn,ri,Qi)=>{x(he,nt,Dt,Dn,Hr,Qi,ri)},Ce=et(N.bands,Xp).find(he=>he.series[0]==E),be=Ce!=null?Ce.dir:0,M=B.fillTo(N,E,B.min,B.max,be),J=xe(te(M,G,ne,ye)),le,ae,$e,Ue=de,Ne=xe(B.width*rt),me=!1,Te=null,Bt=null,Di=null,gi=null;y!=null&&(Ne==0||w!=null)&&(me=!0,Te=y.values(N,E,A,k),Bt=new Map,new Set(Te).forEach(he=>{he!=null&&Bt.set(he,new Path2D)}),Ne>0&&(Di=w.values(N,E,A,k),gi=new Map,new Set(Di).forEach(he=>{he!=null&&gi.set(he,new Path2D)})));let{x0:En,size:kt}=g;if(En!=null&&kt!=null){ge=1,D=En.values(N,E,A,k),En.unit==2&&(D=D.map(Dt=>N.posToVal(V+Dt*de,K.key,!0)));let he=kt.values(N,E,A,k);kt.unit==2?ae=he[0]*de:ae=F(he[0],K,de,V)-F(0,K,de,V),Ue=A_(D,ie,F,K,de,V,Ue),$e=Ue-ae+Ae}else Ue=A_(D,ie,F,K,de,V,Ue),$e=Ue*d+Ae,ae=Ue-$e;$e<1&&($e=0),Ne>=ae/2&&(Ne=0),$e<5&&(xe=NS);let tt=$e>0,gn=Ue-$e-(tt?Ne:0);ae=xe(op(gn,X,ce)),le=(ge==0?ae/2:ge==Me?0:ae)-ge*Me*((ge==0?Ae/2:0)+(tt?Ne/2:0));const Gt={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},qn=me?null:new Path2D;let ii=null;if(Ce!=null)ii=N.data[Ce.series[1]];else{let{y0:he,y1:nt}=g;he!=null&&nt!=null&&(ie=nt.values(N,E,A,k),ii=he.values(N,E,A,k))}let Ui=W*ae,ke=we*ae;for(let he=Me==1?A:k;he>=A&&he<=k;he+=Me){let nt=ie[he];if(nt==null)continue;if(ii!=null){let vn=ii[he]??0;if(nt-vn==0)continue;J=te(vn,G,ne,ye)}let Dt=K.distr!=2||g!=null?D[he]:he,Hr=F(Dt,K,de,V),Dn=te(et(nt,M),G,ne,ye),ri=xe(Hr-le),Qi=xe(ni(Dn,J)),Vn=xe(hr(Dn,J)),In=Qi-Vn;if(nt!=null){let vn=nt<0?ke:Ui,Kn=nt<0?Ui:ke;me?(Ne>0&&Di[he]!=null&&Se(gi.get(Di[he]),ri,Vn+Ci(Ne/2),ae,ni(0,In-Ne),vn,Kn),Te[he]!=null&&Se(Bt.get(Te[he]),ri,Vn+Ci(Ne/2),ae,ni(0,In-Ne),vn,Kn)):Se(qn,ri,Vn+Ci(Ne/2),ae,ni(0,In-Ne),vn,Kn),Be(N,E,he,ri-Ne/2,Vn,ae+Ne,In)}}return Ne>0?Gt.stroke=me?gi:qn:me||(Gt._fill=B.width==0?B._fill:B._stroke??B._fill,Gt.width=0),Gt.fill=me?Bt:qn,Gt})}function _4(n,i){const a=et(i?.alignGaps,0);return(l,u,f,d)=>Xa(l,u,(m,p,g,x,y,w,N,E,A,k,B)=>{[f,d]=ed(g,f,d);let D=m.pxRound,ie=W=>D(w(W,x,k,E)),K=W=>D(N(W,y,B,A)),G,F,te;x.ori==0?(G=sd,te=po,F=tx):(G=ad,te=go,F=nx);const V=x.dir*(x.ori==0?1:-1);let ye=ie(p[V==1?f:d]),de=ye,ne=[],xe=[];for(let W=V==1?f:d;W>=f&&W<=d;W+=V)if(g[W]!=null){let Me=p[W],Se=ie(Me);ne.push(de=Se),xe.push(K(g[W]))}const ge={stroke:n(ne,xe,G,te,F,D),fill:null,clip:null,band:null,gaps:null,flags:oo},Ae=ge.stroke;let[ce,X]=ig(l,u);if(m.fill!=null||ce!=0){let W=ge.fill=new Path2D(Ae),we=m.fillTo(l,u,m.min,m.max,ce),Me=K(we);te(W,de,Me),te(W,ye,Me)}if(!m.spanGaps){let W=[];W.push(...rg(p,g,f,d,V,ie,a)),ge.gaps=W=m.gaps(l,u,f,d,W),ge.clip=rd(W,x.ori,E,A,k,B)}return X!=0&&(ge.band=X==2?[cs(l,u,f,d,Ae,-1),cs(l,u,f,d,Ae,1)]:cs(l,u,f,d,Ae,X)),ge})}function S4(n){return _4(x4,n)}function x4(n,i,a,l,u,f){const d=n.length;if(d<2)return null;const m=new Path2D;if(a(m,n[0],i[0]),d==2)l(m,n[1],i[1]);else{let p=Array(d),g=Array(d-1),x=Array(d-1),y=Array(d-1);for(let w=0;w0!=g[w]>0?p[w]=0:(p[w]=3*(y[w-1]+y[w])/((2*y[w]+y[w-1])/g[w-1]+(y[w]+2*y[w-1])/g[w]),isFinite(p[w])||(p[w]=0));p[d-1]=g[d-2];for(let w=0;w{ln.pxRatio=rt}));const w4=sx(),z4=ix();function j_(n,i,a,l){return(l?[n[0],n[1]].concat(n.slice(2)):[n[0]].concat(n.slice(1))).map((f,d)=>hp(f,d,i,a))}function E4(n,i){return n.map((a,l)=>l==0?{}:sn({},i,a))}function hp(n,i,a,l){return sn({},i==0?a:l,n)}function ax(n,i,a){return i==null?ao:[i,a]}const T4=ax;function O4(n,i,a){return i==null?ao:Hf(i,a,Qp,!0)}function lx(n,i,a,l){return i==null?ao:td(i,a,n.scales[l].log,!1)}const N4=lx;function ox(n,i,a,l){return i==null?ao:Fp(i,a,n.scales[l].log,!1)}const A4=ox;function M4(n,i,a,l,u){let f=ni(u_(n),u_(i)),d=i-n,m=dr(u/l*d,a);do{let p=a[m],g=l*p/d;if(g>=u&&f+(p<5?Qs.get(p):0)<=17)return[p,g]}while(++m(i=fn((a=+u)*rt))+"px"),[n,i,a]}function j4(n){n.show&&[n.font,n.labelFont].forEach(i=>{let a=St(i[2]*rt,1);i[0]=i[0].replace(/[0-9.]+px/,a+"px"),i[1]=a})}function ln(n,i,a){const l={mode:et(n.mode,1)},u=l.mode;function f(v,_,z,T){let R=_.valToPct(v);return T+z*(_.dir==-1?1-R:R)}function d(v,_,z,T){let R=_.valToPct(v);return T+z*(_.dir==-1?R:1-R)}function m(v,_,z,T){return _.ori==0?f(v,_,z,T):d(v,_,z,T)}l.valToPosH=f,l.valToPosV=d;let p=!1;l.status=0;const g=l.root=Yi($3);if(n.id!=null&&(g.id=n.id),ji(g,n.class),n.title){let v=Yi(B3,g);v.textContent=n.title}const x=fr("canvas"),y=l.ctx=x.getContext("2d"),w=Yi(q3,g);Ya("click",w,v=>{v.target===E&&(vt!=ys||xt!=Pr)&&ht.click(l,v)},!0);const N=l.under=Yi(V3,w);w.appendChild(x);const E=l.over=Yi(I3,w);n=lo(n);const A=+et(n.pxAlign,1),k=N_(A);(n.plugins||[]).forEach(v=>{v.opts&&(n=v.opts(l,n)||n)});const B=n.ms||.001,D=l.series=u==1?j_(n.series||[],S_,T_,!1):E4(n.series||[null],E_),ie=l.axes=j_(n.axes||[],__,w_,!0),K=l.scales={},G=l.bands=n.bands||[];G)DELIM" +R"DELIM(.forEach(v=>{v.fill=Qe(v.fill||null),v.dir=et(v.dir,-1)});const F=u==2?D[1].facets[0].scale:D[0].scale,te={axes:ol,series:Hu},V=(n.drawOrder||["axes","series"]).map(v=>te[v]);function ye(v){const _=v.distr==3?z=>us(z>0?z:v.clamp(l,z,v.min,v.max,v.key)):v.distr==4?z=>qm(z,v.asinh):v.distr==100?z=>v.fwd(z):z=>z;return z=>{let T=_(z),{_min:R,_max:L}=v,Y=L-R;return(T-R)/Y}}function de(v){let _=K[v];if(_==null){let z=(n.scales||Mu)[v]||Mu;if(z.from!=null){de(z.from);let T=sn({},K[z.from],z,{key:v});T.valToPct=ye(T),K[v]=T}else{_=K[v]=sn({},v==F?QS:h4,z),_.key=v;let T=_.time,R=_.range,L=Gs(R);if((v!=F||u==2&&!T)&&(L&&(R[0]==null||R[1]==null)&&(R={min:R[0]==null?a_:{mode:1,hard:R[0],soft:R[0]},max:R[1]==null?a_:{mode:1,hard:R[1],soft:R[1]}},L=!1),!L&&id(R))){let Y=R;R=(ee,re,ue)=>re==null?ao:Hf(re,ue,Y)}_.range=Qe(R||(T?T4:v==F?_.distr==3?N4:_.distr==4?A4:ax:_.distr==3?lx:_.distr==4?ox:O4)),_.auto=Qe(L?!1:_.auto),_.clamp=Qe(_.clamp||d4),_._min=_._max=null,_.valToPct=ye(_)}}}de("x"),de("y"),u==1&&D.forEach(v=>{de(v.scale)}),ie.forEach(v=>{de(v.scale)});for(let v in n.scales)de(v);const ne=K[F],xe=ne.distr;let ge,Ae;ne.ori==0?(ji(g,L3),ge=f,Ae=d):(ji(g,H3),ge=d,Ae=f);const ce={};for(let v in K){let _=K[v];(_.min!=null||_.max!=null)&&(ce[v]={min:_.min,max:_.max},_.min=_.max=null)}const X=n.tzDate||(v=>new Date(fn(v/B))),W=n.fmtDate||Wp,we=B==1?LM(X):qM(X),Me=v_(X,g_(B==1?$M:BM,W)),Se=b_(X,y_(IM,W)),Be=[],Ce=l.legend=sn({},YM,n.legend),be=l.cursor=sn({},WM,{drag:{y:u==2}},n.cursor),M=Ce.show,J=be.show,le=Ce.markers;Ce.idxs=Be,le.width=Qe(le.width),le.dash=Qe(le.dash),le.stroke=Qe(le.stroke),le.fill=Qe(le.fill);let ae,$e,Ue,Ne=[],me=[],Te,Bt=!1,Di={};if(Ce.live){const v=D[1]?D[1].values:null;Bt=v!=null,Te=Bt?v(l,1,0):{_:0};for(let _ in Te)Di[_]=Yp}if(M)if(ae=fr("table",Q3,g),Ue=fr("tbody",null,ae),Ce.mount(l,ae),Bt){$e=fr("thead",null,ae,Ue);let v=fr("tr",null,$e);fr("th",null,v);for(var gi in Te)fr("th",Yb,v).textContent=gi}else ji(ae,X3),Ce.live&&ji(ae,J3);const En={show:!0},kt={show:!1};function tt(v,_){if(_==0&&(Bt||!Ce.live||u==2))return ao;let z=[],T=fr("tr",W3,Ue,Ue.childNodes[_]);ji(T,v.class),v.show||ji(T,Va);let R=fr("th",null,T);if(le.show){let ee=Yi(eM,R);if(_>0){let re=le.width(l,_);re&&(ee.style.border=re+"px "+le.dash(l,_)+" "+le.stroke(l,_)),ee.style.background=le.fill(l,_)}}let L=Yi(Yb,R);v.label instanceof HTMLElement?L.appendChild(v.label):L.textContent=v.label,_>0&&(le.show||(L.style.color=v.width>0?le.stroke(l,_):le.fill(l,_)),Gt("click",R,ee=>{if(be._lock)return;Pt(ee);let re=D.indexOf(v);if((ee.ctrlKey||ee.metaKey)!=Ce.isolate){let ue=D.some((fe,pe)=>pe>0&&pe!=re&&fe.show);D.forEach((fe,pe)=>{pe>0&&Zn(pe,ue?pe==re?En:kt:En,!0,Ut.setSeries)})}else Zn(re,{show:!v.show},!0,Ut.setSeries)},!1),hs&&Gt(Jb,R,ee=>{be._lock||(Pt(ee),Zn(D.indexOf(v),tr,!0,Ut.setSeries))},!1));for(var Y in Te){let ee=fr("td",tM,T);ee.textContent="--",z.push(ee)}return[T,z]}const gn=new Map;function Gt(v,_,z,T=!0){const R=gn.get(_)||{},L=be.bind[v](l,_,z,T);L&&(Ya(v,_,R[v]=L),gn.set(_,R))}function qn(v,_,z){const T=gn.get(_)||{};for(let R in T)(v==null||R==v)&&(lp(R,_,T[R]),delete T[R]);v==null&&gn.delete(_)}let ii=0,Ui=0,ke=0,he=0,nt=0,Dt=0,Hr=nt,Dn=Dt,ri=ke,Qi=he,Vn=0,In=0,vn=0,Kn=0;l.bbox={};let Ws=!1,Wa=!1,ds=!1,Yt=!1,el=!1,Gn=!1;function tl(v,_,z){(z||v!=l.width||_!=l.height)&&ea(v,_),Un(!1),ds=!0,Wa=!0,Kr()}function ea(v,_){l.width=ii=ke=v,l.height=Ui=he=_,nt=Dt=0,cd(),ta();let z=l.bbox;Vn=z.left=Ba(nt*rt,.5),In=z.top=Ba(Dt*rt,.5),vn=z.width=Ba(ke*rt,.5),Kn=z.height=Ba(he*rt,.5)}const od=3;function Lu(){let v=!1,_=0;for(;!v;){_++;let z=Bu(_),T=ll(_);v=_==od||z&&T,v||(ea(l.width,l.height),Wa=!0)}}function ud({width:v,height:_}){tl(v,_)}l.setSize=ud;function cd(){let v=!1,_=!1,z=!1,T=!1;ie.forEach((R,L)=>{if(R.show&&R._show){let{side:Y,_size:ee}=R,re=Y%2,ue=R.label!=null?R.labelSize:0,fe=ee+ue;fe>0&&(re?(ke-=fe,Y==3?(nt+=fe,T=!0):z=!0):(he-=fe,Y==0?(Dt+=fe,v=!0):_=!0))}}),br[0]=v,br[1]=z,br[2]=_,br[3]=T,ke-=ai[1]+ai[3],nt+=ai[3],he-=ai[2]+ai[0],Dt+=ai[0]}function ta(){let v=nt+ke,_=Dt+he,z=nt,T=Dt;function R(L,Y){switch(L){case 1:return v+=Y,v-Y;case 2:return _+=Y,_-Y;case 3:return z-=Y,z+Y;case 0:return T-=Y,T+Y}}ie.forEach((L,Y)=>{if(L.show&&L._show){let ee=L.side;L._pos=R(ee,L._size),L.label!=null&&(L._lpos=R(ee,L.labelSize))}})}if(be.dataIdx==null){let v=be.hover,_=v.skip=new Set(v.skip??[]);_.add(void 0);let z=v.prox=Qe(v.prox),T=v.bias??=0;be.dataIdx=(R,L,Y,ee)=>{if(L==0)return Y;let re=Y,ue=z(R,L,Y,ee)??_t,fe=ue>=0&&ue<_t,pe=ne.ori==0?ke:he,De=be.left,Ie=i[0],Je=i[L];if(_.has(Je[Y])){re=null;let qe=null,je=null,ze;if(T==0||T==-1)for(ze=Y;qe==null&&ze-- >0;)_.has(Je[ze])||(qe=ze);if(T==0||T==1)for(ze=Y;je==null&&ze++ue&&(re=null);return re}}const Pt=v=>{be.event=v};be.idxs=Be,be._lock=!1;let Et=be.points;Et.show=Qe(Et.show),Et.size=Qe(Et.size),Et.stroke=Qe(Et.stroke),Et.width=Qe(Et.width),Et.fill=Qe(Et.fill);const Ot=l.focus=sn({},n.focus||{alpha:.3},be.focus),hs=Ot.prox>=0,ms=hs&&Et.one;let si=[],Ji=[],Xi=[];function na(v,_){let z=Et.show(l,_);if(z instanceof HTMLElement)return ji(z,F3),ji(z,v.class),Ur(z,-10,-10,ke,he),E.insertBefore(z,si[_]),z}function yr(v,_){if(u==1||_>0){let z=u==1&&K[v.scale].time,T=v.value;v.value=z?d_(T)?b_(X,y_(T,W)):T||Se:T||u4,v.label=v.label||(z?t4:e4)}if(ms||_>0){v.width=v.width==null?1:v.width,v.paths=v.paths||w4||hM,v.fillTo=Qe(v.fillTo||m4),v.pxAlign=+et(v.pxAlign,A),v.pxRound=N_(v.pxAlign),v.stroke=Qe(v.stroke||null),v.fill=Qe(v.fill||null),v._stroke=v._fill=v._paths=v._focus=null;let z=c4(ni(1,v.width),1),T=v.points=sn({},{size:z,width:ni(1,z*.2),stroke:v.stroke,space:z*2,paths:z4,_stroke:null,_fill:null},v.points);T.show=Qe(T.show),T.filter=Qe(T.filter),T.fill=Qe(T.fill),T.stroke=Qe(T.stroke),T.paths=Qe(T.paths),T.pxAlign=v.pxAlign}if(M){let z=tt(v,_);Ne.splice(_,0,z[0]),me.splice(_,0,z[1]),Ce.values.push(null)}if(J){Be.splice(_,0,null);let z=null;ms?_==0&&(z=na(v,_)):_>0&&(z=na(v,_)),si.splice(_,0,z),Ji.splice(_,0,0),Xi.splice(_,0,0)}Wt("addSeries",_)}function nl(v,_){_=_??D.length,v=u==1?hp(v,_,S_,T_):hp(v,_,{},E_),D.splice(_,0,v),yr(D[_],_)}l.addSeries=nl;function ia(v){if(D.splice(v,1),M){Ce.values.splice(v,1),me.splice(v,1);let _=Ne.splice(v,1)[0];qn(null,_.firstChild),_.remove()}J&&(Be.splice(v,1),si.splice(v,1)[0].remove(),Ji.splice(v,1),Xi.splice(v,1)),Wt("delSeries",v)}l.delSeries=ia;const br=[!1,!1,!1,!1];function fd(v,_){if(v._show=v.show,v.show){let z=v.side%2,T=K[v.scale];T==null&&(v.scale=z?D[1].scale:F,T=K[v.scale]);let R=T.time;v.size=Qe(v.size),v.space=Qe(v.space),v.rotate=Qe(v.rotate),Gs(v.incrs)&&v.incrs.forEach(Y=>{!Qs.has(Y)&&Qs.set(Y,jS(Y))}),v.incrs=Qe(v.incrs||(T.distr==2?DM:R?B==1?ZM:HM:qa)),v.splits=Qe(v.splits||(R&&T.distr==1?we:T.distr==3?up:T.distr==4?r4:i4)),v.stroke=Qe(v.stroke),v.grid.stroke=Qe(v.grid.stroke),v.ticks.stroke=Qe(v.ticks.stroke),v.border.stroke=Qe(v.border.stroke);let L=v.values;v.values=Gs(L)&&!Gs(L[0])?Qe(L):R?Gs(L)?v_(X,g_(L,W)):d_(L)?VM(X,L):L||Me:L||n4,v.filter=Qe(v.filter||(T.distr>=3&&T.log==10?l4:T.distr==3&&T.log==2?o4:AS)),v.font=R_(v.font),v.labelFont=R_(v.labelFont),v._size=v.size(l,null,_,0),v._space=v._rotate=v._incrs=v._found=v._splits=v._values=null,v._size>0&&(br[_]=!0,v._el=Yi(K3,w))}}function ps(v,_,z,T){let[R,L,Y,ee]=z,re=_%2,ue=0;return re==0&&(ee||L)&&(ue=_==0&&!R||_==2&&!Y?fn(__.size/3):0),re==1&&(R||Y)&&(ue=_==1&&!L||_==3&&!ee?fn(w_.size/2):0),ue}const il=l.padding=(n.padding||[ps,ps,ps,ps]).map(v=>Qe(et(v,ps))),ai=l._padding=il.map((v,_)=>v(l,_,br,0));let on,Ft=null,Qt=null;const ra=u==1?D[0].idxs:null;let Yn=null,Br=!1;function vo(v,_){if(i=v??[],l.data=l._data=i,u==2){on=0;for(let z=1;z=0,Gn=!0,Kr()}}l.setData=vo;function rl(){Br=!0;let v,_;u==1&&(on>0?(Ft=ra[0]=0,Qt=ra[1]=on-1,v=i[0][Ft],_=i[0][Qt],xe==2?(v=Ft,_=Qt):v==_&&(xe==3?[v,_]=td(v,v,ne.log,!1):xe==4?[v,_]=Fp(v,v,ne.log,!1):ne.time?_=v+fn(86400/B):[v,_]=Hf(v,_,Qp,!0))):(Ft=ra[0]=v=null,Qt=ra[1]=_=null)),Wi(F,v,_)}let li,Nt,yn,_r,sl,yo,bo,al,qr,un;function sa(v,_,z,T,R,L){v??=Fb,z??=Xp,T??="butt",R??=Fb,L??="round",v!=li&&(y.strokeStyle=li=v),R!=Nt&&(y.fillStyle=Nt=R),_!=yn&&(y.lineWidth=yn=_),L!=sl&&(y.lineJoin=sl=L),T!=yo&&(y.lineCap=yo=T),z!=_r&&y.setLineDash(_r=z)}function Sr(v,_,z,T){_!=Nt&&(y.fillStyle=Nt=_),v!=bo&&(y.font=bo=v),z!=al&&(y.textAlign=al=z),T!=qr&&(y.textBaseline=qr=T)}function xr(v,_,z,T,R=0){if(T.length>0&&v.auto(l,Br)&&(_==null||_.min==null)){let L=et(Ft,0),Y=et(Qt,T.length-1),ee=z.min==null?lM(T,L,Y,R,v.distr==3):[z.min,z.max];v.min=hr(v.min,z.min=ee[0]),v.max=ni(v.max,z.max=ee[1])}}const gs={min:null,max:null};function vs(){for(let T in K){let R=K[T];ce[T]==null&&(R.min==null||ce[F]!=null&&R.auto(l,Br))&&(ce[T]=gs)}for(let T in K){let R=K[T];ce[T]==null&&R.from!=null&&ce[R.from]!=null&&(ce[T]=gs)}ce[F]!=null&&Un(!0);let v={};for(let T in ce){let R=ce[T];if(R!=null){let L=v[T]=lo(K[T],gM);if(R.min!=null)sn(L,R);else if(T!=F||u==2)if(on==0&&L.from==null){let Y=L.range(l,null,null,T);L.min=Y[0],L.max=Y[1]}else L.min=_t,L.max=-_t}}if(on>0){D.forEach((T,R)=>{if(u==1){let L=T.scale,Y=ce[L];if(Y==null)return;let ee=v[L];if(R==0){let re=ee.range(l,ee.min,ee.max,L);ee.min=re[0],ee.max=re[1],Ft=dr(ee.min,i[0]),Qt=dr(ee.max,i[0]),Qt-Ft>1&&(i[0][Ft]ee.max&&Qt--),T.min=Yn[Ft],T.max=Yn[Qt]}else T.show&&T.auto&&xr(ee,Y,T,i[R],T.sorted);T.idxs[0]=Ft,T.idxs[1]=Qt}else if(R>0&&T.show&&T.auto){let[L,Y]=T.facets,ee=L.scale,re=Y.scale,[ue,fe]=i[R],pe=v[ee],De=v[re];pe!=null&&xr(pe,ce[ee],L,ue,L.sorted),De!=null&&xr(De,ce[re],Y,fe,Y.sorted),T.min=Y.min,T.max=Y.max}});for(let T in v){let R=v[T],L=ce[T];if(R.from==null&&(L==null||L.min==null)){let Y=R.range(l,R.min==_t?null:R.min,R.max==-_t?null:R.max,T);R.min=Y[0],R.max=Y[1]}}}for(let T in v){let R=v[T];if(R.from!=null){let L=v[R.from];if(L.min==null)R.min=R.max=null;else{let Y=R.range(l,L.min,L.max,T);R.min=Y[0],R.max=Y[1]}}}let _={},z=!1;for(let T in v){let R=v[T],L=K[T];if(L.min!=R.min||L.max!=R.max){L.min=R.min,L.max=R.max;let Y=L.distr;L._min=Y==3?us(L.min):Y==4?qm(L.min,L.asinh):Y==100?L.fwd(L.min):L.min,L._max=Y==3?us(L.max):Y==4?qm(L.max,L.asinh):Y==100?L.fwd(L.max):L.max,_[T]=z=!0}}if(z){D.forEach((T,R)=>{u==2?R>0&&_.y&&(T._paths=null):_[T.scale]&&(T._paths=null)});for(let T in _)ds=!0,Wt("setScale",T);J&&be.left>=0&&(Yt=Gn=!0)}for(let T in ce)ce[T]=null}function Xt(v){let _=op(Ft-1,0,on-1),z=op(Qt+1,0,on-1);for(;v[_]==null&&_>0;)_--;for(;v[z]==null&&z0){let v=D.some(_=>_._focus)&&un!=Ot.alpha;v&&(y.globalAlpha=un=Ot.alpha),D.forEach((_,z)=>{if(z>0&&_.show&&(_o(z,!1),_o(z,!0),_._paths==null)){let T=un;un!=_.alpha&&(y.globalAlpha=un=_.alpha);let R=u==2?[0,i[z][0].length-1]:Xt(i[z]);_._paths=_.paths(l,z,R[0],R[1]),un!=T&&(y.globalAlpha=un=T)}}),D.forEach((_,z)=>{if(z>0&&_.show){let T=un;un!=_.alpha&&(y.globalAlpha=un=_.alpha),_._paths!=null&&So(z,!1);{let R=_._paths!=null?_._paths.gaps:null,L=_.points.show(l,z,Ft,Qt,R),Y=_.points.filter(l,z,L,R);(L||Y)&&(_.points._paths=_.points.paths(l,z,Ft,Qt,Y),So(z,!0))}un!=T&&(y.globalAlpha=un=T),Wt("drawSeries",z)}}),v&&(y.globalAlpha=un=1)}}function _o(v,_){let z=_?D[v].points:D[v];z._stroke=z.stroke(l,v),z._fill=z.fill(l,v)}function So(v,_){let z=_?D[v].points:D[v],{stroke:T,fill:R,clip:L,flags:Y,_stroke:ee=z._stroke,_fill:re=z._fill,_width:ue=z.width}=z._paths;ue=St(ue*rt,3);let fe=null,pe=ue%2/2;_&&re==null&&(re=ue>0?"#fff":ee);let De=z.pxAlign==1&&pe>0;if(De&&y.translate(pe,pe),!_){let Ie=Vn-ue/2,Je=In-ue/2,qe=vn+ue,je=Kn+ue;fe=new Path2D,fe.rect(Ie,Je,qe,je)}_?xo(ee,ue,z.dash,z.cap,re,T,R,Y,L):Vr(v,ee,ue,z.dash,z.cap,re,T,R,Y,fe,L),De&&y.translate(-pe,-pe)}function Vr(v,_,z,T,R,L,Y,ee,re,ue,fe){let pe=!1;re!=0&&G.forEach((De,Ie)=>{if(De.series[0]==v){let Je=D[De.series[1]],qe=i[De.series[1]],je=(Je._paths||Mu).band;Gs(je)&&(je=De.dir==1?je[0]:je[1]);let ze,mt=null;Je.show&&je&&uM(qe,Ft,Qt)?(mt=De.fill(l,Ie)||L,ze=Je._paths.clip):je=null,xo(_,z,T,R,mt,Y,ee,re,ue,fe,ze,je),pe=!0}}),pe||xo(_,z,T,R,L,Y,ee,re,ue,fe)}const Ir=oo|fp;function xo(v,_,z,T,R,L,Y,ee,re,ue,fe,pe){sa(v,_,z,T,R),(re||ue||pe)&&(y.save(),re&&y.clip(re),ue&&y.clip(ue)),pe?(ee&Ir)==Ir?(y.clip(pe),fe&&y.clip(fe),la(R,Y),aa(v,L,_)):ee&fp?(la(R,Y),y.clip(pe),aa(v,L,_)):ee&oo&&(y.save(),y.clip(pe),fe&&y.clip(fe),la(R,Y),y.restore(),aa(v,L,_)):(la(R,Y),aa(v,L,_)),(re||ue||pe)&&y.restore()}function aa(v,_,z){z>0&&(_ instanceof Map?_.forEach((T,R)=>{y.strokeStyle=li=R,y.stroke(T)}):_!=null&&v&&y.stroke(_))}function la(v,_){_ instanceof Map?_.forEach((z,T)=>{y.fillStyle=Nt=T,y.fill(z)}):_!=null&&v&&y.fill(_)}function dd(v,_,z,T){let R=ie[v],L;if(T<=0)L=[0,0];else{let Y=R._space=R.space(l,v,_,z,T),ee=R._incrs=R.incrs(l,v,_,z,T,Y);L=M4(_,z,ee,T,Y)}return R._found=L}function Ye(v,_,z,T,R,L,Y,ee,re,ue){let fe=Y%2/2;A==1&&y.translate(fe,fe),sa(ee,Y,re,ue,ee),y.beginPath();let pe,De,Ie,Je,qe=R+(T==0||T==3?-L:L);z==0?(De=R,Je=qe):(pe=R,Ie=qe);for(let je=0;je{if(!z.show)return;let R=K[z.scale];if(R.min==null){z._show&&(_=!1,z._show=!1,Un(!1));return}else z._show||(_=!1,z._show=!0,Un(!1));let L=z.side,Y=L%2,{min:ee,max:re}=R,[ue,fe]=dd(T,ee,re,Y==0?ke:he);if(fe==0)return;let pe=R.distr==2,De=z._splits=z.splits(l,T,ee,re,ue,fe,pe),Ie=R.distr==2?De.map(ze=>Yn[ze]):De,Je=R.distr==2?Yn[De[1]]-Yn[De[0]]:ue,qe=z._values=z.values(l,z.filter(l,Ie,T,fe,Je),T,fe,Je);z._rotate=L==2?z.rotate(l,qe,T,fe):0;let je=z._size;z._size=Pi(z.size(l,qe,T,v)),je!=null&&z._size!=je&&(_=!1)}),_}function ll(v){let _=!0;return il.forEach((z,T)=>{let R=z(l,T,br,v);R!=ai[T]&&(_=!1),ai[T]=R}),_}function ol(){for(let v=0;vYn[On]):Ie,qe=fe.distr==2?Yn[Ie[1]]-Yn[Ie[0]]:re,je=_.ticks,ze=_.border,mt=je.show?je.size:0,pt=fn(mt*rt),At=fn((_.alignTo==2?_._size-mt-_.gap:_.gap)*rt),st=_._rotate*-Of/180,yt=k(_._pos*rt),$n=(pt+At)*ee,_n=yt+$n;L=T==0?_n:0,R=T==1?_n:0;let Ln=_.font[0],Fn=_.align==1?Fl:_.align==2?Lm:st>0?Fl:st<0?Lm:T==0?"center":z==3?Lm:Fl,wi=st||T==1?"middle":z==2?vu:Pb;Sr(Ln,Y,Fn,wi);let Hn=_.font[1]*_.lineGap,Qn=Ie.map(On=>k(m(On,fe,pe,De))),zi=_._values;for(let On=0;On{z>0&&(_._paths=null,v&&(u==1?(_.min=null,_.max=null):_.facets.forEach(T=>{T.min)DELIM" +R"DELIM(=null,T.max=null})))})}let bn=!1,ul=!1,oa=[];function wo(){ul=!1;for(let v=0;v0&&queueMicrotask(wo)}l.batch=hd;function Pn(){if(Ws&&(vs(),Ws=!1),ds&&(Lu(),ds=!1),Wa){if(Tt(N,Fl,nt),Tt(N,vu,Dt),Tt(N,xu,ke),Tt(N,wu,he),Tt(E,Fl,nt),Tt(E,vu,Dt),Tt(E,xu,ke),Tt(E,wu,he),Tt(w,xu,ii),Tt(w,wu,Ui),x.width=fn(ii*rt),x.height=fn(Ui*rt),ie.forEach(({_el:v,_show:_,_size:z,_pos:T,side:R})=>{if(v!=null)if(_){let L=R===3||R===0?z:0,Y=R%2==1;Tt(v,Y?"left":"top",T-L),Tt(v,Y?"width":"height",z),Tt(v,Y?"top":"left",Y?Dt:nt),Tt(v,Y?"height":"width",Y?he:ke),ap(v,Va)}else ji(v,Va)}),li=Nt=yn=sl=yo=bo=al=qr=_r=null,un=1,va(!0),nt!=Hr||Dt!=Dn||ke!=ri||he!=Qi){Un(!1);let v=ke/ri,_=he/Qi;if(J&&!Yt&&be.left>=0){be.left*=v,be.top*=_,vi&&Ur(vi,fn(be.left),0,ke,he),Gr&&Ur(Gr,0,fn(be.top),ke,he);for(let z=0;z=0&&We.width>0){We.left*=v,We.width*=v,We.top*=_,We.height*=_;for(let z in ya)Tt(bi,z,We[z])}Hr=nt,Dn=Dt,ri=ke,Qi=he}Wt("setSize"),Wa=!1}ii>0&&Ui>0&&(y.clearRect(0,0,x.width,x.height),Wt("drawClear"),V.forEach(v=>v()),Wt("draw")),We.show&&el&&(fa(We),el=!1),J&&Yt&&(Zi(null,!0,!1),Yt=!1),Ce.show&&Ce.live&&Gn&&(pa(),Gn=!1),p||(p=!0,l.status=1,Wt("ready")),Br=!1,bn=!1}l.redraw=(v,_)=>{ds=_||!1,v!==!1?Wi(F,ne.min,ne.max):Kr()};function ua(v,_){let z=K[v];if(z.from==null){if(on==0){let T=z.range(l,_.min,_.max,v);_.min=T[0],_.max=T[1]}if(_.min>_.max){let T=_.min;_.min=_.max,_.max=T}if(on>1&&_.min!=null&&_.max!=null&&_.max-_.min<1e-16)return;v==F&&z.distr==2&&on>0&&(_.min=dr(_.min,i[0]),_.max=dr(_.max,i[0]),_.min==_.max&&_.max++),ce[v]=_,Ws=!0,Kr()}}l.setScale=ua;let cl,ca,vi,Gr,zo,Yr,ys,Pr,Eo,fl,vt,xt,yi=!1;const ht=be.drag;let qt=ht.x,Vt=ht.y;J&&(be.x&&(cl=Yi(Y3,E)),be.y&&(ca=Yi(P3,E)),ne.ori==0?(vi=cl,Gr=ca):(vi=ca,Gr=cl),vt=be.left,xt=be.top);const We=l.select=sn({show:!0,over:!0,left:0,width:0,top:0,height:0},n.select),bi=We.show?Yi(G3,We.over?E:N):null;function fa(v,_){if(We.show){for(let z in v)We[z]=v[z],z in ya&&Tt(bi,z,v[z]);_!==!1&&Wt("setSelect")}}l.setSelect=fa;function To(v){if(D[v].show)M&&ap(Ne[v],Va);else if(M&&ji(Ne[v],Va),J){let z=ms?si[0]:si[v];z!=null&&Ur(z,-10,-10,ke,he)}}function Wi(v,_,z){ua(v,{min:_,max:z})}function Zn(v,_,z,T){_.focus!=null&&dl(v),_.show!=null&&D.forEach((R,L)=>{L>0&&(v==L||v==null)&&(R.show=_.show,To(L),u==2?(Wi(R.facets[0].scale,null,null),Wi(R.facets[1].scale,null,null)):Wi(R.scale,null,null),Kr())}),z!==!1&&Wt("setSeries",v,_),T&&ba("setSeries",l,v,_)}l.setSeries=Zn;function er(v,_){sn(G[v],_)}function Oo(v,_){v.fill=Qe(v.fill||null),v.dir=et(v.dir,-1),_=_??G.length,G.splice(_,0,v)}function da(v){v==null?G.length=0:G.splice(v,1)}l.addBand=Oo,l.setBand=er,l.delBand=da;function wr(v,_){D[v].alpha=_,J&&si[v]!=null&&(si[v].style.opacity=_),M&&Ne[v]&&(Ne[v].style.opacity=_)}let _i,Si,zr;const tr={focus:!0};function dl(v){if(v!=zr){let _=v==null,z=Ot.alpha!=1;D.forEach((T,R)=>{if(u==1||R>0){let L=_||R==0||R==v;T._focus=_?null:L,z&&wr(R,L?1:Ot.alpha)}}),zr=v,z&&Kr()}}M&&hs&&Gt(Xb,ae,v=>{be._lock||(Pt(v),zr!=null&&Zn(null,tr,!0,Ut.setSeries))});function xi(v,_,z){let T=K[_];z&&(v=v/rt-(T.ori==1?Dt:nt));let R=ke;T.ori==1&&(R=he,v=R-v),T.dir==-1&&(v=R-v);let L=T._min,Y=T._max,ee=v/R,re=L+(Y-L)*ee,ue=T.distr;return ue==3?so(10,re):ue==4?fM(re,T.asinh):ue==100?T.bwd(re):re}function Tn(v,_){let z=xi(v,F,_);return dr(z,i[0],Ft,Qt)}l.valToIdx=v=>dr(v,i[0]),l.posToIdx=Tn,l.posToVal=xi,l.valToPos=(v,_,z)=>K[_].ori==0?f(v,K[_],z?vn:ke,z?Vn:0):d(v,K[_],z?Kn:he,z?In:0),l.setCursor=(v,_,z)=>{vt=v.left,xt=v.top,Zi(null,_,z)};function nr(v,_){Tt(bi,Fl,We.left=v),Tt(bi,xu,We.width=_)}function ha(v,_){Tt(bi,vu,We.top=v),Tt(bi,wu,We.height=_)}let ir=ne.ori==0?nr:ha,ma=ne.ori==1?nr:ha;function No(){if(M&&Ce.live)for(let v=u==2?1:0;v{Be[T]=z}):pM(v.idx)||Be.fill(v.idx),Ce.idx=Be[0]),M&&Ce.live){for(let z=0;z0||u==1&&!Bt)&&ga(z,Be[z]);No()}Gn=!1,_!==!1&&Wt("setLegend")}l.setLegend=pa;function ga(v,_){let z=D[v],T=v==0&&xe==2?Yn:i[v],R;Bt?R=z.values(l,v,_)??Di:(R=z.value(l,_==null?null:T[_],v,_),R=R==null?Di:{_:R}),Ce.values[v]=R}function Zi(v,_,z){Eo=vt,fl=xt,[vt,xt]=be.move(l,vt,xt),be.left=vt,be.top=xt,J&&(vi&&Ur(vi,fn(vt),0,ke,he),Gr&&Ur(Gr,0,fn(xt),ke,he));let T,R=Ft>Qt;_i=_t,Si=null;let L=ne.ori==0?ke:he,Y=ne.ori==1?ke:he;if(vt<0||on==0||R){T=be.idx=null;for(let ee=0;ee0&&mt.show){let $n=st==null?-10:st==T?ue:ge(u==1?i[0][st]:i[ze][0][st],ne,L,0),_n=yt==null?-10:Ae(yt,u==1?K[mt.scale]:K[mt.facets[1].scale],Y,0);if(hs&&yt!=null){let Ln=ne.ori==1?vt:xt,Fn=dn(Ot.dist(l,ze,st,_n,Ln));if(Fn<_i){let wi=Ot.bias;if(wi!=0){let Hn=xi(Ln,mt.scale),Qn=yt>=0?1:-1,zi=Hn>=0?1:-1;zi==Qn&&(zi==1?wi==1?yt>=Hn:yt<=Hn:wi==1?yt<=Hn:yt>=Hn)&&(_i=Fn,Si=ze)}else _i=Fn,Si=ze}}if(Gn||ms){let Ln,Fn;ne.ori==0?(Ln=$n,Fn=_n):(Ln=_n,Fn=$n);let wi,Hn,Qn,zi,$i,On,Jn=!0,Fr=Et.bbox;if(Fr!=null){Jn=!1;let ut=Fr(l,ze);Qn=ut.left,zi=ut.top,wi=ut.width,Hn=ut.height}else Qn=Ln,zi=Fn,wi=Hn=Et.size(l,ze);if(On=Et.fill(l,ze),$i=Et.stroke(l,ze),ms)ze==Si&&_i<=Ot.prox&&(fe=Qn,pe=zi,De=wi,Ie=Hn,Je=Jn,qe=On,je=$i);else{let ut=si[ze];ut!=null&&(Ji[ze]=Qn,Xi[ze]=zi,s_(ut,wi,Hn,Jn),i_(ut,On,$i),Ur(ut,Pi(Qn),Pi(zi),ke,he))}}}}if(ms){let ze=Ot.prox,mt=zr==null?_i<=ze:_i>ze||Si!=zr;if(Gn||mt){let pt=si[0];pt!=null&&(Ji[0]=fe,Xi[0]=pe,s_(pt,De,Ie,Je),i_(pt,qe,je),Ur(pt,Pi(fe),Pi(pe),ke,he))}}}if(We.show&&yi)if(v!=null){let[ee,re]=Ut.scales,[ue,fe]=Ut.match,[pe,De]=v.cursor.sync.scales,Ie=v.cursor.drag;if(qt=Ie._x,Vt=Ie._y,qt||Vt){let{left:Je,top:qe,width:je,height:ze}=v.select,mt=v.scales[pe].ori,pt=v.posToVal,At,st,yt,$n,_n,Ln=ee!=null&&ue(ee,pe),Fn=re!=null&&fe(re,De);Ln&&qt?(mt==0?(At=Je,st=je):(At=qe,st=ze),yt=K[ee],$n=ge(pt(At,pe),yt,L,0),_n=ge(pt(At+st,pe),yt,L,0),ir(hr($n,_n),dn(_n-$n))):ir(0,L),Fn&&Vt?(mt==1?(At=Je,st=je):(At=qe,st=ze),yt=K[re],$n=Ae(pt(At,De),yt,Y,0),_n=Ae(pt(At+st,De),yt,Y,0),ma(hr($n,_n),dn(_n-$n))):ma(0,Y)}else Mo()}else{let ee=dn(Eo-zo),re=dn(fl-Yr);if(ne.ori==1){let De=ee;ee=re,re=De}qt=ht.x&&ee>=ht.dist,Vt=ht.y&&re>=ht.dist;let ue=ht.uni;ue!=null?qt&&Vt&&(qt=ee>=ue,Vt=re>=ue,!qt&&!Vt&&(re>ee?Vt=!0:qt=!0)):ht.x&&ht.y&&(qt||Vt)&&(qt=Vt=!0);let fe,pe;qt&&(ne.ori==0?(fe=ys,pe=vt):(fe=Pr,pe=xt),ir(hr(fe,pe),dn(pe-fe)),Vt||ma(0,Y)),Vt&&(ne.ori==1?(fe=ys,pe=vt):(fe=Pr,pe=xt),ma(hr(fe,pe),dn(pe-fe)),qt||ir(0,L)),!qt&&!Vt&&(ir(0,0),ma(0,0))}if(ht._x=qt,ht._y=Vt,v==null){if(z){if(Ju!=null){let[ee,re]=Ut.scales;Ut.values[0]=ee!=null?xi(ne.ori==0?vt:xt,ee):null,Ut.values[1]=re!=null?xi(ne.ori==1?vt:xt,re):null}ba(Hm,l,vt,xt,ke,he,T)}if(hs){let ee=z&&Ut.setSeries,re=Ot.prox;zr==null?_i<=re&&Zn(Si,tr,!0,ee):_i>re?Zn(null,tr,!0,ee):Si!=zr&&Zn(Si,tr,!0,ee)}}Gn&&(Ce.idx=T,pa()),_!==!1&&Wt("setCursor")}let rr=null;Object.defineProperty(l,"rect",{get(){return rr==null&&va(!1),rr}});function va(v=!1){v?rr=null:(rr=E.getBoundingClientRect(),Wt("syncRect",rr))}function qu(v,_,z,T,R,L,Y){be._lock||yi&&v!=null&&v.movementX==0&&v.movementY==0||(Ao(v,_,z,T,R,L,Y,!1,v!=null),v!=null?Zi(null,!0,!0):Zi(_,!0,!1))}function Ao(v,_,z,T,R,L,Y,ee,re){if(rr==null&&va(!1),Pt(v),v!=null)z=v.clientX-rr.left,T=v.clientY-rr.top;else{if(z<0||T<0){vt=-10,xt=-10;return}let[ue,fe]=Ut.scales,pe=_.cursor.sync,[De,Ie]=pe)DELIM" +R"DELIM(.values,[Je,qe]=pe.scales,[je,ze]=Ut.match,mt=_.axes[0].side%2==1,pt=ne.ori==0?ke:he,At=ne.ori==1?ke:he,st=mt?L:R,yt=mt?R:L,$n=mt?T:z,_n=mt?z:T;if(Je!=null?z=je(ue,Je)?m(De,K[ue],pt,0):-10:z=pt*($n/st),qe!=null?T=ze(fe,qe)?m(Ie,K[fe],At,0):-10:T=At*(_n/yt),ne.ori==1){let Ln=z;z=T,T=Ln}}re&&(_==null||_.cursor.event.type==Hm)&&((z<=1||z>=ke-1)&&(z=Ba(z,ke)),(T<=1||T>=he-1)&&(T=Ba(T,he))),ee?(zo=z,Yr=T,[ys,Pr]=be.move(l,z,T)):(vt=z,xt=T)}const ya={width:0,height:0,left:0,top:0};function Mo(){fa(ya,!1)}let Vu,Iu,Ku,Gu;function jo(v,_,z,T,R,L,Y){yi=!0,qt=Vt=ht._x=ht._y=!1,Ao(v,_,z,T,R,L,Y,!0,!1),v!=null&&(Gt(Bm,rp,Yu,!1),ba(Qb,l,ys,Pr,ke,he,null));let{left:ee,top:re,width:ue,height:fe}=We;Vu=ee,Iu=re,Ku=ue,Gu=fe}function Yu(v,_,z,T,R,L,Y){yi=ht._x=ht._y=!1,Ao(v,_,z,T,R,L,Y,!1,!0);let{left:ee,top:re,width:ue,height:fe}=We,pe=ue>0||fe>0,De=Vu!=ee||Iu!=re||Ku!=ue||Gu!=fe;if(pe&&De&&fa(We),ht.setScale&&pe&&De){let Ie=ee,Je=ue,qe=re,je=fe;if(ne.ori==1&&(Ie=re,Je=fe,qe=ee,je=ue),qt&&Wi(F,xi(Ie,F),xi(Ie+Je,F)),Vt)for(let ze in K){let mt=K[ze];ze!=F&&mt.from==null&&mt.min!=_t&&Wi(ze,xi(qe+je,ze),xi(qe,ze))}Mo()}else be.lock&&(be._lock=!be._lock,Zi(_,!0,v!=null));v!=null&&(qn(Bm,rp),ba(Bm,l,vt,xt,ke,he,null))}function md(v,_,z,T,R,L,Y){if(be._lock)return;Pt(v);let ee=yi;if(yi){let re=!0,ue=!0,fe=10,pe,De;ne.ori==0?(pe=qt,De=Vt):(pe=Vt,De=qt),pe&&De&&(re=vt<=fe||vt>=ke-fe,ue=xt<=fe||xt>=he-fe),pe&&re&&(vt=vt{let R=Ut.match[2];z=R(l,_,z),z!=-1&&Zn(z,T,!0,!1)},J&&(Gt(Qb,E,jo),Gt(Hm,E,qu),Gt(Jb,E,v=>{Pt(v),va(!1)}),Gt(Xb,E,md),Gt(Wb,E,Pu),dp.add(l),l.syncRect=va);const hl=l.hooks=n.hooks||{};function Wt(v,_,z){ul?oa.push([v,_,z]):v in hl&&hl[v].forEach(T=>{T.call(null,l,_,z)})}(n.plugins||[]).forEach(v=>{for(let _ in v.hooks)hl[_]=(hl[_]||[]).concat(v.hooks[_])});const Qu=(v,_,z)=>z,Ut=sn({key:null,setSeries:!1,filters:{pub:c_,sub:c_},scales:[F,D[1]?D[1].scale:null],match:[f_,f_,Qu],values:[null,null]},be.sync);Ut.match.length==2&&Ut.match.push(Qu),be.sync=Ut;const Ju=Ut.key,Ro=JS(Ju);function ba(v,_,z,T,R,L,Y){Ut.filters.pub(v,_,z,T,R,L,Y)&&Ro.pub(v,_,z,T,R,L,Y)}Ro.sub(l);function pd(v,_,z,T,R,L,Y){Ut.filters.sub(v,_,z,T,R,L,Y)&&Er[v](null,_,z,T,R,L,Y)}l.pub=pd;function gd(){Ro.unsub(l),dp.delete(l),gn.clear(),lp(Lf,to,Fu),g.remove(),ae?.remove(),Wt("destroy")}l.destroy=gd;function Co(){Wt("init",n,i),vo(i||n.data,!1),ce[F]?ua(F,ce[F]):rl(),el=We.show&&(We.width>0||We.height>0),Yt=Gn=!0,tl(n.width,n.height)}return D.forEach(yr),ie.forEach(fd),a?a instanceof HTMLElement?(a.appendChild(g),Co()):a(l,Co):Co(),l}ln.assign=sn;ln.fmtNum=Jp;ln.rangeNum=Hf;ln.rangeLog=td;ln.rangeAsinh=Fp;ln.orient=Xa;ln.pxRatio=rt;ln.join=xM;ln.fmtDate=Wp,ln.tzDate=CM;ln.sync=JS;{ln.addGap=p4,ln.clipGaps=rd;let n=ln.paths={points:ix};n.linear=sx,n.stepped=y4,n.bars=b4,n.spline=S4}const ux=(n,i,a,l,u)=>{if(!Number.isFinite(a)||!Number.isFinite(l)||l<=a)return[];const f=[];if(Math.asinh(l)-Math.asinh(a)<1.5){const p=Number.isFinite(u)&&u>0?u:(l-a)/4,g=Math.ceil(a/p)*p;for(let x=0;x<100;x++){const y=Number((g+x*p).toPrecision(14));if(y>l)break;f.push({value:y,priority:y===0?0:1})}}else{const p=Math.ceil(Math.log10(Math.max(Math.abs(a),Math.abs(l))));for(let g=Math.min(-1,p-1);g<=p;g++)for(const x of[1,2,5]){const y=x*10**g;for(const w of[-y,y])Number.isFinite(w)&&w>=a&&w<=l&&f.push({value:w,priority:x===1?1:2})}a<=0&&l>=0&&f.push({value:0,priority:0})}f.sort((p,g)=>p.priority-g.priority||p.value-g.value);const d=[],m=[];for(const{value:p}of f){const g=n.valToPos(p,"y");Number.isFinite(g)&&m.every(x=>Math.abs(g-x)>=36)&&(d.push(p),m.push(g))}return d.sort((p,g)=>p-g),d};function R4(n){const i=n.filter(([,a])=>a>0).map(([a,l])=>({minimumRate:a,virtualSize:l}));return i.sort((a,l)=>a.minimumRate-l.minimumRate),i}const C4=new Intl.NumberFormat(void 0,{maximumSignificantDigits:8}),k4=new Intl.NumberFormat(void 0,{maximumFractionDigits:0});function mp(n){return C4.format(n)}function cx(n){return`${k4.format(n)} vB`}function D4({snapshot:n,now:i,color:a,scale:l}){const u=se.useMemo(()=>R4(n?.data.histogram??[]),[n]),f=n!==null&&i-n.receivedAt>=ku,d=n===null?"Waiting for transaction-pool fee data…":f?"Fee distribution is stale. Waiting for a fresh pool snapshot…":n.data.count===0?"The transaction pool is empty.":u.length===0?"No fee distribution is available for this pool snapshot.":null;return S.jsxs("div",{className:"space-y-3",children:[d?S.jsx("p",{role:"status",className:"text-textMuted flex min-h-72 items-center justify-center px-4 text-center text-sm",children:d}):S.jsxs(S.Fragment,{children:[S.jsx(U4,{bins:u,color:a,scale:l}),S.jsx("p",{className:"text-textMuted text-xs",children:"Each bar is a fee-rate group, labeled by its minimum rate. Bar height is virtual size, not transaction count. Groups are spaced evenly."}),S.jsxs("details",{className:"border-accentSecondary/20 rounded-md border text-xs",children:[S.jsxs("summary",{className:"text-textMuted hover:text-accent cursor-pointer px-3 py-2",children:["View ",hn(u.length)," fee-rate ",u.length===1?"group":"groups"]}),S.jsx("div",{className:"border-accentSecondary/20 max-h-56 overflow-auto border-t",children:S.jsxs("table",{className:"w-full text-left tabular-nums",children:[S.jsx("caption",{className:"sr-only",children:"Transaction-pool fee-rate groups"}),S.jsx("thead",{className:"bg-surface text-textMuted sticky top-0",children:S.jsxs("tr",{children:[S.jsx("th",{scope:"col",className:"px-3 py-2",children:"Minimum rate (sat/vB)"}),S.jsx("th",{scope:"col",className:"px-3 py-2 text-right",children:"Virtual size (vB)"})]})}),S.jsx("tbody",{className:"divide-accentSecondary/20 divide-y",children:u.map((m,p)=>S.jsxs("tr",{children:[S.jsx("td",{className:"px-3 py-2",children:mp(m.minimumRate)}),S.jsx("td",{className:"px-3 py-2 text-right",children:hn(m.virtualSize)})]},p))})]})})]})]}),n&&S.jsxs("p",{className:"text-textMuted text-xs",children:[f?"Last snapshot":"Snapshot"," ",eo(n.receivedAt),!f&&` · ${hn(n.data.count)} transactions · ${cx(n.data.virtual)}`]})]})}function U4({bins:n,color:i,scale:a}){const l=se.useRef(null),u=se.useRef(null),f=se.useRef(n);return se.useLayoutEffect(()=>{f.current=n;const d=u.current;d&&(d.setData([n.map((m,p)=>p),n.map(m=>m.virtualSize)]),d.redraw(!1,!0))},[n]),se.useLayoutEffect(()=>{const d=l.current;if(!d)return;const m=getComputedStyle(d),p=`12px ${m.fontFamily}`,g=[f.current.map((N,E)=>E),f.current.map(N=>N.virtualSize)],x={width:Math.max(240,d.clientWidth),height:280,padding:[12,12,0,0],cursor:{drag:{x:!1,y:!1}},legend:{show:!0,live:!0},scales:{x:{time:!1,range:()=>[-.5,f.current.length-.5]},y:{distr:a==="compressed"?4:1,asinh:1,range:(N,E,A)=>[0,Math.max(1,A*1.08)]}},axes:[{stroke:m.color,font:p,grid:{show:!1},ticks:{stroke:"#ffa0224d",width:1},splits:N=>{const E=f.current,A=Math.max(1,Math.ceil(E.length/Math.max(1,Math.floor(N.width/80))));return E.map((k,B)=>B).filter(k=>k%A===0)},values:(N,E)=>E.map(A=>mp(f.current[A].minimumRate))},{size:76,stroke:m.color,font:p,grid:{stroke:"#c8563733",width:1},ticks:{stroke:"#ffa0224d",width:1},values:(N,E)=>E.map(A=>hn(A)),...a==="compressed"?{splits:ux,filter:(N,E)=>E}:{}}],series:[{label:"Min rate",value:(N,E)=>{const A=E===null?void 0:f.current[E];return A?`${mp(A.minimumRate)} sat/vB`:"—"}},{label:"Virtual size",stroke:i,fill:`${i}90`,width:1,points:{show:!1},paths:ln.paths.bars?.({size:[.85,48]}),value:(N,E)=>E===null?"—":cx(E)}]},y=new ln(x,g,d);u.current=y;const w=new ResizeObserver(N=>{const E=N[0]?.contentRect.width;E&&E>0&&y.setSize({width:Math.round(E),height:280})});return w.observe(d),()=>{w.disconnect(),y.destroy(),u.current=null}},[i,a]),S.jsxs("div",{role:"img","aria-label":"Transacti)DELIM" +R"DELIM(on-pool fee distribution: virtual size in vbytes by minimum fee rate in satoshis per vbyte",children:[S.jsx("p",{className:"text-textMuted mb-2 text-xs",children:"Virtual size (vB)"}),S.jsx("div",{ref:l,className:"text-textMuted min-w-0 overflow-hidden"}),S.jsx("p",{className:"text-textMuted text-center text-xs",children:"Minimum fee rate per group (sat/vB)"})]})}function Z4({data:n,series:i,height:a=280,emptyMessage:l="Waiting for live data…",valueSuffix:u="",zeroBased:f=!0,valueFormatter:d=B4,visualization:m="line",scale:p="linear",forceEmpty:g=!1}){const x=se.useRef(null),y=se.useRef(null),w=se.useRef(!1),N=se.useRef(null),E=se.useMemo(()=>H4(n),[n]),A=se.useRef(E),k=!g&&n[0]?.length>0;return se.useLayoutEffect(()=>{A.current=E},[E]),se.useLayoutEffect(()=>{const B=x.current;if(!B)return;const D=getComputedStyle(B),ie=`12px ${D.fontFamily}`,K={width:Math.max(240,B.clientWidth),height:a,padding:[12,8,0,0],cursor:{drag:{x:!0,y:!1,setScale:!0},focus:{prox:24}},hooks:{setSelect:[V=>{V.select.width>0&&(w.current=!0)}]},legend:{show:!0,live:!0},scales:{x:{time:!0},y:{auto:!0,distr:p==="compressed"?4:1,asinh:1,...f?{range:(V,ye,de)=>[Math.min(0,ye),de===0?1:de*1.08]}:{range:(V,ye,de)=>{const ne=de-ye,xe=ne===0?Math.max(1,Math.abs(de)*5e-4):ne*.08;return[ye-xe,de+xe]}}}},axes:[{stroke:D.color,grid:{stroke:"#c8563733",width:1},ticks:{stroke:"#ffa0224d",width:1},font:ie},{size:72,stroke:D.color,grid:{stroke:"#c8563733",width:1},ticks:{stroke:"#ffa0224d",width:1},font:ie,values:(V,ye)=>ye.map(de=>de===null?null:`${d(de)}${u}`),...p==="compressed"?{splits:ux,filter:(V,ye)=>ye}:{}}],series:[{},...i.map((V,ye)=>{const de=m==="step"?ln.paths.stepped?.({align:1}):m==="bar"?$4(ye,i.length):void 0;return{label:V.label,stroke:V.color,fill:m==="area"||m==="bar"?V.fill??`${V.color}24`:V.fill,width:V.width??2,paths:de,points:{show:m==="line"?V.points??!1:!1},value:(ne,xe)=>xe===null?"—":`${d(xe)}${u}`}})]},G=new ln(K,A.current,B),F=N.current;F&&G.setScale("x",F),y.current=G;const te=new ResizeObserver(V=>{const ye=V[0]?.contentRect.width;ye&&ye>0&&G.setSize({width:Math.round(ye),height:a})});return te.observe(B),()=>{N.current=w.current&&G.scales.x.min!=null&&G.scales.x.max!=null?{min:G.scales.x.min,max:G.scales.x.max}:null,te.disconnect(),G.destroy(),y.current=null}},[a,i,d,u,m,f,p]),se.useEffect(()=>{const B=y.current;if(!B)return;const D=!w.current;B.setData(E,D),D||B.redraw()},[E]),S.jsxs("div",{className:"relative min-w-0",children:[S.jsx("div",{ref:x,className:"text-textMuted min-w-0 overflow-hidden"}),!k&&S.jsx("div",{className:"bg-surface text-textMuted pointer-events-none absolute inset-0 z-10 flex items-center justify-center text-sm",children:l})]})}function $4(n,i){const a=Math.max(1,i);return ln.paths.bars?.({size:[1,48/a,0],disp:{x0:{unit:1,values:l=>{const u=C_(l,a),f=-u.groupWidth/2+u.barWidth*n;return Array.from(l.data[0],d=>d+f)}},size:{unit:1,values:l=>[C_(l,a).barWidth]}}})}function C_(n,i){const a=L4(n.data[0]),l=Math.abs(n.posToVal(48,"x")-n.posToVal(0,"x")),u=Math.min(a*.72,l);return{groupWidth:u,barWidth:u/i}}function L4(n){let i=Number.POSITIVE_INFINITY,a;for(const l of n)if(Number.isFinite(l)){if(a!==void 0){const u=Math.abs(l-a);u>0&&u=2)return n;const a=Date.now()/1e3,l=i[0]??a,u=[l-1,l],f=n.slice(1).map(d=>{const m=d[0]??null;return[m,m]});return[u,...f]}function B4(n){return Math.abs(n)>=1e6?`${(n/1e6).toFixed(1)}m`:Math.abs(n)>=1e3?`${(n/1e3).toFixed(1)}k`:Math.abs(n)>=10?n.toFixed(0):Math.abs(n)>=1?n.toFixed(1):n.toFixed(2)}const q4={300:"5m",900:"15m",3600:"1h"},V4=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),I4=new Intl.NumberFormat(void 0,{maximumFractionDigits:2});function K4(n){return V4.format(n)}function G4(n){return I4.format(n)}function Y4(n){return n==="height"||n==="occurrences"?K4:G4}function P4({metrics:n}){const i=xS(),[a,l]=se.useState(x3),[u,f]=se.useState(null),[d,m]=se.useState(!1);se.useEffect(()=>{w3(a)},[a]);function p(y){l(w=>u?.mode==="add"?w.length>=Jl?w:[...w,y]:w.map(N=>N.id===y.id?y:N)),f(null)}function g(y,w){l(N=>{const E=y+w;if(E<0||E>=N.length)return N;const A=[...N],k=A[y],B=A[E];return A[y]=B,A[E]=k,A})}function x(){if(!d){m(!0);return}l(Tf()),m(!1)}return S.jsxs("section",{className:"space-y-4",children:[S.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Live telemetry"}),S.jsx("h2",{className:"text-accent mt-1 text-2xl font-semibold",children:"Custom charts"}),S.jsxs("p",{className:"text-textMuted mt-1 text-sm",children:["Session data only · ",String(a.length)," of ",String(Jl)," charts"]})]}),S.jsxs("div",{className:"flex flex-wrap gap-2",children:[S.jsx("button",{type:"button",onClick:()=>{m(!1),f({mode:"add",chart:vS()})},disabled:a.length>=Jl,className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium disabled:cursor-not-allowed disabled:opacity-40",children:"Add chart"}),S.jsx("button",{type:"button",onClick:x,onBlur:()=>{m(!1)},className:`rounded-md border px-3 py-2 text-sm font-medium ${d?"border-amber-400/60 text-amber-200":"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary"}`,children:d?"Confirm reset":"Reset defaults"})]})]}),a.length===0?S.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border border-dashed px-6 py-16 text-center",children:[S.jsx("p",{className:"text-textPrimary font-medium",children:"No charts in this dashboard."}),S.jsx("p",{className:"text-textMuted mt-2 text-sm",children:"Add a custom chart or start from a template."})]}):S.jsx("div",{className:"grid gap-6 xl:grid-cols-2",children:a.map((y,w)=>S.jsx(F4,{chart:y,metrics:n,now:i,canMoveEarlier:w>0,canMoveLater:w{l(N=>N.map(E=>E.id===y.id?{...E,scale:E.scale==="compressed"?"linear":"compressed"}:E))},onDelete:()=>{l(N=>N.filter(E=>E.id!==y.id))},onDuplicate:()=>{l(N=>N.length>=Jl?N:[...N,S3(y)])},onEdit:()=>{f({mode:"edit",chart:y})},onMoveEarlier:()=>{g(w,-1)},onMoveLater:()=>{g(w,1)}},y.id))}),u&&S.jsx(U3,{chart:u.chart,mode:u.mode,onCancel:()=>{f(null)},onSave:p},`${u.mode}-${u.chart.id}`)]})}function F4({chart:n,metrics:i,now:a,canMoveEarlier:l,canMoveLater:u,canDuplicate:f,onDelete:d,onDuplicate:m,onEdit:p,onMoveEarlier:g,onMoveLater:x,onToggleScale:y}){const[w,N]=se.useState(null),[E,A]=se.useState(0),k=w??i,B=se.useMemo(()=>an(n)?N3(k,n):null,[n,k]),D=se.useMemo(()=>an(n)?n.series.map(G=>({label:G.label??os(G.signalId).label,color:G.color})):[],[n]),ie=Y4(B?.unit??"vbytes"),K=`Waiting for ${D.length===1?D[0]?.label?.toLowerCase():"the selected signals"}…`;return S.jsxs("article",{className:"border-accent/30 bg-surface/80 min-w-0 overflow-hidden rounded-2xl border",children:[S.jsx("header",{className:"border-accentSecondary/20 space-y-3 border-b px-4 py-4 sm:px-5",children:S.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("h3",{className:"text-accent truncate text-lg font-semibold",title:n.title,children:n.title}),S.jsxs("p",{className:"text-textMuted mt-1 text-xs",children:[an(n)&&B?`${SS(B.unit)} · ${q4[n.range]} · ${n.visualization}`:"Virtual size by fee-rate group · latest snapshot",n.scale==="compressed"?" · compressed scale":"",w?" · paused":""]})]}),S.jsxs("div",{className:"flex flex-wrap justify-end gap-1 text-xs",children:[S.jsx("button",{type:"button","aria-label":`Compress peaks for ${n.title}`,"aria-pressed":n.scale==="compressed",title:"Use a log-like Y axis to compress large peaks. Zero, negative values, and original measurements are preserved.",onClick:y,className:`rounded-md border px-2 py-1.5 ${n.scale==="compressed"?"border-accent/40 bg-accentSecondary/20 text-accent":"border-accent/30 text-textMuted h)DELIM" +R"DELIM(over:text-accent hover:bg-accentSecondary/10"}`,children:"Compress peaks"}),S.jsx(Ha,{label:w?"Resume chart":"Pause chart",onClick:()=>{N(G=>G?null:an(n)?i:{...i,now:a})},children:w?"Resume":"Pause"}),an(n)&&S.jsx(Ha,{label:"Reset chart zoom",onClick:()=>{A(G=>G+1)},children:"Reset zoom"}),S.jsx(Ha,{label:"Edit chart",onClick:p,children:"Edit"}),S.jsx(Ha,{label:"Duplicate chart",onClick:m,disabled:!f,children:"Duplicate"}),S.jsx(Ha,{label:`Move ${n.title} earlier`,onClick:g,disabled:!l,children:"←"}),S.jsx(Ha,{label:`Move ${n.title} later`,onClick:x,disabled:!u,children:"→"}),S.jsx(Ha,{label:"Delete chart",onClick:d,danger:!0,children:"Delete"})]})]})}),S.jsx("div",{className:"min-w-0 p-3 sm:p-5",children:an(n)&&B?S.jsx(Z4,{data:B.data,series:D,visualization:n.visualization,scale:n.scale,zeroBased:M3(B.unit),valueFormatter:ie,valueSuffix:A3(B.unit),forceEmpty:!B.hasObservedData,emptyMessage:K},E):!an(n)&&S.jsx(D4,{snapshot:k.poolSnapshot,now:w?.now??a,color:n.color,scale:n.scale})}),n.scale==="compressed"&&S.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Log-like Y axis · peaks compressed · labels and hover values show original measurements."}),an(n)&&n.series.some(G=>G.signalId==="event:10")&&S.jsx("p",{className:"text-textMuted px-5 pb-3 text-[11px]",children:"Archival includes compact-block recovery; rejected and duplicate submissions are excluded."}),B&&B.unobservedLabels.length>0&&B.hasObservedData&&S.jsxs("footer",{className:"border-accent/10 text-textMuted border-t px-5 py-2 text-[11px]",children:["Not observed this session: ",B.unobservedLabels.join(", ")]})]})}function Ha({label:n,children:i,onClick:a,disabled:l=!1,danger:u=!1}){return S.jsx("button",{type:"button","aria-label":n,onClick:a,disabled:l,className:`rounded-md px-2 py-1.5 disabled:cursor-not-allowed disabled:opacity-30 ${u?"text-textMuted hover:bg-red-500/10 hover:text-red-300":"text-textMuted hover:text-accent hover:bg-accentSecondary/10"}`,children:i})}const Q4=[{event:0,label:"Header archived"},{event:3,label:"Block archived"},{event:5,label:"Block validated"},{event:6,label:"Block confirmed"},{event:13,label:"Block organized"},{event:14,label:"Block reorganized"}];function J4({adminStatus:n,endpoints:i,metrics:a,native:l,syncEstimate:u}){const f=l3(a,10),d=l.configuration,m=mi(6),p=[n.error?`Admin: ${n.error}`:null,l.status.error?`Native: ${l.status.error}`:null,l.transport==="none"&&l.restError?`Native REST: ${l.restError}`:null,a.invalidFrames>0?`${String(a.invalidFrames)} malformed admin frame${a.invalidFrames===1?"":"s"} ignored`:null,l.live.invalidFrames>0?`${String(l.live.invalidFrames)} malformed native frame${l.live.invalidFrames===1?"":"s"} ignored`:null,l.status.phase==="connected"&&l.transport==="none"?"Native: Connected, but no fresh valid state has been received":null].filter(g=>g!==null);return S.jsxs("div",{className:"space-y-6",children:[p.length>0&&S.jsxs("section",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 px-4 py-3",children:[S.jsx("p",{className:"text-sm font-medium text-amber-300",children:"Transport notice"}),S.jsx("ul",{className:"text-textMuted mt-1 space-y-1 text-xs",children:p.map(g=>S.jsx("li",{children:g},g))})]}),S.jsx(h3,{confirmed:l.top,estimate:u}),S.jsxs("dl",{"aria-label":"Node summary",className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-4",children:[S.jsx(vf,{label:"Canonical top",value:l.top===null?"—":hn(l.top),detail:l.transport==="none"?"Waiting for native API":`${W4(u)} · via ${l.transport==="websocket"?"native WebSocket":"REST fallback"}`,emphasized:!0}),S.jsx(vf,{label:"Current activity",value:f.label,detail:f.rate>0?`${RA(f.rate)} over the last 10 seconds`:"No lifecycle events in the last 10 seconds",numeric:!1}),S.jsx(vf,{label:"Highest confirmed",value:a.signalMaximums[m]===void 0?"—":hn(a.signalMaximums[m]),detail:`${hn(a.signalTotals[m]??0)} confirmations observed`}),S.jsx(vf,{label:"Collection uptime",value:jA(a.now-a.sessionStartedAt),detail:`${hn(a.totalEvents)} events · ${hn(a.totalLogs)} logs`})]}),S.jsxs("section",{className:"grid gap-4 lg:grid-cols-2",children:[S.jsx(k_,{title:"Admin stream",endpoint:i.adminUrl,status:n,detail:n.lastMessageAt?`Last frame ${eo(n.lastMessageAt)}`:"Waiting for the first frame"}),S.jsx(k_,{title:"Native interface",endpoint:i.nativeUrl,status:l.status,detail:l.receivedAt?`Last state ${eo(l.receivedAt)} · ${l.transport}`:"Waiting for node state"})]}),S.jsx(P4,{metrics:a}),S.jsxs("section",{className:"grid gap-4 xl:grid-cols-[1.1fr_0.9fr]",children:[S.jsxs("div",{className:"border-accent/30 bg-surface/80 overflow-hidden rounded-2xl border",children:[S.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Lifecycle heights"}),S.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Highest observed event values"})]}),S.jsx("div",{className:"bg-accentSecondary/10 grid gap-px sm:grid-cols-2 lg:grid-cols-3",children:Q4.map(({event:g,label:x})=>{const y=a.signalMaximums[mi(g)];return S.jsxs("div",{className:"bg-surface px-5 py-4",children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:x}),S.jsx("p",{className:"text-textPrimary mt-2 text-xl font-semibold tabular-nums",children:y===void 0?"—":hn(y)})]},g)})})]}),S.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[S.jsxs("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Capabilities"}),S.jsx("h2",{className:"text-accent mt-1 text-lg font-semibold",children:"Native configuration"})]}),d?S.jsxs("div",{className:"grid grid-cols-2 gap-x-6 gap-y-4 p-5 text-sm",children:[S.jsx(Ql,{label:"Address index",enabled:d.address}),S.jsx(Ql,{label:"Client filters",enabled:d.filter}),S.jsx(Ql,{label:"Turbo",enabled:d.turbo}),S.jsx(Ql,{label:"Witness",enabled:d.witness}),S.jsx(Ql,{label:"Retarget",enabled:d.retarget}),S.jsx(Ql,{label:"Difficulty",enabled:d.difficult}),S.jsxs("div",{className:"border-accentSecondary/20 col-span-2 border-t pt-3",children:[S.jsx("span",{className:"text-textMuted",children:"Pruned below"}),S.jsx("span",{className:"text-textPrimary float-right font-mono",children:d.pruned>0?hn(d.pruned):"Not pruned"})]})]}):S.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:"Waiting for native configuration."})]})]}),S.jsx("section",{children:S.jsxs("div",{className:"border-accent/30 bg-surface/80 rounded-2xl border",children:[S.jsx("header",{className:"border-accentSecondary/20 border-b px-5 py-4",children:S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:"Recent events"})}),a.recentEvents.length===0?S.jsx(X4,{text:"No events observed yet."}):S.jsx("ul",{className:"divide-accentSecondary/20 divide-y",children:a.recentEvents.slice(0,6).map(g=>S.jsxs("li",{className:"flex items-center gap-3 px-5 py-3 text-xs",children:[S.jsx("time",{className:"text-textMuted w-24 shrink-0 font-mono",children:eo(g.time)}),S.jsx("span",{className:"text-textPrimary min-w-0 flex-1 truncate font-mono",children:ho(g.event).name}),S.jsx("span",{className:"text-accent tabular-nums",children:Q1(g.event,g.value)})]},g.id))})]})})]})}function k_({title:n,endpoint:i,status:a,detail:l}){return S.jsxs("article",{className:"border-accent/30 bg-surface/80 min-w-0 rounded-2xl border p-5",children:[S.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[S.jsxs("div",{children:[S.jsx("p",{className:"text-accentSecondary text-xs tracking-wide uppercase",children:n}),S.jsx("p",{className:"text-textPrimary mt-2 font-mono text-sm break-all",children:CA(i)})]}),S.jsx(d3,{phase:a.phase,label:a.phase})]}),S.jsxs("div",{className:"text-textMuted border-accentSecondary/20 mt-4 flex flex-wrap justify-between gap-2 border-t pt-3 text-xs",children:[S)DELIM" +R"DELIM(.jsx("span",{children:l}),S.jsxs("span",{children:[String(a.reconnects)," reconnect",a.reconnects===1?"":"s"]})]})]})}function Ql({label:n,enabled:i}){return S.jsxs("div",{className:"flex items-center justify-between gap-3",children:[S.jsx("span",{className:"text-textMuted",children:n}),S.jsx("span",{className:i?"text-emerald-300":"text-textMuted",children:i?"Enabled":"Disabled"})]})}function X4({text:n}){return S.jsx("p",{className:"text-textMuted px-5 py-10 text-center text-sm",children:n})}function W4(n){return n?n.blocksRemaining<=Jf?"Near current (estimated)":`${hn(n.blocksRemaining)} blocks remaining (estimated)`:"Waiting for confirmed block timestamp"}const ej=8e3;function tj({estimate:n,browserNotificationsEnabled:i}){const a=se.useRef(null),[l,u]=se.useState(null),f=n?.blocksRemaining??null;if(se.useEffect(()=>{const m=ij(f);if(!m)return;const p=a.current;if(a.current=m.state,!(p===null||p===m.state)&&(u(m),i)){const g=nj(m);Dz(g.title,{body:g.body,tag:"libbitcoin-sync-status"})}},[i,f]),se.useEffect(()=>{if(!l)return;const m=setTimeout(()=>{u(p=>p===l?null:p)},ej);return()=>{clearTimeout(m)}},[l]),!l)return null;const d=l.state==="near-current";return S.jsx("aside",{role:"status","aria-live":"polite","aria-atomic":"true",className:`fixed right-4 bottom-4 left-4 z-[60] rounded-xl border p-4 shadow-2xl shadow-black/50 sm:left-auto sm:w-96 ${d?"border-emerald-400/35 bg-emerald-950/95":"border-amber-400/35 bg-amber-950/95"}`,children:S.jsxs("div",{className:"flex items-start gap-4",children:[S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:d?"font-semibold text-emerald-200":"font-semibold text-amber-200",children:d?"Node near current (estimated)":"Node fell behind (estimated)"}),S.jsx("p",{className:"mt-1 text-sm text-white/75",children:pp(l)})]}),S.jsx("button",{type:"button","aria-label":"Dismiss synchronization notification",onClick:()=>{u(null)},className:"text-lg leading-none text-white/60 hover:text-white",children:"×"})]})})}function nj(n){return n.state==="near-current"?{title:"Libbitcoin node near current (estimated)",body:pp(n)}:{title:"Libbitcoin node fell behind (estimated)",body:pp(n)}}function ij(n){return n===null?null:{state:n<=Jf?"near-current":"behind",blocksBehind:n}}function pp(n){return n.state==="near-current"?`Confirmed top is estimated to be within ${String(Jf)} blocks of the chain tip, based on block time.`:`Confirmed top is estimated to be ${hn(n.blocksBehind)} blocks behind the chain tip, based on block time.`}const fx='(function(){"use strict";function je(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function dt(e,t="|"){return e.map(n=>bt(n)).join(t)}function Me(e,t){return typeof t=="bigint"?t.toString():t}class cr{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Re(e){return new cr(e)}function ar(e){return e==null}function Le(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ur(e,t){const n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r){const c=t._zod.def.shape[s];return r?r(c,s):c}):mt(e,s,r?r(o.value,s):o.value))}}function lr(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?pt(e,n,()=>t[n]):mt(e,n,r.value))}}function P(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function fr(e){return JSON.stringify(e)}function dr(e){return e.toLowerCase().trim().replace(/[^\\w\\s-]/g,"").replace(/[\\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const gt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ue(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const hr=Re(()=>{if(j.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ee(e){if(ue(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ue(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function _t(e){return ee(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const pr=new Set(["string","number","symbol"]);function le(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function C(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function g(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bt(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function mr(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const vt={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]},gr={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _r(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return J(s,e,fe(e,t)),C(e,P(n,{shape:s,checks:[]}))}function fe(e,t){const n=F(e),r=[];for(const i of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,i)?.enumerable)throw new Error(`Unrecognized key: "${String(i)}"`);t[i]&&r.push(i)}return r}function br(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(fe(e,t)),o={};return J(o,e,Reflect.ownKeys(F(e)).filter(c=>!s.has(c))),C(e,P(n,{shape:o,checks:[]}))}function vr(e,t){if(!ee(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const i=F(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return C(e,P(e._zod.def,{shape:yt(e,t)}))}function yt(e,t){const n={};return J(n,e,Reflect.ownKeys(F(e))),lr(n,t),n}function yr(e,t){if(!ee(t))throw new Error("Invalid input to safeExtend: expected a plain object");return C(e,P(e._zod.def,{shape:yt(e,t)}))}function wr(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};J(n,e,Reflect.ownKeys(F(e))),J(n,t,Reflect.ownKeys(F(t)));const r=P(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return C(e,r)}function wt(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const c=n?new Set(fe(t,n)):void 0,a={};return J(a,t,Reflect.ownKeys(F(t)),e&&((u,l)=>c&&!c.)DELIM" +R"DELIM(has(l)?u:new e({type:"optional",innerType:u}))),C(t,P(t._zod.def,{shape:a,checks:[]}))}function kr(e,t,n){const r=n?new Set(fe(t,n)):void 0,i={};return J(i,t,Reflect.ownKeys(F(t)),(s,o)=>r&&!r.has(o)?s:new e({type:"nonoptional",innerType:s})),C(t,P(t._zod.def,{shape:i}))}function N(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function te(e){return typeof e=="string"?e:e?.message}function kt(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const i=r.maximum??r.length??r.size;i>=0&&t.push([i,n])}return t}function Fe(e,t,n){var r;for(let i=t;ie;return t[Tr]=!0,t}var $t;const Ue={value:void 0,enumerable:!1};let Ot="captureStackTrace"in Error?Error:null;function Nr(e){const t=Ot;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return Ot=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function f(e,t,n,r){const i={};function s(h){this.def=h,this.constr=d,this.traits=new Set}s.prototype=i;const o=n,c=o&&new WeakSet;function a(h,p){if(h._zod){if(h._zod.traits.has(e))return}else{Ue.value=new s(p);try{Object.defineProperty(h,"_zod",Ue)}finally{Ue.value=void 0}}if(h._zod.traits.add(e),t(h,p),c){const _=Object.getPrototypeOf(h),b=h._zod.constr.prototype;let y=_;for(;y&&y!==b;)y=Object.getPrototypeOf(y);const A=y??_;c.has(A)||(c.add(A),Or(A,o))}const m=d.prototype;for(const _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(_ in h||(h[_]=m[_].bind(h)))}const u=r?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(h){const p=r?.Parent?Nr(l):this;a(p,h);const m=p._zod.deferred;if(m){for(const b of m)b();p._zod.deferred=void 0}const _=globalThis.__zod_globalConfig?.postProcessor;return _&&_(p),p}return Object.defineProperty(d,"init",{value:a}),Object.defineProperty(d,Symbol.hasInstance,{value:h=>r?.Parent&&h instanceof r.Parent?!0:h?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class B extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Et extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}($t=globalThis).__zod_globalConfig??($t.__zod_globalConfig={});const j=globalThis.__zod_globalConfig;function U(e){return e&&Object.assign(j,e),j}function jr(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Me,2)),e.message}function Mr(e){this._zod.message=e}const Rr={get:jr,set:Mr,enumerable:!0,configurable:!0},Ke={value:void 0,enumerable:!1},It=new WeakSet([Object.prototype,Error.prototype]),Lr=f("$ZodError",(e,t)=>{e.name="$ZodError",Ke.value=t,Object.defineProperty(e,"issues",Ke),Ke.value=void 0,Object.defineProperty(e,"message",Rr);const n=Object.getPrototypeOf(e);It.has(n)||(It.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))});function Fr(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Cr(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?Fr(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function xr(e,t=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(c=>r({issues:c},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const c=[...s,...o.path];if(c.length===0)n._errors.push(t(o));else{let a=n,u=0;for(;u{const t=(n,r,i,s)=>{const o=i?{...i,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise)throw new B;if(c.issues.length){const a=new(s?.Err??e)(c.issues.map(u=>V(u,o,U())));throw gt(a,s?.callee??t),a}return c.value};return t},Be=e=>{const t=async(n,r,i,s)=>{const o=i?{...i,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},o);if(c instanceof Promise&&(c=await c),c.issues.length){const a=new(s?.Err??e)(c.issues.map(u=>V(u,o,U())));throw gt(a,s?.callee??t),a}return c.value};return t},Ve=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promi)DELIM" +R"DELIM(se)throw new B;return s.issues.length?Zt(e,s.issues,i):{success:!0,data:s.value}};function Zt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(i=>V(i,n,U()))),t=void 0,n=void 0),r},set error(i){r=i,t=void 0,n=void 0}}}const We=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?Zt(e,s.issues,i):{success:!0,data:s.value}},Dr=Symbol.for("zod.compile.invalid"),Ur=Symbol.for("zod.compile.fallback"),Kr=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Dr)return!0;if(r.definite===!0&&n===void 0)return!1}return Jr(e,t,n)});function Jr(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun;let s;if(i?(r[Ur]=!0,s=i({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new B;return s.issues.length===0}const Br=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Vr=e=>{const t=Je(e),n=(r,i,s,o)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,i,c,he(n,o))};return n},Wr=e=>{const t=Je(e),n=(r,i,s,o)=>t(r,i,s,he(n,o));return n},Gr=e=>{const t=Be(e),n=async(r,i,s,o)=>{const c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,i,c,he(n,o))};return n},qr=e=>{const t=Be(e),n=async(r,i,s,o)=>await t(r,i,s,he(n,o));return n},Hr=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Ve(e)(t,n,i)},Yr=e=>(t,n,r)=>Ve(e)(t,n,r),Xr=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return We(e)(t,n,i)},Qr=e=>async(t,n,r)=>We(e)(t,n,r),ei=/^[cC][0-9a-z]{6,}$/,ti=/^[0-9a-z]+$/,ni=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ri=/^[0-9a-vA-V]{20}$/,ii=/^[A-Za-z0-9]{27}$/,si=/^[a-zA-Z0-9_-]{21}$/;function oi(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const ci=/^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/,ai=/^([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})$/,Pt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${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)$/,ui=/^(?:[A-Za-z0-9_\'+\\-]+\\.)*[A-Za-z0-9_\'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/,li="^(?=[\\\\s\\\\S]*[\\\\p{Extended_Pictographic}\\\\p{Regional_Indicator}\\\\u20E3])[\\\\p{Extended_Pictographic}\\\\p{Emoji_Component}]+$";function fi(){return new RegExp(li,"u")}const di=/^(?:(?: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])$/,hi=/^(([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}|:))$/,pi=/^((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])$/,mi=/^(([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}|:))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gi=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_i=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,bi=/^https?$/,vi=/^\\+[1-9]\\d{6,14}$/,Tt="(?:(?:\\\\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])))";function yi(e){return new RegExp(`^${e}$`)}const wi=yi(Tt);function Ge(e){const t="(?:[01]\\\\d|2[0-3]):[0-5]\\\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\\\d`:`${t}:[0-5]\\\\d\\\\.\\\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\\\d(?:\\\\.\\\\d+)?`:`${t}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`}function ki(e){return new RegExp(`^${Ge(e)}$`)}function zi(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)");const n=`${Ge({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Ge({precision:e.precision})}`:n;return new RegExp(`^${Tt}T(?:${r})$`)}const Si=/^[\\s\\S]{0,}$/,$i=/^-?\\d+(?:\\.\\d+)?$/,Oi=/^(?:true|false)$/i,Ei=/^[^A-Z]*$/,Ii=/^[^a-z]*$/,Z=f("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qe=e=>{const t=e.value;return!ar(t)&&t.length!==void 0},pe={number:"number",bigint:"bigint",object:"date"},At=f("$ZodCheckLessThan",(e,t)=>{Z.init(e,t);const n=pe[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{Z.init(e,t);const n=pe[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:pe[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zi=f("$ZodCheckMultipleOf",(e,t)=>{Z.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ur(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Pi=f("$ZodCheckNumberFormat",(e,t)=>{Z.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=vt[t.format];e._zod.check=o=>{const c=o.value;if(n){if(!Number.isInteger(c)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?o.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}cs&&o.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Ti=f("$ZodCheckMaxLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=qe),e._zod.check=r=>{const i=r.value,s=i.length;if((typeof i=="string"&&s>t.maximum?Ce(i):s)<=t.maximum)return;const c=xe(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ai=f("$ZodCheckMinLength",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=qe),e._zod.check=r=>{const i=r.value,s=i.length;if((typeof i=="string"&&s>=t.minimum&&s=t.minimum)return;const c=xe(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Ni=f("$ZodCheckLengthEquals",(e,t)=>{var n;Z.init(e,t),(n=e._zod.def).when??(n.when=qe),e._zod.check=r=>{const i=r.value,s=i.length,o=typeof i=="string"&&s>=t.length&&s<=t.length*2?Ce(i):s;if(o)DELIM" +R"DELIM(===t.length)return;const c=xe(i),a=o>t.length;r.issues.push({origin:c,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),me=f("$ZodCheckStringFormat",(e,t)=>{var n,r;Z.init(e,t),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ji=f("$ZodCheckRegex",(e,t)=>{me.init(e,t),e._zod.check=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})}}),Mi=f("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ei),me.init(e,t)}),Ri=f("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ii),me.init(e,t)}),Li=f("$ZodCheckIncludes",(e,t)=>{Z.init(e,t);const n=le(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),Fi=f("$ZodCheckStartsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`^${le(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Ci=f("$ZodCheckEndsWith",(e,t)=>{Z.init(e,t);const n=new RegExp(`.*${le(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),xi=f("$ZodCheckOverwrite",(e,t)=>{Z.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class Di{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`\n`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {\n${n.join(`\n`)}\n};`)(...Object.values(this.closed))}}const Ui={major:4,minor:6,patch:7},z=f("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ui;const r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(const s of i)for(const o of s._zod.onattach)o(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(c,a,u)=>{if(c.memo)return c;let l=N(c),d;for(const h of a){if(h._zod.def.when){if(zr(c)||!h._zod.def.when(c))continue}else if(l)continue;const p=c.issues.length,m=h._zod.check(c);if(m instanceof Promise&&u?.async===!1)throw new B;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,c.issues.length!==p&&(Fe(c.issues,p,e),l||(l=N(c,p)))});else{if(c.issues.length===p)continue;Fe(c.issues,p,e),l||(l=N(c,p))}}return d?d.then(()=>c):c},o=(c,a,u)=>{if(N(c))return c.aborted=!0,c;const l=s(a,i,u);if(l instanceof Promise){if(u.async===!1)throw new B;return l.then(d=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(c,a)=>{if(a.skipChecks)return e._zod.parse(c,a);if(a.direction==="backward"){const l=e._zod.parse({value:c.value,issues:[]},{...a,skipChecks:!0});return l instanceof Promise?l.then(d=>o(d,c,a)):o(l,c,a)}const u=e._zod.parse(c,a);if(u instanceof Promise){if(a.async===!1)throw new B;return u.then(l=>s(l,i,a))}return s(u,i,a)}}},{get"~standard"(){return zt(this,"~standard",Mt(this))},set"~standard"(e){x(this,"~standard",e)}}),jt=(e,t)=>e.issues.length?{issues:e.issues.map(n=>V(n,t,U()))}:{value:e.value};async function Ki(e,t){const n={async:!0};return jt(await e._zod.run({value:t,issues:[]},n),n)}function Mt(e){return{validate:t=>{const n={async:!1};try{const r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return jt(r,n)}catch{}return Ki(e,t)},vendor:"zod",version:1}}const He=f("$ZodString",(e,t)=>{z.init(e,t),e._zod.pattern=t.pattern??Si,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),k=f("$ZodStringFormat",(e,t)=>{me.init(e,t),He.init(e,t)}),Ji=f("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ai),k.init(e,t)}),Bi=f("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Pt(r))}else t.pattern??(t.pattern=Pt());k.init(e,t)}),Vi=f("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ui),k.init(e,t)}),Rt=1,ge=2;function Lt(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Wi(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?Lt(e)||ge:Gi(e,t)}function Gi(e,t){if(!t.normalize&&t.protocol?.source===bi.source&&!/^https?:\\/\\//i.test(e))return Rt;try{if(typeof URL<"u"){const n=URL;if(typeof n.parse=="function")return n.parse(e)??ge}return new URL(e)}catch{return ge}}const qi=/[\\t\\n\\r]/g;function Ft(e){return e.replace(qi,"")}function Hi(e,t){return t.lastIndex=0,t.test(e.hostname)}function Yi(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const Xi=f("$ZodURL",(e,t)=>{k.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=Wi(r,t);if(i===Rt){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(i===ge){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Ft(r);return}t.hostname&&!Hi(i,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Yi(i,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Ft(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Qi=f("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=fi()),k.init(e,t)}),es=f("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?si:oi(t.length)),k.init(e,t)}),ts=f("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ei),k.init(e,t)}),ns=f("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ti),k.init(e,t)}),rs=f("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ni),k.init(e,t)}),is=f("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ri),k.init(e,t)}),ss=f("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ii),k.init(e,t)}),os=f("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=zi(t)),k.init(e,t)}),cs=f("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wi),k.init(e,t)}),as=f("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ki(t)),k.init(e,t)}),us=f("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ci),k.init(e,t)}),ls=f("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=di),k.init(e,t)}),fs=/^[0-9a-fA-F:.]+$/;function Ct(e){return fs.test(e)?Lt(`http://[${e}]`):!1}const ds=f("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=hi),k.init(e,t),e._zod.check=n=>{Ct(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),hs=f("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pi),k.init(e,t)});function ps(e){const t=e.split("/");if(t.length!==2)return!1;const[n,r]=t;)DELIM" +R"DELIM(if(!r)return!1;const i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ct(n)}const ms=f("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mi),k.init(e,t),e._zod.check=n=>{ps(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function xt(e){if(e==="")return!0;if(/\\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Dt=/^[0-9a-zA-Z+/]*={0,2}$/,gs=f("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Dt),k.init(e,t),e._zod.check=n=>{xt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),Ye=/^[A-Za-z0-9_-]*$/;function _s(e){if(!Ye.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return xt(n)}const bs=f("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ye),k.init(e,t),e._zod.check=n=>{_s(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),vs=f("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vi),k.init(e,t)});function ys(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const ws=f("$ZodJWT",(e,t)=>{k.init(e,t),e._zod.check=n=>{ys(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ut=f("$ZodNumber",(e,t)=>{z.init(e,t),e._zod.pattern=$i,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),ks=f("$ZodNumberFormat",(e,t)=>{Pi.init(e,t),Ut.init(e,t)}),zs=f("$ZodBoolean",(e,t)=>{z.init(e,t),e._zod.pattern=Oi,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Ss=f("$ZodUnknown",(e,t)=>{z.init(e,t),e._zod.parse=n=>n}),$s=f("$ZodNever",(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Os(e,t){const n=kt(e._zod.def.checks);if(!n.length)return;const r=Math.min(...n.map(s=>s[0])),i=e._zod.parse;e._zod.parse=(s,o)=>{const c=t(s.value);if(c>r&&!o?.skipChecks&&o?.direction!=="backward"){for(const[a,u]of kt(e._zod.def.checks))if(c>a&&u._zod.def.when(s)){const l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Fe(s.issues,l,e),s}}return i(s,o)}}const Es=e=>Array.isArray(e)?e.length:-1;function Kt(e,t,n){e.issues.length&&t.issues.push(...de(n,e.issues)),t.value[n]=e.value}const Is=f("$ZodArray",(e,t)=>{z.init(e,t);const n=j.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),i):Array(s.length);const o=[],c=i?.abortEarly;for(let a=0;aKt(d,r,a)));else if(Kt(l,r,a),c&&l.issues.length!==0&&N(l))break}return o.length?Promise.all(o).then(()=>r):r},Os(e,Es)});function _e(e,t,n,r,i,s){const o=n in r,c=s==="optional";if(!(!o&&c&&i==="optional")){if(e.issues.length){if(i!==void 0&&c&&!o)return;t.issues.push(...de(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(o||i==="defaulted"&&!c)&&(t.value[n]=void 0):t.value[n]=e.value}}const Zs=[];function Jt(e){const t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Zs,i=r.length?[...t,...r]:t;for(const o of i)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(o)}": expected a Zod schema`);const s=mr(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function Bt(e,t,n,r,i,s,o){const c=[],a=i.keySet,u=i.catchall._zod,l=u.def.type,d=u.optin,h=u.optout;let p=0;for(const m in t){if(o&&n.issues.length!==p){if(N(n,p))break;p=n.issues.length}if(a.has(m))continue;if(m==="__proto__"){l==="never"&&c.push(m);continue}if(l==="never"){c.push(m);continue}const _=u.run({value:t[m],issues:[]},r);_ instanceof Promise?e.push(_.then(b=>_e(b,n,m,t,d,h))):_e(_,n,m,t,d,h)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}const Ps=f("$ZodObject",(e,t)=>{z.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){const u=()=>{const l={...r};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=r,Object.defineProperty(t,"shape",{get:u})}const i=Re(()=>Jt(t));v(e,"propValues",u=>{const l=u.def.shape,d={};for(const h in l){const p=l[h]._zod;if(p.values){Object.prototype.hasOwnProperty.call(d,h)||K(d,h,new Set);for(const m of p.values)d[h].add(m);p.optin!==void 0&&d[h].add(void 0)}}return d});const s=ue,o=t.catchall;let c;const a=j.memoizer;a?.attach(e),e._zod.parse=(u,l)=>{c??(c=i.value);const d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=a?a.alloc(e,u,{},l):{};const h=[],p=c.shape,m=l?.abortEarly;let _=u.issues.length;for(const b of c.allKeys){if(m&&u.issues.length!==_){if(N(u,_))break;_=u.issues.length}if(b==="__proto__")continue;const y=p[b],A=y._zod.optin,ce=y._zod.optout,ae=y._zod.run({value:d[b],issues:[]},l);ae instanceof Promise?h.push(ae.then(E=>_e(E,u,b,d,A,ce))):_e(ae,u,b,d,A,ce)}return o?Bt(h,d,u,l,i.value,e,m===!0):h.length?Promise.all(h).then(()=>u):u}}),Ts=f("$ZodObjectJIT",(e,t)=>{Ps.init(e,t);const n=e._zod.parse,r=Re(()=>Jt(t)),i=j.memoizer,s=p=>{const m=r.value,_=m.symbolKeys,b=new Di(["payload","ctx"],{shape:p,inst:e,memo:i,syms:_}),y=E=>`shape[${E}]._zod.run({ value: input[${E}], issues: [] }, ctx)`,A=(E,w)=>`\n let ${E}_ab = false;\n for (let i = 0; i < ${E}.issues.length; i++) {\n const iss = ${E}.issues[i];\n iss.path = iss.path ? [${w}, ...iss.path] : [${w}];\n payload.issues.push(iss);\n if (iss.continue !== true) ${E}_ab = true;\n }\n if (${E}_ab && ctx && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }`;b.write("const input = payload.value;");const ce=Object.create(null);let ae=0;for(const E of m.allKeys)ce[E]=`key_${ae++}`;b.write(i?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const E of m.allKeys){if(E==="__proto__")continue;const w=ce[E],L=typeof E=="symbol"?`syms[${_.indexOf(E)}]`:fr(E),lt=`${L} in input`,sr=p[E],ft=sr?._zod?.optin,or=ft!==void 0,pu=sr?._zod?.optout==="optional";if(b.write(`const ${w} = ${y(L)};`),or&&pu){const mu=ft==="optional"?`${w}_present`:`${w}.value !== undefined || ${w}_present`;b.write(`\n const ${w}_present = ${lt};\n if (!${w}.issues.length || ${w}_present) {\n if (${w}.issues.length) {${A(w,L)}\n }\n\n if (${mu}) {\n newResult[${L}] = ${w}.value;\n }\n }\n\n `)}else or?(b.write(`\n if (${w}.issues.length) {${A(w,L)}\n }\n `),ft==="defaulted"?b.write(`newResult[${L}] = ${w}.value;`):b.write(`\n if (${w}.value !== undefined || ${lt}) {\n newResult[${L}] = ${w}.value;\n }\n `)):b.write(`\n const ${w}_present = ${lt};\n if (${w}.issues.length) {${A(w,L)}\n }\n if (!${w}_present && !${w}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${L}]\n });\n if (ctx)DELIM" +R"DELIM( && ctx.abortEarly) {\n payload.value = newResult;\n return payload;\n }\n }\n\n if (${w}_present) {\n newResult[${L}] = ${w}.value;\n }\n\n `)}return b.write("payload.value = newResult;"),b.write("return payload;"),b.compile()};let o;const c=ue,a=!j.jitless,l=a&&hr.value,d=t.catchall;let h;e._zod.parse=(p,m)=>{h??(h=r.value);const _=p.value;return c(_)?a&&l&&m?.async===!1&&m.jitless!==!0?(o||(o=s(t.shape)),p=o(p,m),d?Bt([],_,p,m,h,e,m?.abortEarly===!0):p):n(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),p)}});function Vt(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!N(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>V(o,r,U())))}),t)}const As=f("$ZodUnion",(e,t)=>{z.init(e,t),v(e,"optin",r=>r.def.options.some(i=>i._zod.optin==="defaulted")?"defaulted":r.def.options.some(i=>i._zod.optin!==void 0)?"optional":void 0),v(e,"optout",r=>r.def.options.some(i=>i._zod.optout==="optional")?"optional":void 0),v(e,"values",r=>{if(r.def.options.every(i=>i._zod.values))return new Set(r.def.options.flatMap(i=>Array.from(i._zod.values)))}),v(e,"pattern",r=>{if(r.def.options.every(i=>i._zod.pattern)){const i=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Le(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1;const o=[];for(const c of t.options){const a=c._zod.run({value:r.value,issues:[]},i);if(a instanceof Promise)o.push(a),s=!0;else{if(a.issues.length===0)return a;o.push(a)}}return s?Promise.all(o).then(c=>Vt(c,r,e,i)):Vt(o,r,e,i)}}),Ns=f("$ZodIntersection",(e,t)=>{z.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([a,u])=>Wt(n,a,u)):Wt(n,s,o)}});function Xe(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(ee(e)&&ee(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,"__proto__")&&delete i.__proto__;for(const s of r){if(s==="__proto__")continue;const o=Xe(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)i??(i=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){const h=String(u.path[0]);s.has(h)||s.set(h,u),d=[h]}else return!1;for(const h of d)r.has(h)||r.set(h,{}),r.get(h)[l]=!0;return!0};for(const u of t.issues)o(u,"l")||e.issues.push(u);for(const u of n.issues)o(u,"r")||e.issues.push(u);const c=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(c.length){const u=i?c.filter(l=>i.keys.includes(l)):[];u.length&&e.issues.push({...i,keys:u});for(const l of c)!u.includes(l)&&s.has(l)&&e.issues.push(s.get(l))}const a=Xe(t.value,n.value);if(!a.valid){if(N(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`)}return e.value=a.data,e}const js=f("$ZodTuple",(e,t)=>{z.init(e,t);const n=t.items,r=j.memoizer;r?.attach(e),e._zod.parse=(i,s)=>{const o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],s):[];const c=[],a=Gt(n,"optin"),u=Gt(n,"optout");if(!t.rest){if(o.lengthn.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}const l=new Array(n.length),d=t.rest?s?.abortEarly:void 0;let h=!1;for(let p=0;p{l[p]=_})):(l[p]=m,d&&!h&&m.issues.length&&(h=N(m)))}if(t.rest&&!h){let p=n.length-1;const m=o.slice(n.length);let _=i.issues.length;for(const b of m){if(d&&i.issues.length!==_){if(N(i,_))break;_=i.issues.length}p++;const y=t.rest._zod.run({value:b,issues:[]},s);y instanceof Promise?c.push(y.then(A=>qt(A,i,p))):qt(y,i,p)}}return c.length?Promise.all(c).then(()=>Ht(l,i,n,o,u)):Ht(l,i,n,o,u)}});function Gt(e,t){for(let n=e.length-1;n>=0;n--)if(!(t==="optin"?e[n]._zod.optin!==void 0:e[n]._zod.optout==="optional"))return n+1;return 0}function qt(e,t,n){e.issues.length&&t.issues.push(...de(n,e.issues)),t.value[n]=e.value}function Ht(e,t,n,r,i){for(let s=0;s=i&&n[s]._zod.optin==="optional"){t.value.length=s;break}if(o.issues.length){if(!c&&s>=i){t.value.length=s;break}t.issues.push(...de(s,o.issues))}t.value[s]=o.value}for(let s=t.value.length-1;s>=r.length&&(n[s]._zod.optout==="optional"&&t.value[s]===void 0);s--)t.value.length=s;return t}const Ms=f("$ZodEnum",(e,t)=>{z.init(e,t);const n=je(t.entries),r=new Set(n);e._zod.values=r,v(e,"pattern",i=>{const s=je(i.def.entries).filter(o=>pr.has(typeof o));return new RegExp(s.length?`^(${s.map(o=>le(o.toString())).join("|")})$`:"^[^\\\\s\\\\S]$")}),e._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),Rs=f("$ZodTransform",(e,t)=>{z.init(e,t),e._zod.optin="optional",j.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Et(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new B;return n.value=i,n}});function Yt(e,t){return e.value=t.issues.length?void 0:t.value,e}const Xt=f("$ZodOptional",(e,t)=>{z.init(e,t),v(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",v(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),v(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Le(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(s=>Yt(n,s)):Yt(n,i)}return t.innerType._zod.run(n,r)}}),Ls=f("$ZodExactOptional",(e,t)=>{Xt.init(e,t),v(e,"values",n=>n.def.innerType._zod.values),v(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Fs=f("$ZodNullable",(e,t)=>{z.init(e,t),v(e,"optin",n=>n.def.innerType._zod.optin),v(e,"optout",n=>n.def.innerType._zod.optout),v(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Le(r.source)}|null)$`):void 0}),v(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),Cs=f("$ZodDefault",(e,t)=>{z.init(e,t),e._zod.optin="defaulted",v(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>Qt(s,t)):Qt(i,t)}});function Qt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const xs=f("$ZodPrefault",(e,t)=>{z.init(e,t),e._zod.optin="defaulted",v(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Ds=f("$ZodNonOption)DELIM" +R"DELIM(al",(e,t)=>{z.init(e,t),v(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>en(s,e)):en(i,e)}});function en(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function tn(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(i=>V(i,r,U()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Us=f("$ZodCatch",(e,t)=>{z.init(e,t),v(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),v(e,"optout",n=>n.def.innerType._zod.optout),v(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run({value:n.value,issues:[]},r);return i instanceof Promise?i.then(s=>tn(n,s,t,r)):tn(n,i,t,r)}}),Ks=f("$ZodPipe",(e,t)=>{z.init(e,t),v(e,"values",n=>n.def.in._zod.values),v(e,"optin",n=>n.def.in._zod.optin),v(e,"optout",n=>n.def.out._zod.optout),v(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(o=>be(o,t.in,r)):be(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>be(s,t.out,r)):be(i,t.out,r)}});function be(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Js=f("$ZodReadonly",(e,t)=>{z.init(e,t),v(e,"propValues",n=>n.def.innerType._zod.propValues),v(e,"values",n=>n.def.innerType._zod.values),v(e,"optin",n=>n.def.innerType?._zod?.optin),v(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(nn):nn(i)}});function nn(e){return e.memo||(e.value=Object.freeze(e.value)),e}const Bs=f("$ZodCustom",(e,t)=>{Z.init(e,t),z.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>rn(s,n,r,e));rn(i,n,r,e)}});function rn(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(ne(i))}}class Vs extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Qe="~memo",sn=[];function on(e){return e!==null&&typeof e=="object"}function et(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const cn=new WeakMap,re=0,ve=1,ie=2;function ye(e,t,n){const r=cn.get(e);if(r!==void 0)return r?ie:re;if(t.has(e))return ie;t.add(e);let i=re;const s=l=>{if(i!==ie&&l?._zod){const d=ye(l,t);d>i&&(i=d)}},o=(l,d)=>{let h=re;for(const p of Reflect.ownKeys(l)){const m=Object.getOwnPropertyDescriptor(l,p);if(!m.enumerable)continue;const _=m.get?ve:m.value?._zod?ye(m.value,t):re;_>h&&(h=_)}return h},c=l=>{l>i&&(i=l)},a=e._zod.def;switch(a.type){case"object":{const l=ht(a);c(l?o(l):ve),s(a.catchall);break}case"array":s(a.element);break;case"tuple":for(const l of a.items)s(l);s(a.rest);break;case"record":case"map":s(a.keyType),s(a.valueType);break;case"set":s(a.valueType);break;case"union":for(const l of a.options)s(l);break;case"intersection":s(a.left),s(a.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(a.innerType);break;case"pipe":s(a.in),s(a.out);break;case"function":s(a.input),s(a.output);break;case"lazy":{const l=a._cachedInner??void 0;c(l?ye(l,t):ve);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const l in a){const d=Object.getOwnPropertyDescriptor(a,l);if(!d||d.get)continue;const h=d.value;if(!(!h||typeof h!="object")){if(h._zod)s(h);else if(Array.isArray(h))for(const p of h)s(p)}}}return t.delete(e),Ws(e,i)}function Ws(e,t){return t!==ve&&cn.set(e,t===ie),t}function Gs(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let we;const ke=[],qs={alloc(e,t,n){const r=we;if(!r)return n;we=void 0;const i={value:n,issues:null};return r.set(t.value,i),ke.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(i,s)=>{if(s.direction!=="backward"&&Ys(s,i.value))throw new Vs;return n(i,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,i,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const o=e._zod.parse,c=(a,u)=>{if(n===void 0){const y=ye(e,new Set);if(y===re)return e._zod.parse=o,e._zod.run===c&&(e._zod.run=o),o(a,u);y===ie||r?n=!0:r=!0}const l=a.value;if(!on(l))return o(a,u);let d=u[Qe];d||(d={buckets:new WeakMap,backEdges:void 0},u[Qe]=d);let h;i===u?h=s:(h=Gs(d,e),i=u,s=h);const p=h.get(l);if(p)return a.value=p.value,p.issues?p.issues.length&&a.issues.push(...et(p.issues)):(a.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(p.value)),a;we=h;const m=ke.length,_=o(a,u);we=void 0;const b=ke.length>m?ke.pop():void 0;return _ instanceof Promise?_.then(y=>(b&&(b.issues=y.issues.length?et(y.issues):sn),y)):(b&&(b.issues=_.issues.length?et(_.issues):sn),_)};e._zod.parse=c,e._zod.run===o&&(e._zod.run=c)})}};function Hs(){return qs}function Ys(e,t){const n=e[Qe]?.backEdges;return n!==void 0&&on(t)&&n.has(t)}const Xs=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function i(s,o){return s==="number"&&typeof o=="number"&&!Number.isFinite(o)?String(o):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const o=i(s.expected),c=$r(s.input),a=i(c,s.input);return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${bt(s.values[0])}`:`Invalid option: expected one of ${dt(s.values,"|")}`;case"too_big":{const o=s.exact?"exactly ":s.inclusive?"<=":"<",c=t(s.origin);return c?`Too big: expected ${s.origin??"value"} to have ${o}${s.maximum.toString()} ${c.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${o}${s.maximum.toString()}`}case"too_small":{const o=s.exact?"exactly ":s.inclusive?">=":">",c=t(s.origin);return c?`Too small: expected ${s.origin} to have ${o}${s.minimum.toString()} ${c.unit}`:`Too small: expected ${s.origin} to be ${o}${s.minimum.toString()}`}case"invalid_format":{const o=s;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${n[o.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${dt(s.keys,", ")}`;case"invalid_)DELIM" +R"DELIM(key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(c=>`\'${c}\'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function Qs(){return{localeError:Xs()}}var an;class eo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function to(){return new eo}(an=globalThis).__zod_globalRegistry??(an.__zod_globalRegistry=to());const se=globalThis.__zod_globalRegistry;function un(e){return e.checks&&(e.checks=[...e.checks]),e}function no(e,t){return new e(un({type:"string",...g(t)}))}function ro(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function io(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function so(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function oo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function co(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function ao(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function uo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function lo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function fo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function ho(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function po(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function mo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function go(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function _o(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function bo(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function vo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function yo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function wo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function ko(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function zo(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function So(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function $o(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Oo(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Eo(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Io(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Zo(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Po(e,t){return new e(un({type:"number",checks:[],...g(t)}))}function To(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function Ao(e,t){return new e({type:"boolean",...g(t)})}function No(e){return new e({type:"unknown"})}function jo(e,t){return new e({type:"never",...g(t)})}function ln(e,t){return new At({check:"less_than",...g(t),value:e,inclusive:!1})}function tt(e,t){return new At({check:"less_than",...g(t),value:e,inclusive:!0})}function fn(e,t){return new Nt({check:"greater_than",...g(t),value:e,inclusive:!1})}function nt(e,t){return new Nt({check:"greater_than",...g(t),value:e,inclusive:!0})}function dn(e,t){return new Zi({check:"multiple_of",...g(t),value:e})}function hn(e,t){return new Ti({check:"max_length",...g(t),maximum:e})}function ze(e,t){return new Ai({check:"min_length",...g(t),minimum:e})}function pn(e,t){return new Ni({check:"length_equals",...g(t),length:e})}function Mo(e,t){return new ji({check:"string_format",format:"regex",...g(t),pattern:e})}function Ro(e){return new Mi({check:"string_format",format:"lowercase",...g(e)})}function Lo(e){return new Ri({check:"string_format",format:"uppercase",...g(e)})}function Fo(e,t){return new Li({check:"string_format",format:"includes",...g(t),includes:e})}function Co(e,t){return new Fi({check:"string_format",format:"starts_with",...g(t),prefix:e})}function xo(e,t){return new Ci({check:"string_format",format:"ends_with",...g(t),suffix:e})}function W(e){return new xi({check:"overwrite",tx:e})}function Do(e){return W(t=>t.normalize(e))}function Uo(){return W(e=>e.trim())}function Ko(){return W(e=>e.toLowerCase())}function Jo(){return W(e=>e.toUpperCase())}function Bo(){return W(e=>dr(e))}function Vo(e,t,n){return new e({type:"array",element:t,...g(n)})}function Wo(e,t,n){return new e({type:"custom",check:"custom",fn:t,...g(n)})}function Go(e,t){const n=qo(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(ne(i,r.value,n._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(ne(s))}},e(r.value,r)),t);return n}function qo(e,t){const n=new Z({check:"custom",...g(t)});return n._zod.check=e,n}function oe(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&K(e,r,n[r]);return e}function mn(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??se,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function G(e,t,n,r,i){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(i);return Object.assign(n,s),!0}function O(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const c=e._zod.toJSONSchema?.();if(c)o.schema=c;else{const l={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,l);else{const h=o.schema,p=t.processors[i.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);p(e,t,h,l)}const d=e._zod.parent;d&&(o.ref||(o.ref=d),O(d,t,l),t.seen.get(d).isParent=!0)}const a=t.metadataRegistry.get(e);return a&&oe(o.schema,a),t.io==="input"&&I(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}funct)DELIM" +R"DELIM(ion gn(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function _n(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const o of e.seen.entries()){const c=e.metadataRegistry.get(o[0])?.id;if(c){const a=r.get(c);if(a&&a!==o[0])throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(c,o[0])}}const i=o=>{const c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const d=e.external.registry.get(o[0])?.id,h=e.external.uri??(m=>m);if(d)return{ref:h(d)};const p=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=p,{defId:p,ref:`${h("__shared")}#/${c}/${gn(p)}`}}const a="#",u=`${a}/${c}/`;if(o[1]===n&&!o[1].schema.id)return{ref:a};const l=o[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+gn(l)}},s=o=>{if(o[1].schema.$ref)return;const c=o[1],{ref:a,defId:u}=i(o);c.def={...c.schema},u&&(c.defId=u);const l=c.schema;for(const d in l)delete l[d];l.$ref=a};if(e.cycles==="throw")for(const o of e.seen.entries()){const c=o[1];if(c.cycle)throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/\n\nSet the \\`cycles\\` parameter to \\`"ref"\\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const c=o[1];if(t===o[0]){s(o);continue}if(e.external){const u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(c.cycle){s(o);continue}c.count>1&&e.reused==="ref"&&s(o)}e.external&&(e.sharedDefsExtractedFor=e.external)}function bn(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;bn(r);const i=Object.keys(r);if(i.length!==1||i[0]!=="type")return;const s=r.type;for(const o of Array.isArray(s)?s:[s]){if(typeof o!="string")return;n.includes(o)||n.push(o)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const vn=new Set(["type","properties","required","additionalProperties"]),yn=["oneOf","anyOf"];function wn(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function rt(e){const t=[];for(const s of e){if(typeof s!="object"||s.type!=="object")return null;for(const o in s)if(!vn.has(o))return null;t.push(s)}const n={},r=new Set;for(const s of t){for(const o in s.properties){if(Object.prototype.hasOwnProperty.call(n,o))continue;const c=[];for(const u of t){const l=u.properties?.[o]??wn(u);l!=null&&(c.some(d=>JSON.stringify(d)===JSON.stringify(l))||c.push(l))}const a=c.length===1?c[0]:rt(c)??{allOf:c};K(n,o,a)}for(const o of s.required??[])r.add(o)}const i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(s=>s.additionalProperties===!1))i.additionalProperties=!1;else{const s=[];for(const o of t){const c=wn(o);c&&!s.some(a=>JSON.stringify(a)===JSON.stringify(c))&&s.push(c)}s.length===1?i.additionalProperties=s[0]:s.length>1&&(i.additionalProperties={allOf:s})}return i}function Ho(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const i of vn)if(i in e)return;const n=t.filter(i=>yn.some(s=>Array.isArray(i[s])));let r=null;if(!n.length)r=rt(t);else{const i=n[0],s=yn.find(a=>Array.isArray(i[a]));if(Object.keys(i).length!==1)return;const o=t.filter(a=>a!==i),c=i[s].map(a=>rt([...o,a]));if(c.some(a=>!a))return;r={[s]:c}}r&&(delete e.allOf,oe(e,r))}function kn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=c=>{const a=e.seen.get(c);if(a.ref===null)return;const u=a.def??a.schema,l={...u},d=a.ref;if(a.ref=null,d){r(d);const p=e.seen.get(d),m=p.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(m)):oe(u,m),oe(u,l),c._zod.parent===d)for(const b in u)b==="$ref"||b==="allOf"||b in l||delete u[b];if(m.$ref&&p.def)for(const b in u)b==="$ref"||b==="allOf"||b in p.def&&JSON.stringify(u[b])===JSON.stringify(p.def[b])&&delete u[b]}const h=c._zod.parent;if(h&&h!==d){r(h);const p=e.seen.get(h);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(const m in u)m==="$ref"||m==="allOf"||m in p.def&&JSON.stringify(u[m])===JSON.stringify(p.def[m])&&delete u[m]}e.override({zodSchema:c,jsonSchema:u,path:a.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const c of[...e.seen.entries()].reverse())r(c[0]);if(e.target!=="openapi-3.0")for(const c of e.seen.entries())bn(c[1].def??c[1].schema);for(const c of e.deferred)c();if(e.intersections.length){const c=new Map;for(const a of e.seen.values())for(const u of[a.schema,a.def]){const l=u?.allOf;if(!Array.isArray(l))continue;const d=c.get(l);d?d.push(u):c.set(l,[u])}for(const a of e.intersections)for(const u of c.get(a)??[])Ho(u)}}const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(c)}oe(i,n.defId?n.schema:n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const c of e.seen.entries()){const a=c[1];a.def&&a.defId&&(a.def.id===a.defId&&delete a.def.id,K(o,a.defId,a.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const c=JSON.parse(JSON.stringify(i));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Se(t,"input",e.processors),output:Se(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function I(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return I(r.element,n);if(r.type==="set")return I(r.valueType,n);if(r.type==="lazy")return I(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return I(r.innerType,n);if(r.type==="intersection")return I(r.left,n)||I(r.right,n);if(r.type==="record"||r.type==="map")return I(r.keyType,n)||I(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:I(r.in,n)||I(r.out,n);if(r.type==="object"){for(const i in r.shape)if(I(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(I(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(I(i,n))return!0;return!!(r.rest&&I(r.rest,n))}return!1}const Yo=(e,t={})=>n=>{const r=mn({...n,processors:t});return O(e,r),_n(r,e),kn(r,e)},Se=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=mn({...i??{},target:s,io:t,processors:n});return O(e,o),_n(o,e),kn(o,e)},q=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},H=(e,t,n)=>{(e[t]===void 0||n{q(e,"minimum",t),H(e,"maximum",t)},Sn=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},$n=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},On=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},En=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},In=(e,t)=>q(e,"minimum",t.minimum),Zn=(e,t)=>H(e,"maximum",t.maximum),Pn=e=>(t,n)=>{En(t,n.format);const[r,i]=e[n.format];q(t,"minimum",r),H(t,"maximum",i)},Xo={greater_than:(e,t)=>q(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>H(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Sn(e,t.value),number_format:Pn(vt),bigint_format:Pn(gr),min_length:In,max_length:Zn,length_equals)DELIM" +R"DELIM(:(e,t)=>zn(e,t.length),min_size:In,max_size:Zn,size_equals:(e,t)=>zn(e,t.size),string_format:(e,t)=>{En(e,t.format),t.pattern&&$n(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>On(e,t.mime)};function M(e){const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const s of r)Xo[s._zod.def.check]?.(t,s._zod.def);const i=e._zod.bag;i.minimum!==void 0&&q(t,"minimum",i.minimum),i.exclusiveMinimum!==void 0&&q(t,"exclusiveMinimum",i.exclusiveMinimum),i.maximum!==void 0&&H(t,"maximum",i.maximum),i.exclusiveMaximum!==void 0&&H(t,"exclusiveMaximum",i.exclusiveMaximum),i.multipleOf!==void 0&&Sn(t,i.multipleOf),i.format!==void 0&&(t.format??(t.format=i.format),i.format.includes("int")&&(t.isInt=!0)),i.mime&&On(t,i.mime);for(const s of i.patterns??[])$n(t,s);return t}const Qo={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ec=new Map([[Dt,gi],[Ye,_i]]),tc=e=>ec.get(e)??e,nc=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:c,patterns:a,contentEncoding:u,laxFormat:l}=M(e);if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),c&&(i.format=Qo[c]??c,i.format===""&&delete i.format,(c==="time"||l)&&delete i.format),u&&(i.contentEncoding=u),a&&a.size>0){const d=[...a].map(tc);d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},rc=(e,t,n,r)=>{const i=n,{minimum:s,maximum:o,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:u,isInt:l}=M(e);i.type=l?"integer":"number";const d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),h=typeof a=="number"&&a<=(o??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof s=="number"&&(i.minimum=s),h?p?(i.maximum=a,i.exclusiveMaximum=!0):i.exclusiveMaximum=a:typeof o=="number"&&(i.maximum=o),c){const m=new Set;for(const y of c)Number.isFinite(y)&&y!==0?m.add(Math.abs(y)):G(e,t,i,r,`A multipleOf divisor of ${y} cannot be represented in JSON Schema`);const[_,...b]=m;_!==void 0&&(i.multipleOf=_),b.length&&(i.allOf=[...i.allOf??[],...b.map(y=>({multipleOf:y}))])}},ic=(e,t,n,r)=>{n.type="boolean"},sc=(e,t,n,r)=>{n.not={}},oc=(e,t,n,r)=>{},cc=(e,t,n,r)=>{const i=e._zod.def,s=je(i.entries);if(s.length===0){n.not={};return}s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},ac=(e,t,n,r)=>{G(e,t,n,r,"Custom types cannot be represented in JSON Schema")},uc=(e,t,n,r)=>{G(e,t,n,r,"Transforms cannot be represented in JSON Schema")},lc=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:c}=M(e);typeof o=="number"&&(i.minItems=o),typeof c=="number"&&(i.maxItems=c),i.type="array",i.items=O(s.element,t,{...r,path:[...r.path,"items"]})};function $e(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?$e(t.out):t.type==="catch"?$e(t.innerType):e._zod.optin}const fc=(e,t,n,r)=>{const i=n,s=e._zod.def,o=s.shape;if(Object.getOwnPropertySymbols(o).length&&G(e,t,i,r,"Symbol keys cannot be represented in JSON Schema"))return;i.type="object",i.properties={};for(const u in o)K(i.properties,u,O(o[u],t,{...r,path:[...r.path,"properties",u]}));const a=[];for(const u of Object.keys(o)){const l=s.shape[u];(t.io==="input"?$e(l)===void 0:l._zod.optout===void 0)&&a.push(u)}a.length>0&&(i.required=a),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=O(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},dc=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,o=i.options.map((c,a)=>O(c,t,{...r,path:[...r.path,s?"oneOf":"anyOf",a]}));s?n.oneOf=o:n.anyOf=o},hc=(e,t,n,r)=>{const i=e._zod.def,s=O(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=O(i.right,t,{...r,path:[...r.path,"allOf",1]}),c=u=>"allOf"in u&&Object.keys(u).length===1,a=[...c(s)?s.allOf:[s],...c(o)?o.allOf:[o]];n.allOf=a,t.intersections.push(a)},pc=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",c=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",a=s.items.map((_,b)=>O(_,t,{...r,path:[...r.path,o,b]})),u=s.rest?O(s.rest,t,{...r,path:[...r.path,c,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;let l=s.items.length;for(;l>0;){const _=s.items[l-1];if(!(t.io==="input"?$e(_)!==void 0:_._zod.optout==="optional"))break;l--}const d=s.items.length,h=!s.rest;t.target==="draft-2020-12"?(i.prefixItems=a,h?i.items=!1:u&&(i.items=u),l>0&&(i.minItems=l),h&&(i.maxItems=d)):t.target==="openapi-3.0"?(i.items={anyOf:a},u&&i.items.anyOf.push(u),l>0&&(i.minItems=l),h&&(i.maxItems=d)):(i.items=a,h?i.additionalItems=!1:u&&(i.additionalItems=u),l>0&&(i.minItems=l),h&&(i.maxItems=d));const{minimum:p,maximum:m}=M(e);typeof p=="number"&&(i.minItems=p),typeof m=="number"&&(i.maxItems=m)},mc=(e,t,n,r)=>{const i=e._zod.def,s=O(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},gc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},it=Symbol();function Tn(e,t,n,r,i){let s=!1;const o=JSON.stringify(e,(c,a)=>typeof a!="bigint"?a:(s=!0,null));return s?(G(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),it):JSON.parse(o)}const _c=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;const o=Tn(i.defaultValue,e,t,n,r);o!==it&&(n.default=o)},bc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);if(s.ref=i.innerType,t.io!=="input")return;const o=Tn(i.defaultValue,e,t,n,r);o!==it&&(n._prefault=o)},vc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{G(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=o},yc=(e,t,n,r)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?s?i.out:i.in:i.out;O(o,t,r);const c=t.seen.get(e);c.ref=o},wc=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},An=(e,t,n,r)=>{const i=e._zod.def;O(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},Nn=new WeakSet([Object.prototype,Error.prototype]);function Oe(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const T=f("ZodError",(e,t)=>{Lr.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Nn.has(n)||(Nn.add(n),Oe(n,"format",r=>i=>xr(r,i)),Oe(n,"flatten",r=>i=>Cr(r,i)),Oe(n,"addIssue",r=>i=>{r.issues.push(i),r.message=JSON.stringify(r.issues,Me,2)}),Oe(n,"addIssues",r=>i=>{r.issues.push(...i),r.message=JSON.stringify(r.issues,Me,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),kc=Je(T),zc=Be(T),Sc=Ve(T),$c=We(T),Oc=Vr(T),Ec=Wr(T),Ic=Gr(T),Zc=qr(T),Pc=Hr(T),Tc=Yr(T),Ac=Xr(T),Nc=Qr(T);function jc(){j.localeError||U(Qs())}function Ee(){j.memoizer||U({memoizer:Hs()})}const $=f("ZodType",(e,t)=>(jc(),z.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(P(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Na(e,t))},superRefine(e,t){return this.check(ja(e,t))},overwrite(e){return this.check(W(e))},optional(){return xn(this)},exactOptional(){return)DELIM" +R"DELIM( ya(this)},nullable(){return Un(this)},nullish(){return xn(Un(this))},nonoptional(e){return Oa(this,e)},array(){return Fn(this)},or(e){return Cn([this,e])},and(e){return pa(this,e)},transform(e){return Jn(this,va(e))},default(e){return za(this,e)},prefault(e){return $a(this,e)},catch(e){return Ia(this,e)},pipe(e){return Jn(this,e)},readonly(){return Ta(this)},describe(e){const t=this.clone();return se.add(t,{description:e}),t},meta(...e){if(e.length===0)return se.get(this);const t=this.clone();return se.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return zt(this,"~standard",{...Mt(this),jsonSchema:{input:Se(this,"input"),output:Se(this,"output")}})},set"~standard"(e){x(this,"~standard",e)},parse:function e(t,n){return kc(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await zc(this,t,n,{callee:e})},safeParse(e,t){return Sc(this,e,t)},async safeParseAsync(e,t){return $c(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){x(this,"spa",e)},validate(e,t){return Kr(this,e,t)},validateAsync(e,t){return Br(this,e,t)},encode:function e(t,n){return Oc(this,t,n,{callee:e})},decode:function e(t,n){return Ec(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Ic(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Zc(this,t,n,{callee:e})},safeEncode(e,t){return Pc(this,e,t)},safeDecode(e,t){return Tc(this,e,t)},async safeEncodeAsync(e,t){return Ac(this,e,t)},async safeDecodeAsync(e,t){return Nc(this,e,t)},toJSONSchema(e){return Yo(this,{})(e)},get description(){return se.get(this)?.description},get _def(){return this._zod.def}}),jn=f("_ZodString",(e,t)=>{He.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nc(e,n,r)},St({format:e=>M(e).format??null,minLength:e=>M(e).minimum??null,maxLength:e=>M(e).maximum??null},{regex(...e){return this.check(Mo(...e))},includes(...e){return this.check(Fo(...e))},startsWith(...e){return this.check(Co(...e))},endsWith(...e){return this.check(xo(...e))},min(...e){return this.check(ze(...e))},max(...e){return this.check(hn(...e))},length(...e){return this.check(pn(...e))},nonempty(...e){return this.check(ze(1,...e))},lowercase(e){return this.check(Ro(e))},uppercase(e){return this.check(Lo(e))},trim(){return this.check(Uo())},normalize(...e){return this.check(Do(...e))},toLowerCase(){return this.check(Ko())},toUpperCase(){return this.check(Jo())},slugify(){return this.check(Bo())}})),Mc=f("ZodString",(e,t)=>{He.init(e,t),jn.init(e,t)},{email(e){return this.check(ro(Dc,e))},url(e){return this.check(uo(Kc,e))},jwt(e){return this.check($o(ia,e))},emoji(e){return this.check(lo(Jc,e))},guid(e){return this.check(io(Uc,e))},uuid(e){return this.check(so(Ie,e))},uuidv4(e){return this.check(oo(Ie,e))},uuidv6(e){return this.check(co(Ie,e))},uuidv7(e){return this.check(ao(Ie,e))},nanoid(e){return this.check(fo(Bc,e))},cuid(e){return this.check(ho(Vc,e))},cuid2(e){return this.check(po(Wc,e))},ulid(e){return this.check(mo(Gc,e))},base64(e){return this.check(ko(ta,e))},base64url(e){return this.check(zo(na,e))},xid(e){return this.check(go(qc,e))},ksuid(e){return this.check(_o(Hc,e))},ipv4(e){return this.check(bo(Yc,e))},ipv6(e){return this.check(vo(Xc,e))},cidrv4(e){return this.check(yo(Qc,e))},cidrv6(e){return this.check(wo(ea,e))},e164(e){return this.check(So(ra,e))},datetime(e){return this.check(Oo(Lc,e))},date(e){return this.check(Eo(Fc,e))},time(e){return this.check(Io(Cc,e))},duration(e){return this.check(Zo(xc,e))}});function Rc(e){return no(Mc,e)}const S=f("ZodStringFormat",(e,t)=>{k.init(e,t),jn.init(e,t)}),Lc=f("ZodISODateTime",(e,t)=>{os.init(e,t),S.init(e,t)}),Fc=f("ZodISODate",(e,t)=>{cs.init(e,t),S.init(e,t)}),Cc=f("ZodISOTime",(e,t)=>{as.init(e,t),S.init(e,t)}),xc=f("ZodISODuration",(e,t)=>{us.init(e,t),S.init(e,t)}),Dc=f("ZodEmail",(e,t)=>{Vi.init(e,t),S.init(e,t)}),Uc=f("ZodGUID",(e,t)=>{Ji.init(e,t),S.init(e,t)}),Ie=f("ZodUUID",(e,t)=>{Bi.init(e,t),S.init(e,t)}),Kc=f("ZodURL",(e,t)=>{Xi.init(e,t),S.init(e,t)}),Jc=f("ZodEmoji",(e,t)=>{Qi.init(e,t),S.init(e,t)}),Bc=f("ZodNanoID",(e,t)=>{es.init(e,t),S.init(e,t)}),Vc=f("ZodCUID",(e,t)=>{ts.init(e,t),S.init(e,t)}),Wc=f("ZodCUID2",(e,t)=>{ns.init(e,t),S.init(e,t)}),Gc=f("ZodULID",(e,t)=>{rs.init(e,t),S.init(e,t)}),qc=f("ZodXID",(e,t)=>{is.init(e,t),S.init(e,t)}),Hc=f("ZodKSUID",(e,t)=>{ss.init(e,t),S.init(e,t)}),Yc=f("ZodIPv4",(e,t)=>{ls.init(e,t),S.init(e,t)}),Xc=f("ZodIPv6",(e,t)=>{ds.init(e,t),S.init(e,t)}),Qc=f("ZodCIDRv4",(e,t)=>{hs.init(e,t),S.init(e,t)}),ea=f("ZodCIDRv6",(e,t)=>{ms.init(e,t),S.init(e,t)}),ta=f("ZodBase64",(e,t)=>{gs.init(e,t),S.init(e,t)}),na=f("ZodBase64URL",(e,t)=>{bs.init(e,t),S.init(e,t)}),ra=f("ZodE164",(e,t)=>{vs.init(e,t),S.init(e,t)}),ia=f("ZodJWT",(e,t)=>{ws.init(e,t),S.init(e,t)}),Mn=f("ZodNumber",(e,t)=>{Ut.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rc(e,n,r,i),e.isFinite=!0},St({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=M(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=M(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=M(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>M(e).format??null},{gt(e,t){return this.check(fn(e,t))},gte(e,t){return this.check(nt(e,t))},min(e,t){return this.check(nt(e,t))},lt(e,t){return this.check(ln(e,t))},lte(e,t){return this.check(tt(e,t))},max(e,t){return this.check(tt(e,t))},int(e){return this.check(Rn(e))},safe(e){return this.check(Rn(e))},positive(e){return this.check(fn(0,e))},nonnegative(e){return this.check(nt(0,e))},negative(e){return this.check(ln(0,e))},nonpositive(e){return this.check(tt(0,e))},multipleOf(e,t){return this.check(dn(e,t))},step(e,t){return this.check(dn(e,t))},finite(){return this}}));function R(e){return Po(Mn,e)}const sa=f("ZodNumberFormat",(e,t)=>{ks.init(e,t),Mn.init(e,t)});function Rn(e){return To(sa,e)}const oa=f("ZodBoolean",(e,t)=>{zs.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ic(e,n,r)});function Y(e){return Ao(oa,e)}const ca=f("ZodUnknown",(e,t)=>{Ss.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oc()});function Ln(){return No(ca)}const aa=f("ZodNever",(e,t)=>{$s.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sc(e,n,r)});function ua(e){return jo(aa,e)}const la=f("ZodArray",(e,t)=>{Ee(),Is.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lc(e,n,r,i),e.element=t.element},{min(e,t){return this.check(ze(e,t))},nonempty(e){return this.check(ze(1,e))},max(e,t){return this.check(hn(e,t))},length(e,t){return this.check(pn(e,t))},unwrap(){return this.element}});function Fn(e,t){return Vo(la,e,t)}const fa=f("ZodObject",(e,t)=>{Ee(),Ts.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fc(e,n,r,i),Pr(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return _a(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(P(this._zod.def,{catchall:e}))},passthrough(){return this.clone(P(this._zod.def,{catchall:Ln()}))},loose(){return this.clone(P(this._zod.def,{catchall:Ln()}))},strict(){return this.clone(P(this._zod.def,{catchall:ua()}))},strip(){return this.clone(P(this._zod.def,{catchall:void 0}))},extend(e){return vr(this,e)},safeExtend(e){return yr(this,e)},merge(e){return wr(this,e)},pick(e){return _r(this,e)},omit(e){return br(this,e)},partial(...e){return wt(ot,this,e[0])},exactPartial(...e){return wt(Dn,this,e[0],"exactPartial")},required(...e){return kr(Kn,this,e[0])}});function X(e,t){const n={type:"object",shape:e??{},...g(t)};return new fa(n)}const da=f("ZodUnion",(e,t)=>{As.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dc(e,n,r,i),e.options=t.options});function Cn(e,t){return new da({type:"union",options:e,...g(t)})}const ha=f("ZodIntersection",(e,t)=>{Ns.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hc(e,n,r,i)});function pa(e,t){return new ha({type:"in)DELIM" +R"DELIM(tersection",left:e,right:t})}const ma=f("ZodTuple",(e,t)=>{Ee(),js.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pc(e,n,r,i)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){const e=this._zod.def;if(e.checks?.length)throw new Error(".partial() cannot be used on tuple schemas containing refinements");return this.clone({...e,items:e.items.map(t=>new ot({type:"optional",innerType:t}))})}});function ga(e,t,n){const r=t instanceof z,i=r?n:t,s=r?t:null;return new ma({type:"tuple",items:e,rest:s,...g(i)})}const st=f("ZodEnum",(e,t)=>{Ms.init(e,t),$.init(e,t),e._zod.processJSONSchema=(r,i,s)=>cc(e,r,i),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new st({...t,checks:[],...g(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new st({...t,checks:[],...g(i),entries:s})}});function _a(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new st({type:"enum",entries:n,...g(t)})}const ba=f("ZodTransform",(e,t)=>{Ee(),Rs.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uc(e,n,r,i),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Et(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(ne(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),"input"in o||(o.input=n.value),o.inst??(o.inst=e),n.issues.push(ne(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function va(e){return new ba({type:"transform",transform:e})}const ot=f("ZodOptional",(e,t)=>{Xt.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>An(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function xn(e){return new ot({type:"optional",innerType:e})}const Dn=f("ZodExactOptional",(e,t)=>{Ls.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>An(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function ya(e){return new Dn({type:"optional",innerType:e})}const wa=f("ZodNullable",(e,t)=>{Fs.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Un(e){return new wa({type:"nullable",innerType:e})}const ka=f("ZodDefault",(e,t)=>{Cs.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>_c(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function za(e,t){return new ka({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():_t(t)}})}const Sa=f("ZodPrefault",(e,t)=>{xs.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>bc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new Sa({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():_t(t)}})}const Kn=f("ZodNonOptional",(e,t)=>{Ds.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Oa(e,t){return new Kn({type:"nonoptional",innerType:e,...g(t)})}const Ea=f("ZodCatch",(e,t)=>{Us.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>vc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ia(e,t){return new Ea({type:"catch",innerType:e,catchValue:typeof t=="function"?t:Ar(t)})}const Za=f("ZodPipe",(e,t)=>{Ks.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>yc(e,n,r,i),e.in=t.in,e.out=t.out});function Jn(e,t){return new Za({type:"pipe",in:e,out:t})}const Pa=f("ZodReadonly",(e,t)=>{Js.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>wc(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Ta(e){return new Pa({type:"readonly",innerType:e})}const Aa=f("ZodCustom",(e,t)=>{Bs.init(e,t),$.init(e,t),e._zod.processJSONSchema=(n,r,i)=>ac(e,n,r,i)});function Na(e,t={}){return Wo(Aa,e,t)}function ja(e,t){return Go(e,t)}const Ze=[{id:0,name:"application",label:"Application"},{id:1,name:"news",label:"News"},{id:2,name:"session",label:"Session"},{id:3,name:"protocol",label:"Protocol"},{id:4,name:"proxy",label:"Proxy"},{id:5,name:"remote",label:"Remote"},{id:6,name:"fault",label:"Fault"},{id:7,name:"quitting",label:"Quitting"},{id:8,name:"objects",label:"Objects"},{id:9,name:"verbose",label:"Verbose"}],ct=[{id:0,name:"header_archived",label:"Header archived",category:"headers",valueKind:"height"},{id:1,name:"header_organized",label:"Header organized",category:"headers",valueKind:"height"},{id:2,name:"header_reorganized",label:"Header reorganized",category:"headers",valueKind:"height"},{id:3,name:"block_archived",label:"Block archived",category:"blocks",valueKind:"height"},{id:4,name:"block_buffered",label:"Block buffered",category:"blocks",valueKind:"height"},{id:5,name:"block_validated",label:"Block validated",category:"blocks",valueKind:"height"},{id:6,name:"block_confirmed",label:"Block confirmed",category:"blocks",valueKind:"height"},{id:7,name:"block_unconfirmable",label:"Block unconfirmable",category:"blocks",valueKind:"height"},{id:8,name:"validate_bypassed",label:"Validation bypassed",category:"blocks",valueKind:"height"},{id:9,name:"confirm_bypassed",label:"Confirmation bypassed",category:"blocks",valueKind:"height"},{id:10,name:"tx_archived",label:"Transaction archived",category:"transactions",valueKind:"fee-rate"},{id:11,name:"tx_validated",label:"Transaction validated",category:"transactions",valueKind:"count"},{id:12,name:"tx_invalidated",label:"Transaction invalidated",category:"transactions",valueKind:"count"},{id:13,name:"block_organized",label:"Block organized",category:"chain",valueKind:"height"},{id:14,name:"block_reorganized",label:"Block reorganized",category:"chain",valueKind:"height"},{id:15,name:"template_issued",label:"Mining template issued",category:"mining",valueKind:"count"},{id:16,name:"snapshot_secs",label:"Snapshot",category:"timing",valueKind:"seconds"},{id:17,name:"prune_msecs",label:"Prune",category:"timing",valueKind:"milliseconds"},{id:18,name:"reload_msecs",label:"Store reload",category:"timing",valueKind:"milliseconds"},{id:19,name:"block_usecs",label:"Serve block",category:"timing",valueKind:"microseconds"},{id:20,name:"ancestry_msecs",label:"Serve ancestry",category:"timing",valueKind:"milliseconds"},{id:21,name:"filter_msecs",label:"Serve filter",category:"timing",valueKind:"milliseconds"},{id:22,name:"filterhashes_msecs",label:"Serve filter hashes",category:"timing",valueKind:"milliseconds"},{id:23,name:"filterchecks_msecs",label:"Serve filter checkpoints",category:"timing",valueKind:"milliseconds"},{id:24,name:"ecdsa_secs",label:"ECDSA batch verification",category:"timing",valueKind:"seconds"},{id:25,name:"schnorr_secs",label:"Schnorr batch verification",category:"timing",valueKind:"seconds"},{id:26,name:"silent_secs",label:"Silent payment scan",category:"timing",valueKind:"seconds"},{id:27,name:"validate_usecs",label:"Block validation",category:"timing",valueKind:"microseconds"},{id:28,name:"unknown",label:"Unknown",category:"chain",valueKind:"unknown"}],Bn=R().int().nonnegative().max(864e13),Vn=X({level:R().int().nonnegative(),time:Bn,message:Rc()}),Wn=X({event:R().int().nonnegative(),value:R().nonnegative(),time:Bn}),Gn=X({previous:R().nonnegative()});Cn([Vn,Wn,Gn]);const Ma=2**Ze.length-1,qn=2**ct.length-1;function Hn(e,t){return Number.isInteger(t)&&t>=0&&tnew WebSocket(n))},this.#a=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=t=>(this.#r.add(t),()=>{this.#r.delete(t)});start(){this.#o||(this.#o=!0,this.#a=this.#e.retryMinimumMs,this.#f())}stop(){this.#o=!1,this.#g();const t=this.#n;if(this.#n=null,t)try{t.readyState===1&&this.#e.onBeforeStop?.(t),t.close()}catch{}this.#u(Xn)}send(t){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(t),!0}catch{return!1}}#f(){if(!this.#o||this.#n)return;const t=this.#t.reconnects>0;this.#u({...this.#t,phase:t?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let n;try{n=this.#e.webSocketFactory(this.#e.url),this.#n=n}catch(r){this.#u({...this.#t,error:Ba(r)}),this.#h();return}this.#s=setTimeout(()=>{if(this.#n===n){this.#u({...this.#t,error:"Connection timed out"});try{n.close()}catch{this.#n=null,this.#h()}}},this.#e.connectTimeoutMs),n.addEventListener("open",()=>{this.#n!==n||!this.#o||(this.#p(),this.#a=this.#e.retryMinimumMs,this.#u({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(n),this.#m(n))}),n.addEventListener("message",r=>{if(this.#n!==n||!this.#o)return;const i=Ja(r.data);if(i===null)return;const s=this.#e.now();(this.#t.lastMessageAt===null||s-this.#t.lastMessageAt>=1e3)&&this.#u({...this.#t,lastMessageAt:s}),this.#e.onMessage(i)}),n.addEventListener("error",()=>{if(!(this.#n!==n||!this.#o)){this.#u({...this.#t,error:"WebSocket connection failed"});try{n.close()}catch{this.#n=null,this.#h()}}}),n.addEventListener("close",()=>{this.#n===n&&(this.#n=null,this.#p(),this.#l(),this.#o&&this.#h())})}#h(){if(!this.#o||this.#i)return;const t=1+(this.#e.random()*2-1)*this.#e.jitterRatio,n=Math.max(0,Math.round(this.#a*t));this.#a=Math.min(this.#a*2,this.#e.retryMaximumMs),this.#u({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#i=setTimeout(()=>{this.#i=null,this.#f()},n)}#m(t){this.#l(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#c=setInterval(()=>{this.#n===t&&t.readyState===1&&this.#e.onHeartbeat?.(t)},this.#e.heartbeatMs))}#p(){this.#s&&(clearTimeout(this.#s),this.#s=null)}#l(){this.#c&&(clearInterval(this.#c),this.#c=null)}#g(){this.#p(),this.#l(),this.#i&&(clearTimeout(this.#i),this.#i=null)}#u(t){this.#t=t;for(const n of this.#r)n()}}function Ja(e){return typeof e=="string"?e:e instanceof ArrayBuffer?new TextDecoder().decode(e):null}function Ba(e){return e instanceof Error?e.message:"Unable to create WebSocket"}class Va{#e;#t;#n=new Set;#r=new Set;#s;constructor(t,n={}){this.#e=n.logFilter??Ma,this.#t=n.eventFilter??qn,this.#s=new Ka({url:Ua(t),webSocketFactory:n.webSocketFactory,retryMinimumMs:n.retryMinimumMs,retryMaximumMs:n.retryMaximumMs,jitterRatio:n.jitterRatio,onOpen:r=>{this.#i(r)},onHeartbeat:r=>{this.#i(r)},onBeforeStop:r=>{r.send("/v1/log/subscribe?filter=0"),r.send("/v1/event/subscribe?filter=0")},onMessage:r=>{const i=Fa(r);if(!i){for(const s of this.#r)s(r);return}if(!(Yn(i)&&!Hn(this.#e,i.level)))for(const s of this.#n)s(i)}})}getStatus=()=>this.#s.getStatus();subscribeStatus=t=>this.#s.subscribeStatus(t);start(){this.#s.start()}stop(){this.#s.stop()}subscribeFrames(t){return this.#n.add(t),()=>{this.#n.delete(t)}}subscribeInvalidFrames(t){return this.#r.add(t),()=>{this.#r.delete(t)}}setFilters(t,n){this.#e!==t&&(this.#e=t,this.#s.send(`/v1/log/subscribe?filter=${String(t)}`)),this.#t!==n&&(this.#t=n,this.#s.send(`/v1/event/subscribe?filter=${String(n)}`))}#i(t){t.send(`/v1/log/subscribe?filter=${String(this.#e)}`),t.send(`/v1/event/subscribe?filter=${String(this.#t)}`)}}X({address:Y(),filter:Y(),turbo:Y(),witness:Y(),retarget:Y(),difficult:Y(),pruned:R().int().nonnegative()}),X({height:R().int().nonnegative(),timestamp:R().int().positive().max(4294967295)});const Te=R().int().nonnegative().max(Number.MAX_SAFE_INTEGER);X({count:Te,virtual:Te,fee:Te,histogram:Fn(ga([R().nonnegative(),Te]))});const Wa=15e3;R().int().nonnegative();const Q=["occurrence-rate","occurrence-count","cumulative-occurrences"],Ga=["payload-latest","payload-maximum","payload-change-rate",...Q],qa=["payload-average","payload-latest","payload-minimum","payload-maximum",...Q],Ha=["payload-sum","payload-cumulative","payload-latest","payload-average",...Q],Qn=["payload-latest","payload-average","payload-minimum","payload-maximum"],er=[{field:"count",id:"pool:count",label:"Pool transactions",payloadKind:"transactions",description:"Current confirmable transaction count in the pool."},{field:"virtual",id:"pool:vsize",label:"Pool virtual size",payloadKind:"vbytes",description:"Total virtual size of the current pool, in vbytes."},{field:"fee",id:"pool:total_fee",label:"Pool total fees",payloadKind:"satoshis",description:"Total fees of the current pool, in satoshis."}];function tr(e){return`event:${String(e)}`}function nr(e){return`log:${String(e)}`}const at="native:top";function Ya(e){switch(e){case"height":return"height";case"seconds":case"milliseconds":case"microseconds":return"duration";case"count":return"count";case"fee-rate":return"fee-rate";default:return"unknown"}}function Xa(e){switch(e){case"height":return Ga;case"duration":return qa;case"count":return Ha;case"fee-rate":return[...Qn,...Q];default:return Q}}function Qa(e){switch(e){case"height":return"payload-latest";case"duration":return"payload-average";case"count":return"payload-sum";default:return"occurrence-rate"}}function eu(e){const t=Pe(e),n=Ya(t.valueKind);return{id:tr(e),source:"event",sourceId:e,name:t.name,label:t.label,category:t.category,payloadKind:n,allowedMeasures:Xa(n),defaultMeasure:Qa(n),description:e===10?"Newly archived transactions, including compact-block recovery. Occurrences measure archival, not all received transactions. Fee rate is normalized to sat/vB.":n==="unknown"?"Payload semantics are unknown; occurrence measurements are safe.":`${t.label} event with a ${n} payload.`}}const tu=[...er.map(e=>({id:e.id,source:"pool",sourceId:e.field,name:e.field,label:e.label,category:"pool",payloadKind:e.payloadKind,allowedMeasures:Qn,defaultMeasure:"payload-latest",description:e.description})),...ct.map(e=>eu(e.id)),...Ze.map(e=>({id:nr(e.id),source:"log",sourceId:e.id,name:e.name,label:`${e.label} logs`,category:"logs",payloadKind:"text",allowedMeasures:Q,defaultMeasure:"occurrence-rate",description:`${e.label} log message volume. Message text is not interpreted as numeric data.`})),{id:at,source:"native",sourceId:"top",name:"canonical_top",label:"Canonical top",category:"native",payloadKind:"height",allowedMeasures:["payload-latest","payload-maximum","payload-change-rate"],defaultMeasure:"payload-latest",description:"Canonical chain height reported by the native interface."}];new Map(tu.map(e=>[e.id,e]));function nu(e,t){return Pe(e).valueKind==="fee-rate"?t/1e3:xa(e,t)??t}const ru=3600*1e3,iu=1e3,su=1e3,ou=1e3;class rr{constructor(t){this.capacity=t,this.#e=Array.from({length:t})}capacity;)DELIM" +R"DELIM(#e;#t=0;#n=0;#r=null;get size(){return this.#n}push(t){const n=this.#n===this.capacity;return this.#r=null,this.#e[this.#t]=t,this.#t=(this.#t+1)%this.capacity,this.#n=Math.min(this.#n+1,this.capacity),n}clear(){this.#r=null,this.#e.fill(void 0),this.#t=0,this.#n=0}newestFirst(){if(this.#r)return this.#r;const t=[];for(let n=0;nthis.#A;getRecentLogs=()=>this.#r.newestFirst();getRecentEvents=()=>this.#s.newestFirst();subscribe=t=>(this.#n.add(t),()=>{this.#n.delete(t)});start(){this.#y||(this.tick(),this.#y=setInterval(()=>{this.tick()},1e3))}stop(){this.#y&&(clearInterval(this.#y),this.#y=null),this.#d&&(clearTimeout(this.#d),this.#d=null)}ingest(t,n=this.#e()){const r=this.#_(n);this.#u+=1,Yn(t)?this.#M(t,r):Ra(t)?this.#R(t,r):La(t)&&(this.#I+=1),this.#w()}recordInvalidFrame(){this.#Z+=1,this.#w()}recordNativeTop(t,n=this.#e()){const r=this.#_(n),i=this.#m[at];i?.value===t&&r-i.time<15e3||(this.#k(at,r,t),this.#N(r),this.#w())}recordNativeFees(t,n=this.#e()){if(!Number.isFinite(n)||n=Wa||this.#b!==null&&n<=this.#b.receivedAt)return;const r=this.#_(n);this.#b={data:t,receivedAt:n};for(const i of er)this.#k(i.id,r,t[i.field]);this.#N(r),this.#w()}clearLogs(){this.#O+=this.#r.size,this.#r.clear(),this.flush()}clearEvents(){this.#s.clear(),this.flush()}reset(){this.#r.clear(),this.#s.clear(),this.#i.clear(),this.#c={},this.#a={},this.#o={},this.#f={},this.#h={},this.#m={},this.#p={},this.#l=this.#_(this.#e()),this.#u=0,this.#S=0,this.#$=0,this.#O=0,this.#E=0,this.#I=0,this.#Z=0,this.#P=null,this.#T=null,this.#b=null,this.#v=0,this.#z(this.#l),this.flush()}tick(){const t=this.#_(this.#e());this.#z(t),this.#N(t),this.#w()}flush(){this.#d&&(clearTimeout(this.#d),this.#d=null),this.#A=this.#j();for(const t of this.#n)t()}#M(t,n){this.#S+=1,this.#P=n,this.#v+=1,this.#r.push({...t,id:this.#v,receivedAt:n})&&(this.#$+=1),this.#k(nr(t.level),n,null)}#R(t,n){this.#E+=1,this.#T=n,this.#v+=1,this.#s.push({...t,id:this.#v,receivedAt:n}),this.#k(tr(t.event),n,nu(t.event,t.value))}#_(t){return Number.isFinite(t)?(this.#g=Math.max(this.#g,t),this.#g):this.#g}#k(t,n,r){const i=this.#z(n);i.snapshot=null;const s=i.signals.get(t)??cu();if(s.count+=1,Ae(this.#f,t,1),r!==null){s.samples+=1,s.sum+=r,s.minimum=s.minimum===null?r:Math.min(s.minimum,r),s.maximum=s.maximum===null?r:Math.max(s.maximum,r),(s.firstAt===null||n=s.lastAt)&&(s.last=r,s.lastAt=n),Ae(this.#h,t,r);const o=this.#m[t];(!o||n>=o.time)&&(this.#m[t]={value:r,time:n}),this.#p[t]=Math.max(this.#p[t]??r,r)}i.signals.set(t,s)}#z(t){const n=Math.floor(t/1e3)*1e3,r=this.#i.get(n);if(r)return r;const i={time:n,signals:new Map,snapshot:null};return this.#i.set(n,i),i}#N(t){const n=t-ru;for(const[r,i]of this.#i){if(r>=n)break;for(const[s,o]of i.signals)if(Ae(this.#c,s,o.count),Ae(this.#a,s,o.sum),o.last!==null&&o.lastAt!==null){const c=this.#o[s];(!c||o.lastAt>=c.time)&&(this.#o[s]={value:o.last,time:o.lastAt})}this.#i.delete(r)}}#w(){!this.#t||this.#d||(this.#d=setTimeout(()=>{this.#d=null,this.flush()},iu))}#j(){const t=[...this.#i.values()].map(n=>(n.snapshot??={time:n.time,signals:Object.fromEntries([...n.signals].map(([r,i])=>[r,{...i}]))},n.snapshot));return{now:this.#_(this.#e()),sessionStartedAt:this.#l,totalFrames:this.#u,totalLogs:this.#S,evictedLogs:this.#$,clearedLogs:this.#O,totalEvents:this.#E,totalAcks:this.#I,invalidFrames:this.#Z,buckets:t,priorSignalCounts:{...this.#c},priorSignalSums:{...this.#a},priorSignalLatest:ir(this.#o),signalTotals:{...this.#f},signalSums:{...this.#h},signalLatest:ir(this.#m),signalMaximums:{...this.#p},recentLogs:this.#r.newestFirst(),recentEvents:this.#s.newestFirst(),lastLogAt:this.#P,lastEventAt:this.#T,poolSnapshot:this.#b}}}const Ne=40;function uu(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>Hn(t.filter,o.level)&&(!n||o.message.toLowerCase().includes(n)||Ca(o.level).name.includes(n))),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-Ne));return{logs:r.slice(s,s+Ne),retained:e.length,matched:r.length,offset:s}}function lu(e,t){const n=t.search.trim().toLowerCase(),r=e.filter(o=>{const c=Pe(o.event);return(t.category==="all"||c.category===t.category)&&(!n||c.name.includes(n)||c.label.toLowerCase().includes(n)||String(o.value).includes(n))}),i=Number.isFinite(t.offset)?Math.max(0,Math.floor(t.offset)):0,s=Math.min(i,Math.max(0,r.length-Ne));return{events:r.slice(s,s+Ne),retained:e.length,matched:r.length,offset:s}}function fu(e,t){const{buckets:n,recentLogs:r,recentEvents:i,...s}=e,o=new Map(t?.buckets.map(c=>[c.time,c]));return{summary:s,reset:t===null,firstBucketTime:n[0]?.time??e.now,buckets:n.filter(c=>o.get(c.time)!==c),recentLogs:r===t?.recentLogs?null:r,recentEvents:i===t?.recentEvents?null:i}}class du{constructor(t,n=(i,s)=>new Va(i,{logFilter:s}),r=Date.now){this.send=t,this.createClient=n,this.#e=new au(r,!1)}send;createClient;#e;#t=null;#n=null;#r=0;#s=null;#i=null;#c=null;#a=[];handle(t){if(t.type==="stop"){this.#f(),this.#e.stop(),this.send({type:"stopped"});return}if(t.type==="configure"){if(t.generation{this.#e.ingest(n)}),this.#t.subscribeInvalidFrames(()=>{this.#e.recordInvalidFrame()})],this.#t.start(),this.#e.start()):this.#t.setFilters(t.logFilter,qn);return}if(t.type==="reset"){t.generation>=this.#r&&this.#o(t.generation);return}if(t.generation===this.#r)switch(t.type){case"pause-display":{t.stream==="logs"?this.#i=t.paused?this.#i??this.#e.getRecentLogs():null:this.#c=t.paused?this.#c??this.#e.getRecentEvents():null;break}case"poll-events":{this.send({type:"events",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:lu(this.#c??this.#e.getRecentEvents(),t.query)});break}case"poll-logs":{this.send({type:"logs",generation:this.#r,requestId:t.requestId,queryVersion:t.queryVersion,window:uu(this.#i??this.#e.getRecentLogs(),t.query)});break}case"native-top":{this.#e.recordNativeTop(t.height,t.receivedAt);break}case"native-fees":{this.#e.recordNativeFees(t.fees,t.receivedAt);break}case"clear-logs":{this.#e.clearLogs(),this.#i!==null&&(this.#i=[]);break}case"clear-events":{this.#e.clearEvents(),this.#c!==null&&(this.#c=[]);break}case"poll":{if(!this.#t)return;this.#e.flush();const n=this.#e.getSnapshot();this.send({type:"snapshot",generation:this.#r,requestId:t.requestId,status:this.#t.getStatus(),update:fu(n,this.#s)}),this.#s=n;break}}}#o(t){this.#r=t,this.#s=null,this.#i!==null&&(this.#i=[]),this.#c!==null&&(this.#c=[]),this.#e.reset()}#f(){for(const t of this.#a)t();this.#a=[],this.#t?.stop(),this.#t=null}}const ut=globalThis,hu=new du(e=>{ut.postMessage(e)});ut.addEventListener("message",e=>{hu.handle(e.data),e.data.type==="stop"&&ut.close()})})();\n',D_=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",fx],{type:"text/javascript;charset=utf-8"});function rj(n){let i;try{if(i=D_&&(self.URL||self.webkitURL).createObjectURL(D_),!i)throw"";const a=new Worker(i,{name:n?.name});return a.addEventListener("error",()=>{(self.URL||self.web)DELIM" +R"DELIM(kitURL).revokeObjectURL(i)}),a}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(fx),{name:n?.name})}}const U_=100;function sj(n,i){const a=new Map((i.reset?[]:n.buckets).filter(l=>l.time>=i.firstBucketTime).map(l=>[l.time,l]));for(const l of i.buckets)a.set(l.time,l);return{...i.summary,buckets:[...a.values()],recentLogs:qf(i.reset?[]:n.recentLogs,i.recentLogs),recentEvents:qf(i.reset?[]:n.recentEvents,i.recentEvents)}}function qf(n,i){if(i===null)return n;const a=new Map(n.map(l=>[l.id,l]));return i.map(l=>a.get(l.id)??l)}const bu={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class aj{constructor(i=()=>new rj){this.createWorker=i}createWorker;#e=null;#t=new Vb().getSnapshot();#n=bu;#i=new Set;#a=new Set;#r=null;#l=Wl;#s=0;#u=0;#o=null;#m=null;#p=null;#c=new Set;#f={logs:[],retained:0,matched:0,offset:0};#d={search:"",filter:Wl,offset:0};#h=0;#b=null;#S=null;#y=new Set;#x={events:[],retained:0,matched:0,offset:0};#z={search:"",category:"all",offset:0};#w=0;#_=null;#j=!1;#E=!1;getSnapshot=()=>this.#t;getStatus=()=>this.#n;getLogWindow=()=>this.#f;getEventWindow=()=>this.#x;subscribeEvents=i=>(this.#y.add(i),this.#v(),this.#O(),()=>{this.#y.delete(i),this.#y.size===0&&this.#N()});subscribeLogs=i=>(this.#c.add(i),this.#A(),this.#C(),()=>{this.#c.delete(i),this.#c.size===0&&this.#U()});subscribe=i=>(this.#i.add(i),()=>{this.#i.delete(i)});subscribeStatus=i=>(this.#a.add(i),()=>{this.#a.delete(i)});configure(i,a){i===this.#r&&a===this.#l||(this.#r!==null&&i!==this.#r&&(this.reset(),this.#R({...bu,phase:"connecting"})),this.#r=i,this.#l=a,this.#M())}start(){if(!(this.#e||this.#r===null))try{const i=this.createWorker();this.#e=i,this.#f={logs:[],retained:0,matched:0,offset:0},this.#x={events:[],retained:0,matched:0,offset:0};for(const a of this.#c)a();for(const a of this.#y)a();this.#R({...bu,phase:"connecting"}),i.onmessage=a=>{if(this.#e!==i)return;const l=a.data;if(l.type==="events"){if(l.requestId!==this.#_||(this.#_=null,l.generation!==this.#s))return;if(l.queryVersion!==this.#w){this.#v();return}this.#x={...l.window,events:qf(this.#x.events,l.window.events)};for(const u of this.#y)u();return}if(l.type==="logs"){if(l.requestId!==this.#b||(this.#b=null,l.generation!==this.#s))return;if(l.queryVersion!==this.#h){this.#A();return}this.#f={...l.window,logs:qf(this.#f.logs,l.window.logs)};for(const u of this.#c)u();return}if(l.type==="snapshot"&&l.requestId===this.#o&&(this.#o=null,l.generation===this.#s)){this.#t=sj(this.#t,l.update),this.#R(l.status);for(const u of this.#i)u()}},i.onerror=()=>{this.#T("Telemetry worker failed. Reload the dashboard to reconnect.")},i.onmessageerror=()=>{this.#T("Unable to read telemetry worker data. Reload the dashboard to reconnect.")},this.#M(),this.#j&&this.#g({type:"pause-display",generation:this.#s,stream:"logs",paused:!0}),this.#E&&this.#g({type:"pause-display",generation:this.#s,stream:"events",paused:!0}),this.#k(),this.getStatus().error===null&&(this.#m=setInterval(()=>{this.#k()},1e3)),this.#C(),this.#O()}catch(i){this.#T(`Unable to start telemetry worker: ${i instanceof Error?i.message:String(i)}`)}}stop(){this.#D();const i=this.#e;if(this.#e=null,i){const a=setTimeout(()=>{i.terminate()},500),l=()=>{clearTimeout(a),i.terminate()};i.onmessage=u=>{u.data.type==="stopped"&&l()},i.onerror=l,i.onmessageerror=l;try{i.postMessage({type:"stop"})}catch{l()}}this.#R(bu)}recordNativeTop(i,a=Date.now()){this.#g({type:"native-top",generation:this.#s,height:i,receivedAt:a})}recordNativeFees(i,a=Date.now()){this.#g({type:"native-fees",generation:this.#s,fees:i,receivedAt:a})}clearLogs(){this.#g({type:"clear-logs",generation:this.#s}),this.#h+=1,this.#A()}clearEvents(){this.#g({type:"clear-events",generation:this.#s}),this.#w+=1,this.#v()}setLogsPaused(i){i!==this.#j&&(this.#j=i,this.#U(),this.#g({type:"pause-display",generation:this.#s,stream:"logs",paused:i}),this.#h+=1,this.#A(),this.#C())}setEventsPaused(i){i!==this.#E&&(this.#E=i,this.#N(),this.#g({type:"pause-display",generation:this.#s,stream:"events",paused:i}),this.#w+=1,this.#v(),this.#O())}reset(){this.#s+=1,this.#o=null,this.#b=null,this.#_=null,this.#f={logs:[],retained:0,matched:0,offset:0},this.#x={events:[],retained:0,matched:0,offset:0},this.#t=new Vb().getSnapshot(),this.#g({type:"reset",generation:this.#s});for(const i of this.#i)i();for(const i of this.#c)i();for(const i of this.#y)i()}setLogQuery(i){JSON.stringify(i)!==JSON.stringify(this.#d)&&(this.#d=i,this.#h+=1,this.#A())}setEventQuery(i){JSON.stringify(i)!==JSON.stringify(this.#z)&&(this.#z=i,this.#w+=1,this.#v())}#O(){!this.#e||this.#y.size===0||this.#S||this.#E||(this.#S=setInterval(()=>{this.#v()},U_),this.#v())}#v(){this.#_!==null||!this.#e||this.#y.size===0||(this.#_=++this.#u,this.#g({type:"poll-events",generation:this.#s,requestId:this.#_,queryVersion:this.#w,query:this.#z}))}#N(){this.#S&&clearInterval(this.#S),this.#S=null,this.#_=null}#C(){!this.#e||this.#c.size===0||this.#p||this.#j||(this.#p=setInterval(()=>{this.#A()},U_),this.#A())}#A(){this.#b!==null||!this.#e||this.#c.size===0||(this.#b=++this.#u,this.#g({type:"poll-logs",generation:this.#s,requestId:this.#b,queryVersion:this.#h,query:this.#d}))}#U(){this.#p&&clearInterval(this.#p),this.#p=null,this.#b=null}#M(){this.#r!==null&&this.#g({type:"configure",generation:this.#s,endpoint:this.#r,logFilter:this.#l})}#k(){this.#o!==null||!this.#e||(this.#o=++this.#u,this.#g({type:"poll",generation:this.#s,requestId:this.#o}))}#g(i){try{this.#e?.postMessage(i)}catch{this.#T("Unable to communicate with telemetry worker. Reload the dashboard to reconnect.")}}#D(){this.#U(),this.#N(),this.#m&&clearInterval(this.#m),this.#m=null,this.#o=null}#T(i){this.#D(),this.#e?.terminate(),this.#e=null,this.#R({...bu,error:i})}#R(i){if(JSON.stringify(i)!==JSON.stringify(this.#n)){this.#n=i;for(const a of this.#a)a()}}}const dx="libbitcoinAdminDashboardLogFilter";function hx(){try{return globalThis.localStorage}catch{return null}}function lj(n=hx()){try{const i=n?.getItem(dx);if(!i)return Wl;const a=JSON.parse(i);return typeof a=="number"&&Number.isInteger(a)&&a>=0&&a<=Hp?a:Wl}catch{return Wl}}function oj(n,i=hx()){try{i?.setItem(dx,String(n))}catch{}}const mx=se.createContext(void 0),uj=n=>{const i=se.useContext(mx);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},cj=({client:n,children:i})=>(se.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),S.jsx(mx.Provider,{value:n,children:i})),fj={setTimeout:(n,i)=>setTimeout(n,i),clearTimeout:n=>clearTimeout(n),setInterval:(n,i)=>setInterval(n,i),clearInterval:n=>clearInterval(n)};var dj=class{#e=fj;#t=!1;setTimeoutProvider(n){this.#e=n}setTimeout(n,i){return this.#e.setTimeout(n,i)}clearTimeout(n){this.#e.clearTimeout(n)}setInterval(n,i){return this.#e.setInterval(n,i)}clearInterval(n){this.#e.clearInterval(n)}};const Ka=new dj;function hj(n){setTimeout(n,0)}const mj=typeof window>"u"||"Deno"in globalThis;function hi(){}function pj(n,i){return typeof n=="function"?n(i):n}function px(n){return typeof n=="number"&&n>=0&&n!==1/0}function gx(n,i){return Math.max(n+(i||0)-Date.now(),0)}function jt(n,i){return typeof n=="function"?n(i):n}function Z_(n,i){const{type:a="all",exact:l,fetchStatus:u,predicate:f,queryKey:d,stale:m}=n;if(d){if(l){if(i.queryHash!==ag(d,i.options))return!1}else if(!uo(i.queryKey,d))return!1}if(a!=="all"){const p=i.isActive();if(a==="active"&&!p||a==="inactive"&&p)return!1}return!(typeof m=="boolean"&&i.isStale()!==m||u&&u!==i.state.fetchStatus||f&&!f(i))}function $_(n,i){const{exact:a,status:l,predicate:u,mutationKey:f}=n;if(f){if(!i.options.mutationKey)return!1;if(a){if(Uu(i.options.mutationKey)!==Uu(f))return!1}else if(!uo(i.options.mutationKey,f))return!1}return!(l&&i.state.status!==l||u&&!u(i))}function ag(n,i){return(i?.queryKeyHashFn||Uu)(n)}function Uu(n){return JSON.stringify(n,(i,a)=>gp(a)?Object.keys(a).sort().reduce((l,u)=>(l[u]=a[u],l),{}):a)}function uo(n,i){if(n===i)return!0)DELIM" +R"DELIM(;if(typeof n!=typeof i)return!1;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(Array.isArray(n)&&Array.isArray(i)){if(i.length>n.length)return!1;for(let l=0;l500)return i;const l=L_(n)&&L_(i);if(!l&&!(gp(n)&&gp(i)))return i;const u=(l?n:Object.keys(n)).length,f=l?i:Object.keys(i),d=f.length,m=l?new Array(d):{};let p=0;for(let g=0;g{Ka.setTimeout(i,n)})}function vp(n,i,a){return typeof a.structuralSharing=="function"?a.structuralSharing(n,i):a.structuralSharing!==!1?yx(n,i):i}function vj(n,i,a=0){const l=[...n,i];return a&&l.length>a?l.slice(-a):l}function yj(n,i,a=0){const l=[i,...n];return a&&l.length>a?l.slice(0,a):l}const lg=Symbol();function bx(n,i){return!n.queryFn&&i?.initialPromise?()=>i.initialPromise:!n.queryFn||n.queryFn===lg?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function _x(n,i){return typeof n=="function"?n(...i):!!n}const og=Symbol();function bj(n,i,a,l){let u=!1,f;return Object.defineProperties(n,{[og]:{value:l},signal:{enumerable:!0,get:()=>(f??=i(),u||(u=!0,f.aborted?a():f.addEventListener("abort",a,{once:!0})),f)}}),n}let _j=()=>mj;const ug=()=>_j();var $u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sj=class extends $u{#e;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()})}setFocused(n){this.#e!==n&&(this.#e=n,this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(i=>{i(n)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const cg=new Sj,xj=hj;function wj(){let n=[],i=0,a=m=>{m()},l=m=>{m()},u=xj;const f=m=>{i?n.push(m):u(()=>{a(m)})},d=()=>{const m=n;n=[],m.length&&u(()=>{l(()=>{m.forEach(p=>{a(p)})})})};return{batch:m=>{let p;i++;try{p=m()}finally{i--,i||d()}return p},batchCalls:m=>(...p)=>{f(()=>{m(...p)})},schedule:f,setNotifyFunction:m=>{a=m},setBatchNotifyFunction:m=>{l=m},setScheduler:m=>{u=m}}}const kn=wj();var zj=class extends $u{#e=!0;#t;#n;constructor(){super(),this.#n=n=>{if(typeof window<"u"&&window.addEventListener){const i=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",a)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(n){this.#n=n,this.#t?.(),this.#t=n(this.setOnline.bind(this))}setOnline(n){this.#e!==n&&(this.#e=n,this.listeners.forEach(i=>{i(n)}))}isOnline(){return this.#e}};const Vf=new zj;function Ej(n){return Math.min(1e3*2**n,3e4)}function Sx(n){return(n??"online")==="online"?Vf.isOnline():!0}var yp=class extends Error{constructor(n){super("CancelledError"),this.revert=n?.revert,this.silent=n?.silent}};function xx(n){let i=!1,a=0,l,u="pending",f,d;const m=new Promise((D,ie)=>{f=D,d=ie});m.catch(hi);const p=()=>u!=="pending",g=D=>{if(!p()){const ie=new yp(D);A(ie),n.onCancel?.(ie)}},x=()=>{i=!0},y=()=>{i=!1},w=()=>cg.isFocused()&&(n.networkMode==="always"||Vf.isOnline())&&n.canRun(),N=()=>Sx(n.networkMode)&&n.canRun(),E=D=>{p()||(l?.(),u="resolved",f(D))},A=D=>{p()||(l?.(),u="rejected",d(D))},k=D=>new Promise(ie=>{l=K=>{(p()||D())&&ie(K)},n.onPause?.()}).then(()=>{l=void 0,p()||n.onContinue?.()}),B=()=>{if(p())return;let D;const ie=a===0?n.initialPromise:void 0;try{D=ie??n.fn()}catch(K){D=Promise.reject(K)}Promise.resolve(D).then(E).catch(K=>{if(p())return;const G=n.retry??(ug()?0:3),F=n.retryDelay??Ej,te=typeof F=="function"?F(a,K):F,V=G===!0||typeof G=="number"&&ap()||w()?void 0:k(w)).then(()=>{i?A(K):B()})})};return{promise:m,status:()=>u,cancel:g,continue:()=>(l?.(),m),cancelRetry:x,continueRetry:y,canStart:N,start:()=>(N()?B():k(N).then(B),m)}}var wx=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),px(this.gcTime)&&(this.#e=Ka.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(ug()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Ka.clearTimeout(this.#e),this.#e=void 0)}};function Tj(n){return{onFetch:(i,a)=>{const l=i.options,u=i.fetchOptions?.meta?.fetchMore?.direction,f=i.state.data?.pages||[],d=i.state.data?.pageParams||[];let m={pages:[],pageParams:[]},p=0;const g=async()=>{let x=!1;const y=i,w=A=>{bj(A,()=>i.signal,()=>x=!0,y[og])},N=bx(i.options,i.fetchOptions),E=async(A,k,B)=>{if(x)return Promise.reject(i.signal.reason);if(k==null&&A.pages.length)return Promise.resolve(A);const ie=(()=>{const te={client:i.client,queryKey:i.queryKey,pageParam:k,direction:B?"backward":"forward",meta:i.options.meta};return w(te),te})(),K=await N(ie),{maxPages:G}=i.options,F=B?yj:vj;return{pages:F(A.pages,K,G),pageParams:F(A.pageParams,k,G)}};if(u&&f.length){const A=u==="backward",k=A?Oj:B_,B={pages:f,pageParams:d};m=await E(B,k(l,B),A)}else{const A=n??f.length;do{const k=p===0?d[0]===void 0?l.initialPageParam:d[0]:B_(l,m);if(p>0&&k==null)break;m=await E(m,k),p++}while(pi.options.persister?.(g,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},a):i.fetchFn=g}}}function B_(n,{pages:i,pageParams:a}){const l=i.length-1;return i.length>0?n.getNextPageParam(i[l],i,a[l],a):void 0}function Oj(n,{pages:i,pageParams:a}){return i.length>0?n.getPreviousPageParam?.(i[0],i,a[0],a):void 0}var Nj=class extends wx{#e;#t;#n;#i;#a;#r;#l;#s;#u;constructor(n){super(),this.#u=!1,this.#s=n.defaultOptions,this.setOptions(n.options),this.observers=[],this.#a=n.client,this.#i=this.#a.getQueryCache(),this.queryKey=n.queryKey,this.queryHash=n.queryHash,this.#t=V_(this.options),this.state=n.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(n){if(this.options={...this.#s,...n},n?._type&&(this.#e=n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=V_(this.options);i.data!==void 0&&(this.setState(q_(i.data,i.dataUpdatedAt)),this.#t=i)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#i.remove(this)}setData(n,i){const a=vp(this.state.data,n,this.options);return this.#o({data:a,type:"success",dataUpdatedAt:i?.updatedAt,manual:i?.manual}),a}setState(n){this.#o({type:"setState)DELIM" +R"DELIM(",state:n})}cancel(n){const i=this.#r?.promise;return this.#r?.cancel(n),i?i.then(hi).catch(hi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>jt(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===lg||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(n=>jt(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!gx(this.state.dataUpdatedAt,n)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){const i=this.observers.indexOf(n);i!==-1&&(this.observers.splice(i,1),this.observers.length||(this.#r&&(this.#u||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#i.notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(n,i){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&i?.cancelRefetch)this.cancel({silent:!0});else if(this.#r&&this.#l)return this.#r.continueRetry(),this.#l}if(n&&this.setOptions(n),!this.options.queryFn){const g=this.observers.find(x=>x.options.queryFn);g&&this.setOptions(g.options)}const a=new AbortController,l=g=>{Object.defineProperties(g,{[og]:{value:a.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#u=!0,a.signal)}})},u=()=>{const g=bx(this.options,i),y=(()=>{const w={client:this.#a,queryKey:this.queryKey,meta:this.meta};return l(w),w})();return this.#u=!1,this.options.persister?this.options.persister(g,y,this):g(y)},d=(()=>{const g={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:u};return l(g),g})();(this.#e==="infinite"?Tj(this.options.pages):this.options.behavior)?.onFetch(d,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#o({type:"fetch",meta:d.fetchOptions?.meta});const m=this.#r=xx({initialPromise:i?.initialPromise,fn:d.fetchFn,onCancel:g=>{g instanceof yp&&g.revert&&this.setState({...this.#n,fetchStatus:"idle"}),a.abort()},onFail:(g,x)=>{this.#o({type:"failed",failureCount:g,error:x})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}),p=(async()=>{try{const g=await m.promise;if(g===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(g),this.#i.config.onSuccess?.(g,this),this.#i.config.onSettled?.(g,this.state.error,this),g}catch(g){if(g instanceof yp){if(g.silent){if(this.#r!==m&&this.#l)return this.#l;throw g}else if(g.revert){if(this.state.data===void 0)throw g;return this.state.data}}throw this.#o({type:"error",error:g}),this.#i.config.onError?.(g,this),this.#i.config.onSettled?.(this.state.data,g,this),g}finally{this.#r===m&&(this.#r=void 0,this.#l=void 0),this.scheduleGc()}})();return this.#l=p,m.start(),p}#o(n){const i=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...zx(a.data,this.options),fetchMeta:n.meta??null};case"success":const l={...a,...q_(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=n.manual?l:void 0,l;case"error":const u=n.error;return{...a,error:u,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:u,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=i(this.state),kn.batch(()=>{this.observers.slice().forEach(a=>{a.onQueryUpdate()}),this.#i.notify({query:this,type:"updated",action:n})})}};function zx(n,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Sx(i.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function q_(n,i){return{data:n,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function V_(n){const i=typeof n.initialData=="function"?n.initialData():n.initialData,a=i!==void 0,l=a?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:a?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:a?"success":"pending",fetchStatus:"idle"}}var Aj=class extends $u{#e;#t=void 0;#n=void 0;#i=void 0;#a;#r;#l;#s;#u;#o;#m;#p;#c;#f=new Set;constructor(n,i){super(),this.options=i,this.#e=n,this.#l=null,this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),I_(this.#t,this.options)?this.#d():this.updateResult(),this.#x())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return bp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return bp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#z(),this.#w(),this.#t.removeObserver(this)}setOptions(n){const i=this.options,a=this.#t;if(this.options=this.#e.defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof jt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),i._defaulted&&!Gm(this.options,i)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const l=this.hasListeners();l&&K_(this.#t,a,this.options,i)&&this.#d(),this.updateResult(),l&&(this.#t!==a||jt(this.options.enabled,this.#t)!==jt(i.enabled,this.#t)||jt(this.options.staleTime,this.#t)!==jt(i.staleTime,this.#t))&&this.#b();const u=this.#S();l&&(this.#t!==a||jt(this.options.enabled,this.#t)!==jt(i.enabled,this.#t)||u!==this.#c)&&this.#y(u)}getOptimisticResult(n){const i=this.#e.getQueryCache().build(this.#e,n),a=this.createResult(i,n);return Gm(this.getCurrentResult(),a)||(this.#i=a,this.#r=this.options,this.#a=this.#t.state),a}getCurrentResult(){return this.#i}trackResult(n,i){return new Proxy(n,{get:(a,l)=>(this.trackProp(l),i?.(l),Reflect.get(a,l))})}trackProp(n){this.#f.add(n)}getCurrentQuery(){return this.#t}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const i=this.#e.defaultQueryOptions(n),a=this.#e.getQueryCache().build(this.#e,i);let l=()=>{},u;const f=new Promise(d=>{u=d,l=this.#e.getQueryCache().subscribe(m=>{m.type==="updated"&&m.query.queryHash===a.queryHash&&a.state.data!==void 0&&(l(),d(this.createResult(a,i)))})});return Promise.race([a.fetch(i).then(()=>{const d=this.createResult(a,i);return u?.(d),d}).finally(()=>{l()}),f])}fetch(n){return this.#d({...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(th)DELIM" +R"DELIM(is.updateResult(),this.#i))}#d(n){this.#_();let i=this.#t.fetch(this.options,n);return n?.throwOnError||(i=i.catch(hi)),i}#h(n){return!ug()&&jt(this.options.enabled,this.#t)!==!1&&px(n)}#b(){this.#z();const n=jt(this.options.staleTime,this.#t);if(this.#i.isStale||!this.#h(n))return;const i=gx(this.#i.dataUpdatedAt,n)+1;this.#m=Ka.setTimeout(()=>{this.#i.isStale||this.updateResult()},i)}#S(){return jt(this.options.refetchInterval,this.#t)??!1}#y(n){this.#w(),this.#c=n,!(this.#c===0||!this.#h(this.#c))&&(this.#p=Ka.setInterval(()=>{(this.options.refetchIntervalInBackground||cg.isFocused())&&this.#d()},this.#c))}#x(){this.#b(),this.#y(this.#S())}#z(){this.#m!==void 0&&(Ka.clearTimeout(this.#m),this.#m=void 0)}#w(){this.#p!==void 0&&(Ka.clearInterval(this.#p),this.#p=void 0)}createResult(n,i){const a=this.#t,l=this.options,u=this.#i,f=this.#a,d=this.#r,m=n!==a?n.state:this.#n,{state:p}=n;let g={...p},x=!1,y;if(i._optimisticResults){const G=this.hasListeners(),F=!G&&I_(n,i),te=G&&K_(n,a,i,l);(F||te)&&(g={...g,...zx(p.data,n.options)}),i._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:w,errorUpdatedAt:N,status:E}=g;y=g.data;let A=!1;if(i.placeholderData!==void 0&&y===void 0&&E==="pending"){let G;u?.isPlaceholderData&&i.placeholderData===d?.placeholderData?(G=u.data,A=!0):G=typeof i.placeholderData=="function"?i.placeholderData(this.#o?.state.data,this.#o):i.placeholderData,G!==void 0&&(E="success",y=vp(u?.data,G,i),x=!0)}if(i.select&&y!==void 0&&!A)if(u&&y===f?.data&&i.select===this.#s)y=this.#u;else try{this.#s=i.select,y=i.select(y),y=vp(u?.data,y,i),this.#u=y,this.#l=null}catch(G){this.#l=G}else y===void 0&&(this.#l=null);this.#l&&(w=this.#l,y=this.#u,N=u?.error===w?u.errorUpdatedAt:Date.now(),E="error",x=!1);const k=g.fetchStatus==="fetching",B=E==="pending",D=E==="error",ie=B&&k,K=y!==void 0;return{status:E,fetchStatus:g.fetchStatus,isPending:B,isSuccess:E==="success",isError:D,isInitialLoading:ie,isLoading:ie,data:y,dataUpdatedAt:g.dataUpdatedAt,error:w,errorUpdatedAt:N,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:g.dataUpdateCount>m.dataUpdateCount||g.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!B,isLoadingError:D&&!K,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:D&&K,isStale:fg(n,i),refetch:this.refetch,isEnabled:jt(i.enabled,n)!==!1}}updateResult(){const n=this.#i,i=this.createResult(this.#t,this.options);if(this.#a=this.#t.state,this.#r=this.options,this.#a.data!==void 0&&(this.#o=this.#t),Gm(i,n))return;this.#i=i;const l=(()=>{if(!n)return!0;const{notifyOnChangeProps:u}=this.options,f=typeof u=="function"?u():u;if(f==="all"||!f&&!this.#f.size||this.options.throwOnError&&this.#i.error!==n.error)return!0;for(const d of f??this.#f)if(this.#i[d]!==n[d])return!0;return!1})();kn.batch(()=>{l&&this.listeners.forEach(u=>{u(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#_(){const n=this.#e.getQueryCache().build(this.#e,this.options);if(n===this.#t)return;const i=this.#t;this.#t=n,this.#n=n.state,this.hasListeners()&&(i?.removeObserver(this),n.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#x()}};function Mj(n,i){return jt(i.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&jt(i.retryOnMount,n)===!1)}function I_(n,i){return Mj(n,i)||n.state.data!==void 0&&bp(n,i,i.refetchOnMount)}function bp(n,i,a){if(jt(i.enabled,n)!==!1&&jt(i.staleTime,n)!=="static"){const l=jt(a,n);return l==="always"||l!==!1&&fg(n,i)}return!1}function K_(n,i,a,l){return(n!==i||jt(l.enabled,n)===!1)&&(!a.suspense||n.state.status!=="error")&&fg(n,a)}function fg(n,i){return jt(i.enabled,n)!==!1&&n.isStaleByTime(jt(i.staleTime,n))}var jj=class extends wx{#e;#t;#n;#i;constructor(n){super(),this.#e=n.client,this.mutationId=n.mutationId,this.#n=n.mutationCache,this.#t=[],this.state=n.state||Rj(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){this.#t.includes(n)||(this.#t.push(n),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){this.#t=this.#t.filter(i=>i!==n),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(n){const i=()=>{this.#a({type:"continue"})},a={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},l=this.#i=xx({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(d,m)=>{this.#a({type:"failed",failureCount:d,error:m})},onPause:()=>{this.#a({type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),u=this.state.status==="pending",f=!l.canStart();try{if(u)i();else{this.#a({type:"pending",variables:n,isPaused:f}),this.#n.config.onMutate&&await this.#n.config.onMutate(n,this,a);const m=await this.options.onMutate?.(n,a);m!==this.state.context&&this.#a({type:"pending",context:m,variables:n,isPaused:f})}this.state.isPaused&&l.canStart()&&i();const d=await l.start();return await this.#n.config.onSuccess?.(d,n,this.state.context,this,a),await this.options.onSuccess?.(d,n,this.state.context,a),await this.#n.config.onSettled?.(d,null,this.state.variables,this.state.context,this,a),await this.options.onSettled?.(d,null,n,this.state.context,a),this.#a({type:"success",data:d}),d}catch(d){try{await this.#n.config.onError?.(d,n,this.state.context,this,a)}catch(m){Promise.reject(m)}try{await this.options.onError?.(d,n,this.state.context,a)}catch(m){Promise.reject(m)}try{await this.#n.config.onSettled?.(void 0,d,this.state.variables,this.state.context,this,a)}catch(m){Promise.reject(m)}try{await this.options.onSettled?.(void 0,d,n,this.state.context,a)}catch(m){Promise.reject(m)}throw this.#a({type:"error",error:d}),d}finally{this.#i===l&&(this.#i=void 0),this.#n.runNext(this)}}#a(n){const i=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=i(this.state),kn.batch(()=>{this.#t.forEach(a=>{a.onMutationUpdate(n)}),this.#n.notify({mutation:this,type:"updated",action:n})})}};function Rj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Cj=class extends $u{#e;#t;#n;constructor(n={}){super(),this.config=n,this.#e=new Set,this.#t=new Map,this.#n=0}build(n,i,a){const l=new jj({client:n,mutationCache:this,mutationId:++this.#n,options:n.defaultMutationOptions(i),state:a});return this.add(l),l}add(n){this.#e.add(n);const i=Sf(n);if(typeof i=="string"){const a=this.#t.get(i);a?a.push(n):this.#t.set(i,[n])}this.notify({type:"added",mutation:n})}remove(n){if(this.#e.delete(n)){const i=Sf(n);if(typeof i=="string"){const a=this.#t.get(i);if(a)if(a.length>1){const l=a.indexOf(n);l!==-1&&a.splice(l,1)}else a[0]===n&&this.#t.delete(i)}}this.notify({type:"removed",mutation:n})}canRun(n){const i=Sf(n);if(typeof i=="string"){const a=this.#t.get(i)?.find(l=>l.state.status==="pending");return)DELIM" +R"DELIM(!a||a===n}else return!0}runNext(n){const i=Sf(n);return typeof i=="string"?this.#t.get(i)?.find(a=>a!==n&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){kn.batch(()=>{const n=this.getAll();this.#e.clear(),this.#t.clear(),n.forEach(i=>{this.notify({type:"removed",mutation:i})})})}getAll(){return Array.from(this.#e)}find(n){const i={exact:!0,...n};return this.getAll().find(a=>$_(i,a))}findAll(n={}){return this.getAll().filter(i=>$_(n,i))}notify(n){kn.batch(()=>{this.listeners.forEach(i=>{i(n)})})}resumePausedMutations(){const n=this.getAll().filter(i=>i.state.isPaused);return kn.batch(()=>Promise.all(n.map(i=>i.continue().catch(hi))))}};function Sf(n){return n.options.scope?.id}var kj=class extends $u{#e;constructor(n={}){super(),this.config=n,this.#e=new Map}build(n,i,a){const l=i.queryKey,u=i.queryHash??ag(l,i);let f=this.get(u);return f||(f=new Nj({client:n,queryKey:l,queryHash:u,options:n.defaultQueryOptions(i),state:a,defaultOptions:n.getQueryDefaults(l)}),this.add(f)),f}add(n){this.#e.has(n.queryHash)||(this.#e.set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){this.#e.get(n.queryHash)===n&&(n.destroy(),this.#e.delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){kn.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return this.#e.get(n)}getAll(){return[...this.#e.values()]}find(n){const i={exact:!0,...n};return this.getAll().find(a=>Z_(i,a))}findAll(n={}){const i=this.getAll();return Object.keys(n).length>0?i.filter(a=>Z_(n,a)):i}notify(n){kn.batch(()=>{this.listeners.forEach(i=>{i(n)})})}onFocus(){kn.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){kn.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Dj=class{#e;#t;#n;#i;#a;#r;#l;#s;constructor(n={}){this.#e=n.queryCache||new kj,this.#t=n.mutationCache||new Cj,this.#n=n.defaultOptions||{},this.#i=new Map,this.#a=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#l=cg.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Vf.subscribe(async n=>{n&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#l?.(),this.#l=void 0,this.#s?.(),this.#s=void 0)}isFetching(n){return this.#e.findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return this.#t.findAll({...n,status:"pending"}).length}getQueryData(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state.data}ensureQueryData(n){const i=this.defaultQueryOptions(n),a=this.#e.build(this,i),l=a.state.data;return l===void 0?this.fetchQuery(n):(n.revalidateIfStale&&a.isStaleByTime(jt(i.staleTime,a))&&this.prefetchQuery(i),Promise.resolve(l))}getQueriesData(n){return this.#e.findAll(n).map(({queryKey:i,state:a})=>[i,a.data])}setQueryData(n,i,a){const l=this.defaultQueryOptions({queryKey:n}),u=this.#e.get(l.queryHash)?.state.data,f=pj(i,u);if(f!==void 0)return this.#e.build(this,l).setData(f,{...a,manual:!0})}setQueriesData(n,i,a){return kn.batch(()=>this.#e.findAll(n).map(({queryKey:l})=>[l,this.setQueryData(l,i,a)]))}getQueryState(n){const i=this.defaultQueryOptions({queryKey:n});return this.#e.get(i.queryHash)?.state}removeQueries(n){const i=this.#e;kn.batch(()=>{i.findAll(n).forEach(a=>{i.remove(a)})})}resetQueries(n,i){const a=this.#e;return kn.batch(()=>{const l=a.findAll(n),u=new Set(l);return l.forEach(f=>{f.reset()}),this.refetchQueries({type:"active",predicate:f=>u.has(f)},i)})}cancelQueries(n,i={}){const a={revert:!0,...i},l=kn.batch(()=>this.#e.findAll(n).map(u=>u.cancel(a)));return Promise.all(l).then(hi).catch(hi)}invalidateQueries(n,i={}){return kn.batch(()=>(this.#e.findAll(n).forEach(a=>{a.invalidate()}),n?.refetchType==="none"?Promise.resolve():this.refetchQueries({...n,type:n?.refetchType??n?.type??"active"},i)))}refetchQueries(n,i={}){const a={...i,cancelRefetch:i.cancelRefetch??!0},l=kn.batch(()=>this.#e.findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,a);const d=u.state.fetchStatus==="paused";return(!a.throwOnError||d)&&(f=f.catch(hi)),d?Promise.resolve():f}));return Promise.all(l).then(hi)}async query(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#e.build(this,i),l=a.isStaleByTime(jt(i.staleTime,a))?await a.fetch(i):a.state.data,u=i.select;return u?u(l):l}fetchQuery(n){const i=this.defaultQueryOptions(n);i.retry===void 0&&(i.retry=!1);const a=this.#e.build(this,i);return a.isStaleByTime(jt(i.staleTime,a))?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(hi).catch(hi)}infiniteQuery(n){return n._type="infinite",this.query(n)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(hi).catch(hi)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Vf.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(n){this.#n=n}setQueryDefaults(n,i){this.#i.set(Uu(n),{queryKey:n,defaultOptions:i})}getQueryDefaults(n){const i=[...this.#i.values()],a={};return i.forEach(l=>{uo(n,l.queryKey)&&Object.assign(a,l.defaultOptions)}),a}setMutationDefaults(n,i){this.#a.set(Uu(n),{mutationKey:n,defaultOptions:i})}getMutationDefaults(n){const i=[...this.#a.values()],a={};return i.forEach(l=>{uo(n,l.mutationKey)&&Object.assign(a,l.defaultOptions)}),a}defaultQueryOptions(n){if(n._defaulted)return n;const i={...this.#n.queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return i.queryHash||(i.queryHash=ag(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===lg&&(i.enabled=!1),i}defaultMutationOptions(n){return n?._defaulted?n:{...this.#n.mutations,...n?.mutationKey&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const Ex=se.createContext(!1),Uj=()=>se.useContext(Ex);Ex.Provider;function Zj(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}const $j=se.createContext(Zj()),Lj=()=>se.useContext($j),Hj=(n,i,a)=>{const l=a?.state.status==="error"&&typeof n.throwOnError=="function"?_x(n.throwOnError,[a.state.error,a]):n.throwOnError;(n.suspense||l)&&(i.isReset()||(n.retryOnMount=!1))},Bj=n=>{se.useEffect(()=>{n.clearReset()},[n])},qj=({result:n,errorResetBoundary:i,throwOnError:a,query:l,suspense:u})=>n.isError&&!i.isReset()&&!n.isFetching&&l&&(u&&n.data===void 0||_x(a,[n.error,l])),Vj=n=>{if(n.suspense){const a=u=>u==="static"?u:Math.max(u??1e3,1e3),l=n.staleTime;n.staleTime=typeof l=="function"?(...u)=>a(l(...u)):a(l),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},Ij=(n,i)=>n?.suspense&&i.isPending,Kj=(n,i,a)=>i.fetchOptimistic(n).catch(()=>{a.clearReset()});function Gj(n,i,a){const l=Uj(),u=Lj(),f=uj(),d=f.defaultQueryOptions(n),m=f.getQueryCache().get(d.queryHash),p=n.subscribed!==!1;d._optimisticResults=l?"isRestoring":p?"optimistic":void 0,Vj(d),Hj(d,u,m),Bj(u);const[g]=se.useState(()=>new i(f,d)),x=g.getOptimisticResult(d);se.useEffect(()=>{g.setOptions(d)},[d,g]);const y=!l&&p;if(se.useSyncExternalStore(se.useCallback(w=>{const N=y?g.subscribe(kn.batchCalls(w)):hi;return g.updateResult(),N},[g,y]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),Ij(d,x))throw Kj(d,g,u);if(qj({result:x,errorResetBoundary:u,throwOnError:d.throwOnError,query:m,suspense:d.suspense}))throw x.error;return d.notifyOnChangeProps?x:g.trackResult(x)}function G_(n,i){return Gj(n,Aj)}const Y_={phase:"idle",attempt:0,reconnects:0,connectedAt:null,lastMessageAt:null,error:null};class Yj{#e;#t=Y_;#n=null;#i=new Set;#a=null;#r=null;#l=null;#s;#u=!1;constructor(i){this.#e={...i,connectTimeoutMs:i.connectTimeoutMs??5e3,retryMinimumMs:i.retryMinimumMs??1e3,ret)DELIM" +R"DELIM(ryMaximumMs:i.retryMaximumMs??3e4,heartbeatMs:i.heartbeatMs??24e4,jitterRatio:i.jitterRatio??.2,now:i.now??Date.now,random:i.random??Math.random,webSocketFactory:i.webSocketFactory??(a=>new WebSocket(a))},this.#s=this.#e.retryMinimumMs}getStatus=()=>this.#t;subscribeStatus=i=>(this.#i.add(i),()=>{this.#i.delete(i)});start(){this.#u||(this.#u=!0,this.#s=this.#e.retryMinimumMs,this.#o())}stop(){this.#u=!1,this.#d();const i=this.#n;if(this.#n=null,i)try{i.readyState===1&&this.#e.onBeforeStop?.(i),i.close()}catch{}this.#h(Y_)}send(i){if(this.#n?.readyState!==1)return!1;try{return this.#n.send(i),!0}catch{return!1}}#o(){if(!this.#u||this.#n)return;const i=this.#t.reconnects>0;this.#h({...this.#t,phase:i?"reconnecting":"connecting",attempt:this.#t.attempt+1,error:null});let a;try{a=this.#e.webSocketFactory(this.#e.url),this.#n=a}catch(l){this.#h({...this.#t,error:Fj(l)}),this.#m();return}this.#a=setTimeout(()=>{if(this.#n===a){this.#h({...this.#t,error:"Connection timed out"});try{a.close()}catch{this.#n=null,this.#m()}}},this.#e.connectTimeoutMs),a.addEventListener("open",()=>{this.#n!==a||!this.#u||(this.#c(),this.#s=this.#e.retryMinimumMs,this.#h({...this.#t,phase:"connected",connectedAt:this.#e.now(),error:null}),this.#e.onOpen?.(a),this.#p(a))}),a.addEventListener("message",l=>{if(this.#n!==a||!this.#u)return;const u=Pj(l.data);if(u===null)return;const f=this.#e.now();(this.#t.lastMessageAt===null||f-this.#t.lastMessageAt>=1e3)&&this.#h({...this.#t,lastMessageAt:f}),this.#e.onMessage(u)}),a.addEventListener("error",()=>{if(!(this.#n!==a||!this.#u)){this.#h({...this.#t,error:"WebSocket connection failed"});try{a.close()}catch{this.#n=null,this.#m()}}}),a.addEventListener("close",()=>{this.#n===a&&(this.#n=null,this.#c(),this.#f(),this.#u&&this.#m())})}#m(){if(!this.#u||this.#r)return;const i=1+(this.#e.random()*2-1)*this.#e.jitterRatio,a=Math.max(0,Math.round(this.#s*i));this.#s=Math.min(this.#s*2,this.#e.retryMaximumMs),this.#h({...this.#t,phase:"reconnecting",reconnects:this.#t.reconnects+1,connectedAt:null}),this.#r=setTimeout(()=>{this.#r=null,this.#o()},a)}#p(i){this.#f(),!(!this.#e.onHeartbeat||this.#e.heartbeatMs<=0)&&(this.#l=setInterval(()=>{this.#n===i&&i.readyState===1&&this.#e.onHeartbeat?.(i)},this.#e.heartbeatMs))}#c(){this.#a&&(clearTimeout(this.#a),this.#a=null)}#f(){this.#l&&(clearInterval(this.#l),this.#l=null)}#d(){this.#c(),this.#f(),this.#r&&(clearTimeout(this.#r),this.#r=null)}#h(i){this.#t=i;for(const a of this.#i)a()}}function Pj(n){return typeof n=="string"?n:n instanceof ArrayBuffer?new TextDecoder().decode(n):null}function Fj(n){return n instanceof Error?n.message:"Unable to create WebSocket"}const dg=15e3,_p=3*dg,P_={configuration:null,configurationReceivedAt:null,top:null,topReceivedAt:null,topHeader:null,headerReceivedAt:null,fees:null,invalidFrames:0};class Qj{#e=P_;#t=new Set;#n;#i;#a=null;#r=null;#l=null;#s;#u=null;#o=null;constructor(i,a={}){this.#i=a.now??Date.now,this.#s=a.pollIntervalMs??dg,this.#n=new Yj({url:Zz(i),webSocketFactory:a.webSocketFactory,retryMinimumMs:a.retryMinimumMs,retryMaximumMs:a.retryMaximumMs,jitterRatio:a.jitterRatio,heartbeatMs:this.#s,now:this.#i,onOpen:l=>{this.#a=this.#i(),l.send("/v1/configuration?format=json"),l.send("/v1/top/subscribe?format=json"),this.#o=null,this.#c()},onHeartbeat:l=>{const u=this.#e.topReceivedAt??this.#a;if(u!==null&&this.#i()-u>=_p){try{l.close(4e3,"Native top response timed out")}catch{}return}l.send("/v1/top?format=json")},onBeforeStop:l=>{l.send("/v1/top/subscribe?format=json&stop=true")},onMessage:l=>{const u=BA(l);if(!u){this.#d({...this.#e,invalidFrames:this.#e.invalidFrames+1});return}this.#m(u)}}),this.#n.subscribeStatus(()=>{this.#n.getStatus().phase!=="connected"&&(this.#a=null,this.#o=null,this.#r=null,this.#l=null,this.#f())})}getStatus=()=>this.#n.getStatus();subscribeStatus=i=>this.#n.subscribeStatus(i);getState=()=>this.#e;subscribeState=i=>(this.#t.add(i),()=>{this.#t.delete(i)});start(){this.#u??=setInterval(()=>{this.#c()},tS),this.#n.start()}stop(){this.#u!==null&&clearInterval(this.#u),this.#u=null,this.#o=null,this.#n.stop()}#m(i){const a=this.#i();if(i.type==="fees"){this.#o=null,this.#d({...this.#e,fees:{data:i.payload,receivedAt:a}});return}if(i.type==="top"){const l=this.#e.top!==null&&i.payload{i.configure(n,a)},[n,i,a]),se.useEffect(()=>(i.start(),()=>{i.stop()}),[i]),l}function Xj(n,i,a){const l=se.useMemo(()=>new Qj(n),[n]),u=se.useMemo(()=>$z(n),[n]),f=se.useSyncExternalStore(l.subscribeStatus,l.getStatus,l.getStatus),d=se.useSyncExternalStore(l.subscribeState,l.getState,l.getState),m=Tx(f,d,a);se.useEffect(()=>(l.start(),()=>{l.stop()}),[l]);const p=G_({queryKey:["native-snapshot",n],queryFn:({signal:N})=>qA(n,N),enabled:u&&!m,refetchInterval:dg,retry:!1}),g=Wj(f,d,p.data??null,a),x=F_(f,d,null,a),y=G_({queryKey:["native-fees",n],queryFn:({signal:N})=>VA(n,N),enabled:u&&x===null,refetchInterval:tS,retry:!1}),w=F_(f,d,y.data??null,a);return se.useEffect(()=>{w!==null&&i.recordNativeFees(w.data,w.receivedAt)},[w,i]),se.useEffect(()=>{g.top!==null&&i.recordNativeTop(g.top,g.receivedAt??Date.now())},[i,g.receivedAt,g.top]),{status:f,live:d,...g,restError:p.error instanceof Error?p.error.message:null}}function Tx(n,i,a){return n.phase==="connected"&&i.top!==null&&i.topReceivedAt!==null&&i.configuration!==null&&i.configurationReceivedAt!==null&&Sp(i.topReceivedAt,a)}function Wj(n,i,a,l){return Tx(n,i,l)?{top:i.top,topHeader:i.headerReceivedAt!==null&&Sp(i.headerReceivedAt,l)?i.topHeader:null,configuration:i.configuration,receivedAt:i.topReceivedAt,transport:"websocket"}:a&&Sp(a.receivedAt,l)?{top:a.top,topHeader:a.topHeader,configuration:a.configuration,receivedAt:a.receivedAt,transport:"rest"}:{top:null,topHeader:null,configuration:null,receivedAt:null,transport:"none"}}function F_(n,i,a,l){return n.phase==="connected"&&i.fees!==null&&l-i.fees.receivedAtnew aj,[]),i=xS(),[a,l]=se.useState(Lz),[u,f]=se.useState("overview"),[d,m]=se.useState(!1),[p,g]=se.useState(lj),[x,y]=se.useState(!1),[w,N]=se.useState(!1),[E,A]=se.useState(Cz),k=se.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),B=Jj(a.adminUrl,n,p),D=Xj(a.nativeUrl,n,i),ie=u3(D.top,D.topHeader,i);function K(V){Hz(V),(V.adminUrl!==a.adminUrl||V.nativeUrl!==a.nativeUrl)&&n.reset(),l(V),m(!1)}function G(){Bz();const V=t1();(V.adminUrl!==a.adminUrl||V.nativeUrl!==a.nativeUrl)&&n.reset(),l(V),m(!1)}function F(V){kz(V),A(V)}function te(V){oj(V),g(V)}return S.jsxs("div",{className:"bg-background text-textPrimary min-h-screen",children:[S.jsx("header",{className:"border-accent/30 bg-surface/90 border-b backdrop-blur",children:S.jsx("div",{className:"mx-auto max-w-7xl px-4 py-4",children:S)DELIM" +R"DELIM(.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[S.jsx("button",{type:"button",onClick:()=>{f("overview")},className:"text-accent order-1 text-lg font-semibold tracking-tight",children:"Libbitcoin Server"}),S.jsx("nav",{className:"text-textMuted order-3 flex w-full items-center gap-3 text-sm md:order-2 md:w-auto",children:eR.map(V=>S.jsxs("button",{type:"button",onClick:()=>{f(V.id)},className:`text-textMuted hover:text-accent rounded-md px-3 py-1 text-sm transition ${u===V.id?"bg-accentSecondary/20 text-accent":""}`,children:[V.label,V.id==="logs"&&k.totalLogs>0&&S.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:k.totalLogs>999?"999+":String(k.totalLogs)}),V.id==="events"&&k.totalEvents>0&&S.jsx("span",{className:"bg-background/60 ml-2 rounded px-1.5 py-0.5 text-[10px] tabular-nums",children:k.totalEvents>999?"999+":String(k.totalEvents)})]},V.id))}),S.jsxs("div",{className:"order-2 ml-auto flex items-center gap-3 md:order-3",children:[S.jsxs("div",{className:"hidden items-center gap-2 lg:flex","aria-label":"Connection summary",children:[S.jsx(Q_,{connected:B.phase==="connected",label:"Admin"}),S.jsx(Q_,{connected:D.transport!=="none",label:"Native"})]}),S.jsx("button",{type:"button",onClick:()=>{m(!0)},className:"border-accent/40 text-accent hover:border-accent hover:text-accentSecondary rounded-md border px-3 py-2 text-sm font-medium",children:"Endpoints"})]})]})})}),S.jsxs("main",{className:"mx-auto min-h-[calc(100vh-4rem)] max-w-7xl min-w-0 space-y-6 px-4 py-8",children:[S.jsxs("header",{children:[S.jsx("p",{className:"text-accentSecondary text-sm tracking-wide uppercase",children:"Administration"}),S.jsx("h1",{className:"text-accent text-3xl font-semibold",children:"Admin Dashboard"})]}),u==="overview"&&S.jsx(J4,{adminStatus:B,endpoints:a,metrics:k,native:D,syncEstimate:ie}),u==="logs"&&S.jsx($A,{metrics:n,delivery:k,status:B,logFilter:p,paused:x,onLogFilterChange:te,onPausedChange:V=>{n.setLogsPaused(V),y(V)},onClear:()=>{n.clearLogs()}}),u==="events"&&S.jsx(UA,{metrics:n,paused:w,onPausedChange:V=>{n.setEventsPaused(V),N(V)},onClear:()=>{n.clearEvents()}})]}),S.jsx(tj,{estimate:ie,browserNotificationsEnabled:E},a.nativeUrl),d&&S.jsx(qz,{configuration:a,browserNotificationsEnabled:E,onClose:()=>{m(!1)},onReset:G,onSave:K,onBrowserNotificationsEnabledChange:F},`${a.adminUrl}|${a.nativeUrl}`)]})}function Q_({connected:n,label:i}){return S.jsxs("span",{className:"text-textMuted inline-flex items-center gap-1.5 text-xs",children:[S.jsx("span",{className:`h-2 w-2 rounded-full ${n?"bg-emerald-400":"bg-amber-400"}`,"aria-hidden":"true"}),i]})}function nR({children:n}){const[i]=se.useState(()=>new Dj({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:1}}}));return S.jsx(cj,{client:i,children:n})}const Ox=document.querySelector("#root");if(!Ox)throw new Error("Root element not found");jz.createRoot(Ox).render(S.jsx(wz.StrictMode,{children:S.jsx(nR,{children:S.jsx(tR,{})})})); )DELIM" ) diff --git a/console/embedded/native_css.cpp b/console/embedded/native_css.cpp index e817e44f0..4576c34f7 100644 --- a/console/embedded/native_css.cpp +++ b/console/embedded/native_css.cpp @@ -22,11 +22,38 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, css, -R"DELIM(@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--container-xl:36rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-)DELIM" -R"DELIM(color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-date-and-time-value{text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-y-0{inset-block:0}.left-0{left:0}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[85vh\]{max-height:85vh}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-\[calc\(100\%_-_2rem\)\]{width:calc(100% - 2rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:0}.max-w-7xl{max-width:var(--container-7xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.rotate-180{rotate:180deg}.cursor-pointer{cursor:pointer}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:0}.gap-1{gap:var(--spacing)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));)DELIM" -R"DELIM(margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accent\/10{background-color:#ffa0221a}.bg-accentSecondary{background-color:#c85637}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface{background-color:#1f211c}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-textPrimary{background-color:#ededed}.bg-transparent{background-color:#0000}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.08);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:oklab(24.3788% -.00557154 .00797936/.6);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var)DELIM" -R"DELIM((--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:#ffa022}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.block-101{block-size:calc(var(--spacing) * 101)}.block-102{block-size:calc(var(--spacing) * 102)}.block-103{block-size:calc(var(--spacing) * 103)}.ring-inset{--tw-ring-inset:inset}.group-focus-within\:max-w-\[18rem\]:is(:where(.group):focus-within *){max-width:18rem}.group-focus-within\:translate-x-0:is(:where(.group):focus-within *){--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-focus-within\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media(hover:hover){.group-hover\:max-w-\[18rem\]:is(:where(.group):hover *){max-width:18rem}.group-hover\:translate-x-0:is(:where(.group):hover *){--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.backdrop\:bg-black\/70::backdrop{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/70::backdrop{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing) * 2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing) * 3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing) * 3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,transform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1f)DELIM" -R"DELIM(r))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing) * 72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[16rem_minmax\(0\,1fr\)\]{grid-template-columns:16rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} +R"DELIM(/*! + * Third-party software contained in this file, with its published notices. + * + * ---- @tailwindcss/forms 0.5.11, tailwindcss 4.3.5 ---- + * + * MIT License + * + * Copyright (c) Tailwind Labs, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-space-y-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-lg:32rem;--container-xl:36rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring:where(:not(iframe)){outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hid)DELIM" +R"DELIM(den]:where(:not([hidden=until-found])){display:none!important}input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select{appearance:none;--tw-shadow:0 0 #0000;background-color:#fff;border-width:1px;border-color:#6a7282;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem}:is(input:where([type=text]),input:where(:not([type])),input:where([type=email]),input:where([type=url]),input:where([type=password]),input:where([type=number]),input:where([type=date]),input:where([type=datetime-local]),input:where([type=month]),input:where([type=search]),input:where([type=tel]),input:where([type=time]),input:where([type=week]),select:where([multiple]),textarea,select):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#155dfc;outline:2px solid #0000}input::placeholder,textarea::placeholder{color:#6a7282;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-year-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-month-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-day-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-hour-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-minute-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-second-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-millisecond-field{padding-top:0;padding-bottom:0}::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{-webkit-print-color-adjust:exact;print-color-adjust:exact;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='oklch(55.1%25 0.027 264.364)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem}select:where([multiple]),select:where([size]:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;-webkit-print-color-adjust:unset;print-color-adjust:unset;padding-right:.75rem}input:where([type=checkbox]),input:where([type=radio]){appearance:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;vertical-align:middle;-webkit-user-select:none;user-select:none;color:#155dfc;--tw-shadow:0 0 #0000;background-color:#fff;background-origin:border-box;border-width:1px;border-color:#6a7282;flex-shrink:0;width:1rem;height:1rem;padding:0;display:inline-block}input:where([type=checkbox]){border-radius:0}input:where([type=radio]){border-radius:100%}input:where([type=checkbox]):focus,input:where([type=radio]):focus{outline-offset:2px;--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:oklch(54.6% .245 262.881);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid #0000}input:where([type=checkbox]):checked,input:where([type=radio]):checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}input:where([type=checkbox]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=checkbox]):checked{appearance:auto}}input:where([type=radio]):checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media(forced-colors:active){input:where([type=radio]):checked{appearance:auto}}input:where([type=checkbox]):checked:hover,input:where([type=checkbox]):checked:focus,input:where([type=radio]):checked:hover,input:where([type=radio]):checked:focus{background-color:currentColor;border-color:#0000}input:where([type=checkbox]):indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:#0000}@media(forced-colors:active){input:where([type=checkbox]):indeterminate{appearance:auto}}input:where([type=checkbox]):indeterminate:hover,input:where([type=checkbox]):indeterminate:focus{background-color:currentColor;border-color:#0000}input:where([type=file]){background:unset;border-color:inherit;font-size:unset;line-height:inherit;border-width:0;border-radius:0;padding:0}input:where([type=file]):focus{outline:1px solid buttontext;outline:1px auto -webkit-focus-ring-color}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.inset-y-0{inset-block:0}.left-0{left:0}.z-50{z-index:50}.order-1{order:1}.order-2{order:2}.order-3{order:3}.m-auto{margin:auto}.mx-auto{margin-inline:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing) * 2)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-full{height:100%}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[85vh\]{max-height:85vh}.min-h-\[calc\(100vh-4rem\)\]{min-height:calc(100vh - 4rem)}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-\[calc\(100\%_-_2rem\)\]{width:calc(100% - 2rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:0}.max-w-7xl{max-width:var(--container-7xl)}.max-w-lg{max-width:var(--container-lg)}.max-w-xl{max-width:var(--container-xl)}.min-w-0{min-width:0}.min-w-\[12rem\]{min-width:12rem}.min-w-full{min-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.rotate-180{rotate:180deg}.cursor-pointer{cursor:pointer}.scroll-mt-24{scroll-margin-top:calc(var(--spacing) * 24)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direct)DELIM" +R"DELIM(ion:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:0}.gap-1{gap:var(--spacing)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-accentSecondary\/30>:not(:last-child)){border-color:#c856374d}.place-self-start{place-self:start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:#ffa022}.border-accent\/20{border-color:#ffa02233}.border-accent\/30{border-color:#ffa0224d}.border-accent\/40{border-color:#ffa02266}.border-accent\/50{border-color:#ffa02280}.border-accentSecondary\/20{border-color:#c8563733}.border-accentSecondary\/30{border-color:#c856374d}.border-accentSecondary\/40{border-color:#c8563766}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-rose-500\/50{border-color:#ff235780}@supports (color:color-mix(in lab,red,red)){.border-rose-500\/50{border-color:color-mix(in oklab,var(--color-rose-500) 50%,transparent)}}.border-slate-500\/50{border-color:#62748e80}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/50{border-color:color-mix(in oklab,var(--color-slate-500) 50%,transparent)}}.border-textMuted\/30{border-color:#cfcfcf4d}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab,red,red)){.border-white\/10{border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-accent{background-color:#ffa022}.bg-accent\/5{background-color:#ffa0220d}.bg-accent\/10{background-color:#ffa0221a}.bg-accentSecondary{background-color:#c85637}.bg-accentSecondary\/10{background-color:#c856371a}.bg-accentSecondary\/20{background-color:#c8563733}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-background{background-color:#272822}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-current{background-color:currentColor}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-rose-400{background-color:var(--color-rose-400)}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-rose-500\/20{background-color:#ff235733}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/20{background-color:color-mix(in oklab,var(--color-rose-500) 20%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-surface{background-color:#1f211c}.bg-surface\/60{background-color:#1f211c99}.bg-surface\/80{background-color:#1f211ccc}.bg-surface\/90{background-color:#1f211ce6}.bg-surface\/95{background-color:#1f211cf2}.bg-textPrimary{background-color:#ededed}.bg-transparent{background-color:#0000}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab,red,red)){.bg-white\/5{background-color:color-mix(in oklab,var(--color-white) 5%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-\[linear-gradient\(180deg\,rgba\(255\,255\,255\,0\.18\)\,rgba\(255\,255\,255\,0\)\)\]{background-image:linear-gradient(#ffffff2e,#fff0)}.from-accent\/8{--tw-gradient-from:oklab(78.4754% .0670866 .152134/.08);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-surface\/60{--tw-gradient-to:oklab(24.3788% -.00557154 .00797936/.6);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.)DELIM" +R"DELIM(p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent{color:#ffa022}.text-accentSecondary{color:#c85637}.text-amber-300{color:var(--color-amber-300)}.text-emerald-300{color:var(--color-emerald-300)}.text-rose-300{color:var(--color-rose-300)}.text-slate-300{color:var(--color-slate-300)}.text-textMuted{color:#cfcfcf}.text-textPrimary{color:#ededed}.text-white{color:var(--color-white)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-accent{--tw-ring-color:#ffa022}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.ring-inset{--tw-ring-inset:inset}:is(:where(.group):focus-within .group-focus-within\:max-w-\[18rem\]){max-width:18rem}:is(:where(.group):focus-within .group-focus-within\:translate-x-0){--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(:where(.group):focus-within .group-focus-within\:opacity-100){opacity:1}@media(hover:hover){:is(:where(.group):hover .group-hover\:max-w-\[18rem\]){max-width:18rem}:is(:where(.group):hover .group-hover\:translate-x-0){--tw-translate-x:0px;translate:var(--tw-translate-x) var(--tw-translate-y)}:is(:where(.group):hover .group-hover\:opacity-100){opacity:1}}.placeholder\:text-textMuted::placeholder{color:#cfcfcf}.backdrop\:bg-black\/70::backdrop{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.backdrop\:bg-black\/70::backdrop{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.first\:text-left:first-child{text-align:left}.last\:text-right:last-child{text-align:right}.focus-within\:justify-start:focus-within{justify-content:flex-start}.focus-within\:gap-2:focus-within{gap:calc(var(--spacing) * 2)}.focus-within\:px-3:focus-within{padding-inline:calc(var(--spacing) * 3)}@media(hover:hover){.hover\:justify-start:hover{justify-content:flex-start}.hover\:gap-2:hover{gap:calc(var(--spacing) * 2)}.hover\:border-accent:hover{border-color:#ffa022}.hover\:border-accentSecondary:hover{border-color:#c85637}.hover\:bg-accentSecondary\/10:hover{background-color:#c856371a}.hover\:px-3:hover{padding-inline:calc(var(--spacing) * 3)}.hover\:text-accent:hover{color:#ffa022}.hover\:text-accentSecondary:hover{color:#c85637}}.focus\:border-accent:focus{border-color:#ffa022}.focus\:ring-accent:focus{--tw-ring-color:#ffa022}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:cursor-wait:disabled{cursor:wait}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}@media(prefers-reduced-motion:no-preference){.motion-safe\:-translate-x-1{--tw-translate-x:calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.motion-safe\:transition-\[max-width\,opacity\,tr)DELIM" +R"DELIM(ansform\]{transition-property:max-width,opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:transition-\[padding\,gap\]{transition-property:padding,gap;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.motion-safe\:duration-200{--tw-duration:.2s;transition-duration:.2s}.motion-safe\:ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}}@media(min-width:40rem){.sm\:block{display:block}.sm\:inline{display:inline}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}@media(min-width:48rem){.md\:order-2{order:2}.md\:order-3{order:3}.md\:order-4{order:4}.md\:ml-auto{margin-left:auto}.md\:hidden{display:none}.md\:inline{display:inline}.md\:w-72{width:calc(var(--spacing) * 72)}.md\:w-auto{width:auto}.md\:flex-none{flex:none}.md\:flex-nowrap{flex-wrap:nowrap}}@media(min-width:64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-\[16rem_minmax\(0\,1fr\)\]{grid-template-columns:16rem minmax(0,1fr)}.lg\:grid-cols-\[minmax\(0\,1fr\)_auto\]{grid-template-columns:minmax(0,1fr) auto}}@media(min-width:80rem){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.xl\:grid-cols-\[minmax\(0\,1\.5fr\)_minmax\(20rem\,1fr\)\]{grid-template-columns:minmax(0,1.5fr) minmax(20rem,1fr)}}}:root{color-scheme:dark}body{font-family:var(--font-sans);color:#ededed;background-color:#272822}::selection{color:#272822;background-color:#ffa022}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false} )DELIM" ) diff --git a/console/embedded/native_ecma.cpp b/console/embedded/native_ecma.cpp index cf0177ffe..f2be0fa6c 100644 --- a/console/embedded/native_ecma.cpp +++ b/console/embedded/native_ecma.cpp @@ -22,158 +22,422 @@ namespace libbitcoin { namespace server { DEFINE_EMBEDDED_PAGE(native_pages, char, ecma, -R"DELIM(function TE(e,n){for(var r=0;rs[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();function np(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hd={exports:{}},Eo={};var Dv;function NE(){if(Dv)return Eo;Dv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(s,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var f in l)f!=="key"&&(c[f]=l[f])}else c=l;return l=c.ref,{$$typeof:e,type:s,key:u,ref:l!==void 0?l:null,props:c}}return Eo.Fragment=n,Eo.jsx=r,Eo.jsxs=r,Eo}var Lv;function jE(){return Lv||(Lv=1,Hd.exports=NE()),Hd.exports}var m=jE(),Pd={exports:{}},De={};var Bv;function RE(){if(Bv)return De;Bv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function S(j){return j===null||typeof j!="object"?null:(j=x&&j[x]||j["@@iterator"],typeof j=="function"?j:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,T={};function Q(j,Y,V){this.props=j,this.context=Y,this.refs=T,this.updater=V||k}Q.prototype.isReactComponent={},Q.prototype.setState=function(j,Y){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,Y,"setState")},Q.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function I(){}I.prototype=Q.prototype;function K(j,Y,V){this.props=j,this.context=Y,this.refs=T,this.updater=V||k}var oe=K.prototype=new I;oe.constructor=K,C(oe,Q.prototype),oe.isPureReactComponent=!0;var J=Array.isArray;function ge(){}var O={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function M(j,Y,V){var le=V.ref;return{$$typeof:e,type:j,key:Y,ref:le!==void 0?le:null,props:V}}function $(j,Y){return M(j.type,Y,j.props)}function P(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function U(j){var Y={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(V){return Y[V]})}var fe=/\/+/g;function de(j,Y){return typeof j=="object"&&j!==null&&j.key!=null?U(""+j.key):Y.toString(36)}function me(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(ge,ge):(j.status="pending",j.then(function(Y){j.status==="pending"&&(j.status="fulfilled",j.value=Y)},function(Y){j.status==="pending"&&(j.status="rejected",j.reason=Y)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function z(j,Y,V,le,ne){var be=typeof j;(be==="undefined"||be==="boolean")&&(j=null);var Oe=!1;if(j===null)Oe=!0;else switch(be){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(j.$$typeof){case e:case n:Oe=!0;break;case v:return Oe=j._init,z(Oe(j._payload),Y,V,le,ne)}}if(Oe)return ne=ne(j),Oe=le===""?"."+de(j,0):le,J(ne)?(V="",Oe!=null&&(V=Oe.replace(fe,"$&/")+"/"),z(ne,Y,V,"",function(ye){return ye})):ne!=null&&(P(ne)&&(ne=$(ne,V+(ne.key==null||j&&j.key===ne.key?"":(""+ne.key).replace(fe,"$&/")+"/")+Oe)),Y.push(ne)),1;Oe=0;var wt=le===""?".":le+":";if(J(j))for(var ee=0;ee>>1,ve=z[X];if(0>>1;Xl(V,ae))lel(ne,V)?(z[X]=ne,z[le]=ae,X=le):(z[X]=V,z[Y]=ae,X=Y);else if(lel(ne,ae))z[X]=ne,z[le]=ae,X=le;else break e}}return N}function l(z,N){var ae=z.sortIndex-N.sortIndex;return ae!==0?ae:z.id-N.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],g=[],v=1,y=null,x=3,S=!1,k=!1,C=!1,T=!1,Q=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function oe(z){for(var N=r(g);N!==null;){if(N.callback===null)s(g);else if(N.startTime<=z)s(g),N.sortIndex=N.expirationTime,n(h,N);else break;N=r(g)}}function J(z){if(C=!1,oe(z),!k)if(r(h)!==null)k=!0,ge||(ge=!0,U());else{var N=r(g);N!==null&&me(J,N.startTime-z)}}var ge=!1,O=-1,_=5,M=-1;function $(){return T?!0:!(e.unstable_now()-M<_)}function P(){if(T=!1,ge){var z=e.unstable_now();M=z;var N=!0;try{e:{k=!1,C&&(C=!1,I(O),O=-1),S=!0;var ae=x;try{t:{for(oe(z),y=r(h);y!==null&&!(y.expirationTime>z&&$());){var X=y.callback;if(typeof X=="function"){y.callback=null,x=y.priorityLevel;var ve=X(y.expirationTime<=z);if(z=e.unstable_now(),typeof ve=="function"){y.callback=ve,oe(z),N=!0;break t}y===r(h)&&s(h),oe(z)}else s(h);y=r(h)}if(y!==null)N=!0;else{var j=r(g);j!==null&&me(J,j.startTime-z),N=!1}}break e}finally{y=null,x=ae,S=!1}N=void 0}}finally{N?U():ge=!1}}}var U;if(typeof K=="function")U=function(){K(P)};else if(typeof MessageChannel<"u"){var fe=new MessageChannel,de=fe.port2;fe.port1.onmessage=P,U=function(){de.postMessage(null)}}else U=function(){Q(P,0)};function me(z,N){O=Q(function(){z(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_forceFrameRate=function(z){0>z||125X?(z.sortIndex=ae,n(g,z),r(h)===null&&z===r(g)&&(C?(I(O),O=-1):C=!0,me(J,ae-X))):(z.sortIndex=ve,n(h,z),k||S||(k=!0,ge||(ge=!0,U()))),z},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(z){var N=x;return function(){var ae=x;x=N;try{return z.apply(this,arguments)}finally{x=ae}}}})(qd)),qd}var Hv;function OE(){return Hv||(Hv=1,Id.exports=AE()),Id.exports}var Fd={exports:{}},sn={};var Pv;function zE(){if(Pv)return sn;Pv=1;var e=ap();function n(h){var g="https://react.dev/errors/"+h;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Fd.exports=zE(),Fd.exports}var Iv;function ME(){if(Iv)return _o;Iv=1;var e=OE(),n=ap(),r=U0();function s(t){var a="https://react.dev/errors/"+t;if(1ve||(t.current=X[ve],X[ve]=null,ve--)}function V(t,a){ve++,X[ve]=t.current,t.current=a}var le=j(null),ne=j(null),be=j(null),Oe=j(null);function wt(t,a){switch(V(be,a),V(ne,t),V(le,null),a.nodeType){case 9:case 11:t=(t=a.documentElement)&&(t=t.namespaceURI)?rv(t):0;break;default:if(t=a.tagName,a=a.namespaceURI)a=rv(a),t=iv(a,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Y(le),V(le,t)}function ee(){Y(le),Y(ne),Y(be)}function ye(t){t.memoizedState!==null&&V(Oe,t);var a=le.current,i=iv(a,t.type);a!==i&&(V(ne,t),V(le,i))}function te(t){ne.current===t&&(Y(le),Y(ne)),Oe.current===t&&(Y(Oe),bo._currentValue=ae)}var pe,he;function Ne(t){if(pe===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);pe=a&&a[1]||"",he=-1)":-1d||R[o]!==Z[d]){var W=` -`+R[o].replace(" at new "," at ");return t.displayName&&W.includes("")&&(W=W.replace("",t.displayName)),W}while(1<=o&&0<=d);break}}}finally{$e=!1,Error.prepareStackTrace=i}return(i=t?t.displayName||t.name:"")?Ne(i):""}function Tt(t,a){switch(t.tag){case 26:case 27:case 5:return Ne(t.type);case 16:return Ne("Lazy");case 13:return t.child!==a&&a!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return nt(t.type,!1);case 11:return nt(t.type.render,!1);case 1:return nt(t.type,!0);case 31:return Ne("Activity");default:return""}}function Ze(t){try{var a="",i=null;do a+=Tt(t,i),i=t,t=t.return;while(t);return a}catch(o){return` -Error generating stack: `+o.message+` -`+o.stack}}var Ke=Object.prototype.hasOwnProperty,Je=e.unstable_scheduleCallback,st=e.unstable_cancelCallback,Ct=e.unstable_shouldYield,Tn=e.unstable_requestPaint,zt=e.unstable_now,aa=e.unstable_getCurrentPriorityLevel,gn=e.unstable_ImmediatePriority,Ca=e.unstable_UserBlockingPriority,Hn=e.unstable_NormalPriority,Nn=e.unstable_LowPriority,Pn=e.unstable_IdlePriority,Cu=e.log,Au=e.unstable_setDisableYieldValue,Aa=null,cn=null;function Qt(t){if(typeof Cu=="function"&&Au(t),cn&&typeof cn.setStrictMode=="function")try{cn.setStrictMode(Aa,t)}catch{}}var rn=Math.clz32?Math.clz32:Ou,ml=Math.log,gl=Math.LN2;function Ou(t){return t>>>=0,t===0?32:31-(ml(t)/gl|0))DELIM" -R"DELIM(|0}var Gr=256,Oa=262144,Kr=4194304;function ra(t){var a=t&42;if(a!==0)return a;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function _i(t,a,i){var o=t.pendingLanes;if(o===0)return 0;var d=0,p=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var w=o&134217727;return w!==0?(o=w&~p,o!==0?d=ra(o):(b&=w,b!==0?d=ra(b):i||(i=w&~t,i!==0&&(d=ra(i))))):(w=o&~p,w!==0?d=ra(w):b!==0?d=ra(b):i||(i=o&~t,i!==0&&(d=ra(i)))),d===0?0:a!==0&&a!==d&&(a&p)===0&&(p=d&-d,i=a&-a,p>=i||p===32&&(i&4194048)!==0)?a:d}function sr(t,a){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&a)===0}function zu(t,a){switch(t){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function zs(){var t=Kr;return Kr<<=1,(Kr&62914560)===0&&(Kr=4194304),t}function or(t){for(var a=[],i=0;31>i;i++)a.push(t);return a}function ma(t,a){t.pendingLanes|=a,a!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function yl(t,a,i,o,d,p){var b=t.pendingLanes;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=i,t.entangledLanes&=i,t.errorRecoveryDisabledLanes&=i,t.shellSuspendCounter=0;var w=t.entanglements,R=t.expirationTimes,Z=t.hiddenUpdates;for(i=b&~i;0"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Da=/[\n"\\]/g;function fn(t){return t.replace(Da,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Ms(t,a,i,o,d,p,b,w){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),a!=null?b==="number"?(a===0&&t.value===""||t.value!=a)&&(t.value=""+gt(a)):t.value!==""+gt(a)&&(t.value=""+gt(a)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),a!=null?Mu(t,b,gt(a)):i!=null?Mu(t,b,gt(i)):o!=null&&t.removeAttribute("value"),d==null&&p!=null&&(t.defaultChecked=!!p),d!=null&&(t.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.name=""+gt(w):t.removeAttribute("name")}function Jp(t,a,i,o,d,p,b,w){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.type=p),a!=null||i!=null){if(!(p!=="submit"&&p!=="reset"||a!=null)){Ni(t);return}i=i!=null?""+gt(i):"",a=a!=null?""+gt(a):i,w||a===t.value||(t.value=a),t.defaultValue=a}o=o??d,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=w?t.checked:!!o,t.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),Ni(t)}function Mu(t,a,i){a==="number"&&ct(t.ownerDocument)===t||t.defaultValue===""+i||(t.defaultValue=""+i)}function Ri(t,a,i,o){if(t=t.options,a){a={};for(var d=0;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$u=!1;if(Ba)try{var Ls={};Object.defineProperty(Ls,"passive",{get:function(){$u=!0}}),window.addEventListener("test",Ls,Ls),window.removeEventListener("test",Ls,Ls)}catch{$u=!1}var cr=null,Hu=null,Sl=null;function im(){if(Sl)return Sl;var t,a=Hu,i=a.length,o,d="value"in cr?cr.value:cr.textContent,p=d.length;for(t=0;t=$s),fm=" ",dm=!1;function hm(t,a){switch(t){case"keyup":return VS.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var zi=!1;function KS(t,a){switch(t){case"compositionend":return pm(a);case"keypress":return a.which!==32?null:(dm=!0,fm);case"textInput":return t=a.data,t===fm&&dm?null:t;default:return null}}function XS(t,a){if(zi)return t==="compositionend"||!Fu&&hm(t,a)?(t=im(),Sl=Hu=cr=null,zi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1=a)return{node:i,offset:a-t};t=o}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=wm(i)}}function _m(t,a){return t&&a?t===a?!0:t&&t.nodeType===3?!1:a&&a.nodeType===3?_m(t,a.parentNode):"contains"in t?t.contains(a):t.compareDocumentPosition?!!(t.compareDocumentPosition(a)&16):!1:!1}function km(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var a=ct(t.document);a instanceof t.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)t=a.contentWindow;else break;a=ct(t.document)}return a}function Vu(t){var a=t&&t.nodeName&&t.nodeName.toLowerCase();return a&&(a==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||a==="textarea"||t.contentEditable==="true")}var iw=Ba&&"documentMode"in document&&11>=document.documentMode,Mi=null,Gu=null,Is=null,Ku=!1;function Tm(t,a,i){var o=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Ku||Mi==null||Mi!==ct(o)||(o=Mi,"selectionStart"in o&&Vu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Is&&Zs(Is,o)||(Is=o,o=pc(Gu,"onSelect"),0>=b,d-=b,ga=1<<32-rn(a)+d|i<He?(Ye=ke,ke=null):Ye=ke.sibling;var it=F(B,ke,H[He],ie);if(it===null){ke===null&&(ke=Ye);break}t&&ke&&it.alternate===null&&a(B,ke),D=p(it,D,He),rt===null?je=it:rt.sibling=it,rt=it,ke=Ye}if(He===H.length)return i(B,ke),Ve&&$a(B,He),je;if(ke===null){for(;HeHe?(Ye=ke,ke=null):Ye=ke.sibling;var Ar=F(B,ke,it.value,ie);if(Ar===null){ke===null&&(ke=Ye);break}t&&ke&&Ar.alternate===null&&a(B,ke),D=p(Ar,D,He),rt===null?je=Ar:rt.sibling=Ar,rt=Ar,ke=Ye}if(it.done)return i(B,ke),Ve&&$a(B,He),je;if(ke===null){for(;!it.done;He++,it=H.next())it=se(B,it.value,ie),it!==null&&(D=p(it,D,He),rt===null?je=it:rt.sibling=it,rt=it);return Ve&&$a(B,He),je}for(ke=o(ke);!it.done;He++,it=H.next())it=G(ke,B,He,it.value,ie),it!==null&&(t&&it.alternate!==null&&ke.delete(it.key===null?He:it.key),D=p(it,D,He),rt===null?je=it:rt.sibling=it,rt=it);return t&&ke.forEach(function(kE){return a(B,kE)}),Ve&&$a(B,He),je}function mt(B,D,H,ie){if(typeof H=="object"&&H!==null&&H.type===C&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case S:e:{for(var je=H.key;D!==null;){if(D.key===je){if(je=H.type,je===C){if(D.tag===7){i(B,D.sibling),ie=d(D,H.props.children),ie.return=B,B=ie;break e}}else if(D.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===_&&si(je)===D.type){i(B,D.sibling),ie=d(D,H.props),Gs(ie,H),ie.return=B,B=ie;break e}i(B,D);break}else a(B,D);D=D.sibling}H.type===C?(ie=ti(H.props.children,B.mode,ie,H.key),ie.return=B,B=ie):(ie=Al(H.type,H.key,H.props,null,B.mode,ie),Gs(ie,H),ie.return=B,B=ie)}return b(B);case k:e:{for(je=H.key;D!==null;){if(D.key===je)if(D.tag===4&&D.stateNode.containerInfo===H.containerInfo&&D.stateNode.implementation===H.implementation){i(B,D.sibling),ie=d(D,H.children||[]),ie.return=B,B=ie;break e}else{i(B,D);break}else a(B,D);D=D.sibling}ie=af(H,B.mode,ie),ie.return=B,B=ie}return b(B);case _:return H=si(H),mt(B,D,H,ie)}if(me(H))return _e(B,D,H,ie);if(U(H)){if(je=U(H),typeof je!="function")throw Error(s(150));return H=je.call(H),Ae(B,D,H,ie)}if(typeof H.then=="function")return mt(B,D,Ul(H),ie);if(H.$$typeof===K)return mt(B,D,Ml(B,H),ie);$l(B,H)}return typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint"?(H=""+H,D!==null&&D.tag===6?(i(B,D.sibling),ie=d(D,H),ie.return=B,B=ie):(i(B,D),ie=nf(H,B.mode,ie),ie.return=B,B=ie),b(B)):i(B,D)}return function(B,D,H,ie){try{Vs=0;var je=mt(B,D,H,ie);return Fi=null,je}catch(ke){if(ke===qi||ke===Ll)throw ke;var rt=Cn(29,ke,null,B.mode);return rt.lanes=ie,rt.return=B,rt}}}var li=Gm(!0),Km=Gm(!1),pr=!1;function gf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yf(t,a){t=t.updateQueue,a.updateQueue===t&&(a.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function mr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function gr(t,a,i){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ot&2)!==0){var d=o.pending;return d===null?a.next=a:(a.next=d.next,d.next=a),o.pending=a,a=Cl(t),zm(t,null,i),a}return Rl(t,o,a,i),Cl(t)}function Ks(t,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var o=a.lanes;o&=t.pendingLanes,i|=o,a.lanes=i,bl(t,i)}}function vf(t,a){var i=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,i===o)){var d=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var b={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};p===null?d=p=b:p=p.next=b,i=i.next}while(i!==null);p===null?d=p=a:p=p.next=a}else d=p=a;i={baseState:o.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},t.updateQueue=i;return}t=i.lastBaseUpdate,t===null?i.firstBaseUpdate=a:t.next=a,i.lastBaseUpdate=a}var bf=!1;function Xs(){if(bf){var t=Ii;if(t!==null)throw t}}function Js(t,a,i,o){bf=!1;var d=t.updateQueue;pr=!1;var p=d.firstBaseUpdate,b=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var R=w,Z=R.next;R.next=null,b===null?p=Z:b.next=Z,b=R;var W=t.alternate;W!==null&&(W=W.updateQueue,w=W.lastBaseUpdate,w!==b&&(w===null?W.firstBaseUpdate=Z:w.next=Z,W.lastBaseUpdate=R))}if(p!==null){var se=d.baseState;b=0,W=Z=R=null,w=p;do{var F=w.lane&-536870913,G=F!==w.lane;if(G?(Qe&F)===F:(o&F)===F){F!==0&&F===Zi&&(bf=!0),W!==null&&(W=W.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var _e=t,Ae=w;F=a;var mt=i;switch(Ae.tag){case 1:if(_e=Ae.payload,typeof _e=="function"){se=_e.call(mt,se,F);break e}se=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=Ae.payload,F=typeof _e=="function"?_e.call(mt,se,F):_e,F==null)break e;se=y({},se,F);break e;case 2:pr=!0}}F=w.callback,F!==null&&(t.flags|=64,G&&(t.flags|=8192),G=d.callbacks,G===null?d.callbacks=[F]:G.push(F))}else G={lane:F,tag:w.tag,payload:w.payload,callback:w.callback,next:null},W===null?(Z=W=G,R=se):W=W.next=G,b|=F;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;G=w,w=G.next,G.next=null,d.lastBaseUpdate=G,d.shared.pending=null}}while(!0);W===null&&(R=se),d.baseState=R,d.firstBaseUpdate=Z,d.lastBaseUpdate=W,p===null&&(d.shared.lanes=0),Sr|=b,t.lanes=b,t.memoizedState=se}}function Xm(t,a){if(typeof t!="function")throw Error(s(191,t));t.call(a)}function Jm(t,a){var i=t.callbacks;if(i!==null)for(t.callbacks=null,t=0;tp?p:8;var b=z.T,w={};z.T=w,Uf(t,!1,a,i);try{var R=d(),Z=z.S;if(Z!==null&&Z(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var W=pw(R,o);to(t,a,W,Dn(t))}else to(t,a,o,Dn(t))}catch(se){to(t,a,{then:function(){},status:"rejected",reason:se},Dn())}finally{N.p=p,b!==null&&w.types!==null&&(b.types=w.types),z.T=b}}function xw(){}function Lf(t,a,i,o){if(t.tag!==5)throw Error(s(476));var d=Cg(t).queue;Rg(t,d,a,ae,i===null?xw:function(){return Ag(t),i(o)})}function Cg(t){var a=t.memoizedState;if(a!==null)return a;a={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:ae},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ia,lastRenderedState:i},next:null},t.memoizedState=a,t=t.alternate,t!==null&&(t.memoizedState=a),a}function Ag(t){var a=Cg(t);a.next===null&&(a=t.alternate.memoizedState),to(t,a.next.queue,{},Dn())}function Bf(){return Jt(bo)}function Og(){return Lt().memoizedState}function zg(){return Lt().memoizedState}function Sw(t){for(var a=t.return;a!==null;){switch(a.tag){case 24:case 3:var i=Dn();t=mr(i);var o=gr(a,t,i);o!==null&&(En(o,a,i),Ks(o,a,i)),a={cache:df()},t.payload=a;return}a=a.return}}function ww(t,a,i){var o=Dn();i={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Gl(t)?Dg(a,i):(i=ef(t,a,i,o),i!==null&&(En(i,t,o),Lg(i,a,o)))}function Mg(t,a,i){var o=Dn();to(t,a,i,o)}function to(t,a,i,o){var d={lane:o,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Gl(t))Dg(a,d);else{var p=t.alternate;if(t.lanes===0&&(p===null||p.lanes===0)&&(p=a.lastRenderedReducer,p!==null))try{var b=a.lastRenderedState,w=p(b,i);if(d.hasEagerState=!0,d.eagerState=w,Rn(w,b))return Rl(t,a,d,0),yt===null&&jl(),!1}catch{}if(i=ef(t,a,d,o),i!==null)return En(i,t,o),Lg(i,a,o),!0}return!1}function Uf(t,a,i,o){if(o={lane:2,revertLane:gd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Gl(t)){if(a)throw Error(s(479))}else a=ef(t,i,o,2),a!==null&&En(a,t,2)}function Gl(t){var a=t.alternate;return t===Ue||a!==null&&a===Ue}function Dg(t,a){Yi=Zl=!0;var i=t.pending;i===null?a.next=a:(a.next=i.next,i.next=a),t.pending=a}function Lg(t,a,i){if((i&4194048)!==0){var o=a.lanes;o&=t.pendingLanes,i|=o,a.lanes=i,bl(t,i)}}var no={readContext:Jt,use:Fl,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useLayoutEffect:At,useInsertionEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useSyncExternalStore:At,useId:At,useHostTransitionStatus:At,useFormState:At,useActionState:At,useOptimistic:At,useMemoCache:At,useCacheRefresh:At};no.useEffectEvent=At;var Bg={readContext:Jt,use:Fl,useCallback:function(t,a){return dn().memoizedState=[t,a===void 0?null:a],t},useContext:Jt,useEffect:xg,useImperativeHandle:function(t,a,i){i=i!=null?i.concat([t]):null,Yl(4194308,4,_g.bind(null,a,t),i)},useLayoutEffect:function(t,a){return Yl(4194308,4,t,a)},useInsertionEffect:function(t,a){Yl(4,2,t,a)},useMemo:function(t,a){var i=dn();a=a===void 0?null:a;var o=t();if(ci){Qt(!0);try{t()}finally{Qt(!1)}}return i.memoizedState=[o,a],o},useReducer:function(t,a,i){var o=dn();if(i!==void 0){var d=i(a);if(ci){Qt(!0);try{i(a)}finally{Qt(!1)}}}else d=a;return o.memoizedState=o.baseState=d,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:d},o.queue=t,t=t.dispatch=ww.bind(null,Ue,t),[o.memoizedState,t]},useRef:function(t){var a=dn();return t={current:t},a.memoizedState=t},useState:function(t){t=Af(t);var a=t.queue,i=Mg.bind(null,Ue,a);return a.dispatch=i,[t.memoizedState,i]},useDebugValue:Mf,useDeferredValue:function(t,a){var i=dn();return Df(i,t,a)},useTransition:function(){var t=Af(!1);return t=Rg.bind(null,Ue,t.queue,!0,!1),dn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,a,i){var o=Ue,d=dn();if(Ve){if(i===void 0)throw Error(s(407));i=i()}else{if(i=a(),yt===null)throw Error(s(349));(Qe&127)!==0||rg(o,a,i)}d.memoizedState=i;var p={value:i,getSnapshot:a};return d.queue=p,xg(sg.bind(null,o,p,t),[t]),o.flags|=2048,Gi(9,{destroy:void 0},ig.bind(null,o,p,i,a),null),i},useId:function(){var t=dn(),a=yt.identifierPrefix;if(Ve){var i=ya,o=ga;i=(o&~(1<<32-rn(o)-1)).toString(32)+i,a="_"+a+"R_"+i,i=Il++,0<\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?b.createElement(d,{is:o.is}):b.createElement(d)}}p[xe]=a,p[we]=o;e:for(b=a.child;b!==null;){if(b.tag===5||b.tag===6)p.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===a)break e;for(;b.sibling===null;){if(b.return===null||b.return===a)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}a.stateNode=p;e:switch(en(p,d,o),d){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Fa(a)}}return xt(a),Jf(a,a.type,t===null?null:t.memoizedProps,a.pendingProps,i),null;case 6:if(t&&a.stateNode!=null)t.memoizedProps!==o&&Fa(a);else{if(typeof o!="string"&&a.stateNode===null)throw Error(s(166));if(t=be.current,Hi(a)){if(t=a.stateNode,i=a.memoizedProps,o=null,d=Xt,d!==null)switch(d.tag){case 27:case 5:o=d.memoizedProps}t[xe]=a,t=!!(t.nodeValue===i||o!==null&&o.suppressHydrationWarning===!0||nv(t.nodeValue,i)),t||dr(a,!0)}else t=mc(t).createTextNode(o),t[xe]=a,a.stateNode=t}return xt(a),null;case 31:if(i=a.memoizedState,t===null||t.memoizedState!==null){if(o=Hi(a),i!==null){if(t===null){if(!o)throw Error(s(318));if(t=a.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[xe]=a}else ni(),(a.flags)DELIM" -R"DELIM(&128)===0&&(a.memoizedState=null),a.flags|=4;xt(a),t=!1}else i=lf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=i),t=!0;if(!t)return a.flags&256?(On(a),a):(On(a),null);if((a.flags&128)!==0)throw Error(s(558))}return xt(a),null;case 13:if(o=a.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(d=Hi(a),o!==null&&o.dehydrated!==null){if(t===null){if(!d)throw Error(s(318));if(d=a.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(s(317));d[xe]=a}else ni(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;xt(a),d=!1}else d=lf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=d),d=!0;if(!d)return a.flags&256?(On(a),a):(On(a),null)}return On(a),(a.flags&128)!==0?(a.lanes=i,a):(i=o!==null,t=t!==null&&t.memoizedState!==null,i&&(o=a.child,d=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(d=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==d&&(o.flags|=2048)),i!==t&&i&&(a.child.flags|=8192),ec(a,a.updateQueue),xt(a),null);case 4:return ee(),t===null&&xd(a.stateNode.containerInfo),xt(a),null;case 10:return Pa(a.type),xt(a),null;case 19:if(Y(Dt),o=a.memoizedState,o===null)return xt(a),null;if(d=(a.flags&128)!==0,p=o.rendering,p===null)if(d)ro(o,!1);else{if(Ot!==0||t!==null&&(t.flags&128)!==0)for(t=a.child;t!==null;){if(p=Pl(t),p!==null){for(a.flags|=128,ro(o,!1),t=p.updateQueue,a.updateQueue=t,ec(a,t),a.subtreeFlags=0,t=i,i=a.child;i!==null;)Mm(i,t),i=i.sibling;return V(Dt,Dt.current&1|2),Ve&&$a(a,o.treeForkCount),a.child}t=t.sibling}o.tail!==null&&zt()>ic&&(a.flags|=128,d=!0,ro(o,!1),a.lanes=4194304)}else{if(!d)if(t=Pl(p),t!==null){if(a.flags|=128,d=!0,t=t.updateQueue,a.updateQueue=t,ec(a,t),ro(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!Ve)return xt(a),null}else 2*zt()-o.renderingStartTime>ic&&i!==536870912&&(a.flags|=128,d=!0,ro(o,!1),a.lanes=4194304);o.isBackwards?(p.sibling=a.child,a.child=p):(t=o.last,t!==null?t.sibling=p:a.child=p,o.last=p)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=zt(),t.sibling=null,i=Dt.current,V(Dt,d?i&1|2:i&1),Ve&&$a(a,o.treeForkCount),t):(xt(a),null);case 22:case 23:return On(a),Sf(),o=a.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(a.flags|=8192):o&&(a.flags|=8192),o?(i&536870912)!==0&&(a.flags&128)===0&&(xt(a),a.subtreeFlags&6&&(a.flags|=8192)):xt(a),i=a.updateQueue,i!==null&&ec(a,i.retryQueue),i=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),o=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(o=a.memoizedState.cachePool.pool),o!==i&&(a.flags|=2048),t!==null&&Y(ii),null;case 24:return i=null,t!==null&&(i=t.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Pa($t),xt(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function Nw(t,a){switch(sf(a),a.tag){case 1:return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 3:return Pa($t),ee(),t=a.flags,(t&65536)!==0&&(t&128)===0?(a.flags=t&-65537|128,a):null;case 26:case 27:case 5:return te(a),null;case 31:if(a.memoizedState!==null){if(On(a),a.alternate===null)throw Error(s(340));ni()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 13:if(On(a),t=a.memoizedState,t!==null&&t.dehydrated!==null){if(a.alternate===null)throw Error(s(340));ni()}return t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 19:return Y(Dt),null;case 4:return ee(),null;case 10:return Pa(a.type),null;case 22:case 23:return On(a),Sf(),t!==null&&Y(ii),t=a.flags,t&65536?(a.flags=t&-65537|128,a):null;case 24:return Pa($t),null;case 25:return null;default:return null}}function oy(t,a){switch(sf(a),a.tag){case 3:Pa($t),ee();break;case 26:case 27:case 5:te(a);break;case 4:ee();break;case 31:a.memoizedState!==null&&On(a);break;case 13:On(a);break;case 19:Y(Dt);break;case 10:Pa(a.type);break;case 22:case 23:On(a),Sf(),t!==null&&Y(ii);break;case 24:Pa($t)}}function io(t,a){try{var i=a.updateQueue,o=i!==null?i.lastEffect:null;if(o!==null){var d=o.next;i=d;do{if((i.tag&t)===t){o=void 0;var p=i.create,b=i.inst;o=p(),b.destroy=o}i=i.next}while(i!==d)}}catch(w){ft(a,a.return,w)}}function br(t,a,i){try{var o=a.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var p=d.next;o=p;do{if((o.tag&t)===t){var b=o.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,d=a;var R=i,Z=w;try{Z()}catch(W){ft(d,R,W)}}}o=o.next}while(o!==p)}}catch(W){ft(a,a.return,W)}}function ly(t){var a=t.updateQueue;if(a!==null){var i=t.stateNode;try{Jm(a,i)}catch(o){ft(t,t.return,o)}}}function cy(t,a,i){i.props=ui(t.type,t.memoizedProps),i.state=t.memoizedState;try{i.componentWillUnmount()}catch(o){ft(t,a,o)}}function so(t,a){try{var i=t.ref;if(i!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof i=="function"?t.refCleanup=i(o):i.current=o}}catch(d){ft(t,a,d)}}function va(t,a){var i=t.ref,o=t.refCleanup;if(i!==null)if(typeof o=="function")try{o()}catch(d){ft(t,a,d)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(d){ft(t,a,d)}else i.current=null}function uy(t){var a=t.type,i=t.memoizedProps,o=t.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&o.focus();break e;case"img":i.src?o.src=i.src:i.srcSet&&(o.srcset=i.srcSet)}}catch(d){ft(t,t.return,d)}}function Wf(t,a,i){try{var o=t.stateNode;Gw(o,t.type,i,a),o[we]=a}catch(d){ft(t,t.return,d)}}function fy(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Tr(t.type)||t.tag===4}function ed(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||fy(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Tr(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function td(t,a,i){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(t,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(t),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=La));else if(o!==4&&(o===27&&Tr(t.type)&&(i=t.stateNode,a=null),t=t.child,t!==null))for(td(t,a,i),t=t.sibling;t!==null;)td(t,a,i),t=t.sibling}function tc(t,a,i){var o=t.tag;if(o===5||o===6)t=t.stateNode,a?i.insertBefore(t,a):i.appendChild(t);else if(o!==4&&(o===27&&Tr(t.type)&&(i=t.stateNode),t=t.child,t!==null))for(tc(t,a,i),t=t.sibling;t!==null;)tc(t,a,i),t=t.sibling}function dy(t){var a=t.stateNode,i=t.memoizedProps;try{for(var o=t.type,d=a.attributes;d.length;)a.removeAttributeNode(d[0]);en(a,o,i),a[xe]=t,a[we]=i}catch(p){ft(t,t.return,p)}}var Qa=!1,Zt=!1,nd=!1,hy=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function jw(t,a){if(t=t.containerInfo,Ed=wc,t=km(t),Vu(t)){if("selectionStart"in t)var i={start:t.selectionStart,end:t.selectionEnd};else e:{i=(i=t.ownerDocument)&&i.defaultView||window;var o=i.getSelection&&i.getSelection();if(o&&o.rangeCount!==0){i=o.anchorNode;var d=o.anchorOffset,p=o.focusNode;o=o.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var b=0,w=-1,R=-1,Z=0,W=0,se=t,F=null;t:for(;;){for(var G;se!==i||d!==0&&se.nodeType!==3||(w=b+d),se!==p||o!==0&&se.nodeType!==3||(R=b+o),se.nodeType===3&&(b+=se.nodeValue.length),(G=se.firstChild)!==null;)F=se,se=G;for(;;){if(se===t)break t;if(F===i&&++Z===d&&(w=b),F===p&&++W===o&&(R=b),(G=se.nextSibling)!==null)break;se=F,F=se.parentNode}se=G}i=w===-1||R===-1?null:{start:w,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for(_d={focusedElem:t,selectionRange:i},wc=!1,Yt=a;Yt!==null;)if(a=Yt,t=a.child,(a.subtreeFlags&1028)!==0&&t!==null)t.return=a,Yt=t;else for(;Yt!==null;){switch(a=Yt,p=a.alternate,t=a.flags,a.tag){case 0:if((t&4)!==0&&(t=a.updateQueue,t=t!==null?t.)DELIM" -R"DELIM(events:null,t!==null))for(i=0;i title"))),en(p,o,i),p[xe]=t,et(p),o=p;break e;case"link":var b=bv("link","href",d).get(o+(i.href||""));if(b){for(var w=0;wmt&&(b=mt,mt=Ae,Ae=b);var B=Em(w,Ae),D=Em(w,mt);if(B&&D&&(G.rangeCount!==1||G.anchorNode!==B.node||G.anchorOffset!==B.offset||G.focusNode!==D.node||G.focusOffset!==D.offset)){var H=se.createRange();H.setStart(B.node,B.offset),G.removeAllRanges(),Ae>mt?(G.addRange(H),G.extend(D.node,D.offset)):(H.setEnd(D.node,D.offset),G.addRange(H))}}}}for(se=[],G=w;G=G.parentNode;)G.nodeType===1&&se.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;wi?32:i,z.T=null,i=cd,cd=null;var p=Er,b=Xa;if(Ft=0,es=Er=null,Xa=0,(ot&6)!==0)throw Error(s(331));var w=ot;if(ot|=4,_y(p.current),Sy(p,p.current,b,i),ot=w,ho(0,!1),cn&&typeof cn.onPostCommitFiberRoot=="function")try{cn.onPostCommitFiberRoot(Aa,p)}catch{}return!0}finally{N.p=d,z.T=o,Zy(t,a)}}function qy(t,a,i){a=qn(i,a),a=Zf(t.stateNode,a,2),t=gr(t,a,2),t!==null&&(ma(t,2),ba(t))}function ft(t,a,i){if(t.tag===3)qy(t,t,i);else for(;a!==null;){if(a.tag===3){qy(a,t,i);break}else if(a.tag===1){var o=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(wr===null||!wr.has(o))){t=qn(i,t),i=Fg(2),o=gr(a,i,2),o!==null&&(Qg(i,o,a,t),ma(o,2),ba(o));break}}a=a.return}}function hd(t,a,i){var o=t.pingCache;if(o===null){o=t.pingCache=new Aw;var d=new Set;o.set(a,d)}else d=o.get(a),d===void 0&&(d=new Set,o.set(a,d));d.has(i)||(id=!0,d.add(i),t=Lw.bind(null,t,a,i),a.then(t,t))}function Lw(t,a,i){var o=t.pingCache;o!==null&&o.delete(a),t.pingedLanes|=t.suspendedLanes&i,t.warmLanes&=~i,yt===t&&(Qe&i)===i&&(Ot===4||Ot===3&&(Qe&62914560)===Qe&&300>zt()-rc?(ot&2)===0&&ts(t,0):sd|=i,Wi===Qe&&(Wi=0)),ba(t)}function Fy(t,a){a===0&&(a=zs()),t=ei(t,a),t!==null&&(ma(t,a),ba(t))}function Bw(t){var a=t.memoizedState,i=0;a!==null&&(i=a.retryLane),Fy(t,i)}function Uw(t,a){var i=0;switch(t.tag){case 31:case 13:var o=t.stateNode,d=t.memoizedState;d!==null&&(i=d.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(s(314))}o!==null&&o.delete(a),Fy(t,i)}function $w(t,a){return Je(t,a)}var fc=null,as=null,pd=!1,dc=!1,md=!1,kr=0;function ba(t){t!==as&&t.next===null&&(as===null?fc=as=t:as=as.next=t),dc=!0,pd||(pd=!0,Pw())}function ho(t,a){if(!md&&dc){md=!0;do for(var i=!1,o=fc;o!==null;){if(t!==0){var d=o.pendingLanes;if(d===0)var p=0;else{var b=o.suspendedLanes,w=o.pingedLanes;p=(1<<31-rn(42|t)+1)-1,p&=d&~(b&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(i=!0,Gy(o,p))}else p=Qe,p=_i(o,o===yt?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||sr(o,p)||(i=!0,Gy(o,p));o=o.next}while(i);md=!1}}function Hw(){Qy()}function Qy(){dc=pd=!1;var t=0;kr!==0&&Xw()&&(t=kr);for(var a=zt(),i=null,o=fc;o!==null;){var d=o.next,p=Yy(o,a);p===0?(o.next=null,i===null?fc=d:i.next=d,d===null&&(as=i)):(i=o,(t!==0||(p&3)!==0)&&(dc=!0)),o=d}Ft!==0&&Ft!==5||ho(t),kr!==0&&(kr=0)}function Yy(t,a){for(var i=t.suspendedLanes,o=t.pingedLanes,d=t.expirationTimes,p=t.pendingLanes&-62914561;0w)break;var W=R.transferSize,se=R.initiatorType;W&&av(se)&&(R=R.responseEnd,b+=W*(R"u"?null:document;function mv(t,a,i){var o=rs;if(o&&typeof a=="string"&&a){var d=fn(a);d='link[rel="'+t+'"][href="'+d+'"]',typeof i=="string"&&(d+='[crossorigin="'+i+'"]'),pv.has(d)||(pv.add(d),t={rel:t,crossOrigin:i,href:a},o.querySelector(d)===null&&(a=o.createElement("link"),en(a,"link",t),et(a),o.head.appendChild(a)))}}function sE(t){Ja.D(t),mv("dns-prefetch",t,null)}function oE(t,a){Ja.C(t,a),mv("preconnect",t,a)}function lE(t,a,i){Ja.L(t,a,i);var o=rs;if(o&&t&&a){var d='link[rel="preload"][as="'+fn(a)+'"]';a==="image"&&i&&i.imageSrcSet?(d+='[imagesrcset="'+fn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(d+='[imagesizes="'+fn(i.imageSizes)+'"]')):d+='[href="'+fn(t)+'"]';var p=d;switch(a){case"style":p=is(t);break;case"script":p=ss(t)}Kn.has(p)||(t=y({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:t,as:a},i),Kn.set(p,t),o.querySelector(d)!==null||a==="style"&&o.querySelector(yo(p))||a==="script"&&o.querySelector(vo(p))||(a=o.createElement("link"),en(a,"link",t),et(a),o.head.appendChild(a)))}}function cE(t,a){Ja.m(t,a);var i=rs;if(i&&t){var o=a&&typeof a.as=="string"?a.as:"script",d='link[rel="modulepreload"][as="'+fn(o)+'"][href="'+fn(t)+'"]',p=d;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=ss(t)}if(!Kn.has(p)&&(t=y({rel:"modulepreload",href:t},a),Kn.set(p,t),i.querySelector(d)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(vo(p)))return}o=i.createElement("link"),en(o,"link",t),et(o),i.head.appendChild(o)}}}function uE(t,a,i){Ja.S(t,a,i);var o=rs;if(o&&t){var d=Mt(o).hoistableStyles,p=is(t);a=a||"default";var b=d.get(p);if(!b){var w={loading:0,preload:null};if(b=o.querySelector(yo(p)))w.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":a},i),(i=Kn.get(p))&&Ad(t,i);var R=b=o.createElement("link");et(R),en(R,"link",t),R._p=new Promise(function(Z,W){R.onload=Z,R.onerror=W}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",functio)DELIM" -R"DELIM(n(){w.loading|=2}),w.loading|=4,yc(b,a,o)}b={type:"stylesheet",instance:b,count:1,state:w},d.set(p,b)}}}function fE(t,a){Ja.X(t,a);var i=rs;if(i&&t){var o=Mt(i).hoistableScripts,d=ss(t),p=o.get(d);p||(p=i.querySelector(vo(d)),p||(t=y({src:t,async:!0},a),(a=Kn.get(d))&&Od(t,a),p=i.createElement("script"),et(p),en(p,"link",t),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(d,p))}}function dE(t,a){Ja.M(t,a);var i=rs;if(i&&t){var o=Mt(i).hoistableScripts,d=ss(t),p=o.get(d);p||(p=i.querySelector(vo(d)),p||(t=y({src:t,async:!0,type:"module"},a),(a=Kn.get(d))&&Od(t,a),p=i.createElement("script"),et(p),en(p,"link",t),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(d,p))}}function gv(t,a,i,o){var d=(d=be.current)?gc(d):null;if(!d)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=is(i.href),i=Mt(d).hoistableStyles,o=i.get(a),o||(o={type:"style",instance:null,count:0,state:null},i.set(a,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){t=is(i.href);var p=Mt(d).hoistableStyles,b=p.get(t);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(t,b),(p=d.querySelector(yo(t)))&&!p._p&&(b.instance=p,b.state.loading=5),Kn.has(t)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Kn.set(t,i),p||hE(d,t,i,b.state))),a&&o===null)throw Error(s(528,""));return b}if(a&&o!==null)throw Error(s(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=ss(i),i=Mt(d).hoistableScripts,o=i.get(a),o||(o={type:"script",instance:null,count:0,state:null},i.set(a,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function is(t){return'href="'+fn(t)+'"'}function yo(t){return'link[rel="stylesheet"]['+t+"]"}function yv(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function hE(t,a,i,o){t.querySelector('link[rel="preload"][as="style"]['+a+"]")?o.loading=1:(a=t.createElement("link"),o.preload=a,a.addEventListener("load",function(){return o.loading|=1}),a.addEventListener("error",function(){return o.loading|=2}),en(a,"link",i),et(a),t.head.appendChild(a))}function ss(t){return'[src="'+fn(t)+'"]'}function vo(t){return"script[async]"+t}function vv(t,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var o=t.querySelector('style[data-href~="'+fn(i.href)+'"]');if(o)return a.instance=o,et(o),o;var d=y({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),et(o),en(o,"style",d),yc(o,i.precedence,t),a.instance=o;case"stylesheet":d=is(i.href);var p=t.querySelector(yo(d));if(p)return a.state.loading|=4,a.instance=p,et(p),p;o=yv(i),(d=Kn.get(d))&&Ad(o,d),p=(t.ownerDocument||t).createElement("link"),et(p);var b=p;return b._p=new Promise(function(w,R){b.onload=w,b.onerror=R}),en(p,"link",o),a.state.loading|=4,yc(p,i.precedence,t),a.instance=p;case"script":return p=ss(i.src),(d=t.querySelector(vo(p)))?(a.instance=d,et(d),d):(o=i,(d=Kn.get(p))&&(o=y({},i),Od(o,d)),t=t.ownerDocument||t,d=t.createElement("script"),et(d),en(d,"link",o),t.head.appendChild(d),a.instance=d);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(o=a.instance,a.state.loading|=4,yc(o,i.precedence,t));return a.instance}function yc(t,a,i){for(var o=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=o.length?o[o.length-1]:null,p=d,b=0;b title"):null)}function pE(t,a,i){if(i===1||a.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;return a.rel==="stylesheet"?(t=a.disabled,typeof a.precedence=="string"&&t==null):!0;case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function Sv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function mE(t,a,i,o){if(i.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var d=is(o.href),p=a.querySelector(yo(d));if(p){a=p._p,a!==null&&typeof a=="object"&&typeof a.then=="function"&&(t.count++,t=bc.bind(t),a.then(t,t)),i.state.loading|=4,i.instance=p,et(p);return}p=a.ownerDocument||a,o=yv(o),(d=Kn.get(d))&&Ad(o,d),p=p.createElement("link"),et(p);var b=p;b._p=new Promise(function(w,R){b.onload=w,b.onerror=R}),en(p,"link",o),i.instance=p}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(i,a),(a=i.state.preload)&&(i.state.loading&3)===0&&(t.count++,i=bc.bind(t),a.addEventListener("load",i),a.addEventListener("error",i))}}var zd=0;function gE(t,a){return t.stylesheets&&t.count===0&&Sc(t,t.stylesheets),0zd?50:800)+a);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(d)}}:null}function bc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Sc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var xc=null;function Sc(t,a){t.stylesheets=null,t.unsuspend!==null&&(t.count++,xc=new Map,a.forEach(yE,t),xc=null,bc.call(t))}function yE(t,a){if(!(a.state.loading&4)){var i=xc.get(t);if(i)var o=i.get(null);else{i=new Map,xc.set(t,i);for(var d=t.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Zd.exports=ME(),Zd.exports}var LE=DE();const BE=np(LE);var nl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},UE=class extends nl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},rp=new UE,$E={setTimeout:(e,n)=>setTimeout(e,n),clearTimeout:e=>clearTimeout(e),setInterval:(e,n)=>setInterval(e,n),clearInterval:e=>clearInterval(e)},HE=class{#e=$E;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,n){return this.#e.setTimeout(e,n)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,n){return this.#e.setInterval(e,n)}clearInterval(e){this.#e.clearInterval(e)}},yi=new HE;function PE(e){setTimeout(e,0)}var ZE=typeof window>"u"||"Deno"in globalThis;function _n(){}function IE(e,n){return typeof e=="function"?e(n):e}function Eh(e){return typeof e=="number"&&e>=0&&e!==1/0}function $0(e,n){return Math.max(e+(n||0)-Date.now(),0)}function qr(e,n){return typeof e=="function"?e(n):e}function Ln(e,n){return typeof e=="function"?e(n):e}function Fv(e,n){const{type:r="all",exact:s,fetchStatus:l,predicate:c,queryKey:u,stale:f}=e;if(u){if(s){if(n.queryHash!==ip(u,n.options))return!1}else if(!Fo(n.queryKey,u))return!1}if(r!=="all"){const h=n.isActive();if(r==="active"&&!h||r==="inactive"&&h)return!1}return!(typeof f=="boolean"&&n.isStale()!==f||l&&l!==n.state.fetchStatus||c&&!c(n))}function Qv(e,n){const{exact:r,status:s,predicate:l,mutationKey:c}=e;if(c){if(!n.options.mutationKey)return!1;if(r){if(qo(n.options.mutationKey)!==qo(c))return!1}else if(!Fo(n.options.mutationKey,c))return!1}return!(s&&n.state.status!==s||l&&!l(n))}function ip(e,n){return(n?.queryKeyHashFn||qo)(e)}function qo(e){return JSON.stringify(e,(n,r)=>kh(r)?Object.keys(r).sort().reduce((s,l)=>(s[l]=r[l],s),{}):r)}function Fo(e,n){return e===n?!0:typeof e!=typeof n?!1:e&&n&&typeof e=="object"&&typeof n=="object"?Object.keys(n).every(r=>Fo(e[r],n[r])):!1}var qE=Object.prototype.hasOwnProperty;function H0(e,n,r=0){if(e===n)return e;if(r>500)return n;const s=Yv(e)&&Yv(n);if(!s&&!(kh(e)&&kh(n)))return n;const c=(s?e:Object.keys(e)).length,u=s?n:Object.keys(n),f=u.length,h=s?new Array(f):{};let g=0;for(let v=0;v{yi.setTimeout(n,e)})}function Th(e,n,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,n):r.structuralSharing!==!1?H0(e,n):n}function QE(e,n,r=0){const s=[...e,n];return r&&s.length>r?s.slice(1):s}function YE(e,n,r=0){const s=[n,...e];return r&&s.length>r?s.slice(0,-1):s}var sp=Symbol();function P0(e,n){return!e.queryFn&&n?.initialPromise?()=>n.initialPromise:!e.queryFn||e.queryFn===sp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Z0(e,n){return typeof e=="function"?e(...n):!!e}function VE(e,n,r){let s=!1,l;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(l??=n(),s||(s=!0,l.aborted?r():l.addEventListener("abort",r,{once:!0})),l)}),e}var Qo=(()=>{let e=()=>ZE;return{isServer(){return e()},setIsServer(n){e=n}}})();function Nh(){let e,n;const r=new Promise((l,c)=>{e=l,n=c});r.status="pending",r.catch(()=>{});function s(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{s({status:"fulfilled",value:l}),e(l)},r.reject=l=>{s({status:"rejected",reason:l}),n(l)},r}var GE=PE;function KE(){let e=[],n=0,r=f=>{f()},s=f=>{f()},l=GE;const c=f=>{n?e.push(f):l(()=>{r(f)})},u=()=>{const f=e;e=[],f.length&&l(()=>{s(()=>{f.forEach(h=>{r(h)})})})};return{batch:f=>{let h;n++;try{h=f()}finally{n--,n||u()}return h},batchCalls:f=>(...h)=>{c(()=>{f(...h)})},schedule:c,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{l=f}}}var an=KE(),XE=class extends nl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.s)DELIM" -R"DELIM(etOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}},au=new XE;function JE(e){return Math.min(1e3*2**e,3e4)}function I0(e){return(e??"online")==="online"?au.isOnline():!0}var jh=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function q0(e){let n=!1,r=0,s;const l=Nh(),c=()=>l.status!=="pending",u=C=>{if(!c()){const T=new jh(C);x(T),e.onCancel?.(T)}},f=()=>{n=!0},h=()=>{n=!1},g=()=>rp.isFocused()&&(e.networkMode==="always"||au.isOnline())&&e.canRun(),v=()=>I0(e.networkMode)&&e.canRun(),y=C=>{c()||(s?.(),l.resolve(C))},x=C=>{c()||(s?.(),l.reject(C))},S=()=>new Promise(C=>{s=T=>{(c()||g())&&C(T)},e.onPause?.()}).then(()=>{s=void 0,c()||e.onContinue?.()}),k=()=>{if(c())return;let C;const T=r===0?e.initialPromise:void 0;try{C=T??e.fn()}catch(Q){C=Promise.reject(Q)}Promise.resolve(C).then(y).catch(Q=>{if(c())return;const I=e.retry??(Qo.isServer()?0:3),K=e.retryDelay??JE,oe=typeof K=="function"?K(r,Q):K,J=I===!0||typeof I=="number"&&rg()?void 0:S()).then(()=>{n?x(Q):k()})})};return{promise:l,status:()=>l.status,cancel:u,continue:()=>(s?.(),l),cancelRetry:f,continueRetry:h,canStart:v,start:()=>(v()?k():S().then(k),l)}}var F0=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Eh(this.gcTime)&&(this.#e=yi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Qo.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(yi.clearTimeout(this.#e),this.#e=void 0)}};function WE(e){return{onFetch:(n,r)=>{const s=n.options,l=n.fetchOptions?.meta?.fetchMore?.direction,c=n.state.data?.pages||[],u=n.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const g=async()=>{let v=!1;const y=k=>{VE(k,()=>n.signal,()=>v=!0)},x=P0(n.options,n.fetchOptions),S=async(k,C,T)=>{if(v)return Promise.reject(n.signal.reason);if(C==null&&k.pages.length)return Promise.resolve(k);const I=(()=>{const ge={client:n.client,queryKey:n.queryKey,pageParam:C,direction:T?"backward":"forward",meta:n.options.meta};return y(ge),ge})(),K=await x(I),{maxPages:oe}=n.options,J=T?YE:QE;return{pages:J(k.pages,K,oe),pageParams:J(k.pageParams,C,oe)}};if(l&&c.length){const k=l==="backward",C=k?e2:Gv,T={pages:c,pageParams:u},Q=C(s,T);f=await S(T,Q,k)}else{const k=e??c.length;do{const C=h===0?u[0]??s.initialPageParam:Gv(s,f);if(h>0&&C==null)break;f=await S(f,C),h++}while(hn.options.persister?.(g,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},r):n.fetchFn=g}}}function Gv(e,{pages:n,pageParams:r}){const s=n.length-1;return n.length>0?e.getNextPageParam(n[s],n,r[s],r):void 0}function e2(e,{pages:n,pageParams:r}){return n.length>0?e.getPreviousPageParam?.(n[0],n,r[0],r):void 0}var t2=class extends F0{#e;#t;#n;#a;#i;#r;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Xv(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Xv(this.options);n.data!==void 0&&(this.setState(Kv(n.data,n.dataUpdatedAt)),this.#t=n)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,n){const r=Th(this.state.data,e,this.options);return this.#l({data:r,type:"success",dataUpdatedAt:n?.updatedAt,manual:n?.manual}),r}setState(e){this.#l({type:"setState",state:e})}cancel(e){const n=this.#r?.promise;return this.#r?.cancel(e),n?n.then(_n).catch(_n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ln(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===sp||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>qr(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!$0(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(n=>n.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(n=>n.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.#r&&(this.#s||this.#u()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,n){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&n?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(g=>g.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#s=!0,r.signal)})},l=()=>{const h=P0(this.options,n),v=(()=>{const y={client:this.#i,queryKey:this.queryKey,meta:this.meta};return s(y),y})();return this.#s=!1,this.options.persister?this.options.persister(h,v,this):h(v)},u=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:l};return s(h),h})();(this.#e==="infinite"?WE(this.options.pages):this.options.behavior)?.onFetch(u,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#l({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=q0({initialPromise:n?.initialPromise,fn:u.fetchFn,onCancel:h=>{h instanceof jh&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),r.abort()},onFail:(h,g)=>{this.#l({type:"failed",failureCount:h,error:g})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#a.config.onSuccess?.(h,this),this.#a.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof jh){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#a.config.onError?.(h,this),this.#a.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Q0(r.data,this.options),fetchMeta:e.meta??null};case"success":const s={...r,...Kv(e.data,e.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idl)DELIM" -R"DELIM(e",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?s:void 0,s;case"error":const l=e.error;return{...r,error:l,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),an.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function Q0(e,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I0(n.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Kv(e,n){return{data:e,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Xv(e){const n=typeof e.initialData=="function"?e.initialData():e.initialData,r=n!==void 0,s=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var n2=class extends nl{constructor(e,n){super(),this.options=n,this.#e=e,this.#s=null,this.#o=Nh(),this.bindMethods(),this.setOptions(n)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#r;#o;#s;#u;#l;#p;#f;#d;#c;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Jv(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rh(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rh(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const n=this.options,r=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ln(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),n._defaulted&&!_h(this.options,n)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Wv(this.#t,r,this.options,n)&&this.#h(),this.updateResult(),s&&(this.#t!==r||Ln(this.options.enabled,this.#t)!==Ln(n.enabled,this.#t)||qr(this.options.staleTime,this.#t)!==qr(n.staleTime,this.#t))&&this.#g();const l=this.#y();s&&(this.#t!==r||Ln(this.options.enabled,this.#t)!==Ln(n.enabled,this.#t)||l!==this.#c)&&this.#v(l)}getOptimisticResult(e){const n=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(n,e);return r2(this,r)&&(this.#a=r,this.#r=this.options,this.#i=this.#t.state),r}getCurrentResult(){return this.#a}trackResult(e,n){return new Proxy(e,{get:(r,s)=>(this.trackProp(s),n?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,s))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#h(e){this.#w();let n=this.#t.fetch(this.options,e);return e?.throwOnError||(n=n.catch(_n)),n}#g(){this.#x();const e=qr(this.options.staleTime,this.#t);if(Qo.isServer()||this.#a.isStale||!Eh(e))return;const r=$0(this.#a.dataUpdatedAt,e)+1;this.#f=yi.setTimeout(()=>{this.#a.isStale||this.updateResult()},r)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#c=e,!(Qo.isServer()||Ln(this.options.enabled,this.#t)===!1||!Eh(this.#c)||this.#c===0)&&(this.#d=yi.setInterval(()=>{(this.options.refetchIntervalInBackground||rp.isFocused())&&this.#h()},this.#c))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#f!==void 0&&(yi.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(yi.clearInterval(this.#d),this.#d=void 0)}createResult(e,n){const r=this.#t,s=this.options,l=this.#a,c=this.#i,u=this.#r,h=e!==r?e.state:this.#n,{state:g}=e;let v={...g},y=!1,x;if(n._optimisticResults){const _=this.hasListeners(),M=!_&&Jv(e,n),$=_&&Wv(e,r,n,s);(M||$)&&(v={...v,...Q0(g.data,e.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:S,errorUpdatedAt:k,status:C}=v;x=v.data;let T=!1;if(n.placeholderData!==void 0&&x===void 0&&C==="pending"){let _;l?.isPlaceholderData&&n.placeholderData===u?.placeholderData?(_=l.data,T=!0):_=typeof n.placeholderData=="function"?n.placeholderData(this.#p?.state.data,this.#p):n.placeholderData,_!==void 0&&(C="success",x=Th(l?.data,_,n),y=!0)}if(n.select&&x!==void 0&&!T)if(l&&x===c?.data&&n.select===this.#u)x=this.#l;else try{this.#u=n.select,x=n.select(x),x=Th(l?.data,x,n),this.#l=x,this.#s=null}catch(_){this.#s=_}this.#s&&(S=this.#s,x=this.#l,k=Date.now(),C="error");const Q=v.fetchStatus==="fetching",I=C==="pending",K=C==="error",oe=I&&Q,J=x!==void 0,O={status:C,fetchStatus:v.fetchStatus,isPending:I,isSuccess:C==="success",isError:K,isInitialLoading:oe,isLoading:oe,data:x,dataUpdatedAt:v.dataUpdatedAt,error:S,errorUpdatedAt:k,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:v.dataUpdateCount>h.dataUpdateCount||v.errorUpdateCount>h.errorUpdateCount,isFetching:Q,isRefetching:Q&&!I,isLoadingError:K&&!J,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:K&&J,isStale:op(e,n),refetch:this.refetch,promise:this.#o,isEnabled:Ln(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const _=O.data!==void 0,M=O.status==="error"&&!_,$=fe=>{M?fe.reject(O.error):_&&fe.resolve(O.data)},P=()=>{const fe=this.#o=O.promise=Nh();$(fe)},U=this.#o;switch(U.status){case"pending":e.queryHash===r.queryHash&&$(U);break;case"fulfilled":(M||O.data!==U.value)&&P();break;case"rejected":(!M||O.error!==U.reason)&&P();break}}return O}updateResult(){const e=this.#a,n=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#r=this.options,this.#i.data!==void 0&&(this.#p=this.#t),_h(n,e))return;this.#a=n;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,l=typeof s=="function"?s():s;if(l==="all"||!l&&!this.#m.size)return!0;const c=new Set(l??this.#m);return this.options.throwOnError&&c.add("error"),Object.keys(this.#a).some(u=>{const f=u;return this.#a[f]!==e[f]&&c.has(f)})};this.#E({listeners:r()})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const n=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(n?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#E(e){an.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function a2(e,n){return Ln(n.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ln(n.retryOnMount,e)===!1)}function Jv(e,n){return a2(e,n)||e.state.data!==void 0&&Rh(e,n,n.refetchOnMount)}function Rh(e,n,r){if(Ln(n.enabled,e)!==!1&&qr(n.staleTime,e)!=="static"){const s=typeof r=="function"?r(e):r;return s==="always"||s!==!1&&op(e,n)}return!1}function Wv(e,n,r,s){return(e!==n||Ln(s.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&op(e,r)}function op(e,n){return Ln(n.enabled,e)!==!1&&e.isStaleByTime(qr(n.staleTime,e))}function r2(e,n){return!_h(e.g)DELIM" -R"DELIM(etCurrentResult(),n)}var i2=class extends F0{#e;#t;#n;#a;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||s2(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(n=>n!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const n=()=>{this.#i({type:"continue"})},r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=q0({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(new Error("No mutationFn found")),onFail:(c,u)=>{this.#i({type:"failed",failureCount:c,error:u})},onPause:()=>{this.#i({type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",l=!this.#a.canStart();try{if(s)n();else{this.#i({type:"pending",variables:e,isPaused:l}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);const u=await this.options.onMutate?.(e,r);u!==this.state.context&&this.#i({type:"pending",context:u,variables:e,isPaused:l})}const c=await this.#a.start();return await this.#n.config.onSuccess?.(c,e,this.state.context,this,r),await this.options.onSuccess?.(c,e,this.state.context,r),await this.#n.config.onSettled?.(c,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(c,null,e,this.state.context,r),this.#i({type:"success",data:c}),c}catch(c){try{await this.#n.config.onError?.(c,e,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onError?.(c,e,this.state.context,r)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,c,this.state.variables,this.state.context,this,r)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,c,e,this.state.context,r)}catch(u){Promise.reject(u)}throw this.#i({type:"error",error:c}),c}finally{this.#n.runNext(this)}}#i(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),an.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function s2(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var o2=class extends nl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,n,r){const s=new i2({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){this.#e.add(e);const n=Rc(e);if(typeof n=="string"){const r=this.#t.get(n);r?r.push(e):this.#t.set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const n=Rc(e);if(typeof n=="string"){const r=this.#t.get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&this.#t.delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Rc(e);if(typeof n=="string"){const s=this.#t.get(n)?.find(l=>l.state.status==="pending");return!s||s===e}else return!0}runNext(e){const n=Rc(e);return typeof n=="string"?this.#t.get(n)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){an.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Qv(n,r))}findAll(e={}){return this.getAll().filter(n=>Qv(e,n))}notify(e){an.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return an.batch(()=>Promise.all(e.map(n=>n.continue().catch(_n))))}};function Rc(e){return e.options.scope?.id}var l2=class extends nl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,r){const s=n.queryKey,l=n.queryHash??ip(s,n);let c=this.get(l);return c||(c=new t2({client:e,queryKey:s,queryHash:l,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=this.#e.get(e.queryHash);n&&(e.destroy(),n===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){an.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Fv(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>Fv(e,r)):n}notify(e){an.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){an.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){an.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c2=class{#e;#t;#n;#a;#i;#r;#o;#s;constructor(e={}){this.#e=e.queryCache||new l2,this.#t=e.mutationCache||new o2,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#o=rp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=au.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(e){const n=this.defaultQueryOptions(e),r=this.#e.build(this,n),s=r.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(qr(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:n,state:r})=>{const s=r.data;return[n,s]})}setQueryData(e,n,r){const s=this.defaultQueryOptions({queryKey:e}),c=this.#e.get(s.queryHash)?.state.data,u=IE(n,c);if(u!==void 0)return this.#e.build(this,s).setData(u,{...r,manual:!0})}setQueriesData(e,n,r){return an.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,n,r)]))}getQueryState(e){const n=this.defaultQueryOptions({queryKey:e});return this.#e.get(n.queryHash)?.state}removeQueries(e){const n=this.#e;an.batch(()=>{n.findAll(e).forEach(r=>{n.remove(r)})})}resetQueries(e,n){const r=this.#e;return an.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},n)))}cancelQueries(e,n={}){const r={revert:!0,...n},s=an.batch(()=>this.#e.findAll(e).map(l=>l.cancel(r)));return Promise.all(s).then(_n).catch(_n)}invalidateQueries(e,n={}){return an.batch(()=>(this.#e.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},n)))}refetchQueries(e,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},s=an.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&)DELIM" -R"DELIM(!l.isStatic()).map(l=>{let c=l.fetch(void 0,r);return r.throwOnError||(c=c.catch(_n)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(s).then(_n)}fetchQuery(e){const n=this.defaultQueryOptions(e);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(qr(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(_n).catch(_n)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(_n).catch(_n)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return au.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,n){this.#a.set(qo(e),{queryKey:e,defaultOptions:n})}getQueryDefaults(e){const n=[...this.#a.values()],r={};return n.forEach(s=>{Fo(e,s.queryKey)&&Object.assign(r,s.defaultOptions)}),r}setMutationDefaults(e,n){this.#i.set(qo(e),{mutationKey:e,defaultOptions:n})}getMutationDefaults(e){const n=[...this.#i.values()],r={};return n.forEach(s=>{Fo(e,s.mutationKey)&&Object.assign(r,s.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const n={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return n.queryHash||(n.queryHash=ip(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===sp&&(n.enabled=!1),n}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Y0=E.createContext(void 0),V0=e=>{const n=E.useContext(Y0);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},u2=({client:e,children:n})=>(E.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(Y0.Provider,{value:e,children:n})),G0=E.createContext(!1),f2=()=>E.useContext(G0);G0.Provider;function d2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var h2=E.createContext(d2()),p2=()=>E.useContext(h2),m2=(e,n,r)=>{const s=r?.state.error&&typeof e.throwOnError=="function"?Z0(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(n.isReset()||(e.retryOnMount=!1))},g2=e=>{E.useEffect(()=>{e.clearReset()},[e])},y2=({result:e,errorResetBoundary:n,throwOnError:r,query:s,suspense:l})=>e.isError&&!n.isReset()&&!e.isFetching&&s&&(l&&e.data===void 0||Z0(r,[e.error,s])),v2=e=>{if(e.suspense){const r=l=>l==="static"?l:Math.max(l??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...l)=>r(s(...l)):r(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},b2=(e,n)=>e.isLoading&&e.isFetching&&!n,x2=(e,n)=>e?.suspense&&n.isPending,eb=(e,n,r)=>n.fetchOptimistic(e).catch(()=>{r.clearReset()});function S2(e,n,r){const s=f2(),l=p2(),c=V0(),u=c.defaultQueryOptions(e);c.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=c.getQueryCache().get(u.queryHash),h=e.subscribed!==!1;u._optimisticResults=s?"isRestoring":h?"optimistic":void 0,v2(u),m2(u,l,f),g2(l);const g=!c.getQueryCache().get(u.queryHash),[v]=E.useState(()=>new n(c,u)),y=v.getOptimisticResult(u),x=!s&&h;if(E.useSyncExternalStore(E.useCallback(S=>{const k=x?v.subscribe(an.batchCalls(S)):_n;return v.updateResult(),k},[v,x]),()=>v.getCurrentResult(),()=>v.getCurrentResult()),E.useEffect(()=>{v.setOptions(u)},[u,v]),x2(u,y))throw eb(u,v,l);if(y2({result:y,errorResetBoundary:l,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;return c.getDefaultOptions().queries?._experimental_afterQuery?.(u,y),u.experimental_prefetchInRender&&!Qo.isServer()&&b2(y,s)&&(g?eb(u,v,l):f?.promise)?.catch(_n).finally(()=>{v.updateResult()}),u.notifyOnChangeProps?y:v.trackResult(y)}function w2(e,n){return S2(e,n2)}var tb;function re(e,n,r){function s(f,h){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:h,constr:u,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),n(f,h);const g=u.prototype,v=Object.keys(g);for(let y=0;yr?.Parent&&f instanceof r.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class vs extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class K0 extends Error{constructor(n){super(`Encountered unidirectional transform during encode: ${n}`),this.name="ZodEncodeError"}}(tb=globalThis).__zod_globalConfig??(tb.__zod_globalConfig={});const lp=globalThis.__zod_globalConfig;function nr(e){return lp}function X0(e){const n=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,l])=>n.indexOf(+s)===-1).map(([s,l])=>l)}function Ch(e,n){return typeof n=="bigint"?n.toString():n}function bu(e){return{get value(){{const n=e();return Object.defineProperty(this,"value",{value:n}),n}}}}function cp(e){return e==null}function up(e){const n=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(n,r)}function E2(e,n){const r=e/n,s=Math.round(r),l=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-s){};function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const k2=bu(()=>{if(lp.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Es(e){if(Yo(e)===!1)return!1;const n=e.constructor;if(n===void 0||typeof n!="function")return!0;const r=n.prototype;return!(Yo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function W0(e){return Es(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const T2=new Set(["string","number","symbol"]);function _s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yr(e,n,r){const s=new e._zod.constr(n??e._zod.def);return(!n||r?.parent)&&(s._zod.parent=e),s}function Te(e){const n=e;if(!n)return{};if(typeof n=="string")return{error:()=>n};if(n?.message!==void 0){if(n?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");n.error=n.message}return delete n.message,typeof n.error=="string"?{...n,error:()=>n.error}:n}function N2(e){return Object.keys(e).filter(n=>e[n]._zod.optin==="optional"&&e[n]._zod.optout==="optional")}const j2={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 R2(e,n){const r=e._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c)DELIM" -R"DELIM(=Qr(e._zod.def,{get shape(){const u={};for(const f in n){if(!(f in r.shape))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(u[f]=r.shape[f])}return Si(this,"shape",u),u},checks:[]});return Yr(e,c)}function C2(e,n){const r=e._zod.def,s=r.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=Qr(e._zod.def,{get shape(){const u={...e._zod.def.shape};for(const f in n){if(!(f in r.shape))throw new Error(`Unrecognized key: "${f}"`);n[f]&&delete u[f]}return Si(this,"shape",u),u},checks:[]});return Yr(e,c)}function A2(e,n){if(!Es(n))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const c=e._zod.def.shape;for(const u in n)if(Object.getOwnPropertyDescriptor(c,u)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const l=Qr(e._zod.def,{get shape(){const c={...e._zod.def.shape,...n};return Si(this,"shape",c),c}});return Yr(e,l)}function O2(e,n){if(!Es(n))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Qr(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n};return Si(this,"shape",s),s}});return Yr(e,r)}function z2(e,n){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const r=Qr(e._zod.def,{get shape(){const s={...e._zod.def.shape,...n._zod.def.shape};return Si(this,"shape",s),s},get catchall(){return n._zod.def.catchall},checks:n._zod.def.checks??[]});return Yr(e,r)}function M2(e,n,r){const l=n._zod.def.checks;if(l&&l.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const u=Qr(n._zod.def,{get shape(){const f=n._zod.def.shape,h={...f};if(r)for(const g in r){if(!(g in f))throw new Error(`Unrecognized key: "${g}"`);r[g]&&(h[g]=e?new e({type:"optional",innerType:f[g]}):f[g])}else for(const g in f)h[g]=e?new e({type:"optional",innerType:f[g]}):f[g];return Si(this,"shape",h),h},checks:[]});return Yr(n,u)}function D2(e,n,r){const s=Qr(n._zod.def,{get shape(){const l=n._zod.def.shape,c={...l};if(r)for(const u in r){if(!(u in c))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=new e({type:"nonoptional",innerType:l[u]}))}else for(const u in l)c[u]=new e({type:"nonoptional",innerType:l[u]});return Si(this,"shape",c),c}});return Yr(n,s)}function ps(e,n=0){if(e.aborted===!0)return!0;for(let r=n;r{var s;return(s=r).path??(s.path=[]),r.path.unshift(e),r})}function Cc(e){return typeof e=="string"?e:e?.message}function ar(e,n,r){const s=e.message?e.message:Cc(e.inst?._zod.def?.error?.(e))??Cc(n?.error?.(e))??Cc(r.customError?.(e))??Cc(r.localeError?.(e))??"Invalid input",{inst:l,continue:c,input:u,...f}=e;return f.path??(f.path=[]),f.message=s,n?.reportInput&&(f.input=u),f}function fp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Vo(...e){const[n,r,s]=e;return typeof n=="string"?{message:n,code:"custom",input:r,inst:s}:{...n}}const ex=(e,n)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:n,enumerable:!1}),e.message=JSON.stringify(n,Ch,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},tx=re("$ZodError",ex),nx=re("$ZodError",ex,{Parent:Error});function B2(e,n=r=>r.message){const r={},s=[];for(const l of e.issues)l.path.length>0?(r[l.path[0]]=r[l.path[0]]||[],r[l.path[0]].push(n(l))):s.push(n(l));return{formErrors:s,fieldErrors:r}}function U2(e,n=r=>r.message){const r={_errors:[]},s=(l,c=[])=>{for(const u of l.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(f=>s({issues:f},[...c,...u.path]));else if(u.code==="invalid_key")s({issues:u.issues},[...c,...u.path]);else if(u.code==="invalid_element")s({issues:u.issues},[...c,...u.path]);else{const f=[...c,...u.path];if(f.length===0)r._errors.push(n(u));else{let h=r,g=0;for(;g(n,r,s,l)=>{const c=s?{...s,async:!1}:{async:!1},u=n._zod.run({value:r,issues:[]},c);if(u instanceof Promise)throw new vs;if(u.issues.length){const f=new(l?.Err??e)(u.issues.map(h=>ar(h,c,nr())));throw J0(f,l?.callee),f}return u.value},hp=e=>async(n,r,s,l)=>{const c=s?{...s,async:!0}:{async:!0};let u=n._zod.run({value:r,issues:[]},c);if(u instanceof Promise&&(u=await u),u.issues.length){const f=new(l?.Err??e)(u.issues.map(h=>ar(h,c,nr())));throw J0(f,l?.callee),f}return u.value},xu=e=>(n,r,s)=>{const l=s?{...s,async:!1}:{async:!1},c=n._zod.run({value:r,issues:[]},l);if(c instanceof Promise)throw new vs;return c.issues.length?{success:!1,error:new(e??tx)(c.issues.map(u=>ar(u,l,nr())))}:{success:!0,data:c.value}},$2=xu(nx),Su=e=>async(n,r,s)=>{const l=s?{...s,async:!0}:{async:!0};let c=n._zod.run({value:r,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?{success:!1,error:new e(c.issues.map(u=>ar(u,l,nr())))}:{success:!0,data:c.value}},H2=Su(nx),P2=e=>(n,r,s)=>{const l=s?{...s,direction:"backward"}:{direction:"backward"};return dp(e)(n,r,l)},Z2=e=>(n,r,s)=>dp(e)(n,r,s),I2=e=>async(n,r,s)=>{const l=s?{...s,direction:"backward"}:{direction:"backward"};return hp(e)(n,r,l)},q2=e=>async(n,r,s)=>hp(e)(n,r,s),F2=e=>(n,r,s)=>{const l=s?{...s,direction:"backward"}:{direction:"backward"};return xu(e)(n,r,l)},Q2=e=>(n,r,s)=>xu(e)(n,r,s),Y2=e=>async(n,r,s)=>{const l=s?{...s,direction:"backward"}:{direction:"backward"};return Su(e)(n,r,l)},V2=e=>async(n,r,s)=>Su(e)(n,r,s),G2=/^[cC][0-9a-z]{6,}$/,K2=/^[0-9a-z]+$/,X2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,J2=/^[0-9a-vA-V]{20}$/,W2=/^[A-Za-z0-9]{27}$/,e_=/^[a-zA-Z0-9_-]{21}$/,t_=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,n_=/^([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})$/,rb=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${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)$/,a_=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,r_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function i_(){return new RegExp(r_,"u")}const s_=/^(?:(?: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])$/,o_=/^(([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}|:))$/,l_=/^((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])$/,c_=/^(([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])$/,u_=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ax=/^[A-Za-z0-9_-]*$/,f_=/^https?$/,d_=/^\+[1-9]\d{6,14}$/,rx="(?:(?:\\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])))",h_=new RegExp(`^${rx}$`);function ix(e){const n="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${n}`:e.precision===0?`${n}:[0-)DELIM" -R"DELIM(5]\\d`:`${n}:[0-5]\\d\\.\\d{${e.precision}}`:`${n}(?::[0-5]\\d(?:\\.\\d+)?)?`}function p_(e){return new RegExp(`^${ix(e)}$`)}function m_(e){const n=ix({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${n}(?:${r.join("|")})`;return new RegExp(`^${rx}T(?:${s})$`)}const g_=e=>{const n=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${n}$`)},y_=/^-?\d+$/,sx=/^-?\d+(?:\.\d+)?$/,v_=/^(?:true|false)$/i,b_=/^[^A-Z]*$/,x_=/^[^a-z]*$/,kn=re("$ZodCheck",(e,n)=>{var r;e._zod??(e._zod={}),e._zod.def=n,(r=e._zod).onattach??(r.onattach=[])}),ox={number:"number",bigint:"bigint",object:"date"},lx=re("$ZodCheckLessThan",(e,n)=>{kn.init(e,n);const r=ox[typeof n.value];e._zod.onattach.push(s=>{const l=s._zod.bag,c=(n.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;n.value{(n.inclusive?s.value<=n.value:s.value{kn.init(e,n);const r=ox[typeof n.value];e._zod.onattach.push(s=>{const l=s._zod.bag,c=(n.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;n.value>c&&(n.inclusive?l.minimum=n.value:l.exclusiveMinimum=n.value)}),e._zod.check=s=>{(n.inclusive?s.value>=n.value:s.value>n.value)||s.issues.push({origin:r,code:"too_small",minimum:typeof n.value=="object"?n.value.getTime():n.value,input:s.value,inclusive:n.inclusive,inst:e,continue:!n.abort})}}),S_=re("$ZodCheckMultipleOf",(e,n)=>{kn.init(e,n),e._zod.onattach.push(r=>{var s;(s=r._zod.bag).multipleOf??(s.multipleOf=n.value)}),e._zod.check=r=>{if(typeof r.value!=typeof n.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%n.value===BigInt(0):E2(r.value,n.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:n.value,input:r.value,inst:e,continue:!n.abort})}}),w_=re("$ZodCheckNumberFormat",(e,n)=>{kn.init(e,n),n.format=n.format||"float64";const r=n.format?.includes("int"),s=r?"int":"number",[l,c]=j2[n.format];e._zod.onattach.push(u=>{const f=u._zod.bag;f.format=n.format,f.minimum=l,f.maximum=c,r&&(f.pattern=y_)}),e._zod.check=u=>{const f=u.value;if(r){if(!Number.isInteger(f)){u.issues.push({expected:s,format:n.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?u.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!n.abort}):u.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!n.abort});return}}fc&&u.issues.push({origin:"number",input:f,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!n.abort})}}),E_=re("$ZodCheckMaxLength",(e,n)=>{var r;kn.init(e,n),(r=e._zod.def).when??(r.when=s=>{const l=s.value;return!cp(l)&&l.length!==void 0}),e._zod.onattach.push(s=>{const l=s._zod.bag.maximum??Number.POSITIVE_INFINITY;n.maximum{const l=s.value;if(l.length<=n.maximum)return;const u=fp(l);s.issues.push({origin:u,code:"too_big",maximum:n.maximum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),__=re("$ZodCheckMinLength",(e,n)=>{var r;kn.init(e,n),(r=e._zod.def).when??(r.when=s=>{const l=s.value;return!cp(l)&&l.length!==void 0}),e._zod.onattach.push(s=>{const l=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;n.minimum>l&&(s._zod.bag.minimum=n.minimum)}),e._zod.check=s=>{const l=s.value;if(l.length>=n.minimum)return;const u=fp(l);s.issues.push({origin:u,code:"too_small",minimum:n.minimum,inclusive:!0,input:l,inst:e,continue:!n.abort})}}),k_=re("$ZodCheckLengthEquals",(e,n)=>{var r;kn.init(e,n),(r=e._zod.def).when??(r.when=s=>{const l=s.value;return!cp(l)&&l.length!==void 0}),e._zod.onattach.push(s=>{const l=s._zod.bag;l.minimum=n.length,l.maximum=n.length,l.length=n.length}),e._zod.check=s=>{const l=s.value,c=l.length;if(c===n.length)return;const u=fp(l),f=c>n.length;s.issues.push({origin:u,...f?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!n.abort})}}),wu=re("$ZodCheckStringFormat",(e,n)=>{var r,s;kn.init(e,n),e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=n.format,n.pattern&&(c.patterns??(c.patterns=new Set),c.patterns.add(n.pattern))}),n.pattern?(r=e._zod).check??(r.check=l=>{n.pattern.lastIndex=0,!n.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:n.format,input:l.value,...n.pattern?{pattern:n.pattern.toString()}:{},inst:e,continue:!n.abort})}):(s=e._zod).check??(s.check=()=>{})}),T_=re("$ZodCheckRegex",(e,n)=>{wu.init(e,n),e._zod.check=r=>{n.pattern.lastIndex=0,!n.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:n.pattern.toString(),inst:e,continue:!n.abort})}}),N_=re("$ZodCheckLowerCase",(e,n)=>{n.pattern??(n.pattern=b_),wu.init(e,n)}),j_=re("$ZodCheckUpperCase",(e,n)=>{n.pattern??(n.pattern=x_),wu.init(e,n)}),R_=re("$ZodCheckIncludes",(e,n)=>{kn.init(e,n);const r=_s(n.includes),s=new RegExp(typeof n.position=="number"?`^.{${n.position}}${r}`:r);n.pattern=s,e._zod.onattach.push(l=>{const c=l._zod.bag;c.patterns??(c.patterns=new Set),c.patterns.add(s)}),e._zod.check=l=>{l.value.includes(n.includes,n.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:n.includes,input:l.value,inst:e,continue:!n.abort})}}),C_=re("$ZodCheckStartsWith",(e,n)=>{kn.init(e,n);const r=new RegExp(`^${_s(n.prefix)}.*`);n.pattern??(n.pattern=r),e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=s=>{s.value.startsWith(n.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:n.prefix,input:s.value,inst:e,continue:!n.abort})}}),A_=re("$ZodCheckEndsWith",(e,n)=>{kn.init(e,n);const r=new RegExp(`.*${_s(n.suffix)}$`);n.pattern??(n.pattern=r),e._zod.onattach.push(s=>{const l=s._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=s=>{s.value.endsWith(n.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:n.suffix,input:s.value,inst:e,continue:!n.abort})}}),O_=re("$ZodCheckOverwrite",(e,n)=>{kn.init(e,n),e._zod.check=r=>{r.value=n.tx(r.value)}});class z_{constructor(n=[]){this.content=[],this.indent=0,this&&(this.args=n)}indented(n){this.indent+=1,n(this),this.indent-=1}write(n){if(typeof n=="function"){n(this,{execution:"sync"}),n(this,{execution:"async"});return}const s=n.split(` -`).filter(u=>u),l=Math.min(...s.map(u=>u.length-u.trimStart().length)),c=s.map(u=>u.slice(l)).map(u=>" ".repeat(this.indent*2)+u);for(const u of c)this.content.push(u)}compile(){const n=Function,r=this?.args,l=[...(this?.content??[""]).map(c=>` ${c}`)];return new n(...r,l.join(` -`))}}const M_={major:4,minor:4,patch:3},Nt=re("$ZodType",(e,n)=>{var r;e??(e={}),e._zod.def=n,e._zod.bag=e._zod.bag||{},e._zod.version=M_;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const l of s)for(const c of l._zod.onattach)c(e);if(s.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(u,f,h)=>{let g=ps(u),v;for(const y of f){if(y._zod.def.when){if(L2(u)||!y._zod.def.when(u))continue}else if(g)continue;const x=u.issues.length,S=y._zod.check(u);if(S instanceof Promise&&h?.async===!1)throw new vs;if(v||S instanceof Promise)v=(v??Promise.resolve()).then(async()=>{await S,u.issues.length!==x&&(g||(g=ps(u,x)))});else{if(u.issues)DELIM" -R"DELIM(.length===x)continue;g||(g=ps(u,x))}}return v?v.then(()=>u):u},c=(u,f,h)=>{if(ps(u))return u.aborted=!0,u;const g=l(f,s,h);if(g instanceof Promise){if(h.async===!1)throw new vs;return g.then(v=>e._zod.parse(v,h))}return e._zod.parse(g,h)};e._zod.run=(u,f)=>{if(f.skipChecks)return e._zod.parse(u,f);if(f.direction==="backward"){const g=e._zod.parse({value:u.value,issues:[]},{...f,skipChecks:!0});return g instanceof Promise?g.then(v=>c(v,u,f)):c(g,u,f)}const h=e._zod.parse(u,f);if(h instanceof Promise){if(f.async===!1)throw new vs;return h.then(g=>l(g,s,f))}return l(h,s,f)}}dt(e,"~standard",()=>({validate:l=>{try{const c=$2(e,l);return c.success?{value:c.data}:{issues:c.error?.issues}}catch{return H2(e,l).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}))}),pp=re("$ZodString",(e,n)=>{Nt.init(e,n),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??g_(e._zod.bag),e._zod.parse=(r,s)=>{if(n.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),kt=re("$ZodStringFormat",(e,n)=>{wu.init(e,n),pp.init(e,n)}),D_=re("$ZodGUID",(e,n)=>{n.pattern??(n.pattern=n_),kt.init(e,n)}),L_=re("$ZodUUID",(e,n)=>{if(n.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[n.version];if(s===void 0)throw new Error(`Invalid UUID version: "${n.version}"`);n.pattern??(n.pattern=rb(s))}else n.pattern??(n.pattern=rb());kt.init(e,n)}),B_=re("$ZodEmail",(e,n)=>{n.pattern??(n.pattern=a_),kt.init(e,n)}),U_=re("$ZodURL",(e,n)=>{kt.init(e,n),e._zod.check=r=>{try{const s=r.value.trim();if(!n.normalize&&n.protocol?.source===f_.source&&!/^https?:\/\//i.test(s)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!n.abort});return}const l=new URL(s);n.hostname&&(n.hostname.lastIndex=0,n.hostname.test(l.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:n.hostname.source,input:r.value,inst:e,continue:!n.abort})),n.protocol&&(n.protocol.lastIndex=0,n.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:n.protocol.source,input:r.value,inst:e,continue:!n.abort})),n.normalize?r.value=l.href:r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!n.abort})}}}),$_=re("$ZodEmoji",(e,n)=>{n.pattern??(n.pattern=i_()),kt.init(e,n)}),H_=re("$ZodNanoID",(e,n)=>{n.pattern??(n.pattern=e_),kt.init(e,n)}),P_=re("$ZodCUID",(e,n)=>{n.pattern??(n.pattern=G2),kt.init(e,n)}),Z_=re("$ZodCUID2",(e,n)=>{n.pattern??(n.pattern=K2),kt.init(e,n)}),I_=re("$ZodULID",(e,n)=>{n.pattern??(n.pattern=X2),kt.init(e,n)}),q_=re("$ZodXID",(e,n)=>{n.pattern??(n.pattern=J2),kt.init(e,n)}),F_=re("$ZodKSUID",(e,n)=>{n.pattern??(n.pattern=W2),kt.init(e,n)}),Q_=re("$ZodISODateTime",(e,n)=>{n.pattern??(n.pattern=m_(n)),kt.init(e,n)}),Y_=re("$ZodISODate",(e,n)=>{n.pattern??(n.pattern=h_),kt.init(e,n)}),V_=re("$ZodISOTime",(e,n)=>{n.pattern??(n.pattern=p_(n)),kt.init(e,n)}),G_=re("$ZodISODuration",(e,n)=>{n.pattern??(n.pattern=t_),kt.init(e,n)}),K_=re("$ZodIPv4",(e,n)=>{n.pattern??(n.pattern=s_),kt.init(e,n),e._zod.bag.format="ipv4"}),X_=re("$ZodIPv6",(e,n)=>{n.pattern??(n.pattern=o_),kt.init(e,n),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!n.abort})}}}),J_=re("$ZodCIDRv4",(e,n)=>{n.pattern??(n.pattern=l_),kt.init(e,n)}),W_=re("$ZodCIDRv6",(e,n)=>{n.pattern??(n.pattern=c_),kt.init(e,n),e._zod.check=r=>{const s=r.value.split("/");try{if(s.length!==2)throw new Error;const[l,c]=s;if(!c)throw new Error;const u=Number(c);if(`${u}`!==c)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${l}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!n.abort})}}});function ux(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const ek=re("$ZodBase64",(e,n)=>{n.pattern??(n.pattern=u_),kt.init(e,n),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{ux(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!n.abort})}});function tk(e){if(!ax.test(e))return!1;const n=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),r=n.padEnd(Math.ceil(n.length/4)*4,"=");return ux(r)}const nk=re("$ZodBase64URL",(e,n)=>{n.pattern??(n.pattern=ax),kt.init(e,n),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{tk(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!n.abort})}}),ak=re("$ZodE164",(e,n)=>{n.pattern??(n.pattern=d_),kt.init(e,n)});function rk(e,n=null){try{const r=e.split(".");if(r.length!==3)return!1;const[s]=r;if(!s)return!1;const l=JSON.parse(atob(s));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||n&&(!("alg"in l)||l.alg!==n))}catch{return!1}}const ik=re("$ZodJWT",(e,n)=>{kt.init(e,n),e._zod.check=r=>{rk(r.value,n.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!n.abort})}}),fx=re("$ZodNumber",(e,n)=>{Nt.init(e,n),e._zod.pattern=e._zod.bag.pattern??sx,e._zod.parse=(r,s)=>{if(n.coerce)try{r.value=Number(r.value)}catch{}const l=r.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return r;const c=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...c?{received:c}:{}}),r}}),sk=re("$ZodNumberFormat",(e,n)=>{w_.init(e,n),fx.init(e,n)}),ok=re("$ZodBoolean",(e,n)=>{Nt.init(e,n),e._zod.pattern=v_,e._zod.parse=(r,s)=>{if(n.coerce)try{r.value=!!r.value}catch{}const l=r.value;return typeof l=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),r}}),lk=re("$ZodUnknown",(e,n)=>{Nt.init(e,n),e._zod.parse=r=>r}),ck=re("$ZodNever",(e,n)=>{Nt.init(e,n),e._zod.parse=(r,s)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function ib(e,n,r){e.issues.length&&n.issues.push(...ms(r,e.issues)),n.value[r]=e.value}const uk=re("$ZodArray",(e,n)=>{Nt.init(e,n),e._zod.parse=(r,s)=>{const l=r.value;if(!Array.isArray(l))return r.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),r;r.value=Array(l.length);const c=[];for(let u=0;uib(g,r,u))):ib(h,r,u)}return c.length?Promise.all(c).then(()=>r):r}});function ru(e,n,r,s,l,c){const u=r in s;if(e.issues.length){if(l&&c&&!u)return;n.issues.push(...ms(r,e.issues))}if(!u&&!l){e.issues.length||n.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?u&&(n.value[r]=void 0):n.value[r]=e.value}function dx(e){const n=Object.keys(e.shape);for(const s of n)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=N2(e.shape);return{...e,keys:n,keySet:new Set(n),numKeys:n.length,optionalKeys:new Set(r)}}function hx(e,n,r,s,l,c){const u=[],f=l.keySet,h=l.catchall._zod,g=h.def.type,v=h.optin==="optional",y=h.optout==="optional";for(const x in n){if(x==="__proto__"||f.has(x))continue;if(g==="never"){u.push(x);continue}const S=h.run({value:n[x],issues:[]},s);S instanceof Promise?e.push(S.then(k=>ru(k,r,x,n,v,y))):ru(S,r,x,n,v,y)}return u.length&&r.issues.push({code:"unrecognized_keys",keys:u,input:n,inst:c}),e.length?Promise.all(e).then(()=>r):r}const fk=re("$ZodObject",(e,n)=>{if(Nt.init(e,n),!Object.getOwnPropertyDescriptor(n,"shape")?.get){const f=n.shape;Object.defineProperty(n,"shape",{get:()=>{const h={...f};return Object.defineProperty(n,"shape",{value:h}),h}})}const s=bu(()=>dx(n));dt(e._zod,"propValues",()=>{const f=n.shape,h={};for(const g in f){const v=f[g]._zod;if(v.values){h[g]??(h[g]=new Set);for(const y of v.val)DELIM" -R"DELIM(ues)h[g].add(y)}}return h});const l=Yo,c=n.catchall;let u;e._zod.parse=(f,h)=>{u??(u=s.value);const g=f.value;if(!l(g))return f.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),f;f.value={};const v=[],y=u.shape;for(const x of u.keys){const S=y[x],k=S._zod.optin==="optional",C=S._zod.optout==="optional",T=S._zod.run({value:g[x],issues:[]},h);T instanceof Promise?v.push(T.then(Q=>ru(Q,f,x,g,k,C))):ru(T,f,x,g,k,C)}return c?hx(v,g,f,h,s.value,e):v.length?Promise.all(v).then(()=>f):f}}),dk=re("$ZodObjectJIT",(e,n)=>{fk.init(e,n);const r=e._zod.parse,s=bu(()=>dx(n)),l=x=>{const S=new z_(["shape","payload","ctx"]),k=s.value,C=K=>{const oe=ab(K);return`shape[${oe}]._zod.run({ value: input[${oe}], issues: [] }, ctx)`};S.write("const input = payload.value;");const T=Object.create(null);let Q=0;for(const K of k.keys)T[K]=`key_${Q++}`;S.write("const newResult = {};");for(const K of k.keys){const oe=T[K],J=ab(K),ge=x[K],O=ge?._zod?.optin==="optional",_=ge?._zod?.optout==="optional";S.write(`const ${oe} = ${C(K)};`),O&&_?S.write(` - if (${oe}.issues.length) { - if (${J} in input) { - payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${J}, ...iss.path] : [${J}] - }))); +R"DELIM(/*! + * Third-party software contained in this file, with its published notices. + * + * ---- @heroicons/react 2.2.0 ---- + * + * MIT License + * + * Copyright (c) Tailwind Labs, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- @noble/hashes 2.4.0, @scure/base 2.4.0 ---- + * + * The MIT License (MIT) + * + * Copyright (c) 2022 Paul Miller (https://paulmillr.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the “Software”), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * ---- @rollup/plugin-commonjs bundled in vite 7.3.8 ---- + * + * The MIT License (MIT) + * + * Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * ---- @tanstack/query-core 5.107.1, @tanstack/react-query 5.107.1 ---- + * + * MIT License + * + * Copyright (c) 2021-present Tanner Linsley + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- prop-types 15.8.1 ---- + * + * MIT License + * + * Copyright (c) 2013-present, Facebook, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- qrcode-generator 2.0.4 ---- + * + * QR Code Generator for JavaScript + * + * Copyright (c) 2009 Kazuhiko Arase + * + * URL: http://www.d-project.com/ + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * + * The word 'QR Code' is registered trademark of + * DENSO WAVE INCORPORATED + * http://www.denso-wave.com/qrcode/faqpatent-e.html + * + * ---- react 19.3.1, react-dom 19.3.1, scheduler 0.28.0 ---- + * + * MIT License + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- react-qr-code 2.2.0 ---- + * + * MIT License + * + * Copyright (c) 2017 Ross Khanas + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + *)DELIM" +R"DELIM( in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- react-router 7.18.5 ---- + * + * MIT License + * + * Copyright (c) React Training LLC 2015-2019 + * Copyright (c) Remix Software Inc. 2020-2021 + * Copyright (c) Shopify Inc. 2022-2023 + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- vite 7.3.8 ---- + * + * # Vite core license + * Vite is released under the MIT license: + * + * MIT License + * + * Copyright (c) 2019-present, VoidZero Inc. and Vite contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * ---- zod 4.6.7 ---- + * + * MIT License + * + * Copyright (c) 2025 Colin McDonnell + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +function QT(e,r){for(var i=0;io[l]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function i(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(l){if(l.ep)return;l.ep=!0;const c=i(l);fetch(l.href,c)}})();function Dp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var um={exports:{}},dl={};var Fb;function KT(){if(Fb)return dl;Fb=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function i(o,l,c){var f=null;if(c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),"key"in l){c={};for(var h in l)h!=="key"&&(c[h]=l[h])}else c=l;return l=c.ref,{$$typeof:e,type:o,key:f,ref:l!==void 0?l:null,props:c}}return dl.Fragment=r,dl.jsx=i,dl.jsxs=i,dl}var Vb;function GT(){return Vb||(Vb=1,um.exports=KT()),um.exports}var g=GT(),fm={exports:{}},Le={};var Yb;function XT(){if(Yb)return Le;Yb=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),S=Symbol.iterator;function E(j){return j===null||typeof j!="object"?null:(j=S&&j[S]||j["@@iterator"],typeof j=="function"?j:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,P={};function H(j,I,pe){this.props=j,this.context=I,this.refs=P,this.updater=pe||k}H.prototype.isReactComponent={},H.prototype.setState=function(j,I){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,I,"setState")},H.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function te(){}te.prototype=H.prototype;function de(j,I,pe){this.props=j,this.context=I,this.refs=P,this.updater=pe||k}var X=de.prototype=new te;X.constructor=de,T(X,H.prototype),X.isPureReactComponent=!0;var se=Array.isArray;function O(){}var N={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function Z(j,I,pe){var ve=pe.ref;return{$$typeof:e,type:j,key:I,ref:ve!==void 0?ve:null,props:pe}}function Q(j,I){return Z(j.type,I,j.props)}function q(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function ue(j){var I={")DELIM" +R"DELIM(=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(pe){return I[pe]})}var me=/\/+/g;function he(j,I){return typeof j=="object"&&j!==null&&j.key!=null?ue(""+j.key):I.toString(36)}function V(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(O,O):(j.status="pending",j.then(function(I){j.status==="pending"&&(j.status="fulfilled",j.value=I)},function(I){j.status==="pending"&&(j.status="rejected",j.reason=I)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function A(j,I,pe,ve,$e){var J=typeof j;(J==="undefined"||J==="boolean")&&(j=null);var le=!1;if(j===null)le=!0;else switch(J){case"bigint":case"string":case"number":le=!0;break;case"object":switch(j.$$typeof){case e:case r:le=!0;break;case v:return le=j._init,A(le(j._payload),I,pe,ve,$e)}}if(le)return $e=$e(j),le=ve===""?"."+he(j,0):ve,se($e)?(pe="",le!=null&&(pe=le.replace(me,"$&/")+"/"),A($e,I,pe,"",function(fe){return fe})):$e!=null&&(q($e)&&($e=Q($e,pe+($e.key==null||j&&j.key===$e.key?"":(""+$e.key).replace(me,"$&/")+"/")+le)),I.push($e)),1;le=0;var $=ve===""?".":ve+":";if(se(j))for(var ee=0;ee>>1,ge=V[W];if(0>>1;Wl(be,ae))jl(I,be)?(V[W]=I,V[j]=ae,W=j):(V[W]=be,V[Fe]=ae,W=Fe);else if(jl(I,ae))V[W]=I,V[j]=ae,W=j;else break e}}return A}function l(V,A){var ae=V.sortIndex-A.sortIndex;return ae!==0?ae:V.id-A.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();e.unstable_now=function(){return f.now()-h}}var m=[],p=[],v=1,y=null,x=3,S=!1,E=!1,k=!1,T=!1,P=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,te=typeof setImmediate<"u"?setImmediate:null;function de(V){for(var A=i(p);A!==null;){if(A.callback===null)o(p);else if(A.startTime<=V)o(p),A.sortIndex=A.expirationTime,r(m,A);else break;A=i(p)}}function X(V){if(k=!1,de(V),!E)if(i(m)!==null)E=!0,se||(se=!0,q());else{var A=i(p);A!==null&&he(X,A.startTime-V)}}var se=!1,O=-1,N=5,M=-1;function Z(){return T?!0:!(e.unstable_now()-MV&&Z());){var W=y.callback;if(typeof W=="function"){y.callback=null,x=y.priorityLevel;var ge=W(y.expirationTime<=V);if(V=e.unstable_now(),typeof ge=="function"){y.callback=ge,de(V),A=!0;break t}y===i(m)&&o(m),de(V)}else o(m);y=i(m)}if(y!==null)A=!0;else{var Ce=i(p);Ce!==null&&he(X,Ce.startTime-V),A=!1}}break e}finally{y=null,x=ae,S=!1}A=void 0}}finally{A?q():se=!1}}}var q;if(typeof te=="function")q=function(){te(Q)};else if(typeof MessageChannel<"u"){var ue=new MessageChannel,me=ue.port2;ue.port1.onmessage=Q,q=function(){me.postMessage(null)}}else q=function(){P(Q,0)};function he(V,A){O=P(function(){V(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125W?(V.sortIndex=ae,r(p,V),i(m)===null&&V===i(p)&&(k?(H(O),O=-1):k=!0,he(X,ae-W))):(V.sortIndex=ge,r(m,V),E||S||(E=!0,se||(se=!0,q()))),V},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(V){var A=x;return function(){var ae=x;x=A;try{return V.apply(this,arguments)}finally{x=ae}}}})(mm)),mm}var Gb;function eN(){return Gb||(Gb=1,hm.exports=WT()),hm.exports}var pm={exports:{}},dn={};var Xb;function tN(){if(Xb)return dn;Xb=1;var e=Lp();function r(v){var y="https://react.dev/errors/"+v;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),pm.exports=tN(),pm.exports}var Wb;function nN(){if(Wb)return hl;Wb=1;var e=eN(),r=Lp(),i=dS();function o(t){var n="https://react.dev/errors/"+t;if(1Be||(t.current=Oe[Be],Oe[Be]=null,Be--)}function Te(t,n){Be++,Oe[Be]=t.current,t.current=n}var Ze=Ve(null),tt=Ve(null),Je=Ve(null),St=Ve(null);function gn(t,n){switch(Te(Je,n),Te(tt,t),Te(Ze,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?eb(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=eb(n),t=tb(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Ye(Ze),Te(Ze,t)}function An(){Ye(Ze),Ye(tt),Ye(Je)}function $n(t){var n=t.memoizedState;n!==null&&(Io._currentValue=n.memoizedState,Te(St,t)),n=Ze.current;var a=tb(n,t.type);n!==a&&(Te(tt,t),Te(Ze,a))}function yn(t){tt.current===t&&(Ye(Ze),Ye(tt)),St.current===t&&(Ye(St),Io._currentValue=fe)}var jr,Cr;function Ht(t){if(jr===void 0)try{throw Error()}catch(a){var n=a.stack.trim().match(/\n( *(at )?)/);jr=n&&n[1]||"",Cr=-1)":-1u||R[s]!==U[u]){var G=` +`+R[s].replace(" at new "," at ");return t.displayName&&G.includes("")&&(G=G.replace("",t.displayName)),G}while(1<=s&&0<=u);break}}}finally{Pn=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ht(a):""}function Lf(t,n){switch(t.tag){case 26:case 27:case 5:return Ht(t.type);case 16:return Ht("Lazy");case 13:return t.child!==n&&n!==null?Ht("Suspense Fallback"):Ht("Suspense");case 19:return Ht("SuspenseList");case 0:case 15:return bs(t.type,!1);case 11:return bs(t.type.render,!1);case 1:return bs(t.type,!0);case 31:return Ht("Activity");case 30:return Ht("ViewTransition");default:return""}}function eo(t){try{var n="",a=null;do n+=Lf(t,a),a=t,t=t.return;while(t);return n}catch(s){return` +Error generating stack: `+s.message+` +`+s.stack}}var xs=Object.prototype.hasOwnProperty,In=e.unstable_scheduleCallback,to=e.unstable_cancelCallback,nc=e.unstable_shouldYield,rc=e.unstable_requestPaint,wn=e.unstable_now,ac=e.unstable_getCurrentPriorityLevel,vi=e.unstable_ImmediatePriority,Ss=e.unstable_UserBlockingPriority,Ta=e.unstable_NormalPriority,Bf=e.unstable_LowPriority,ws=e.unstable_IdlePriority,Uf=e.log,ic=e.unstable_setDisableYieldValue,Or=null,Qt=null;function gr(t){if(typeof Uf=="function"&&ic(t),Qt&&typeof Qt.setStrictMode=="function")try{Qt.setStrictMode(Or,t)}catch{}}var En=Math.clz32?Math.clz32:D,Hf=Math.log,C=Math.LN2;function D(t){return t>>>=0,t===0?32:31-(Hf(t)/C|0)|0}var K=256,oe=262144,ce=4194304;function Ee(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Se(t,n,a){var s=t.pendingLanes;if(s===0)return 0;var u=0,d=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var w=s&134217727;return w!==0?(s=w&~d,s!==0?u=Ee(s):(b&=w,b!==0?u=Ee(b)DELIM" +R"DELIM():a||(a=w&~t,a!==0&&(u=Ee(a))))):(w=s&~d,w!==0?u=Ee(w):b!==0?u=Ee(b):a||(a=s&~t,a!==0&&(u=Ee(a)))),u===0?0:n!==0&&n!==u&&(n&d)===0&&(d=u&-u,a=n&-n,d>=a||d===32&&(a&4194048)!==0)?n:u}function Ne(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function we(t,n){(n&8)!==0&&(n|=n&32);var a=t.entangledLanes;if(a!==0)for(t=t.entanglements,a&=n;0a;a++)n.push(t);return n}function Ae(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function st(t,n,a,s,u,d){var b=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var w=t.entanglements,R=t.expirationTimes,U=t.hiddenUpdates;for(a=b&~a;0"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Yf=!1;if(aa)try{var Ts={};Object.defineProperty(Ts,"passive",{get:function(){Yf=!0}}),window.addEventListener("test",Ts,Ts),window.removeEventListener("test",Ts,Ts)}catch{Yf=!1}var Ra=null,Qf=null,uc=null;function Gg(){if(uc)return uc;var t,n=Qf,a=n.length,s,u="value"in Ra?Ra.value:Ra.textContent,d=u.length;for(t=0;t=Rs),ny=" ",ry=!1;function ay(t,n){switch(t){case"keyup":return F_.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iy(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var co=!1;function Y_(t,n){switch(t){case"compositionend":return iy(n);case"keypress":return n.which!==32?null:(ry=!0,ny);case"textInput":return t=n.data,t===ny&&ry?null:t;default:return null}}function Q_(t,n){if(co)return t==="compositionend"||!Wf&&ay(t,n)?(t=Gg(),uc=Qf=Ra=null,co=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function hy(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function my(t,n){var a=hy(t);t=0;for(var s;a;){if(a.nodeType===3){if(s=t+a.textContent.length,t<=n&&s>=n)return{node:a,offset:n-t};t=s}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=hy(a)}}function py(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?py(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function gy(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=nd(t.document);n instanceof t.HTMLIFrameElement;){try{var a=typeof n.contentWindow.location.href=="string"}catch{a=!1}if(a)t=n.contentWindow;else break;n=nd(t.document)}return n}function rd(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var n2=aa&&"documentMode"in document&&11>=document.documentMode,uo=null,ad=null,As=null,id=!1;function yy(t,n,a){var s=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;id||uo==null||uo!==nd(s)||(s=uo,"selectionStart"in s&&rd(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),As&&Os(As,s)||(As=s,s=pu(ad,"onSelect"),0>=b,u-=b,Br=1<<32-En(n)+u|a<Me?(Zt=je,je=null):Zt=je.sibling;var at=L(B,je,F[Me],ne);if(at===null){je===null&&(je=Zt);break}t&&je&&at.alternate===null&&n(B,je),z=d(at,z,Me),et===null?xe=at:et.sibling=at,et=at,je=Zt}if(Me===F.length)return a(B,je),Ke&&la(B,Me),xe;if(je===null){for(;MeMe?(Zt=je,je=null):Zt=je.sibling;var Wa=L(B,je,at.value,ne);if(Wa===null){je===null&&(je=Zt);break}t&&je&&Wa.alternate===null&&n(B,je),z=d(Wa,z,Me),et===null?xe=Wa:et.sibling=Wa,et=Wa,je=Zt}if(at.done)return a(B,je),Ke&&la(B,Me),xe;if(je===null){for(;!at.done;Me++,at=F.next())at=re(B,at.value,ne),at!==null&&(z=d(at,z,Me),et===null?xe=at:et.sibling=at,et=at);return Ke&&la(B,Me),xe}for(je=s(je);!at.done;Me++,at=F.next())at=Y(je,B,Me,at.value,ne),at!==null&&(t&&(Zt=at.alternate,Zt!==null&&je.delete(Zt.key===null?Me:Zt.key)),z=d(at,z,Me),et===null?xe=at:et.sibling=at,et=at);return t&&je.forEach(function(YT){return n(B,YT)}),Ke&&la(B,Me),xe}function Ie(B,z,F,ne){if(typeof F=="object"&&F!==null&&F.type===Q&&F.key===null&&F.props.ref===void 0&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case M:e:{for(var xe=F.key;z!==null;){if(z.key===xe){if(xe=F.type,xe===Q){if(z.tag===7){a(B,z.sibling),ne=u(z,F.props.children),Ma(ne,F),ne.return=B,B=ne;break e}}else if(z.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===ge&&Oi(xe)===z.type){a(B,z.sibling),ne=u(z,F.props),Ma(ne,F),ne.return=B,B=ne;break e}a(B,z);break}else n(B,z);z=z.sibling}F.type===Q?(ne=_i(F.props.children,B.mode,ne,F.key),Ma(ne,F),ne.return=B,B=ne):(ne=xc(F.type,F.key,F.props,null,B.mode,ne),Ma(ne,F),ne.return=B,B=ne)}return b(B);case Z:e:{for(xe=F.key;z!==null;){if(z.key===xe)if(z.tag===4&&z.stateNode.containerInfo===F.containerInfo&&z.stateNode.implementation===F.implementation){a(B,z.sibling),ne=u(z,F.children||[]),ne.return=B,B=ne;break e}else{a(B,z);break}else n(B,z);z=z.sibling}ne=dd(F,B.mode,ne),ne.return=B,B=ne}return b(B);case ge:return F=Oi(F),Ie(B,z,F,ne)}if(le(F))return ye(B,z,F,ne);if(ve(F)){if(xe=ve(F),typeof xe!="function")throw Error(o(150));return F=xe.call(F),_e(B,z,F,ne)}if(typeof F.then=="function")return Ie(B,z,Cc(F),ne);if(F.$$typeof===he)return Ie(B,z,Nc(B,F),ne);Oc(B,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,z!==null&&z.tag===6?(a(B,z.sibling),ne=u(z,F),ne.return=B,B=ne):(a(B,z),ne=fd(F,B.mode,ne),ne.return=B,B=ne),b(B)):a(B,z)}return function(B,z,F,ne){try{Us=0;var xe=Ie(B,z,F,ne);return xo=null,xe}catch(je){if(je===bo||je===Rc)throw je;var et=zn(29,je,null,B.mode);return et.lanes=ne,et.return=B,et}}}var zi=Py(!0),Iy=Py(!1),Da=!1;function wd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ed(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function La(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Ba(t,n,a){var s=t.updateQueue;if(s===null)return null;if(s=s.shared,(ut&2)!==0){var u=s.pending;return u===null?n.next=n:(n.next=u.next,u.next=n),s.pending=n,n=bc(t),Ty(t,null,a),n}return vc(t,s,n,a),bc(t)}function Hs(t,n,a){if(n=n.updateQueue,n!==null&&(n=n.shared,(a&4194048)!==0)){var s=n.lanes;s&=t.pendingLanes,a|=s,n.lanes=a,zt(t,a)}}function _d(t,n){var a=t.updateQueue,s=t.alternate;if(s!==null&&(s=s.updateQueue,a===s)){var u=null,d=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};d===null?u=d=b:d=d.next=b,a=a.next}while(a!==null);d===null?u=d=n:d=d.next=n}else u=d=n;a={baseState:s.baseState,firstBaseUpdate:u,lastBaseUpdate:d,shared:s.shared,callbacks:s.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=n:t.next=n,a.lastBaseUpdate=n}var Td=!1;function $s(){if(Td){var t=vo;if(t!==null)throw t}}function Ps(t,n,a,s){Td=!1;var u=t.updateQueue;Da=!1;var d=u.firstBaseUpdate,b=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var R=w,U=R.next;R.next=null,b===null?d=U:b.next=U,b=R;var G=t.alternate;G!==null&&(G=G.updateQueue,w=G.lastBaseUpdate,w!==b&&(w===null?G.firstBaseUpdate=U:w.next=U,G.lastBaseUpdate=R))}if(d!==null){var re=u.baseState;b=0,G=U=R=null,w=d;do{var L=w.lane&-536870913,Y=L!==w.lane;if(Y?(We&L)===L:(s&L)===L){L!==0&&L===ji&&(Td=!0),G!==null&&(G=G.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ye=t,_e=w;L=n;var Ie=a;switch(_e.tag){case 1:if(ye=_e.payload,typeof ye=="function"){re=ye.call(Ie,re,L);break e}re=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=_e.payload,L=typeof ye=="function"?ye.call(Ie,re,L):ye,L==null)break e;re=O({},re,L);break e;case 2:Da=!0}}L=w.callback,L!==null&&(t.flags|=64,Y&&(t.flags|=8192),Y=u.callbacks,Y===null?u.callbacks=[L]:Y.push(L))}else Y={lane:L,tag:w.tag,payload:w.payload,callback:w.callback,next:null},G===null?(U=G=Y,R=re):G=G.next=Y,b|=L;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;Y=w,w=Y.next,Y.next=null,u.lastBaseUpdate=Y,u.shared.pending=null}}while(!0);G===null&&(R=re),u.baseState=R,u.firstBaseUpdate=U,u.lastBaseUpdate=G,d===null&&(u.shared.lanes=0),qa|=b,t.lanes=b,t.memoizedState=re}}function Zy(t,n){if(typeof t!="function")throw Error(o(191,t));t.call(n)}function qy(t,n){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;td?d:8;var b=$.T,w={};w.types=b!==null?b.types:null,$.T=w,Fd(t,!1,n,a);try{var R=u(),U=$.S;if(U!==null&&U(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=h2(R,s);Fs(t,n,G,Kn(t))}else Fs(t,n,s,Kn(t))}catch(re){Fs(t,n,{then:function(){},status:"rejected",reason:re},Kn())}finally{ee.p=d,b!==null&&w.types!==null&&(b.types=w.types),$.T=b}}function b2(){}function Zd(t,n,a,s){if(t.tag!==5)throw Error(o(476));var u=wv(t).queue;Sv(t,u,n,fe,a===null?b2:function(){return Ev(t),a(s)})}function wv(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:fe,baseState:fe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:fe},next:null};var a={};return n.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:a},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function Ev(t){var n=wv(t);n.next===null&&(n=t.alternate.memoizedState),Fs(t,n.next.queue,{},Kn())}function qd(){return sn(Io)}function _v(){return Lt().memoizedState}function Tv(){return Lt().memoizedState}function x2(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var a=Kn();t=La(a);var s=Ba(n,t,a);s!==null&&(Bn(s,n,a),Hs(s,n,a)),n={cache:vd()},t.payload=n;return}n=n.return}}function S2(t,n,a){var s=Kn();a={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Pc(t)?kv(n,a):(a=cd(t,n,a,s),a!==null&&(Bn(a,t,s),Rv(a,n,s)))}function Nv(t,n,a){var s=Kn();Fs(t,n,a,s)}function Fs(t,n,a,s){var u={lane:s,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Pc(t))kv(n,u);else{var d=t.alternate;if(t.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var b=n.lastRenderedState,w=d(b,a);if(u.hasEagerState=!0,u.eagerState=w,qn(w,b))return vc(t,n,u,0),vt===null&&yc(),!1}catch{}if(a=cd(t,n,u,s),a!==null)return Bn(a,t,s),Rv(a,n,s),!0}return!1}function Fd(t,n,a,s){if(s={lane:2,revertLane:Dh(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Pc(t)){if(n)throw Error(o(479))}else n=cd(t,a,s,2),n!==null&&Bn(n,t,2)}function Pc(t){var n=t.alternate;return t===Pe||n!==null&&n===Pe}function kv(t,n){So=Mc=!0;var a=t.pending;a===null?n.next=n:(n.next=a.next,a.next=n),t.pending=n}function Rv(t,n,a){if((a&4194048)!==0){var s=n.lanes;s&=t.pendingLanes,a|=s,n.lanes=a,zt(t,a)}}var Ic={readContext:sn,use:Bc,useCallback:Mt,useContext:Mt,useEffect:Mt,useImperativeHandle:Mt,useLayoutEffect:Mt,useInsertionEffect:Mt,useMemo:Mt,useReducer:Mt,useRef:Mt,useState:Mt,useDebugValue:Mt,useDeferredValue:Mt,useTransition:Mt,useSyncExternalStore:Mt,useId:Mt,useHostTransitionStatus:Mt,useFormState:Mt,useActionState:Mt,useOptimistic:Mt,useMemoCache:Mt,useCacheRefresh:Mt,useEffectEvent:Mt},jv={readContext:sn,use:Bc,useCallback:function(t,n){return Tn().memoizedState=[t,n===void 0?null:n],t},useContext:sn,useEffect:dv,useImperativeHandle:function(t,n,a){a=a!=null?a.concat([t]):null,Hc(4194308,4,gv.bind(null,n,t),a)},useLayoutEffect:function(t,n){return Hc(4194308,4,t,n)},useInsertionEffect:function(t,n){Hc(4,2,t,n)},useMemo:function(t,n){var a=Tn();n=n===void 0?null:n;var s=t();if(Mi){gr(!0);try{t()}finally{gr(!1)}}return a.memoizedState=[s,n],s},useReducer:function(t,n,a){var s=Tn();if(a!==void 0){var u=a(n);if(Mi){gr(!0);try{a(n)}finally{gr(!1)}}}else u=n;return s.memoizedState=s.baseState=u,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:u},s.queue=t,t=t.dispatch=S2.bind(null,Pe,t),[s.memoizedState,t]},useRef:function(t){var n=Tn();return t={current:t},n.memoizedState=t},useState:function(t){t=Ud(t);var n=t.queue,a=Nv.bind(null,Pe,n);return n.dispatch=a,[t.memoizedState,a]},useDebugValue:Pd,useDeferredValue:function(t,n){var a=Tn();return Id(a,t,n)},useTransition:function(){var t=Ud(!1);return t=Sv.bind(null,Pe,t.queue,!0,!1),Tn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,a){var s=Pe,u=Tn();if(Ke){if(a===void 0)throw Error(o(407));a=a()}else{if(a=n(),vt===null)throw Error(o(349));(We&127)!==0||Gy(s,n,a)}u.memoizedState=a;var d={value:a,getSnapshot:n};return u.queue=d,dv(Jy.bind(null,s,d,t),[t]),s.flags|=2048,Eo(9,{destroy:void 0},Xy.bind(null,s,d,a,n),null),a},useId:function(){var t=Tn(),n=vt.identifierPrefix;if(Ke){var a=Ur,s=Br;a=(s&~(1<<32-En(s)-1)).toString(32)+a,n="_"+n+"R_"+a,a=Dc++,0<\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof s.is=="string"?b.createElement("select",{is:s.is}):b.createElement("select"),s.multiple?d.multiple=!0:s.size&&(d.size=s.size);break;default:d=typeof s.is=="string"?b.createElement(u,{is:s.is}):b.createElement(u)}}d[Et]=n,d[Rt]=s;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=d;e:switch(fn(d,u,s),u){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ma(n)}}return xt(n),n.subtreeFlags&=-33554433,ah(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,a),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==s&&ma(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(o(166));if(t=Je.current,yo(n)){if(t=n.stateNode,a=n.memoizedProps,s=null,u=Jt,u!==null)switch(u.tag){case 27:case 5:s=u.memoizedProps}t[Et]=n,t=!!(t.nodeValue===a||s!==null&&s.suppressHydrationWarning===!0||J0(t.nodeValue,a)),t||Aa(n,!0)}else t=al(t).createTextNode(s),t[Et]=n,n.stateNode=t}return xt(n),null;case 31:if(a=n.memoizedState,t===null||t.memoizedState!==null){if(s=yo(n),a!==null){if(t===null){if(!s)throw Error(o(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(o(557));t[Et]=n}else Ti(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),t=!1}else a=pd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return n.flags&256?(Fn(n),n):(Fn(n),null);if((n.flags&128)!==0)throw Error(o(558))}return xt(n),null;case 13:if(s=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(u=yo(n),s!==null&&s.dehydrated!==null){if(t===null){if(!u)throw Error(o(318));if(u=n.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Et]=n}else Ti(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;xt(n),u=!1}else u=pd(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=u),u=!0;if(!u)return n.flags&256?(Fn(n),n):(Fn(n),null)}return Fn(n),(n.flags&128)!==0?(n.lanes=a,n):(a=s!==null,t=t!==null&&t.memoizedState!==null,a&&(s=n.child,u=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(u=s.alternate.memoizedState.cachePool.pool),d=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),d!==u&&(s.flags|=2048)),a!==t&&a&&(n.child.flags|=8192),Qc(n,n.updateQueue),xt(n),null);case 4:return An(),t===null&&Hh(n.stateNode.containerInfo),n.flags|=67108864,xt(n),null;case 10:return ua(n.type),xt(n),null;case 19:if(jd(n),s=n.memoizedState,s===null)return xt(n),null;if(u=(n.flags&128)!==0,d=s.rendering,d===null)if(u)Ys(s,!1);else{if(Dt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(d=zc(t),d!==null){for(n.flags|=128,Ys(s,!1),t=d.updateQueue,n.updateQueue=t,Qc(n,t),n.subtreeFlags=0,t=a,a=n.child;a!==null;)Ny(a,t),a=a.sibling;return Is(n,cn.current&1|2),Ke&&la(n,s.treeForkCount),n.child}t=t.sibling}s.tail!==null&&wn()>ou&&(n.flags|=128,u=!0,Ys(s,!1),n.lanes=4194304)}else{if(!u)if(t=zc(d),t!==null){if(n.flags|=128,u=!0,t=t.updateQueue,n.updateQueue=t,Qc(n,t),Ys(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!d.alternate&&!Ke)return xt(n),null}else 2*wn()-s.renderingStartTime>ou&&a!==536870912&&(n.flags|=128,u=!0,Ys(s,!1),n.lanes=4194304);s.isBackwards?(d.sibling=n.child,n.child=d):(t=s.last,t!==null?t.sibling=d:n.child=d,s.last=d)}if(s.tail!==null){t=s.tail;e:{for(a=t;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return s.rendering=t,s.tail=t.sibling,s.renderingStartTime=wn(),t.sibling=null,d=cn.current,d=u?d&1|2:d&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!a||Ke?Is(n,d):(a=d,Te(ln,n),Te(cn,a),bn===null&&(bn=n)),Ke&&la(n,s.treeForkCount),t}return xt(n),null;case 22:case 23:return Fn(n),kd(),s=n.memoizedState!==null,t!==null?t.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(a&536870912)!==0&&(n.flags&128)===0&&(xt(n),n.subtreeFlags&6&&(n.flags|=8192)):xt(n),a=n.updateQueue,a!==null&&Qc(n,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==a&&(n.flags|=2048),t!==null&&Ye(Ci),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),ua($t),xt(n),null;case 25:return null;case 30:return n.flags|=33554432,xt(n),null}throw Error(o(156,n.tag))}function R2(t,n){switch(hd(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return ua($t),An(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return yn(n),null;case 31:if(n.memoizedState!==null){if(Fn(n),n.alternate===null)throw Error(o(340));Ti()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Fn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(o(340));Ti()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return jd(n),t=n.flags,t&65536?(n.flags=t&-65537|128,t=n.memoizedState,t!==null&&(t.rendering=null,t.tail=null),n.flags|=4,n):null;case 4:return An(),null;case 10:return ua(n.type),null;case 22:case 23:return Fn(n),kd(),t!==null&&Ye(Ci),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return ua($t),null;case 25:return null;default:return null}}function e0(t,n){switch(hd(n),n.tag){case 3:ua($t),An();break;case 26:case 27:case 5:yn(n);break;case 4:An();break;case 31:n.memoizedState!==null&&Fn(n);break;case 13:Fn(n);break;case 19:jd(n);break;case 10:ua(n.type);break;case 22:case 23:Fn(n),kd(),t!==null&&Ye(Ci);break;case 24:ua($t)}}function Qs(t,n){try{var a=n.updateQueue,s=a!==null?a.lastEffect:null;if(s!==null){var u=s.next;a=u;do{if((a.tag&t)===t){s=void 0;var d=a.create,b=a.inst;s=d(),b.destroy=s}a=a.next}while(a!==u)}}catch(w){pt(n,n.return,w)}}function Pa(t,n,a){try{var s=n.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var d=u.next;s=d;do{if((s.tag&t)===t){var b=s.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,u=n;var R=a,U=w;try{U()}catch(G){pt(u,R,G)}}}s=s.next}while(s!==d)}}catch(G){pt(n,n.return,G)}}function t0(t){var n=t.updateQueue;if(n!==null){var a=t.stateNode;try{qy(n,a)}catch(s){pt(t,t.return,s)}}}function n0(t,n,a){a.props=Di(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(s){pt(t,n,s)}}function Hr(t,n){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var s=t.stateNode;break;case 30:var u=t.stateNode,d=ia(t.memoizedProps,u);(u.ref===null||u.ref.name!==d)&&(u.ref=cb(d)),s=u.ref;break;case 7:if(t.stateNode===null){var b=new Gn(t);y(t.child,!1,vT,b,void 0,void 0),t.stateNode=b}s=t.stateNode;break;default:s=t.stateNode}typeof a=="function"?t.refCleanup=a(s):a.current=s}}catch(w){pt(t,n,w)}}function un(t,n){var a=t.ref,s=t.refCleanup;if(a!==null)if(typeof s=="function")try{s()}catch(u){pt(t,n,u)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(nul)DELIM" +R"DELIM(l)}catch(u){pt(t,n,u)}else a.current=null}function Kc(t,n){if((t.tag===5||t.tag===27||t.tag===6)&&t.alternate===null&&n!==null)for(var a=0;a title"))),fn(s,n,a),s[Et]=t,He(s),n=s;break e;case"link":if(d=Nb("link","href",u).get(n+(a.href||""))){for(b=0;bIe&&(b=Ie,Ie=_e,_e=b);var B=my(w,_e),z=my(w,Ie);if(B&&z&&(Y.rangeCount!==1||Y.anchorNode!==B.node||Y.anchorOffset!==B.offset||Y.focusNode!==z.node||Y.focusOffset!==z.offset)){var F=re.createRange();F.setStart(B.node,B.offset),Y.removeAllRanges(),_e>Ie?(Y.addRange(F),Y.extend(z.node,z.offset)):(F.setEnd(z.node,z.offset),Y.addRange(F))}}}}for(re=[],Y=w;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;wa?32:a,$.T=null,a=Th,Th=null;var d=Sr,b=Fr;if(jt=0,Hi=Sr=null,Fr=0,(ut&6)!==0)throw Error(o(331));var w=ut;if(ut|=4,T0(d.current),w0(d,d.current,b,a),ut=w,tl(0,!1),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(Or,d)}catch{}return!0}finally{ee.p=u,$.T=s,$0(t,n)}}function P0(t,n,a){n=rr(a,n),n=Qd(t.stateNode,n,2),t=Ba(t,n,2),t!==null&&(Ae(t,2),Vr(t))}function pt(t,n,a){if(t.tag===3)P0(t,t,a);else for(;n!==null;){if(n.tag===3){P0(n,t,a);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Fa===null||!Fa.has(s))){t=rr(a,t),a=Bv(2),s=Ba(n,a,2),s!==null&&(Uv(a,s,n,t),Ae(s,2),Vr(s));break}}n=n.return}}function Ah(t,n,a){var s=t.pingCache;if(s===null){s=t.pingCache=new A2;var u=new Set;s.set(n,u)}else u=s.get(n),u===void 0&&(u=new Set,s.set(n,u));u.has(a)||(wh=!0,u.add(a),t=$2.bind(null,t,n,a),n.then(t,t))}function $2(t,n,a){var s=t.pingCache;s!==null&&s.delete(n),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,vt===t&&(We&a)===a&&((Dt===4||Dt===3&&(We&62914560)===We&&300>wn()-iu)&&(ut&2)===0?Mo(t,0):au|=a,jo===We&&(jo=0)),Vr(t)}function I0(t,n){n===0&&(n=Re()),t=Ei(t,n),t!==null&&(Ae(t,n),Vr(t))}function P2(t){var n=t.memoizedState,a=0;n!==null&&(a=n.retryLane),I0(t,a)}function I2(t,n){var a=0;switch(t.tag){case 31:case 13:var s=t.stateNode,u=t.memoizedState;u!==null&&(a=u.retryLane);break;case 19:s=t.stateNode;break;case 22:s=t.stateNode._retryCache;break;default:throw Error(o(314))}s!==null&&s.delete(n),I0(t,a)}function Z2(t,n){return In(t,n)}var Lo=null,Bo=null,zh=!1,hu=!1,Mh=!1,Ya=0;function Vr(t){t!==Bo&&t.next===null&&(Bo===null?Lo=Bo=t:Bo=Bo.next=t),hu=!0,zh||(zh=!0,F2())}function tl(t,n){if(!Mh&&hu){Mh=!0;do for(var a=!1,s=Lo;s!==null;){if(t!==0){var u=s.pendingLanes;if(u===0)var d=0;else{var b=s.suspendedLanes,w=s.pingedLanes;d=(1<<31-En(42|t)+1)-1,d&=u&~(b&~w),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(a=!0,V0(s,d))}else d=We,d=Se(s,s===vt?d:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(d&3)===0||Ne(s,d)||(a=!0,V0(s,d));s=s.next}while(a);Mh=!1}}function q2(){Z0()}function Z0(){hu=zh=!1;var t=0;Ya!==0&&nT()&&(t=Ya);for(var n=wn(),a=null,s=Lo;s!==null;){var u=s.next,d=q0(s,n);d===0?(s.next=null,a===null?Lo=u:a.next=u,u===null&&(Bo=a)):(a=s,(t!==0||(d&3)!==0)&&(hu=!0)),s=u}jt!==0&&jt!==5||tl(t),Ya!==0&&(Ya=0)}function q0(t,n){for(var a=t.suspendedLanes,s=t.pingedLanes,u=t.expirationTimes,d=t.pendingLanes&-62914561;0w)break;var G=R.transferSize,re=R.initiatorType;G&&W0(re)&&(R=R.responseEnd,b+=G*(Rvu){_e.length=ye;break}F=new Promise(lT.bind(F)),_e.push(F)}}}if(0<_e.length)return L=Promise.race([Promise.all(_e),new Promise(function(xe){return setTimeout(xe,500)})]).then(u,u),(Y?Promise.allSettled([Y.finished,L]):L).then(d,d);if(u(),Y)return Y.finished.then(d,d);d()},types:a});U.__reactViewTransition=G;var re=[];return G.ready.then(function(){for(var L=U.documentElement.getAnimations({subtree:!0}),Y=0;Y"u"?null:document;function wb(t,n,a){var s=Ho;if(s&&typeof n=="string"&&n){var u=tr(n);u='link[rel="'+t+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Sb.has(u)||(Sb.add(u),t={rel:t,crossOrigin:a,href:n},s.querySelector(u)===null&&(n=s.createElement("link"),fn(n,"link",t),He(n),s.head.appendChild(n)))}}function kT(t){ga.D(t),wb("dns-prefetch",t,null)}function RT(t,n){ga.C(t,n),wb("preconnect",t,n)}function jT(t,n,a){ga.L(t,n,a);var s=Ho;if(s&&t&&n){var u='link[rel="preload"][as="'+tr(n)+'"]';n==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+tr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+tr(a.imageSizes)+'"]')))DELIM" +R"DELIM(:u+='[href="'+tr(t)+'"]';var d=u;switch(n){case"style":d=$o(t);break;case"script":d=Po(t)}if(!(cr.has(d)||(t=O({rel:"preload",href:n==="image"&&a&&a.imageSrcSet?void 0:t,as:n},a),cr.set(d,t),s.querySelector(u)!==null||n==="style"&&s.querySelector(ol(d))||n==="script"&&s.querySelector(sl(d))))){var b=s.createElement("link");fn(b,"link",t),n==="style"&&(b[Qe]=!0,b.onload=b.onerror=function(){Dr(b)}),He(b),s.head.appendChild(b)}}}function CT(t,n){ga.m(t,n);var a=Ho;if(a&&t){var s=n&&typeof n.as=="string"?n.as:"script",u='link[rel="modulepreload"][as="'+tr(s)+'"][href="'+tr(t)+'"]',d=u;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Po(t)}if(!cr.has(d)&&(t=O({rel:"modulepreload",href:t},n),cr.set(d,t),a.querySelector(u)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(sl(d)))return}s=a.createElement("link"),fn(s,"link",t),He(s),a.head.appendChild(s)}}}function OT(t,n,a){ga.S(t,n,a);var s=Ho;if(s&&t){var u=Mr(s).hoistableStyles,d=$o(t);n=n||"default";var b=u.get(d);if(!b){var w={loading:0,preload:null};if(b=s.querySelector(ol(d)))w.loading=5;else{t=O({rel:"stylesheet",href:t,"data-precedence":n},a),(a=cr.get(d))&&tm(t,a);var R=b=s.createElement("link");He(R),fn(R,"link",t),R._p=new Promise(function(U,G){R.onload=U,R.onerror=G}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,gu(b,n,s)}b={type:"stylesheet",instance:b,count:1,state:w},u.set(d,b)}}}function AT(t,n){ga.X(t,n);var a=Ho;if(a&&t){var s=Mr(a).hoistableScripts,u=Po(t),d=s.get(u);d||(d=a.querySelector(sl(u)),d||(t=O({src:t,async:!0},n),(n=cr.get(u))&&nm(t,n),d=a.createElement("script"),He(d),fn(d,"link",t),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(u,d))}}function zT(t,n){ga.M(t,n);var a=Ho;if(a&&t){var s=Mr(a).hoistableScripts,u=Po(t),d=s.get(u);d||(d=a.querySelector(sl(u)),d||(t=O({src:t,async:!0,type:"module"},n),(n=cr.get(u))&&nm(t,n),d=a.createElement("script"),He(d),fn(d,"link",t),a.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},s.set(u,d))}}function Eb(t,n,a,s){var u=(u=Je.current)?il(u):null;if(!u)throw Error(o(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=$o(a.href),n=Mr(u).hoistableStyles,s=n.get(a),s||(s={type:"style",instance:null,count:0,state:null},n.set(a,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=$o(a.href);var d=Mr(u).hoistableStyles,b=d.get(t);if(b||(u=u.ownerDocument||u,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(t,b),(d=u.querySelector(ol(t)))?d._p||(b.instance=d,b.state.loading=5):(d=cr.get(t),d||(d={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},cr.set(t,d)),MT(u,t,d,b.state))),n&&s===null)throw Error(o(528,""));return b}if(n&&s!==null)throw Error(o(529,""));return null;case"script":return n=a.async,a=a.src,typeof a=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(a=Po(a),n=Mr(u).hoistableScripts,s=n.get(a),s||(s={type:"script",instance:null,count:0,state:null},n.set(a,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,t))}}function $o(t){return'href="'+tr(t)+'"'}function ol(t){return'link[rel="stylesheet"]['+t+"]"}function _b(t){return O({},t,{"data-precedence":t.precedence,precedence:null})}function MT(t,n,a,s){if(n=t.querySelector('link[rel="preload"][as="style"]['+n+"]")){if(n[Qe]!==!0){s.loading=1;return}}else n=t.createElement("link"),n[Qe]=!0,n.onload=n.onerror=Dr.bind(null,n),fn(n,"link",a),He(n),t.head.appendChild(n);s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2})}function Po(t){return'[src="'+tr(t)+'"]'}function sl(t){return"script[async]"+t}function Tb(t,n,a){if(n.count++,n.instance===null)switch(n.type){case"style":var s=t.querySelector('style[data-href~="'+tr(a.href)+'"]');if(s)return n.instance=s,He(s),s;var u=O({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return s=(t.ownerDocument||t).createElement("style"),He(s),fn(s,"style",u),gu(s,a.precedence,t),n.instance=s;case"stylesheet":u=$o(a.href);var d=t.querySelector(ol(u));if(d)return n.state.loading|=4,n.instance=d,He(d),d;s=_b(a),(u=cr.get(u))&&tm(s,u),d=(t.ownerDocument||t).createElement("link"),He(d);var b=d;return b._p=new Promise(function(w,R){b.onload=w,b.onerror=R}),fn(d,"link",s),n.state.loading|=4,gu(d,a.precedence,t),n.instance=d;case"script":return d=Po(a.src),(u=t.querySelector(sl(d)))?(n.instance=u,He(u),u):(s=a,(u=cr.get(d))&&(s=O({},a),nm(s,u)),t=t.ownerDocument||t,u=t.createElement("script"),He(u),fn(u,"link",s),t.head.appendChild(u),n.instance=u);case"void":return null;default:throw Error(o(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,gu(s,a.precedence,t));return n.instance}function gu(t,n,a){for(var s=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=s.length?s[s.length-1]:null,d=u,b=0;b title"):null)}function DT(t,n,a){if(a===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function kb(t,n){return t==="img"&&n.src!=null&&n.src!==""&&n.onLoad==null&&n.loading!=="lazy"}function Rb(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function jb(t){return(t.width||100)*(t.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Cb(t,n){typeof n.decode=="function"&&(t.imgCount++,n.complete||(t.imgBytes+=jb(n),t.suspenseyImages.push(n)),t=UT.bind(t),n.decode().then(t,t))}function LT(t,n,a,s){if(a.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=$o(s.href),d=n.querySelector(ol(u));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=ll.bind(t),n.then(t,t)),a.state.loading|=4,a.instance=d,He(d);return}d=n.ownerDocument||n,s=_b(s),(u=cr.get(u))&&tm(s,u),d=d.createElement("link"),He(d);var b=d;b._p=new Promise(function(w,R){b.onload=w,b.onerror=R}),fn(d,"link",s),a.instance=d}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,n)DELIM" +R"DELIM(),(n=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=ll.bind(t),n.addEventListener("load",a),n.addEventListener("error",a))}}var vu=0;function BT(t,n){return t.stylesheets&&t.count===0&&xu(t,t.stylesheets),0vu?50:800)+n);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(s),clearTimeout(u)}}:null}function Ob(t){if(t.count===0&&(t.imgCount===0||!t.waitingForImages)){if(t.stylesheets)xu(t,t.stylesheets);else if(t.unsuspend){var n=t.unsuspend;t.unsuspend=null,n()}}}function ll(){this.count--,Ob(this)}function UT(){this.imgCount--,Ob(this)}var bu=null;function xu(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,bu=new Map,n.forEach(HT,t),bu=null,ll.call(t))}function HT(t,n){if(!(n.state.loading&4)){var a=bu.get(t);if(a)var s=a.get(null);else{a=new Map,bu.set(t,a);for(var u=t.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),dm.exports=nN(),dm.exports}var aN=rN();const iN=Dp(aN),hS=_.createContext(void 0),mS=e=>{const r=_.useContext(hS);if(!r)throw new Error("No QueryClient set, use QueryClientProvider to set one");return r},oN=({client:e,children:r})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(hS.Provider,{value:e,children:r})),sN={setTimeout:(e,r)=>setTimeout(e,r),clearTimeout:e=>clearTimeout(e),setInterval:(e,r)=>setInterval(e,r),clearInterval:e=>clearInterval(e)};var lN=class{#e=sN;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,r){return this.#e.setTimeout(e,r)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,r){return this.#e.setInterval(e,r)}clearInterval(e){this.#e.clearInterval(e)}};const Fi=new lN;function cN(e){setTimeout(e,0)}const uN=typeof window>"u"||"Deno"in globalThis;function Un(){}function fN(e,r){return typeof e=="function"?e(r):e}function pS(e){return typeof e=="number"&&e>=0&&e!==1/0}function gS(e,r){return Math.max(e+(r||0)-Date.now(),0)}function Tt(e,r){return typeof e=="function"?e(r):e}function tx(e,r){const{type:i="all",exact:o,fetchStatus:l,predicate:c,queryKey:f,stale:h}=e;if(f){if(o){if(r.queryHash!==Bp(f,r.options))return!1}else if(!is(r.queryKey,f))return!1}if(i!=="all"){const m=r.isActive();if(i==="active"&&!m||i==="inactive"&&m)return!1}return!(typeof h=="boolean"&&r.isStale()!==h||l&&l!==r.state.fetchStatus||c&&!c(r))}function nx(e,r){const{exact:i,status:o,predicate:l,mutationKey:c}=e;if(c){if(!r.options.mutationKey)return!1;if(i){if(Bl(r.options.mutationKey)!==Bl(c))return!1}else if(!is(r.options.mutationKey,c))return!1}return!(o&&r.state.status!==o||l&&!l(r))}function Bp(e,r){return(r?.queryKeyHashFn||Bl)(e)}function Bl(e){return JSON.stringify(e,(r,i)=>ep(i)?Object.keys(i).sort().reduce((o,l)=>(o[l]=i[l],o),{}):i)}function is(e,r){if(e===r)return!0;if(typeof e!=typeof r)return!1;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(Array.isArray(e)&&Array.isArray(r)){if(r.length>e.length)return!1;for(let o=0;o500)return r;const o=rx(e)&&rx(r);if(!o&&!(ep(e)&&ep(r)))return r;const l=(o?e:Object.keys(e)).length,c=o?r:Object.keys(r),f=c.length,h=o?new Array(f):{};let m=0;for(let p=0;p{Fi.setTimeout(r,e)})}function tp(e,r,i){return typeof i.structuralSharing=="function"?i.structuralSharing(e,r):i.structuralSharing!==!1?vS(e,r):r}function hN(e,r,i=0){const o=[...e,r];return i&&o.length>i?o.slice(-i):o}function mN(e,r,i=0){const o=[r,...e];return i&&o.length>i?o.slice(0,i):o}const Up=Symbol();function bS(e,r){return!e.queryFn&&r?.initialPromise?()=>r.initialPromise:!e.queryFn||e.queryFn===Up?()=>Promise.reject(new )DELIM" +R"DELIM(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function xS(e,r){return typeof e=="function"?e(...r):!!e}const Hp=Symbol();function pN(e,r,i,o){let l=!1,c;return Object.defineProperties(e,{[Hp]:{value:o},signal:{enumerable:!0,get:()=>(c??=r(),l||(l=!0,c.aborted?i():c.addEventListener("abort",i,{once:!0})),c)}}),e}let gN=()=>uN;const $p=()=>gN();var Fl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yN=class extends Fl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}};const Pp=new yN,vN=cN;function bN(){let e=[],r=0,i=h=>{h()},o=h=>{h()},l=vN;const c=h=>{r?e.push(h):l(()=>{i(h)})},f=()=>{const h=e;e=[],h.length&&l(()=>{o(()=>{h.forEach(m=>{i(m)})})})};return{batch:h=>{let m;r++;try{m=h()}finally{r--,r||f()}return m},batchCalls:h=>(...m)=>{c(()=>{h(...m)})},schedule:c,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{o=h},setScheduler:h=>{l=h}}}const pn=bN();var xN=class extends Fl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const r=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#e}};const af=new xN;function SN(e){return Math.min(1e3*2**e,3e4)}function SS(e){return(e??"online")==="online"?af.isOnline():!0}var np=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function wS(e){let r=!1,i=0,o,l="pending",c,f;const h=new Promise((H,te)=>{c=H,f=te});h.catch(Un);const m=()=>l!=="pending",p=H=>{if(!m()){const te=new np(H);k(te),e.onCancel?.(te)}},v=()=>{r=!0},y=()=>{r=!1},x=()=>Pp.isFocused()&&(e.networkMode==="always"||af.isOnline())&&e.canRun(),S=()=>SS(e.networkMode)&&e.canRun(),E=H=>{m()||(o?.(),l="resolved",c(H))},k=H=>{m()||(o?.(),l="rejected",f(H))},T=H=>new Promise(te=>{o=de=>{(m()||H())&&te(de)},e.onPause?.()}).then(()=>{o=void 0,m()||e.onContinue?.()}),P=()=>{if(m())return;let H;const te=i===0?e.initialPromise:void 0;try{H=te??e.fn()}catch(de){H=Promise.reject(de)}Promise.resolve(H).then(E).catch(de=>{if(m())return;const X=e.retry??($p()?0:3),se=e.retryDelay??SN,O=typeof se=="function"?se(i,de):se,N=X===!0||typeof X=="number"&&im()||x()?void 0:T(x)).then(()=>{r?k(de):P()})})};return{promise:h,status:()=>l,cancel:p,continue:()=>(o?.(),h),cancelRetry:v,continueRetry:y,canStart:S,start:()=>(S()?P():T(S).then(P),h)}}var ES=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pS(this.gcTime)&&(this.#e=Fi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($p()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Fi.clearTimeout(this.#e),this.#e=void 0)}};function wN(e){return{onFetch:(r,i)=>{const o=r.options,l=r.fetchOptions?.meta?.fetchMore?.direction,c=r.state.data?.pages||[],f=r.state.data?.pageParams||[];let h={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=r,x=k=>{pN(k,()=>r.signal,()=>v=!0,y[Hp])},S=bS(r.options,r.fetchOptions),E=async(k,T,P)=>{if(v)return Promise.reject(r.signal.reason);if(T==null&&k.pages.length)return Promise.resolve(k);const te=(()=>{const O={client:r.client,queryKey:r.queryKey,pageParam:T,direction:P?"backward":"forward",meta:r.options.meta};return x(O),O})(),de=await S(te),{maxPages:X}=r.options,se=P?mN:hN;return{pages:se(k.pages,de,X),pageParams:se(k.pageParams,T,X)}};if(l&&c.length){const k=l==="backward",T=k?EN:ix,P={pages:c,pageParams:f};h=await E(P,T(o,P),k)}else{const k=e??c.length;do{const T=m===0?f[0]===void 0?o.initialPageParam:f[0]:ix(o,h);if(m>0&&T==null)break;h=await E(h,T),m++}while(mr.options.persister?.(p,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},i):r.fetchFn=p}}}function ix(e,{pages:r,pageParams:i}){const o=r.length-1;return r.length>0?e.getNextPageParam(r[o],r,i[o],i):void 0}function EN(e,{pages:r,pageParams:i}){return r.length>0?e.getPreviousPageParam?.(r[0],r,i[0],i):void 0}var _N=class extends ES{#e;#t;#n;#r;#i;#a;#o;#l;#c;constructor(e){super(),this.#c=!1,this.#l=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=sx(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#l,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=sx(this.options);r.data!==void 0&&(this.setState(ox(r.data,r.dataUpdatedAt)),this.#t=r)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#r.remove(this)}setData(e,r){const i=tp(this.state.data,e,this.options);return this.#s({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e){this.#s({type:"setState",state:e})}cancel(e){const r=this.#a?.promise;return this.#a?.cancel(e),r?r.then(Un).catch(Un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Tt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Up||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.state.data===void 0?!1:this.getObserversCount()>0?this.observers.some(e=>Tt(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!gS(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){const r=this.observers.indexOf(e);r!==-1&&(this.observers.splice(r,1),this.observers.length||(this.#a&&(this.#c||this.state.fetchStatus==="paused"&&this.state.status==="pending"?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,r){if(this.state.fetchStat)DELIM" +R"DELIM(us!=="idle"&&this.#a?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#a&&this.#o)return this.#a.continueRetry(),this.#o}if(e&&this.setOptions(e),!this.options.queryFn){const p=this.observers.find(v=>v.options.queryFn);p&&this.setOptions(p.options)}const i=new AbortController,o=p=>{Object.defineProperties(p,{[Hp]:{value:i.signal,enumerable:!0},signal:{enumerable:!0,get:()=>(this.#c=!0,i.signal)}})},l=()=>{const p=bS(this.options,r),y=(()=>{const x={client:this.#i,queryKey:this.queryKey,meta:this.meta};return o(x),x})();return this.#c=!1,this.options.persister?this.options.persister(p,y,this):p(y)},f=(()=>{const p={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:l};return o(p),p})();(this.#e==="infinite"?wN(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#s({type:"fetch",meta:f.fetchOptions?.meta});const h=this.#a=wS({initialPromise:r?.initialPromise,fn:f.fetchFn,onCancel:p=>{p instanceof np&&p.revert&&this.setState({...this.#n,fetchStatus:"idle"}),i.abort()},onFail:(p,v)=>{this.#s({type:"failed",failureCount:p,error:v})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}),m=(async()=>{try{const p=await h.promise;if(p===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(p),this.#r.config.onSuccess?.(p,this),this.#r.config.onSettled?.(p,this.state.error,this),p}catch(p){if(p instanceof np){if(p.silent){if(this.#a!==h&&this.#o)return this.#o;throw p}else if(p.revert){if(this.state.data===void 0)throw p;return this.state.data}}throw this.#s({type:"error",error:p}),this.#r.config.onError?.(p,this),this.#r.config.onSettled?.(this.state.data,p,this),p}finally{this.#a===h&&(this.#a=void 0,this.#o=void 0),this.scheduleGc()}})();return this.#o=m,h.start(),m}#s(e){const r=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,..._S(i.data,this.options),fetchMeta:e.meta??null};case"success":const o={...i,...ox(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?o:void 0,o;case"error":const l=e.error;return{...i,error:l,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=r(this.state),pn.batch(()=>{this.observers.slice().forEach(i=>{i.onQueryUpdate()}),this.#r.notify({query:this,type:"updated",action:e})})}};function _S(e,r){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SS(r.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ox(e,r){return{data:e,dataUpdatedAt:r??Date.now(),error:null,isInvalidated:!1,status:"success"}}function sx(e){const r=typeof e.initialData=="function"?e.initialData():e.initialData,i=r!==void 0,o=i?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:r,dataUpdateCount:0,dataUpdatedAt:i?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var TN=class extends Fl{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#l;#c;#s;#f;#d;#u;#m=new Set;constructor(e,r){super(),this.options=r,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),lx(this.#t,this.options)?this.#h():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return rp(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return rp(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const r=this.options,i=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tt(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#w(),this.#t.setOptions(this.options),r._defaulted&&!gm(this.options,r)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const o=this.hasListeners();o&&cx(this.#t,i,this.options,r)&&this.#h(),this.updateResult(),o&&(this.#t!==i||Tt(this.options.enabled,this.#t)!==Tt(r.enabled,this.#t)||Tt(this.options.staleTime,this.#t)!==Tt(r.staleTime,this.#t))&&this.#g();const l=this.#y();o&&(this.#t!==i||Tt(this.options.enabled,this.#t)!==Tt(r.enabled,this.#t)||l!==this.#u)&&this.#v(l)}getOptimisticResult(e){const r=this.#e.getQueryCache().build(this.#e,e),i=this.createResult(r,e);return gm(this.getCurrentResult(),i)||(this.#r=i,this.#a=this.options,this.#i=this.#t.state),i}getCurrentResult(){return this.#r}trackResult(e,r){return new Proxy(e,{get:(i,o)=>(this.trackProp(o),r?.(o),Reflect.get(i,o))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=this.#e.defaultQueryOptions(e),i=this.#e.getQueryCache().build(this.#e,r);let o=()=>{},l;const c=new Promise(f=>{l=f,o=this.#e.getQueryCache().subscribe(h=>{h.type==="updated"&&h.query.queryHash===i.queryHash&&i.state.data!==void 0&&(o(),f(this.createResult(i,r)))})});return Promise.race([i.fetch(r).then(()=>{const f=this.createResult(i,r);return l?.(f),f}).finally(()=>{o()}),c])}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#w();let r=this.#t.fetch(this.options,e);return e?.throwOnError||(r=r.catch(Un)),r}#p(e){return!$p()&&Tt(this.options.enabled,this.#t)!==!1&&pS(e)}#g(){this.#x();const e=Tt(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#p(e))return;const r=gS(this.#r.dataUpdatedAt,e)+1;this.#f=Fi.setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#y(){return Tt(this.options.refetchInterval,this.#t)??!1}#v(e){this.#S(),this.#u=e,!(this.#u===0||!this.#p(this.#u))&&(this.#d=Fi.setInterval(()=>{(this.options.refetchIntervalInBackground||Pp.isFocused())&&this.#h()},this.#u))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#f!==void 0&&(Fi.clearTimeout(this.#f),this.#f=void 0)}#S(){this.#d!==void 0&&(Fi.clearInterval(this.#d),this.#d=void 0)}createResult(e,r){const i=this.#t,o=this.options,l=this.#r,c=this.#i,f=this.#a,h=e!==i?e.state:this.#n,{state:m}=e;let p={...m},v=!1,y;if(r._optimisticResults){const X=this.hasListeners(),se=!X&&lx(e,r),O=X&&cx(e,i,r,o);(se||O)&&(p={...p,..._S(m.data,e.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:E}=p;y=p.data;let k=!1;if(r.placeholderData!==void 0&&y===void 0&&E==="pending"){let X;l?.isPlaceholderData&&r.placeholderData===f?.placeholderData?(X=l.data,k=!0):X=typeof r.placeholderData=="function"?r.placeholderData(this.#s?.state.data,this.#s):r.placeholderData,X!==void 0&&(E="success",y=tp(l?.data,X,r),v=!0)}if(r.select&&y!==void 0&&!k)if(l&&y===c?.data&&r.select===this.#l)y=this.#c;else try{this.#l=r.select,y=r.select(y),y=tp(l?.data,y,r),this.#c=y,this.#o=null}catch(X){this.#o=X}else y===void 0&&(this.#o=null);this.#o&&(x=this.#o,y=this.#c,S=l?.error===x?l.errorUpdatedAt:Date.now(),E="error",v=!1);const T=p.fetchStatus==="fetchin)DELIM" +R"DELIM(g",P=E==="pending",H=E==="error",te=P&&T,de=y!==void 0;return{status:E,fetchStatus:p.fetchStatus,isPending:P,isSuccess:E==="success",isError:H,isInitialLoading:te,isLoading:te,data:y,dataUpdatedAt:p.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:T,isRefetching:T&&!P,isLoadingError:H&&!de,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:H&&de,isStale:Ip(e,r),refetch:this.refetch,isEnabled:Tt(r.enabled,e)!==!1}}updateResult(){const e=this.#r,r=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#s=this.#t),gm(r,e))return;this.#r=r;const o=(()=>{if(!e)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!this.#m.size||this.options.throwOnError&&this.#r.error!==e.error)return!0;for(const f of c??this.#m)if(this.#r[f]!==e[f])return!0;return!1})();pn.batch(()=>{o&&this.listeners.forEach(l=>{l(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}#w(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const r=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}};function NN(e,r){return Tt(r.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Tt(r.retryOnMount,e)===!1)}function lx(e,r){return NN(e,r)||e.state.data!==void 0&&rp(e,r,r.refetchOnMount)}function rp(e,r,i){if(Tt(r.enabled,e)!==!1&&Tt(r.staleTime,e)!=="static"){const o=Tt(i,e);return o==="always"||o!==!1&&Ip(e,r)}return!1}function cx(e,r,i,o){return(e!==r||Tt(o.enabled,e)===!1)&&(!i.suspense||e.state.status!=="error")&&Ip(e,i)}function Ip(e,r){return Tt(r.enabled,e)!==!1&&e.isStaleByTime(Tt(r.staleTime,e))}var kN=class extends ES{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||RN(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(r=>r!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(e){const r=()=>{this.#i({type:"continue"})},i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},o=this.#r=wS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(f,h)=>{this.#i({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#i({type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),l=this.state.status==="pending",c=!o.canStart();try{if(l)r();else{this.#i({type:"pending",variables:e,isPaused:c}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,i);const h=await this.options.onMutate?.(e,i);h!==this.state.context&&this.#i({type:"pending",context:h,variables:e,isPaused:c})}this.state.isPaused&&o.canStart()&&r();const f=await o.start();return await this.#n.config.onSuccess?.(f,e,this.state.context,this,i),await this.options.onSuccess?.(f,e,this.state.context,i),await this.#n.config.onSettled?.(f,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(f,null,e,this.state.context,i),this.#i({type:"success",data:f}),f}catch(f){try{await this.#n.config.onError?.(f,e,this.state.context,this,i)}catch(h){Promise.reject(h)}try{await this.options.onError?.(f,e,this.state.context,i)}catch(h){Promise.reject(h)}try{await this.#n.config.onSettled?.(void 0,f,this.state.variables,this.state.context,this,i)}catch(h){Promise.reject(h)}try{await this.options.onSettled?.(void 0,f,e,this.state.context,i)}catch(h){Promise.reject(h)}throw this.#i({type:"error",error:f}),f}finally{this.#r===o&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){const r=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),pn.batch(()=>{this.#t.forEach(i=>{i.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function RN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jN=class extends Fl{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,r,i){const o=new kN({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(r),state:i});return this.add(o),o}add(e){this.#e.add(e);const r=ku(e);if(typeof r=="string"){const i=this.#t.get(r);i?i.push(e):this.#t.set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const r=ku(e);if(typeof r=="string"){const i=this.#t.get(r);if(i)if(i.length>1){const o=i.indexOf(e);o!==-1&&i.splice(o,1)}else i[0]===e&&this.#t.delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=ku(e);if(typeof r=="string"){const i=this.#t.get(r)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const r=ku(e);return typeof r=="string"?this.#t.get(r)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){pn.batch(()=>{const e=this.getAll();this.#e.clear(),this.#t.clear(),e.forEach(r=>{this.notify({type:"removed",mutation:r})})})}getAll(){return Array.from(this.#e)}find(e){const r={exact:!0,...e};return this.getAll().find(i=>nx(r,i))}findAll(e={}){return this.getAll().filter(r=>nx(e,r))}notify(e){pn.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return pn.batch(()=>Promise.all(e.map(r=>r.continue().catch(Un))))}};function ku(e){return e.options.scope?.id}var CN=class extends Fl{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,r,i){const o=r.queryKey,l=r.queryHash??Bp(o,r);let c=this.get(l);return c||(c=new _N({client:e,queryKey:o,queryHash:l,options:e.defaultQueryOptions(r),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(c)),c}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){pn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const r={exact:!0,...e};return this.getAll().find(i=>tx(r,i))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(i=>tx(e,i)):r}notify(e){pn.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){pn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ON=class{#e;#t;#n;#r;#i;#a;#o;#l;constructor(e={}){this.#e=e.q)DELIM" +R"DELIM(ueryCache||new CN,this.#t=e.mutationCache||new jN,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Pp.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=af.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state.data}ensureQueryData(e){const r=this.defaultQueryOptions(e),i=this.#e.build(this,r),o=i.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(Tt(r.staleTime,i))&&this.prefetchQuery(r),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:r,state:i})=>[r,i.data])}setQueryData(e,r,i){const o=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(o.queryHash)?.state.data,c=fN(r,l);if(c!==void 0)return this.#e.build(this,o).setData(c,{...i,manual:!0})}setQueriesData(e,r,i){return pn.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,r,i)]))}getQueryState(e){const r=this.defaultQueryOptions({queryKey:e});return this.#e.get(r.queryHash)?.state}removeQueries(e){const r=this.#e;pn.batch(()=>{r.findAll(e).forEach(i=>{r.remove(i)})})}resetQueries(e,r){const i=this.#e;return pn.batch(()=>{const o=i.findAll(e),l=new Set(o);return o.forEach(c=>{c.reset()}),this.refetchQueries({type:"active",predicate:c=>l.has(c)},r)})}cancelQueries(e,r={}){const i={revert:!0,...r},o=pn.batch(()=>this.#e.findAll(e).map(l=>l.cancel(i)));return Promise.all(o).then(Un).catch(Un)}invalidateQueries(e,r={}){return pn.batch(()=>(this.#e.findAll(e).forEach(i=>{i.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},r)))}refetchQueries(e,r={}){const i={...r,cancelRefetch:r.cancelRefetch??!0},o=pn.batch(()=>this.#e.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,i);const f=l.state.fetchStatus==="paused";return(!i.throwOnError||f)&&(c=c.catch(Un)),f?Promise.resolve():c}));return Promise.all(o).then(Un)}async query(e){const r=this.defaultQueryOptions(e);r.retry===void 0&&(r.retry=!1);const i=this.#e.build(this,r),o=i.isStaleByTime(Tt(r.staleTime,i))?await i.fetch(r):i.state.data,l=r.select;return l?l(o):o}fetchQuery(e){const r=this.defaultQueryOptions(e);r.retry===void 0&&(r.retry=!1);const i=this.#e.build(this,r);return i.isStaleByTime(Tt(r.staleTime,i))?i.fetch(r):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Un).catch(Un)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Un).catch(Un)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return af.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,r){this.#r.set(Bl(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){const r=[...this.#r.values()],i={};return r.forEach(o=>{is(e,o.queryKey)&&Object.assign(i,o.defaultOptions)}),i}setMutationDefaults(e,r){this.#i.set(Bl(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){const r=[...this.#i.values()],i={};return r.forEach(o=>{is(e,o.mutationKey)&&Object.assign(i,o.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;const r={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=Bp(r.queryKey,r)),r.refetchOnReconnect===void 0&&(r.refetchOnReconnect=r.networkMode!=="always"),r.throwOnError===void 0&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===Up&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const TS=_.createContext(!1),AN=()=>_.useContext(TS);TS.Provider;function zN(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const MN=_.createContext(zN()),DN=()=>_.useContext(MN),LN=(e,r,i)=>{const o=i?.state.status==="error"&&typeof e.throwOnError=="function"?xS(e.throwOnError,[i.state.error,i]):e.throwOnError;(e.suspense||o)&&(r.isReset()||(e.retryOnMount=!1))},BN=e=>{_.useEffect(()=>{e.clearReset()},[e])},UN=({result:e,errorResetBoundary:r,throwOnError:i,query:o,suspense:l})=>e.isError&&!r.isReset()&&!e.isFetching&&o&&(l&&e.data===void 0||xS(i,[e.error,o])),HN=e=>{if(e.suspense){const i=l=>l==="static"?l:Math.max(l??1e3,1e3),o=e.staleTime;e.staleTime=typeof o=="function"?(...l)=>i(o(...l)):i(o),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},$N=(e,r)=>e?.suspense&&r.isPending,PN=(e,r,i)=>r.fetchOptimistic(e).catch(()=>{i.clearReset()});function IN(e,r,i){const o=AN(),l=DN(),c=mS(),f=c.defaultQueryOptions(e),h=c.getQueryCache().get(f.queryHash),m=e.subscribed!==!1;f._optimisticResults=o?"isRestoring":m?"optimistic":void 0,HN(f),LN(f,l,h),BN(l);const[p]=_.useState(()=>new r(c,f)),v=p.getOptimisticResult(f);_.useEffect(()=>{p.setOptions(f)},[f,p]);const y=!o&&m;if(_.useSyncExternalStore(_.useCallback(x=>{const S=y?p.subscribe(pn.batchCalls(x)):Un;return p.updateResult(),S},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),$N(f,v))throw PN(f,p,l);if(UN({result:v,errorResetBoundary:l,throwOnError:f.throwOnError,query:h,suspense:f.suspense}))throw v.error;return f.notifyOnChangeProps?v:p.trackResult(v)}function ZN(e,r){return IN(e,TN)}function ap(e){const r=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,l])=>r.indexOf(+o)===-1).map(([o,l])=>l)}function ux(e,r="|"){return e.map(i=>CS(i)).join(r)}function ip(e,r){return typeof r=="bigint"?r.toString():r}class qN{constructor(r){this._getter=r,this._value=void 0}get value(){const r=this._getter;return r!==void 0&&(this._value=r(),this._getter=void 0),this._value}}function Ef(e){return new qN(e)}function FN(e){return e==null}function Zp(e){const r=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(r,i)}function VN(e,r){const i=e/r,o=Math.round(i),l=4*Number.EPSILON*Math.max(Math.abs(i),1);return Math.abs(i-o){const h=r._zod.def.shape[c];return o?o(h,c):h}):kS(e,c,o?o(f.value,c):f.value))}}function YN(e,r){for(const i of Reflect.ownKeys(r)){const o=Object.getOwnPropertyDescriptor(r,i);o.enumerable&&(o.get?NS(e,i,()=>r[i]):kS(e,i,o.value))}}function Jn(...e){const r={};for(const i of e){const o=Object.getOwnPropertyDescriptors(i);Object.assign(r,o)}return Object.defineProperties({},r)}function QN(e){return JSON.stringify(e)}function KN(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const RS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ul(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const GN=Ef(()=>{if(kr.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""))DELIM" +R"DELIM(,!0}catch{return!1}});function os(e){if(Ul(e)===!1)return!1;const r=e.constructor;if(r===void 0||typeof r!="function")return!0;const i=r.prototype;return!(Ul(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function jS(e){return os(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const XN=new Set(["string","number","symbol"]);function ss(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gi(e,r,i){const o=new e._zod.constr(r??e._zod.def);return(!r||i?.parent)&&(o._zod.parent=e),o}function ke(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if(r?.message!==void 0){if(r?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function CS(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function JN(e){return Object.keys(e).filter(r=>e[r]._zod.optin!==void 0&&e[r]._zod.optout==="optional")}const OS={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]},WN={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e4(e,r){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const c={};return Ki(c,e,_f(e,r)),gi(e,Jn(i,{shape:c,checks:[]}))}function _f(e,r){const i=Sa(e),o=[];for(const l of Reflect.ownKeys(r)){if(!Object.getOwnPropertyDescriptor(i,l)?.enumerable)throw new Error(`Unrecognized key: "${String(l)}"`);r[l]&&o.push(l)}return o}function t4(e,r){const i=e._zod.def,o=i.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const c=new Set(_f(e,r)),f={};return Ki(f,e,Reflect.ownKeys(Sa(e)).filter(h=>!c.has(h))),gi(e,Jn(i,{shape:f,checks:[]}))}function n4(e,r){if(!os(r))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const l=Sa(e);for(const c of Reflect.ownKeys(r))if(Object.getOwnPropertyDescriptor(l,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return gi(e,Jn(e._zod.def,{shape:AS(e,r)}))}function AS(e,r){const i={};return Ki(i,e,Reflect.ownKeys(Sa(e))),YN(i,r),i}function r4(e,r){if(!os(r))throw new Error("Invalid input to safeExtend: expected a plain object");return gi(e,Jn(e._zod.def,{shape:AS(e,r)}))}function a4(e,r){if(!r?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const i={};Ki(i,e,Reflect.ownKeys(Sa(e))),Ki(i,r,Reflect.ownKeys(Sa(r)));const o=Jn(e._zod.def,{shape:i,get catchall(){return r._zod.def.catchall},checks:r._zod.def.checks??[]});return gi(e,o)}function fx(e,r,i,o="partial"){const c=r._zod.def.checks;if(c&&c.length>0)throw new Error(`.${o}() cannot be used on object schemas containing refinements`);const h=i?new Set(_f(r,i)):void 0,m={};return Ki(m,r,Reflect.ownKeys(Sa(r)),e&&((p,v)=>h&&!h.has(v)?p:new e({type:"optional",innerType:p}))),gi(r,Jn(r._zod.def,{shape:m,checks:[]}))}function i4(e,r,i){const o=i?new Set(_f(r,i)):void 0,l={};return Ki(l,r,Reflect.ownKeys(Sa(r)),(c,f)=>o&&!o.has(f)?c:new e({type:"nonoptional",innerType:c})),gi(r,Jn(r._zod.def,{shape:l}))}function ba(e,r=0){if(e.aborted===!0)return!0;for(let i=r;i{var o;return(o=i).path??(o.path=[]),i.path.unshift(e),i})}function ml(e){return typeof e=="string"?e:e?.message}function dx(e){const r=[];for(const i of e??[]){const o=i._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;const l=o.maximum??o.length??o.size;l>=0&&r.push([l,i])}return r}function op(e,r,i){var o;for(let l=r;le;return r[m4]=!0,r}var hx;const vm={value:void 0,enumerable:!1};let mx="captureStackTrace"in Error?Error:null;function g4(e){const r=mx;if(r){const i=r.stackTraceLimit;if(typeof i=="number"){try{r.stackTraceLimit=0}catch{return mx=null,new e}try{return new e}finally{r.stackTraceLimit=i}}}return new e}function ie(e,r,i,o){const l={};function c(x){this.def=x,this.constr=y,this.traits=new Set}c.prototype=l;const f=i,h=f&&new WeakSet;function m(x,S){if(x._zod){if(x._zod.traits.has(e))return}else{vm.value=new c(S);try{Object.defineProperty(x,"_zod",vm)}finally{vm.value=void 0}}if(x._zod.traits.add(e),r(x,S),h){const k=Object.getPrototypeOf(x),T=x._zod.constr.prototype;let P=k;for(;P&&P!==T;)P=Object.getPrototypeOf(P);const H=P??k;h.has(H)||(h.add(H),c4(H,f))}const E=y.prototype;for(const k in E)Object.prototype.hasOwnPropert)DELIM" +R"DELIM(y.call(E,k)&&(k in x||(x[k]=E[k].bind(x)))}const p=o?.Parent??Object;class v extends p{}Object.defineProperty(v,"name",{value:e});function y(x){const S=o?.Parent?g4(v):this;m(S,x);const E=S._zod.deferred;if(E){for(const T of E)T();S._zod.deferred=void 0}const k=globalThis.__zod_globalConfig?.postProcessor;return k&&k(S),S}return Object.defineProperty(y,"init",{value:m}),Object.defineProperty(y,Symbol.hasInstance,{value:x=>o?.Parent&&x instanceof o.Parent?!0:x?._zod?.traits?.has(e)}),Object.defineProperty(y,"name",{value:e}),y}class Qi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class DS extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}(hx=globalThis).__zod_globalConfig??(hx.__zod_globalConfig={});const kr=globalThis.__zod_globalConfig;function Wr(e){return e&&Object.assign(kr,e),kr}function y4(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ip,2)),e.message}function v4(e){this._zod.message=e}const b4={get:y4,set:v4,enumerable:!0,configurable:!0},bm={value:void 0,enumerable:!1},px=new WeakSet([Object.prototype,Error.prototype]),x4=(e,r)=>{e.name="$ZodError",bm.value=r,Object.defineProperty(e,"issues",bm),bm.value=void 0,Object.defineProperty(e,"message",b4);const i=Object.getPrototypeOf(e);px.has(i)||(px.add(i),Object.defineProperty(i,"toString",{configurable:!0,enumerable:!1,get(){const o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}}))},S4=ie("$ZodError",x4);function w4(e,r,i){return Object.prototype.hasOwnProperty.call(e,r)||(r==="__proto__"?Object.defineProperty(e,r,{value:i(),writable:!0,enumerable:!0,configurable:!0}):e[r]=i()),e[r]}function E4(e,r=i=>i.message){const i={},o=[];for(const l of e.issues)l.path.length>0?w4(i,l.path[0],()=>[]).push(r(l)):o.push(r(l));return{formErrors:o,fieldErrors:i}}function _4(e,r=i=>i.message){const i={_errors:[]},o=(l,c=[])=>{for(const f of l.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(h=>o({issues:h},[...c,...f.path]));else if(f.code==="invalid_key")o({issues:f.issues},[...c,...f.path]);else if(f.code==="invalid_element")o({issues:f.issues},[...c,...f.path]);else{const h=[...c,...f.path];if(h.length===0)i._errors.push(r(f));else{let m=i,p=0;for(;p{const r=(i,o,l,c)=>{const f=l?{...l,async:!1}:{async:!1},h=i._zod.run({value:o,issues:[]},f);if(h instanceof Promise)throw new Qi;if(h.issues.length){const m=new(c?.Err??e)(h.issues.map(p=>hi(p,f,Wr())));throw RS(m,c?.callee??r),m}return h.value};return r},Qp=e=>{const r=async(i,o,l,c)=>{const f=l?{...l,async:!0}:{async:!0};let h=i._zod.run({value:o,issues:[]},f);if(h instanceof Promise&&(h=await h),h.issues.length){const m=new(c?.Err??e)(h.issues.map(p=>hi(p,f,Wr())));throw RS(m,c?.callee??r),m}return h.value};return r},Kp=e=>(r,i,o)=>{const l=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:i,issues:[]},l);if(c instanceof Promise)throw new Qi;return c.issues.length?LS(e,c.issues,l):{success:!0,data:c.value}};function LS(e,r,i){let o;return{success:!1,get error(){return o||(o=new e(r.map(l=>hi(l,i,Wr()))),r=void 0,i=void 0),o},set error(l){o=l,r=void 0,i=void 0}}}const Gp=e=>async(r,i,o)=>{const l=o?{...o,async:!0}:{async:!0};let c=r._zod.run({value:i,issues:[]},l);return c instanceof Promise&&(c=await c),c.issues.length?LS(e,c.issues,l):{success:!0,data:c.value}},T4=Symbol.for("zod.compile.invalid"),N4=Symbol.for("zod.compile.fallback"),k4=((e,r,i)=>{const o=e._zod.bag.validator;if(o!==void 0){if(o(r)!==T4)return!0;if(o.definite===!0&&i===void 0)return!1}return R4(e,r,i)});function R4(e,r,i){const o=i?{...i,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},l=e._zod.bag.fallbackRun;let c;if(l?(o[N4]=!0,c=l({value:r,issues:[]},o)):c=e._zod.run({value:r,issues:[]},o),c instanceof Promise)throw new Qi;return c.issues.length===0}const j4=async(e,r,i)=>{const o=i?{...i,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let l=e._zod.run({value:r,issues:[]},o);return l instanceof Promise&&(l=await l),l.issues.length===0},C4=e=>{const r=Yp(e),i=(o,l,c,f)=>{const h=c?{...c,direction:"backward"}:{direction:"backward"};return r(o,l,h,Tf(i,f))};return i},O4=e=>{const r=Yp(e),i=(o,l,c,f)=>r(o,l,c,Tf(i,f));return i},A4=e=>{const r=Qp(e),i=async(o,l,c,f)=>{const h=c?{...c,direction:"backward"}:{direction:"backward"};return await r(o,l,h,Tf(i,f))};return i},z4=e=>{const r=Qp(e),i=async(o,l,c,f)=>await r(o,l,c,Tf(i,f));return i},M4=e=>(r,i,o)=>{const l=o?{...o,direction:"backward"}:{direction:"backward"};return Kp(e)(r,i,l)},D4=e=>(r,i,o)=>Kp(e)(r,i,o),L4=e=>async(r,i,o)=>{const l=o?{...o,direction:"backward"}:{direction:"backward"};return Gp(e)(r,i,l)},B4=e=>async(r,i,o)=>Gp(e)(r,i,o),U4=/^[cC][0-9a-z]{6,}$/,H4=/^[0-9a-z]+$/,$4=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,P4=/^[0-9a-vA-V]{20}$/,I4=/^[A-Za-z0-9]{27}$/,Z4=/^[a-zA-Z0-9_-]{21}$/;function q4(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const F4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,V4=/^([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})$/,gx=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${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)$/,Y4=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Q4="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function K4(){return new RegExp(Q4,"u")}const G4=/^(?:(?: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])$/,X4=/^(([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}|:))$/,J4=/^((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])$/,W4=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ek=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tk=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,nk=/^https?$/,rk=/^\+[1-9]\d{6,14}$/,BS="(?:(?:\\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])))";function ak(e){return new RegExp(`^${e}$`)}const ik=ak(BS);function sp(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${r}:[0-5]\\d(?:\\.\\d+)?`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ok(e){return new RegExp(`^)DELIM" +R"DELIM(${sp(e)}$`)}function sk(e){const r=["Z"];e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${sp({precision:e.precision,seconds:!0})}(?:${r.join("|")})`,o=e.local?`${i}|${sp({precision:e.precision})}`:i;return new RegExp(`^${BS}T(?:${o})$`)}const lk=/^[\s\S]{0,}$/,ck=/^-?\d+$/,Xp=/^-?\d+(?:\.\d+)?$/,uk=/^(?:true|false)$/i,fk=/^[^A-Z]*$/,dk=/^[^a-z]*$/,Hn=ie("$ZodCheck",(e,r)=>{var i;e._zod??(e._zod={}),e._zod.def=r,(i=e._zod).onattach??(i.onattach=[])}),Jp=e=>{const r=e.value;return!FN(r)&&r.length!==void 0},of={number:"number",bigint:"bigint",object:"date"},US=ie("$ZodCheckLessThan",(e,r)=>{Hn.init(e,r);const i=of[typeof r.value];e._zod.check=o=>{(r.inclusive?o.value<=r.value:o.value{Hn.init(e,r);const i=of[typeof r.value];e._zod.check=o=>{(r.inclusive?o.value>=r.value:o.value>r.value)||o.issues.push({origin:of[typeof o.value]??i,code:"too_small",minimum:typeof r.value=="object"?r.value.getTime():r.value,input:o.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),hk=ie("$ZodCheckMultipleOf",(e,r)=>{Hn.init(e,r),e._zod.check=i=>{if(typeof i.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?r.value!==BigInt(0)&&i.value%r.value===BigInt(0):VN(i.value,r.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:r.value,input:i.value,inst:e,continue:!r.abort})}}),mk=ie("$ZodCheckNumberFormat",(e,r)=>{Hn.init(e,r),r.format=r.format||"float64";const i=r.format?.includes("int"),o=i?"int":"number",[l,c]=OS[r.format];e._zod.check=f=>{const h=f.value;if(i){if(!Number.isInteger(h)){f.issues.push({expected:o,format:r.format,code:"invalid_type",continue:!1,input:h,inst:e});return}if(!Number.isSafeInteger(h)){h>0?f.issues.push({input:h,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort}):f.issues.push({input:h,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!r.abort});return}}hc&&f.issues.push({origin:"number",input:h,code:"too_big",maximum:c,inclusive:!0,inst:e,continue:!r.abort})}}),pk=ie("$ZodCheckMaxLength",(e,r)=>{var i;Hn.init(e,r),(i=e._zod.def).when??(i.when=Jp),e._zod.check=o=>{const l=o.value,c=l.length;if((typeof l=="string"&&c>r.maximum?Fp(l):c)<=r.maximum)return;const h=Vp(l);o.issues.push({origin:h,code:"too_big",maximum:r.maximum,inclusive:!0,input:l,inst:e,continue:!r.abort})}}),gk=ie("$ZodCheckMinLength",(e,r)=>{var i;Hn.init(e,r),(i=e._zod.def).when??(i.when=Jp),e._zod.check=o=>{const l=o.value,c=l.length;if((typeof l=="string"&&c>=r.minimum&&c=r.minimum)return;const h=Vp(l);o.issues.push({origin:h,code:"too_small",minimum:r.minimum,inclusive:!0,input:l,inst:e,continue:!r.abort})}}),yk=ie("$ZodCheckLengthEquals",(e,r)=>{var i;Hn.init(e,r),(i=e._zod.def).when??(i.when=Jp),e._zod.check=o=>{const l=o.value,c=l.length,f=typeof l=="string"&&c>=r.length&&c<=r.length*2?Fp(l):c;if(f===r.length)return;const h=Vp(l),m=f>r.length;o.issues.push({origin:h,...m?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!r.abort})}}),Nf=ie("$ZodCheckStringFormat",(e,r)=>{var i,o;Hn.init(e,r),r.pattern?(i=e._zod).check??(i.check=l=>{r.pattern.lastIndex=0,!r.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:r.format,input:l.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(o=e._zod).check??(o.check=()=>{})}),vk=ie("$ZodCheckRegex",(e,r)=>{Nf.init(e,r),e._zod.check=i=>{r.pattern.lastIndex=0,!r.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),bk=ie("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=fk),Nf.init(e,r)}),xk=ie("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=dk),Nf.init(e,r)}),Sk=ie("$ZodCheckIncludes",(e,r)=>{Hn.init(e,r);const i=ss(r.includes),o=new RegExp(typeof r.position=="number"?`^.{${r.position},}${i}`:i);r.pattern=o,e._zod.check=l=>{l.value.includes(r.includes,r.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:l.value,inst:e,continue:!r.abort})}}),wk=ie("$ZodCheckStartsWith",(e,r)=>{Hn.init(e,r);const i=new RegExp(`^${ss(r.prefix)}.*`);r.pattern??(r.pattern=i),e._zod.check=o=>{o.value.startsWith(r.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:o.value,inst:e,continue:!r.abort})}}),Ek=ie("$ZodCheckEndsWith",(e,r)=>{Hn.init(e,r);const i=new RegExp(`.*${ss(r.suffix)}$`);r.pattern??(r.pattern=i),e._zod.check=o=>{o.value.endsWith(r.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:o.value,inst:e,continue:!r.abort})}}),_k=ie("$ZodCheckOverwrite",(e,r)=>{Hn.init(e,r),e._zod.check=i=>{i.value=r.tx(i.value)}});class Tk{constructor(r=[],i={}){this.content=[],this.indent=0,this.args=r,this.closed=i}indented(r){this.indent+=1;try{r(this)}finally{this.indent-=1}}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const o=r.split(` +`).filter(f=>f),l=Math.min(...o.map(f=>f.length-f.trimStart().length)),c=o.map(f=>f.slice(l)).map(f=>" ".repeat(this.indent*2)+f);for(const f of c)this.content.push(f)}compile(){const r=Function,i=this?.content??[""];return new r(...Object.keys(this.closed),`return function (${this.args.join(", ")}) { +${i.join(` +`)} +};`)(...Object.values(this.closed))}}const Nk={major:4,minor:6,patch:7},Ct=ie("$ZodType",(e,r)=>{var i;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=Nk;const o=e._zod.def.checks,l=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(const c of l)for(const f of c._zod.onattach)f(e);if(l.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const c=(h,m,p)=>{if(h.memo)return h;let v=ba(h),y;for(const x of m){if(x._zod.def.when){if(o4(h)||!x._zod.def.when(h))continue}else if(v)continue;const S=h.issues.length,E=x._zod.check(h);if(E instanceof Promise&&p?.async===!1)throw new Qi;if(y||E instanceof Promise)y=(y??Promise.resolve()).then(async()=>{await E,h.issues.length!==S&&(op(h.issues,S,e),v||(v=ba(h,S)))});else{if(h.issues.length===S)continue;op(h.issues,S,e),v||(v=ba(h,S))}}return y?y.then(()=>h):h},f=(h,m,p)=>{if(ba(h))return h.aborted=!0,h;const v=c(m,l,p);if(v instanceof Promise){if(p.async===!1)throw new Qi;return v.then(y=>e._zod.parse(y,p))}return e._zod.parse(v,p)};e._zod.run=(h,m)=>{if(m.skipChecks)return e._zod.parse(h,m);if(m.direction==="backward"){const v=e._zod.parse({value:h.value,issues:[]},{...m,skipChecks:!0});return v instanceof Promise?v.then(y=>f(y,h,m)):f(v,h,m)}const p=e._zod.parse(h,m);if(p instanceof Promise){if(m.async===!1)throw new Qi;return p.then(v=>c(v,l,m))}return c(p,l,m)}}},{get"~standard"(){return zS(this,"~standard",PS(this))},set"~standard"(e){mi(this,"~standard",e)}}),$S=(e,r)=>e.issues.length?{issues:e.issues.map(i=>hi(i,r,Wr()))}:{value:e.value};async function kk(e,r){const i={async:!0};return $S(await e._zod.run({value:r,issues:[]},i),i)}function PS(e){return{validate:r=>{const i={async:!1};try{const o=e._zod.run({value:r,issues:[]},i);if(!(o instanceof Promise))return $S(o,i)}catch{}return kk(e,r)},vendor:"zod",version:1}}const Wp=ie("$ZodString",(e,r)=>{Ct.init(e,r),e._zod.pattern=r.pattern??lk,e._zod.parse=(i,o)=>{if(r.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="stri)DELIM" +R"DELIM(ng"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),kt=ie("$ZodStringFormat",(e,r)=>{Nf.init(e,r),Wp.init(e,r)}),Rk=ie("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=V4),kt.init(e,r)}),jk=ie("$ZodUUID",(e,r)=>{if(r.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(o===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=gx(o))}else r.pattern??(r.pattern=gx());kt.init(e,r)}),Ck=ie("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=Y4),kt.init(e,r)}),IS=1,sf=2;function ZS(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Ok(e,r){return!("normalize"in r)&&!("hostname"in r)&&!("protocol"in r)?ZS(e)||sf:Ak(e,r)}function Ak(e,r){if(!r.normalize&&r.protocol?.source===nk.source&&!/^https?:\/\//i.test(e))return IS;try{if(typeof URL<"u"){const i=URL;if(typeof i.parse=="function")return i.parse(e)??sf}return new URL(e)}catch{return sf}}const zk=/[\t\n\r]/g;function yx(e){return e.replace(zk,"")}function Mk(e,r){return r.lastIndex=0,r.test(e.hostname)}function Dk(e,r){return r.lastIndex=0,r.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}const Lk=ie("$ZodURL",(e,r)=>{kt.init(e,r),e._zod.check=i=>{try{const o=i.value.trim(),l=Ok(o,r);if(l===IS){i.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:i.value,inst:e,continue:!r.abort});return}if(l===sf){i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!r.abort});return}if(l===!0){i.value=yx(o);return}r.hostname&&!Mk(l,r.hostname)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:i.value,inst:e,continue:!r.abort}),r.protocol&&!Dk(l,r.protocol)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:i.value,inst:e,continue:!r.abort}),i.value=r.normalize?l.href:yx(o);return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!r.abort})}}}),Bk=ie("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=K4()),kt.init(e,r)}),Uk=ie("$ZodNanoID",(e,r)=>{if(r.length!==void 0&&(!Number.isInteger(r.length)||r.length<1))throw new Error(`Invalid nanoid length: ${r.length}`);r.pattern??(r.pattern=r.length===void 0?Z4:q4(r.length)),kt.init(e,r)}),Hk=ie("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=U4),kt.init(e,r)}),$k=ie("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=H4),kt.init(e,r)}),Pk=ie("$ZodULID",(e,r)=>{r.pattern??(r.pattern=$4),kt.init(e,r)}),Ik=ie("$ZodXID",(e,r)=>{r.pattern??(r.pattern=P4),kt.init(e,r)}),Zk=ie("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=I4),kt.init(e,r)}),qk=ie("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=sk(r)),kt.init(e,r)}),Fk=ie("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=ik),kt.init(e,r)}),Vk=ie("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=ok(r)),kt.init(e,r)}),Yk=ie("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=F4),kt.init(e,r)}),Qk=ie("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=G4),kt.init(e,r)}),Kk=/^[0-9a-fA-F:.]+$/;function qS(e){return Kk.test(e)?ZS(`http://[${e}]`):!1}const Gk=ie("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=X4),kt.init(e,r),e._zod.check=i=>{qS(i.value)||i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!r.abort})}}),Xk=ie("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=J4),kt.init(e,r)});function Jk(e){const r=e.split("/");if(r.length!==2)return!1;const[i,o]=r;if(!o)return!1;const l=Number(o);return`${l}`!==o||l<0||l>128?!1:qS(i)}const Wk=ie("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=W4),kt.init(e,r),e._zod.check=i=>{Jk(i.value)||i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!r.abort})}});function FS(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const VS=/^[0-9a-zA-Z+/]*={0,2}$/,eR=ie("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=VS),kt.init(e,r),e._zod.check=i=>{FS(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!r.abort})}}),eg=/^[A-Za-z0-9_-]*$/;function tR(e){if(!eg.test(e))return!1;const r=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),i=r.padEnd(Math.ceil(r.length/4)*4,"=");return FS(i)}const nR=ie("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=eg),kt.init(e,r),e._zod.check=i=>{tR(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!r.abort})}}),rR=ie("$ZodE164",(e,r)=>{r.pattern??(r.pattern=rk),kt.init(e,r)});function aR(e,r=null){try{const i=e.split(".");if(i.length!==3)return!1;const[o]=i;if(!o)return!1;const l=JSON.parse(atob(o));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||r&&(!("alg"in l)||l.alg!==r))}catch{return!1}}const iR=ie("$ZodJWT",(e,r)=>{kt.init(e,r),e._zod.check=i=>{aR(i.value,r.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!r.abort})}}),YS=ie("$ZodNumber",(e,r)=>{Ct.init(e,r),e._zod.pattern=Xp,e._zod.parse=(i,o)=>{if(r.coerce)try{i.value=Number(i.value)}catch{}const l=i.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return i;const c=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:String(l):void 0;return i.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...c?{received:c}:{}}),i}}),oR=ie("$ZodNumberFormat",(e,r)=>{mk.init(e,r),YS.init(e,r)}),sR=ie("$ZodBoolean",(e,r)=>{Ct.init(e,r),e._zod.pattern=uk,e._zod.parse=(i,o)=>{if(r.coerce)try{i.value=!!i.value}catch{}const l=i.value;return typeof l=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),i}}),lR=ie("$ZodUnknown",(e,r)=>{Ct.init(e,r),e._zod.parse=i=>i}),cR=ie("$ZodNever",(e,r)=>{Ct.init(e,r),e._zod.parse=(i,o)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function uR(e,r){const i=dx(e._zod.def.checks);if(!i.length)return;const o=Math.min(...i.map(c=>c[0])),l=e._zod.parse;e._zod.parse=(c,f)=>{const h=r(c.value);if(h>o&&!f?.skipChecks&&f?.direction!=="backward"){for(const[m,p]of dx(e._zod.def.checks))if(h>m&&p._zod.def.when(c)){const v=c.issues.length;return p._zod.check(c),c.issues[v].continue=!1,op(c.issues,v,e),c}}return l(c,f)}}const fR=e=>Array.isArray(e)?e.length:-1;function vx(e,r,i){e.issues.length&&r.issues.push(...Xo(i,e.issues)),r.value[i]=e.value}const dR=ie("$ZodArray",(e,r)=>{Ct.init(e,r);const i=kr.memoizer;i?.attach(e),e._zod.parse=(o,l)=>{const c=o.value;if(!Array.isArray(c))return o.issues.push({expected:"array",code:"invalid_type",input:c,inst:e}),o;o.value=i?i.alloc(e,o,Array(c.length),l):Array(c.length);const f=[],h=l?.abortEarly;for(let m=0;mvx(y,o,m)));else if(vx(v,o,m),h&&v.issues.length!==0&&ba(v))break}return f.length?Promise.all(f).then(()=>o):o},uR(e,fR)});function lf(e,r,i,o,l,c){const f=i in o,h=c==="optional";if(!(!f&&h&&l==="optional")){if(e.issues.length){if(l!==void 0&&h&&!f)return;r.issues.push(...Xo(i,e.issues))}if(!f&&l===void 0){e.issues.length||r.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[i]});return}e.value===void 0?(f||l==="defaulted"&&!h)&&(r.value[i]=void 0):r.value[i]=e.value}}const hR=[];function QS(e){const r=Object.keys(e.shape),i=Object.getOwnPropertySymbols(e.shape),o=i.length?i:hR,l=o.length?[...r,...o]:r;for(const f of l)if(!e.shape?.[f]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(f)}": expected a Zod schema`);const c=JN(e.shape);return{...e,allKeys:l,symbolKeys:o,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(c)}}function KS(e,r,i,o,l,c,f){const h=[],m=l.keySet,p=l.catchall._zod,v=p.def.type,y=p.optin,x=p.optout;let S=0;for(const E in r){if(f&&i.issues.length!==S){if(ba(i,S))break;S=i.issues.length}if(m.has(E))continue;if(E==="__proto__"){v==="never"&&h.push(E);continue}if(v==="never"){h.push(E);continue}const k=p.run({value:r[E],issues:[]},o);k instanceof Promise?e.push(k.then(T=>lf(T,i,E,)DELIM" +R"DELIM(r,y,x))):lf(k,i,E,r,y,x)}return h.length&&i.issues.push({code:"unrecognized_keys",keys:h,input:r,inst:c,continue:!0}),e.length?Promise.all(e).then(()=>i):i}const mR=ie("$ZodObject",(e,r)=>{Ct.init(e,r);const i=Object.getOwnPropertyDescriptor(r,"shape"),o=i?.get?i.get.raw:r.shape??{};if(o){const p=()=>{const v={...o};return Object.defineProperty(r,"shape",{value:v}),p.raw=v,v};p.raw=o,Object.defineProperty(r,"shape",{get:p})}const l=Ef(()=>QS(r));ft(e,"propValues",p=>{const v=p.def.shape,y={};for(const x in v){const S=v[x]._zod;if(S.values){Object.prototype.hasOwnProperty.call(y,x)||wa(y,x,new Set);for(const E of S.values)y[x].add(E);S.optin!==void 0&&y[x].add(void 0)}}return y});const c=Ul,f=r.catchall;let h;const m=kr.memoizer;m?.attach(e),e._zod.parse=(p,v)=>{h??(h=l.value);const y=p.value;if(!c(y))return p.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),p;p.value=m?m.alloc(e,p,{},v):{};const x=[],S=h.shape,E=v?.abortEarly;let k=p.issues.length;for(const T of h.allKeys){if(E&&p.issues.length!==k){if(ba(p,k))break;k=p.issues.length}if(T==="__proto__")continue;const P=S[T],H=P._zod.optin,te=P._zod.optout,de=P._zod.run({value:y[T],issues:[]},v);de instanceof Promise?x.push(de.then(X=>lf(X,p,T,y,H,te))):lf(de,p,T,y,H,te)}return f?KS(x,y,p,v,l.value,e,E===!0):x.length?Promise.all(x).then(()=>p):p}}),pR=ie("$ZodObjectJIT",(e,r)=>{mR.init(e,r);const i=e._zod.parse,o=Ef(()=>QS(r)),l=kr.memoizer,c=S=>{const E=o.value,k=E.symbolKeys,T=new Tk(["payload","ctx"],{shape:S,inst:e,memo:l,syms:k}),P=X=>`shape[${X}]._zod.run({ value: input[${X}], issues: [] }, ctx)`,H=(X,se)=>` + let ${X}_ab = false; + for (let i = 0; i < ${X}.issues.length; i++) { + const iss = ${X}.issues[i]; + iss.path = iss.path ? [${se}, ...iss.path] : [${se}]; + payload.issues.push(iss); + if (iss.continue !== true) ${X}_ab = true; } - } - - if (${oe}.value === undefined) { - if (${J} in input) { - newResult[${J}] = undefined; + if (${X}_ab && ctx && ctx.abortEarly) { + payload.value = newResult; + return payload; + }`;T.write("const input = payload.value;");const te=Object.create(null);let de=0;for(const X of E.allKeys)te[X]=`key_${de++}`;T.write(l?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const X of E.allKeys){if(X==="__proto__")continue;const se=te[X],O=typeof X=="symbol"?`syms[${k.indexOf(X)}]`:QN(X),N=`${O} in input`,M=S[X],Z=M?._zod?.optin,Q=Z!==void 0,q=M?._zod?.optout==="optional";if(T.write(`const ${se} = ${P(O)};`),Q&&q){const ue=Z==="optional"?`${se}_present`:`${se}.value !== undefined || ${se}_present`;T.write(` + const ${se}_present = ${N}; + if (!${se}.issues.length || ${se}_present) { + if (${se}.issues.length) {${H(se,O)} + } + + if (${ue}) { + newResult[${O}] = ${se}.value; } - } else { - newResult[${J}] = ${oe}.value; } - - `):O?S.write(` - if (${oe}.issues.length) { - payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${J}, ...iss.path] : [${J}] - }))); + + `)}else Q?(T.write(` + if (${se}.issues.length) {${H(se,O)} } - - if (${oe}.value === undefined) { - if (${J} in input) { - newResult[${J}] = undefined; - } - } else { - newResult[${J}] = ${oe}.value; + `),Z==="defaulted"?T.write(`newResult[${O}] = ${se}.value;`):T.write(` + if (${se}.value !== undefined || ${N}) { + newResult[${O}] = ${se}.value; } - - `):S.write(` - const ${oe}_present = ${J} in input; - if (${oe}.issues.length) { - payload.issues = payload.issues.concat(${oe}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${J}, ...iss.path] : [${J}] - }))); + `)):T.write(` + const ${se}_present = ${N}; + if (${se}.issues.length) {${H(se,O)} } - if (!${oe}_present && !${oe}.issues.length) { + if (!${se}_present && !${se}.issues.length) { payload.issues.push({ code: "invalid_type", expected: "nonoptional", input: undefined, - path: [${J}] + path: [${O}] }); + if (ctx && ctx.abortEarly) { + payload.value = newResult; + return payload; + } } - if (${oe}_present) { - if (${oe}.value === undefined) { - newResult[${J}] = undefined; - } else { - newResult[${J}] = ${oe}.value; - } + if (${se}_present) { + newResult[${O}] = ${se}.value; } - `)}S.write("payload.value = newResult;"),S.write("return payload;");const I=S.compile();return(K,oe)=>I(x,K,oe)};let c;const u=Yo,f=!lp.jitless,g=f&&k2.value,v=n.catchall;let y;e._zod.parse=(x,S)=>{y??(y=s.value);const k=x.value;return u(k)?f&&g&&S?.async===!1&&S.jitless!==!0?(c||(c=l(n.shape)),x=c(x,S),v?hx([],k,x,S,y,e):x):r(x,S):(x.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),x)}});function sb(e,n,r,s){for(const c of e)if(c.issues.length===0)return n.value=c.value,n;const l=e.filter(c=>!ps(c));return l.length===1?(n.value=l[0].value,l[0]):(n.issues.push({code:"invalid_union",input:n.value,inst:r,errors:e.map(c=>c.issues.map(u=>ar(u,s,nr())))}),n)}const px=re("$ZodUnion",(e,n)=>{Nt.init(e,n),dt(e._zod,"optin",()=>n.options.some(s=>s._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>n.options.some(s=>s._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(n.options.every(s=>s._zod.values))return new Set(n.options.flatMap(s=>Array.from(s._zod.values)))}),dt(e._zod,"pattern",()=>{if(n.options.every(s=>s._zod.pattern)){const s=n.options.map(l=>l._zod.pattern);return new RegExp(`^(${s.map(l=>up(l.source)).join("|")})$`)}});const r=n.options.length===1?n.options[0]._zod.run:null;e._zod.parse=(s,l)=>{if(r)return r(s,l);let c=!1;const u=[];for(const f of n.options){const h=f._zod.run({value:s.value,issues:[]},l);if(h instanceof Promise)u.push(h),c=!0;else{if(h.issues.length===0)return h;u.push(h)}}return c?Promise.all(u).then(f=>sb(f,s,e,l)):sb(u,s,e,l)}}),hk=re("$ZodDiscriminatedUnion",(e,n)=>{n.inclusive=!1,px.init(e,n);const r=e._zod.parse;dt(e._zod,"propValues",()=>{const l={};for(const c of n.options){const u=c._zod.propValues;if(!u||Object.keys(u).length===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(c)}"`);for(const[f,h]of Object.entries(u)){l[f]||(l[f]=new Set);for(const g of h)l[f].add(g)}}return l});const s=bu(()=>{const l=n.options,c=new Map;for(const u of l){const f=u._zod.propValues?.[n.discriminator];if(!f||f.size===0)throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(u)}"`);for(const h of f){if(c.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);c.set(h,u)}}return c});e._zod.parse=(l,c)=>{const u=l.value;if(!Yo(u))return l.issues.push({code:"invalid_type",expected:"object",input:u,inst:e}),l;const f=s.value.get(u?.[n.discriminator]);return f?f._zod.run(l,c):n.unionFallback||c.direction==="backward"?r(l,c):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:n.discriminator,options:Array.from(s.value.keys()),input:u,path:[n.discriminator],inst:e}),l)}}),pk=re("$ZodIntersection",(e,n)=>{Nt.init(e,n),e._zod.parse=(r,s)=>{const l=r.value,c=n.left._zod.run({value:l,issues:[]},s),u=n.right._zod.run({value:l,issues:[]},s);return c instanceof Promise||u instanceof Promise?Promise.all([c,u]).then(([h,g])=>ob(r,h,g)):ob(r,c,u)}});function Ah(e,n){if(e===n)return{valid:!0,data:e};if(e instanceof Date&&n instanceof Date&&+e==+n)return{valid:!0,data:e};if(Es(e)&&Es(n)){const r=Object.keys(n),s=Object.keys(e).filter(c=>r.indexOf(c)!==-1),l={...e,...n};for(const c of s){const u=Ah(e[c],n[c]);if(!u.valid)return{valid:!1,mergeErrorPath:[c,...u.mergeErrorPath]};l[c]=u.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(n)){if(e.length!==n.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let s=0;sf.l&&f.r).map(([f])=>f);if(c.length&&l&&e.issues.push({...l,keys:c}),ps(e))return e;const u=Ah(n.value,r.value);if(!u.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`);return e.value=u.data,e}const mk=re("$ZodRecord",(e,n)=>{Nt.init(e,n),e._zod.parse=(r,s)=>{const l=r.value;if(!Es(l))return r.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),r;const c=[],u=n.keyType._zod.values;if(u){r.value={};const f=new Set;for(const g of u)if(typeof g=="string"||typeof g=="number"||typeof g=="symbol"){f.add(typeof g=="number"?g.toString():g);const v=n.keyType._zod.run({value:g,issues:[]},s);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(v.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:v.issues.map(S=>ar(S,s,nr())),input:g,path:[g],inst:e});continue}const y=v.value,x=n.valueType._zod.run({value:l[g],issues:[]},s);x instanceof Promise?c.push(x.then(S=>{S.issues.length&&r.issues.push(...ms(g,S.issues)),r.value[y]=S.value})):(x.issues.length&&r.issues.push(...ms(g,x.issues)),r.value[y]=x.value)}let h;for(const g in l)f.has(g)||(h=h??[],h.push(g));h&&h.length>0&&r.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:h})}else{r.value={};for(const f of Reflect.o)DELIM" -R"DELIM(wnKeys(l)){if(f==="__proto__"||!Object.prototype.propertyIsEnumerable.call(l,f))continue;let h=n.keyType._zod.run({value:f,issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&sx.test(f)&&h.issues.length){const y=n.keyType._zod.run({value:Number(f),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(h=y)}if(h.issues.length){n.mode==="loose"?r.value[f]=l[f]:r.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(y=>ar(y,s,nr())),input:f,path:[f],inst:e});continue}const v=n.valueType._zod.run({value:l[f],issues:[]},s);v instanceof Promise?c.push(v.then(y=>{y.issues.length&&r.issues.push(...ms(f,y.issues)),r.value[h.value]=y.value})):(v.issues.length&&r.issues.push(...ms(f,v.issues)),r.value[h.value]=v.value)}}return c.length?Promise.all(c).then(()=>r):r}}),gk=re("$ZodEnum",(e,n)=>{Nt.init(e,n);const r=X0(n.entries),s=new Set(r);e._zod.values=s,e._zod.pattern=new RegExp(`^(${r.filter(l=>T2.has(typeof l)).map(l=>typeof l=="string"?_s(l):l.toString()).join("|")})$`),e._zod.parse=(l,c)=>{const u=l.value;return s.has(u)||l.issues.push({code:"invalid_value",values:r,input:u,inst:e}),l}}),yk=re("$ZodLiteral",(e,n)=>{if(Nt.init(e,n),n.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(n.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.values.map(s=>typeof s=="string"?_s(s):s?_s(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,l)=>{const c=s.value;return r.has(c)||s.issues.push({code:"invalid_value",values:n.values,input:c,inst:e}),s}}),vk=re("$ZodTransform",(e,n)=>{Nt.init(e,n),e._zod.optin="optional",e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new K0(e.constructor.name);const l=n.transform(r.value,r);if(s.async)return(l instanceof Promise?l:Promise.resolve(l)).then(u=>(r.value=u,r.fallback=!0,r));if(l instanceof Promise)throw new vs;return r.value=l,r.fallback=!0,r}});function lb(e,n){return n===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const mx=re("$ZodOptional",(e,n)=>{Nt.init(e,n),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${up(r.source)})?$`):void 0}),e._zod.parse=(r,s)=>{if(n.innerType._zod.optin==="optional"){const l=r.value,c=n.innerType._zod.run(r,s);return c instanceof Promise?c.then(u=>lb(u,l)):lb(c,l)}return r.value===void 0?r:n.innerType._zod.run(r,s)}}),bk=re("$ZodExactOptional",(e,n)=>{mx.init(e,n),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"pattern",()=>n.innerType._zod.pattern),e._zod.parse=(r,s)=>n.innerType._zod.run(r,s)}),xk=re("$ZodNullable",(e,n)=>{Nt.init(e,n),dt(e._zod,"optin",()=>n.innerType._zod.optin),dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=n.innerType._zod.pattern;return r?new RegExp(`^(${up(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>n.innerType._zod.values?new Set([...n.innerType._zod.values,null]):void 0),e._zod.parse=(r,s)=>r.value===null?r:n.innerType._zod.run(r,s)}),Sk=re("$ZodDefault",(e,n)=>{Nt.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return n.innerType._zod.run(r,s);if(r.value===void 0)return r.value=n.defaultValue,r;const l=n.innerType._zod.run(r,s);return l instanceof Promise?l.then(c=>cb(c,n)):cb(l,n)}});function cb(e,n){return e.value===void 0&&(e.value=n.defaultValue),e}const wk=re("$ZodPrefault",(e,n)=>{Nt.init(e,n),e._zod.optin="optional",dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,s)=>(s.direction==="backward"||r.value===void 0&&(r.value=n.defaultValue),n.innerType._zod.run(r,s))}),Ek=re("$ZodNonOptional",(e,n)=>{Nt.init(e,n),dt(e._zod,"values",()=>{const r=n.innerType._zod.values;return r?new Set([...r].filter(s=>s!==void 0)):void 0}),e._zod.parse=(r,s)=>{const l=n.innerType._zod.run(r,s);return l instanceof Promise?l.then(c=>ub(c,e)):ub(l,e)}});function ub(e,n){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:n}),e}const _k=re("$ZodCatch",(e,n)=>{Nt.init(e,n),e._zod.optin="optional",dt(e._zod,"optout",()=>n.innerType._zod.optout),dt(e._zod,"values",()=>n.innerType._zod.values),e._zod.parse=(r,s)=>{if(s.direction==="backward")return n.innerType._zod.run(r,s);const l=n.innerType._zod.run(r,s);return l instanceof Promise?l.then(c=>(r.value=c.value,c.issues.length&&(r.value=n.catchValue({...r,error:{issues:c.issues.map(u=>ar(u,s,nr()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=l.value,l.issues.length&&(r.value=n.catchValue({...r,error:{issues:l.issues.map(c=>ar(c,s,nr()))},input:r.value}),r.issues=[],r.fallback=!0),r)}}),kk=re("$ZodPipe",(e,n)=>{Nt.init(e,n),dt(e._zod,"values",()=>n.in._zod.values),dt(e._zod,"optin",()=>n.in._zod.optin),dt(e._zod,"optout",()=>n.out._zod.optout),dt(e._zod,"propValues",()=>n.in._zod.propValues),e._zod.parse=(r,s)=>{if(s.direction==="backward"){const c=n.out._zod.run(r,s);return c instanceof Promise?c.then(u=>Ac(u,n.in,s)):Ac(c,n.in,s)}const l=n.in._zod.run(r,s);return l instanceof Promise?l.then(c=>Ac(c,n.out,s)):Ac(l,n.out,s)}});function Ac(e,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}const Tk=re("$ZodReadonly",(e,n)=>{Nt.init(e,n),dt(e._zod,"propValues",()=>n.innerType._zod.propValues),dt(e._zod,"values",()=>n.innerType._zod.values),dt(e._zod,"optin",()=>n.innerType?._zod?.optin),dt(e._zod,"optout",()=>n.innerType?._zod?.optout),e._zod.parse=(r,s)=>{if(s.direction==="backward")return n.innerType._zod.run(r,s);const l=n.innerType._zod.run(r,s);return l instanceof Promise?l.then(fb):fb(l)}});function fb(e){return e.value=Object.freeze(e.value),e}const Nk=re("$ZodCustom",(e,n)=>{kn.init(e,n),Nt.init(e,n),e._zod.parse=(r,s)=>r,e._zod.check=r=>{const s=r.value,l=n.fn(s);if(l instanceof Promise)return l.then(c=>db(c,r,s,e));db(l,r,s,e)}});function db(e,n,r,s){if(!e){const l={code:"custom",input:r,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(l.params=s._zod.def.params),n.issues.push(Vo(l))}}var hb;class jk{constructor(){this._map=new WeakMap,this._idmap=new Map}add(n,...r){const s=r[0];return this._map.set(n,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,n),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(n){const r=this._map.get(n);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(n),this}get(n){const r=n._zod.parent;if(r){const s={...this.get(r)??{}};delete s.id;const l={...s,...this._map.get(n)};return Object.keys(l).length?l:void 0}return this._map.get(n)}has(n){return this._map.has(n)}}function Rk(){return new jk}(hb=globalThis).__zod_globalRegistry??(hb.__zod_globalRegistry=Rk());const Oo=globalThis.__zod_globalRegistry;function Ck(e,n){return new e({type:"string",...Te(n)})}function Ak(e,n){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Te(n)})}function pb(e,n){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Te(n)})}function Ok(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Te(n)})}function zk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Te(n)})}function Mk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Te(n)})}function Dk(e,n){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Te(n)})}function Lk(e,n){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Te(n)})}function Bk(e,n){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Te(n)})DELIM" -R"DELIM()}function Uk(e,n){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Te(n)})}function $k(e,n){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Te(n)})}function Hk(e,n){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Te(n)})}function Pk(e,n){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Te(n)})}function Zk(e,n){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Te(n)})}function Ik(e,n){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Te(n)})}function qk(e,n){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Te(n)})}function Fk(e,n){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Te(n)})}function Qk(e,n){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Te(n)})}function Yk(e,n){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Te(n)})}function Vk(e,n){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Te(n)})}function Gk(e,n){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Te(n)})}function Kk(e,n){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Te(n)})}function Xk(e,n){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Te(n)})}function Jk(e,n){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Te(n)})}function Wk(e,n){return new e({type:"string",format:"date",check:"string_format",...Te(n)})}function eT(e,n){return new e({type:"string",format:"time",check:"string_format",precision:null,...Te(n)})}function tT(e,n){return new e({type:"string",format:"duration",check:"string_format",...Te(n)})}function nT(e,n){return new e({type:"number",checks:[],...Te(n)})}function aT(e,n){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Te(n)})}function rT(e,n){return new e({type:"boolean",...Te(n)})}function iT(e){return new e({type:"unknown"})}function sT(e,n){return new e({type:"never",...Te(n)})}function mb(e,n){return new lx({check:"less_than",...Te(n),value:e,inclusive:!1})}function Qd(e,n){return new lx({check:"less_than",...Te(n),value:e,inclusive:!0})}function gb(e,n){return new cx({check:"greater_than",...Te(n),value:e,inclusive:!1})}function Yd(e,n){return new cx({check:"greater_than",...Te(n),value:e,inclusive:!0})}function yb(e,n){return new S_({check:"multiple_of",...Te(n),value:e})}function gx(e,n){return new E_({check:"max_length",...Te(n),maximum:e})}function iu(e,n){return new __({check:"min_length",...Te(n),minimum:e})}function yx(e,n){return new k_({check:"length_equals",...Te(n),length:e})}function oT(e,n){return new T_({check:"string_format",format:"regex",...Te(n),pattern:e})}function lT(e){return new N_({check:"string_format",format:"lowercase",...Te(e)})}function cT(e){return new j_({check:"string_format",format:"uppercase",...Te(e)})}function uT(e,n){return new R_({check:"string_format",format:"includes",...Te(n),includes:e})}function fT(e,n){return new C_({check:"string_format",format:"starts_with",...Te(n),prefix:e})}function dT(e,n){return new A_({check:"string_format",format:"ends_with",...Te(n),suffix:e})}function Ns(e){return new O_({check:"overwrite",tx:e})}function hT(e){return Ns(n=>n.normalize(e))}function pT(){return Ns(e=>e.trim())}function mT(){return Ns(e=>e.toLowerCase())}function gT(){return Ns(e=>e.toUpperCase())}function yT(){return Ns(e=>_2(e))}function vT(e,n,r){return new e({type:"array",element:n,...Te(r)})}function bT(e,n,r){return new e({type:"custom",check:"custom",fn:n,...Te(r)})}function xT(e,n){const r=ST(s=>(s.addIssue=l=>{if(typeof l=="string")s.issues.push(Vo(l,s.value,r._zod.def));else{const c=l;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=s.value),c.inst??(c.inst=r),c.continue??(c.continue=!r._zod.def.abort),s.issues.push(Vo(c))}},e(s.value,s)),n);return r}function ST(e,n){const r=new kn({check:"custom",...Te(n)});return r._zod.check=e,r}function vx(e){let n=e?.target??"draft-2020-12";return n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Oo,target:n,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function qt(e,n,r={path:[],schemaPath:[]}){var s;const l=e._zod.def,c=n.seen.get(e);if(c)return c.count++,r.schemaPath.includes(e)&&(c.cycle=r.path),c.schema;const u={schema:{},count:1,cycle:void 0,path:r.path};n.seen.set(e,u);const f=e._zod.toJSONSchema?.();if(f)u.schema=f;else{const v={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(n,u.schema,v);else{const x=u.schema,S=n.processors[l.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);S(e,n,x,v)}const y=e._zod.parent;y&&(u.ref||(u.ref=y),qt(y,n,v),n.seen.get(y).isParent=!0)}const h=n.metadataRegistry.get(e);return h&&Object.assign(u.schema,h),n.io==="input"&&hn(e)&&(delete u.schema.examples,delete u.schema.default),n.io==="input"&&"_prefault"in u.schema&&((s=u.schema).default??(s.default=u.schema._prefault)),delete u.schema._prefault,n.seen.get(e).schema}function bx(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const u of e.seen.entries()){const f=e.metadataRegistry.get(u[0])?.id;if(f){const h=s.get(f);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(f,u[0])}}const l=u=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(u[0])?.id,x=e.external.uri??(k=>k);if(y)return{ref:x(y)};const S=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=S,{defId:S,ref:`${x("__shared")}#/${f}/${S}`}}if(u[1]===r)return{ref:"#"};const g=`#/${f}/`,v=u[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:g+v}},c=u=>{if(u[1].schema.$ref)return;const f=u[1],{ref:h,defId:g}=l(u);f.def={...f.schema},g&&(f.defId=g);const v=f.schema;for(const y in v)delete v[y];v.$ref=h};if(e.cycles==="throw")for(const u of e.seen.entries()){const f=u[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/ + `)}return T.write("payload.value = newResult;"),T.write("return payload;"),T.compile()};let f;const h=Ul,m=!kr.jitless,v=m&&GN.value,y=r.catchall;let x;e._zod.parse=(S,E)=>{x??(x=o.value);const k=S.value;return h(k)?m&&v&&E?.async===!1&&E.jitless!==!0?(f||(f=c(r.shape)),S=f(S,E),y?KS([],k,S,E,x,e,E?.abortEarly===!0):S):i(S,E):(S.issues.push({expected:"object",code:"invalid_type",input:k,inst:e}),S)}});function bx(e,r,i,o){for(const c of e)if(c.issues.length===0)return r.value=c.value,r;const l=e.filter(c=>!ba(c));return l.length===1?(r.value=l[0].value,l[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:i,errors:e.map(c=>c.issues.map(f=>hi(f,o,Wr())))}),r)}const GS=ie("$ZodUnion",(e,r)=>{Ct.init(e,r),ft(e,"optin",o=>o.def.options.some(l=>l._zod.optin==="defaulted")?"defaulted":o.def.options.some(l=>l._zod.optin!==void 0)?"optional":void 0),ft(e,"optout",o=>o.def.options.some(l=>l._zod.optout==="optional")?"optional":void 0),ft(e,"values",o=>{if(o.def.options.every(l=>l._zod.values))return new Set(o.def.options.flatMap(l=>Array.from(l._zod.values)))}),ft(e,"pattern",o=>{if(o.def.options.every(l=>l._zod.pattern)){const l=o.def.options.map(c=>c._zod.pattern);return new RegExp(`^(${l.map(c=>Zp(c.source)).join("|")})$`)}});const i=r.options.length===1?r.options[0]._zod.run:null;e._zod.parse=(o,l)=>{if(i)return i(o,l);let c=!1;const f=[];for(const h of r.options){const m=h._zod.run({value:o.value,issues:[]},l);if(m instanceof Promise)f.push(m),c=!0;else{if(m.issues.length===0)return m;f.push(m)}}return c?Promise.all(f).then(h=>bx(h,o,e,l)):bx(f,o,e,l)}});function gR(e){const r=new Map;for(const i of e.options){const o=i._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const l of o)if(r.has(l)){if(l!==void 0)throw new Error(`Duplicate discriminator value "${String(l)}"`);r.set(l,null)}else r.set(l,i)}return r}const yR=ie("$ZodDiscriminatedUnion",(e,r)=>{r.inclusive=!1,GS.init(e,r);const i=e._zod.parse;ft(e,"propValues",l=>{const c={};let f=0;for(const h of l.def.options){const m=h._zod.propValues;if(!m||Object.keys(m).length===0)throw new Error(`Invalid discriminated union option at index "${l.def.options.indexOf(h)}"`);m[l.def.discriminator]?.has(void 0)&&f++;for(const[p,v]of Object.entries(m)){Object.prototype.hasOwnProperty.call(c,p)||wa(c,p,new Set);for(const y of v)c[p].add(y)}}return!l.def.unionFallback&&f>1&&c[l.def.discriminator]?.delete(void 0),c}),r.options.forEach((l,c)=>{const f=qp(l._zod.def);if(f&&!Object.prototype.hasOwnProperty.call(f,r.discriminator))throw new Error(`Invalid discriminated union option at index "${c}"`)});const o=Ef(()=>gR(r));e._zod.parse=(l,c)=>{const f=l.value;if(!Ul(f))return l.issues.push({code:"invalid_type",expected:"object",input:f,inst:e}),l;const h=f?.[r.discriminator],m=o.value.get(h);return m&&(h!==void 0||c.direction!=="backward")?m._zod.run(l,c):r.unionFallback||c.direction==="backward"?i(l,c):(l.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:r.discriminator,options:Array.from(o.value.keys()).filter(p=>o.value.get(p)!==null),input:f,path:[r.discriminator],inst:e}),l)}}),vR=ie("$ZodIntersection",(e,r)=>{Ct.init(e,r),e._zod.parse=(i,o)=>{const l=i.value,c=r.left._zod.run({value:l,issues:[]},o),f=r.right._zod.run({value:l,issues:[]},o);return c instanceof Promise||f instanceof Promise?Promise.all([c,f]).then(([m,p])=>xx(i,m,p)):xx(i,c,f)}});function lp(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(os(e)&&os(r)){const i=Object.keys(r),o=Object.keys(e).filter(c=>i.indexOf(c)!==-1),l={...e,...r};Object.prototype.hasOwnProperty.call(l,"__proto__")&&delete l.__proto__;for(const c of o){if(c==="__proto__")continue;const f=lp(e[c],r[c]);if(!f.valid)return{valid:!1,mergeErrorPath:[c,...f.mergeErrorPath]};l[c]=f.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let o=0;o{let y;if(p.code==="unrec)DELIM" +R"DELIM(ognized_keys"&&!p.path?.length)l??(l=p),y=p.keys;else if(p.code==="invalid_key"&&p.origin==="record"&&p.path?.length===1){const x=String(p.path[0]);c.has(x)||c.set(x,p),y=[x]}else return!1;for(const x of y)o.has(x)||o.set(x,{}),o.get(x)[v]=!0;return!0};for(const p of r.issues)f(p,"l")||e.issues.push(p);for(const p of i.issues)f(p,"r")||e.issues.push(p);const h=[...o].filter(([,p])=>p.l&&p.r).map(([p])=>p);if(h.length){const p=l?h.filter(v=>l.keys.includes(v)):[];p.length&&e.issues.push({...l,keys:p});for(const v of h)!p.includes(v)&&c.has(v)&&e.issues.push(c.get(v))}const m=lp(r.value,i.value);if(!m.valid){if(ba(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(m.mergeErrorPath)}`)}return e.value=m.data,e}const bR=ie("$ZodRecord",(e,r)=>{Ct.init(e,r);const i=kr.memoizer;i?.attach(e),e._zod.parse=(o,l)=>{const c=o.value;if(!os(c))return o.issues.push({expected:"record",code:"invalid_type",input:c,inst:e}),o;const f=[],h=r.keyType._zod.values;if(h&&!r.partial){o.value=i?i.alloc(e,o,{},l):{};const m=new Set;for(const v of h)if(typeof v=="string"||typeof v=="number"||typeof v=="symbol"){if(m.add(typeof v=="number"?v.toString():v),v==="__proto__")continue;const y=r.keyType._zod.run({value:v,issues:[]},l);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(y.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(E=>hi(E,l,Wr())),input:v,path:[v],inst:e});continue}const x=y.value;if(x==="__proto__")continue;const S=r.valueType._zod.run({value:c[v],issues:[]},l);S instanceof Promise?f.push(S.then(E=>{E.issues.length&&o.issues.push(...Xo(v,E.issues)),o.value[x]=E.value})):(S.issues.length&&o.issues.push(...Xo(v,S.issues)),o.value[x]=S.value)}let p;for(const v in c)if(!m.has(v))if(r.mode==="loose"){if(v==="__proto__")continue;o.value[v]=c[v]}else p=p??[],p.push(v);p&&p.length>0&&o.issues.push({code:"unrecognized_keys",input:c,inst:e,keys:p,continue:!0})}else{o.value=i?i.alloc(e,o,{},l):{};let m;for(const p of Reflect.ownKeys(c)){if(p==="__proto__"||!Object.prototype.propertyIsEnumerable.call(c,p))continue;let v=r.keyType._zod.run({value:p,issues:[]},l);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof p=="string"&&Xp.test(p)&&v.issues.length){const E=r.keyType._zod.run({value:Number(p),issues:[]},l);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(v=E)}if(v.issues.length){r.mode==="loose"?o.value[p]=c[p]:h?(m=m??[],m.push(p)):o.issues.push({code:"invalid_key",origin:"record",issues:v.issues.map(E=>hi(E,l,Wr())),input:p,path:[p],inst:e});continue}const x=v.value;if(x==="__proto__")continue;const S=r.valueType._zod.run({value:c[p],issues:[]},l);S instanceof Promise?f.push(S.then(E=>{E.issues.length&&o.issues.push(...Xo(p,E.issues)),o.value[x]=E.value})):(S.issues.length&&o.issues.push(...Xo(p,S.issues)),o.value[x]=S.value)}m&&m.length>0&&o.issues.push({code:"unrecognized_keys",input:c,inst:e,keys:m,continue:!0})}return f.length?Promise.all(f).then(()=>o):o}}),xR=ie("$ZodEnum",(e,r)=>{Ct.init(e,r);const i=ap(r.entries),o=new Set(i);e._zod.values=o,ft(e,"pattern",l=>{const c=ap(l.def.entries).filter(f=>XN.has(typeof f));return new RegExp(c.length?`^(${c.map(f=>ss(f.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(l,c)=>{const f=l.value;return o.has(f)||l.issues.push({code:"invalid_value",values:i,input:f,inst:e}),l}}),SR=ie("$ZodLiteral",(e,r)=>{Ct.init(e,r);const i=new Set(r.values);e._zod.values=i,ft(e,"pattern",o=>{const l=o.def.values;return new RegExp(l.length?`^(${l.map(c=>typeof c=="string"?ss(c):c?ss(c.toString()):String(c)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,l)=>{const c=o.value;return i.has(c)||o.issues.push({code:"invalid_value",values:r.values,input:c,inst:e}),o}}),wR=ie("$ZodTransform",(e,r)=>{Ct.init(e,r),e._zod.optin="optional",kr.memoizer?.guard(e),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new DS(e.constructor.name);const l=r.transform(i.value,i);if(o.async)return(l instanceof Promise?l:Promise.resolve(l)).then(f=>(i.value=f,i));if(l instanceof Promise)throw new Qi;return i.value=l,i}});function Sx(e,r){return e.value=r.issues.length?void 0:r.value,e}const XS=ie("$ZodOptional",(e,r)=>{Ct.init(e,r),ft(e,"optin",i=>i.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",ft(e,"values",i=>{const o=i.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),ft(e,"pattern",i=>{const o=i.def.innerType._zod.pattern;return o?new RegExp(`^(${Zp(o.source)})?$`):void 0}),e._zod.parse=(i,o)=>{if(i.value===void 0){if(r.innerType._zod.optin!=="defaulted")return i;const l=r.innerType._zod.run({value:i.value,issues:[]},o);return l instanceof Promise?l.then(c=>Sx(i,c)):Sx(i,l)}return r.innerType._zod.run(i,o)}}),ER=ie("$ZodExactOptional",(e,r)=>{XS.init(e,r),ft(e,"values",i=>i.def.innerType._zod.values),ft(e,"pattern",i=>i.def.innerType._zod.pattern),e._zod.parse=(i,o)=>r.innerType._zod.run(i,o)}),_R=ie("$ZodNullable",(e,r)=>{Ct.init(e,r),ft(e,"optin",i=>i.def.innerType._zod.optin),ft(e,"optout",i=>i.def.innerType._zod.optout),ft(e,"pattern",i=>{const o=i.def.innerType._zod.pattern;return o?new RegExp(`^(${Zp(o.source)}|null)$`):void 0}),ft(e,"values",i=>i.def.innerType._zod.values?new Set([...i.def.innerType._zod.values,null]):void 0),e._zod.parse=(i,o)=>i.value===null?i:r.innerType._zod.run(i,o)}),TR=ie("$ZodDefault",(e,r)=>{Ct.init(e,r),e._zod.optin="defaulted",ft(e,"values",i=>i.def.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return r.innerType._zod.run(i,o);if(i.value===void 0)return i.value=r.defaultValue,i;const l=r.innerType._zod.run(i,o);return l instanceof Promise?l.then(c=>wx(c,r)):wx(l,r)}});function wx(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const NR=ie("$ZodPrefault",(e,r)=>{Ct.init(e,r),e._zod.optin="defaulted",ft(e,"values",i=>i.def.innerType._zod.values),e._zod.parse=(i,o)=>(o.direction==="backward"||i.value===void 0&&(i.value=r.defaultValue),r.innerType._zod.run(i,o))}),kR=ie("$ZodNonOptional",(e,r)=>{Ct.init(e,r),ft(e,"values",i=>{const o=i.def.innerType._zod.values;return o?new Set([...o].filter(l=>l!==void 0)):void 0}),e._zod.parse=(i,o)=>{const l=r.innerType._zod.run(i,o);return l instanceof Promise?l.then(c=>Ex(c,e)):Ex(l,e)}});function Ex(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}function _x(e,r,i,o){return r.issues.length?(e.value=i.catchValue({...r,value:e.value,error:{issues:r.issues.map(l=>hi(l,o,Wr()))},input:e.value}),e):(e.value=r.value,r.memo&&(e.memo=!0),e)}const RR=ie("$ZodCatch",(e,r)=>{Ct.init(e,r),ft(e,"optin",i=>i.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),ft(e,"optout",i=>i.def.innerType._zod.optout),ft(e,"values",i=>i.def.innerType._zod.values),e._zod.parse=(i,o)=>{if(o.direction==="backward")return r.innerType._zod.run(i,o);const l=r.innerType._zod.run({value:i.value,issues:[]},o);return l instanceof Promise?l.then(c=>_x(i,c,r,o)):_x(i,l,r,o)}}),jR=ie("$ZodPipe",(e,r)=>{Ct.init(e,r),ft(e,"values",i=>i.def.in._zod.values),ft(e,"optin",i=>i.def.in._zod.optin),ft(e,"optout",i=>i.def.out._zod.optout),ft(e,"propValues",i=>i.def.in._zod.propValues),e._zod.parse=(i,o)=>{if(o.direction==="backward"){const c=r.out._zod.run(i,o);return c instanceof Promise?c.then(f=>Ru(f,r.in,o)):Ru(c,r.in,o)}const l=r.in._zod.run(i,o);return l instanceof Promise?l.then(c=>Ru(c,r.out,o)):Ru(l,r.out,o)}});function Ru(e,r,i){return e.issues.some(o=>o.code!=="unrecognized_keys")?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},i)}const CR=ie("$ZodReadonly",(e,r)=>{Ct.init(e,r),ft(e,"propValues",i=>i.def.innerType._zod.propValues),ft(e,"values",i=>i.def.innerType._zod.values),ft(e,"optin",i=>i.def.innerType?._zod?.optin),ft(e,"optout",i=>i.def.innerType?._zod?.optout),e._zod.parse=(i,o)=)DELIM" +R"DELIM(>{if(o.direction==="backward")return r.innerType._zod.run(i,o);const l=r.innerType._zod.run(i,o);return l instanceof Promise?l.then(Tx):Tx(l)}});function Tx(e){return e.memo||(e.value=Object.freeze(e.value)),e}const OR=ie("$ZodCustom",(e,r)=>{Hn.init(e,r),Ct.init(e,r),e._zod.parse=(i,o)=>i,e._zod.check=i=>{const o=i.value,l=r.fn(o);if(l instanceof Promise)return l.then(c=>Nx(c,i,o,e));Nx(l,i,o,e)}});function Nx(e,r,i,o){if(!e){const l={code:"custom",input:i,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(l.params=o._zod.def.params),r.issues.push(Hl(l))}}class AR extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const cp="~memo",kx=[];function JS(e){return e!==null&&typeof e=="object"}function xm(e){return e.map(r=>r.path?{...r,path:r.path.slice()}:{...r})}const WS=new WeakMap,wl=0,Fu=1,Cl=2;function Vu(e,r,i){const o=WS.get(e);if(o!==void 0)return o?Cl:wl;if(r.has(e))return Cl;r.add(e);let l=wl;const c=v=>{if(l!==Cl&&v?._zod){const y=Vu(v,r);y>l&&(l=y)}},f=(v,y)=>{let x=wl;for(const S of Reflect.ownKeys(v)){const E=Object.getOwnPropertyDescriptor(v,S);if(!E.enumerable)continue;const k=E.get?Fu:E.value?._zod?Vu(E.value,r):wl;k>x&&(x=k)}return x},h=v=>{v>l&&(l=v)},m=e._zod.def;switch(m.type){case"object":{const v=qp(m);h(v?f(v):Fu),c(m.catchall);break}case"array":c(m.element);break;case"tuple":for(const v of m.items)c(v);c(m.rest);break;case"record":case"map":c(m.keyType),c(m.valueType);break;case"set":c(m.valueType);break;case"union":for(const v of m.options)c(v);break;case"intersection":c(m.left),c(m.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":c(m.innerType);break;case"pipe":c(m.in),c(m.out);break;case"function":c(m.input),c(m.output);break;case"lazy":{const v=m._cachedInner??void 0;h(v?Vu(v,r):Fu);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const v in m){const y=Object.getOwnPropertyDescriptor(m,v);if(!y||y.get)continue;const x=y.value;if(!(!x||typeof x!="object")){if(x._zod)c(x);else if(Array.isArray(x))for(const S of x)c(S)}}}return r.delete(e),zR(e,l)}function zR(e,r){return r!==Fu&&WS.set(e,r===Cl),r}function MR(e,r){let i=e.buckets.get(r);return i||(i=new WeakMap,e.buckets.set(r,i)),i}let ju;const Cu=[],DR={alloc(e,r,i){const o=ju;if(!o)return i;ju=void 0;const l={value:i,issues:null};return o.set(r.value,l),Cu.push(l),i},guard(e){var r;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{const i=e._zod.parse,o=(l,c)=>{if(c.direction!=="backward"&&BR(c,l.value))throw new AR;return i(l,c)};e._zod.parse=o,e._zod.run===i&&(e._zod.run=o)})},attach(e){var r;let i,o=!1,l,c;(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred.push(()=>{const f=e._zod.parse,h=(m,p)=>{if(i===void 0){const P=Vu(e,new Set);if(P===wl)return e._zod.parse=f,e._zod.run===h&&(e._zod.run=f),f(m,p);P===Cl||o?i=!0:o=!0}const v=m.value;if(!JS(v))return f(m,p);let y=p[cp];y||(y={buckets:new WeakMap,backEdges:void 0},p[cp]=y);let x;l===p?x=c:(x=MR(y,e),l=p,c=x);const S=x.get(v);if(S)return m.value=S.value,S.issues?S.issues.length&&m.issues.push(...xm(S.issues)):(m.memo=!0,y.backEdges??(y.backEdges=new WeakSet),y.backEdges.add(S.value)),m;ju=x;const E=Cu.length,k=f(m,p);ju=void 0;const T=Cu.length>E?Cu.pop():void 0;return k instanceof Promise?k.then(P=>(T&&(T.issues=P.issues.length?xm(P.issues):kx),P)):(T&&(T.issues=k.issues.length?xm(k.issues):kx),k)};e._zod.parse=h,e._zod.run===f&&(e._zod.run=h)})}};function LR(){return DR}function BR(e,r){const i=e[cp]?.backEdges;return i!==void 0&&JS(r)&&i.has(r)}const UR=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function r(c){return e[c]??null}const i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};function l(c,f){return c==="number"&&typeof f=="number"&&!Number.isFinite(f)?String(f):o[c]??c}return c=>{switch(c.code){case"invalid_type":{const f=l(c.expected),h=l4(c.input),m=l(h,c.input);return`Invalid input: expected ${f}, received ${m}`}case"invalid_value":return c.values.length===1?`Invalid input: expected ${CS(c.values[0])}`:`Invalid option: expected one of ${ux(c.values,"|")}`;case"too_big":{const f=c.exact?"exactly ":c.inclusive?"<=":"<",h=r(c.origin);return h?`Too big: expected ${c.origin??"value"} to have ${f}${c.maximum.toString()} ${h.unit??"elements"}`:`Too big: expected ${c.origin??"value"} to be ${f}${c.maximum.toString()}`}case"too_small":{const f=c.exact?"exactly ":c.inclusive?">=":">",h=r(c.origin);return h?`Too small: expected ${c.origin} to have ${f}${c.minimum.toString()} ${h.unit}`:`Too small: expected ${c.origin} to be ${f}${c.minimum.toString()}`}case"invalid_format":{const f=c;return f.format==="starts_with"?`Invalid string: must start with "${f.prefix}"`:f.format==="ends_with"?`Invalid string: must end with "${f.suffix}"`:f.format==="includes"?`Invalid string: must include "${f.includes}"`:f.format==="regex"?`Invalid string: must match pattern ${f.pattern}`:`Invalid ${i[f.format]??c.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${c.divisor}`;case"unrecognized_keys":return`Unrecognized key${c.keys.length>1?"s":""}: ${ux(c.keys,", ")}`;case"invalid_key":return`Invalid key in ${c.origin}`;case"invalid_union":return c.options&&Array.isArray(c.options)&&c.options.length>0?`Invalid discriminator value. Expected ${c.options.map(h=>`'${h}'`).join(" | ")}`:c.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${c.origin}`;default:return"Invalid input"}}};function HR(){return{localeError:UR()}}var Rx;class $R{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...i){const o=i[0];return this._map.set(r,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,r),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const i=this._map.get(r);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(r),this}get(r){const i=r._zod.parent;if(i){const o={...this.get(i)??{}};delete o.id;const l={...o,...this._map.get(r)};return Object.keys(l).length?l:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function PR(){return new $R}(Rx=globalThis).__zod_globalRegistry??(Rx.__zod_globalRegistry=PR());const El=globalThis.__zod_globalRegistry;function ew(e){return e.checks&&(e.checks=[...e.checks]),e}function IR(e,r){return new e(ew({type:"string",...ke(r)}))}function ZR(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(r)})}function qR(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(r)})}function FR(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(r)})}function VR(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(r)})}function YR(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(r)})}function QR(e,r){return new e({type:")DELIM" +R"DELIM(string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(r)})}function KR(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(r)})}function GR(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(r)})}function XR(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(r)})}function JR(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(r)})}function WR(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(r)})}function ej(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(r)})}function tj(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(r)})}function nj(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(r)})}function rj(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(r)})}function aj(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(r)})}function ij(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(r)})}function oj(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(r)})}function sj(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(r)})}function lj(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(r)})}function cj(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(r)})}function uj(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(r)})}function fj(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(r)})}function dj(e,r){return new e({type:"string",format:"date",check:"string_format",...ke(r)})}function hj(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(r)})}function mj(e,r){return new e({type:"string",format:"duration",check:"string_format",...ke(r)})}function pj(e,r){return new e(ew({type:"number",checks:[],...ke(r)}))}function gj(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ke(r)})}function yj(e,r){return new e({type:"boolean",...ke(r)})}function vj(e){return new e({type:"unknown"})}function bj(e,r){return new e({type:"never",...ke(r)})}function jx(e,r){return new US({check:"less_than",...ke(r),value:e,inclusive:!1})}function Sm(e,r){return new US({check:"less_than",...ke(r),value:e,inclusive:!0})}function Cx(e,r){return new HS({check:"greater_than",...ke(r),value:e,inclusive:!1})}function wm(e,r){return new HS({check:"greater_than",...ke(r),value:e,inclusive:!0})}function Ox(e,r){return new hk({check:"multiple_of",...ke(r),value:e})}function tw(e,r){return new pk({check:"max_length",...ke(r),maximum:e})}function cf(e,r){return new gk({check:"min_length",...ke(r),minimum:e})}function nw(e,r){return new yk({check:"length_equals",...ke(r),length:e})}function xj(e,r){return new vk({check:"string_format",format:"regex",...ke(r),pattern:e})}function Sj(e){return new bk({check:"string_format",format:"lowercase",...ke(e)})}function wj(e){return new xk({check:"string_format",format:"uppercase",...ke(e)})}function Ej(e,r){return new Sk({check:"string_format",format:"includes",...ke(r),includes:e})}function _j(e,r){return new wk({check:"string_format",format:"starts_with",...ke(r),prefix:e})}function Tj(e,r){return new Ek({check:"string_format",format:"ends_with",...ke(r),suffix:e})}function hs(e){return new _k({check:"overwrite",tx:e})}function Nj(e){return hs(r=>r.normalize(e))}function kj(){return hs(e=>e.trim())}function Rj(){return hs(e=>e.toLowerCase())}function jj(){return hs(e=>e.toUpperCase())}function Cj(){return hs(e=>KN(e))}function Oj(e,r,i){return new e({type:"array",element:r,...ke(i)})}function Aj(e,r,i){return new e({type:"custom",check:"custom",fn:r,...ke(i)})}function zj(e,r){const i=Mj(o=>(o.addIssue=l=>{if(typeof l=="string")o.issues.push(Hl(l,o.value,i._zod.def));else{const c=l;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),"input"in c||(c.input=o.value),c.inst??(c.inst=i),c.continue??(c.continue=!i._zod.def.abort),o.issues.push(Hl(c))}},e(o.value,o)),r);return i}function Mj(e,r){const i=new Hn({check:"custom",...ke(r)});return i._zod.check=e,i}function Ol(e,...r){for(const i of r)for(const o of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,o)&&wa(e,o,i[o]);return e}function rw(e){let r=e?.target??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??El,target:r,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function pi(e,r,i,o,l){const c=typeof r.unrepresentable=="function"?r.unrepresentable({zodSchema:e,path:o.path,message:l}):r.unrepresentable;if(c==="any")return!1;if(c===void 0||c==="throw")throw new Error(l);return Object.assign(i,c),!0}function Ft(e,r,i={path:[],schemaPath:[]}){var o;const l=e._zod.def,c=r.seen.get(e);if(c)return c.count++,i.schemaPath.includes(e)&&(c.cycle=i.path),c.schema;const f={schema:{},count:1,cycle:void 0,path:i.path};r.seen.set(e,f),r.sharedDefsExtractedFor=void 0,r.sharedEmitDoneFor=void 0;const h=e._zod.toJSONSchema?.();if(h)f.schema=h;else{const v={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,f.schema,v);else{const x=f.schema,S=r.processors[l.type];if(!S)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${l.type}`);S(e,r,x,v)}const y=e._zod.parent;y&&(f.ref||(f.ref=y),Ft(y,r,v),r.seen.get(y).isParent=!0)}const m=r.metadataRegistry.get(e);return m&&Ol(f.schema,m),r.io==="input"&&Rn(e)&&(delete f.schema.examples,delete f.schema.default),r.io==="input"&&"_prefault"in f.schema&&((o=f.schema).default??(o.default=f.schema._prefault)),delete f.schema._prefault,r.seen.get(e).schema}function Ax(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function aw(e,r){const i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const o=new Map;for(const f of e.seen.entries()){const h=e.metadataRegistry.get(f[0])?.id;if(h){const m=o.get(h);if(m&&m!==f[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(h,f[0])}}const l=f=>{const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(f[0])?.id,x=e.external.uri??(E=>E);if(y)return{ref:x(y)};const S=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=S,{defId:S,ref:`${x("__shared")}#/${h}/${Ax(S)}`}}const m="#",p=`${m}/${h}/`;if(f[1]===i&&!f[1].schema.id)return{ref:m};const v=f[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+Ax(v)}},c=f=>{if(f[1].schema.$ref)return;const h=f[1],{ref:m,defId:p}=l(f);h.def={...h.schema},p&&(h.defId=p);const v=h.schema;for(const y in v)delete v[y];v.$ref=m};if(e.cycles==="throw")for(const f of e.seen.entries()){const h=f[1];if(h.cycle)throw new Error(`Cycle detected: #/${h.cycle?.join("/")}/ -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const f=u[1];if(n===u[0]){c(u);continue}if(e.external){const g=e.external.registry.get(u[0])?.id;if(n!==u[0]&&g){c(u);continue}}if(e.metadataRegistry.get(u[0])?.id){c(u);continue}if(f.cycle){c(u);continue}if(f.count>1&&e.reused==="ref"){c(u);continue}}}function xx(e,n){const r=e.seen.get(n);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=f=>{const h=e.seen.get(f);if(h.ref===null)return;const g=h.def??h.schema,v={...g},y=h.ref;if(h.ref=null,y){s(y);const S=e.seen.get(y),k=S.schema;if(k.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(g.allOf=g.allOf??[],g.allOf.push(k)):Object.assign(g,k),Object.assign(g,v),f._zod.parent===y)for(const T in g)T==="$ref"||T==="allOf"||T in v||delete g[T];if(k.$ref&&S.def)for(const T in g)T==="$ref"||T==="allOf"||T in S.def&&JSON.stringify(g[T])===JSON.stringify(S.def[T])&&delete g[T]}const x=f._zod.parent;if(x&&x!==y){s(x);const S=e.seen.get(x);if(S?.schema.$ref&&(g.$ref=S.schema.$ref,S.def))for(const k in g)k==="$ref"||k==="allOf"||k in S.def&&JSON.stringify(g[k])===JSON.stringify(S.def[k])&&delete g[k]}e.override({zodSchema:f,jsonSchema:g,path:h.path??[]})};for(const f of[...e.seen.entries()].reverse())s(f[0]);const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==)DELIM" -R"DELIM(="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const f=e.external.registry.get(n)?.id;if(!f)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(f)}Object.assign(l,r.def??r.schema);const c=e.metadataRegistry.get(n)?.id;c!==void 0&&l.id===c&&delete l.id;const u=e.external?.defs??{};for(const f of e.seen.entries()){const h=f[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,u[h.defId]=h.def)}e.external||Object.keys(u).length>0&&(e.target==="draft-2020-12"?l.$defs=u:l.definitions=u);try{const f=JSON.parse(JSON.stringify(l));return Object.defineProperty(f,"~standard",{value:{...n["~standard"],jsonSchema:{input:su(n,"input",e.processors),output:su(n,"output",e.processors)}},enumerable:!1,writable:!1}),f}catch{throw new Error("Error converting schema to JSON.")}}function hn(e,n){const r=n??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return hn(s.element,r);if(s.type==="set")return hn(s.valueType,r);if(s.type==="lazy")return hn(s.getter(),r);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return hn(s.innerType,r);if(s.type==="intersection")return hn(s.left,r)||hn(s.right,r);if(s.type==="record"||s.type==="map")return hn(s.keyType,r)||hn(s.valueType,r);if(s.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:hn(s.in,r)||hn(s.out,r);if(s.type==="object"){for(const l in s.shape)if(hn(s.shape[l],r))return!0;return!1}if(s.type==="union"){for(const l of s.options)if(hn(l,r))return!0;return!1}if(s.type==="tuple"){for(const l of s.items)if(hn(l,r))return!0;return!!(s.rest&&hn(s.rest,r))}return!1}const wT=(e,n={})=>r=>{const s=vx({...r,processors:n});return qt(e,s),bx(s,e),xx(s,e)},su=(e,n,r={})=>s=>{const{libraryOptions:l,target:c}=s??{},u=vx({...l??{},target:c,io:n,processors:r});return qt(e,u),bx(u,e),xx(u,e)},ET={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_T=(e,n,r,s)=>{const l=r;l.type="string";const{minimum:c,maximum:u,format:f,patterns:h,contentEncoding:g}=e._zod.bag;if(typeof c=="number"&&(l.minLength=c),typeof u=="number"&&(l.maxLength=u),f&&(l.format=ET[f]??f,l.format===""&&delete l.format,f==="time"&&delete l.format),g&&(l.contentEncoding=g),h&&h.size>0){const v=[...h];v.length===1?l.pattern=v[0].source:v.length>1&&(l.allOf=[...v.map(y=>({...n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},kT=(e,n,r,s)=>{const l=r,{minimum:c,maximum:u,format:f,multipleOf:h,exclusiveMaximum:g,exclusiveMinimum:v}=e._zod.bag;typeof f=="string"&&f.includes("int")?l.type="integer":l.type="number";const y=typeof v=="number"&&v>=(c??Number.NEGATIVE_INFINITY),x=typeof g=="number"&&g<=(u??Number.POSITIVE_INFINITY),S=n.target==="draft-04"||n.target==="openapi-3.0";y?S?(l.minimum=v,l.exclusiveMinimum=!0):l.exclusiveMinimum=v:typeof c=="number"&&(l.minimum=c),x?S?(l.maximum=g,l.exclusiveMaximum=!0):l.exclusiveMaximum=g:typeof u=="number"&&(l.maximum=u),typeof h=="number"&&(l.multipleOf=h)},TT=(e,n,r,s)=>{r.type="boolean"},NT=(e,n,r,s)=>{r.not={}},jT=(e,n,r,s)=>{},RT=(e,n,r,s)=>{const l=e._zod.def,c=X0(l.entries);c.every(u=>typeof u=="number")&&(r.type="number"),c.every(u=>typeof u=="string")&&(r.type="string"),r.enum=c},CT=(e,n,r,s)=>{const l=e._zod.def,c=[];for(const u of l.values)if(u===void 0){if(n.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof u=="bigint"){if(n.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");c.push(Number(u))}else c.push(u);if(c.length!==0)if(c.length===1){const u=c[0];r.type=u===null?"null":typeof u,n.target==="draft-04"||n.target==="openapi-3.0"?r.enum=[u]:r.const=u}else c.every(u=>typeof u=="number")&&(r.type="number"),c.every(u=>typeof u=="string")&&(r.type="string"),c.every(u=>typeof u=="boolean")&&(r.type="boolean"),c.every(u=>u===null)&&(r.type="null"),r.enum=c},AT=(e,n,r,s)=>{if(n.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},OT=(e,n,r,s)=>{if(n.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},zT=(e,n,r,s)=>{const l=r,c=e._zod.def,{minimum:u,maximum:f}=e._zod.bag;typeof u=="number"&&(l.minItems=u),typeof f=="number"&&(l.maxItems=f),l.type="array",l.items=qt(c.element,n,{...s,path:[...s.path,"items"]})},MT=(e,n,r,s)=>{const l=r,c=e._zod.def;l.type="object",l.properties={};const u=c.shape;for(const g in u)l.properties[g]=qt(u[g],n,{...s,path:[...s.path,"properties",g]});const f=new Set(Object.keys(u)),h=new Set([...f].filter(g=>{const v=c.shape[g]._zod;return n.io==="input"?v.optin===void 0:v.optout===void 0}));h.size>0&&(l.required=Array.from(h)),c.catchall?._zod.def.type==="never"?l.additionalProperties=!1:c.catchall?c.catchall&&(l.additionalProperties=qt(c.catchall,n,{...s,path:[...s.path,"additionalProperties"]})):n.io==="output"&&(l.additionalProperties=!1)},DT=(e,n,r,s)=>{const l=e._zod.def,c=l.inclusive===!1,u=l.options.map((f,h)=>qt(f,n,{...s,path:[...s.path,c?"oneOf":"anyOf",h]}));c?r.oneOf=u:r.anyOf=u},LT=(e,n,r,s)=>{const l=e._zod.def,c=qt(l.left,n,{...s,path:[...s.path,"allOf",0]}),u=qt(l.right,n,{...s,path:[...s.path,"allOf",1]}),f=g=>"allOf"in g&&Object.keys(g).length===1,h=[...f(c)?c.allOf:[c],...f(u)?u.allOf:[u]];r.allOf=h},BT=(e,n,r,s)=>{const l=r,c=e._zod.def;l.type="object";const u=c.keyType,h=u._zod.bag?.patterns;if(c.mode==="loose"&&h&&h.size>0){const v=qt(c.valueType,n,{...s,path:[...s.path,"patternProperties","*"]});l.patternProperties={};for(const y of h)l.patternProperties[y.source]=v}else(n.target==="draft-07"||n.target==="draft-2020-12")&&(l.propertyNames=qt(c.keyType,n,{...s,path:[...s.path,"propertyNames"]})),l.additionalProperties=qt(c.valueType,n,{...s,path:[...s.path,"additionalProperties"]});const g=u._zod.values;if(g){const v=[...g].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(l.required=v)}},UT=(e,n,r,s)=>{const l=e._zod.def,c=qt(l.innerType,n,s),u=n.seen.get(e);n.target==="openapi-3.0"?(u.ref=l.innerType,r.nullable=!0):r.anyOf=[c,{type:"null"}]},$T=(e,n,r,s)=>{const l=e._zod.def;qt(l.innerType,n,s);const c=n.seen.get(e);c.ref=l.innerType},HT=(e,n,r,s)=>{const l=e._zod.def;qt(l.innerType,n,s);const c=n.seen.get(e);c.ref=l.innerType,r.default=JSON.parse(JSON.stringify(l.defaultValue))},PT=(e,n,r,s)=>{const l=e._zod.def;qt(l.innerType,n,s);const c=n.seen.get(e);c.ref=l.innerType,n.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(l.defaultValue)))},ZT=(e,n,r,s)=>{const l=e._zod.def;qt(l.innerType,n,s);const c=n.seen.get(e);c.ref=l.innerType;let u;try{u=l.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=u},IT=(e,n,r,s)=>{const l=e._zod.def,c=l.in._zod.traits.has("$ZodTransform"),u=n.io==="input"?c?l.out:l.in:l.out;qt(u,n,s);const f=n.seen.get(e);f.ref=u},qT=(e,n,r,s)=>{const l=e._zod.def;qt(l.innerType,n,s);const c=n.seen.get(e);c.ref=l.innerType,r.readOnly=!0},Sx=(e,n,r,s)=>{const l=e._zod.def;qt(l.innerType,n,s);const c=n.seen.get(e);c.ref=l.innerType},FT=re("ZodISODateTime",(e,n)=>{Q_.init(e,n),Rt.init(e,n)});function QT(e){return Jk(FT,e)}const YT=re("ZodISODate",(e,n)=>{Y_.init(e,n),Rt.init(e,n)});function VT(e){return Wk(YT,e)}const GT=re("ZodISOTime",(e,n)=>{V_.init(e,n),Rt.init(e,n)});function KT(e){return eT(GT,e)}const XT=re("ZodISODuration",(e,n)=>{G_.init(e,n),Rt.init(e,n)});function JT(e){return tT(XT,e)}const WT=(e,n)=>{tx.init(e,n),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>U2(e,r)},flatten:{value:r=>B2(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ch,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ch,2)}},isEmpty:)DELIM" -R"DELIM({get(){return e.issues.length===0}}})},ta=re("ZodError",WT,{Parent:Error}),e4=dp(ta),t4=hp(ta),n4=xu(ta),a4=Su(ta),r4=P2(ta),i4=Z2(ta),s4=I2(ta),o4=q2(ta),l4=F2(ta),c4=Q2(ta),u4=Y2(ta),f4=V2(ta),vb=new WeakMap;function al(e,n,r){const s=Object.getPrototypeOf(e);let l=vb.get(s);if(l||(l=new Set,vb.set(s,l)),!l.has(n)){l.add(n);for(const c in r){const u=r[c];Object.defineProperty(s,c,{configurable:!0,enumerable:!1,get(){const f=u.bind(this);return Object.defineProperty(this,c,{configurable:!0,writable:!0,enumerable:!0,value:f}),f},set(f){Object.defineProperty(this,c,{configurable:!0,writable:!0,enumerable:!0,value:f})}})}}}const jt=re("ZodType",(e,n)=>(Nt.init(e,n),Object.assign(e["~standard"],{jsonSchema:{input:su(e,"input"),output:su(e,"output")}}),e.toJSONSchema=wT(e,{}),e.def=n,e.type=n.type,Object.defineProperty(e,"_def",{value:n}),e.parse=(r,s)=>e4(e,r,s,{callee:e.parse}),e.safeParse=(r,s)=>n4(e,r,s),e.parseAsync=async(r,s)=>t4(e,r,s,{callee:e.parseAsync}),e.safeParseAsync=async(r,s)=>a4(e,r,s),e.spa=e.safeParseAsync,e.encode=(r,s)=>r4(e,r,s),e.decode=(r,s)=>i4(e,r,s),e.encodeAsync=async(r,s)=>s4(e,r,s),e.decodeAsync=async(r,s)=>o4(e,r,s),e.safeEncode=(r,s)=>l4(e,r,s),e.safeDecode=(r,s)=>c4(e,r,s),e.safeEncodeAsync=async(r,s)=>u4(e,r,s),e.safeDecodeAsync=async(r,s)=>f4(e,r,s),al(e,"ZodType",{check(...r){const s=this.def;return this.clone(Qr(s,{checks:[...s.checks??[],...r.map(l=>typeof l=="function"?{_zod:{check:l,def:{check:"custom"},onattach:[]}}:l)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,s){return Yr(this,r,s)},brand(){return this},register(r,s){return r.add(this,s),this},refine(r,s){return this.check(iN(r,s))},superRefine(r,s){return this.check(sN(r,s))},overwrite(r){return this.check(Ns(r))},optional(){return wb(this)},exactOptional(){return Q4(this)},nullable(){return Eb(this)},nullish(){return wb(Eb(this))},nonoptional(r){return J4(this,r)},array(){return Ta(this)},or(r){return B4([this,r])},and(r){return H4(this,r)},transform(r){return _b(this,q4(r))},default(r){return G4(this,r)},prefault(r){return X4(this,r)},catch(r){return eN(this,r)},pipe(r){return _b(this,r)},readonly(){return aN(this)},describe(r){const s=this.clone();return Oo.add(s,{description:r}),s},meta(...r){if(r.length===0)return Oo.get(this);const s=this.clone();return Oo.add(s,r[0]),s},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Oo.get(e)?.description},configurable:!0}),e)),wx=re("_ZodString",(e,n)=>{pp.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(s,l,c)=>_T(e,s,l);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,al(e,"_ZodString",{regex(...s){return this.check(oT(...s))},includes(...s){return this.check(uT(...s))},startsWith(...s){return this.check(fT(...s))},endsWith(...s){return this.check(dT(...s))},min(...s){return this.check(iu(...s))},max(...s){return this.check(gx(...s))},length(...s){return this.check(yx(...s))},nonempty(...s){return this.check(iu(1,...s))},lowercase(s){return this.check(lT(s))},uppercase(s){return this.check(cT(s))},trim(){return this.check(pT())},normalize(...s){return this.check(hT(...s))},toLowerCase(){return this.check(mT())},toUpperCase(){return this.check(gT())},slugify(){return this.check(yT())}})}),d4=re("ZodString",(e,n)=>{pp.init(e,n),wx.init(e,n),e.email=r=>e.check(Ak(h4,r)),e.url=r=>e.check(Lk(p4,r)),e.jwt=r=>e.check(Xk(R4,r)),e.emoji=r=>e.check(Bk(m4,r)),e.guid=r=>e.check(pb(bb,r)),e.uuid=r=>e.check(Ok(Oc,r)),e.uuidv4=r=>e.check(zk(Oc,r)),e.uuidv6=r=>e.check(Mk(Oc,r)),e.uuidv7=r=>e.check(Dk(Oc,r)),e.nanoid=r=>e.check(Uk(g4,r)),e.guid=r=>e.check(pb(bb,r)),e.cuid=r=>e.check($k(y4,r)),e.cuid2=r=>e.check(Hk(v4,r)),e.ulid=r=>e.check(Pk(b4,r)),e.base64=r=>e.check(Vk(T4,r)),e.base64url=r=>e.check(Gk(N4,r)),e.xid=r=>e.check(Zk(x4,r)),e.ksuid=r=>e.check(Ik(S4,r)),e.ipv4=r=>e.check(qk(w4,r)),e.ipv6=r=>e.check(Fk(E4,r)),e.cidrv4=r=>e.check(Qk(_4,r)),e.cidrv6=r=>e.check(Yk(k4,r)),e.e164=r=>e.check(Kk(j4,r)),e.datetime=r=>e.check(QT(r)),e.date=r=>e.check(VT(r)),e.time=r=>e.check(KT(r)),e.duration=r=>e.check(JT(r))});function Ge(e){return Ck(d4,e)}const Rt=re("ZodStringFormat",(e,n)=>{kt.init(e,n),wx.init(e,n)}),h4=re("ZodEmail",(e,n)=>{B_.init(e,n),Rt.init(e,n)}),bb=re("ZodGUID",(e,n)=>{D_.init(e,n),Rt.init(e,n)}),Oc=re("ZodUUID",(e,n)=>{L_.init(e,n),Rt.init(e,n)}),p4=re("ZodURL",(e,n)=>{U_.init(e,n),Rt.init(e,n)}),m4=re("ZodEmoji",(e,n)=>{$_.init(e,n),Rt.init(e,n)}),g4=re("ZodNanoID",(e,n)=>{H_.init(e,n),Rt.init(e,n)}),y4=re("ZodCUID",(e,n)=>{P_.init(e,n),Rt.init(e,n)}),v4=re("ZodCUID2",(e,n)=>{Z_.init(e,n),Rt.init(e,n)}),b4=re("ZodULID",(e,n)=>{I_.init(e,n),Rt.init(e,n)}),x4=re("ZodXID",(e,n)=>{q_.init(e,n),Rt.init(e,n)}),S4=re("ZodKSUID",(e,n)=>{F_.init(e,n),Rt.init(e,n)}),w4=re("ZodIPv4",(e,n)=>{K_.init(e,n),Rt.init(e,n)}),E4=re("ZodIPv6",(e,n)=>{X_.init(e,n),Rt.init(e,n)}),_4=re("ZodCIDRv4",(e,n)=>{J_.init(e,n),Rt.init(e,n)}),k4=re("ZodCIDRv6",(e,n)=>{W_.init(e,n),Rt.init(e,n)}),T4=re("ZodBase64",(e,n)=>{ek.init(e,n),Rt.init(e,n)}),N4=re("ZodBase64URL",(e,n)=>{nk.init(e,n),Rt.init(e,n)}),j4=re("ZodE164",(e,n)=>{ak.init(e,n),Rt.init(e,n)}),R4=re("ZodJWT",(e,n)=>{ik.init(e,n),Rt.init(e,n)}),Ex=re("ZodNumber",(e,n)=>{fx.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(s,l,c)=>kT(e,s,l),al(e,"ZodNumber",{gt(s,l){return this.check(gb(s,l))},gte(s,l){return this.check(Yd(s,l))},min(s,l){return this.check(Yd(s,l))},lt(s,l){return this.check(mb(s,l))},lte(s,l){return this.check(Qd(s,l))},max(s,l){return this.check(Qd(s,l))},int(s){return this.check(xb(s))},safe(s){return this.check(xb(s))},positive(s){return this.check(gb(0,s))},nonnegative(s){return this.check(Yd(0,s))},negative(s){return this.check(mb(0,s))},nonpositive(s){return this.check(Qd(0,s))},multipleOf(s,l){return this.check(yb(s,l))},step(s,l){return this.check(yb(s,l))},finite(){return this}});const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Pe(e){return nT(Ex,e)}const C4=re("ZodNumberFormat",(e,n)=>{sk.init(e,n),Ex.init(e,n)});function xb(e){return aT(C4,e)}const A4=re("ZodBoolean",(e,n)=>{ok.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>TT(e,r,s)});function $r(e){return rT(A4,e)}const O4=re("ZodUnknown",(e,n)=>{lk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>jT()});function Oh(){return iT(O4)}const z4=re("ZodNever",(e,n)=>{ck.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>NT(e,r,s)});function M4(e){return sT(z4,e)}const D4=re("ZodArray",(e,n)=>{uk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>zT(e,r,s,l),e.element=n.element,al(e,"ZodArray",{min(r,s){return this.check(iu(r,s))},nonempty(r){return this.check(iu(1,r))},max(r,s){return this.check(gx(r,s))},length(r,s){return this.check(yx(r,s))},unwrap(){return this.element}})});function Ta(e,n){return vT(D4,e,n)}const L4=re("ZodObject",(e,n)=>{dk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>MT(e,r,s,l),dt(e,"shape",()=>n.shape),al(e,"ZodObject",{keyof(){return Tx(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Oh()})},loose(){return this.clone({...this._zod.def,catchall:Oh()})},strict(){return this.clone({...this._zod.def,catchall:M4()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return A2(this,r)},safeExtend(r){return O2(this,r)},merge(r){return z2(this,r)},pick(r){return R2(this,r)},omit(r){return C2(this,r)},partial(...r){return M2(Nx,this,r[0])},required(...r){return D2(jx,this,r[0])}})});function St(e,n){const r={type:"obje)DELIM" -R"DELIM(ct",shape:e??{},...Te(n)};return new L4(r)}const _x=re("ZodUnion",(e,n)=>{px.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>DT(e,r,s,l),e.options=n.options});function B4(e,n){return new _x({type:"union",options:e,...Te(n)})}const U4=re("ZodDiscriminatedUnion",(e,n)=>{_x.init(e,n),hk.init(e,n)});function kx(e,n,r){return new U4({type:"union",options:n,discriminator:e,...Te(r)})}const $4=re("ZodIntersection",(e,n)=>{pk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>LT(e,r,s,l)});function H4(e,n){return new $4({type:"intersection",left:e,right:n})}const Sb=re("ZodRecord",(e,n)=>{mk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>BT(e,r,s,l),e.keyType=n.keyType,e.valueType=n.valueType});function P4(e,n,r){return!n||!n._zod?new Sb({type:"record",keyType:Ge(),valueType:e,...Te(n)}):new Sb({type:"record",keyType:e,valueType:n,...Te(r)})}const zh=re("ZodEnum",(e,n)=>{gk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(s,l,c)=>RT(e,s,l),e.enum=n.entries,e.options=Object.values(n.entries);const r=new Set(Object.keys(n.entries));e.extract=(s,l)=>{const c={};for(const u of s)if(r.has(u))c[u]=n.entries[u];else throw new Error(`Key ${u} not found in enum`);return new zh({...n,checks:[],...Te(l),entries:c})},e.exclude=(s,l)=>{const c={...n.entries};for(const u of s)if(r.has(u))delete c[u];else throw new Error(`Key ${u} not found in enum`);return new zh({...n,checks:[],...Te(l),entries:c})}});function Tx(e,n){const r=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new zh({type:"enum",entries:r,...Te(n)})}const Z4=re("ZodLiteral",(e,n)=>{yk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>CT(e,r,s),e.values=new Set(n.values),Object.defineProperty(e,"value",{get(){if(n.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return n.values[0]}})});function Hr(e,n){return new Z4({type:"literal",values:Array.isArray(e)?e:[e],...Te(n)})}const I4=re("ZodTransform",(e,n)=>{vk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>OT(e,r),e._zod.parse=(r,s)=>{if(s.direction==="backward")throw new K0(e.constructor.name);r.addIssue=c=>{if(typeof c=="string")r.issues.push(Vo(c,r.value,n));else{const u=c;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=e),r.issues.push(Vo(u))}};const l=n.transform(r.value,r);return l instanceof Promise?l.then(c=>(r.value=c,r.fallback=!0,r)):(r.value=l,r.fallback=!0,r)}});function q4(e){return new I4({type:"transform",transform:e})}const Nx=re("ZodOptional",(e,n)=>{mx.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>Sx(e,r,s,l),e.unwrap=()=>e._zod.def.innerType});function wb(e){return new Nx({type:"optional",innerType:e})}const F4=re("ZodExactOptional",(e,n)=>{bk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>Sx(e,r,s,l),e.unwrap=()=>e._zod.def.innerType});function Q4(e){return new F4({type:"optional",innerType:e})}const Y4=re("ZodNullable",(e,n)=>{xk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>UT(e,r,s,l),e.unwrap=()=>e._zod.def.innerType});function Eb(e){return new Y4({type:"nullable",innerType:e})}const V4=re("ZodDefault",(e,n)=>{Sk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>HT(e,r,s,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function G4(e,n){return new V4({type:"default",innerType:e,get defaultValue(){return typeof n=="function"?n():W0(n)}})}const K4=re("ZodPrefault",(e,n)=>{wk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>PT(e,r,s,l),e.unwrap=()=>e._zod.def.innerType});function X4(e,n){return new K4({type:"prefault",innerType:e,get defaultValue(){return typeof n=="function"?n():W0(n)}})}const jx=re("ZodNonOptional",(e,n)=>{Ek.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>$T(e,r,s,l),e.unwrap=()=>e._zod.def.innerType});function J4(e,n){return new jx({type:"nonoptional",innerType:e,...Te(n)})}const W4=re("ZodCatch",(e,n)=>{_k.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>ZT(e,r,s,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function eN(e,n){return new W4({type:"catch",innerType:e,catchValue:typeof n=="function"?n:()=>n})}const tN=re("ZodPipe",(e,n)=>{kk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>IT(e,r,s,l),e.in=n.in,e.out=n.out});function _b(e,n){return new tN({type:"pipe",in:e,out:n})}const nN=re("ZodReadonly",(e,n)=>{Tk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>qT(e,r,s,l),e.unwrap=()=>e._zod.def.innerType});function aN(e){return new nN({type:"readonly",innerType:e})}const rN=re("ZodCustom",(e,n)=>{Nk.init(e,n),jt.init(e,n),e._zod.processJSONSchema=(r,s,l)=>AT(e,r)});function iN(e,n={}){return bT(rN,e,n)}function sN(e,n){return xT(e,n)}function tr(e){if(!e)return;const n=e.trim();if(!n)return;const r=n.toLowerCase(),s=r.indexOf("1");if(s>0){const u=r.slice(0,s);if(["bc","tb","bcrt","ltc","sb"].includes(u)){const f=r.slice(s+1);if(!f)return;const h=f.charAt(0);return h==="p"?"p2tr":h==="q"?f.length===39||f.length===40||e.length===42?"p2wpkh":f.length===59||f.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const l=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(n)&&n.length>=26&&n.length<=35;switch(r[0]){case"1":case"m":case"n":return l?"p2pkh":void 0;case"3":case"2":return l?"p2sh":void 0;default:return}}class mp extends Error{constructor(n,r){super(n),this.status=r}status}const Mh=St({id:Ge(),height:Pe(),timestamp:Pe().optional(),mediantime:Pe().optional(),tx_count:Pe().optional(),size:Pe().optional(),weight:Pe().optional(),difficulty:Pe().optional(),bits:Pe().optional(),merkle_root:Ge().optional(),previousblockhash:Ge().nullable().optional(),nonce:Pe().optional(),version:Pe().optional()}).loose(),Rx=St({confirmed:$r(),block_height:Pe().optional(),block_hash:Ge().optional(),block_time:Pe().optional()}),oN=St({txid:Ge().optional().nullable(),vout:Pe().optional().nullable(),sequence:Pe().optional(),scriptsig:Ge().optional().nullable(),scriptsig_asm:Ge().optional().nullable(),witness:Ta(Ge()).optional(),is_coinbase:$r().optional(),prevout:St({scriptpubkey_type:Ge().optional(),scriptpubkey_address:Ge().optional(),scriptpubkey:Ge().optional(),scriptpubkey_asm:Ge().optional(),value:Pe().optional()}).partial().nullable().optional()}).loose(),lN=St({scriptpubkey_type:Ge().optional(),scriptpubkey_address:Ge().optional(),scriptpubkey:Ge().optional(),scriptpubkey_asm:Ge().optional(),value:Pe(),n:Pe().optional()}).loose(),Fc=St({txid:Ge(),hash:Ge().optional(),fee:Pe().optional(),version:Pe(),locktime:Pe(),vin:Ta(oN),vout:Ta(lN),size:Pe(),weight:Pe(),status:Rx}).loose(),gp=Ta(Mh),ou=Ta(Fc),Vd=St({in_best_chain:$r(),next_best:Ge().optional(),height:Pe().optional()}),cN=St({id:Ge().regex(/^[0-9a-f]{64}$/iu),mediantime:Pe().int().nonnegative().max(4294967295).optional()}),kb=St({address:Ge(),chain_stats:St({funded_txo_count:Pe().optional(),funded_txo_sum:Pe().optional(),spent_txo_count:Pe().optional(),spent_txo_sum:Pe().optional(),tx_count:Pe().optional()}),mempool_stats:St({funded_txo_count:Pe().optional(),funded_txo_sum:Pe().optional(),spent_txo_count:Pe().optional(),spent_txo_sum:Pe().optional(),tx_count:Pe().optional()})}),uN=St({txid:Ge(),vout:Pe().int().nonnegative(),value:Pe().nonnegative(),status:Rx}).loose(),fN=Ta(uN),dN=kx("spent",[St({spent:Hr(!1)}),St({spent:Hr(!0),txid:Ge().regex(/^[0-9a-f]{64}$/iu),vin:Pe().int().nonnegative().max(4294967295)})]);async function It(e,n,r){const s=n.startsWith("/")?n:`/${n}`,l=await fetch(`${e}${s}`);if(!l.ok)throw new mp(`Request to ${n} failed with status ${String(l.status)}`,l.status);const c=await l.json();return r.parse(c)}async function Tb(e,n,r){if(r<=0)return[];const s=[];let l=n;for(;l&&s.lengthc.scriptpubkey_address===e?l+c.value:l,0),s=n.vin.reduce((l,c)=>{const u=c.prevout;return u?.scriptpubkey_address===e&&typeof u.value=="number"?l+u.value:l},0);return r-s}async function Gd(e,n){if(n==="latest"||n==="tip"){const r=await It(e,"/blocks",gp);if(r.length===0)throw new Error("No blocks returned from API");return r[0].id}if(/^\d+$/.test(n)){const r=await fetch(`${e}/block-height/${n}`);if(!r.ok)throw new mp("Unable to resolve block height",r.status);return(await r.text()).trim()}return n}async function jb(e,n,r){if(r.lastKnownHeight==null||n>=r.lastKnownHeight)return null;const s=n+1;try{const l=await fetch(`${e}/block-height/${String(s)}`);return l.ok&&(await l.text()).trim()||null}catch(l){return console.warn(`Failed to resolve hash for height ${String(s)}`,l),null}}function ko(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function Kd(e,n){const r=e.status.confirmed?"confirmed":"unconfirmed",s=e.vin.map((h,g)=>{const v=h.is_coinbase||h.txid==null?void 0:typeof h.vout=="number"&&h.vout!==4294967295?h.vout:void 0;return{index:g,prevTxId:h.txid??void 0,prevOutputIndex:v,address:h.prevout?.scriptpubkey_address??void 0,valueSats:h.prevout?.value,scriptType:h.prevout?.scriptpubkey_type,isCoinbase:h.is_coinbase??!1,script:typeof h.scriptsig=="string"||h.scriptsig_asm?{hex:h.scriptsig??void 0,mnemonic:h.scriptsig_asm??void 0}:void 0,witness:h.witness??void 0,sequence:h.sequence}}),l=e.vout.map((h,g)=>({index:g,address:h.scriptpubkey_address??void 0,valueSats:h.value,scriptType:h.scriptpubkey_type,spent:void 0,script:typeof h.scriptpubkey=="string"||h.scriptpubkey_asm?{hex:h.scriptpubkey??void 0,mnemonic:h.scriptpubkey_asm??void 0}:void 0})),c=l.reduce((h,g)=>h+g.valueSats,0),u=n.lastKnownHeight;let f=0;return e.status.block_height&&r==="confirmed"&&(f=u&&u>=e.status.block_height?u-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:r,confirmations:f,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:c,inputs:s,outputs:l}}function pN(e,n){const r=e.chain_stats,s=e.mempool_stats,l=(r.funded_txo_sum??0)-(r.spent_txo_sum??0),c=Cx(e.address,n.slice(0,25));return{address:e.address,addressType:tr(e.address),balance:l,totalReceived:(r.funded_txo_sum??0)+(s.funded_txo_sum??0),totalSent:(r.spent_txo_sum??0)+(s.spent_txo_sum??0),txCount:(r.tx_count??0)+(s.tx_count??0),utxoCount:(r.funded_txo_count??0)-(r.spent_txo_count??0),transactions:c}}function mN(e){const n=e.chain_stats,r=e.mempool_stats,s=(n.funded_txo_sum??0)-(n.spent_txo_sum??0);return{address:e.address,addressType:tr(e.address),balance:s,totalReceived:(n.funded_txo_sum??0)+(r.funded_txo_sum??0),totalSent:(n.spent_txo_sum??0)+(r.spent_txo_sum??0),txCount:(n.tx_count??0)+(r.tx_count??0),utxoCount:(n.funded_txo_count??0)-(n.spent_txo_count??0)}}function Cx(e,n){return n.map(r=>({txid:r.txid,timestamp:r.status.block_time,valueChange:hN(e,r),blockHeight:r.status.block_height}))}async function Rb(e,n,r=0){const s=r>0?`/block/${n}/txs/${String(r)}`:`/block/${n}/txs`;return It(e,s,ou)}async function gN(e,n,r){return r?It(e,`/address/${n}/txs/chain/${r}`,ou):It(e,`/address/${n}/txs`,ou)}function Ax({baseUrl:e}){const n=new Set;let r=null;const s={lastBlockHash:null,lastKnownHeight:null};async function l(f){const h=await It(e,`/tx/${f}`,Fc);return await(h.status.block_height?ls(e,s,h.status.block_height):ls(e,s)),Kd(h,s)}function c(){r||n.size===0||(r=setInterval(async()=>{try{const f=await It(e,"/blocks",gp);if(f.length===0)return;const h=f[0];if(h.id!==s.lastBlockHash){s.lastBlockHash=h.id,s.lastKnownHeight=Math.max(h.height,s.lastKnownHeight??0);const g=ko(h);for(const v of n)v({type:"block.new",payload:g})}}catch(f){console.warn("Block polling failed",f)}},15e3))}function u(){r&&(clearInterval(r),r=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(f=10){const h=await Tb(e,"/blocks",f);return h.length>0&&(s.lastBlockHash=h[0].id,s.lastKnownHeight=Math.max(h[0].height,s.lastKnownHeight??0)),h.map(g=>ko(g))},async getBlocksBefore(f,h=10){const g=Math.max(f,0),v=await Tb(e,`/blocks/${String(g)}`,h);return v.length>0&&(s.lastKnownHeight=Math.max(v[0].height,s.lastKnownHeight??0)),v.map(y=>ko(y))},async getBlockHeader(f){const h=await Gd(e,f);await ls(e,s);const[g,v]=await Promise.all([It(e,`/block/${h}`,Mh),It(e,`/block/${h}/status`,Vd).catch(()=>null)]),y=ko(g);s.lastBlockHash=y.hash,s.lastKnownHeight=Math.max(y.height,s.lastKnownHeight??y.height);let x=v?.next_best??null;return x||(x=await jb(e,y.height,s)),{...y,merkleRoot:g.merkle_root,nonce:g.nonce,bits:g.bits,version:g.version,nextBlockHash:x}},async getBlockValidation(f){const[h,g]=await Promise.all([It(e,`/block/${f}`,cN),It(e,`/block/${f}/status`,Vd)]);if(h.id.toLowerCase()!==f.toLowerCase())throw new Error("Block validation response does not match the requested block");return{medianTimePast:h.mediantime,inBestChain:g.in_best_chain}},getBlockStats(f){return Promise.resolve({})},async getBlock(f){const h=await Gd(e,f);await ls(e,s);const g=await It(e,`/block/${h}`,Mh),[v,y]=await Promise.allSettled([Rb(e,h),It(e,`/block/${h}/status`,Vd)]);v.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",v.reason),y.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",y.reason);const x=ko(g);s.lastBlockHash=x.hash,s.lastKnownHeight=Math.max(x.height,s.lastKnownHeight??x.height);const S=v.status==="fulfilled"?v.value:[];let C=(y.status==="fulfilled"?y.value:null)?.next_best??null;return C||(C=await jb(e,x.height,s)),{...x,merkleRoot:g.merkle_root,nonce:g.nonce,bits:g.bits,version:g.version,nextBlockHash:C,transactions:S.map(Q=>Kd(Q,s))}},async getBlockTransactions(f,h=0){const g=await Gd(e,f),v=await Rb(e,g,h),y=v.reduce((x,S)=>S.status.block_height?x===null?S.status.block_height:Math.max(x,S.status.block_height):x,null);return await(typeof y=="number"?ls(e,s,y):ls(e,s)),v.map(x=>Kd(x,s))},async getTransactionHeader(f){return l(f)},async getTransaction(f){return l(f)},async getTransactionInputScriptHex(f,h){const g=await It(e,`/tx/${f}`,Fc);if(h<0||h>=g.vin.length)throw new RangeError(`Input index ${String(h)} not found`);const y=g.vin[h].scriptsig;return typeof y=="string"?y:""},async getTransactionOutputScriptHex(f,h){const g=await It(e,`/tx/${f}`,Fc);if(h<0||h>=g.vout.length)throw new RangeError(`Output index ${String(h)} not found`);const y=g.vout[h].scriptpubkey;if(typeof y!="string")throw new TypeError("Output script missing in provider response");return y},async getTransactionOutputSpends(f,h){if(h.length===0)return[];const g=await It(e,`/tx/${f}/outspends`,Ta(Oh()));return h.map(v=>{const y=dN.safeParse(g[v]);return y.success?y.data.spent?{outputIndex:v,status:"spent",txid:y.data.txid.toLowerCase(),inputIndex:y.data.vin}:{outputIndex:v,status:"unspent"}:{outputIndex:v,status:"unknown"}})},async getAddressSummary(f){const h=await It(e,`/address/${f}`,kb);return mN(h)},async getAddressUtxos(f){return(await It(e,`/address/${f}/utxo`,fN)).map(g=>({txid:g.txid,outputIndex:g.vout,valueSats:g.value,status:g.status.confirmed)DELIM" -R"DELIM(?"confirmed":"unconfirmed",blockHeight:g.status.block_height,blockHash:g.status.block_hash,timestamp:g.status.block_time}))},async getAddress(f){const h=await It(e,`/address/${f}`,kb),g=await It(e,`/address/${f}/txs`,ou);return pN(h,g)},async getAddressTransactions(f,h){const g=await gN(e,f,h);return Cx(f,g)},subscribeToEvents(f){return n.add(f),c(),()=>{n.delete(f),n.size===0&&u()}}}}function yN({baseUrl:e}){const n=Ax({baseUrl:e});return{...n,metadata:{...n.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}function Go(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Ox(e,n){return Array.isArray(n)?n.length===0?!0:e?n.every(r=>typeof r=="string"):n.every(r=>Number.isSafeInteger(r)):!1}function yp(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function Ko(e,n){if(typeof n!="string")throw new TypeError(`${e}: string expected`);return!0}function rl(e){if(typeof e!="number")throw new TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`invalid integer: ${e}`)}function lu(e){if(!Array.isArray(e))throw new TypeError("array expected")}function zx(e,n){if(!Ox(!0,n))throw new TypeError(`${e}: array of strings expected`)}function vp(e,n){if(!Ox(!1,n))throw new TypeError(`${e}: array of numbers expected`)}function bp(...e){const n=c=>c,r=(c,u)=>f=>c(u(f)),s=e.map(c=>c.encode).reduceRight(r,n),l=e.map(c=>c.decode).reduce(r,n);return{encode:s,decode:l}}function Mx(e){const n=typeof e=="string"?e.split(""):e,r=n.length;zx("alphabet",n);const s=new Map(n.map((l,c)=>[l,c]));return{encode:l=>(lu(l),l.map(c=>{if(!Number.isSafeInteger(c)||c<0||c>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${c}". Allowed: ${e}`);return n[c]})),decode:l=>(lu(l),l.map(c=>{Ko("alphabet.decode",c);const u=s.get(c);if(u===void 0)throw new Error(`Unknown letter: "${c}". Allowed: ${e}`);return u}))}}function Dx(e=""){return Ko("join",e),{encode:n=>(zx("join.decode",n),n.join(e)),decode:n=>(Ko("join.decode",n),n.split(e))}}function Cb(e,n,r){if(n<2)throw new RangeError(`convertRadix: invalid from=${n}, base cannot be less than 2`);if(r<2)throw new RangeError(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(lu(e),!e.length)return[];let s=0;const l=[],c=Array.from(e,f=>{if(rl(f),f<0||f>=n)throw new Error(`invalid integer: ${f}`);return f}),u=c.length;for(;;){let f=0,h=!0;for(let g=s;gn===0?e:Lx(n,e%n),cu=(e,n)=>e+(n-Lx(e,n)),Qc=(()=>{let e=[];for(let n=0;n<40;n++)e.push(2**n);return e})();function Dh(e,n,r,s){if(lu(e),n<=0||n>32)throw new RangeError(`convertRadix2: wrong from=${n}`);if(r<=0||r>32)throw new RangeError(`convertRadix2: wrong to=${r}`);if(cu(n,r)>32)throw new Error(`convertRadix2: carry overflow from=${n} to=${r} carryBits=${cu(n,r)}`);let l=0,c=0;const u=Qc[n],f=Qc[r]-1,h=[];for(const g of e){if(rl(g),g>=u)throw new Error(`convertRadix2: invalid data word=${g} from=${n}`);if(l=l<32)throw new Error(`convertRadix2: carry overflow pos=${c} from=${n}`);for(c+=n;c>=r;c-=r)h.push((l>>c-r&f)>>>0);const v=Qc[c];if(v===void 0)throw new Error("invalid carry");l&=v-1}if(l=l<=n)throw new Error("Excess padding");if(!s&&l>0)throw new Error(`Non-zero padding: ${l}`);return s&&c>0&&h.push(l>>>0),h}function vN(e){rl(e);const n=2**8;return{encode:r=>{if(!Go(r))throw new TypeError("radix.encode input should be Uint8Array");return Cb(Array.from(r),n,e)},decode:r=>(vp("radix.decode",r),Uint8Array.from(Cb(r,e,n)))}}function bN(e,n=!1){if(rl(e),e<=0||e>32)throw new RangeError("radix2: bits should be in (0..32]");if(cu(8,e)>32||cu(e,8)>32)throw new RangeError("radix2: carry overflow");return{encode:r=>{if(!Go(r))throw new TypeError("radix2.encode input should be Uint8Array");return Dh(Array.from(r),8,e,!n)},decode:r=>(vp("radix2.decode",r),Uint8Array.from(Dh(r,e,8,n)))}}function Ab(e){return yp(e),function(...n){try{return e.apply(null,n)}catch{}}}function xN(e,n){if(rl(e),e<=0)throw new RangeError(`checksum length must be positive: ${e}`);yp(n);const r=n;return{encode(s){if(!Go(s))throw new TypeError("checksum.encode: input should be Uint8Array");const l=r(s).slice(0,e),c=new Uint8Array(s.length+e);return c.set(s),c.set(l,s.length),c},decode(s){if(!Go(s))throw new TypeError("checksum.decode: input should be Uint8Array");const l=s.slice(0,-e),c=s.slice(-e),u=r(l).slice(0,e);for(let f=0;fbp(vN(58),Mx(e),Dx("")),wN=Object.freeze(SN("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),EN=e=>{yp(e);const n=e;return bp(xN(4,r=>n(n(r))),wN)},Lh=bp(Mx("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Dx("")),Ob=[996825010,642813549,513874426,1027748829,705979059];function To(e){const n=e>>25;let r=(e&33554431)<<5;for(let s=0;s>s&1)===1&&(r^=Ob[s]);return r}function zb(e,n,r=1){const s=e.length;let l=1;for(let c=0;c126)throw new Error(`Invalid prefix (${e})`);l=To(l)^u>>5}l=To(l);for(let c=0;cS)throw new TypeError(`Length ${C} exceeds limit ${S}`);const T=y.toLowerCase(),Q=zb(T,x,n);return`${T}1${Lh.encode(x)}${Q}`}function f(y,x=90){Ko("bech32.decode input",y);const S=y.length;if(S<8||x!==!1&&S>x)throw new TypeError(`invalid string length: ${S} (${y}). Expected (8..${x})`);const k=y.toLowerCase();if(y!==k&&y!==y.toUpperCase())throw new Error("String must be lowercase or uppercase");const C=k.lastIndexOf("1");if(C===0||C===-1)throw new Error('Letter "1" must be present between prefix and data only');const T=k.slice(0,C),Q=k.slice(C+1);if(Q.length<6)throw new Error("Data must be at least 6 characters long");const I=Lh.decode(Q).slice(0,-6),K=zb(T,I,n);if(!Q.endsWith(K))throw new Error(`Invalid checksum in ${y}: expected "${K}"`);return{prefix:T,words:I}}const h=Ab(f);function g(y){const{prefix:x,words:S}=f(y,!1);return{prefix:x,words:S,bytes:s(S)}}function v(y,x){return u(y,l(x))}return{encode:u,decode:f,encodeFromBytes:v,decodeToBytes:g,decodeUnsafe:h,fromWords:s,fromWordsUnsafe:c,toWords:l}}const uu=Object.freeze(Bx("bech32")),Bh=Object.freeze(Bx("bech32m"));function _N(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function xp(e,n,r=""){const s=_N(e),l=e?.length;if(!s||n!==void 0){const u=r&&`"${r}" `,f="",h=s?`length=${l}`:`type=${typeof e}`,g=u+"expected Uint8Array"+f+", got "+h;throw s?new RangeError(g):new TypeError(g)}return e}function Mb(e,n=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(n&&e.finished)throw new Error("Hash#digest() has already been called")}function kN(e,n){xp(e,void 0,"digestInto() output");const r=n.outputLen;if(e.length='+r)}function Uh(...e){for(let n=0;n>>n}const TN=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Arra)DELIM" -R"DELIM(y.fromHex=="function",NN=Array.from({length:256},(e,n)=>n.toString(16).padStart(2,"0"));function Yc(e){if(xp(e),TN)return e.toHex();let n="";for(let r=0;re(c).update(l).digest(),s=e(void 0);return r.outputLen=s.outputLen,r.blockLen=s.blockLen,r.canXOF=s.canXOF,r.create=l=>e(l),Object.assign(r,n),Object.freeze(r)}const RN=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function CN(e,n,r){return e&n^~e&r}function AN(e,n,r){return e&n^e&r^n&r}class ON{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(n,r,s,l){this.blockLen=n,this.outputLen=r,this.padOffset=s,this.isLE=l,this.buffer=new Uint8Array(n),this.view=Xd(this.buffer)}update(n){Mb(this),xp(n);const{view:r,buffer:s,blockLen:l}=this,c=n.length;for(let u=0;ul-u&&(this.process(s,0),u=0);for(let y=u;yv.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y>>3,C=xa(S,17)^xa(S,19)^S>>>10;zr[y]=C+zr[y-7]+k+zr[y-16]|0}let{A:s,B:l,C:c,D:u,E:f,F:h,G:g,H:v}=this;for(let y=0;y<64;y++){const x=xa(f,6)^xa(f,11)^xa(f,25),S=v+x+CN(f,h,g)+zN[y]+zr[y]|0,C=(xa(s,2)^xa(s,13)^xa(s,22))+AN(s,l,c)|0;v=g,g=h,h=f,f=u+S|0,u=c,c=l,l=s,s=S+C|0}s=s+this.A|0,l=l+this.B|0,c=c+this.C|0,u=u+this.D|0,f=f+this.E|0,h=h+this.F|0,g=g+this.G|0,v=v+this.H|0,this.set(s,l,c,u,f,h,g,v)}roundClean(){Uh(zr)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),Uh(this.buffer)}}class DN extends MN{A=Or[0]|0;B=Or[1]|0;C=Or[2]|0;D=Or[3]|0;E=Or[4]|0;F=Or[5]|0;G=Or[6]|0;H=Or[7]|0;constructor(){super(32)}}const Ux=jN(()=>new DN,RN(1)),$x=EN(Ux),LN=0x00000000ffff0000000000000000000000000000000000000000000000000000n;function Sp(e){if(e.length%2!==0)throw new Error("Invalid hex string");const n=new Uint8Array(e.length/2);for(let r=0;r>>24,r=e&8388607;if(r===0||n<3)return;const s=BigInt(r)*(1n<r[1]);return n.length>0?n:[e]}function wp(e){const n=e.toLowerCase();if(n.includes("dup hash160")&&n.includes("equalverify checksig"))return"p2pkh";if(n.startsWith("hash160")&&n.includes("equal"))return"p2sh";if(n.startsWith("zero [")){const s=n.match(/zero \[([0-9a-f]+)\]/)?.[1]??"";return s.length===40?"p2wpkh":s.length===64?"p2wsh":"segwit"}if(n.startsWith("1 ["))return"p2tr"}function js(){return"mainnet"}function Rs(e){return e==="testnet"||e==="regtest"?{p2pkh:111,p2sh:196,hrp:e==="regtest"?"bcrt":"tb"}:{p2pkh:0,p2sh:5,hrp:"bc"}}function Db(e,n){const r=new Uint8Array(n.length/2+1);return r[0]=e,r.set(Sp(n),1),$x.encode(r)}function Jd(e,n,r){const s=Sp(r),l=uu.toWords(s);return l.unshift(n),(n===0?uu:Bh).encode(e,l)}function Hx(e,n){const r=e.toLowerCase(),s=r.match(/dup hash160 \[([0-9a-f]{40})\] equalverify checksig/);if(s)return{address:Db(n.p2pkh,s[1]),type:"p2pkh"};const l=r.match(/^hash160 \[([0-9a-f]{40})\] equal$/);if(l)return{address:Db(n.p2sh,l[1]),type:"p2sh"};const c=r.match(/^zero \[([0-9a-f]{40})\]/);if(c)return{address:Jd(n.hrp,0,c[1]),type:"p2wpkh"};const u=r.match(/^zero \[([0-9a-f]{64})\]/);if(u)return{address:Jd(n.hrp,0,u[1]),type:"p2wsh"};const f=r.match(/^1 \[([0-9a-f]{64})\]/);return f?{address:Jd(n.hrp,1,f[1]),type:"p2tr"}:{type:wp(e)}}function $N(e,n){try{const l=$x.decode(e),c=l[0],u=Yc(l.slice(1));if(u.length===40&&c===n.p2pkh)return{scriptHex:`76a914${u}88ac`,type:"p2pkh"};if(u.length===40&&c===n.p2sh)return{scriptHex:`a914${u}87`,type:"p2sh"}}catch{}const r=e.toLowerCase();if(r.indexOf("1")>0&&r.startsWith(`${n.hrp}1`)){const l=r,c=h=>{try{return h.decode(l,90)}catch{return null}},u=c(uu);if(u&&u.prefix===n.hrp){const h=u.words[0],g=uu.fromWords(u.words.slice(1)),v=Yc(g),y=g.length.toString(16).padStart(2,"0");if(h===0&&(g.length===20||g.length===32))return{scriptHex:`00${y}${v}`,type:g.length===20?"p2wpkh":"p2wsh"}}const f=c(Bh);if(f&&f.prefix===n.hrp){const h=f.words[0],g=Bh.fromWords(f.words.slice(1)),v=Yc(g),y=g.length.toString(16).padStart(2,"0");if(h===1&&g.length===32)return{scriptHex:`51${y}${v}`,type:"p2tr"}}}return null}function _a(e,n){const r=e.toLowerCase();if(/^[0-9a-f]{64}$/.test(r))return{hash:r,type:"script-hash"};const s=$N(e,n);if(!s)return null;const l=Ux(Sp(s.scriptHex)),c=Uint8Array.from(l).reverse();return{hash:Yc(c),type:s.type}}function Vc(e,n){return{hash:e.hash,height:e.height,timestamp:e.timestamp,txCount:n,size:void 0,weight:void 0,difficulty:BN(e.bits),previousBlockHash:e.previous}}function HN(e){const n=UN(e);return n&&n.length>0?n:void 0}function PN(e,n,r,s){const l=/^0{64}$/u.test(e.point.hash),c=n?Hx(n.script,r):{address:void 0,type:void 0},u=n?n.value:void 0,f=n?n.script:void 0;return{index:s,prevTxId:l?void 0:e.point.hash,prevOutputIndex:l?void 0:e.point.index,address:c.address,valueSats:u,scriptType:c.type??wp(f??e.script),isCoinbase:l,script:e.script===""?{hex:""}:{mnemonic:e.script},witness:HN(e.witness),sequence:e.sequence}}function ZN(e,n,r){const s=Hx(e.script,r);return{index:n,address:s.address,valueSats:e.value,scriptType:s.type??wp(e.script),spent:void 0,script:e.script===""?{hex:""}:{mnemonic:e.script}}}function IN(e,n){return typeof e!="number"||typeof n!="number"?0:Math.max(0,e-n+1)}function zc(e,n,r,s,l){const c=e.outputs.map((v,y)=>ZN(v,y,r)),u=c.reduce((v,y)=>v+y.valueSats,0),f=n.reduce((v,y)=>y?(v??0)+y.value:v,null),h=IN(s.tipHeight,s.blockHeight),g=typeof s.blockHeight=="number"?"confirmed":"unconfirmed";return{txid:e.hash,hash:e.hash,status:g,confirmations:h,blockHeight:s.blockHeight,blockHash:s.blockHash,receivedTime:s.timestamp,feeSats:Number.isFinite(l)?)DELIM" -R"DELIM(l:void 0,feeRate:null,size:void 0,weight:void 0,version:e.version,locktime:e.locktime,totalInput:f,totalOutput:u,inputs:e.inputs.map((v,y)=>PN(v,n[y],r,y)),outputs:c}}const Mc=25,$o=8,qN="/v1/top/subscribe?format=json",FN="/v1/top/subscribe?format=json&stop=true",QN=5e3,YN=2500,Wd=5e3,VN=3e5,GN=St({hash:Ge().regex(/^[0-9a-f]{64}$/iu),mtp:Pe().int().nonnegative().max(4294967295).optional(),state:St({validated:$r().optional(),confirmed:$r().optional(),confirmable:$r().optional(),unconfirmable:$r().optional()}).optional(),forks:P4(Ge(),$r()).optional()}),Lb=5e3,No=new Map,eh=new Map;class Eu extends Error{constructor(n,r){super(n),this.status=r,this.name="LibbitcoinApiError"}status}const fu={address:!0,filter:!1,turbo:!0,witness:!0,retarget:!1,difficult:!1};function KN(e){if(!e||typeof e!="object"||Array.isArray(e))return fu;const n=e,r=s=>typeof n[s]=="boolean"?n[s]:fu[s];return{address:r("address"),filter:r("filter"),turbo:r("turbo"),witness:r("witness"),retarget:r("retarget"),difficult:r("difficult")}}function zo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e.state;if(!r||typeof r!="object"||Array.isArray(r))return null;const s=r,l=typeof s.count=="number"?s.count:void 0,c=typeof s.size=="number"?s.size:void 0,u=typeof s.weight=="number"?s.weight:void 0;return l===void 0&&c===void 0&&u===void 0?null:{count:l,size:c,weight:u}}function Gc(e){return e?.weight??e?.size}function XN(e,n){return!Number.isFinite(e)||!Number.isFinite(n)||n<=0?null:e/n*4}function Dc(e,n){if(!n)return e;const r=typeof n.fee=="number"?n.fee:void 0,s=typeof n.weight=="number"?n.weight:void 0,l=typeof r=="number"&&typeof s=="number"?XN(r,s):e.feeRate;return{...e,wtxid:n.wtxid||e.wtxid,feeSats:typeof n.fee=="number"?n.fee:e.feeSats,feeRate:l,size:typeof n.maximal=="number"?n.maximal:e.size,weight:typeof n.weight=="number"?n.weight:e.weight,sigops:typeof n.confirmed?.sigops=="number"?n.confirmed.sigops:e.sigops,totalInput:typeof n.value=="number"?n.value:e.totalInput,totalOutput:typeof n.spend=="number"?n.spend:e.totalOutput}}async function nn(e,n,r){const s=n.startsWith("/")?n:`/${n}`;let l=s.includes("?")?`${e}${s}`:`${e}${s}?format=json`;r&&(l+=l.includes("?")?"&turbo=true":"?turbo=true");const c=eh.get(l);if(c)return c;const u=(async()=>{const f=await fetch(l,{headers:{Accept:"application/json"}});if(!f.ok){const g=await f.text().catch(()=>"");throw new Eu(`Request failed ${String(f.status)}: ${g||f.statusText}`,f.status)}const h=await f.text();if(/[?&]format=text(?:&|$)/u.test(s))return h;try{return JSON.parse(h)}catch{return h}})();eh.set(l,u);try{return await u}finally{eh.delete(l)}}async function tn(e,n,r){try{return await nn(e,n,r)}catch{return null}}async function Px(e,n,r){try{return await nn(e,n,r)}catch(s){if(s instanceof Eu&&s.status===404)return null;throw s}}async function Zx(e,n){const r=await nn(e,"/v1/top?format=json",n),s=typeof r=="number"?r:Number(r);if(!Number.isFinite(s))throw new Error("Invalid top height");return s}function Ix(e){return/^[0-9a-f]{64}$/iu.test(e)}function JN(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:typeof e=="string"&&/^\d+$/u.test(e.trim())?Number(e.trim()):null}function $h(e){const n=JN(e);if(n!==null)return n;if(typeof e=="string"){const l=e.trim();return Ix(l)?l:null}if(!e||typeof e!="object"||Array.isArray(e))return null;const r=e,s=[r.payload,r.top,r.block,r.header,r.hash,r.height];for(const l of s){if(l===e)continue;const c=$h(l);if(c!==null)return c}return null}function WN(e){return typeof e=="string"?Promise.resolve(e):e instanceof ArrayBuffer?Promise.resolve(new TextDecoder().decode(e)):e instanceof Blob?e.text():Promise.resolve(null)}function ej(e){const n=e.trim();if(!n)return null;try{return $h(JSON.parse(n))}catch{return $h(n)}}function tj(e){const n=e.trim();if(!n)return null;const s=/^[a-z][a-z\d+\-.]*:\/\//iu.test(n)?n:`http://${n}`,l=globalThis.window;try{const c=new URL(s,l?.location.href??"http://localhost");if(c.protocol==="http:")c.protocol="ws:";else if(c.protocol==="https:")c.protocol="wss:";else if(c.protocol!=="ws:"&&c.protocol!=="wss:")return null;return c.hash="",c.search="",c.toString()}catch{return null}}async function pi(e,n){const r=Date.now(),s=`${e}|0`,l=No.get(s);if(l&&l.expiresAt>r)return l.promise;const c=Zx(e,n).then(u=>(No.set(s,{promise:c,value:u,expiresAt:Date.now()+Lb}),u),u=>{throw No.get(s)?.promise===c&&No.delete(s),u});return No.set(s,{promise:c,value:l?.value??null,expiresAt:r+Lb}),c}async function Lc(e,n,r){if(n==="latest"||n==="tip"){const s=await pi(e,r);return{path:`/v1/block/height/${String(s)}`,height:s}}return/^\d+$/u.test(n)?{path:`/v1/block/height/${n}`}:{path:`/v1/block/hash/${n}`}}function nj(e,n){const r=new Map;return(s,l)=>{const c=`${s}:${String(l)}`,u=r.get(c);if(u)return u;const f=nn(e,`/v1/output/${s}/${String(l)}?format=json`,n).catch(()=>null);return r.set(c,f),f}}async function aj(e,n,r,s){return nn(e,`${n}/tx/${String(r)}?format=json`,s)}async function Bb(e,n,r,s){const l=await vi(r,$o,async u=>{try{return await aj(e,n,u)}catch(f){if(s&&f instanceof Eu&&f.status===404)return null;throw f}}),c=l.indexOf(null);if(c===-1)return l.filter(u=>u!==null);if(l.slice(c+1).some(u=>u!==null))throw new Error("Libbitcoin returned a non-contiguous block transaction page");return l.slice(0,c).filter(u=>u!==null)}async function Ub(e,n){return vi(n,$o,async r=>{const[s,l]=await Promise.all([nn(e,`/v1/block/height/${String(r)}/header?format=json`),tn(e,`/v1/block/height/${String(r)}/header/context?format=json`)]),c=zo(l);return{...Vc(s,c?.count),size:Gc(c)}})}function qx(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function Fx(e){return qx(e)?typeof e.hash=="string"&&e.hash.length>0&&typeof e.index=="number"&&Number.isInteger(e.index)&&e.index>=0:!1}function Qx(e,n){if(!Array.isArray(e)||!e.every(r=>qx(r)&&Fx(r.point)&&typeof r.value=="number"&&Number.isFinite(r.value)&&r.value>=0))throw new TypeError(`Invalid response from ${n}`);return e}async function rj(e,n,r){const s=`/v1/address/${n}/confirmed?format=json`,l=await Px(e,s,r);return l===null?[]:Qx(l,s)}async function ij(e,n,r){const s=`/v1/address/${n}?format=json`,l=await Px(e,s,r);return l===null?[]:Qx(l,s)}const $b=25,Yx=8,Hb=3e4;function sj(e){if(e===void 0)return 0;const n=Number(e);return Number.isInteger(n)&&n>0?n:0}async function Vx(e,n,r){const s=`/v1/output/${n}/${String(r)}/spender?format=json`;let l;try{l=await nn(e,s)}catch(c){if(c instanceof Eu&&c.status===404)return null;throw c}if(!Fx(l))throw new TypeError(`Invalid response from ${s}`);return l}async function vi(e,n,r){const s=Array.from({length:e.length});let l=0;async function c(){for(;lc())),s}async function oj(e,n,r){const s=await vi(n,Yx,c=>Vx(e,c.point.hash,c.point.index)),l=[];for(const[c,u]of n.entries()){const{hash:f,index:h}=u.point,g=s[c];l.push({id:`in:${f}:${String(h)}`,txid:f,outputIndex:h,valueChange:u.value,direction:"received",spent:g!==null,...r===null?{}:{cursor:r}}),g&&l.push({id:`out:${f}:${String(h)}`,txid:g.hash,valueChange:-u.value,direction:"sent",...r===null?{}:{cursor:r}})}return l}function Pb(e,n){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const s=Number(e);if(Number.isFinite(s))return s}let r=0;for(const s of n)r+=s.value;return r}function th({baseUrl:e,pollIntervalMs:n=15e3,turbo:r=!1}){const s=new Set,l=new Set;let c=null,u=null,f=null,h=null,g=null,v=Wd,y=!1,x=!1,S="idle",k=null,C=null;const T=Rs(js());let Q=null,I=null;const K=tj(e),oe=!!(K&&globalThis.WebSocket),J=new Map,ge=new Map;async function O(ee,ye){const te=Date.now(),pe=J.get(ee);if(pe&&pe.expiresAt>te)return pe.outputs;const he=await ij(e,ee,ye);return J.set(ee,{outputs:he,expiresAt:te+Hb}),he}async function _(ee,ye){const te=Date.now(),pe=ge.get(ee);if(pe&&pe.expiresAt>te)return pe.request;const he=rj(e,ee,ye);ge.set(ee,{request:he,expiresAt:te+Hb});try{return awa)DELIM" -R"DELIM(it he}catch(Ne){throw ge.get(ee)?.request===he&&ge.delete(ee),Ne}}async function M(ee,ye,te){const pe=await O(ee,ye),he=sj(te),Ne=pe.slice(he,he+$b),$e=he+$b,nt=$e{const ye=KN(ee);return Q=ye,ye}).catch(ee=>(console.warn("Libbitcoin configuration fetch failed",ee),Q=fu,fu)),I)}function P(ee){return ee.address}function U(ee){return P(ee)&&ee.turbo}function fe(){return{transport:S,websocketAvailable:oe&&!y}}function de(ee){if(S===ee)return;S=ee;const ye=fe();for(const te of l)te(ye)}async function me(ee){const ye=typeof ee=="number"?`/v1/block/height/${String(ee)}`:`/v1/block/hash/${ee}`,[te,pe]=await Promise.all([nn(e,`${ye}/header?format=json`),tn(e,`${ye}/header/context?format=json`)]);if(C===te.hash||k!==null&&te.heightk&&await me(ee)}catch(ee){console.warn("Libbitcoin poller failed",ee)}}function N(){s.size!==0&&(c||(c=setInterval(()=>{z()},n)),de("polling"))}function ae(){c&&(clearInterval(c),c=null)}function X(){f&&(clearTimeout(f),f=null)}function ve(){h&&(clearTimeout(h),h=null)}function j(){g&&(clearTimeout(g),g=null)}function Y(){if(g||!oe||s.size===0)return;const ee=v;v=Math.min(v*2,VN),g=setTimeout(()=>{g=null,!(u||s.size===0)&&(y=!1,ne())},ee)}function V(){y=!0,le(!1),N(),Y()}function le(ee){if(X(),!!u){x=!0;try{ee&&u.readyState===1&&u.send(FN),u.close()}catch{}finally{u=null}}}function ne(){if(ve(),u)return!0;if(!oe||!K||y||s.size===0)return!1;try{x=!1,u=new WebSocket(K),de("connecting")}catch(ye){return console.warn("Libbitcoin websocket unavailable, falling back to polling",ye),V(),!1}const ee=u;return f=setTimeout(()=>{u===ee&&(console.warn("Libbitcoin websocket connect timed out, falling back to polling"),V())},QN),ee.addEventListener("open",()=>{if(u===ee){X();try{ee.send(qN),ae(),y=!1,v=Wd,de("websocket")}catch(ye){console.warn("Libbitcoin websocket subscribe failed, falling back to polling",ye),V()}}}),ee.addEventListener("message",ye=>{(async()=>{try{const te=await WN(ye.data);if(te===null)return;const pe=ej(te);if(pe===null)return;await me(pe)}catch(te){console.warn("Libbitcoin websocket event handling failed",te)}})()}),ee.addEventListener("error",ye=>{x||u!==ee||(console.warn("Libbitcoin websocket failed, falling back to polling",ye),V())}),ee.addEventListener("close",()=>{if(!(u!==null&&u!==ee)){if(X(),u===ee&&(u=null),x){x=!1;return}s.size!==0&&V()}}),!0}function be(){ne()||(N(),Y())}function Oe(){ve(),j(),v=Wd,y=!1,ae(),le(!0),de("idle")}function wt(){s.size>0||h||(h=setTimeout(()=>{h=null,s.size===0&&Oe()},YN))}return{metadata:{id:"libbitcoin",label:"Server",type:"local",connectionState:"connected",supportsWebsocket:oe,endpoint:e,description:"Adapter for the libbitcoin embedded REST API."},getConfiguration(){return $()},async getLatestBlocks(ee=10){const ye=await pi(e);k=ye;const te=Array.from({length:ee},(he,Ne)=>ye-Ne).filter(he=>he>=0),pe=await Ub(e,te);return pe.length>0&&(C=pe[0].hash),pe},async getBlocksBefore(ee,ye=10){const te=Array.from({length:ye},(pe,he)=>ee-he).filter(pe=>pe>=0);return Ub(e,te)},async getBlockHeader(ee){const{path:ye,height:te}=await Lc(e,ee),pe=te===void 0?pi(e):Promise.resolve(te),[he,Ne,$e]=await Promise.all([nn(e,`${ye}/header?format=json`),pe,tn(e,`${ye}/header/context?format=json`)]);k=Math.max(k??0,Ne);let nt=null;he.heightCa),Tn=await Bb(e,ye,Ct,typeof Ke!="number"),zt=await vi(Tn,$o,gn=>tn(e,`/v1/tx/${gn.hash}/details?format=json`)),aa=Tn.map((gn,Ca)=>{const Hn=zt[Ca],Nn=zc(gn,[],T,{blockHeight:he.height,blockHash:he.hash,tipHeight:Ne,timestamp:he.timestamp},typeof Hn?.fee=="number"?Hn.fee:void 0);return Dc(Nn,Hn)});return{...Je,size:nt?.maximal??Gc(Ze),weight:nt?.weight,merkleRoot:he.merkle_root,nonce:he.nonce,bits:he.bits,version:he.version,nextBlockHash:Tt,feesSats:nt?.fees,subsidySats:nt?.subsidy,sigops:nt?.sigops,transactions:aa}},async getBlockTransactions(ee,ye=0){const{path:te}=await Lc(e,ee),[pe,he,Ne]=await Promise.all([nn(e,`${te}/header?format=json`),pi(e),tn(e,`${te}/header/context?format=json`)]);k=Math.max(k??0,he);const $e=zo(Ne)?.count;if(typeof $e=="number"&&ye>=$e)return[];const nt=typeof $e=="number"?Math.min(ye+Mc,$e):ye+Mc,Tt=Array.from({length:Math.max(0,nt-ye)},(Je,st)=>ye+st),Ze=await Bb(e,te,Tt,typeof $e!="number");if(Ze.length===0)return[];const Ke=await vi(Ze,$o,Je=>tn(e,`/v1/tx/${Je.hash}/details?format=json`));return Ze.map((Je,st)=>{const Ct=Ke[st],Tn=zc(Je,[],T,{blockHeight:pe.height,blockHash:pe.hash,tipHeight:he,timestamp:pe.timestamp},typeof Ct?.fee=="number"?Ct.fee:void 0);return Dc(Tn,Ct)})},async getTransaction(ee){const ye=await nn(e,`/v1/tx/${ee}?format=json`),te=nj(e),pe=vi(ye.inputs,$o,Ze=>/^0{64}$/u.test(Ze.point.hash)?Promise.resolve(null):te(Ze.point.hash,Ze.point.index)),[he,Ne,$e,nt]=await Promise.all([tn(e,`/v1/tx/${ee}/header?format=json`),pi(e).catch(()=>null),tn(e,`/v1/tx/${ee}/details?format=json`),pe]);typeof Ne=="number"&&(k=Math.max(k??0,Ne));const Tt=zc(ye,nt,T,{blockHeight:he?.height,blockHash:he?.hash,tipHeight:typeof Ne=="number"?Ne:void 0,timestamp:he?.timestamp},typeof $e?.fee=="number"?$e.fee:void 0);return Dc(Tt,$e)},async getTransactionHeader(ee){const ye=await nn(e,`/v1/tx/${ee}?format=json`),[te,pe,he]=await Promise.all([tn(e,`/v1/tx/${ee}/header?format=json`),pi(e).catch(()=>null),tn(e,`/v1/tx/${ee}/details?format=json`)]);typeof pe=="number"&&(k=Math.max(k??0,pe));const Ne=zc(ye,[],T,{blockHeight:te?.height,blockHash:te?.hash,tipHeight:typeof pe=="number"?pe:void 0,timestamp:te?.timestamp},typeof he?.fee=="number"?he.fee:void 0);return Dc(Ne,he)},async getTransactionInputScriptHex(ee,ye){return(await nn(e,`/v1/input/${ee}/${String(ye)}/script?format=text`)).trim()},async getTransactionOutputScriptHex(ee,ye){return(await nn(e,`/v1/output/${ee}/${String(ye)}/script?format=text`)).trim()},getTransactionOutputSpends(ee,ye){return vi(ye,Yx,async te=>{try{const pe=await Vx(e,ee,te);return pe===null?{outputIndex:te,status:"unspent"}:!Ix(pe.hash)||pe.index>4294967295?{outputIndex:te,status:"unknown"}:{outputIndex:te,status:"spent",txid:pe.hash.toLowerCase(),inputIndex:pe.index}}catch{return{outputIndex:te,status:"unknown"}}})},async getAddress(ee){const ye=_a(ee,T);if(!ye)throw new Error("Unsupported address format for libbitcoin adapter");const te=Q??await $();if(!P(te))throw new Error("A)DELIM" -R"DELIM(ddress endpoints are disabled by server configuration");const pe=r&&U(te),[he,Ne]=await Promise.all([tn(e,`/v1/address/${ye.hash}/balance?format=json`,pe),_(ye.hash,pe)]),$e=Pb(he,Ne),nt=await M(ye.hash,pe);return{address:ee,addressType:ye.type,balance:$e,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ne.length,transactions:nt}},async getAddressSummary(ee){const ye=_a(ee,T);if(!ye)throw new Error("Unsupported address format for libbitcoin adapter");const te=Q??await $();if(!P(te))throw new Error("Address endpoints are disabled by server configuration");const pe=r&&U(te),[he,Ne]=await Promise.all([tn(e,`/v1/address/${ye.hash}/balance?format=json`,pe),_(ye.hash,pe)]),$e=Pb(he,Ne);return{address:ee,addressType:ye.type,balance:$e,totalReceived:void 0,totalSent:void 0,txCount:void 0,utxoCount:Ne.length}},async getAddressUtxos(ee){const ye=_a(ee,T);if(!ye)throw new Error("Unsupported address format for libbitcoin adapter");const te=Q??await $();if(!P(te))throw new Error("Address endpoints are disabled by server configuration");const pe=r&&U(te);return(await _(ye.hash,pe)).map(Ne=>({txid:Ne.point.hash,outputIndex:Ne.point.index,valueSats:Ne.value,status:"confirmed"}))},async getAddressTransactions(ee,ye){const te=_a(ee,T);if(!te)return[];const pe=Q??await $();if(!P(pe))return[];const he=r&&U(pe);return M(te.hash,he,ye)},subscribeToEvents(ee){return ve(),s.add(ee),be(),()=>{s.delete(ee),wt()}},getEventStatus:fe,subscribeToEventStatus(ee){return l.add(ee),ee(fe()),()=>{l.delete(ee)}}}}const Gx=E.createContext(null),Kx=E.createContext(null),Xx=E.createContext(null);function lj({children:e,client:n}){return m.jsx(Gx.Provider,{value:n,children:e})}function cj({children:e,provider:n,setProvider:r,availableProviders:s,selectorVisible:l,setSelectorVisible:c}){return m.jsx(Kx.Provider,{value:{provider:n,setProvider:r,availableProviders:s,selectorVisible:l,setSelectorVisible:c},children:e})}function uj({children:e,turbo:n,setTurbo:r}){return m.jsx(Xx.Provider,{value:{turbo:n,setTurbo:r},children:e})}function rr(){const e=E.useContext(Gx);if(!e)throw new Error("BlockchainClientProvider missing in component tree");return e}function Vr(){return rr().metadata}function Ep(){const e=E.useContext(Kx);if(!e)throw new Error("ProviderSwitcherProvider missing in component tree");return e}function Jx(){const e=E.useContext(Xx);if(!e)throw new Error("TurboProvider missing in component tree");return e}function nh(){const e=globalThis.window;return e?.location.origin?e.location.origin:"http://localhost:8180"}function Wx(e,n){if(e==="blockstream")return Ax({baseUrl:"https://blockstream.info/api"});if(e==="mempool")return yN({baseUrl:"https://mempool.space/api"});if(e==="libbitcoin"){const s=nh();return th({baseUrl:s,turbo:n?.turboEnabled})}if(e==="external"){console.warn("No external API URL provided, falling back to libbitcoin provider");const s=nh();return th({baseUrl:s,turbo:n?.turboEnabled})}console.warn(`Unknown provider "${e}", falling back to libbitcoin provider`);const r=nh();return th({baseUrl:r,turbo:n?.turboEnabled})}function fj(){return[...new Set(["libbitcoin","blockstream","mempool"])]}const ah=10,dj=20;function e1(e){return e.metadata.endpoint?{providerId:e.metadata.id,endpoint:e.metadata.endpoint}:{providerId:e.metadata.id}}function t1(e,n){if(!e||typeof e!="object"||Array.isArray(e))return!1;const r=e;return r.providerId===n.providerId&&r.endpoint===n.endpoint}function Zb(e){return JSON.stringify([e.providerId,e.endpoint??null])}function hj(e,n){if(!e||typeof e!="object"||Array.isArray(e))return n;const r=e.limit;return typeof r=="number"&&Number.isFinite(r)&&r>0?r:n}function pj(e,n,r){const s=e.getQueryCache().findAll({predicate:l=>{const c=l.queryKey;return c.length>=4&&t1(c[0],n)&&c[1]==="blocks"&&c[2]==="latest"}});for(const l of s){const c=hj(l.queryKey[3],ah);e.setQueryData(l.queryKey,u=>[r,...(u??[]).filter(g=>g.hash!==r.hash)].slice(0,c))}e.setQueryData([n,"blocks","latest",{limit:ah}],l=>[r,...(l??[]).filter(f=>f.hash!==r.hash)].slice(0,ah))}function mj(e,n,r){e.setQueryData([n,"transactions","recent"],s=>[r,...(s??[]).filter(u=>u.txid!==r.txid)].slice(0,dj))}function gj(e,n){if(!t1(e.queryKey[0],n))return!1;const r=e.meta;if(r?.blockRefresh==="always")return!0;if(r?.blockRefresh!=="while-unconfirmed")return!1;const s=e.state.data;return!s||typeof s!="object"||Array.isArray(s)?!0:s.status!=="confirmed"}function yj(e,n){return e.invalidateQueries({predicate:r=>gj(r,n),refetchType:"active"})}function vj(e,n,r){r.type==="block.new"&&pj(e,n,r.payload),r.type==="tx.new"&&mj(e,n,r.payload)}function pn({queryKey:e,queryFn:n,enabled:r,retry:s,staleTime:l,initialData:c,blockRefresh:u}){const f=rr();return w2({queryKey:[e1(f),...e],queryFn:()=>n(f),enabled:r,...s===void 0?{}:{retry:s},staleTime:l,initialData:c,meta:u?{blockRefresh:u}:void 0})}function n1(e=10){return pn({queryKey:["blocks","latest",{limit:e}],queryFn:n=>n.getLatestBlocks(e)})}function a1(){return pn({queryKey:["configuration"],queryFn:e=>e.getConfiguration(),staleTime:6e4})}function _p(e,n){return pn({queryKey:["block",e,"header"],queryFn:r=>r.getBlockHeader(e),enabled:(n?.enabled??!0)&&!!e.trim(),retry:n?.retry})}function r1(e,n){return pn({queryKey:["block",e,"stats"],queryFn:r=>r.getBlockStats(e),enabled:(n?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function bj(e,n){return pn({queryKey:["block",e,"validation"],queryFn:r=>r.getBlockValidation(e),enabled:(n?.enabled??!0)&&!!e.trim(),blockRefresh:"always"})}function xj(e,n=0){return pn({queryKey:["block",e,"transactions",{startIndex:n}],queryFn:r=>r.getBlockTransactions(e,n)})}function i1(e,n){return pn({queryKey:["transaction",e,"header"],queryFn:r=>r.getTransactionHeader(e),enabled:(n?.enabled??!0)&&!!e.trim(),retry:n?.retry,blockRefresh:"while-unconfirmed"})}function Sj(e,n){return pn({queryKey:["transaction",e],queryFn:r=>r.getTransaction(e),enabled:n?.enabled??!!e.trim(),blockRefresh:"while-unconfirmed"})}function wj(e,n,r){return pn({queryKey:["transaction",e,"input",n,"scriptHex"],queryFn:s=>s.getTransactionInputScriptHex(e,n),enabled:(r?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function Ej(e,n,r){return pn({queryKey:["transaction",e,"output",n,"scriptHex"],queryFn:s=>s.getTransactionOutputScriptHex(e,n),enabled:(r?.enabled??!0)&&!!e.trim(),staleTime:1/0})}function _j(e){return pn({queryKey:["address",e,"summary"],queryFn:n=>n.getAddressSummary(e),enabled:!!e.trim(),blockRefresh:"always"})}function kj(e,n){return pn({queryKey:["transaction",e,"outputSpends",n],queryFn:r=>r.getTransactionOutputSpends(e,n),enabled:!!e.trim()&&n.length>0,blockRefresh:"always"})}function Tj(e){return pn({queryKey:["address",e,"utxos"],queryFn:n=>n.getAddressUtxos(e),enabled:!!e.trim(),blockRefresh:"always"})}function Nj(e,n){return pn({queryKey:["address",e,"transactions",{lastSeenTxid:null}],queryFn:r=>r.getAddressTransactions(e,n),enabled:!!e.trim(),blockRefresh:"always"})}function jj(e){const n=rr(),r=E.useRef(e);E.useEffect(()=>{r.current=e},[e]),E.useEffect(()=>{const s=n.subscribeToEvents(l=>{r.current(l)});return()=>{s()}},[n])}function Rj(){const e=rr(),n=E.useMemo(()=>({transport:e.metadata.supportsWebsocket?"websocket":"polling",websocketAvailable:e.metadata.supportsWebsocket}),[e.metadata.supportsWebsocket]),[r,s]=E.useState(()=>e.getEventStatus?e.getEventStatus():n);return E.useEffect(()=>{const l=e.getEventStatus?e.getEventStatus():n;return s(l),e.subscribeToEventStatus?.(s)},[e,n]),r}function Cj(){const e=rr(),n=E.useMemo(()=>e1(e),[e]),r=V0(),s=E.useRef(new Map),l=E.useRef(new Map),c=E.useCallback(f=>{const h=Zb(f);let g=l.current.get(h);if(g||(g={dirty:!1,running:null},l.current.set(h,g)),g.dirty=!0,g.running)return;const v=async()=>{for(;g.dirty;)g.dirty=!1,await yj(r,f)};g.running=v().finally(()=>{g.running=null,g.dirty||l.current.delete(h)})},[r]),u=E.useCallback(f=>{if(vj(r,n,f),f.type!=="block.new")return;const h=Zb(n);s.current.get(h)!==f.payload.hash&&(s.current.set(h,f.payload.hash),c(n))},[r,n,c]);return jj(u),null}functio)DELIM" -R"DELIM(n Aj(e=10){const{data:n,isLoading:r,isError:s,error:l}=n1(e),{data:c=[]}=pn({queryKey:["transactions","recent"],queryFn:()=>Promise.resolve([]),enabled:!1,initialData:[]});return{data:n,recentTransactions:c,isLoading:r,isError:s,error:l}}const Ib="scriptExplainerEnabled",s1=E.createContext(null);function Oj({children:e}){const[n,r]=E.useState(()=>{try{return globalThis.localStorage.getItem(Ib)==="true"}catch{return!1}});return E.useEffect(()=>{try{globalThis.localStorage.setItem(Ib,String(n))}catch{}},[n]),m.jsx(s1.Provider,{value:{enabled:n,setEnabled:r},children:e})}function kp(){const e=E.useContext(s1);if(!e)throw new Error("ScriptExplainerPreferenceProvider missing in component tree");return e}function Na(){return"/v1"}function Xo(){return"/v1/block"}function du(){return"/v1/investigations"}function Gt(e){return`/v1/block/hash/${encodeURIComponent(e)}`}function o1(e){return`${Gt(e)}/header/context`}function il(e){return`/v1/block/height/${encodeURIComponent(String(e))}`}function ka(e){return`/v1/tx/${encodeURIComponent(e)}`}function l1(e,n){return`${ka(e)}#input-${String(n)}`}function sl(e,n){return`${ka(e)}#output-${String(n)}`}function xi(e){return`/v1/address/${encodeURIComponent(e)}`}function Hh(e){return`/v1/search?q=${encodeURIComponent(e)}`}const Ph="savedInvestigations",ol="bookmarks",Bc=Ge().regex(/^[0-9a-f]{64}$/iu).transform(e=>e.toLowerCase()),qb=Ge().regex(/^[a-z0-9]+$/iu).max(120).refine(e=>/^[0-9a-f]{64}$/iu.test(e)||!!tr(e),"Invalid address or script hash").transform(e=>/^[0-9a-f]{64}$/iu.test(e)||/^(bc1|tb1|bcrt1)/iu.test(e)?e.toLowerCase():e),Fb=Pe().int().min(0).max(4294967295),hu=Pe().int().nonnegative().max(Number.MAX_SAFE_INTEGER),Zh=Ge().min(1).max(100),c1=kx("kind",[St({kind:Hr("block"),hash:Bc,height:Pe().int().nonnegative().optional()}),St({kind:Hr("transaction"),txid:Bc}),St({kind:Hr("address"),address:qb,displayAddress:qb.optional()}),St({kind:Hr("input"),txid:Bc,index:Fb}),St({kind:Hr("output"),txid:Bc,index:Fb})]),zj=St({providerId:Ge().min(1).max(80),endpoint:Ge().max(2048).transform(e=>e.replace(/\/+$/u,"")),network:Tx(["mainnet","testnet","regtest"]).optional()}),Mj=St({id:Zh,name:Ge().trim().min(1).max(80),notes:Ge().max(5e3),createdAt:hu,updatedAt:hu}),Dj=St({id:Zh,investigationId:Zh,target:c1,source:zj,label:Ge().trim().min(1).max(120),notes:Ge().max(5e3),createdAt:hu,updatedAt:hu}),Lj=St({version:Hr(1),investigations:Ta(Mj).min(1).max(200),bookmarks:Ta(Dj).max(5e3)});function Ho(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),e=>e.toString(16).padStart(2,"0")).join("")}function u1(){return{version:1,investigations:[{id:ol,name:"Bookmarks",notes:"",createdAt:Date.now(),updatedAt:Date.now()}],bookmarks:[]}}function Tp(e){return{providerId:e.id,endpoint:(e.endpoint??"").replace(/\/+$/u,""),...e.id==="libbitcoin"?{network:js()}:{}}}function Mo(e){return JSON.stringify([e.providerId,e.endpoint,e.network??""])}function f1(e){switch(e.kind){case"block":return Gt(e.hash);case"transaction":return ka(e.txid);case"address":return xi(e.address);case"input":return l1(e.txid,e.index);case"output":return sl(e.txid,e.index)}}function Pr(e,n){return JSON.stringify([Mo(n),f1(e)])}function Ih(e){return e.kind==="block"?e.hash:e.kind==="address"?e.displayAddress??e.address:e.kind==="transaction"?e.txid:`${e.txid}:${String(e.index)}`}function Bj(e){if(e.kind==="block"&&e.height!==void 0)return`Block #${String(e.height)}`;const n=Ih(e);return`${e.kind[0].toUpperCase()}${e.kind.slice(1)} ${n.slice(0,12)}…${n.slice(-8)}`}function qh(e){if(e.length>1e7)throw new Error("Investigation data exceeds the 10 MB limit.");const n=Lj.safeParse(JSON.parse(e));if(!n.success)throw new Error("Invalid saved investigations data or unsupported version.");const r=n.data,s=new Set(r.investigations.map(u=>u.id)),l=new Set(r.bookmarks.map(u=>u.id)),c=new Set(r.bookmarks.map(u=>JSON.stringify([u.investigationId,Pr(u.target,u.source)])));if(!s.has(ol)||s.size!==r.investigations.length||l.size!==r.bookmarks.length||c.size!==r.bookmarks.length||r.bookmarks.some(u=>!s.has(u.investigationId)))throw new Error("Saved investigations contain duplicate or missing references.");return r}function Uj(e,n){const r=new Map(n.investigations.map(s=>[s.id,Ho()]));return{version:1,investigations:[...e.investigations,...n.investigations.map(s=>({...s,id:r.get(s.id)??"",name:`${s.name.slice(0,69)} (imported)`}))],bookmarks:[...e.bookmarks,...n.bookmarks.map(s=>({...s,id:Ho(),investigationId:r.get(s.investigationId)??""}))]}}function Fh(){const e=globalThis.localStorage.getItem(Ph);return e?qh(e):u1()}function Qb(){try{return{data:Fh(),error:null}}catch{return{data:u1(),error:"Saved investigations could not be read. Existing storage has been left untouched."}}}function $j(){const[e,n]=E.useState(Qb),[r,s]=E.useState(e.error),l=E.useMemo(()=>{const f=new Map;for(const h of e.data.bookmarks){const g=Pr(h.target,h.source),v=f.get(g)??[];v.push(h),f.set(g,v)}return f},[e.data.bookmarks]),c=E.useCallback(f=>{try{const h=qh(JSON.stringify(f(Fh())));return globalThis.localStorage.setItem(Ph,JSON.stringify(h)),n({data:h,error:null}),s(null),!0}catch(h){return s(h instanceof Error?`Could not save: ${h.message}`:"Could not save investigations. Browser storage may be unavailable or full."),!1}},[]);E.useEffect(()=>{const f=h=>{if(h.key!==Ph&&h.key!==null)return;const g=Qb();n(g),s(g.error)};return globalThis.addEventListener("storage",f),()=>{globalThis.removeEventListener("storage",f)}},[]);const u=f=>c(h=>{const g=Date.now(),v=f.newInvestigationName?Ho():f.investigationId,y=f.newInvestigationName?[...h.investigations,{id:v,name:f.newInvestigationName,notes:"",createdAt:g,updatedAt:g}]:h.investigations,x=Pr(f.target,f.source),S=h.bookmarks.find(C=>C.investigationId===v&&Pr(C.target,C.source)===x),k={id:S?.id??Ho(),investigationId:v,target:f.target,source:f.source,label:f.label,notes:f.notes,createdAt:S?.createdAt??g,updatedAt:g};return{...h,investigations:y,bookmarks:S?h.bookmarks.map(C=>C.id===S.id?k:C):[k,...h.bookmarks]}});return{data:e.data,bookmarksByTarget:l,error:r,saveBookmark:u,createInvestigation:f=>{const h=Ho();return c(g=>({...g,investigations:[...g.investigations,{id:h,name:f,notes:"",createdAt:Date.now(),updatedAt:Date.now()}]}))?h:null},updateInvestigation:(f,h,g)=>c(v=>({...v,investigations:v.investigations.map(y=>y.id===f?{...y,name:h,notes:g,updatedAt:Date.now()}:y)})),deleteInvestigation:f=>c(h=>f===ol?h:{...h,investigations:h.investigations.filter(g=>g.id!==f),bookmarks:h.bookmarks.filter(g=>g.investigationId!==f)}),updateBookmark:(f,h,g,v)=>c(y=>{const x=y.bookmarks.find(S=>S.id===f);if(!x)throw new Error("This bookmark no longer exists.");if(y.bookmarks.some(S=>S.id!==f&&S.investigationId===v&&Pr(S.target,S.source)===Pr(x.target,x.source)))throw new Error("This item is already saved in that investigation. Its existing notes were preserved.");return{...y,bookmarks:y.bookmarks.map(S=>S.id===f?{...S,label:h,notes:g,investigationId:v,updatedAt:Date.now()}:S)}}),removeBookmark:f=>c(h=>({...h,bookmarks:h.bookmarks.filter(g=>g.id!==f)})),importData:f=>c(h=>Uj(h,qh(f))),exportData:()=>{try{return JSON.stringify(Fh(),null,2)}catch{return s("Could not read investigations for export. Existing storage has been left untouched."),null}}}}const d1=E.createContext(null);function Hj({children:e}){const n=$j();return m.jsx(d1.Provider,{value:n,children:e})}function Cs(){const e=E.useContext(d1);if(!e)throw new Error("SavedInvestigationsProvider missing in component tree");return e}function rh(e){return globalThis.window?.localStorage.getItem(e)??null}function ih(e,n){globalThis.window?.localStorage.setItem(e,n)}function Pj({children:e}){const n="libbitcoin",r=fj(),[s,l]=E.useState(()=>rh("turboEnabled")==="true"),[c,u]=E.useState(()=>{const y=rh("blockchainProvider");return y&&r.includes(y)?y:n}),[f,h]=E.useState(()=>rh("providerSelectorVisible")==="true"),[g]=E.useState(()=>new c2({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1,retry:1}}})),v=E.)DELIM" -R"DELIM(useMemo(()=>Wx(c,{turboEnabled:s}),[c,s]);return E.useEffect(()=>{ih("turboEnabled",s?"true":"false")},[s]),E.useEffect(()=>{ih("blockchainProvider",c)},[c]),E.useEffect(()=>{ih("providerSelectorVisible",f?"true":"false")},[f]),m.jsx(cj,{provider:c,setProvider:u,availableProviders:r,selectorVisible:f,setSelectorVisible:h,children:m.jsx(uj,{turbo:s,setTurbo:l,children:m.jsx(lj,{client:v,children:m.jsxs(u2,{client:g,children:[m.jsx(Cj,{}),m.jsx(Hj,{children:m.jsx(Oj,{children:e})}),null]})})})})}var h1=e=>{throw TypeError(e)},p1=(e,n,r)=>n.has(e)||h1("Cannot "+r),Xn=(e,n,r)=>(p1(e,n,"read from private field"),r?r.call(e):n.get(e)),Do=(e,n,r)=>n.has(e)?h1("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,r),Sa=(e,n,r,s)=>(p1(e,n,"write to private field"),n.set(e,r),r),_u=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Np=/^[\\/]{2}/;function m1(e,n){return n+e.replace(/\\/g,"/")}var g1=(e=>(e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE",e))(g1||{}),Yb="popstate";function Vb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Zj(e={}){function n(s,l){let c=l.state?.masked,{pathname:u,search:f,hash:h}=c||s.location;return Jo("",{pathname:u,search:f,hash:h},l.state&&l.state.usr||null,l.state&&l.state.key||"default",c?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function r(s,l){return typeof l=="string"?l:ja(l)}return qj(n,r,null,e)}function Le(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function _t(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Ij(){return Math.random().toString(36).substring(2,10)}function Gb(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Jo(e,n,r=null,s,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?Ra(n):n,state:r,key:n&&n.key||s||Ij(),mask:l}}function ja({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ra(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let s=e.indexOf("?");s>=0&&(n.search=e.substring(s),e=e.substring(0,s)),e&&(n.pathname=e)}return n}function qj(e,n,r,s={}){let{window:l=document.defaultView,v5Compat:c=!1}=s,u=l.history,f="POP",h=null,g=v();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function v(){return(u.state||{idx:null}).idx}function y(){f="POP";let T=v(),Q=T==null?null:T-g;g=T,h&&h({action:f,location:C.location,delta:Q})}function x(T,Q){f="PUSH";let I=Vb(T)?T:Jo(C.location,T,Q);g=v()+1;let K=Gb(I,g),oe=C.createHref(I.mask||I);try{u.pushState(K,"",oe)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;l.location.assign(oe)}c&&h&&h({action:f,location:C.location,delta:1})}function S(T,Q){f="REPLACE";let I=Vb(T)?T:Jo(C.location,T,Q);g=v();let K=Gb(I,g),oe=C.createHref(I.mask||I);u.replaceState(K,"",oe),c&&h&&h({action:f,location:C.location,delta:0})}function k(T){return y1(l,T)}let C={get action(){return f},get location(){return e(l,u)},listen(T){if(h)throw new Error("A history only accepts one active listener");return l.addEventListener(Yb,y),h=T,()=>{l.removeEventListener(Yb,y),h=null}},createHref(T){return n(l,T)},createURL:k,encodeLocation(T){let Q=k(T);return{pathname:Q.pathname,search:Q.search,hash:Q.hash}},push:x,replace:S,go(T){return u.go(T)}};return C}function y1(e,n,r=!1){let s="http://localhost";e&&(s=e.location.origin!=="null"?e.location.origin:e.location.href),Le(s,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:ja(n);return l=l.replace(/ $/,"%20"),!r&&Np.test(l)&&(l=s+l),new URL(l,s)}var Lo,Kb=class{constructor(e){if(Do(this,Lo,new Map),e)for(let[n,r]of e)this.set(n,r)}get(e){if(Xn(this,Lo).has(e))return Xn(this,Lo).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,n){Xn(this,Lo).set(e,n)}};Lo=new WeakMap;var Fj=new Set(["lazy","caseSensitive","path","id","index","children"]);function Qj(e){return Fj.has(e)}var Yj=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Vj(e){return Yj.has(e)}function Gj(e){return e.index===!0}function Wo(e,n,r=[],s={},l=!1){return e.map((c,u)=>{let f=[...r,String(u)],h=typeof c.id=="string"?c.id:f.join("-");if(Le(c.index!==!0||!c.children,"Cannot specify children on an index route"),Le(l||!s[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),Gj(c)){let g={...c,id:h};return s[h]=Xb(g,n(g)),g}else{let g={...c,id:h,children:void 0};return s[h]=Xb(g,n(g)),c.children&&(g.children=Wo(c.children,n,f,s,l)),g}})}function Xb(e,n){return Object.assign(e,{...n,...typeof n.lazy=="object"&&n.lazy!=null?{lazy:{...e.lazy,...n.lazy}}:{}})}function v1(e,n,r="/"){return da(e,n,r,!1)}function da(e,n,r,s,l){let c=typeof n=="string"?Ra(n):n,u=$n(c.pathname||"/",r);if(u==null)return null;let f=l??Kc(e),h=null,g=sR(u);for(let v=0;h==null&&v{let v={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&h)return;Le(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let y=ea([s,v.relativePath]),x=r.concat(v);u.children&&u.children.length>0&&(Le(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),x1(u.children,n,x,y,h)),!(u.path==null&&!u.index)&&n.push({path:y,score:aR(y,u.index),routesMeta:x.map((S,k)=>{let[C,T]=E1(S.relativePath,S.caseSensitive,k===x.length-1);return{...S,matcher:C,compiledParams:T}})})};return e.forEach((u,f)=>{if(u.path===""||!u.path?.includes("?"))c(u,f);else for(let h of S1(u.path))c(u,f,!0,h)}),n}function S1(e){let n=e.split("/");if(n.length===0)return[];let[r,...s]=n,l=r.endsWith("?"),c=r.replace(/\?$/,"");if(s.length===0)return l?[c,""]:[c];let u=S1(s.join("/")),f=[];return f.push(...u.map(h=>h===""?c:[c,h].join("/"))),l&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function Kj(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:rR(n.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var Xj=/^:[\w-]+$/,Jj=3,Wj=2,eR=1,tR=10,nR=-2,Jb=e=>e==="*";function aR(e,n){let r=e.split("/"),s=r.length;return r.some(Jb)&&(s+=nR),n&&(s+=Wj),r.filter(l=>!Jb(l)).reduce((l,c)=>l+(Xj.test(c)?Jj:c===""?eR:tR),s)}function rR(e,n){return e.length===n.length&&e.slice(0,-1).every((s,l)=>s===n[l])?e[e.length-1]-n[n.length-1]:0}function iR(e,n,r=!1){let{routesMeta:s}=e,l={},c="/",u=[];for(let f=0;f{if(v==="*"){let k=f[x]||"";u=c.slice(0,c.length-k.length).replace(/(.)\/+$/,"$1")}const S=f[x];return y&&!S?g[v]=void 0:g[v]=(S||"").replace(/%2F/g,"/"),g},{}),pathname:c,pathnameBase:u,pattern:e}}function E1(e,n=!1,r=!0){_t(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h,g,v)=>{if(s.push({paramName:f,isOptional:h!=null}),h){let y=v.charAt(g+u.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),s]}function sR(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return _t(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function $n(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,s=e.charAt(r);return s&&s!=="/"?null:e.slice(r)||"/"}function oR({basename:e,pathname:n}){return n==="/"?e:ea([e,n])}var jp=e=>_u.test(e);function lR(e,n="/"){let{pathname:r,search:s="",hash:l=""}=typeof e=="string"?Ra(e):e,c;return r?(r=Rp(r),r.startsWith("/")?c=Wb(r.substring(1),"/"):c=Wb(r,n)):c=n,{pathname:c,search:uR(s),hash:fR(l)}}function Wb(e,n){let r=mu(n).split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function sh(e,n,r,s){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function _1(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function ku(e){let n=_1(e);return n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase)}function ll(e,n,r,s=!1){let l;typeof e=="string"?l=Ra(e):(l={...e},Le(!l.pathname||!l.pathname.includes("?"),sh("?","pathname","search",l)),Le(!l.pathname||!l.pathname.includes("#"),sh("#","pathname","hash",l)),Le(!l.search||!l.search.includes("#"),sh("#","search","hash",l)));let c=e===""||l.pathname==="",u=c?"/":l.pathname,f;if(u==null)f=r;else{let y=n.length-1;if(!s&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),y-=1;l.pathname=x.join("/")}f=y>=0?n[y]:"/"}let h=lR(l,f),g=u&&u!=="/"&&u.endsWith("/"),v=(c||u===".")&&r.endsWith("/");return!h.pathname.endsWith("/")&&(g||v)&&(h.pathname+="/"),h}var Rp=e=>e.replace(/[\\/]{2,}/g,"/"),ea=e=>Rp(e.join("/")),mu=e=>e.replace(/\/+$/,""),cR=e=>mu(e).replace(/^\/*/,"/"),uR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,fR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,dR=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],cl=class{constructor(e,n,r,s=!1){this.status=e,this.statusText=n||"",this.internal=s,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function el(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ul(e){let n=e.map(r=>r.route.path).filter(Boolean);return ea(n)||"/"}var k1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function T1(e,n){let r=e;if(typeof r!="string"||!_u.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let s=r,l=!1;if(k1)try{let c=new URL(window.location.href),u=Np.test(r)?new URL(m1(r,c.protocol)):new URL(r),f=$n(u.pathname,n);u.origin===c.origin&&f!=null?r=f+u.search+u.hash:l=!0}catch{_t(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:l,to:r}}var Ir=Symbol("Uninstrumented");function hR(e,n){let r={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(l=>l({id:n.id,index:n.index,path:n.path,instrument(c){let u=Object.keys(r);for(let f of u)c[f]&&r[f].push(c[f])}}));let s={};if(typeof n.lazy=="function"&&r.lazy.length>0){let l=gs(r.lazy,n.lazy,()=>{});l&&(s.lazy=l)}if(typeof n.lazy=="object"){let l=n.lazy;["middleware","loader","action"].forEach(c=>{let u=l[c],f=r[`lazy.${c}`];if(typeof u=="function"&&f.length>0){let h=gs(f,u,()=>{});h&&(s.lazy=Object.assign(s.lazy||{},{[c]:h}))}})}return["loader","action"].forEach(l=>{let c=n[l];if(typeof c=="function"&&r[l].length>0){let u=c[Ir]??c,f=gs(r[l],u,(...h)=>e0(h[0]));f&&(l==="loader"&&u.hydrate===!0&&(f.hydrate=!0),f[Ir]=u,s[l]=f)}}),n.middleware&&n.middleware.length>0&&r.middleware.length>0&&(s.middleware=n.middleware.map(l=>{let c=l[Ir]??l,u=gs(r.middleware,c,(...f)=>e0(f[0]));return u?(u[Ir]=c,u):l})),s}function pR(e,n){let r={navigate:[],fetch:[]};if(n.forEach(s=>s({instrument(l){let c=Object.keys(l);for(let u of c)l[u]&&r[u].push(l[u])}})),r.navigate.length>0){let s=e.navigate[Ir]??e.navigate,l=gs(r.navigate,s,(...c)=>{let[u,f]=c;return{to:typeof u=="number"||typeof u=="string"?u:u?ja(u):".",...t0(e,f??{})}});l&&(l[Ir]=s,e.navigate=l)}if(r.fetch.length>0){let s=e.fetch[Ir]??e.fetch,l=gs(r.fetch,s,(...c)=>{let[u,,f,h]=c;return{href:f??".",fetcherKey:u,...t0(e,h??{})}});l&&(l[Ir]=s,e.fetch=l)}return e}function gs(e,n,r){return e.length===0?null:async(...s)=>{let l=await N1(e,r(...s),()=>n(...s),e.length-1);if(l.type==="error")throw l.value;return l.value}}async function N1(e,n,r,s){let l=e[s],c;if(l){let u,f=async()=>(u?console.error("You cannot call instrumented handlers more than once"):u=N1(e,n,r,s-1),c=await u,Le(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await l(f,n)}catch(h){console.error("An instrumentation function threw an error:",h)}u||await f(),await u}else try{c={type:"success",value:await r()}}catch(u){c={type:"error",value:u}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function e0(e){let{request:n,context:r,params:s,pattern:l}=e;return{request:mR(n),params:{...s},pattern:l,context:gR(r)}}function t0(e,n){return{currentUrl:ja(e.state.location),..."formMethod"in n?{formMethod:n.formMethod}:{},..."formEncType"in n?{formEncType:n.formEncType}:{},..."formData"in n?{formData:n.formData}:{},..."body"in n?{body:n.body}:{}}}function mR(e){return{method:e.method,url:e.url,headers:{get:(...n)=>e.headers.get(...n)}}}function gR(e){if(vR(e)){let n={...e};return Object.freeze(n),n}else return{get:n=>e.get(n)}}var yR=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vR(e){if(e===null||typeof e!="object")return!1;const n=Object.getPrototypeOf(e);return n===Object.prototype||n===null||Object.getOwnPropertyNames(n).sort().join("\0")===yR}var j1=["POST","PUT","PATCH","DELETE"],bR=new Set(j1),xR=["GET",...j1],SR=new Set(xR),R1=new Set([301,302,303,307,308]),wR=new Set([307,308]),oh={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ER={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},jo={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},_R=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),C1="remix-router-transitions",A1=Symbol("ResetLoaderData"),mi,fs,Br,ds,kR=class{constructor(e){Do(this,mi),Do(this,fs),Do(this,Br),Do(this,ds),Sa(this,mi,e),Sa(this,fs,Kc(e))}get stableRoutes(){return Xn(this,mi)}get activeRoutes(){return Xn)DELIM" -R"DELIM((this,Br)??Xn(this,mi)}get branches(){return Xn(this,ds)??Xn(this,fs)}get hasHMRRoutes(){return Xn(this,Br)!=null}setRoutes(e){Sa(this,mi,e),Sa(this,fs,Kc(e))}setHmrRoutes(e){Sa(this,Br,e),Sa(this,ds,Kc(e))}commitHmrRoutes(){Xn(this,Br)&&(Sa(this,mi,Xn(this,Br)),Sa(this,fs,Xn(this,ds)),Sa(this,Br,void 0),Sa(this,ds,void 0))}};mi=new WeakMap;fs=new WeakMap;Br=new WeakMap;ds=new WeakMap;function TR(e){const n=e.window?e.window:typeof window<"u"?window:void 0,r=typeof n<"u"&&typeof n.document<"u"&&typeof n.document.createElement<"u";Le(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let s=e.hydrationRouteProperties||[],l=e.mapRouteProperties||_R,c=l;if(e.instrumentations){let A=e.instrumentations;c=L=>({...l(L),...hR(A.map(q=>q.route).filter(Boolean),L)})}let u={},f=new kR(Wo(e.routes,c,void 0,u)),h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let g=e.dataStrategy||AR,v={...e.future},y=null,x=new Set,S=null,k=null,C=null,T=null,Q=e.hydrationData!=null,I=da(f.activeRoutes,e.history.location,h,!1,f.branches),K=!1,oe=null,J,ge;if(I==null&&!e.patchRoutesOnNavigation){let A=Jn(404,{pathname:e.history.location.pathname}),{matches:L,route:q}=Uc(f.activeRoutes);J=!0,ge=!J,I=L,oe={[q.id]:A}}else if(I&&!e.hydrationData&&or(I,f.activeRoutes,e.history.location.pathname).active&&(I=null),I)if(I.some(A=>A.route.lazy))J=!1,ge=!J;else if(!I.some(A=>Cp(A.route)))J=!0,ge=!J;else{let A=e.hydrationData?e.hydrationData.loaderData:null,L=e.hydrationData?e.hydrationData.errors:null,q=I;if(L){let ce=I.findIndex(ue=>L[ue.route.id]!==void 0);q=q.slice(0,ce+1)}ge=!1,J=!0,q.forEach(ce=>{let ue=O1(ce.route,A,L);ge=ge||ue.renderFallback,J=J&&!ue.shouldLoad})}else{J=!1,ge=!J,I=[];let A=or(null,f.activeRoutes,e.history.location.pathname);A.active&&A.matches&&(K=!0,I=A.matches)}let O,_={historyAction:e.history.action,location:e.history.location,matches:I,initialized:J,renderFallback:ge,navigation:oh,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||oe,fetchers:new Map,blockers:new Map},M="POP",$=null,P=!1,U,fe=!1,de=new Map,me=null,z=!1,N=!1,ae=new Set,X=new Map,ve=0,j=-1,Y=new Map,V=new Set,le=new Map,ne=new Map,be=new Set,Oe=new Map,wt,ee=null;function ye(){if(y=e.history.listen(({action:A,location:L,delta:q})=>{if(wt){wt(),wt=void 0;return}_t(Oe.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ce=Kr({currentLocation:_.location,nextLocation:L,historyAction:A});if(ce&&q!=null){let ue=new Promise(Ee=>{wt=Ee});e.history.go(q*-1),Oa(ce,{state:"blocked",location:L,proceed(){Oa(ce,{state:"proceeding",proceed:void 0,reset:void 0,location:L}),ue.then(()=>e.history.go(q))},reset(){let Ee=new Map(_.blockers);Ee.set(ce,jo),he({blockers:Ee})}}),$?.resolve(),$=null;return}return Tt(A,L)}),r){KR(n,de);let A=()=>XR(n,de);n.addEventListener("pagehide",A),me=()=>n.removeEventListener("pagehide",A)}return _.initialized||Tt("POP",_.location,{initialHydration:!0}),O}function te(){y&&y(),me&&me(),x.clear(),U&&U.abort(),_.fetchers.forEach((A,L)=>Aa(_.fetchers,L)),_.blockers.forEach((A,L)=>Gr(L))}function pe(A){if(x.add(A),S){let{newErrors:L}=S;S=null,A(_,{deletedFetchers:[],newErrors:L,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(A)}function he(A,L={}){A.matches&&(A.matches=A.matches.map(ue=>{let Ee=u[ue.route.id],xe=ue.route;return xe.element!==Ee.element||xe.errorElement!==Ee.errorElement||xe.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ue,route:Ee}:ue})),_={..._,...A};let q=[],ce=[];_.fetchers.forEach((ue,Ee)=>{ue.state==="idle"&&(be.has(Ee)?q.push(Ee):ce.push(Ee))}),be.forEach(ue=>{!_.fetchers.has(ue)&&!X.has(ue)&&q.push(ue)}),x.size===0&&(S={newErrors:A.errors??null}),[...x].forEach(ue=>ue(_,{deletedFetchers:q,newErrors:A.errors??null,viewTransitionOpts:L.viewTransitionOpts,flushSync:L.flushSync===!0})),q.forEach(ue=>Aa(_.fetchers,ue)),ce.forEach(ue=>_.fetchers.delete(ue))}function Ne(A,L,{flushSync:q}={}){let ce=_.actionData!=null&&_.navigation.formMethod!=null&&ln(_.navigation.formMethod)&&_.navigation.state==="loading"&&A.state?._isRedirect!==!0,ue;L.actionData?Object.keys(L.actionData).length>0?ue=L.actionData:ue=null:ce?ue=_.actionData:ue=null;let Ee=L.loaderData?f0(_.loaderData,L.loaderData,L.matches||[],L.errors):_.loaderData,xe=_.blockers;xe.size>0&&(xe=new Map(xe),xe.forEach((Ce,Be)=>xe.set(Be,jo)));let we=z?!1:zs(A,L.matches||_.matches),Se=P===!0||_.navigation.formMethod!=null&&ln(_.navigation.formMethod)&&A.state?._isRedirect!==!0;f.commitHmrRoutes(),z||M==="POP"||(M==="PUSH"?e.history.push(A,A.state):M==="REPLACE"&&e.history.replace(A,A.state));let Re;if(M==="POP"){let Ce=de.get(_.location.pathname);Ce&&Ce.has(A.pathname)?Re={currentLocation:_.location,nextLocation:A}:de.has(A.pathname)&&(Re={currentLocation:A,nextLocation:_.location})}else if(fe){let Ce=de.get(_.location.pathname);Ce?Ce.add(A.pathname):(Ce=new Set([A.pathname]),de.set(_.location.pathname,Ce)),Re={currentLocation:_.location,nextLocation:A}}he({...L,actionData:ue,loaderData:Ee,historyAction:M,location:A,initialized:!0,renderFallback:!1,navigation:oh,revalidation:"idle",restoreScrollPosition:we,preventScrollReset:Se,blockers:xe},{viewTransitionOpts:Re,flushSync:q===!0}),M="POP",P=!1,fe=!1,z=!1,N=!1,$?.resolve(),$=null,ee?.resolve(),ee=null}async function $e(A,L){if($?.resolve(),$=null,typeof A=="number"){$||($=m0());let at=$.promise;return e.history.go(A),at}let q=Qh(_.location,_.matches,h,A,L?.fromRouteId,L?.relative),{path:ce,submission:ue,error:Ee}=n0(!1,q,L),xe;L?.mask&&(xe={pathname:"",search:"",hash:"",...typeof L.mask=="string"?Ra(L.mask):{..._.location.mask,...L.mask}});let we=_.location,Se=Jo(we,ce,L&&L.state,void 0,xe);Se={...Se,...e.history.encodeLocation(Se)};let Re=L&&L.replace!=null?L.replace:void 0,Ce="PUSH";Re===!0?Ce="REPLACE":Re===!1||ue!=null&&ln(ue.formMethod)&&ue.formAction===_.location.pathname+_.location.search&&(Ce="REPLACE");let Be=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,ze=(L&&L.flushSync)===!0,Ie=Kr({currentLocation:we,nextLocation:Se,historyAction:Ce});if(Ie){Oa(Ie,{state:"blocked",location:Se,proceed(){Oa(Ie,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),$e(A,L)},reset(){let at=new Map(_.blockers);at.set(Ie,jo),he({blockers:at})}});return}await Tt(Ce,Se,{submission:ue,pendingError:Ee,preventScrollReset:Be,replace:L&&L.replace,enableViewTransition:L&&L.viewTransition,flushSync:ze,callSiteDefaultShouldRevalidate:L&&L.defaultShouldRevalidate})}function nt(){ee||(ee=m0()),Hn(),he({revalidation:"loading"});let A=ee.promise;return _.navigation.state==="submitting"?A:_.navigation.state==="idle"?(Tt(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),A):(Tt(M||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:fe===!0}),A)}async function Tt(A,L,q){U&&U.abort(),U=null,M=A,z=(q&&q.startUninterruptedRevalidation)===!0,zu(_.location,_.matches),P=(q&&q.preventScrollReset)===!0,fe=(q&&q.enableViewTransition)===!0;let ce=f.activeRoutes,ue=q?.initialHydration&&_.matches&&_.matches.length>0&&!K?_.matches:da(ce,L,h,!1,f.branches),Ee=(q&&q.flushSync)===!0;if(ue&&_.initialized&&!N&&HR(_.location,L)&&!(q&&q.submission&&ln(q.submission.formMethod))){Ne(L,{matches:ue},{flushSync:Ee});return}let xe=or(ue,ce,L.pathname);if(xe.active&&xe.matches&&(ue=xe.matches),!ue){let{error:lt,notFoundMatches:We,route:Mt}=ra(L.pathname);Ne(L,{matches:We,loaderData:{},errors:{[Mt.id]:lt}},{flushSync:Ee});return}let we)DELIM" -R"DELIM(=q&&q.overrideNavigation?{...q.overrideNavigation,matches:ue,historyAction:A}:void 0;U=new AbortController;let Se=hs(e.history,L,U.signal,q&&q.submission),Re=e.getContext?await e.getContext():new Kb,Ce;if(q&&q.pendingError)Ce=[Zr(ue).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&ln(q.submission.formMethod)){let lt=await Ze(Se,L,q.submission,ue,A,Re,xe.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:Ee});if(lt.shortCircuited)return;if(lt.pendingActionResult){let[We,Mt]=lt.pendingActionResult;if(Bn(Mt)&&el(Mt.error)&&Mt.error.status===404){U=null,Ne(L,{matches:lt.matches,loaderData:{},errors:{[We]:Mt.error}});return}}ue=lt.matches||ue,Ce=lt.pendingActionResult,we=lh(L,ue,A,q.submission),Ee=!1,xe.active=!1,Se=hs(e.history,Se.url,Se.signal)}let{shortCircuited:Be,matches:ze,loaderData:Ie,errors:at,workingFetchers:vt}=await Ke(Se,L,ue,A,Re,xe.active,we,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Ee,Ce,q&&q.callSiteDefaultShouldRevalidate);Be||(U=null,Ne(L,{matches:ze||ue,...d0(Ce),loaderData:Ie,errors:at,...vt?{fetchers:vt}:{}}))}async function Ze(A,L,q,ce,ue,Ee,xe,we,Se={}){Hn();let Re=VR(L,ce,ue,q);if(he({navigation:Re},{flushSync:Se.flushSync===!0}),xe){let ze=await ma(ce,L.pathname,A.signal);if(ze.type==="aborted")return{shortCircuited:!0};if(ze.type==="error"){if(ze.partialMatches.length===0){let{matches:at,route:vt}=Uc(f.activeRoutes);return{matches:at,pendingActionResult:[vt.id,{type:"error",error:ze.error}]}}let Ie=Zr(ze.partialMatches).route.id;return{matches:ze.partialMatches,pendingActionResult:[Ie,{type:"error",error:ze.error}]}}else if(ze.matches)ce=ze.matches;else{let{notFoundMatches:Ie,error:at,route:vt}=ra(L.pathname);return{matches:Ie,pendingActionResult:[vt.id,{type:"error",error:at}]}}}let Ce,Be=Xc(ce,L);if(!Be.route.action&&!Be.route.lazy)Ce={type:"error",error:Jn(405,{method:A.method,pathname:L.pathname,routeId:Be.route.id})};else{let ze=bs(c,u,A,L,ce,Be,we?[]:s,Ee),Ie=await gn(A,L,ze,Ee,null);if(Ce=Ie[Be.route.id],!Ce){for(let at of ce)if(Ie[at.route.id]){Ce=Ie[at.route.id];break}}if(A.signal.aborted)return{shortCircuited:!0}}if(bi(Ce)){let ze;return Se&&Se.replace!=null?ze=Se.replace:ze=l0(Ce.response.headers.get("Location"),new URL(A.url),h,e.history)===_.location.pathname+_.location.search,await aa(A,Ce,!0,{submission:q,replace:ze}),{shortCircuited:!0}}if(Bn(Ce)){let ze=Zr(ce,Be.route.id);return(Se&&Se.replace)!==!0&&(M="PUSH"),{matches:ce,pendingActionResult:[ze.route.id,Ce,Be.route.id]}}return{matches:ce,pendingActionResult:[Be.route.id,Ce]}}async function Ke(A,L,q,ce,ue,Ee,xe,we,Se,Re,Ce,Be,ze,Ie){let at=xe||lh(L,q,ce,we),vt=we||Se||p0(at),lt=!z&&!Ce;if(Ee){if(lt){let gt=Je(ze);he({navigation:at,...gt!==void 0?{actionData:gt}:{}},{flushSync:Be})}let Me=await ma(q,L.pathname,A.signal);if(Me.type==="aborted")return{shortCircuited:!0};if(Me.type==="error"){if(Me.partialMatches.length===0){let{matches:jn,route:oa}=Uc(f.activeRoutes);return{matches:jn,loaderData:{},errors:{[oa.id]:Me.error}}}let gt=Zr(Me.partialMatches).route.id;return{matches:Me.partialMatches,loaderData:{},errors:{[gt]:Me.error}}}else if(Me.matches)q=Me.matches;else{let{error:gt,notFoundMatches:jn,route:oa}=ra(L.pathname);return{matches:jn,loaderData:{},errors:{[oa.id]:gt}}}}let We=f.activeRoutes,{dsMatches:Mt,revalidatingFetchers:et}=a0(A,ue,c,u,e.history,_,q,vt,L,Ce?[]:s,Ce===!0,N,ae,be,le,V,We,h,e.patchRoutesOnNavigation!=null,f.branches,ze,Ie);if(j=++ve,!e.dataStrategy&&!Mt.some(Me=>Me.shouldLoad)&&!Mt.some(Me=>Me.route.middleware&&Me.route.middleware.length>0)&&et.length===0){let Me=new Map(_.fetchers),gt=ml(Me);return Ne(L,{matches:q,loaderData:{},errors:ze&&Bn(ze[1])?{[ze[0]]:ze[1].error}:null,...d0(ze),...gt?{fetchers:Me}:{}},{flushSync:Be}),{shortCircuited:!0}}if(lt){let Me={};if(!Ee){Me.navigation=at;let gt=Je(ze);gt!==void 0&&(Me.actionData=gt)}et.length>0&&(Me.fetchers=st(et)),he(Me,{flushSync:Be})}et.forEach(Me=>{Qt(Me.key),Me.controller&&X.set(Me.key,Me.controller)});let lr=()=>et.forEach(Me=>Qt(Me.key));U&&U.signal.addEventListener("abort",lr);let{loaderResults:ia,fetcherResults:yn}=await Ca(Mt,et,A,L,ue);if(A.signal.aborted)return{shortCircuited:!0};U&&U.signal.removeEventListener("abort",lr),et.forEach(Me=>X.delete(Me.key));let un=$c(ia);if(un)return await aa(A,un.result,!0,{replace:Re}),{shortCircuited:!0};if(un=$c(yn),un)return V.add(un.key),await aa(A,un.result,!0,{replace:Re}),{shortCircuited:!0};let Zn=new Map(_.fetchers),{loaderData:ki,errors:sa}=u0(_,q,ia,ze,et,yn,Zn);Ce&&_.errors&&(sa={..._.errors,...sa});let Ti=ml(Zn),za=gl(j,Zn),Ma=Ti||za||et.length>0;return{matches:q,loaderData:ki,errors:sa,...Ma?{workingFetchers:Zn}:{}}}function Je(A){if(A&&!Bn(A[1]))return{[A[0]]:A[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function st(A){let L=new Map(_.fetchers);return A.forEach(q=>{let ce=L.get(q.key),ue=Ro(void 0,ce?ce.data:void 0);L.set(q.key,ue)}),L}async function Ct(A,L,q,ce){Qt(A);let ue=(ce&&ce.flushSync)===!0,Ee=f.activeRoutes,xe=Qh(_.location,_.matches,h,q,L,ce?.relative),we=da(Ee,xe,h,!1,f.branches),Se=or(we,Ee,xe);if(Se.active&&Se.matches&&(we=Se.matches),!we){Pn(A,L,Jn(404,{pathname:xe}),{flushSync:ue});return}let{path:Re,submission:Ce,error:Be}=n0(!0,xe,ce);if(Be){Pn(A,L,Be,{flushSync:ue});return}let ze=e.getContext?await e.getContext():new Kb,Ie=(ce&&ce.preventScrollReset)===!0;if(Ce&&ln(Ce.formMethod)){await Tn(A,L,Re,we,ze,Se.active,ue,Ie,Ce,ce&&ce.defaultShouldRevalidate);return}le.set(A,{routeId:L,path:Re}),await zt(A,L,Re,we,ze,Se.active,ue,Ie,Ce)}async function Tn(A,L,q,ce,ue,Ee,xe,we,Se,Re){Hn(),le.delete(A);let Ce=_.fetchers.get(A);Nn(A,GR(Se,Ce),{flushSync:xe});let Be=new AbortController,ze=hs(e.history,q,Be.signal,Se);if(Ee){let ct=await ma(ce,new URL(ze.url).pathname,ze.signal,A);if(ct.type==="aborted")return;if(ct.type==="error"){Pn(A,L,ct.error,{flushSync:xe});return}else if(ct.matches)ce=ct.matches;else{Pn(A,L,Jn(404,{pathname:q}),{flushSync:xe});return}}let Ie=Xc(ce,q);if(!Ie.route.action&&!Ie.route.lazy){let ct=Jn(405,{method:Se.formMethod,pathname:q,routeId:L});Pn(A,L,ct,{flushSync:xe});return}X.set(A,Be);let at=ve,vt=bs(c,u,ze,q,ce,Ie,s,ue),lt=await gn(ze,q,vt,ue,A),We=lt[Ie.route.id];if(!We){for(let ct of vt)if(lt[ct.route.id]){We=lt[ct.route.id];break}}if(ze.signal.aborted){X.get(A)===Be&&X.delete(A);return}if(be.has(A)){if(bi(We)||Bn(We)){Nn(A,Ea(void 0));return}}else{if(bi(We))if(X.delete(A),j>at){Nn(A,Ea(void 0));return}else return V.add(A),Nn(A,Ro(Se)),aa(ze,We,!1,{fetcherSubmission:Se,preventScrollReset:we});if(Bn(We)){Pn(A,L,We.error);return}}let Mt=_.navigation.location||_.location,et=hs(e.history,Mt,Be.signal),lr=f.activeRoutes,ia=_.navigation.state!=="idle"?da(lr,_.navigation.location,h,!1,f.branches):_.matches;Le(ia,"Didn't find any matches after fetcher action");let yn=++ve;Y.set(A,yn);let{dsMatches:un,revalidatingFetchers:Zn}=a0(et,ue,c,u,e.history,_,ia,Se,Mt,s,!1,N,ae,be,le,V,lr,h,e.patchRoutesOnNavigation!=null,f.branches,[Ie.route.id,We],Re),ki=Ro(Se,We.data),sa=new Map(_.fetchers);sa.set(A,ki),Zn.filter(ct=>ct.key!==A).forEach(ct=>{let Da=ct.key,fn=sa.get(Da),Ms=Ro(void 0,fn?fn.data:void 0);sa.set(Da,Ms),Qt(Da),ct.controller&&X.set(Da,ct.controller)}),he({fetchers:sa});let Ti=()=>Zn.forEach(ct=>Qt(ct.key));Be.signal.addEventListener("abort",Ti);let{loaderResults:za,fetcherResults:Ma}=await Ca(un,Zn,et,Mt,ue);if(Be.signal.aborted)return;Be.signal.removeEventListener("abort",Ti),Y.delete(A),X.delete(A),Zn.forEach(ct=>X.delete(ct.key));let Me=_.fetchers.has(A),gt=ct=>{if(!Me)return ct;let Da=new Map(ct.fetchers);return Da.set(A,Ea(We.data)),{...ct,fetchers:Da}},jn=$c(za);if(jn)return _=gt(_),aa(et,jn.result,!1,{preventScrollReset:we});if(jn=$c(Ma),jn)return V.add(jn.key),_=gt(_),aa(et,jn.result,!1,{preventScrollReset:we});let oa=new Map(_.fetchers);Me&&oa.set(A,Ea(We.data));let{loaderData:Ni,errors:ji}=u0(_,ia,za,void 0,Zn,Ma,oa);gl(yn,oa),_.navigation.state==="loading"&&yn>j?(Le(M,"Ex)DELIM" -R"DELIM(pected pending action"),U&&U.abort(),Ne(_.navigation.location,{matches:ia,loaderData:Ni,errors:ji,fetchers:oa})):(he({errors:ji,loaderData:f0(_.loaderData,Ni,ia,ji),fetchers:oa}),N=!1)}async function zt(A,L,q,ce,ue,Ee,xe,we,Se){let Re=_.fetchers.get(A);Nn(A,Ro(Se,Re?Re.data:void 0),{flushSync:xe});let Ce=new AbortController,Be=hs(e.history,q,Ce.signal);if(Ee){let We=await ma(ce,new URL(Be.url).pathname,Be.signal,A);if(We.type==="aborted")return;if(We.type==="error"){Pn(A,L,We.error,{flushSync:xe});return}else if(We.matches)ce=We.matches;else{Pn(A,L,Jn(404,{pathname:q}),{flushSync:xe});return}}let ze=Xc(ce,q);X.set(A,Ce);let Ie=ve,at=bs(c,u,Be,q,ce,ze,s,ue),vt=await gn(Be,q,at,ue,A),lt=vt[ze.route.id];if(!lt){for(let We of ce)if(vt[We.route.id]){lt=vt[We.route.id];break}}if(X.get(A)===Ce&&X.delete(A),!Be.signal.aborted){if(be.has(A)){Nn(A,Ea(void 0));return}if(bi(lt))if(j>Ie){Nn(A,Ea(void 0));return}else{V.add(A),await aa(Be,lt,!1,{preventScrollReset:we});return}if(Bn(lt)){Pn(A,L,lt.error);return}Nn(A,Ea(lt.data))}}async function aa(A,L,q,{submission:ce,fetcherSubmission:ue,preventScrollReset:Ee,replace:xe}={}){q||($?.resolve(),$=null),L.response.headers.has("X-Remix-Revalidate")&&(N=!0);let we=L.response.headers.get("Location");Le(we,"Expected a Location header on the redirect Response"),we=l0(we,new URL(A.url),h,e.history);let Se=Jo(_.location,we,{_isRedirect:!0});if(r){let at=!1;if(L.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(jp(we)){const vt=y1(n,we,!0);at=vt.origin!==n.location.origin||$n(vt.pathname,h)==null}if(at){xe?n.location.replace(we):n.location.assign(we);return}}U=null;let Re=xe===!0||L.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ce,formAction:Be,formEncType:ze}=_.navigation;!ce&&!ue&&Ce&&Be&&ze&&(ce=p0(_.navigation));let Ie=ce||ue;if(wR.has(L.response.status)&&Ie&&ln(Ie.formMethod))await Tt(Re,Se,{submission:{...Ie,formAction:we},preventScrollReset:Ee||P,enableViewTransition:q?fe:void 0});else{let at=lh(Se,[],Re,ce);await Tt(Re,Se,{overrideNavigation:at,fetcherSubmission:ue,preventScrollReset:Ee||P,enableViewTransition:q?fe:void 0})}}async function gn(A,L,q,ce,ue){let Ee,xe={};try{Ee=await zR(g,A,L,q,ue,ce,!1)}catch(we){return q.filter(Se=>Se.shouldLoad).forEach(Se=>{xe[Se.route.id]={type:"error",error:we}}),xe}if(A.signal.aborted)return xe;if(!ln(A.method))for(let we of q){if(Ee[we.route.id]?.type==="error")break;!Ee.hasOwnProperty(we.route.id)&&!_.loaderData.hasOwnProperty(we.route.id)&&(!_.errors||!_.errors.hasOwnProperty(we.route.id))&&we.shouldCallHandler()&&(Ee[we.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${we.route.id}`)})}for(let[we,Se]of Object.entries(Ee))if(qR(Se)){let Re=Se.result;xe[we]={type:"redirect",response:BR(Re,A,we,q,h)}}else xe[we]=await LR(Se);return xe}async function Ca(A,L,q,ce,ue){let Ee=gn(q,ce,A,ue,null),xe=Promise.all(L.map(async Re=>{if(Re.matches&&Re.match&&Re.request&&Re.controller){let Be=(await gn(Re.request,Re.path,Re.matches,ue,Re.key))[Re.match.route.id];return{[Re.key]:Be}}else return Promise.resolve({[Re.key]:{type:"error",error:Jn(404,{pathname:Re.path})}})})),we=await Ee,Se=(await xe).reduce((Re,Ce)=>Object.assign(Re,Ce),{});return{loaderResults:we,fetcherResults:Se}}function Hn(){N=!0,le.forEach((A,L)=>{X.has(L)&&ae.add(L),Qt(L)})}function Nn(A,L,q={}){let ce=new Map(_.fetchers);ce.set(A,L),he({fetchers:ce},{flushSync:(q&&q.flushSync)===!0})}function Pn(A,L,q,ce={}){let ue=Zr(_.matches,L),Ee=new Map(_.fetchers);Aa(Ee,A),he({errors:{[ue.route.id]:q},fetchers:Ee},{flushSync:(ce&&ce.flushSync)===!0})}function Cu(A){return ne.set(A,(ne.get(A)||0)+1),be.has(A)&&be.delete(A),_.fetchers.get(A)||ER}function Au(A,L){Qt(A,L?.reason),Nn(A,Ea(null))}function Aa(A,L){let q=_.fetchers.get(L);X.has(L)&&!(q&&q.state==="loading"&&Y.has(L))&&Qt(L),le.delete(L),Y.delete(L),V.delete(L),be.delete(L),ae.delete(L),A.delete(L)}function cn(A){let L=(ne.get(A)||0)-1;L<=0?(ne.delete(A),be.add(A)):ne.set(A,L),he({fetchers:new Map(_.fetchers)})}function Qt(A,L){let q=X.get(A);q&&(q.abort(L),X.delete(A))}function rn(A,L){for(let q of A){let ce=L.get(q);Le(ce,`Expected fetcher: ${q}`);let ue=Ea(ce.data);L.set(q,ue)}}function ml(A){let L=[],q=!1;for(let ce of V){let ue=A.get(ce);Le(ue,`Expected fetcher: ${ce}`),ue.state==="loading"&&(V.delete(ce),L.push(ce),q=!0)}return rn(L,A),q}function gl(A,L){let q=[];for(let[ce,ue]of Y)if(ue0}function Ou(A,L){let q=_.blockers.get(A)||jo;return Oe.get(A)!==L&&Oe.set(A,L),q}function Gr(A){_.blockers.delete(A),Oe.delete(A)}function Oa(A,L){let q=_.blockers.get(A)||jo;Le(q.state==="unblocked"&&L.state==="blocked"||q.state==="blocked"&&L.state==="blocked"||q.state==="blocked"&&L.state==="proceeding"||q.state==="blocked"&&L.state==="unblocked"||q.state==="proceeding"&&L.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${L.state}`);let ce=new Map(_.blockers);ce.set(A,L),he({blockers:ce})}function Kr({currentLocation:A,nextLocation:L,historyAction:q}){if(Oe.size===0)return;Oe.size>1&&_t(!1,"A router only supports one blocker at a time");let ce=Array.from(Oe.entries()),[ue,Ee]=ce[ce.length-1],xe=_.blockers.get(ue);if(!(xe&&xe.state==="proceeding")&&Ee({currentLocation:A,nextLocation:L,historyAction:q}))return ue}function ra(A){let L=Jn(404,{pathname:A}),q=f.activeRoutes,{matches:ce,route:ue}=Uc(q);return{notFoundMatches:ce,route:ue,error:L}}function _i(A,L,q){if(k=A,T=L,C=q||null,!Q&&_.navigation===oh){Q=!0;let ce=zs(_.location,_.matches);ce!=null&&he({restoreScrollPosition:ce})}return()=>{k=null,T=null,C=null}}function sr(A,L){return C&&C(A,L.map(ce=>b1(ce,_.loaderData)))||A.key}function zu(A,L){if(k&&T){let q=sr(A,L);k[q]=T()}}function zs(A,L){if(k){let q=sr(A,L),ce=k[q];if(typeof ce=="number")return ce}return null}function or(A,L,q){if(e.patchRoutesOnNavigation){let ce=f.branches;if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:da(L,q,h,!0,ce)}}else return{active:!0,matches:da(L,q,h,!0,ce)||[]}}return{active:!1,matches:null}}async function ma(A,L,q,ce){if(!e.patchRoutesOnNavigation)return{type:"success",matches:A};let ue=A;for(;;){let Ee=u;try{await e.patchRoutesOnNavigation({signal:q,path:L,matches:ue,fetcherKey:ce,patch:(Re,Ce)=>{q.aborted||r0(Re,Ce,f,Ee,c,!1)}})}catch(Re){return{type:"error",error:Re,partialMatches:ue}}if(q.aborted)return{type:"aborted"};let xe=f.branches,we=da(f.activeRoutes,L,h,!1,xe),Se=null;if(we){if(Object.keys(we[0].params).length===0)return{type:"success",matches:we};if(Se=da(f.activeRoutes,L,h,!0,xe),!(Se&&ue.lengthq.route.id===L[ce].route.id)}function vl(A){u={},f.setHmrRoutes(Wo(A,c,void 0,u))}function bl(A,L,q=!1){r0(A,L,f,u,c,q),f.hasHMRRoutes||he({})}return O={get basename(){return h},get future(){return v},get state(){return _},get routes(){return f.stableRoutes},get branches(){return f.branches},get manifest(){return u},get window(){return n},initialize:ye,subscribe:pe,enableScrollRestoration:_i,navigate:$e,fetch:Ct,revalidate:nt,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Cu,resetFetcher:Au,deleteFetcher:cn,dispose:te,getBlocker:Ou,deleteBlocker:Gr,patchRoutes:bl,_internalFetchControllers:X,_internalSetRoutes:vl,_internalSetStateDoNotUseOrYouWillBreakYourApp(A){he(A)}},e.instrumentations&&(O=pR(O,e.instrumentations.map(A=>A.router).filter(Boolean))),O}function NR(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Qh(e,n,r,s,l,c){let u,f;if(l){u=[];for(let g of n)if(u.push(g),g.route.id===l){f=g;break}}else u=n,f=n[n.length-1];let h=ll(s||".",ku(u),$n(e.pathname,r)||e.pathname,c)DELIM" -R"DELIM(==="path");if(s==null&&(h.search=e.search,h.hash=e.hash),(s==null||s===""||s===".")&&f){let g=Op(h.search);if(f.route.index&&!g)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!f.route.index&&g){let v=new URLSearchParams(h.search),y=v.getAll("index");v.delete("index"),y.filter(S=>S).forEach(S=>v.append("index",S));let x=v.toString();h.search=x?`?${x}`:""}}return r!=="/"&&(h.pathname=oR({basename:r,pathname:h.pathname})),ja(h)}function n0(e,n,r){if(!r||!NR(r))return{path:n};if(r.formMethod&&!YR(r.formMethod))return{path:n,error:Jn(405,{method:r.formMethod})};let s=()=>({path:n,error:Jn(400,{type:"invalid-body"})}),c=(r.formMethod||"get").toUpperCase(),u=$1(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!ln(c))return s();let y=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,[S,k])=>`${x}${S}=${k} -`,""):String(r.body);return{path:n,submission:{formMethod:c,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:y}}}else if(r.formEncType==="application/json"){if(!ln(c))return s();try{let y=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:c,formAction:u,formEncType:r.formEncType,formData:void 0,json:y,text:void 0}}}catch{return s()}}}Le(typeof FormData=="function","FormData is not available in this environment");let f,h;if(r.formData)f=Gh(r.formData),h=r.formData;else if(r.body instanceof FormData)f=Gh(r.body),h=r.body;else if(r.body instanceof URLSearchParams)f=r.body,h=c0(f);else if(r.body==null)f=new URLSearchParams,h=new FormData;else try{f=new URLSearchParams(r.body),h=c0(f)}catch{return s()}let g={formMethod:c,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(ln(g.formMethod))return{path:n,submission:g};let v=Ra(n);return e&&v.search&&Op(v.search)&&f.append("index",""),v.search=`?${f}`,{path:ja(v),submission:g}}function a0(e,n,r,s,l,c,u,f,h,g,v,y,x,S,k,C,T,Q,I,K,oe,J){let ge=oe?Bn(oe[1])?oe[1].error:oe[1].data:void 0,O=l.createURL(c.location),_=l.createURL(h),M;if(v&&c.errors){let z=Object.keys(c.errors)[0];M=u.findIndex(N=>N.route.id===z)}else if(oe&&Bn(oe[1])){let z=oe[0];M=u.findIndex(N=>N.route.id===z)-1}let $=oe?oe[1].statusCode:void 0,P=$&&$>=400,U={currentUrl:O,currentParams:c.matches[0]?.params||{},nextUrl:_,nextParams:u[0].params,...f,actionResult:ge,actionStatus:$},fe=ul(u),de=u.map((z,N)=>{let{route:ae}=z,X=null;if(M!=null&&N>M)X=!1;else if(ae.lazy)X=!0;else if(!Cp(ae))X=!1;else if(v){let{shouldLoad:V}=O1(ae,c.loaderData,c.errors);X=V}else jR(c.loaderData,c.matches[N],z)&&(X=!0);if(X!==null)return Yh(r,s,e,h,fe,z,g,n,X);let ve=!1;typeof J=="boolean"?ve=J:P?ve=!1:(y||O.pathname+O.search===_.pathname+_.search||O.search!==_.search||RR(c.matches[N],z))&&(ve=!0);let j={...U,defaultShouldRevalidate:ve},Y=Po(z,j);return Yh(r,s,e,h,fe,z,g,n,Y,j,J)}),me=[];return k.forEach((z,N)=>{if(v||!u.some(ne=>ne.route.id===z.routeId)||S.has(N))return;let ae=c.fetchers.get(N),X=ae&&ae.state!=="idle"&&ae.data===void 0,ve=da(T,z.path,Q??"/",!1,K);if(!ve){if(I&&X)return;me.push({key:N,routeId:z.routeId,path:z.path,matches:null,match:null,request:null,controller:null});return}if(C.has(N))return;let j=Xc(ve,z.path),Y=new AbortController,V=hs(l,z.path,Y.signal),le=null;if(x.has(N))x.delete(N),le=bs(r,s,V,z.path,ve,j,g,n);else if(X)y&&(le=bs(r,s,V,z.path,ve,j,g,n));else{let ne;typeof J=="boolean"?ne=J:P?ne=!1:ne=y;let be={...U,defaultShouldRevalidate:ne};Po(j,be)&&(le=bs(r,s,V,z.path,ve,j,g,n,be))}le&&me.push({key:N,routeId:z.routeId,path:z.path,matches:le,match:j,request:V,controller:Y})}),{dsMatches:de,revalidatingFetchers:me}}function Cp(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function O1(e,n,r){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Cp(e))return{shouldLoad:!1,renderFallback:!1};let s=n!=null&&e.id in n,l=r!=null&&r[e.id]!==void 0;if(!s&&l)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!s};let c=!s&&!l;return{shouldLoad:c,renderFallback:c}}function jR(e,n,r){let s=!n||r.route.id!==n.route.id,l=!e.hasOwnProperty(r.route.id);return s||l}function RR(e,n){let r=e.route.path;return e.pathname!==n.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==n.params["*"]}function Po(e,n){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(n);if(typeof r=="boolean")return r}return n.defaultShouldRevalidate}function r0(e,n,r,s,l,c){let u;if(e){let g=s[e];Le(g,`No route found to patch children into: routeId = ${e}`),g.children||(g.children=[]),u=g.children}else u=r.activeRoutes;let f=[],h=[];if(n.forEach(g=>{let v=u.find(y=>z1(g,y));v?h.push({existingRoute:v,newRoute:g}):f.push(g)}),f.length>0){let g=Wo(f,l,[e||"_","patch",String(u?.length||"0")],s);u.push(...g)}if(c&&h.length>0)for(let g=0;gn.children?.some(l=>z1(r,l)))??!1:!1}var i0=new WeakMap,M1=({key:e,route:n,manifest:r,mapRouteProperties:s})=>{let l=r[n.id];if(Le(l,"No route found in manifest"),!l.lazy||typeof l.lazy!="object")return;let c=l.lazy[e];if(!c)return;let u=i0.get(l);u||(u={},i0.set(l,u));let f=u[e];if(f)return f;let h=(async()=>{let g=Qj(e),y=l[e]!==void 0&&e!=="hasErrorBoundary";if(g)_t(!g,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),u[e]=Promise.resolve();else if(y)_t(!1,`Route "${l.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await c();x!=null&&(Object.assign(l,{[e]:x}),Object.assign(l,s(l)))}typeof l.lazy=="object"&&(l.lazy[e]=void 0,Object.values(l.lazy).every(x=>x===void 0)&&(l.lazy=void 0))})();return u[e]=h,h},s0=new WeakMap;function CR(e,n,r,s,l){let c=r[e.id];if(Le(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let v=s0.get(c);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let y=(async()=>{Le(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),S={};for(let k in x){let C=x[k];if(C===void 0)continue;let T=Vj(k),I=c[k]!==void 0&&k!=="hasErrorBoundary";T?_t(!T,"Route property "+k+" is not a supported property to be returned from a lazy route function. This property will be ignored."):I?_t(!I,`Route "${c.id}" has a static property "${k}" defined but its lazy function is also returning a value for this property. The lazy route property "${k}" will be ignored.`):S[k]=C}Object.assign(c,S),Object.assign(c,{...s(c),lazy:void 0})})();return s0.set(c,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let u=Object.keys(e.lazy),f=[],h;for(let v of u){if(l&&l.includes(v))continue;let y=M1({key:v,route:e,manifest:r,mapRouteProperties:s});y&&(f.push(y),v===n&&(h=y))}let g=f.length>0?Promise.all(f).then(()=>{}):void 0;return g?.catch(()=>{}),h?.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:h}}async function o0(e){let n=e.matches.filter(l=>l.shouldLoad),r={};return(await Promise.all(n.map(l=>l.resolve()))).forEach((l,c)=>{r[n[c].route.id]=l}),r}async function AR(e){return e.matches.some(n=>n.route.middleware)?D1(e,()=>o0(e)):o0(e)}function D1(e,n){return OR(e,n,s=>{if(QR(s))throw s;return s},ZR,r);function r(s,l,c){if(c)return Promise.resolve(Object.assign(c.value,{[l]:{type:"error",result:s}}));{let{matches:u}=e,f=Math.min(Math.max(u.findIndex(g=>g.route.id===l),0),Mat)DELIM" -R"DELIM(h.max(u.findIndex(g=>g.shouldCallHandler()),0)),h=Zr(u,u[f].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:s}})}}}async function OR(e,n,r,s,l){let{matches:c,...u}=e,f=c.flatMap(g=>g.route.middleware?g.route.middleware.map(v=>[g.route.id,v]):[]);return await L1(u,f,n,r,s,l)}async function L1(e,n,r,s,l,c,u=0){let{request:f}=e;if(f.signal.aborted)throw f.signal.reason??new Error(`Request aborted: ${f.method} ${f.url}`);let h=n[u];if(!h)return await r();let[g,v]=h,y,x=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await L1(e,n,r,s,l,c,u+1)},y.value}catch(S){return y={value:await c(S,g,y)},y.value}};try{let S=await v(e,x),k=S!=null?s(S):void 0;return l(k)?k:y?k??y.value:(y={value:await x()},y.value)}catch(S){return await c(S,g,y)}}function B1(e,n,r,s,l){let c=M1({key:"middleware",route:s.route,manifest:n,mapRouteProperties:e}),u=CR(s.route,ln(r.method)?"action":"loader",n,e,l);return{middleware:c,route:u.lazyRoutePromise,handler:u.lazyHandlerPromise}}function Yh(e,n,r,s,l,c,u,f,h,g=null,v){let y=!1,x=B1(e,n,r,c,u);return{...c,_lazyPromises:x,shouldLoad:h,shouldRevalidateArgs:g,shouldCallHandler(S){return y=!0,g?typeof v=="boolean"?Po(c,{...g,defaultShouldRevalidate:v}):typeof S=="boolean"?Po(c,{...g,defaultShouldRevalidate:S}):Po(c,g):h},resolve(S){let{lazy:k,loader:C,middleware:T}=c.route,Q=y||h||S&&!ln(r.method)&&(k||C),I=T&&T.length>0&&!C&&!k;return Q&&(ln(r.method)||!I)?MR({request:r,path:s,pattern:l,match:c,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:S,scopedContext:f}):Promise.resolve({type:"data",result:void 0})}}}function bs(e,n,r,s,l,c,u,f,h=null){return l.map(g=>g.route.id!==c.route.id?{...g,shouldLoad:!1,shouldRevalidateArgs:h,shouldCallHandler:()=>!1,_lazyPromises:B1(e,n,r,g,u),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Yh(e,n,r,s,ul(l),g,u,f,!0,h))}async function zR(e,n,r,s,l,c,u){s.some(v=>v._lazyPromises?.middleware)&&await Promise.all(s.map(v=>v._lazyPromises?.middleware));let f={request:n,url:U1(n,r),pattern:ul(s),params:s[0].params,context:c,matches:s},g=await e({...f,fetcherKey:l,runClientMiddleware:v=>{let y=f;return D1(y,()=>v({...y,fetcherKey:l,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(s.flatMap(v=>[v._lazyPromises?.handler,v._lazyPromises?.route]))}catch{}return g}async function MR({request:e,path:n,pattern:r,match:s,lazyHandlerPromise:l,lazyRoutePromise:c,handlerOverride:u,scopedContext:f}){let h,g,v=ln(e.method),y=v?"action":"loader",x=S=>{let k,C=new Promise((I,K)=>k=K);g=()=>k(),e.signal.addEventListener("abort",g);let T=I=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${s.route.id}]`)):S({request:e,url:U1(e,n),pattern:r,params:s.params,context:f},...I!==void 0?[I]:[]),Q=(async()=>{try{return{type:"data",result:await(u?u(K=>T(K)):T())}}catch(I){return{type:"error",result:I}}})();return Promise.race([Q,C])};try{let S=v?s.route.action:s.route.loader;if(l||c)if(S){let k,[C]=await Promise.all([x(S).catch(T=>{k=T}),l,c]);if(k!==void 0)throw k;h=C}else{await l;let k=v?s.route.action:s.route.loader;if(k)[h]=await Promise.all([x(k),c]);else if(y==="action"){let C=new URL(e.url),T=C.pathname+C.search;throw Jn(405,{method:e.method,pathname:T,routeId:s.route.id})}else return{type:"data",result:void 0}}else if(S)h=await x(S);else{let k=new URL(e.url),C=k.pathname+k.search;throw Jn(404,{pathname:C})}}catch(S){return{type:"error",result:S}}finally{g&&e.signal.removeEventListener("abort",g)}return h}async function DR(e){let n=e.headers.get("Content-Type");return n&&/\bapplication\/json\b/.test(n)?e.body==null?null:e.json():e.text()}async function LR(e){let{result:n,type:r}=e;if(Ap(n)){let s;try{s=await DR(n)}catch(l){return{type:"error",error:l}}return r==="error"?{type:"error",error:new cl(n.status,n.statusText,s),statusCode:n.status,headers:n.headers}:{type:"data",data:s,statusCode:n.status,headers:n.headers}}return r==="error"?h0(n)?n.data instanceof Error?{type:"error",error:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:PR(n),statusCode:el(n)?n.status:void 0,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"error",error:n,statusCode:el(n)?n.status:void 0}:h0(n)?{type:"data",data:n.data,statusCode:n.init?.status,headers:n.init?.headers?new Headers(n.init.headers):void 0}:{type:"data",data:n}}function BR(e,n,r,s,l){let c=e.headers.get("Location");if(Le(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!jp(c)){let u=s.slice(0,s.findIndex(f=>f.route.id===r)+1);c=Qh(new URL(n.url),u,l,c),e.headers.set("Location",c)}return e}var UR=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Vh(e){try{return UR.includes(new URL(e).protocol)}catch{return!1}}function l0(e,n,r,s){if(jp(e)){let l=e,c=Np.test(l)?new URL(m1(l,n.protocol)):new URL(l);if(Vh(c.toString()))throw new Error("Invalid redirect location");let u=$n(c.pathname,r)!=null;if(c.origin===n.origin&&u)return Rp(c.pathname)+c.search+c.hash}try{let l=s.createURL(e);if(Vh(l.toString()))throw new Error("Invalid redirect location")}catch{}return e}function hs(e,n,r,s){let l=e.createURL($1(n)).toString(),c={signal:r};if(s&&ln(s.formMethod)){let{formMethod:u,formEncType:f}=s;c.method=u.toUpperCase(),f==="application/json"?(c.headers=new Headers({"Content-Type":f}),c.body=JSON.stringify(s.json)):f==="text/plain"?c.body=s.text:f==="application/x-www-form-urlencoded"&&s.formData?c.body=Gh(s.formData):c.body=s.formData}return new Request(l,c)}function U1(e,n){let r=new URL(e.url),s=typeof n=="string"?Ra(n):n;if(r.pathname=s.pathname||"/",s.search){let l=new URLSearchParams(s.search),c=l.getAll("index");l.delete("index");for(let u of c.filter(Boolean))l.append("index",u);r.search=l.size?`?${l.toString()}`:""}else r.search="";return r.hash=s.hash||"",r}function Gh(e){let n=new URLSearchParams;for(let[r,s]of e.entries())n.append(r,typeof s=="string"?s:s.name);return n}function c0(e){let n=new FormData;for(let[r,s]of e.entries())n.append(r,s);return n}function $R(e,n,r,s=!1,l=!1){let c={},u=null,f,h=!1,g={},v=r&&Bn(r[1])?r[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in n))return;let x=y.route.id,S=n[x];if(Le(!bi(S),"Cannot handle redirect results in processLoaderData"),Bn(S)){let k=S.error;if(v!==void 0&&(k=v,v=void 0),u=u||{},l)u[x]=k;else{let C=Zr(e,x);u[C.route.id]==null&&(u[C.route.id]=k)}s||(c[x]=A1),h||(h=!0,f=el(S.error)?S.error.status:500),S.headers&&(g[x]=S.headers)}else c[x]=S.data,S.statusCode&&S.statusCode!==200&&!h&&(f=S.statusCode),S.headers&&(g[x]=S.headers)}),v!==void 0&&r&&(u={[r[0]]:v},r[2]&&(c[r[2]]=void 0)),{loaderData:c,errors:u,statusCode:f||200,loaderHeaders:g}}function u0(e,n,r,s,l,c,u){let{loaderData:f,errors:h}=$R(n,r,s);return l.filter(g=>!g.matches||g.matches.some(v=>v.shouldLoad)).forEach(g=>{let{key:v,match:y,controller:x}=g;if(x&&x.signal.aborted)return;let S=c[v];if(Le(S,"Did not find corresponding fetcher result"),Bn(S)){let k=Zr(e.matches,y?.route.id);h&&h[k.route.id]||(h={...h,[k.route.id]:S.error}),u.delete(v)}else if(bi(S))Le(!1,"Unhandled fetcher revalidation redirect");else{let k=Ea(S.data);u.set(v,k)}}),{loaderData:f,errors:h}}function f0(e,n,r,s){let l=Object.entries(n).filter(([,c])=>c!==A1).reduce((c,[u,f])=>(c[u]=f,c),{});for(let c of r){let u=c.route.id;if(!n.hasOwnProperty(u)&&e.hasOwnProperty(u)&&c.route.loader&&(l[u]=e[u]),s&&s.hasOwnProperty(u))break}return l}function d0(e){return e?Bn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Zr(e,n){return(n?e.slice(0,e.findIndex(s=>s.route.id===n)+1):[...e]).reverse().find(s=>s.route.hasErrorBoundary===!0)||e[0]}function Uc(e){let n=e.length===1?e[0]:e.find(r=>r.index||!r.path||r.path==="/")||{id:"__s)DELIM" -R"DELIM(him-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:n}],route:n}}function Jn(e,{pathname:n,routeId:r,method:s,type:l,message:c}={}){let u="Unknown Server Error",f="Unknown @remix-run/router error";return e===400?(u="Bad Request",s&&n&&r?f=`You made a ${s} request to "${n}" but did not provide a \`loader\` for route "${r}", so there is no way to handle the request.`:l==="invalid-body"&&(f="Unable to encode submission body")):e===403?(u="Forbidden",f=`Route "${r}" does not match URL "${n}"`):e===404?(u="Not Found",f=`No route matches URL "${n}"`):e===405&&(u="Method Not Allowed",s&&n&&r?f=`You made a ${s.toUpperCase()} request to "${n}" but did not provide an \`action\` for route "${r}", so there is no way to handle the request.`:s&&(f=`Invalid request method "${s.toUpperCase()}"`)),new cl(e||500,u,new Error(f),!0)}function $c(e){let n=Object.entries(e);for(let r=n.length-1;r>=0;r--){let[s,l]=n[r];if(bi(l))return{key:s,result:l}}}function $1(e){let n=typeof e=="string"?Ra(e):e;return ja({...n,hash:""})}function HR(e,n){return e.pathname!==n.pathname||e.search!==n.search?!1:e.hash===""?n.hash!=="":e.hash===n.hash?!0:n.hash!==""}function PR(e){return new cl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function ZR(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([n,r])=>typeof n=="string"&&IR(r))}function IR(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function qR(e){return Ap(e.result)&&R1.has(e.result.status)}function Bn(e){return e.type==="error"}function bi(e){return(e&&e.type)==="redirect"}function h0(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Ap(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function FR(e){return R1.has(e)}function QR(e){return Ap(e)&&FR(e.status)&&e.headers.has("Location")}function YR(e){return SR.has(e.toUpperCase())}function ln(e){return bR.has(e.toUpperCase())}function Op(e){return new URLSearchParams(e).getAll("index").some(n=>n==="")}function Xc(e,n){let r=typeof n=="string"?Ra(n).search:n.search;if(e[e.length-1].route.index&&Op(r||""))return e[e.length-1];let s=_1(e);return s[s.length-1]}function p0(e){let{formMethod:n,formAction:r,formEncType:s,text:l,formData:c,json:u}=e;if(!(!n||!r||!s)){if(l!=null)return{formMethod:n,formAction:r,formEncType:s,formData:void 0,json:void 0,text:l};if(c!=null)return{formMethod:n,formAction:r,formEncType:s,formData:c,json:void 0,text:void 0};if(u!==void 0)return{formMethod:n,formAction:r,formEncType:s,formData:void 0,json:u,text:void 0}}}function lh(e,n,r,s){return s?{state:"loading",location:e,matches:n,historyAction:r,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}:{state:"loading",location:e,matches:n,historyAction:r,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function VR(e,n,r,s){return{state:"submitting",location:e,matches:n,historyAction:r,formMethod:s.formMethod,formAction:s.formAction,formEncType:s.formEncType,formData:s.formData,json:s.json,text:s.text}}function Ro(e,n){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:n}}function GR(e,n){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:n?n.data:void 0}}function Ea(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function KR(e,n){try{let r=e.sessionStorage.getItem(C1);if(r){let s=JSON.parse(r);for(let[l,c]of Object.entries(s||{}))c&&Array.isArray(c)&&n.set(l,new Set(c||[]))}}catch{}}function XR(e,n){if(n.size>0){let r={};for(let[s,l]of n)r[s]=[...l];try{e.sessionStorage.setItem(C1,JSON.stringify(r))}catch(s){_t(!1,`Failed to save applied view transitions in sessionStorage (${s}).`)}}}function m0(){let e,n,r=new Promise((s,l)=>{e=async c=>{s(c);try{await r}catch{}},n=async c=>{l(c);try{await r}catch{}}});return{promise:r,resolve:e,reject:n}}var wi=E.createContext(null);wi.displayName="DataRouter";var As=E.createContext(null);As.displayName="DataRouterState";var H1=E.createContext(!1);function P1(){return E.useContext(H1)}var zp=E.createContext({isTransitioning:!1});zp.displayName="ViewTransition";var Z1=E.createContext(new Map);Z1.displayName="Fetchers";var JR=E.createContext(null);JR.displayName="Await";var mn=E.createContext(null);mn.displayName="Navigation";var fl=E.createContext(null);fl.displayName="Location";var na=E.createContext({outlet:null,matches:[],isDataRoute:!1});na.displayName="Route";var Mp=E.createContext(null);Mp.displayName="RouteError";var I1="REACT_ROUTER_ERROR",WR="REDIRECT",eC="ROUTE_ERROR_RESPONSE";function tC(e){if(e.startsWith(`${I1}:${WR}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function nC(e){if(e.startsWith(`${I1}:${eC}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new cl(n.status,n.statusText,n.data)}catch{}}function aC(e,{relative:n}={}){Le(Os(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:s}=E.useContext(mn),{hash:l,pathname:c,search:u}=dl(e,{relative:n}),f=c;return r!=="/"&&(f=c==="/"?r:ea([r,c])),s.createHref({pathname:f,search:u,hash:l})}function Os(){return E.useContext(fl)!=null}function Kt(){return Le(Os(),"useLocation() may be used only in the context of a component."),E.useContext(fl).location}function rC(){return E.useContext(fl).navigationType}var q1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function F1(e){E.useContext(mn).static||E.useLayoutEffect(e)}function pa(){let{isDataRoute:e}=E.useContext(na);return e?vC():iC()}function iC(){Le(Os(),"useNavigate() may be used only in the context of a component.");let e=E.useContext(wi),{basename:n,navigator:r}=E.useContext(mn),{matches:s}=E.useContext(na),{pathname:l}=Kt(),c=JSON.stringify(ku(s)),u=E.useRef(!1);return F1(()=>{u.current=!0}),E.useCallback((h,g={})=>{if(_t(u.current,q1),!u.current)return;if(typeof h=="number"){r.go(h);return}let v=ll(h,JSON.parse(c),l,g.relative==="path");e==null&&n!=="/"&&(v.pathname=v.pathname==="/"?n:ea([n,v.pathname])),(g.replace?r.replace:r.push)(v,g.state,g)},[n,r,c,l,e])}var sC=E.createContext(null);function oC(e){let n=E.useContext(na).outlet;return E.useMemo(()=>n&&E.createElement(sC.Provider,{value:e},n),[n,e])}function Dp(){let{matches:e}=E.useContext(na);return e[e.length-1]?.params??{}}function dl(e,{relative:n}={}){let{matches:r}=E.useContext(na),{pathname:s}=Kt(),l=JSON.stringify(ku(r));return E.useMemo(()=>ll(e,JSON.parse(l),s,n==="path"),[e,l,s,n])}function lC(e,n,r){Le(Os(),"useRoutes() may be used only in the context of a component.");let{navigator:s}=E.useContext(mn),{matches:l}=E.useContext(na),c=l[l.length-1],u=c?c.params:{},f=c?c.pathname:"/",h=c?c.pathnameBase:"/",g=c&&c.route;{let T=g&&g.path||"";G1(f,!g||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const h=f[1];if(r===f[0]){c(f);continue}if(e.external){const p=e.external.registry.get(f[0])?.id;if(r!==f[0]&&p){c(f);continue}}if(e.metadataRegistry.get(f[0])?.id){c(f);continue}if(h.cycle){c(f);continue}h.count>1&&e.reused==="ref"&&c(f)}e.external&&(e.sharedDefsExtractedFor=e.external)}function iw(e){const r=e.anyOf;if(!Array.isArray(r)||r.length===0||e.type!==void)DELIM" +R"DELIM( 0)return;const i=[];for(const o of r){if(!o||typeof o!="object")return;iw(o);const l=Object.keys(o);if(l.length!==1||l[0]!=="type")return;const c=o.type;for(const f of Array.isArray(c)?c:[c]){if(typeof f!="string")return;i.includes(f)||i.push(f)}}delete e.anyOf,e.type=i.length===1?i[0]:i}const ow=new Set(["type","properties","required","additionalProperties"]),zx=["oneOf","anyOf"];function Mx(e){const r=e.additionalProperties;return r===void 0||r===!1||typeof r!="object"||r===null?null:Object.keys(r).length?r:null}function up(e){const r=[];for(const c of e){if(typeof c!="object"||c.type!=="object")return null;for(const f in c)if(!ow.has(f))return null;r.push(c)}const i={},o=new Set;for(const c of r){for(const f in c.properties){if(Object.prototype.hasOwnProperty.call(i,f))continue;const h=[];for(const p of r){const v=p.properties?.[f]??Mx(p);v!=null&&(h.some(y=>JSON.stringify(y)===JSON.stringify(v))||h.push(v))}const m=h.length===1?h[0]:up(h)??{allOf:h};wa(i,f,m)}for(const f of c.required??[])o.add(f)}const l={type:"object",properties:i};if(o.size&&(l.required=[...o]),r.every(c=>c.additionalProperties===!1))l.additionalProperties=!1;else{const c=[];for(const f of r){const h=Mx(f);h&&!c.some(m=>JSON.stringify(m)===JSON.stringify(h))&&c.push(h)}c.length===1?l.additionalProperties=c[0]:c.length>1&&(l.additionalProperties={allOf:c})}return l}function Dj(e){const r=e.allOf;if(!Array.isArray(r)||r.length<2)return;for(const l of ow)if(l in e)return;const i=r.filter(l=>zx.some(c=>Array.isArray(l[c])));let o=null;if(!i.length)o=up(r);else{const l=i[0],c=zx.find(m=>Array.isArray(l[m]));if(Object.keys(l).length!==1)return;const f=r.filter(m=>m!==l),h=l[c].map(m=>up([...f,m]));if(h.some(m=>!m))return;o={[c]:h}}o&&(delete e.allOf,Ol(e,o))}function sw(e,r){const i=e.seen.get(r);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=h=>{const m=e.seen.get(h);if(m.ref===null)return;const p=m.def??m.schema,v={...p},y=m.ref;if(m.ref=null,y){o(y);const S=e.seen.get(y),E=S.schema;if(E.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(E)):Ol(p,E),Ol(p,v),h._zod.parent===y)for(const T in p)T==="$ref"||T==="allOf"||T in v||delete p[T];if(E.$ref&&S.def)for(const T in p)T==="$ref"||T==="allOf"||T in S.def&&JSON.stringify(p[T])===JSON.stringify(S.def[T])&&delete p[T]}const x=h._zod.parent;if(x&&x!==y){o(x);const S=e.seen.get(x);if(S?.schema.$ref&&(p.$ref=S.schema.$ref,S.def))for(const E in p)E==="$ref"||E==="allOf"||E in S.def&&JSON.stringify(p[E])===JSON.stringify(S.def[E])&&delete p[E]}e.override({zodSchema:h,jsonSchema:p,path:m.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const h of[...e.seen.entries()].reverse())o(h[0]);if(e.target!=="openapi-3.0")for(const h of e.seen.entries())iw(h[1].def??h[1].schema);for(const h of e.deferred)h();if(e.intersections.length){const h=new Map;for(const m of e.seen.values())for(const p of[m.schema,m.def]){const v=p?.allOf;if(!Array.isArray(v))continue;const y=h.get(v);y?y.push(p):h.set(v,[p])}for(const m of e.intersections)for(const p of h.get(m)??[])Dj(p)}}const l={};if(e.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?l.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?l.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const h=e.external.registry.get(r)?.id;if(!h)throw new Error("Schema is missing an `id` property");l.$id=e.external.uri(h)}Ol(l,i.defId?i.schema:i.def??i.schema);const c=e.metadataRegistry.get(r)?.id;c!==void 0&&l.id===c&&delete l.id;const f=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const h of e.seen.entries()){const m=h[1];m.def&&m.defId&&(m.def.id===m.defId&&delete m.def.id,wa(f,m.defId,m.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(f).length>0&&(e.target==="draft-2020-12"?l.$defs=f:l.definitions=f);try{const h=JSON.parse(JSON.stringify(l));return Object.defineProperty(h,"~standard",{value:{...r["~standard"],jsonSchema:{input:uf(r,"input",e.processors),output:uf(r,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function Rn(e,r){const i=r??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Rn(o.element,i);if(o.type==="set")return Rn(o.valueType,i);if(o.type==="lazy")return Rn(o.getter(),i);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Rn(o.innerType,i);if(o.type==="intersection")return Rn(o.left,i)||Rn(o.right,i);if(o.type==="record"||o.type==="map")return Rn(o.keyType,i)||Rn(o.valueType,i);if(o.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Rn(o.in,i)||Rn(o.out,i);if(o.type==="object"){for(const l in o.shape)if(Rn(o.shape[l],i))return!0;return!1}if(o.type==="union"){for(const l of o.options)if(Rn(l,i))return!0;return!1}if(o.type==="tuple"){for(const l of o.items)if(Rn(l,i))return!0;return!!(o.rest&&Rn(o.rest,i))}return!1}const Lj=(e,r={})=>i=>{const o=rw({...i,processors:r});return Ft(e,o),aw(o,e),sw(o,e)},uf=(e,r,i={})=>o=>{const{libraryOptions:l,target:c}=o??{},f=rw({...l??{},target:c,io:r,processors:i});return Ft(e,f),aw(f,e),sw(f,e)},ls=(e,r,i)=>{(e[r]===void 0||i>e[r])&&(e[r]=i)},cs=(e,r,i)=>{(e[r]===void 0||i{ls(e,"minimum",r),cs(e,"maximum",r)},lw=(e,r)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(r)||e.multipleOf.push(r)},cw=(e,r)=>{e.patterns??(e.patterns=new Set),e.patterns.add(r)},uw=(e,r)=>{e.mime=e.mime?e.mime.filter(i=>r.includes(i)):[...r]},fw=(e,r)=>{e.format=r,r.includes("int")&&(e.isInt=!0)},Lx=(e,r)=>ls(e,"minimum",r.minimum),Bx=(e,r)=>cs(e,"maximum",r.maximum),Ux=e=>(r,i)=>{fw(r,i.format);const[o,l]=e[i.format];ls(r,"minimum",o),cs(r,"maximum",l)},Bj={greater_than:(e,r)=>ls(e,r.inclusive?"minimum":"exclusiveMinimum",r.value),less_than:(e,r)=>cs(e,r.inclusive?"maximum":"exclusiveMaximum",r.value),multiple_of:(e,r)=>lw(e,r.value),number_format:Ux(OS),bigint_format:Ux(WN),min_length:Lx,max_length:Bx,length_equals:(e,r)=>Dx(e,r.length),min_size:Lx,max_size:Bx,size_equals:(e,r)=>Dx(e,r.size),string_format:(e,r)=>{fw(e,r.format),r.pattern&&cw(e,r.pattern),(r.format==="base64"||r.format==="base64url")&&(e.contentEncoding=r.format),(r.local||r.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,r)=>uw(e,r.mime)};function Tr(e){const r={},i=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...i.checks??[]]:i.checks??[];for(const c of o)Bj[c._zod.def.check]?.(r,c._zod.def);const l=e._zod.bag;l.minimum!==void 0&&ls(r,"minimum",l.minimum),l.exclusiveMinimum!==void 0&&ls(r,"exclusiveMinimum",l.exclusiveMinimum),l.maximum!==void 0&&cs(r,"maximum",l.maximum),l.exclusiveMaximum!==void 0&&cs(r,"exclusiveMaximum",l.exclusiveMaximum),l.multipleOf!==void 0&&lw(r,l.multipleOf),l.format!==void 0&&(r.format??(r.format=l.format),l.format.includes("int")&&(r.isInt=!0)),l.mime&&uw(r,l.mime);for(const c of l.patterns??[])cw(r,c);return r}const Uj={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Hj=new Map([[VS,ek],[eg,tk]]),dw=e=>Hj.get(e)??e,$j=(e,r,i,o)=>{const l=i;l.type="string";const{minimum:c,maximum:f,format:h,patterns:m,contentEncoding:p,laxFormat:v}=Tr(e);if(typeof c=="number"&&(l.minLength=c),typeof f=="number"&&(l.maxLength=f),h&&(l.format=Uj[h]??h,l.format===""&&delete l.format,(h==="time"||v)&&delete l.format),p&&(l.contentEncoding=p),m&&m.size>0){const y=[...m].map(dw);y.length===1?l.pattern=y[0].source:y.length>1&&(l.allOf=[...y.map(x=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},Pj=(e,r,i,o)=>{const l=i,{minimum:c,maximum:f,multipleOf:h,exclusiveMaximum:m,exclusiveMinimum:p,isInt:v}=Tr(e);l.type=v?"integer":"number";const y=type)DELIM" +R"DELIM(of p=="number"&&p>=(c??Number.NEGATIVE_INFINITY),x=typeof m=="number"&&m<=(f??Number.POSITIVE_INFINITY),S=r.target==="draft-04"||r.target==="openapi-3.0";if(y?S?(l.minimum=p,l.exclusiveMinimum=!0):l.exclusiveMinimum=p:typeof c=="number"&&(l.minimum=c),x?S?(l.maximum=m,l.exclusiveMaximum=!0):l.exclusiveMaximum=m:typeof f=="number"&&(l.maximum=f),h){const E=new Set;for(const P of h)Number.isFinite(P)&&P!==0?E.add(Math.abs(P)):pi(e,r,l,o,`A multipleOf divisor of ${P} cannot be represented in JSON Schema`);const[k,...T]=E;k!==void 0&&(l.multipleOf=k),T.length&&(l.allOf=[...l.allOf??[],...T.map(P=>({multipleOf:P}))])}},Ij=(e,r,i,o)=>{i.type="boolean"},Zj=(e,r,i,o)=>{i.not={}},qj=(e,r,i,o)=>{},Fj=(e,r,i,o)=>{const l=e._zod.def,c=ap(l.entries);if(c.length===0){i.not={};return}c.every(f=>typeof f=="number")&&(i.type="number"),c.every(f=>typeof f=="string")&&(i.type="string"),i.enum=c},Vj=(e,r,i,o)=>{const l=e._zod.def;if(l.values.length===0){i.not={};return}const c=[];for(const f of l.values)if(f===void 0){if(pi(e,r,i,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof f=="bigint"){if(pi(e,r,i,o,"BigInt literals cannot be represented in JSON Schema"))return;c.push(Number(f))}else c.push(f);if(c.length!==0)if(c.length===1){const f=c[0];i.type=f===null?"null":typeof f,r.target==="draft-04"||r.target==="openapi-3.0"?i.enum=[f]:i.const=f}else c.every(f=>typeof f=="number")&&(i.type="number"),c.every(f=>typeof f=="string")&&(i.type="string"),c.every(f=>typeof f=="boolean")&&(i.type="boolean"),c.every(f=>f===null)&&(i.type="null"),i.enum=c},Yj=(e,r,i,o)=>{pi(e,r,i,o,"Custom types cannot be represented in JSON Schema")},Qj=(e,r,i,o)=>{pi(e,r,i,o,"Transforms cannot be represented in JSON Schema")},Kj=(e,r,i,o)=>{const l=i,c=e._zod.def,{minimum:f,maximum:h}=Tr(e);typeof f=="number"&&(l.minItems=f),typeof h=="number"&&(l.maxItems=h),l.type="array",l.items=Ft(c.element,r,{...o,path:[...o.path,"items"]})};function ff(e){const r=e._zod.def;return r.type==="pipe"&&r.in._zod.traits.has("$ZodTransform")?ff(r.out):r.type==="catch"?ff(r.innerType):e._zod.optin}const Gj=(e,r,i,o)=>{const l=i,c=e._zod.def,f=c.shape;if(Object.getOwnPropertySymbols(f).length&&pi(e,r,l,o,"Symbol keys cannot be represented in JSON Schema"))return;l.type="object",l.properties={};for(const p in f)wa(l.properties,p,Ft(f[p],r,{...o,path:[...o.path,"properties",p]}));const m=[];for(const p of Object.keys(f)){const v=c.shape[p];(r.io==="input"?ff(v)===void 0:v._zod.optout===void 0)&&m.push(p)}m.length>0&&(l.required=m),c.catchall?._zod.def.type==="never"?l.additionalProperties=!1:c.catchall?c.catchall&&(l.additionalProperties=Ft(c.catchall,r,{...o,path:[...o.path,"additionalProperties"]})):r.io==="output"&&(l.additionalProperties=!1)},Xj=(e,r,i,o)=>{const l=e._zod.def,c=l.inclusive===!1,f=l.options.map((h,m)=>Ft(h,r,{...o,path:[...o.path,c?"oneOf":"anyOf",m]}));c?i.oneOf=f:i.anyOf=f},Jj=(e,r,i,o)=>{const l=e._zod.def,c=Ft(l.left,r,{...o,path:[...o.path,"allOf",0]}),f=Ft(l.right,r,{...o,path:[...o.path,"allOf",1]}),h=p=>"allOf"in p&&Object.keys(p).length===1,m=[...h(c)?c.allOf:[c],...h(f)?f.allOf:[f]];i.allOf=m,r.intersections.push(m)};function fp(e,r,i){if(r.$ref){if(i.has(r))return r;i.add(r);const E=e.get(r)?.def;if(!E)return r;const k=fp(e,E,i);return k===E?r:k}for(const E of["anyOf","oneOf"]){const k=r[E];if(!Array.isArray(k))continue;const T=k.map(P=>fp(e,P,i));T.some((P,H)=>P!==k[H])&&(r={...r,[E]:T})}const o=Array.isArray(r.type)?r.type:[r.type],l=!o.includes("string")&&o.some(E=>E==="number"||E==="integer"),c=r.enum??(r.const!==void 0?[r.const]:void 0);if(!l&&!c?.some(E=>typeof E=="number"))return r;const{minimum:f,maximum:h,exclusiveMinimum:m,exclusiveMaximum:p,multipleOf:v,format:y,id:x,...S}=r;return S.enum?S.enum=S.enum.map(E=>typeof E=="number"?String(E):E):typeof S.const=="number"&&(S.const=String(S.const)),l&&(S.type="string",c||(S.pattern=(o.includes("number")?Xp:ck).source)),S}const dp=new WeakMap;function Wj(e){const r=new Map;for(const o of e.seen.values())o.def&&!r.has(o.schema)&&r.set(o.schema,o);const i=new Map;for(const o of dp.get(e)??[]){const l=e.seen.get(o),c=(l?.def??l?.schema)?.propertyNames;if(!c||c===!0||i.has(c))continue;const f=fp(r,c,new Set);f!==c&&i.set(c,f)}if(i.size)for(const o of e.seen.values())for(const l of[o.schema,o.def]){const c=l&&i.get(l.propertyNames);c&&(l.propertyNames=c)}}const eC=(e,r,i,o)=>{const l=i,c=e._zod.def;l.type="object";const f=c.keyType,h=Tr(f).patterns;if(c.mode==="loose"&&h&&h.size>0){const v=Ft(c.valueType,r,{...o,path:[...o.path,"patternProperties","*"]});l.patternProperties={};for(const y of h)wa(l.patternProperties,dw(y).source,v)}else{if(r.target==="draft-07"||r.target==="draft-2020-12"){l.propertyNames=Ft(c.keyType,r,{...o,path:[...o.path,"propertyNames"]});let v=dp.get(r);v||(v=[],dp.set(r,v),r.deferred.push(()=>Wj(r))),v.push(e)}l.additionalProperties=Ft(c.valueType,r,{...o,path:[...o.path,"additionalProperties"]})}const m=f._zod.values,p=r.io==="input"&&ff(c.valueType)!==void 0;if(m&&!c.partial&&!p){const v=[...m].filter(y=>typeof y=="string"||typeof y=="number");v.length>0&&(l.required=v.map(String))}},tC=(e,r,i,o)=>{const l=e._zod.def,c=Ft(l.innerType,r,o),f=r.seen.get(e);r.target==="openapi-3.0"?(f.ref=l.innerType,i.nullable=!0):i.anyOf=[c,{type:"null"}]},nC=(e,r,i,o)=>{const l=e._zod.def;Ft(l.innerType,r,o);const c=r.seen.get(e);c.ref=l.innerType},tg=Symbol();function hw(e,r,i,o,l){let c=!1;const f=JSON.stringify(e,(h,m)=>typeof m!="bigint"?m:(c=!0,null));return c?(pi(r,i,o,l,"BigInt defaults cannot be represented in JSON Schema"),tg):JSON.parse(f)}const rC=(e,r,i,o)=>{const l=e._zod.def;Ft(l.innerType,r,o);const c=r.seen.get(e);c.ref=l.innerType;const f=hw(l.defaultValue,e,r,i,o);f!==tg&&(i.default=f)},aC=(e,r,i,o)=>{const l=e._zod.def;Ft(l.innerType,r,o);const c=r.seen.get(e);if(c.ref=l.innerType,r.io!=="input")return;const f=hw(l.defaultValue,e,r,i,o);f!==tg&&(i._prefault=f)},iC=(e,r,i,o)=>{const l=e._zod.def;Ft(l.innerType,r,o);const c=r.seen.get(e);c.ref=l.innerType;let f;try{f=l.catchValue(void 0)}catch{pi(e,r,i,o,"Dynamic catch values are not supported in JSON Schema");return}i.default=f},oC=(e,r,i,o)=>{const l=e._zod.def,c=l.in._zod.traits.has("$ZodTransform"),f=r.io==="input"?c?l.out:l.in:l.out;Ft(f,r,o);const h=r.seen.get(e);h.ref=f},sC=(e,r,i,o)=>{const l=e._zod.def;Ft(l.innerType,r,o);const c=r.seen.get(e);c.ref=l.innerType,i.readOnly=!0},mw=(e,r,i,o)=>{const l=e._zod.def;Ft(l.innerType,r,o);const c=r.seen.get(e);c.ref=l.innerType},Hx=new WeakSet([Object.prototype,Error.prototype]);function Ou(e,r,i){Object.defineProperty(e,r,{configurable:!0,enumerable:!1,get(){const o=i(this);return Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,r,{value:o,configurable:!0,writable:!0})}})}const lC=(e,r)=>{S4.init(e,r),e.name="ZodError";const i=Object.getPrototypeOf(e);Hx.has(i)||(Hx.add(i),Ou(i,"format",o=>l=>_4(o,l)),Ou(i,"flatten",o=>l=>E4(o,l)),Ou(i,"addIssue",o=>l=>{o.issues.push(l),o.message=JSON.stringify(o.issues,ip,2)}),Ou(i,"addIssues",o=>l=>{o.issues.push(...l),o.message=JSON.stringify(o.issues,ip,2)}),Object.defineProperty(i,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},mr=ie("ZodError",lC,void 0,{Parent:Error}),cC=Yp(mr),uC=Qp(mr),fC=Kp(mr),dC=Gp(mr),hC=C4(mr),mC=O4(mr),pC=A4(mr),gC=z4(mr),yC=M4(mr),vC=D4(mr),bC=L4(mr),xC=B4(mr);function SC(){kr.localeError||Wr(HR())}function kf(){kr.memoizer||Wr({memoizer:LR()})}const Ot=ie("ZodType",(e,r)=>(SC(),Ct.init(e,r),e.def=r,e.type=r.type,e),{check(...e){const r=this.def;return this.clone(Jn(r,{checks:[...r.checks??[],...e.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,r){return gi(this,e,r)},brand(){return this},register(e,r){return e.add(this,r),this},refine(e,r){return this.check(bO(e,r))},superRefine(e,r){return this.check(xO(e,r))},overwrite(e){return )DELIM" +R"DELIM(this.check(hs(e))},optional(){return Ix(this)},exactOptional(){return oO(this)},nullable(){return Zx(this)},nullish(){return Ix(Zx(this))},nonoptional(e){return dO(this,e)},array(){return ea(this)},or(e){return JC([this,e])},and(e){return tO(this,e)},transform(e){return qx(this,iO(e))},default(e){return cO(this,e)},prefault(e){return fO(this,e)},catch(e){return mO(this,e)},pipe(e){return qx(this,e)},readonly(){return yO(this)},describe(e){const r=this.clone();return El.add(r,{description:e}),r},meta(...e){if(e.length===0)return El.get(this);const r=this.clone();return El.add(r,e[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...r){return r.length===0?e(this):e(this,...r)},get"~standard"(){return zS(this,"~standard",{...PS(this),jsonSchema:{input:uf(this,"input"),output:uf(this,"output")}})},set"~standard"(e){mi(this,"~standard",e)},parse:function e(r,i){return cC(this,r,i,{callee:e})},parseAsync:async function e(r,i){return await uC(this,r,i,{callee:e})},safeParse(e,r){return fC(this,e,r)},async safeParseAsync(e,r){return dC(this,e,r)},get spa(){return this?.safeParseAsync},set spa(e){mi(this,"spa",e)},validate(e,r){return k4(this,e,r)},validateAsync(e,r){return j4(this,e,r)},encode:function e(r,i){return hC(this,r,i,{callee:e})},decode:function e(r,i){return mC(this,r,i,{callee:e})},encodeAsync:async function e(r,i){return await pC(this,r,i,{callee:e})},decodeAsync:async function e(r,i){return await gC(this,r,i,{callee:e})},safeEncode(e,r){return yC(this,e,r)},safeDecode(e,r){return vC(this,e,r)},async safeEncodeAsync(e,r){return bC(this,e,r)},async safeDecodeAsync(e,r){return xC(this,e,r)},toJSONSchema(e){return Lj(this,{})(e)},get description(){return El.get(this)?.description},get _def(){return this._zod.def}}),pw=ie("_ZodString",(e,r)=>{Wp.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>$j(e,i,o)},MS({format:e=>Tr(e).format??null,minLength:e=>Tr(e).minimum??null,maxLength:e=>Tr(e).maximum??null},{regex(...e){return this.check(xj(...e))},includes(...e){return this.check(Ej(...e))},startsWith(...e){return this.check(_j(...e))},endsWith(...e){return this.check(Tj(...e))},min(...e){return this.check(cf(...e))},max(...e){return this.check(tw(...e))},length(...e){return this.check(nw(...e))},nonempty(...e){return this.check(cf(1,...e))},lowercase(e){return this.check(Sj(e))},uppercase(e){return this.check(wj(e))},trim(){return this.check(kj())},normalize(...e){return this.check(Nj(...e))},toLowerCase(){return this.check(Rj())},toUpperCase(){return this.check(jj())},slugify(){return this.check(Cj())}})),wC=ie("ZodString",(e,r)=>{Wp.init(e,r),pw.init(e,r)},{email(e){return this.check(ZR(kC,e))},url(e){return this.check(KR(jC,e))},jwt(e){return this.check(uj(qC,e))},emoji(e){return this.check(GR(CC,e))},guid(e){return this.check(qR(RC,e))},uuid(e){return this.check(FR(Au,e))},uuidv4(e){return this.check(VR(Au,e))},uuidv6(e){return this.check(YR(Au,e))},uuidv7(e){return this.check(QR(Au,e))},nanoid(e){return this.check(XR(OC,e))},cuid(e){return this.check(JR(AC,e))},cuid2(e){return this.check(WR(zC,e))},ulid(e){return this.check(ej(MC,e))},base64(e){return this.check(sj(PC,e))},base64url(e){return this.check(lj(IC,e))},xid(e){return this.check(tj(DC,e))},ksuid(e){return this.check(nj(LC,e))},ipv4(e){return this.check(rj(BC,e))},ipv6(e){return this.check(aj(UC,e))},cidrv4(e){return this.check(ij(HC,e))},cidrv6(e){return this.check(oj($C,e))},e164(e){return this.check(cj(ZC,e))},datetime(e){return this.check(fj(EC,e))},date(e){return this.check(dj(_C,e))},time(e){return this.check(hj(TC,e))},duration(e){return this.check(mj(NC,e))}});function nt(e){return IR(wC,e)}const At=ie("ZodStringFormat",(e,r)=>{kt.init(e,r),pw.init(e,r)}),EC=ie("ZodISODateTime",(e,r)=>{qk.init(e,r),At.init(e,r)}),_C=ie("ZodISODate",(e,r)=>{Fk.init(e,r),At.init(e,r)}),TC=ie("ZodISOTime",(e,r)=>{Vk.init(e,r),At.init(e,r)}),NC=ie("ZodISODuration",(e,r)=>{Yk.init(e,r),At.init(e,r)}),kC=ie("ZodEmail",(e,r)=>{Ck.init(e,r),At.init(e,r)}),RC=ie("ZodGUID",(e,r)=>{Rk.init(e,r),At.init(e,r)}),Au=ie("ZodUUID",(e,r)=>{jk.init(e,r),At.init(e,r)}),jC=ie("ZodURL",(e,r)=>{Lk.init(e,r),At.init(e,r)}),CC=ie("ZodEmoji",(e,r)=>{Bk.init(e,r),At.init(e,r)}),OC=ie("ZodNanoID",(e,r)=>{Uk.init(e,r),At.init(e,r)}),AC=ie("ZodCUID",(e,r)=>{Hk.init(e,r),At.init(e,r)}),zC=ie("ZodCUID2",(e,r)=>{$k.init(e,r),At.init(e,r)}),MC=ie("ZodULID",(e,r)=>{Pk.init(e,r),At.init(e,r)}),DC=ie("ZodXID",(e,r)=>{Ik.init(e,r),At.init(e,r)}),LC=ie("ZodKSUID",(e,r)=>{Zk.init(e,r),At.init(e,r)}),BC=ie("ZodIPv4",(e,r)=>{Qk.init(e,r),At.init(e,r)}),UC=ie("ZodIPv6",(e,r)=>{Gk.init(e,r),At.init(e,r)}),HC=ie("ZodCIDRv4",(e,r)=>{Xk.init(e,r),At.init(e,r)}),$C=ie("ZodCIDRv6",(e,r)=>{Wk.init(e,r),At.init(e,r)}),PC=ie("ZodBase64",(e,r)=>{eR.init(e,r),At.init(e,r)}),IC=ie("ZodBase64URL",(e,r)=>{nR.init(e,r),At.init(e,r)}),ZC=ie("ZodE164",(e,r)=>{rR.init(e,r),At.init(e,r)}),qC=ie("ZodJWT",(e,r)=>{iR.init(e,r),At.init(e,r)}),gw=ie("ZodNumber",(e,r)=>{YS.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Pj(e,i,o,l),e.isFinite=!0},MS({minValue:e=>{const{minimum:r,exclusiveMinimum:i}=Tr(e);return Math.max(r??Number.NEGATIVE_INFINITY,i??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:r,exclusiveMaximum:i}=Tr(e);return Math.min(r??Number.POSITIVE_INFINITY,i??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:r,multipleOf:i}=Tr(e);return!!r||!!i?.some(Number.isSafeInteger)},format:e=>Tr(e).format??null},{gt(e,r){return this.check(Cx(e,r))},gte(e,r){return this.check(wm(e,r))},min(e,r){return this.check(wm(e,r))},lt(e,r){return this.check(jx(e,r))},lte(e,r){return this.check(Sm(e,r))},max(e,r){return this.check(Sm(e,r))},int(e){return this.check($x(e))},safe(e){return this.check($x(e))},positive(e){return this.check(Cx(0,e))},nonnegative(e){return this.check(wm(0,e))},negative(e){return this.check(jx(0,e))},nonpositive(e){return this.check(Sm(0,e))},multipleOf(e,r){return this.check(Ox(e,r))},step(e,r){return this.check(Ox(e,r))},finite(){return this}}));function qe(e){return pj(gw,e)}const FC=ie("ZodNumberFormat",(e,r)=>{oR.init(e,r),gw.init(e,r)});function $x(e){return gj(FC,e)}const VC=ie("ZodBoolean",(e,r)=>{sR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Ij(e,i,o)});function si(e){return yj(VC,e)}const YC=ie("ZodUnknown",(e,r)=>{lR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>qj()});function hp(){return vj(YC)}const QC=ie("ZodNever",(e,r)=>{cR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Zj(e,i,o)});function KC(e){return bj(QC,e)}const GC=ie("ZodArray",(e,r)=>{kf(),dR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Kj(e,i,o,l),e.element=r.element},{min(e,r){return this.check(cf(e,r))},nonempty(e){return this.check(cf(1,e))},max(e,r){return this.check(tw(e,r))},length(e,r){return this.check(nw(e,r))},unwrap(){return this.element}});function ea(e,r){return Oj(GC,e,r)}const XC=ie("ZodObject",(e,r)=>{kf(),pR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Gj(e,i,o,l),h4(e,"shape",i=>i._zod.def.shape,!1)},{keyof(){return bw(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Jn(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Jn(this._zod.def,{catchall:hp()}))},loose(){return this.clone(Jn(this._zod.def,{catchall:hp()}))},strict(){return this.clone(Jn(this._zod.def,{catchall:KC()}))},strip(){return this.clone(Jn(this._zod.def,{catchall:void 0}))},extend(e){return n4(this,e)},safeExtend(e){return r4(this,e)},merge(e){return a4(this,e)},pick(e){return e4(this,e)},omit(e){return t4(this,e)},partial(...e){return fx(xw,this,e[0])},exactPartial(...e){return fx(Sw,this,e[0],"exactPartial")},required(...e){return i4(ww,this,e[0])}});function wt(e,r){const i={type:"object",shape:e??{},...ke(r)};return new XC(i)}const yw=ie("ZodUnion",(e,r)=>{GS.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Xj(e,i,o,l),e.options=r.options});function JC(e,r){return new yw({type:"union",options:e,...ke()DELIM" +R"DELIM(r)})}const WC=ie("ZodDiscriminatedUnion",(e,r)=>{yw.init(e,r),yR.init(e,r)});function vw(e,r,i){return new WC({type:"union",options:r,discriminator:e,...ke(i)})}const eO=ie("ZodIntersection",(e,r)=>{vR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Jj(e,i,o,l)});function tO(e,r){return new eO({type:"intersection",left:e,right:r})}const Px=ie("ZodRecord",(e,r)=>{kf(),bR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>eC(e,i,o,l),e.keyType=r.keyType,e.valueType=r.valueType});function nO(e,r,i){return!r||!r._zod?new Px({type:"record",keyType:nt(),valueType:e,...ke(r)}):new Px({type:"record",keyType:e,valueType:r,...ke(i)})}const mp=ie("ZodEnum",(e,r)=>{xR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(o,l,c)=>Fj(e,o,l),e.enum=r.entries,e.options=[...e._zod.values];const i=new Set(Object.keys(r.entries));e.extract=(o,l)=>{const c={};for(const f of o)if(i.has(f))c[f]=r.entries[f];else throw new Error(`Key ${f} not found in enum`);return new mp({...r,checks:[],...ke(l),entries:c})},e.exclude=(o,l)=>{const c={...r.entries};for(const f of o)if(i.has(f))delete c[f];else throw new Error(`Key ${f} not found in enum`);return new mp({...r,checks:[],...ke(l),entries:c})}});function bw(e,r){const i=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new mp({type:"enum",entries:i,...ke(r)})}const rO=ie("ZodLiteral",(e,r)=>{SR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Vj(e,i,o,l),e.values=new Set(r.values),Object.defineProperty(e,"value",{get(){if(r.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return r.values[0]}})});function li(e,r){return new rO({type:"literal",values:Array.isArray(e)?e:[e],...ke(r)})}const aO=ie("ZodTransform",(e,r)=>{kf(),wR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Qj(e,i,o,l),e._zod.parse=(i,o)=>{if(o.direction==="backward")throw new DS(e.constructor.name);i.addIssue=c=>{if(typeof c=="string")i.issues.push(Hl(c,i.value,r));else{const f=c;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),"input"in f||(f.input=i.value),f.inst??(f.inst=e),i.issues.push(Hl(f))}};const l=r.transform(i.value,i);return l instanceof Promise?l.then(c=>(i.value=c,i)):(i.value=l,i)}});function iO(e){return new aO({type:"transform",transform:e})}const xw=ie("ZodOptional",(e,r)=>{XS.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>mw(e,i,o,l),e.unwrap=()=>e._zod.def.innerType});function Ix(e){return new xw({type:"optional",innerType:e})}const Sw=ie("ZodExactOptional",(e,r)=>{ER.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>mw(e,i,o,l),e.unwrap=()=>e._zod.def.innerType});function oO(e){return new Sw({type:"optional",innerType:e})}const sO=ie("ZodNullable",(e,r)=>{_R.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>tC(e,i,o,l),e.unwrap=()=>e._zod.def.innerType});function Zx(e){return new sO({type:"nullable",innerType:e})}const lO=ie("ZodDefault",(e,r)=>{TR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>rC(e,i,o,l),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function cO(e,r){return new lO({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():jS(r)}})}const uO=ie("ZodPrefault",(e,r)=>{NR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>aC(e,i,o,l),e.unwrap=()=>e._zod.def.innerType});function fO(e,r){return new uO({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():jS(r)}})}const ww=ie("ZodNonOptional",(e,r)=>{kR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>nC(e,i,o,l),e.unwrap=()=>e._zod.def.innerType});function dO(e,r){return new ww({type:"nonoptional",innerType:e,...ke(r)})}const hO=ie("ZodCatch",(e,r)=>{RR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>iC(e,i,o,l),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function mO(e,r){return new hO({type:"catch",innerType:e,catchValue:typeof r=="function"?r:p4(r)})}const pO=ie("ZodPipe",(e,r)=>{jR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>oC(e,i,o,l),e.in=r.in,e.out=r.out});function qx(e,r){return new pO({type:"pipe",in:e,out:r})}const gO=ie("ZodReadonly",(e,r)=>{CR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>sC(e,i,o,l),e.unwrap=()=>e._zod.def.innerType});function yO(e){return new gO({type:"readonly",innerType:e})}const vO=ie("ZodCustom",(e,r)=>{OR.init(e,r),Ot.init(e,r),e._zod.processJSONSchema=(i,o,l)=>Yj(e,i,o,l)});function bO(e,r={}){return Aj(vO,e,r)}function xO(e,r){return zj(e,r)}function xa(e){if(!e)return;const r=e.trim();if(!r)return;const i=r.toLowerCase(),o=i.indexOf("1");if(o>0){const f=i.slice(0,o);if(["bc","tb","bcrt","ltc","sb"].includes(f)){const h=i.slice(o+1);if(!h)return;const m=h.charAt(0);return m==="p"?"p2tr":m==="q"?h.length===39||h.length===40||e.length===42?"p2wpkh":h.length===59||h.length===60||e.length===62?"p2wsh":"segwit":"segwit"}}const l=/^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$/u.test(r)&&r.length>=26&&r.length<=35;switch(i[0]){case"1":case"m":case"n":return l?"p2pkh":void 0;case"3":case"2":return l?"p2sh":void 0;default:return}}class ng extends Error{constructor(r,i){super(r),this.status=i}status}const pp=wt({id:nt(),height:qe(),timestamp:qe().optional(),mediantime:qe().optional(),tx_count:qe().optional(),size:qe().optional(),weight:qe().optional(),difficulty:qe().optional(),bits:qe().optional(),merkle_root:nt().optional(),previousblockhash:nt().nullable().optional(),nonce:qe().optional(),version:qe().optional()}).loose(),Ew=wt({confirmed:si(),block_height:qe().optional(),block_hash:nt().optional(),block_time:qe().optional()}),SO=wt({txid:nt().optional().nullable(),vout:qe().optional().nullable(),sequence:qe().optional(),scriptsig:nt().optional().nullable(),scriptsig_asm:nt().optional().nullable(),witness:ea(nt()).optional(),is_coinbase:si().optional(),prevout:wt({scriptpubkey_type:nt().optional(),scriptpubkey_address:nt().optional(),scriptpubkey:nt().optional(),scriptpubkey_asm:nt().optional(),value:qe().optional()}).partial().nullable().optional()}).loose(),wO=wt({scriptpubkey_type:nt().optional(),scriptpubkey_address:nt().optional(),scriptpubkey:nt().optional(),scriptpubkey_asm:nt().optional(),value:qe(),n:qe().optional()}).loose(),Yu=wt({txid:nt(),hash:nt().optional(),fee:qe().optional(),version:qe(),locktime:qe(),vin:ea(SO),vout:ea(wO),size:qe(),weight:qe(),status:Ew}).loose(),rg=ea(pp),df=ea(Yu),Em=wt({in_best_chain:si(),next_best:nt().optional(),height:qe().optional()}),EO=wt({id:nt().regex(/^[0-9a-f]{64}$/iu),mediantime:qe().int().nonnegative().max(4294967295).optional()}),Fx=wt({address:nt(),chain_stats:wt({funded_txo_count:qe().optional(),funded_txo_sum:qe().optional(),spent_txo_count:qe().optional(),spent_txo_sum:qe().optional(),tx_count:qe().optional()}),mempool_stats:wt({funded_txo_count:qe().optional(),funded_txo_sum:qe().optional(),spent_txo_count:qe().optional(),spent_txo_sum:qe().optional(),tx_count:qe().optional()})}),_O=wt({txid:nt(),vout:qe().int().nonnegative(),value:qe().nonnegative(),status:Ew}).loose(),TO=ea(_O),NO=vw("spent",[wt({spent:li(!1)}),wt({spent:li(!0),txid:nt().regex(/^[0-9a-f]{64}$/iu),vin:qe().int().nonnegative().max(4294967295)})]);async function qt(e,r,i){const o=r.startsWith("/")?r:`/${r}`,l=await fetch(`${e}${o}`);if(!l.ok)throw new ng(`Request to ${r} failed with status ${String(l.status)}`,l.status);const c=await l.json();return i.parse(c)}async function Vx(e,r,i){if(i<=0)return[];const o=[];let l=r;for(;l&&o.lengthc.scriptpubkey_address===e?l+c.value:l,0),o=r.vin.reduce((l,c)=>{const f=c.prevout;return f?.scriptpubkey_address===e&&typeof f.value=="number"?l+f.value:l},0);return i-o}async function _m(e,r){if(r==="latest"||r==="tip"){const i=await qt(e,"/blocks",rg);if(i.length===0)throw new Error("No blocks returned from API");return i[0].id}if(/^\d+$/.test(r)){const i=await fetch(`${e}/block-height/${r}`);if(!i.ok)throw new ng("Unable to resolve block height",i.status);return(await i.text()).trim()}return r}async function Qx(e,r,i){if(i.lastKnownHeight==null||r>=i.lastKnownHeight)return null;const o=r+1;try{const l=await fetch(`${e}/block-height/${String(o)}`);return l.ok&&(await l.text()).trim()||null}catch(l){return console.warn(`Failed to resolve hash for height ${String(o)}`,l),null}}function pl(e){return{hash:e.id,height:e.height,timestamp:e.timestamp??e.mediantime??0,txCount:e.tx_count??0,size:e.size??0,weight:e.weight??0,difficulty:e.difficulty,previousBlockHash:e.previousblockhash??null}}function Tm(e,r){const i=e.status.confirmed?"confirmed":"unconfirmed",o=e.vin.map((m,p)=>{const v=m.is_coinbase||m.txid==null?void 0:typeof m.vout=="number"&&m.vout!==4294967295?m.vout:void 0;return{index:p,prevTxId:m.txid??void 0,prevOutputIndex:v,address:m.prevout?.scriptpubkey_address??void 0,valueSats:m.prevout?.value,scriptType:m.prevout?.scriptpubkey_type,isCoinbase:m.is_coinbase??!1,script:typeof m.scriptsig=="string"||m.scriptsig_asm?{hex:m.scriptsig??void 0,mnemonic:m.scriptsig_asm??void 0}:void 0,witness:m.witness??void 0,sequence:m.sequence}}),l=e.vout.map((m,p)=>({index:p,address:m.scriptpubkey_address??void 0,valueSats:m.value,scriptType:m.scriptpubkey_type,spent:void 0,script:typeof m.scriptpubkey=="string"||m.scriptpubkey_asm?{hex:m.scriptpubkey??void 0,mnemonic:m.scriptpubkey_asm??void 0}:void 0})),c=l.reduce((m,p)=>m+p.valueSats,0),f=r.lastKnownHeight;let h=0;return e.status.block_height&&i==="confirmed"&&(h=f&&f>=e.status.block_height?f-e.status.block_height+1:1),{txid:e.txid,hash:e.hash??e.txid,status:i,confirmations:h,blockHeight:e.status.block_height,blockHash:e.status.block_hash,receivedTime:e.status.block_time,feeSats:e.fee??null,feeRate:e.fee?e.fee/e.weight*4:null,size:e.size,weight:e.weight,version:e.version,locktime:e.locktime,totalInput:null,totalOutput:c,inputs:o,outputs:l}}function RO(e,r){const i=e.chain_stats,o=e.mempool_stats,l=(i.funded_txo_sum??0)-(i.spent_txo_sum??0),c=_w(e.address,r.slice(0,25));return{address:e.address,addressType:xa(e.address),balance:l,totalReceived:(i.funded_txo_sum??0)+(o.funded_txo_sum??0),totalSent:(i.spent_txo_sum??0)+(o.spent_txo_sum??0),txCount:(i.tx_count??0)+(o.tx_count??0),utxoCount:(i.funded_txo_count??0)-(i.spent_txo_count??0),transactions:c}}function jO(e){const r=e.chain_stats,i=e.mempool_stats,o=(r.funded_txo_sum??0)-(r.spent_txo_sum??0);return{address:e.address,addressType:xa(e.address),balance:o,totalReceived:(r.funded_txo_sum??0)+(i.funded_txo_sum??0),totalSent:(r.spent_txo_sum??0)+(i.spent_txo_sum??0),txCount:(r.tx_count??0)+(i.tx_count??0),utxoCount:(r.funded_txo_count??0)-(r.spent_txo_count??0)}}function _w(e,r){return r.map(i=>({txid:i.txid,timestamp:i.status.block_time,valueChange:kO(e,i),blockHeight:i.status.block_height}))}async function Kx(e,r,i=0){const o=i>0?`/block/${r}/txs/${String(i)}`:`/block/${r}/txs`;return qt(e,o,df)}async function CO(e,r,i){return i?qt(e,`/address/${r}/txs/chain/${i}`,df):qt(e,`/address/${r}/txs`,df)}function Tw({baseUrl:e}){const r=new Set;let i=null;const o={lastBlockHash:null,lastKnownHeight:null};async function l(h){const m=await qt(e,`/tx/${h}`,Yu);return await(m.status.block_height?Fo(e,o,m.status.block_height):Fo(e,o)),Tm(m,o)}function c(){i||r.size===0||(i=setInterval(async()=>{try{const h=await qt(e,"/blocks",rg);if(h.length===0)return;const m=h[0];if(m.id!==o.lastBlockHash){o.lastBlockHash=m.id,o.lastKnownHeight=Math.max(m.height,o.lastKnownHeight??0);const p=pl(m);for(const v of r)v({type:"block.new",payload:p})}}catch(h){console.warn("Block polling failed",h)}},15e3))}function f(){i&&(clearInterval(i),i=null)}return{metadata:{id:"blockstream",label:"Blockstream.info",type:"external",connectionState:"connected",supportsWebsocket:!1,endpoint:e,description:"Read-only adapter using Blockstream public REST API."},getConfiguration(){return Promise.resolve({address:!0,filter:!1,turbo:!1,witness:!0,retarget:!1,difficult:!1})},async getLatestBlocks(h=10){const m=await Vx(e,"/blocks",h);return m.length>0&&(o.lastBlockHash=m[0].id,o.lastKnownHeight=Math.max(m[0].height,o.lastKnownHeight??0)),m.map(p=>pl(p))},async getBlocksBefore(h,m=10){const p=Math.max(h,0),v=await Vx(e,`/blocks/${String(p)}`,m);return v.length>0&&(o.lastKnownHeight=Math.max(v[0].height,o.lastKnownHeight??0)),v.map(y=>pl(y))},async getBlockHeader(h){const m=await _m(e,h);await Fo(e,o);const[p,v]=await Promise.all([qt(e,`/block/${m}`,pp),qt(e,`/block/${m}/status`,Em).catch(()=>null)]),y=pl(p);o.lastBlockHash=y.hash,o.lastKnownHeight=Math.max(y.height,o.lastKnownHeight??y.height);let x=v?.next_best??null;return x||(x=await Qx(e,y.height,o)),{...y,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:x}},async getBlockValidation(h){const[m,p]=await Promise.all([qt(e,`/block/${h}`,EO),qt(e,`/block/${h}/status`,Em)]);if(m.id.toLowerCase()!==h.toLowerCase())throw new Error("Block validation response does not match the requested block");return{medianTimePast:m.mediantime,inBestChain:p.in_best_chain}},getBlockStats(){return Promise.resolve({})},async getBlock(h){const m=await _m(e,h);await Fo(e,o);const p=await qt(e,`/block/${m}`,pp),[v,y]=await Promise.allSettled([Kx(e,m),qt(e,`/block/${m}/status`,Em)]);v.status==="rejected"&&console.warn("Failed to load block transactions, defaulting to empty set",v.reason),y.status==="rejected"&&console.warn("Failed to load block status, defaulting to unknown",y.reason);const x=pl(p);o.lastBlockHash=x.hash,o.lastKnownHeight=Math.max(x.height,o.lastKnownHeight??x.height);const S=v.status==="fulfilled"?v.value:[];let k=(y.status==="fulfilled"?y.value:null)?.next_best??null;return k||(k=await Qx(e,x.height,o)),{...x,merkleRoot:p.merkle_root,nonce:p.nonce,bits:p.bits,version:p.version,nextBlockHash:k,transactions:S.map(P=>Tm(P,o))}},async getBlockTransactions(h,m=0){const p=await _m(e,h),v=await Kx(e,p,m),y=v.reduce((x,S)=>S.status.block_height?x===null?S.status.block_height:Math.max(x,S.status.block_height):x,null);return await(typeof y=="number"?Fo(e,o,y):Fo(e,o)),v.map(x=>Tm(x,o))},async getTransactionHeader(h){return l(h)},async getTransaction(h){return l(h)},async getTransactionInputScriptHex(h,m){const p=await qt(e,`/tx/${h}`,Yu);if(m<0||m>=p.vin.length)throw new RangeError(`Input index ${String(m)} not found`);const y=p.vin[m].scriptsig;return typeof y=="string"?y:""},async getTransactionOutputScriptHex(h,m){const p=await qt(e,`/tx/${h}`,Yu);if(m<0||m>=p.vout.length)throw new RangeError(`Output index ${String(m)} not found`);const y=p.vout[m].scriptpubkey;if(typeof y!="string")throw new TypeError("Output script missing in provider response");return y},async getTransactionOutputSpends(h,m){if(m.length===0)return[];const p=await qt(e,`/tx/${h}/outspends`,ea(hp()));return m.map(v=>{const y=NO.safeParse(p[v]);return y.success?y.data.spent?{outputIndex:v,status:"spent",txid:y.data.txid.toLowerCase(),inputIndex:y.data.vin}:{outputIndex:v,status:"unspent"}:{outputIndex:v,status:"unknown"}})},async getAddressSummary(h){const m=await qt(e,`/address/${h}`,Fx);return jO(m)},async getAddressUtxos(h){return(await qt(e,`/address/${h}/utxo`,TO)).map(p=>({txid:p.txid,outputIndex:p.vout,valueSats:p.value,status:p.status.confirmed?"confirmed":"unconfirmed",blockHeight:p.status.block_height,blockHash:p.status.block_hash,timestamp:p.status.block_time}))},async getAddress(h){const m=await qt(e,`/address/${h}`,Fx),p=await qt(e,`/address/${h}/txs`,df);return RO(m,p)},asy)DELIM" +R"DELIM(nc getAddressTransactions(h,m){const p=await CO(e,h,m);return _w(h,p)},subscribeToEvents(h){return r.add(h),c(),()=>{r.delete(h),r.size===0&&f()}}}}function OO({baseUrl:e}){const r=Tw({baseUrl:e});return{...r,metadata:{...r.metadata,id:"mempool",label:"mempool.space",endpoint:e,description:"Adapter backed by mempool.space REST API."}}}const ag=e=>Object.freeze(e());function Nw(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Gi(e){if(!Nw(e))throw new TypeError("Uint8Array expected")}function AO(e,r){return Array.isArray(r)?r.length===0?!0:r.every(i=>Number.isSafeInteger(i)):!1}function ig(e){if(typeof e!="function")throw new TypeError("function expected");return!0}function hf(e,r){if(typeof r!="string")throw new TypeError(`${e}: string expected`);return!0}function mf(e,r="number"){if(typeof e!="number")throw new TypeError(`${r}: expected number, got ${typeof e}`);if(!Number.isSafeInteger(e))throw new RangeError(`${r}: expected safe integer, got ${e}`)}function Gx(e,r){if(!AO(!1,r))throw new TypeError(`${e}: array of numbers expected`)}function zO(...e){const r=c=>c,i=(c,f)=>h=>c(f(h)),o=e.map(c=>c.encode).reduceRight(i,r),l=e.map(c=>c.decode).reduce(i,r);return{encode:o,decode:l}}const MO=(()=>{let e=[];for(let r=0;r<40;r++)e.push(2**r);return e})();function Xx(e,r=e.length){const i=new Array(r);for(let o=0;o{try{const e=new TextDecoder;return e.decode(Uint8Array.of(65,48,43,127))==="A0+"?e:void 0}catch{return}})(),Nm=8192;function DO(e){const r=e.length;if(Jx!==void 0&&r>=12)return Jx.decode(e);if(r<=Nm)return String.fromCharCode.apply(null,e);let i="";for(let o=0;o8)throw new RangeError("radix2: bits should be in (0..8]");const r=MO[e]-1;return{encode:i=>{Gi(i);const o=i.length,l=new Uint8Array(Math.ceil(o*8/e));let c=0,f=0,h=0;for(let m=0;m>f&r,!(f0&&(l[h]=c<{const o=i.length,l=new Uint8Array(Math.floor(o*e/8));let c=0,f=0,h=0;for(let m=0;m=8;f-=8)l[h++]=c>>f-8&255;if(c=c<<8-f&255,f>=e)throw new Error("Excess padding");if(c>0)throw new Error(`Non-zero padding: ${c}`);return l}}}function kw(e,r){const i=e.length;if(i>128)throw new Error("alphabet: max 128 letters");const o=new Uint8Array(i),l=new Int8Array(128).fill(-1);for(let c=0;c127)throw new Error("alphabet: single-char ASCII letters only");o[c]=f,l[f]=c}if(r!==void 0)for(const c of Object.keys(r)){const f=c.charCodeAt(0),h=l[r[c].charCodeAt(0)];if(c.length!==1||f>127||h===void 0||h===-1)throw new Error(`alphabet: invalid alias ${c}`);l[f]=h}return{encode:c=>{const f=new Uint8Array(c.length);for(let h=0;h{hf("decode",c);const f=c.length,h=new Uint8Array(f);for(let m=0;m({encode:i=>{Gi(i);const o=i.length;if(o===0)return new Uint8Array(0);if(o>=e1)throw new Error("invalid length");let l=0;for(;l=l;E=Math.floor(E/e))x[S--]=E%e;return x},decode:i=>{Gi(i);const o=i.length;if(o===0)return new Uint8Array(0);if(o>=e1)throw new Error("invalid length");let l=0;for(;l=e)throw new Error(`invalid integer: ${T}`);x=x*e+T,S*=e}m=5;let E=x;for(let k=0;k0;E=Math.floor(E/65536))c[f++]=E%65536}const p=f===0?1:f*2-(c[f-1]<256?1:0),v=new Uint8Array(l+p);let y=v.length-1;for(let x=0;x=l&&(v[y--]=S>>8)}return v}}),IO=(e,r)=>{const i=kw(r);return{encode(o){if(Gi(o),o.length>HO)throw new Error("invalid length");return i.encode(e.encode(o))},decode(o){if(hf("baseN.decode",o),o.length>$O)throw new Error("invalid length");return e.decode(i.decode(o))}}},ZO=PO(58,UO),qO=e=>IO(ZO,e),FO=ag(()=>qO("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),VO=e=>{ig(e);const r=e;return zO(BO(4,i=>r(r(i))),FO)},gp=kw("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),YO=/^[\x21-\x60\x7b-\x7e]+$/;function t1(e,r){for(let i=0;i126)throw new Error(`${e}: printable ASCII expected`)}}function QO(e){const r=e.length,i=new Uint8Array(r);for(let o=0;o=32)throw new Error(`alphabet.encode: invalid digit ${l}`);i[o]=l}return i}const n1=[996825010,642813549,513874426,1027748829,705979059];function gl(e){const r=e>>25;let i=(e&33554431)<<5;for(let o=0;o>o&1)===1&&(i^=n1[o]);return i}function r1(e,r,i=1){const o=e.length;let l=1;for(let f=0;f126)throw new Error(`Invalid prefix (${e})`);l=gl(l)^h>>5}l=gl(l);for(let f=0;f>>5*(5-f)&31;return gp.encode(c)}function Rw(e){const r=e==="bech32"?1:734539939,i=LO(5),o=y=>{Gi(y);const x=y.length,S=new Array(Math.ceil(x*8/5));let E=0,k=0,T=0;for(let P=0;P=5;k-=5)S[T++]=E>>k-5&31;return k>0&&(S[T]=E<<5-k&31),S},l=y=>{Gx("radix2.decode",y);const x=y.length,S=new Uint8Array(x);for(let E=0;E=32)throw new Error(`convertRadix2: invalid word=${k}`);S[E]=k}return i.decode(S)},c=Wx(l);function f(y,x,S=90){hf("bech32.encode prefix",y),S!==!1&&mf(S,"limit"),Nw(x)&&(x=Xx(x)),Gx("bech32.encode",x);const E=y.length;if(E===0)throw new TypeError(`Invalid prefix length ${E}`);const k=E+7+x.length;if(S!==!1&&k>S)throw new TypeError(`Length ${k} exceeds limit ${S}`);t1("bech32.encode prefix",y);const T=y.toLowerCase(),P=r1(T,x,r);return`${T}1${gp.encode(QO(x))}${P}`}function h(y,x=90){hf("bech32.decode input",y),x!==!1&&mf(x,"limit");const S=y.length;if(S<8||x!==!1&&S>x)throw new TypeError(`invalid string length ${S}, expected (8..${x})`);const E=y.toLowerCase();if(y!==E&&!YO.test(y))throw t1("bech32.decode input",y),new Error("mixed-case string not allowed");const k=E.lastIndexOf("1");if(k===0||k===-1)throw new Error('invalid separator "1"');const T=E.slice(0,k),P=E.slice(k+1);if(P.length<6)throw new Error("invalid data length");const H=gp.decode(P),te=Xx(H,H.length-6),de=r1(T,te,r);if(!P.endsWith(de))throw new Error(`Invalid checksum in ${y}`);return{prefix:T,words:te}}const m=Wx(h);function p(y,x=90){const{prefix:S,words:E}=h(y,x);return{prefix:S,words:E,bytes:l(E)}}function v(y,x){return f(y,o(x))}return{encod)DELIM" +R"DELIM(e:f,decode:h,encodeFromBytes:v,decodeToBytes:p,decodeUnsafe:m,fromWords:l,fromWordsUnsafe:c,toWords:o}}const pf=ag(()=>Rw("bech32")),yp=ag(()=>Rw("bech32m")),KO=e=>e/2**32|0,GO=e=>e>>>0;function XO(e,r,i,o){const l=KO(i),c=GO(i);e.setUint32(r,o?c:l,o),e.setUint32(r+4,o?l:c,o)}function a1(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}const JO=e=>e?`"${e}" `:"";function og(e,r,i=""){if(a1(e)&&r===void 0)return e;const o=a1(e),l="",c=o?`length=${e.length}`:`type=${typeof e}`,f=JO(i)+"expected Uint8Array"+l+", got "+c;throw o?new RangeError(f):new TypeError(f)}const WO=(e,r)=>{if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError((r==="object"?"":`"${r}" `)+"expected object, got type="+typeof e)},i1=(e,r)=>{WO(e,r);const i=Object.getPrototypeOf(e);if(i!==Object.prototype&&i!==null)throw new TypeError(`"${r}" expected plain object`);if(Object.hasOwn(e,"__proto__"))throw new TypeError(`"${r}.__proto__" is not allowed`)};function o1(e,r=!0){if(e.destroyed)throw new Error("hash was destroyed");if(r&&e.finished)throw new Error("digest() was already called")}function e3(e,r){og(e,void 0,"output");const i=r.outputLen;if(!(e.length>=i))throw new RangeError('"output" expected length >= '+i)}function s1(...e){for(let r=0;r>>r}const t3=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",n3=Array.from({length:256},(e,r)=>r.toString(16).padStart(2,"0"));function Qu(e){if(og(e),t3)return e.toHex();let r="";for(let i=0;i{let v={relativePath:p===void 0?f.path||"":p,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(o)&&m)return;Ue(v.relativePath.startsWith(o),`Absolute route path "${v.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(o.length)}let y=hr([o,v.relativePath]),x=i.concat(v);f.children&&f.children.length>0&&(Ue(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),fE(f.children,r,x,y,m)),!(f.path==null&&!f.index)&&r.push({path:y,score:MA(y,f.index),routesMeta:x.map((S,E)=>{let[k,T]=mE(S.relativePath,S.caseSensitive,E===x.length-1);return{...S,matcher:k,compiledParams:T}})})};return e.forEach((f,h)=>{if(f.path===""||!f.path?.includes("?"))c(f,h);else for(let m of dE(f.path))c(f,h,!0,m)}),r}functi)DELIM" +R"DELIM(on dE(e){let r=e.split("/");if(r.length===0)return[];let[i,...o]=r,l=i.endsWith("?"),c=i.replace(/\?$/,"");if(o.length===0)return l?[c,""]:[c];let f=dE(o.join("/")),h=[];return h.push(...f.map(m=>m===""?c:[c,m].join("/"))),l&&h.push(...f),h.map(m=>e.startsWith("/")&&m===""?"/":m)}function kA(e){e.sort((r,i)=>r.score!==i.score?i.score-r.score:DA(r.routesMeta.map(o=>o.childrenIndex),i.routesMeta.map(o=>o.childrenIndex)))}var RA=/^:[\w-]+$/,jA=3,CA=2,OA=1,AA=10,zA=-2,T1=e=>e==="*";function MA(e,r){let i=e.split("/"),o=i.length;return i.some(T1)&&(o+=zA),r&&(o+=CA),i.filter(l=>!T1(l)).reduce((l,c)=>l+(RA.test(c)?jA:c===""?OA:AA),o)}function DA(e,r){return e.length===r.length&&e.slice(0,-1).every((o,l)=>o===r[l])?e[e.length-1]-r[r.length-1]:0}function LA(e,r,i=!1){let{routesMeta:o}=e,l={},c="/",f=[];for(let h=0;h{if(v==="*"){let E=h[x]||"";f=us(c.slice(0,c.length-E.length),1)}const S=h[x];return y&&!S?p[v]=void 0:p[v]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:f,pattern:e}}function mE(e,r=!1,i=!0){Nt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let o=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,m,p,v)=>{if(o.push({paramName:h,isOptional:m!=null}),m){let y=v.charAt(p+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(o.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,r?void 0:"i"),o]}function BA(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return Nt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),e}}function er(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let i=r.endsWith("/")?r.length-1:r.length,o=e.charAt(i);return o&&o!=="/"?null:e.slice(i)||"/"}function UA({basename:e,pathname:r}){return r==="/"?e:hr([e,r])}var hg=e=>jf.test(e);function HA(e,r="/"){let{pathname:i,search:o="",hash:l=""}=typeof e=="string"?na(e):e,c;return i?(i=mg(i),i.startsWith("/")||i.startsWith("\\")?c=N1(i.substring(1),"/"):c=N1(i,r)):c=r,{pathname:c,search:PA(o),hash:IA(l)}}function N1(e,r){let i=us(r).split("/");return e.split("/").forEach(l=>{l===".."?i.length>1&&i.pop():l!=="."&&i.push(l)}),i.length>1?i.join("/"):"/"}function Lm(e,r,i,o){return`Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function pE(e){return e.filter((r,i)=>i===0||r.route.path&&r.route.path.length>0)}function Of(e){let r=pE(e);return r.map((i,o)=>o===r.length-1?i.pathname:i.pathnameBase)}function Kl(e,r,i,o=!1){let l;typeof e=="string"?l=na(e):(l={...e},Ue(!l.pathname||!l.pathname.includes("?"),Lm("?","pathname","search",l)),Ue(!l.pathname||!l.pathname.includes("#"),Lm("#","pathname","hash",l)),Ue(!l.search||!l.search.includes("#"),Lm("#","search","hash",l)));let c=e===""||l.pathname==="",f=c?"/":l.pathname,h;if(f==null)h=i;else{let y=r.length-1;if(!o&&f.startsWith("..")){let x=f.split("/");for(;x[0]==="..";)x.shift(),y-=1;l.pathname=x.join("/")}h=y>=0?r[y]:"/"}let m=HA(l,h),p=f&&f!=="/"&&f.endsWith("/"),v=(c||f===".")&&i.endsWith("/");return!m.pathname.endsWith("/")&&(p||v)&&(m.pathname+="/"),m}var mg=e=>e.replace(/[\\/]{2,}/g,"/"),hr=e=>mg(e.join("/"));function us(e,r=0){let i=e.length;for(;i>r&&e.charCodeAt(i-1)===47;)i--;return i===e.length?e:e.slice(0,i)}var $A=e=>us(e).replace(/^\/*/,"/"),PA=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,IA=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ZA=["EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Gl=class{constructor(e,r,i,o=!1){this.status=e,this.statusText=r||"",this.internal=o,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function Zl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Xl(e){let r=e.map(i=>i.route.path).filter(Boolean);return hr(r)||"/"}var gE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yE(e,r){let i=e;if(typeof i!="string"||!jf.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let o=i,l=!1;if(gE)try{let c=new URL(window.location.href),f=Cf.test(i)?new URL(oE(i,c.protocol)):new URL(i),h=er(f.pathname,r);f.origin===c.origin&&h!=null?i=h+f.search+f.hash:l=!0}catch{Nt(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:l,to:i}}var fi=Symbol("Uninstrumented");function qA(e,r){let i={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(l=>l({id:r.id,index:r.index,path:r.path,instrument(c){let f=Object.keys(i);for(let h of f)c[h]&&i[h].push(c[h])}}));let o={};if(typeof r.lazy=="function"&&i.lazy.length>0){let l=Jo(i.lazy,r.lazy,()=>{});l&&(o.lazy=l)}if(typeof r.lazy=="object"){let l=r.lazy;["middleware","loader","action"].forEach(c=>{let f=l[c],h=i[`lazy.${c}`];if(typeof f=="function"&&h.length>0){let m=Jo(h,f,()=>{});m&&(o.lazy=Object.assign(o.lazy||{},{[c]:m}))}})}return["loader","action"].forEach(l=>{let c=r[l];if(typeof c=="function"&&i[l].length>0){let f=c[fi]??c,h=Jo(i[l],f,(...m)=>k1(m[0]));h&&(l==="loader"&&f.hydrate===!0&&(h.hydrate=!0),h[fi]=f,o[l]=h)}}),r.middleware&&r.middleware.length>0&&i.middleware.length>0&&(o.middleware=r.middleware.map(l=>{let c=l[fi]??l,f=Jo(i.middleware,c,(...h)=>k1(h[0]));return f?(f[fi]=c,f):l})),o}function FA(e,r){let i={navigate:[],fetch:[]};if(r.forEach(o=>o({instrument(l){let c=Object.keys(l);for(let f of c)l[f]&&i[f].push(l[f])}})),i.navigate.length>0){let o=e.navigate[fi]??e.navigate,l=Jo(i.navigate,o,(...c)=>{let[f,h]=c;return{to:typeof f=="number"||typeof f=="string"?f:f?jn(f):".",...R1(e,h??{})}});l&&(l[fi]=o,e.navigate=l)}if(i.fetch.length>0){let o=e.fetch[fi]??e.fetch,l=Jo(i.fetch,o,(...c)=>{let[f,,h,m]=c;return{href:h??".",fetcherKey:f,...R1(e,m??{})}});l&&(l[fi]=o,e.fetch=l)}return e}function Jo(e,r,i){return e.length===0?null:async(...o)=>{let l=await vE(e,i(...o),()=>r(...o),e.length-1);if(l.type==="error")throw l.value;return l.value}}async function vE(e,r,i,o){let l=e[o],c;if(l){let f,h=async()=>(f?console.error("You cannot call instrumented handlers more than once"):f=vE(e,r,i,o-1),c=await f,Ue(c,"Expected a result"),c.type==="error"&&c.value instanceof Error?{status:"error",error:c.value}:{status:"success",error:void 0});try{await l(h,r)}catch(m){console.error("An instrumentation function threw an error:",m)}f||await h(),await f}else try{c={type:"success",value:await)DELIM" +R"DELIM( i()}}catch(f){c={type:"error",value:f}}return c||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function k1(e){let{request:r,context:i,params:o,pattern:l}=e;return{request:VA(r),params:{...o},pattern:l,context:YA(i)}}function R1(e,r){return{currentUrl:jn(e.state.location),..."formMethod"in r?{formMethod:r.formMethod}:{},..."formEncType"in r?{formEncType:r.formEncType}:{},..."formData"in r?{formData:r.formData}:{},..."body"in r?{body:r.body}:{}}}function VA(e){return{method:e.method,url:e.url,headers:{get:(...r)=>e.headers.get(...r)}}}function YA(e){if(KA(e)){let r={...e};return Object.freeze(r),r}else return{get:r=>e.get(r)}}var QA=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function KA(e){if(e===null||typeof e!="object")return!1;const r=Object.getPrototypeOf(e);return r===Object.prototype||r===null||Object.getOwnPropertyNames(r).sort().join("\0")===QA}var j1=new URL("http://localhost");function pg(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),j1)}catch{return j1}}function Bm(e,r){return e.origin===r.origin&&(e.origin!=="null"||e.protocol===r.protocol&&e.host===r.host)}function GA(e,r){if(e.startsWith("//"))return!0;let i=r.protocol.toLowerCase();return e.toLowerCase().startsWith(i)?r.host===""||e.slice(i.length).startsWith("//"):!1}function es(e,r,i,o){let l=null;try{l=e==null?null:new URL(e,i)}catch{}let c=new URL(r,i),f=l!=null&&!Bm(l,i),h=!Bm(c,i);if(o==="reject"){if(f||h)throw new Error("External navigation is not allowed")}else if(h&&(l==null||!GA(e,l)||!Bm(l,c)))throw new Error("External navigation is not allowed")}var bE=["POST","PUT","PATCH","DELETE"],XA=new Set(bE),JA=["GET",...bE],WA=new Set(JA),xE=new Set([301,302,303,307,308]),ez=new Set([307,308]),Um={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tz={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},nz=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),SE="remix-router-transitions",wE=Symbol("ResetLoaderData"),Zi,Qo,ii,Ko,rz=class{constructor(e){Nl(this,Zi),Nl(this,Qo),Nl(this,ii),Nl(this,Ko),Qr(this,Zi,e),Qr(this,Qo,Xu(e))}get stableRoutes(){return ur(this,Zi)}get activeRoutes(){return ur(this,ii)??ur(this,Zi)}get branches(){return ur(this,Ko)??ur(this,Qo)}get hasHMRRoutes(){return ur(this,ii)!=null}setRoutes(e){Qr(this,Zi,e),Qr(this,Qo,Xu(e))}setHmrRoutes(e){Qr(this,ii,e),Qr(this,Ko,Xu(e))}commitHmrRoutes(){ur(this,ii)&&(Qr(this,Zi,ur(this,ii)),Qr(this,Qo,ur(this,Ko)),Qr(this,ii,void 0),Qr(this,Ko,void 0))}};Zi=new WeakMap;Qo=new WeakMap;ii=new WeakMap;Ko=new WeakMap;function az(e){const r=e.window?e.window:typeof window<"u"?window:void 0,i=typeof r<"u"&&typeof r.document<"u"&&typeof r.document.createElement<"u";Ue(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o=e.hydrationRouteProperties||[],l=e.mapRouteProperties||nz,c=l;if(e.instrumentations){let C=e.instrumentations;c=D=>({...l(D),...qA(C.map(K=>K.route).filter(Boolean),D)})}let f={},h=new rz(Il(e.routes,c,void 0,f)),m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let p=e.dataStrategy||cz,v={...e.future},y=null,x=new Set,S=null,E=null,k=null,T=null,P=e.hydrationData!=null,H=_r(h.activeRoutes,e.history.location,m,!1,h.branches),te=!1,de=null,X,se;if(H==null&&!e.patchRoutesOnNavigation){let C=fr(404,{pathname:e.history.location.pathname}),{matches:D,route:K}=Uu(h.activeRoutes);X=!0,se=!X,H=D,de={[K.id]:C}}else if(H&&!e.hydrationData&&Or(H,h.activeRoutes,e.history.location.pathname).active&&(H=null),H)if(H.some(C=>C.route.lazy))X=!1,se=!X;else if(!H.some(C=>gg(C.route)))X=!0,se=!X;else{let C=e.hydrationData?e.hydrationData.loaderData:null,D=e.hydrationData?e.hydrationData.errors:null,K=H;if(D){let oe=H.findIndex(ce=>D[ce.route.id]!==void 0);K=K.slice(0,oe+1)}se=!1,X=!0,K.forEach(oe=>{let ce=EE(oe.route,C,D);se=se||ce.renderFallback,X=X&&!ce.shouldLoad})}else{X=!1,se=!X,H=[];let C=Or(null,h.activeRoutes,e.history.location.pathname);C.active&&C.matches&&(te=!0,H=C.matches)}let O,N={historyAction:e.history.action,location:e.history.location,matches:H,initialized:X,renderFallback:se,navigation:Um,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||de,fetchers:new Map,blockers:new Map},M="POP",Z=null,Q=!1,q,ue=!1,me=new Map,he=null,V=!1,A=!1,ae=new Set,W=new Map,ge=0,Ce=-1,Fe=new Map,be=new Set,j=new Map,I=new Map,pe=new Set,ve=new Map,$e,J=null;function le(){if(y=e.history.listen(({action:C,location:D,delta:K})=>{if($e){$e(),$e=void 0;return}Nt(ve.size===0||K!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let oe=Ss({currentLocation:N.location,nextLocation:D,historyAction:C});if(oe&&K!=null){let ce=new Promise(Ee=>{$e=Ee});e.history.go(K*-1),vi(oe,{state:"blocked",location:D,proceed(){vi(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),ce.then(()=>e.history.go(K))},reset(){let Ee=new Map(N.blockers);Ee.set(oe,vl),fe({blockers:Ee})}}),Z?.resolve(),Z=null;return}return Ye(C,D)}),i){Rz(r,me);let C=()=>jz(r,me);r.addEventListener("pagehide",C),he=()=>r.removeEventListener("pagehide",C)}return N.initialized||Ye("POP",N.location,{initialHydration:!0}),O}function $(){y&&y(),he&&he(),x.clear(),q&&q.abort(),N.fetchers.forEach((C,D)=>eo(N.fetchers,D)),N.blockers.forEach((C,D)=>ac(D))}function ee(C){if(x.add(C),S){let{newErrors:D}=S;S=null,C(N,{deletedFetchers:[],newErrors:D,viewTransitionOpts:void 0,flushSync:!1})}return()=>x.delete(C)}function fe(C,D={}){C.matches&&(C.matches=C.matches.map(ce=>{let Ee=f[ce.route.id],Se=ce.route;return Se.element!==Ee.element||Se.errorElement!==Ee.errorElement||Se.hydrateFallbackElement!==Ee.hydrateFallbackElement?{...ce,route:Ee}:ce})),N={...N,...C};let K=[],oe=[];N.fetchers.forEach((ce,Ee)=>{ce.state==="idle"&&(pe.has(Ee)?K.push(Ee):oe.push(Ee))}),pe.forEach(ce=>{!N.fetchers.has(ce)&&!W.has(ce)&&K.push(ce)}),x.size===0&&(S={newErrors:C.errors??null}),[...x].forEach(ce=>ce(N,{deletedFetchers:K,newErrors:C.errors??null,viewTransitionOpts:D.viewTransitionOpts,flushSync:D.flushSync===!0})),K.forEach(ce=>eo(N.fetchers,ce)),oe.forEach(ce=>N.fetchers.delete(ce))}function Oe(C,D,{flushSync:K}={}){let oe=N.actionData!=null&&N.navigation.formMethod!=null&&Sn(N.navigation.formMethod)&&N.navigation.state==="loading"&&C.state?._isRedirect!==!0,ce;D.actionData?Object.keys(D.actionData).length>0?ce=D.actionData:ce=null:oe?ce=N.actionData:ce=null;let Ee=D.loaderData?H1(N.loaderData,D.loaderData,D.matches||[],D.errors):N.loaderData,Se=N.blockers;Se.size>0&&(Se=new Map(Se),Se.forEach((Re,De)=>Se.set(De,vl)));let Ne=V?!1:ic(C,D.matches||N.matches),we=Q===!0||N.navigation.formMethod!=null&&Sn(N.navigation.formMethod)&&C.state?._isRedirect!==!0;h.commitHmrRoutes(),V||M==="POP"||(M==="PUSH"?e.history.push(C,C.state):M==="REPLACE"&&e.history.replace(C,C.state));let ze;if(M==="POP"&&!V&&C!==N.location){let Re=me.get(N.location.pathname);Re&&Re.has(C.pathname)?ze={currentLocation:N.location,nextLocation:C}:me.has(C.pathname)&&(ze={currentLocation:C,nextLocation:N.location})}else if(ue){let Re=me.get(N.location.pathname);Re?Re.add(C.pathname):(Re=new Set([C.pathname]),me.set(N.location.pathname,Re)),ze={currentLocation:N.location,nextLocation:C}}fe({...D,actionData:ce,loaderData:Ee,historyAction:M,locat)DELIM" +R"DELIM(ion:C,initialized:!0,renderFallback:!1,navigation:Um,revalidation:"idle",restoreScrollPosition:Ne,preventScrollReset:we,blockers:Se},{viewTransitionOpts:ze,flushSync:K===!0}),M="POP",Q=!1,ue=!1,V=!1,A=!1,Z?.resolve(),Z=null,J?.resolve(),J=null}async function Be(C,D){if(Z?.resolve(),Z=null,typeof C=="number"){Z||(Z=Z1());let dt=Z.promise;return e.history.go(C),dt}let K=Tp(N.location,N.matches,m,C,D?.fromRouteId,D?.relative),{path:oe,submission:ce,error:Ee}=C1(!1,K,D),Se;if(D?.mask){let dt=typeof D.mask=="string"?na(D.mask):{...N.location.mask,...D.mask};if(Se={pathname:dt.pathname??"",search:dt.search??"",hash:dt.hash??""},Cf.test(Se.pathname))throw new Error("External navigation is not allowed");Se.pathname.startsWith("\\")&&(Se.pathname=Se.pathname.replace(/^\\+/,"/")),es(typeof D.mask=="string"?D.mask:jn(D.mask),jn(Se),e.history.createURL("/"),"reject")}let Ne=N.location,we=Pl(Ne,oe,D&&D.state,void 0,Se);we={...we,...e.history.encodeLocation(we)},es(C==null?e.history.createHref(N.location):typeof C=="string"?C:jn(C),e.history.createHref(we.mask||we),e.history.createURL("/"),"reject");let ze=D&&D.replace!=null?D.replace:void 0,Re="PUSH";ze===!0?Re="REPLACE":ze===!1||ce!=null&&Sn(ce.formMethod)&&ce.formAction===N.location.pathname+N.location.search&&(Re="REPLACE");let De=D&&"preventScrollReset"in D?D.preventScrollReset===!0:void 0,Ae=(D&&D.flushSync)===!0,st=Ss({currentLocation:Ne,nextLocation:we,historyAction:Re});if(st){vi(st,{state:"blocked",location:we,proceed(){vi(st,{state:"proceeding",proceed:void 0,reset:void 0,location:we}),Be(C,D)},reset(){let dt=new Map(N.blockers);dt.set(st,vl),fe({blockers:dt})}});return}await Ye(Re,we,{submission:ce,pendingError:Ee,preventScrollReset:De,replace:D&&D.replace,enableViewTransition:D&&D.viewTransition,flushSync:Ae,callSiteDefaultShouldRevalidate:D&&D.defaultShouldRevalidate})}function Ve(){J||(J=Z1()),Cr(),fe({revalidation:"loading"});let C=J.promise;return N.navigation.state==="submitting"?C:N.navigation.state==="idle"?(Ye(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),C):(Ye(M||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:ue===!0}),C)}async function Ye(C,D,K){q&&q.abort(),q=null,M=C,V=(K&&K.startUninterruptedRevalidation)===!0,Uf(N.location,N.matches),Q=(K&&K.preventScrollReset)===!0,ue=(K&&K.enableViewTransition)===!0;let oe=h.activeRoutes,ce=K?.initialHydration&&N.matches&&N.matches.length>0&&!te?N.matches:_r(oe,D,m,!1,h.branches),Ee=(K&&K.flushSync)===!0;if(ce&&N.initialized&&!A&&vz(N.location,D)&&!(K&&K.submission&&Sn(K.submission.formMethod))){Oe(D,{matches:ce},{flushSync:Ee});return}let Se=Or(ce,oe,D.pathname);if(Se.active&&Se.matches&&(ce=Se.matches),!ce){let{error:lt,notFoundMatches:rt,route:Kt}=Ta(D.pathname);Oe(D,{matches:rt,loaderData:{},errors:{[Kt.id]:lt}},{flushSync:Ee});return}let Ne=K&&K.overrideNavigation?{...K.overrideNavigation,matches:ce,historyAction:C}:void 0;q=new AbortController;let we=Go(e.history,D,q.signal,K&&K.submission),ze=e.getContext?await e.getContext():new E1,Re;if(K&&K.pendingError)Re=[ui(ce).route.id,{type:"error",error:K.pendingError}];else if(K&&K.submission&&Sn(K.submission.formMethod)){let lt=await Te(we,D,K.submission,ce,C,ze,Se.active,K&&K.initialHydration===!0,{replace:K.replace,flushSync:Ee});if(lt.shortCircuited)return;if(lt.pendingActionResult){let[rt,Kt]=lt.pendingActionResult;if(Xn(Kt)&&Zl(Kt.error)&&Kt.error.status===404){q=null,Oe(D,{matches:lt.matches,loaderData:{},errors:{[rt]:Kt.error}});return}}ce=lt.matches||ce,Re=lt.pendingActionResult,Ne=Hm(D,ce,C,K.submission),Ee=!1,Se.active=!1,we=Go(e.history,we.url,we.signal)}let{shortCircuited:De,matches:Ae,loaderData:st,errors:dt,workingFetchers:zt}=await Ze(we,D,ce,C,ze,Se.active,Ne,K&&K.submission,K&&K.fetcherSubmission,K&&K.replace,K&&K.initialHydration===!0,Ee,Re,K&&K.callSiteDefaultShouldRevalidate);De||(q=null,Oe(D,{matches:Ae||ce,...$1(Re),loaderData:st,errors:dt,...zt?{fetchers:zt}:{}}))}async function Te(C,D,K,oe,ce,Ee,Se,Ne,we={}){Cr();let ze=Nz(D,oe,ce,K);if(fe({navigation:ze},{flushSync:we.flushSync===!0}),Se){let Ae=await Qt(oe,D.pathname,C.signal);if(Ae.type==="aborted")return{shortCircuited:!0};if(Ae.type==="error"){if(Ae.partialMatches.length===0){let{matches:dt,route:zt}=Uu(h.activeRoutes);return{matches:dt,pendingActionResult:[zt.id,{type:"error",error:Ae.error}]}}let st=ui(Ae.partialMatches).route.id;return{matches:Ae.partialMatches,pendingActionResult:[st,{type:"error",error:Ae.error}]}}else if(Ae.matches)oe=Ae.matches;else{let{notFoundMatches:st,error:dt,route:zt}=Ta(D.pathname);return{matches:st,pendingActionResult:[zt.id,{type:"error",error:dt}]}}}let Re,De=Ju(oe,D);if(!De.route.action&&!De.route.lazy)Re={type:"error",error:fr(405,{method:C.method,pathname:D.pathname,routeId:De.route.id})};else{let Ae=ts(c,f,C,D,oe,De,Ne?[]:o,Ee),st=await yn(C,D,Ae,Ee,null);if(Re=st[De.route.id],!Re){for(let dt of oe)if(st[dt.route.id]){Re=st[dt.route.id];break}}if(C.signal.aborted)return{shortCircuited:!0}}if(Yi(Re)){let Ae;return we&&we.replace!=null?Ae=we.replace:Ae=L1(Re.response.headers.get("Location"),new URL(C.url),m,e.history)===N.location.pathname+N.location.search,await $n(C,Re,!0,{submission:K,replace:Ae}),{shortCircuited:!0}}if(Xn(Re)){let Ae=ui(oe,De.route.id);return(we&&we.replace)!==!0&&(M="PUSH"),{matches:oe,pendingActionResult:[Ae.route.id,Re,De.route.id]}}return{matches:oe,pendingActionResult:[De.route.id,Re]}}async function Ze(C,D,K,oe,ce,Ee,Se,Ne,we,ze,Re,De,Ae,st){let dt=Se||Hm(D,K,oe,Ne),zt=Ne||we||I1(dt),lt=!V&&!Re;if(Ee){if(lt){let Vt=tt(Ae);fe({navigation:dt,...Vt!==void 0?{actionData:Vt}:{}},{flushSync:De})}let Qe=await Qt(K,D.pathname,C.signal);if(Qe.type==="aborted")return{shortCircuited:!0};if(Qe.type==="error"){if(Qe.partialMatches.length===0){let{matches:Xt,route:vn}=Uu(h.activeRoutes);return{matches:Xt,loaderData:{},errors:{[vn.id]:Qe.error}}}let Vt=ui(Qe.partialMatches).route.id;return{matches:Qe.partialMatches,loaderData:{},errors:{[Vt]:Qe.error}}}else if(Qe.matches)K=Qe.matches;else{let{error:Vt,notFoundMatches:Xt,route:vn}=Ta(D.pathname);return{matches:Xt,loaderData:{},errors:{[vn.id]:Vt}}}}let rt=h.activeRoutes,{dsMatches:Kt,revalidatingFetchers:an}=O1(C,ce,c,f,e.history,N,K,zt,D,Re?[]:o,Re===!0,A,ae,pe,j,be,rt,m,e.patchRoutesOnNavigation!=null,h.branches,Ae,st);if(Ce=++ge,!e.dataStrategy&&!Kt.some(Qe=>Qe.shouldLoad)&&!Kt.some(Qe=>Qe.route.middleware&&Qe.route.middleware.length>0)&&an.length===0){let Qe=new Map(N.fetchers),Vt=nc(Qe);return Oe(D,{matches:K,loaderData:{},errors:Ae&&Xn(Ae[1])?{[Ae[0]]:Ae[1].error}:null,...$1(Ae),...Vt?{fetchers:Qe}:{}},{flushSync:De}),{shortCircuited:!0}}if(lt){let Qe={};if(!Ee){Qe.navigation=dt;let Vt=tt(Ae);Vt!==void 0&&(Qe.actionData=Vt)}an.length>0&&(Qe.fetchers=Je(an)),fe(Qe,{flushSync:De})}an.forEach(Qe=>{In(Qe.key),Qe.controller&&W.set(Qe.key,Qe.controller)});let Na=()=>an.forEach(Qe=>In(Qe.key));q&&q.signal.addEventListener("abort",Na);let{loaderResults:Gt,fetcherResults:Et}=await jr(Kt,an,C,D,ce);if(C.signal.aborted)return{shortCircuited:!0};q&&q.signal.removeEventListener("abort",Na),an.forEach(Qe=>W.delete(Qe.key));let Rt=Hu(Gt);if(Rt)return await $n(C,Rt.result,!0,{replace:ze}),{shortCircuited:!0};if(Rt=Hu(Et),Rt)return be.add(Rt.key),await $n(C,Rt.result,!0,{replace:ze}),{shortCircuited:!0};let on=new Map(N.fetchers),{loaderData:no,errors:Ar}=U1(N,K,Gt,Ae,an,Et,on);Re&&N.errors&&(Ar={...N.errors,...Ar});let ro=nc(on),bi=rc(Ce,on),zr=ro||bi||an.length>0;return{matches:K,loaderData:no,errors:Ar,...zr?{workingFetchers:on}:{}}}function tt(C){if(C&&!Xn(C[1]))return{[C[0]]:C[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Je(C){let D=new Map(N.fetchers);return C.forEach(K=>{let oe=D.get(K.key),ce=bl(void 0,oe?oe.data:void 0);D.set(K.key,ce)}),D}async function St(C,D,K,oe){In(C);let ce=(oe&&oe.flushSync)===!0,Ee=h.activeRoutes,Se=Tp(N.location,N.matches,m,K,D,oe?.relative),Ne=_r(Ee,Se,m,!1,h.branches),we=Or(Ne,Ee,Se);if)DELIM" +R"DELIM((we.active&&we.matches&&(Ne=we.matches),!Ne){Pn(C,D,fr(404,{pathname:Se}),{flushSync:ce});return}let{path:ze,submission:Re,error:De}=C1(!0,Se,oe);if(De){Pn(C,D,De,{flushSync:ce});return}let Ae=e.getContext?await e.getContext():new E1,st=(oe&&oe.preventScrollReset)===!0;if(Re&&Sn(Re.formMethod)){await gn(C,D,ze,Ne,Ae,we.active,ce,st,Re,oe&&oe.defaultShouldRevalidate);return}j.set(C,{routeId:D,path:ze}),await An(C,D,ze,Ne,Ae,we.active,ce,st,Re)}async function gn(C,D,K,oe,ce,Ee,Se,Ne,we,ze){Cr(),j.delete(C);let Re=N.fetchers.get(C);Ht(C,kz(we,Re),{flushSync:Se});let De=new AbortController,Ae=Go(e.history,K,De.signal,we);if(Ee){let He=await Qt(oe,new URL(Ae.url).pathname,Ae.signal,C);if(He.type==="aborted")return;if(He.type==="error"){Pn(C,D,He.error,{flushSync:Se});return}else if(He.matches)oe=He.matches;else{Pn(C,D,fr(404,{pathname:K}),{flushSync:Se});return}}let st=Ju(oe,K);if(!st.route.action&&!st.route.lazy){let He=fr(405,{method:we.formMethod,pathname:K,routeId:D});Pn(C,D,He,{flushSync:Se});return}W.set(C,De);let dt=ge,zt=ts(c,f,Ae,K,oe,st,o,ce),lt=await yn(Ae,K,zt,ce,C),rt=lt[st.route.id];if(!rt){for(let He of zt)if(lt[He.route.id]){rt=lt[He.route.id];break}}if(Ae.signal.aborted){W.get(C)===De&&W.delete(C);return}if(pe.has(C)){if(Yi(rt)||Xn(rt)){Ht(C,Gr(void 0));return}}else{if(Yi(rt))if(W.delete(C),Ce>dt){Ht(C,Gr(void 0));return}else return be.add(C),Ht(C,bl(we)),$n(Ae,rt,!1,{fetcherSubmission:we,preventScrollReset:Ne});if(Xn(rt)){Pn(C,D,rt.error);return}}let Kt=N.navigation.location||N.location,an=Go(e.history,Kt,De.signal),Na=h.activeRoutes,Gt=N.navigation.state!=="idle"?_r(Na,N.navigation.location,m,!1,h.branches):N.matches;Ue(Gt,"Didn't find any matches after fetcher action");let Et=++ge;Fe.set(C,Et);let{dsMatches:Rt,revalidatingFetchers:on}=O1(an,ce,c,f,e.history,N,Gt,we,Kt,o,!1,A,ae,pe,j,be,Na,m,e.patchRoutesOnNavigation!=null,h.branches,[st.route.id,rt],ze),no=bl(we,rt.data),Ar=new Map(N.fetchers);Ar.set(C,no),on.filter(He=>He.key!==C).forEach(He=>{let Dr=He.key,Es=Ar.get(Dr),oc=bl(void 0,Es?Es.data:void 0);Ar.set(Dr,oc),In(Dr),He.controller&&W.set(Dr,He.controller)}),fe({fetchers:Ar});let ro=()=>on.forEach(He=>In(He.key));De.signal.addEventListener("abort",ro);let{loaderResults:bi,fetcherResults:zr}=await jr(Rt,on,an,Kt,ce);if(De.signal.aborted)return;De.signal.removeEventListener("abort",ro),Fe.delete(C),W.delete(C),on.forEach(He=>W.delete(He.key));let Qe=N.fetchers.has(C),Vt=He=>{if(!Qe)return He;let Dr=new Map(He.fetchers);return Dr.set(C,Gr(rt.data)),{...He,fetchers:Dr}},Xt=Hu(bi);if(Xt)return N=Vt(N),$n(an,Xt.result,!1,{preventScrollReset:Ne});if(Xt=Hu(zr),Xt)return be.add(Xt.key),N=Vt(N),$n(an,Xt.result,!1,{preventScrollReset:Ne});let vn=new Map(N.fetchers);Qe&&vn.set(C,Gr(rt.data));let{loaderData:ka,errors:Mr}=U1(N,Gt,bi,void 0,on,zr,vn);rc(Et,vn),N.navigation.state==="loading"&&Et>Ce?(Ue(M,"Expected pending action"),q&&q.abort(),Oe(N.navigation.location,{matches:Gt,loaderData:ka,errors:Mr,fetchers:vn})):(fe({errors:Mr,loaderData:H1(N.loaderData,ka,Gt,Mr),fetchers:vn}),A=!1)}async function An(C,D,K,oe,ce,Ee,Se,Ne,we){let ze=N.fetchers.get(C);Ht(C,bl(we,ze?ze.data:void 0),{flushSync:Se});let Re=new AbortController,De=Go(e.history,K,Re.signal);if(Ee){let rt=await Qt(oe,new URL(De.url).pathname,De.signal,C);if(rt.type==="aborted")return;if(rt.type==="error"){Pn(C,D,rt.error,{flushSync:Se});return}else if(rt.matches)oe=rt.matches;else{Pn(C,D,fr(404,{pathname:K}),{flushSync:Se});return}}let Ae=Ju(oe,K);W.set(C,Re);let st=ge,dt=ts(c,f,De,K,oe,Ae,o,ce),zt=await yn(De,K,dt,ce,C),lt=zt[Ae.route.id];if(!lt){for(let rt of oe)if(zt[rt.route.id]){lt=zt[rt.route.id];break}}if(W.get(C)===Re&&W.delete(C),!De.signal.aborted){if(pe.has(C)){Ht(C,Gr(void 0));return}if(Yi(lt))if(Ce>st){Ht(C,Gr(void 0));return}else{be.add(C),await $n(De,lt,!1,{preventScrollReset:Ne});return}if(Xn(lt)){Pn(C,D,lt.error);return}Ht(C,Gr(lt.data))}}async function $n(C,D,K,{submission:oe,fetcherSubmission:ce,preventScrollReset:Ee,replace:Se}={}){K||(Z?.resolve(),Z=null),D.response.headers.has("X-Remix-Revalidate")&&(A=!0);let Ne=D.response.headers.get("Location");Ue(Ne,"Expected a Location header on the redirect Response");let we=Ne,ze=new URL(C.url);Ne=L1(Ne,ze,m,e.history),es(we,Ne,ze,"allow-explicit");let Re=Pl(N.location,Ne,{_isRedirect:!0});if(i){let lt=!1;if(D.response.headers.has("X-Remix-Reload-Document"))lt=!0;else if(hg(Ne)){const rt=lE(r,Ne,!0);lt=rt.origin!==r.location.origin||er(rt.pathname,m)==null}if(lt){Se?r.location.replace(Ne):r.location.assign(Ne);return}}q=null;let De=Se===!0||D.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ae,formAction:st,formEncType:dt}=N.navigation;!oe&&!ce&&Ae&&st&&dt&&(oe=I1(N.navigation));let zt=oe||ce;if(ez.has(D.response.status)&&zt&&Sn(zt.formMethod))await Ye(De,Re,{submission:{...zt,formAction:Ne},preventScrollReset:Ee||Q,enableViewTransition:K?ue:void 0});else{let lt=Hm(Re,[],De,oe);await Ye(De,Re,{overrideNavigation:lt,fetcherSubmission:ce,preventScrollReset:Ee||Q,enableViewTransition:K?ue:void 0})}}async function yn(C,D,K,oe,ce){let Ee,Se={};try{Ee=await fz(p,C,D,K,ce,oe,!1)}catch(Ne){return K.filter(we=>we.shouldLoad).forEach(we=>{Se[we.route.id]={type:"error",error:Ne}}),Se}if(C.signal.aborted)return Se;if(!Sn(C.method))for(let Ne of K){if(Ee[Ne.route.id]?.type==="error")break;!Ee.hasOwnProperty(Ne.route.id)&&!N.loaderData.hasOwnProperty(Ne.route.id)&&(!N.errors||!N.errors.hasOwnProperty(Ne.route.id))&&Ne.shouldCallHandler()&&(Ee[Ne.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ne.route.id}`)})}for(let[Ne,we]of Object.entries(Ee))if(wz(we)){let ze=we.result;Se[Ne]={type:"redirect",response:pz(ze,C,Ne,K,m)}}else Se[Ne]=await mz(we);return Se}async function jr(C,D,K,oe,ce){let Ee=yn(K,oe,C,ce,null),Se=Promise.all(D.map(async ze=>{if(ze.matches&&ze.match&&ze.request&&ze.controller){let De=(await yn(ze.request,ze.path,ze.matches,ce,ze.key))[ze.match.route.id];return{[ze.key]:De}}else return Promise.resolve({[ze.key]:{type:"error",error:fr(404,{pathname:ze.path})}})})),Ne=await Ee,we=(await Se).reduce((ze,Re)=>Object.assign(ze,Re),{});return{loaderResults:Ne,fetcherResults:we}}function Cr(){A=!0,j.forEach((C,D)=>{W.has(D)&&ae.add(D),In(D)})}function Ht(C,D,K={}){let oe=new Map(N.fetchers);oe.set(C,D),fe({fetchers:oe},{flushSync:(K&&K.flushSync)===!0})}function Pn(C,D,K,oe={}){let ce=ui(N.matches,D),Ee=new Map(N.fetchers);eo(Ee,C),fe({errors:{[ce.route.id]:K},fetchers:Ee},{flushSync:(oe&&oe.flushSync)===!0})}function bs(C){return I.set(C,(I.get(C)||0)+1),pe.has(C)&&pe.delete(C),N.fetchers.get(C)||tz}function Lf(C,D){In(C,D?.reason),Ht(C,Gr(null))}function eo(C,D){let K=N.fetchers.get(D);W.has(D)&&!(K&&K.state==="loading"&&Fe.has(D))&&In(D),j.delete(D),Fe.delete(D),be.delete(D),pe.delete(D),ae.delete(D),C.delete(D)}function xs(C){let D=(I.get(C)||0)-1;D<=0?(I.delete(C),pe.add(C)):I.set(C,D),fe({fetchers:new Map(N.fetchers)})}function In(C,D){let K=W.get(C);K&&(K.abort(D),W.delete(C))}function to(C,D){for(let K of C){let oe=D.get(K);Ue(oe,`Expected fetcher: ${K}`);let ce=Gr(oe.data);D.set(K,ce)}}function nc(C){let D=[],K=!1;for(let oe of be){let ce=C.get(oe);Ue(ce,`Expected fetcher: ${oe}`),ce.state==="loading"&&(be.delete(oe),D.push(oe),K=!0)}return to(D,C),K}function rc(C,D){let K=[];for(let[oe,ce]of Fe)if(ce0}function wn(C,D){let K=N.blockers.get(C)||vl;return ve.get(C)!==D&&ve.set(C,D),K}function ac(C){N.blockers.delete(C),ve.delete(C)}function vi(C,D){let K=N.blockers.get(C)||vl;Ue(K.state==="unblocked"&&D.state==="blocked"||K.state==="blocked"&&D.state==="blocked"||K.state==="blocked"&&D.state==="proceeding"||K.state==="blocked"&&D.state==="unblocked"||K.state==="proceeding"&&D.state==="unblocked",`Invalid blocker state transition: ${K.state} -> ${D.state}`);let oe=new Map(N.blockers);oe.set(C,D),fe({blockers:oe})}function Ss)DELIM" +R"DELIM(({currentLocation:C,nextLocation:D,historyAction:K}){if(ve.size===0)return;ve.size>1&&Nt(!1,"A router only supports one blocker at a time");let oe=Array.from(ve.entries()),[ce,Ee]=oe[oe.length-1],Se=N.blockers.get(ce);if(!(Se&&Se.state==="proceeding")&&Ee({currentLocation:C,nextLocation:D,historyAction:K}))return ce}function Ta(C){let D=fr(404,{pathname:C}),K=h.activeRoutes,{matches:oe,route:ce}=Uu(K);return{notFoundMatches:oe,route:ce,error:D}}function Bf(C,D,K){if(E=C,T=D,k=K||null,!P&&N.navigation===Um){P=!0;let oe=ic(N.location,N.matches);oe!=null&&fe({restoreScrollPosition:oe})}return()=>{E=null,T=null,k=null}}function ws(C,D){return k&&k(C,D.map(oe=>uE(oe,N.loaderData)))||C.key}function Uf(C,D){if(E&&T){let K=ws(C,D);E[K]=T()}}function ic(C,D){if(E){let K=ws(C,D),oe=E[K];if(typeof oe=="number")return oe}return null}function Or(C,D,K){if(e.patchRoutesOnNavigation){let oe=h.branches;if(C){if(Object.keys(C[0].params).length>0)return{active:!0,matches:_r(D,K,m,!0,oe)}}else return{active:!0,matches:_r(D,K,m,!0,oe)||[]}}return{active:!1,matches:null}}async function Qt(C,D,K,oe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:C};let ce=C;for(;;){let Ee=f;try{await e.patchRoutesOnNavigation({signal:K,path:D,matches:ce,fetcherKey:oe,patch:(ze,Re)=>{K.aborted||A1(ze,Re,h,Ee,c,!1)}})}catch(ze){return{type:"error",error:ze,partialMatches:ce}}if(K.aborted)return{type:"aborted"};let Se=h.branches,Ne=_r(h.activeRoutes,D,m,!1,Se),we=null;if(Ne){if(Object.keys(Ne[0].params).length===0)return{type:"success",matches:Ne};if(we=_r(h.activeRoutes,D,m,!0,Se),!(we&&ce.lengthK.route.id===D[oe].route.id)}function En(C){f={},h.setHmrRoutes(Il(C,c,void 0,f))}function Hf(C,D,K=!1){A1(C,D,h,f,c,K),h.hasHMRRoutes||fe({})}return O={get basename(){return m},get future(){return v},get state(){return N},get routes(){return h.stableRoutes},get branches(){return h.branches},get manifest(){return f},get window(){return r},initialize:le,subscribe:ee,enableScrollRestoration:Bf,navigate:Be,fetch:St,revalidate:Ve,createHref:C=>e.history.createHref(C),createURL:C=>e.history.createURL(C),encodeLocation:C=>e.history.encodeLocation(C),getFetcher:bs,resetFetcher:Lf,deleteFetcher:xs,dispose:$,getBlocker:wn,deleteBlocker:ac,patchRoutes:Hf,_internalFetchControllers:W,_internalSetRoutes:En,_internalSetStateDoNotUseOrYouWillBreakYourApp(C){fe(C)}},e.instrumentations&&(O=FA(O,e.instrumentations.map(C=>C.router).filter(Boolean))),O}function iz(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Tp(e,r,i,o,l,c){let f,h;if(l){f=[];for(let p of r)if(f.push(p),p.route.id===l){h=p;break}}else f=r,h=r[r.length-1];let m=Kl(o||".",Of(f),er(e.pathname,i)||e.pathname,c==="path");if(o==null&&(m.search=e.search,m.hash=e.hash),(o==null||o===""||o===".")&&h){let p=vg(m.search);if(h.route.index&&!p)m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index";else if(!h.route.index&&p){let v=new URLSearchParams(m.search),y=v.getAll("index");v.delete("index"),y.filter(S=>S).forEach(S=>v.append("index",S));let x=v.toString();m.search=x?`?${x}`:""}}return i!=="/"&&(m.pathname=UA({basename:i,pathname:m.pathname})),jn(m)}function C1(e,r,i){if(!i||!iz(i))return{path:r};if(i.formMethod&&!Tz(i.formMethod))return{path:r,error:fr(405,{method:i.formMethod})};let o=()=>({path:r,error:fr(400,{type:"invalid-body"})}),c=(i.formMethod||"get").toUpperCase(),f=CE(r);if(i.body!==void 0){if(i.formEncType==="text/plain"){if(!Sn(c))return o();let y=typeof i.body=="string"?i.body:i.body instanceof FormData||i.body instanceof URLSearchParams?Array.from(i.body.entries()).reduce((x,[S,E])=>`${x}${S}=${E} +`,""):String(i.body);return{path:r,submission:{formMethod:c,formAction:f,formEncType:i.formEncType,formData:void 0,json:void 0,text:y}}}else if(i.formEncType==="application/json"){if(!Sn(c))return o();try{let y=typeof i.body=="string"?JSON.parse(i.body):i.body;return{path:r,submission:{formMethod:c,formAction:f,formEncType:i.formEncType,formData:void 0,json:y,text:void 0}}}catch{return o()}}}Ue(typeof FormData=="function","FormData is not available in this environment");let h,m;if(i.formData)h=Rp(i.formData),m=i.formData;else if(i.body instanceof FormData)h=Rp(i.body),m=i.body;else if(i.body instanceof URLSearchParams)h=i.body,m=B1(h);else if(i.body==null)h=new URLSearchParams,m=new FormData;else try{h=new URLSearchParams(i.body),m=B1(h)}catch{return o()}let p={formMethod:c,formAction:f,formEncType:i&&i.formEncType||"application/x-www-form-urlencoded",formData:m,json:void 0,text:void 0};if(Sn(p.formMethod))return{path:r,submission:p};let v=na(r);return e&&v.search&&vg(v.search)&&h.append("index",""),v.search=`?${h}`,{path:jn(v),submission:p}}function O1(e,r,i,o,l,c,f,h,m,p,v,y,x,S,E,k,T,P,H,te,de,X){let se=de?Xn(de[1])?de[1].error:de[1].data:void 0,O=l.createURL(c.location),N=l.createURL(m),M;if(v&&c.errors){let V=Object.keys(c.errors)[0];M=f.findIndex(A=>A.route.id===V)}else if(de&&Xn(de[1])){let V=de[0];M=f.findIndex(A=>A.route.id===V)-1}let Z=de?de[1].statusCode:void 0,Q=Z&&Z>=400,q={currentUrl:O,currentParams:c.matches[0]?.params||{},nextUrl:N,nextParams:f[0].params,...h,actionResult:se,actionStatus:Z},ue=Xl(f),me=f.map((V,A)=>{let{route:ae}=V,W=null;if(M!=null&&A>M)W=!1;else if(ae.lazy)W=!0;else if(!gg(ae))W=!1;else if(v){let{shouldLoad:be}=EE(ae,c.loaderData,c.errors);W=be}else oz(c.loaderData,c.matches[A],V)&&(W=!0);if(W!==null)return Np(i,o,e,m,ue,V,p,r,W);let ge=!1;typeof X=="boolean"?ge=X:Q?ge=!1:(y||O.pathname+O.search===N.pathname+N.search||O.search!==N.search||sz(c.matches[A],V))&&(ge=!0);let Ce={...q,defaultShouldRevalidate:ge},Fe=Ml(V,Ce);return Np(i,o,e,m,ue,V,p,r,Fe,Ce,X)}),he=[];return E.forEach((V,A)=>{if(v||!f.some(I=>I.route.id===V.routeId)||S.has(A))return;let ae=c.fetchers.get(A),W=ae&&ae.state!=="idle"&&ae.data===void 0,ge=_r(T,V.path,P??"/",!1,te);if(!ge){if(H&&W)return;he.push({key:A,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(k.has(A))return;let Ce=Ju(ge,V.path),Fe=new AbortController,be=Go(l,V.path,Fe.signal),j=null;if(x.has(A))x.delete(A),j=ts(i,o,be,V.path,ge,Ce,p,r);else if(W)y&&(j=ts(i,o,be,V.path,ge,Ce,p,r));else{let I;typeof X=="boolean"?I=X:Q?I=!1:I=y;let pe={...q,defaultShouldRevalidate:I};Ml(Ce,pe)&&(j=ts(i,o,be,V.path,ge,Ce,p,r,pe))}j&&he.push({key:A,routeId:V.routeId,path:V.path,matches:j,match:Ce,request:be,controller:Fe})}),{dsMatches:me,revalidatingFetchers:he}}function gg(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function EE(e,r,i){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!gg(e))return{shouldLoad:!1,renderFallback:!1};let o=r!=null&&e.id in r,l=i!=null&&i[e.id]!==void 0;if(!o&&l)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader=="function"&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!o};let c=!o&&!l;return{shouldLoad:c,renderFallback:c}}function oz(e,r,i){let o=!r||i.route.id!==r.route.id,l=!e.hasOwnProperty(i.route.id);return o||l}function sz(e,r){let i=e.route.path;return e.pathname!==r.pathname||i!=null&&i.endsWith("*")&&e.params["*"]!==r.params["*"]}function Ml(e,r){if(e.route.shouldRevalidate){let i=e.route.shouldRevalidate(r);if(typeof i=="boolean")return i}return r.defaultShouldRevalidate}function A1(e,r,i,o,l,c){let f;if(e){let p=o[e];Ue(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),f=p.children}else f=i.activeRoutes;let h=[],m=[];if(r.forEach(p=>{let v=f.find(y=>_E(p,y));v?m.push({existingRoute:v,newRoute:p}):h.push(p)}),h.length>0){let p=Il(h,l,[e||"_","patch",String(f?.length||"0")],o);f.push(...p)}if(c&&m.length>0)for(let p=0;pr.children?.some(l=>_E(i,l)))??!1:!1}var z1=new WeakMap,TE=({key:e,route:r,manifest:i,mapRouteProperties:o})=>{let l=i[r.id];if(Ue(l,"No route found in manifest"),!l.lazy||typeof l.lazy!="object")return;let c=l.lazy[e];if(!c)return;let f=z1.get(l);f||(f={},z1.set(l,f));let h=f[e];if(h)return h;let m=(async()=>{let p=EA(e),y=l[e]!==void 0&&e!=="hasErrorBoundary";if(p)Nt(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),f[e]=Promise.resolve();else if(y)Nt(!1,`Route "${l.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await c();x!=null&&(Object.assign(l,{[e]:x}),Object.assign(l,o(l)))}typeof l.lazy=="object"&&(l.lazy[e]=void 0,Object.values(l.lazy).every(x=>x===void 0)&&(l.lazy=void 0))})();return f[e]=m,m},M1=new WeakMap;function lz(e,r,i,o,l){let c=i[e.id];if(Ue(c,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let v=M1.get(c);if(v)return{lazyRoutePromise:v,lazyHandlerPromise:v};let y=(async()=>{Ue(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),S={};for(let E in x){let k=x[E];if(k===void 0)continue;let T=TA(E),H=c[E]!==void 0&&E!=="hasErrorBoundary";T?Nt(!T,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):H?Nt(!H,`Route "${c.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):S[E]=k}Object.assign(c,S),Object.assign(c,{...o(c),lazy:void 0})})();return M1.set(c,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let f=Object.keys(e.lazy),h=[],m;for(let v of f){if(l&&l.includes(v))continue;let y=TE({key:v,route:e,manifest:i,mapRouteProperties:o});y&&(h.push(y),v===r&&(m=y))}let p=h.length>0?Promise.all(h).then(()=>{}):void 0;return p?.catch(()=>{}),m?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:m}}async function D1(e){let r=e.matches.filter(l=>l.shouldLoad),i={};return(await Promise.all(r.map(l=>l.resolve()))).forEach((l,c)=>{i[r[c].route.id]=l}),i}async function cz(e){return e.matches.some(r=>r.route.middleware)?NE(e,()=>D1(e)):D1(e)}function NE(e,r){return uz(e,r,o=>{if(_z(o))throw o;return o},xz,i);function i(o,l,c){if(c)return Promise.resolve(Object.assign(c.value,{[l]:{type:"error",result:o}}));{let{matches:f}=e,h=Math.min(Math.max(f.findIndex(p=>p.route.id===l),0),Math.max(f.findIndex(p=>p.shouldCallHandler()),0)),m=ui(f,f[h].route.id).route.id;return Promise.resolve({[m]:{type:"error",result:o}})}}}async function uz(e,r,i,o,l){let{matches:c,...f}=e,h=c.flatMap(p=>p.route.middleware?p.route.middleware.map(v=>[p.route.id,v]):[]);return await kE(f,h,r,i,o,l)}async function kE(e,r,i,o,l,c,f=0){let{request:h}=e;if(h.signal.aborted)throw h.signal.reason??new Error(`Request aborted: ${h.method} ${h.url}`);let m=r[f];if(!m)return await i();let[p,v]=m,y,x=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await kE(e,r,i,o,l,c,f+1)},y.value}catch(S){return y={value:await c(S,p,y)},y.value}};try{let S=await v(e,x),E=S!=null?o(S):void 0;return l(E)?E:y?E??y.value:(y={value:await x()},y.value)}catch(S){return await c(S,p,y)}}function RE(e,r,i,o,l){let c=TE({key:"middleware",route:o.route,manifest:r,mapRouteProperties:e}),f=lz(o.route,Sn(i.method)?"action":"loader",r,e,l);return{middleware:c,route:f.lazyRoutePromise,handler:f.lazyHandlerPromise}}function Np(e,r,i,o,l,c,f,h,m,p=null,v){let y=!1,x=RE(e,r,i,c,f);return{...c,_lazyPromises:x,shouldLoad:m,shouldRevalidateArgs:p,shouldCallHandler(S){return y=!0,p?typeof v=="boolean"?Ml(c,{...p,defaultShouldRevalidate:v}):typeof S=="boolean"?Ml(c,{...p,defaultShouldRevalidate:S}):Ml(c,p):m},resolve(S){let{lazy:E,loader:k,middleware:T}=c.route,P=y||m||S&&!Sn(i.method)&&(E||k),H=T&&T.length>0&&!k&&!E;return P&&(Sn(i.method)||!H)?dz({request:i,path:o,pattern:l,match:c,lazyHandlerPromise:x?.handler,lazyRoutePromise:x?.route,handlerOverride:S,scopedContext:h}):Promise.resolve({type:"data",result:void 0})}}}function ts(e,r,i,o,l,c,f,h,m=null){return l.map(p=>p.route.id!==c.route.id?{...p,shouldLoad:!1,shouldRevalidateArgs:m,shouldCallHandler:()=>!1,_lazyPromises:RE(e,r,i,p,f),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Np(e,r,i,o,Xl(l),p,f,h,!0,m))}async function fz(e,r,i,o,l,c,f){o.some(v=>v._lazyPromises?.middleware)&&await Promise.all(o.map(v=>v._lazyPromises?.middleware));let h={request:r,url:jE(r,i),pattern:Xl(o),params:o[0].params,context:c,matches:o},p=await e({...h,fetcherKey:l,runClientMiddleware:v=>{let y=h;return NE(y,()=>v({...y,fetcherKey:l,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(o.flatMap(v=>[v._lazyPromises?.handler,v._lazyPromises?.route]))}catch{}return p}async function dz({request:e,path:r,pattern:i,match:o,lazyHandlerPromise:l,lazyRoutePromise:c,handlerOverride:f,scopedContext:h}){let m,p,v=Sn(e.method),y=v?"action":"loader",x=S=>{let E,k=new Promise((H,te)=>E=te);p=()=>E(),e.signal.addEventListener("abort",p);let T=H=>typeof S!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${y}" [routeId: ${o.route.id}]`)):S({request:e,url:jE(e,r),pattern:i,params:o.params,context:h},...H!==void 0?[H]:[]),P=(async()=>{try{return{type:"data",result:await(f?f(te=>T(te)):T())}}catch(H){return{type:"error",result:H}}})();return Promise.race([P,k])};try{let S=v?o.route.action:o.route.loader;if(l||c)if(S){let E,[k]=await Promise.all([x(S).catch(T=>{E=T}),l,c]);if(E!==void 0)throw E;m=k}else{await l;let E=v?o.route.action:o.route.loader;if(E)[m]=await Promise.all([x(E),c]);else if(y==="action"){let k=new URL(e.url),T=k.pathname+k.search;throw fr(405,{method:e.method,pathname:T,routeId:o.route.id})}else return{type:"data",result:void 0}}else if(S)m=await x(S);else{let E=new URL(e.url),k=E.pathname+E.search;throw fr(404,{pathname:k})}}catch(S){return{type:"error",result:S}}finally{p&&e.signal.removeEventListener("abort",p)}return m}async function hz(e){let r=e.headers.get("Content-Type");return r&&/\bapplication\/json\b/.test(r)?e.body==null?null:e.json():e.text()}async function mz(e){let{result:r,type:i}=e;if(yg(r)){let o;try{o=await hz(r)}catch(l){return{type:"error",error:l}}return i==="error"?{type:"error",error:new Gl(r.status,r.statusText,o),statusCode:r.status,headers:r.headers}:{type:"data",data:o,statusCode:r.status,headers:r.headers}}return i==="error"?P1(r)?r.data instanceof Error?{type:"error",error:r.data,statusCode:r.init?.status,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"error",error:bz(r),statusCode:Zl(r)?r.status:void 0,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"error",error:r,statusCode:Zl(r)?r.status:void 0}:P1(r)?{type:"data",data:r.data,statusCode:r.init?.status,headers:r.init?.headers?new Headers(r.init.headers):void 0}:{type:"data",data:r}}function pz(e,r,i,o,l){let c=e.headers.get("Location");if(Ue(c,"Redirects returned/thrown from loaders/actions must have a Location header"),!hg(c)){let f=o.slice(0,o.findIndex(h=>h.route.id===i)+1);c=Tp(new URL(r.url),f,l,c),e.headers.set("Location",c)}return e}var gz=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function kp(e){try{return gz.includes(new URL(e).protocol)}catch{return!1}}fun)DELIM" +R"DELIM(ction L1(e,r,i,o){if(hg(e)){let l=e,c=Cf.test(l)?new URL(oE(l,r.protocol)):new URL(l);if(kp(c.toString()))throw new Error("Invalid redirect location");let f=er(c.pathname,i)!=null;if(c.origin===r.origin&&f)return mg(c.pathname)+c.search+c.hash}try{let l=o.createURL(e);if(kp(l.toString()))throw new Error("Invalid redirect location")}catch{}return e}function Go(e,r,i,o){let l=e.createURL(CE(r)).toString(),c={signal:i};if(o&&Sn(o.formMethod)){let{formMethod:f,formEncType:h}=o;c.method=f.toUpperCase(),h==="application/json"?(c.headers=new Headers({"Content-Type":h}),c.body=JSON.stringify(o.json)):h==="text/plain"?c.body=o.text:h==="application/x-www-form-urlencoded"&&o.formData?c.body=Rp(o.formData):c.body=o.formData}return new Request(l,c)}function jE(e,r){let i=new URL(e.url),o=typeof r=="string"?na(r):r;if(i.pathname=o.pathname||"/",o.search){let l=new URLSearchParams(o.search),c=l.getAll("index");l.delete("index");for(let f of c.filter(Boolean))l.append("index",f);i.search=l.size?`?${l.toString()}`:""}else i.search="";return i.hash=o.hash||"",i}function Rp(e){let r=new URLSearchParams;for(let[i,o]of e.entries())r.append(i,typeof o=="string"?o:o.name);return r}function B1(e){let r=new FormData;for(let[i,o]of e.entries())r.append(i,o);return r}function yz(e,r,i,o=!1,l=!1){let c={},f=null,h,m=!1,p={},v=i&&Xn(i[1])?i[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in r))return;let x=y.route.id,S=r[x];if(Ue(!Yi(S),"Cannot handle redirect results in processLoaderData"),Xn(S)){let E=S.error;if(v!==void 0&&(E=v,v=void 0),f=f||{},l)f[x]=E;else{let k=ui(e,x);f[k.route.id]==null&&(f[k.route.id]=E)}o||(c[x]=wE),m||(m=!0,h=Zl(S.error)?S.error.status:500),S.headers&&(p[x]=S.headers)}else c[x]=S.data,S.statusCode&&S.statusCode!==200&&!m&&(h=S.statusCode),S.headers&&(p[x]=S.headers)}),v!==void 0&&i&&(f={[i[0]]:v},i[2]&&(c[i[2]]=void 0)),{loaderData:c,errors:f,statusCode:h||200,loaderHeaders:p}}function U1(e,r,i,o,l,c,f){let{loaderData:h,errors:m}=yz(r,i,o);return l.filter(p=>!p.matches||p.matches.some(v=>v.shouldLoad)).forEach(p=>{let{key:v,match:y,controller:x}=p;if(x&&x.signal.aborted)return;let S=c[v];if(Ue(S,"Did not find corresponding fetcher result"),Xn(S)){let E=ui(e.matches,y?.route.id);m&&m[E.route.id]||(m={...m,[E.route.id]:S.error}),f.delete(v)}else if(Yi(S))Ue(!1,"Unhandled fetcher revalidation redirect");else{let E=Gr(S.data);f.set(v,E)}}),{loaderData:h,errors:m}}function H1(e,r,i,o){let l=Object.entries(r).filter(([,c])=>c!==wE).reduce((c,[f,h])=>(c[f]=h,c),{});for(let c of i){let f=c.route.id;if(!r.hasOwnProperty(f)&&e.hasOwnProperty(f)&&c.route.loader&&(l[f]=e[f]),o&&o.hasOwnProperty(f))break}return l}function $1(e){return e?Xn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ui(e,r){return(r?e.slice(0,e.findIndex(o=>o.route.id===r)+1):[...e]).reverse().find(o=>o.route.hasErrorBoundary===!0)||e[0]}function Uu(e){let r=e.length===1?e[0]:e.find(i=>i.index||!i.path||i.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:r}],route:r}}function fr(e,{pathname:r,routeId:i,method:o,type:l,message:c}={}){let f="Unknown Server Error",h="Unknown @remix-run/router error";return e===400?(f="Bad Request",o&&r&&i?h=`You made a ${o} request to "${r}" but did not provide a \`loader\` for route "${i}", so there is no way to handle the request.`:l==="invalid-body"&&(h="Unable to encode submission body")):e===403?(f="Forbidden",h=`Route "${i}" does not match URL "${r}"`):e===404?(f="Not Found",h=`No route matches URL "${r}"`):e===405&&(f="Method Not Allowed",o&&r&&i?h=`You made a ${o.toUpperCase()} request to "${r}" but did not provide an \`action\` for route "${i}", so there is no way to handle the request.`:o&&(h=`Invalid request method "${o.toUpperCase()}"`)),new Gl(e||500,f,new Error(h),!0)}function Hu(e){let r=Object.entries(e);for(let i=r.length-1;i>=0;i--){let[o,l]=r[i];if(Yi(l))return{key:o,result:l}}}function CE(e){let r=typeof e=="string"?na(e):e;return jn({...r,hash:""})}function vz(e,r){return e.pathname!==r.pathname||e.search!==r.search?!1:e.hash===""?r.hash!=="":e.hash===r.hash?!0:r.hash!==""}function bz(e){return new Gl(e.init?.status??500,e.init?.statusText??"Internal Server Error",e.data)}function xz(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([r,i])=>typeof r=="string"&&Sz(i))}function Sz(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function wz(e){return yg(e.result)&&xE.has(e.result.status)}function Xn(e){return e.type==="error"}function Yi(e){return(e&&e.type)==="redirect"}function P1(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function yg(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Ez(e){return xE.has(e)}function _z(e){return yg(e)&&Ez(e.status)&&e.headers.has("Location")}function Tz(e){return WA.has(e.toUpperCase())}function Sn(e){return XA.has(e.toUpperCase())}function vg(e){return new URLSearchParams(e).getAll("index").some(r=>r==="")}function Ju(e,r){let i=typeof r=="string"?na(r).search:r.search;if(e[e.length-1].route.index&&vg(i||""))return e[e.length-1];let o=pE(e);return o[o.length-1]}function I1(e){let{formMethod:r,formAction:i,formEncType:o,text:l,formData:c,json:f}=e;if(!(!r||!i||!o)){if(l!=null)return{formMethod:r,formAction:i,formEncType:o,formData:void 0,json:void 0,text:l};if(c!=null)return{formMethod:r,formAction:i,formEncType:o,formData:c,json:void 0,text:void 0};if(f!==void 0)return{formMethod:r,formAction:i,formEncType:o,formData:void 0,json:f,text:void 0}}}function Hm(e,r,i,o){return o?{state:"loading",location:e,matches:r,historyAction:i,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text}:{state:"loading",location:e,matches:r,historyAction:i,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function Nz(e,r,i,o){return{state:"submitting",location:e,matches:r,historyAction:i,formMethod:o.formMethod,formAction:o.formAction,formEncType:o.formEncType,formData:o.formData,json:o.json,text:o.text}}function bl(e,r){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:r}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:r}}function kz(e,r){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:r?r.data:void 0}}function Gr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Rz(e,r){try{let i=e.sessionStorage.getItem(SE);if(i){let o=JSON.parse(i);for(let[l,c]of Object.entries(o||{}))c&&Array.isArray(c)&&r.set(l,new Set(c||[]))}}catch{}}function jz(e,r){if(r.size>0){let i={};for(let[o,l]of r)i[o]=[...l];try{e.sessionStorage.setItem(SE,JSON.stringify(i))}catch(o){Nt(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function Z1(){let e,r,i=new Promise((o,l)=>{e=async c=>{o(c);try{await i}catch{}},r=async c=>{l(c);try{await i}catch{}}});return{promise:i,resolve:e,reject:r}}var Ji=_.createContext(null);Ji.displayName="DataRouter";var ys=_.createContext(null);ys.displayName="DataRouterState";var OE=_.createContext(!1);function AE(){return _.useContext(OE)}var bg=_.createContext({isTransitioning:!1});bg.displayName="ViewTransition";var zE=_.createContext(new Map);zE.displayName="Fetchers";var Cz=_.createContext(null);Cz.displayName="Await";var On=_.createContext(null);On.displayName="Navigation";var Jl=_.createContext(null);Jl.displayName="Location";var pr=_.createContext({outlet:null,matches:[],isDataRoute:!1});pr.displayName="Route";var xg=_.createContext(null);xg.displayName="RouteE)DELIM" +R"DELIM(rror";var ME="REACT_ROUTER_ERROR",Oz="REDIRECT",Az="ROUTE_ERROR_RESPONSE";function zz(e){if(e.startsWith(`${ME}:${Oz}:{`))try{let r=JSON.parse(e.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function Mz(e){if(e.startsWith(`${ME}:${Az}:{`))try{let r=JSON.parse(e.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new Gl(r.status,r.statusText,r.data)}catch{}}function Dz(e,{relative:r}={}){Ue(vs(),"useHref() may be used only in the context of a component.");let{basename:i,navigator:o}=_.useContext(On),{hash:l,pathname:c,search:f}=Wl(e,{relative:r}),h=c;return i!=="/"&&(h=c==="/"?i:hr([i,c])),o.createHref({pathname:h,search:f,hash:l})}function vs(){return _.useContext(Jl)!=null}function rn(){return Ue(vs(),"useLocation() may be used only in the context of a component."),_.useContext(Jl).location}function Lz(){return _.useContext(Jl).navigationType}var DE="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function LE(e){_.useContext(On).static||_.useLayoutEffect(e)}function Rr(){let{isDataRoute:e}=_.useContext(pr);return e?Gz():Bz()}function Bz(){Ue(vs(),"useNavigate() may be used only in the context of a component.");let e=_.useContext(Ji),{basename:r,navigator:i}=_.useContext(On),{matches:o}=_.useContext(pr),{pathname:l}=rn(),c=JSON.stringify(Of(o)),f=_.useRef(!1);return LE(()=>{f.current=!0}),_.useCallback((m,p={})=>{if(Nt(f.current,DE),!f.current)return;if(typeof m=="number"){i.go(m);return}let v=Kl(m,JSON.parse(c),l,p.relative==="path");e==null&&r!=="/"&&(v.pathname=v.pathname==="/"?r:hr([r,v.pathname])),es(typeof m=="string"?m:jn(m),i.createHref(v),pg(i),"reject"),(p.replace?i.replace:i.push)(v,p.state,p)},[r,i,c,l,e])}var Uz=_.createContext(null);function Hz(e){let r=_.useContext(pr).outlet;return _.useMemo(()=>r&&_.createElement(Uz.Provider,{value:e},r),[r,e])}function Sg(){let{matches:e}=_.useContext(pr);return e[e.length-1]?.params??{}}function Wl(e,{relative:r}={}){let{matches:i}=_.useContext(pr),{pathname:o}=rn(),l=JSON.stringify(Of(i));return _.useMemo(()=>Kl(e,JSON.parse(l),o,r==="path"),[e,l,o,r])}function $z(e,r,i){Ue(vs(),"useRoutes() may be used only in the context of a component.");let{navigator:o}=_.useContext(On),{matches:l}=_.useContext(pr),c=l[l.length-1],f=c?c.params:{},h=c?c.pathname:"/",m=c?c.pathnameBase:"/",p=c&&c.route;{let T=p&&p.path||"";$E(h,!p||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let v=Kt(),y;y=v;let x=y.pathname)DELIM" -R"DELIM(||"/",S=x;if(h!=="/"){let T=h.replace(/^\//,"").split("/");S="/"+x.replace(/^\//,"").split("/").slice(T.length).join("/")}let k=r&&r.state.matches.length?r.state.matches.map(T=>Object.assign(T,{route:r.manifest[T.route.id]||T.route})):v1(e,{pathname:S});return _t(g||k!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),_t(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),hC(k&&k.map(T=>Object.assign({},T,{params:Object.assign({},u,T.params),pathname:ea([h,s.encodeLocation?s.encodeLocation(T.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?h:ea([h,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),l,r)}function cC(){let e=V1(),n=el(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:c},"ErrorBoundary")," or"," ",E.createElement("code",{style:c},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},n),r?E.createElement("pre",{style:l},r):null,u)}var uC=E.createElement(cC,null),Q1=class extends E.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=nC(e.digest);r&&(e=r)}let n=e!==void 0?E.createElement(na.Provider,{value:this.props.routeContext},E.createElement(Mp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?E.createElement(fC,{error:e},n):n}};Q1.contextType=H1;var ch=new WeakMap;function fC({children:e,error:n}){let{basename:r}=E.useContext(mn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let s=tC(n.digest);if(s){let l=ch.get(n);if(l)throw l;let c=T1(s.location,r),u=c.absoluteURL||c.to;if(Vh(u))throw new Error("Invalid redirect location");if(k1&&!ch.get(n))if(c.isExternal||s.reloadDocument)window.location.href=u;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw ch.set(n,f),f}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}function dC({routeContext:e,match:n,children:r}){let s=E.useContext(wi);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(na.Provider,{value:e},r)}function hC(e,n=[],r){let s=r?.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(n.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let l=e,c=s?.errors;if(c!=null){let v=l.findIndex(y=>y.route.id&&c?.[y.route.id]!==void 0);Le(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,v+1))}let u=!1,f=-1;if(r&&s){u=s.renderFallback;for(let v=0;v=0?l=l.slice(0,f+1):l=[l[0]];break}}}}let h=r?.onError,g=s&&h?(v,y)=>{h(v,{location:s.location,params:s.matches?.[0]?.params??{},pattern:ul(s.matches),errorInfo:y})}:void 0;return l.reduceRight((v,y,x)=>{let S,k=!1,C=null,T=null;s&&(S=c&&y.route.id?c[y.route.id]:void 0,C=y.route.errorElement||uC,u&&(f<0&&x===0?(G1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,T=null):f===x&&(k=!0,T=y.route.hydrateFallbackElement||null)));let Q=n.concat(l.slice(0,x+1)),I=()=>{let K;return S?K=C:k?K=T:y.route.Component?K=E.createElement(y.route.Component,null):y.route.element?K=y.route.element:K=v,E.createElement(dC,{match:y,routeContext:{outlet:v,matches:Q,isDataRoute:s!=null},children:K})};return s&&(y.route.ErrorBoundary||y.route.errorElement||x===0)?E.createElement(Q1,{location:s.location,revalidation:s.revalidation,component:C,error:S,children:I(),routeContext:{outlet:null,matches:Q,isDataRoute:!0},onError:g}):I()},null)}function Lp(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function pC(e){let n=E.useContext(wi);return Le(n,Lp(e)),n}function Bp(e){let n=E.useContext(As);return Le(n,Lp(e)),n}function mC(e){let n=E.useContext(na);return Le(n,Lp(e)),n}function Up(e){let n=mC(e),r=n.matches[n.matches.length-1];return Le(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function gC(){return Up("useRouteId")}function yC(){let e=Bp("useNavigation");return E.useMemo(()=>{let{matches:n,historyAction:r,...s}=e.navigation;return s},[e.navigation])}function Y1(){let{matches:e,loaderData:n}=Bp("useMatches");return E.useMemo(()=>e.map(r=>b1(r,n)),[e,n])}function V1(){let e=E.useContext(Mp),n=Bp("useRouteError"),r=Up("useRouteError");return e!==void 0?e:n.errors?.[r]}function vC(){let{router:e}=pC("useNavigate"),n=Up("useNavigate"),r=E.useRef(!1);return F1(()=>{r.current=!0}),E.useCallback(async(l,c={})=>{_t(r.current,q1),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:n,...c}))},[e,n])}var g0={};function G1(e,n,r){!n&&!g0[e]&&(g0[e]=!0,_t(!1,r))}var y0={};function v0(e,n){!e&&!y0[n]&&(y0[n]=!0,console.warn(n))}var bC="useOptimistic",b0=CE[bC],xC=()=>{};function SC(e){return b0?b0(e):[e,xC]}function wC(e){let n={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&_t(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(n,{element:E.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&_t(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(n,{hydrateFallbackElement:E.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&_t(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(n,{errorElement:E.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),n}var EC=["HydrateFallback","hydrateFallbackElement"],_C=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function kC({router:e,flushSync:n,onError:r,useTransitions:s}){s=P1()||s;let)DELIM" -R"DELIM([c,u]=E.useState(e.state),[f,h]=SC(c),[g,v]=E.useState(),[y,x]=E.useState({isTransitioning:!1}),[S,k]=E.useState(),[C,T]=E.useState(),[Q,I]=E.useState(),K=E.useRef(new Map),oe=E.useCallback((_,{deletedFetchers:M,newErrors:$,flushSync:P,viewTransitionOpts:U})=>{$&&r&&Object.values($).forEach(de=>r(de,{location:_.location,params:_.matches[0]?.params??{},pattern:ul(_.matches)})),_.fetchers.forEach((de,me)=>{de.data!==void 0&&K.current.set(me,de.data)}),M.forEach(de=>K.current.delete(de)),v0(P===!1||n!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let fe=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(v0(U==null||fe,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!U||!fe){n&&P?n(()=>u(_)):s===!1?u(_):E.startTransition(()=>{s===!0&&h(de=>x0(de,_)),u(_)});return}if(n&&P){n(()=>{C&&(S?.resolve(),C.skipTransition()),x({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let de=e.window.document.startViewTransition(()=>{n(()=>u(_))});de.finished.finally(()=>{n(()=>{k(void 0),T(void 0),v(void 0),x({isTransitioning:!1})})}),n(()=>T(de));return}C?(S?.resolve(),C.skipTransition(),I({state:_,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(v(_),x({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[e.window,n,C,S,s,h,r]);E.useLayoutEffect(()=>e.subscribe(oe),[e,oe]),E.useEffect(()=>{y.isTransitioning&&!y.flushSync&&k(new _C)},[y]),E.useEffect(()=>{if(S&&g&&e.window){let _=g,M=S.promise,$=e.window.document.startViewTransition(async()=>{s===!1?u(_):E.startTransition(()=>{s===!0&&h(P=>x0(P,_)),u(_)}),await M});$.finished.finally(()=>{k(void 0),T(void 0),v(void 0),x({isTransitioning:!1})}),T($)}},[g,S,e.window,s,h]),E.useEffect(()=>{S&&g&&f.location.key===g.location.key&&S.resolve()},[S,C,f.location,g]),E.useEffect(()=>{!y.isTransitioning&&Q&&(v(Q.state),x({isTransitioning:!0,flushSync:!1,currentLocation:Q.currentLocation,nextLocation:Q.nextLocation}),I(void 0))},[y.isTransitioning,Q]);let J=E.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:_=>e.navigate(_),push:(_,M,$)=>e.navigate(_,{state:M,preventScrollReset:$?.preventScrollReset}),replace:(_,M,$)=>e.navigate(_,{replace:!0,state:M,preventScrollReset:$?.preventScrollReset})}),[e]),ge=e.basename||"/",O=E.useMemo(()=>({router:e,navigator:J,static:!1,basename:ge,onError:r}),[e,J,ge,r]);return E.createElement(E.Fragment,null,E.createElement(wi.Provider,{value:O},E.createElement(As.Provider,{value:f},E.createElement(Z1.Provider,{value:K.current},E.createElement(zp.Provider,{value:y},E.createElement(CC,{basename:ge,location:f.location,navigationType:f.historyAction,navigator:J,useTransitions:s},E.createElement(TC,{routes:e.routes,manifest:e.manifest,future:e.future,state:f,isStatic:!1,onError:r})))))),null)}function x0(e,n){return{...e,navigation:n.navigation.state!=="idle"?n.navigation:e.navigation,revalidation:n.revalidation!=="idle"?n.revalidation:e.revalidation,actionData:n.navigation.state!=="submitting"?n.actionData:e.actionData,fetchers:n.fetchers}}var TC=E.memo(NC);function NC({routes:e,manifest:n,future:r,state:s,isStatic:l,onError:c}){return lC(e,void 0,{manifest:n,state:s,isStatic:l,onError:c})}function jC({to:e,replace:n,state:r,relative:s}){Le(Os()," may be used only in the context of a component.");let{static:l}=E.useContext(mn);_t(!l," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:c}=E.useContext(na),{pathname:u}=Kt(),f=pa(),h=ll(e,ku(c),u,s==="path"),g=JSON.stringify(h);return E.useEffect(()=>{f(JSON.parse(g),{replace:n,state:r,relative:s})},[f,g,s,n,r]),null}function RC(e){return oC(e.context)}function Bt(e){Le(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function CC({basename:e="/",children:n=null,location:r,navigationType:s="POP",navigator:l,static:c=!1,useTransitions:u}){Le(!Os(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=E.useMemo(()=>({basename:f,navigator:l,static:c,useTransitions:u,future:{}}),[f,l,c,u]);typeof r=="string"&&(r=Ra(r));let{pathname:g="/",search:v="",hash:y="",state:x=null,key:S="default",mask:k}=r,C=E.useMemo(()=>{let T=$n(g,f);return T==null?null:{location:{pathname:T,search:v,hash:y,state:x,key:S,mask:k},navigationType:s}},[f,g,v,y,x,S,s,k]);return _t(C!=null,` is not able to match the URL "${g}${v}${y}" because it does not start with the basename, so the won't render anything.`),C==null?null:E.createElement(mn.Provider,{value:h},E.createElement(fl.Provider,{children:n,value:C}))}function Kh(e,n=[]){let r=[];return E.Children.forEach(e,(s,l)=>{if(!E.isValidElement(s))return;let c=[...n,l];if(s.type===E.Fragment){r.push.apply(r,Kh(s.props.children,c));return}Le(s.type===Bt,`[${typeof s.type=="string"?s.type:s.type.name}] is not a component. All component children of must be a or `),Le(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||c.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Kh(s.props.children,c)),r.push(u)}),r}var AC=Kh,Jc="get",Wc="application/x-www-form-urlencoded";function Tu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function OC(e){return Tu(e)&&e.tagName.toLowerCase()==="button"}function zC(e){return Tu(e)&&e.tagName.toLowerCase()==="form"}function MC(e){return Tu(e)&&e.tagName.toLowerCase()==="input"}function DC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LC(e,n){return e.button===0&&(!n||n==="_self")&&!DC(e)}function Xh(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((n,r)=>{let s=e[r];return n.concat(Array.isArray(s)?s.map(l=>[r,l]):[[r,s]])},[]))}function BC(e,n){let r=Xh(e);return n&&n.forEach((s,l)=>{r.has(l)||n.getAll(l).forEach(c=>{r.append(l,c)})}),r}var Hc=null;function UC(){if(Hc===null)try{new FormData(document.createElement("form"),0),Hc=!1}catch{Hc=!0}return Hc}var $C=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function uh(e){return e!=null&&!$C.has(e)?(_t(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Wc}"`),null):e}function HC(e,n){let r,s,l,c,u;if(zC(e)){let f=e.getAttribute("action");s=f?$n(f,n):null,r=e.getAttribute("method")||Jc,l=uh(e.getAttribute("enctype"))||Wc,c=new FormData(e)}else if(OC(e)||MC(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a