From f538aa920620e1efd7fc8f84ea00f56766314e70 Mon Sep 17 00:00:00 2001 From: chronoflame78 Date: Fri, 26 Jun 2026 09:25:57 +0700 Subject: [PATCH] FE challenge - solve problem 1, 2, 3 --- readme.md | 27 + src/problem1/index.js | 75 + src/problem2/.gitignore | 11 + src/problem2/README.md | 79 + src/problem2/index.html | 40 +- src/problem2/package-lock.json | 3288 +++++++++++++++++ src/problem2/package.json | 33 + src/problem2/public/swap.svg | 6 + src/problem2/script.js | 0 src/problem2/src/App.tsx | 34 + src/problem2/src/components/SwapForm.test.tsx | 182 + src/problem2/src/components/SwapForm.tsx | 356 ++ src/problem2/src/components/SwapToast.tsx | 58 + src/problem2/src/components/TokenIcon.tsx | 53 + src/problem2/src/components/TokenSelect.tsx | 107 + src/problem2/src/hooks/usePrices.test.ts | 57 + src/problem2/src/hooks/usePrices.ts | 46 + src/problem2/src/index.css | 720 ++++ src/problem2/src/lib/tokens.test.ts | 97 + src/problem2/src/lib/tokens.ts | 65 + src/problem2/src/main.tsx | 10 + src/problem2/src/test/setup.ts | 8 + src/problem2/src/types.ts | 16 + src/problem2/src/vite-env.d.ts | 1 + src/problem2/style.css | 8 - src/problem2/tsconfig.app.json | 25 + src/problem2/tsconfig.app.tsbuildinfo | 1 + src/problem2/tsconfig.json | 7 + src/problem2/tsconfig.node.json | 20 + src/problem2/tsconfig.node.tsbuildinfo | 1 + src/problem2/vite.config.ts | 13 + src/problem3/task.md | 220 ++ 32 files changed, 5630 insertions(+), 34 deletions(-) create mode 100644 src/problem1/index.js create mode 100644 src/problem2/.gitignore create mode 100644 src/problem2/README.md create mode 100644 src/problem2/package-lock.json create mode 100644 src/problem2/package.json create mode 100644 src/problem2/public/swap.svg delete mode 100644 src/problem2/script.js create mode 100644 src/problem2/src/App.tsx create mode 100644 src/problem2/src/components/SwapForm.test.tsx create mode 100644 src/problem2/src/components/SwapForm.tsx create mode 100644 src/problem2/src/components/SwapToast.tsx create mode 100644 src/problem2/src/components/TokenIcon.tsx create mode 100644 src/problem2/src/components/TokenSelect.tsx create mode 100644 src/problem2/src/hooks/usePrices.test.ts create mode 100644 src/problem2/src/hooks/usePrices.ts create mode 100644 src/problem2/src/index.css create mode 100644 src/problem2/src/lib/tokens.test.ts create mode 100644 src/problem2/src/lib/tokens.ts create mode 100644 src/problem2/src/main.tsx create mode 100644 src/problem2/src/test/setup.ts create mode 100644 src/problem2/src/types.ts create mode 100644 src/problem2/src/vite-env.d.ts delete mode 100644 src/problem2/style.css create mode 100644 src/problem2/tsconfig.app.json create mode 100644 src/problem2/tsconfig.app.tsbuildinfo create mode 100644 src/problem2/tsconfig.json create mode 100644 src/problem2/tsconfig.node.json create mode 100644 src/problem2/tsconfig.node.tsbuildinfo create mode 100644 src/problem2/vite.config.ts create mode 100644 src/problem3/task.md diff --git a/readme.md b/readme.md index 1ff4bc95b4..aa0d76c999 100644 --- a/readme.md +++ b/readme.md @@ -8,3 +8,30 @@ It is important that you minimally attempt the problems, even if you do not arri ## Submission ## You can either provide a link to an online repository, attach the solution in your application, or whichever method you prefer. We're cool as long as we can view your solution without any pain. + +## Execution ## + +**Prerequisites:** [Node.js](https://nodejs.org) 18+ (only needed for Problem 2). + +### Problem 1 — Sum to N +Runs the three implementations against a built-in test suite: + +```bash +node src/problem1/index.js +``` + +### Problem 2 — Currency Swap Form +First install dependencies, then start the dev server: + +```bash +cd src/problem2 +npm install +npm run dev +``` + +Then open http://localhost:5173 in your browser. +Run the test suite with `npm run test:run`. + +### Problem 3 — React Code Review +The list of issues and the refactored solution are written at the bottom of +[`src/problem3/task.md`](src/problem3/task.md). diff --git a/src/problem1/index.js b/src/problem1/index.js new file mode 100644 index 0000000000..4901b47323 --- /dev/null +++ b/src/problem1/index.js @@ -0,0 +1,75 @@ +// Three unique implementations of summation to n. + +// Implementation A: closed-form (Gauss) formula. O(1) time and space. +var sum_to_n_a = function (n) { + const sign = n < 0 ? -1 : 1; + const m = Math.abs(n); + return sign * (m * (m + 1)) / 2; +}; + +// Implementation B: iterative accumulation. O(n) time, O(1) space. +var sum_to_n_b = function (n) { + let sum = 0; + const sign = n < 0 ? -1 : 1; + for (let i = 1; i <= Math.abs(n); i++) { + sum += i * sign; + } + return sum; +}; + +// Implementation C: functional reduce over a generated range. O(n) time and space. +var sum_to_n_c = function (n) { + const sign = n < 0 ? -1 : 1; + return Array.from({ length: Math.abs(n) }, function (_, i) { + return (i + 1) * sign; + }).reduce(function (acc, value) { + return acc + value; + }, 0); +}; + +// --- Tests --------------------------------------------------------------- +// Contract: any integer. Negative n sums |n| terms with n's sign, e.g. +// sum_to_n(-5) === -(1+2+3+4+5) === -15. All three should agree everywhere. +function runTestCases() { + const testCases = [ + { input: 0, expected: 0 }, + { input: 1, expected: 1 }, + { input: 5, expected: 15 }, + { input: 10, expected: 55 }, + { input: 100, expected: 5050 }, + { input: -1, expected: -1 }, + { input: -5, expected: -15 }, + { input: -10, expected: -55 }, + { input: -100, expected: -5050 }, + ]; + + const implementations = [ + { name: "Implementation A", fn: sum_to_n_a }, + { name: "Implementation B", fn: sum_to_n_b }, + { name: "Implementation C", fn: sum_to_n_c }, + ]; + + console.log("Running Tests...\n"); + + let passed = 0; + let failed = 0; + + testCases.forEach(({ input, expected }) => { + console.log(`Test n = ${input} (expected: ${expected})`); + implementations.forEach(({ name, fn }) => { + const result = fn(input); + const pass = result === expected; + pass ? passed++ : failed++; + console.log( + ` ${name}: ${result} → ${pass ? "PASS" : "FAIL"}` + ); + }); + console.log(""); + }); + + const total = passed + failed; + console.log(`All tests completed: ${passed}/${total} passed, ${failed} failed.`); +} + +// Execute test cases +runTestCases(); \ No newline at end of file diff --git a/src/problem2/.gitignore b/src/problem2/.gitignore new file mode 100644 index 0000000000..eed76e6446 --- /dev/null +++ b/src/problem2/.gitignore @@ -0,0 +1,11 @@ +node_modules +dist +dist-ssr +*.local +.vite + +# Editor / OS +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store diff --git a/src/problem2/README.md b/src/problem2/README.md new file mode 100644 index 0000000000..cf66d86352 --- /dev/null +++ b/src/problem2/README.md @@ -0,0 +1,79 @@ +# Fancy Swap — Currency Swap Form + +A polished currency swap interface built with **Vite + React + TypeScript**. + +![stack](https://img.shields.io/badge/Vite-React-TypeScript-7c6cff) + +## Run it + +```bash +cd src/problem2 +npm install +npm run dev # http://localhost:5173 +``` + +Other scripts: + +```bash +npm run build # type-check (tsc -b) + production build to dist/ +npm run preview # serve the production build +npm test # run the Vitest suite in watch mode +npm run test:run # run the suite once (CI) +``` + +> On Windows PowerShell, chain commands with `;` (and `if ($?)`) rather than +> `&&`, e.g. `cd src/problem2; if ($?) { npm run dev }`. + +## What it does + +- **Live prices & rates** — fetches the [Switcheo price feed](https://interview.switcheo.com/prices.json), + de-duplicates it (keeping the most recent record per currency), and computes the + exchange rate as `priceFrom / priceTo`. Tokens without a price are omitted. +- **Token picker** — searchable modal listing every priced token with its icon + (from the [Switcheo token-icons repo](https://github.com/Switcheo/token-icons/tree/main/tokens)) + and USD price. Icons that don't exist fall back to a coloured monogram. +- **Two-way form** — type into "You pay" to compute "You receive"; the flip + button swaps direction and carries the amount over. +- **Validation** — rejects non-numeric/negative input and flags + *insufficient balance* against a mock per-token wallet ("Max" fills the field). +- **Simulated backend** — "Confirm swap" shows a loading spinner for ~1.6s, + then a success state (no real funds move). + +## Structure + +``` +src/ + components/ + SwapForm.tsx # form state, validation, submit simulation + TokenSelect.tsx # searchable token-picker modal + TokenIcon.tsx # SVG icon with monogram fallback + hooks/ + usePrices.ts # fetches the feed -> derived token list + lib/ + tokens.ts # price parsing, icon URLs, number formatting + types.ts # shared types + App.tsx # loading / error / form states + index.css # design system + component styles +``` + +## Tests + +[Vitest](https://vitest.dev) + React Testing Library (chosen over Jest because it +reuses the Vite pipeline — native TS/ESM, no separate transform config). 21 specs: + +- `lib/tokens.test.ts` — price de-duplication (latest-by-date, the timestamp-tie + rule, dropping non-positive/malformed records, sorting) and number formatting. +- `hooks/usePrices.test.ts` — loading → tokens / error transitions with a mocked `fetch`. +- `components/SwapForm.test.tsx` — rate calculation, input guarding, the + insufficient-balance error, the flip button, and the simulated swap lifecycle. + +```bash +npm run test:run +``` + +## Notes + +- Wallet balances are mocked (deterministic per symbol) since there is no + real account — enough to make the balance/Max/insufficient checks meaningful. +- No UI framework was used; the design system lives in `index.css` so the visual + style is fully hand-authored. diff --git a/src/problem2/index.html b/src/problem2/index.html index 4058a68bff..6048a44139 100644 --- a/src/problem2/index.html +++ b/src/problem2/index.html @@ -1,27 +1,15 @@ - - - - - Fancy Form - - - - - - - - -
-
Swap
- - - - - - - -
- - - + + + + + + + + + Fancy Swap — Currency Exchange + + +
+ + diff --git a/src/problem2/package-lock.json b/src/problem2/package-lock.json new file mode 100644 index 0000000000..db84737e94 --- /dev/null +++ b/src/problem2/package-lock.json @@ -0,0 +1,3288 @@ +{ + "name": "currency-swap-form", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "currency-swap-form", + "version": "1.0.0", + "dependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", + "@testing-library/user-event": "^14.6.1", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.4", + "jsdom": "^25.0.1", + "typescript": "^5.6.3", + "vite": "^6.0.7", + "vitest": "^2.1.9" + } + }, + "node_modules/@adobe/css-tools": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz", + "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@asamuzakjp/css-color": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@asamuzakjp/css-color/-/css-color-3.2.0.tgz", + "integrity": "sha512-K1A6z8tS3XsmCMM86xoWdn7Fkdn9m6RSVtocUrJYIwZnFVkng/PvkEoWtOWmP+Scc6saYWHWZYbndEEXxl24jw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@csstools/css-calc": "^2.1.3", + "@csstools/css-color-parser": "^3.0.9", + "@csstools/css-parser-algorithms": "^3.0.4", + "@csstools/css-tokenizer": "^3.0.3", + "lru-cache": "^10.4.3" + } + }, + "node_modules/@asamuzakjp/css-color/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-self": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.29.7.tgz", + "integrity": "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-transform-react-jsx-source": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.29.7.tgz", + "integrity": "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@csstools/color-helpers": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@csstools/color-helpers/-/color-helpers-5.1.0.tgz", + "integrity": "sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT-0", + "engines": { + "node": ">=18" + } + }, + "node_modules/@csstools/css-calc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@csstools/css-calc/-/css-calc-2.1.4.tgz", + "integrity": "sha512-3N8oaj+0juUw/1H3YwmDDJXCgTB1gKU6Hc/bB502u9zR0q2vd786XJH9QfrKIEgFlZmhZiq6epXl4rHqhzsIgQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-color-parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@csstools/css-color-parser/-/css-color-parser-3.1.0.tgz", + "integrity": "sha512-nbtKwh3a6xNVIp/VRuXV64yTKnb1IjTAEEh3irzS+HkKjAOYLTGNb9pmVNntZ8iVBHcWDA2Dof0QtPgFI1BaTA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "dependencies": { + "@csstools/color-helpers": "^5.1.0", + "@csstools/css-calc": "^2.1.4" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-parser-algorithms": "^3.0.5", + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-parser-algorithms": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@csstools/css-parser-algorithms/-/css-parser-algorithms-3.0.5.tgz", + "integrity": "sha512-DaDeUkXZKjdGhgYaHNJTV9pV7Y9B3b644jCLs9Upc3VeNGg6LWARAT6O+Q+/COo+2gg/bM5rhpMAtf70WqfBdQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@csstools/css-tokenizer": "^3.0.4" + } + }, + "node_modules/@csstools/css-tokenizer": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@csstools/css-tokenizer/-/css-tokenizer-3.0.4.tgz", + "integrity": "sha512-Vd/9EVDiu6PPJt9yAh6roZP6El1xHrdvIVGjyBsHR0RYwNHgL7FJPyIIW4fANJNG6FtyZfvlRPpFI4ZM/lubvw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.0-beta.27", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz", + "integrity": "sha512-+d0F4MKMCbeVUJwG96uQ4SgAznZNSq93I3V+9NHA4OpvqG8mRCpGdKmK8l/dl02h2CCDHwW2FqilnTyDcAnqjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", + "integrity": "sha512-6o7ZLZK+BeenkZCFNDXqpbjw9bD6nuWonvS/lwQJp7NoVVxm6p3qE7qQ5jGuBjiFsgvqjD8mZAU5oWxTmbOeOg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.62.2.tgz", + "integrity": "sha512-BaH7BllCACHoH1LguOU56UItGfUWjujlO65kS9LAodViaN4bwIKd7oeW/ZHJ/4ljr/7MIiENnNy3HJ0zXv8Zkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.62.2.tgz", + "integrity": "sha512-v39RCCvj4He82I9sFmk+M1VZ0PLM9sfsLVikjfx2hYBNALhrrOR2D3JjQA6AhlaSOgcR+RzrKY7e1+bT6SUO/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.62.2.tgz", + "integrity": "sha512-yl0y2vq3S3lHeuXhEdss6TWfKW8vkujImO12tn4ZkG/4oghr09LvdYm2RElVjokTQiUvDUGXLGsYeLqUMCKpGA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.62.2.tgz", + "integrity": "sha512-tT4pvt4qXD+vEoezupCWi+a1F0vvDiksiHc+PxRlYTOH1I6/X4id9jPxTP+Fg+545euaFT1jJVs4CEdHZAU1vw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.62.2.tgz", + "integrity": "sha512-6nU5F2wCW+qvCBhTn1pdIU3bzsIoF7EUwsCDRxilWGprQR6yd508YnH9+OKFCwpfS8pjZqDUmnCAr7exax0XCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.62.2.tgz", + "integrity": "sha512-n1GJHPOvpIfhi3TmrCeh6S6URt9BFCt0KQE3qvexyGCTAKpR4Lg+eWvNZEqu7epxwus/8ElT3hacYEucm49SZg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.62.2.tgz", + "integrity": "sha512-JqgflS8wEB+UXV/vS1RpRbifGBeN4D5lz8D8oOFbFZw4vedvdOgCFAjfBmIMdW3yL10XpQQ0Ambepw6MXrhOnA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.62.2.tgz", + "integrity": "sha512-wnFJkogWvN4jm/hQRF2UBaeUmk20j5+DmHvoyWii2b8HJDyvz1MF2OU/6ynXt2KR63rbZLWkFpoytpdc/yBuSA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.62.2.tgz", + "integrity": "sha512-HVu2bp0zhvJ8xHEV9+UUs7S90VadmBSY3LcIMvozbPo4AuMGDWlz3ymHLHZPX4hR67TKTt8Qp5PJ5RBg/i+RMQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.62.2.tgz", + "integrity": "sha512-mQqqAV8QaoSgr9I2fKDLY2BAVvmKjWoGiu/cSYQonsLvtqwEn1E4QYfnCOcp5zoEqNhsDYin1s6jx/VJmrxlZg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.62.2.tgz", + "integrity": "sha512-IxKLoxCQ2IWi6bT2akyDUBGsOImDKB+sPp4EsTmwFQ/fMwpCKm8uLSSgP/Kx/QYUgKis6SEZ5/Nlhup0DIA0PQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.62.2.tgz", + "integrity": "sha512-Mk5ha2RQSgyFfmYYLkBpPnUk8D8FriBxesO1u9O75X0mHgXL1UQcH5Itl2lurWL2tj0RxV9b9tJgipac0hRY9A==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.62.2.tgz", + "integrity": "sha512-CjvEnqJL/0/TQ3TXX3OPIJ/kmBellrWd4heXUmHeJlTnmwjKpSJzoehLaL6Xk0ZnMHBu9dZuFADNOrtjF4v+2w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.62.2.tgz", + "integrity": "sha512-1SiZbzwdkaDURsew/tSOrooKiYy7EQGT6m8ufavAi9NEyQb/6VuIxFXAL1fqa4iZe3g4NbNk4P7J32z2tw5Mgg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.62.2.tgz", + "integrity": "sha512-nQts12zJ3NQRoE6uYljOH89v7szzLDvG2JD/vsX+vGXU8w/At1GowTZ5/7qeFQ8m7L55rpR8Okugnuo5bgjy2Q==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.62.2.tgz", + "integrity": "sha512-E9/ll019jhPIJgpzfZoIkBGhcz+kKNgVWYRY0zr9srBdPPFVpvOKW8VaJKUbeK+eZXyQF9ltME+Kk6affeaPgg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.62.2.tgz", + "integrity": "sha512-5BqxR/pshjey51iliyzTD5Xi3EN0aLmQ2lZ3lvefVV9c82BvrLo2/6OT55iifpWBufs6kdwWbuOKS841DrmK9A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.62.2.tgz", + "integrity": "sha512-uNN83XxQrRAh/w0/pmAfibcwyb6YWt4gP+dpnQKPVJshAloQ785ii8CT8ZCIxkGg9opVsvAlGhFitSm6D1Jjpg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.62.2.tgz", + "integrity": "sha512-srjEIxSH3LRnJN6THczDHWQplqEMFiAJrTab0msUryh9kwNpkICf3Ea6q6MN/2cZwRFUNx5w+h6Hpi4QuHS6Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.62.2.tgz", + "integrity": "sha512-8hOJnxgbyObnCm5AlRA3A931xX19xq80RjVTKgJOvEKWqJruP/Uf12IbAOaDjjEXYRewwHLfmF0YRIdK3OwKWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.62.2.tgz", + "integrity": "sha512-mmF4AY1i0hG/bLWUctUq59gtmgaSIRa3cu/A3JFRp/sCNEme2bgDEiDS22P9FbnJB8NJNF4jPJiSP5RHQpUTDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.62.2.tgz", + "integrity": "sha512-DZgkknc6jhHrk46V25vbAM0zZkyP0nSDkJB8/dRkLTxv470dOmWDqGoEJl/9A0dFfS7yE3REOwNDxpHwSLSt0Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.62.2.tgz", + "integrity": "sha512-T6xr6ucWSFto+VGajA8YH26LdpHRuP4YLHEKAtCWvJDOlnmWcDZVCI2Jmjr+IFHDlt2zRaTAKE4tfjTaWLgJBg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.62.2.tgz", + "integrity": "sha512-BfzEnDJOt9T8M989/lA37EcJgat01wLRnoi5dQf3QzOH7jzpqTAzdDbVfRljVr5r+jzKqpbHeyOfAaXxAd0PAA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@testing-library/dom": { + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz", + "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/runtime": "^7.12.5", + "@types/aria-query": "^5.0.1", + "aria-query": "5.3.0", + "dom-accessibility-api": "^0.5.9", + "lz-string": "^1.5.0", + "picocolors": "1.1.1", + "pretty-format": "^27.0.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@testing-library/jest-dom": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@testing-library/react": { + "version": "16.3.2", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.2.tgz", + "integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.12.5" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@testing-library/dom": "^10.0.0", + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@testing-library/user-event": { + "version": "14.6.1", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz", + "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12", + "npm": ">=6" + }, + "peerDependencies": { + "@testing-library/dom": ">=7.21.4" + } + }, + "node_modules/@types/aria-query": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/prop-types": { + "version": "15.7.15", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", + "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/react": { + "version": "18.3.31", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", + "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/prop-types": "*", + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "18.3.7", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.7.tgz", + "integrity": "sha512-MEe3UeoENYVFXzoXEWsvcpg6ZvlrFNlOQ7EOsvhI3CfAXwzPfO8Qwuxd40nepsYKqyyVQnTdEfv68q91yLcKrQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^18.0.0" + } + }, + "node_modules/@vitejs/plugin-react": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", + "integrity": "sha512-gUu9hwfWvvEDBBmgtAowQCojwZmJ5mcLn3aufeCsitijs3+f2NsrPtlAWIR6OPiqljl96GVCUbLe0HyqIpVaoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/core": "^7.28.0", + "@babel/plugin-transform-react-jsx-self": "^7.27.1", + "@babel/plugin-transform-react-jsx-source": "^7.27.1", + "@rolldown/pluginutils": "1.0.0-beta.27", + "@types/babel__core": "^7.20.5", + "react-refresh": "^0.17.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + } + }, + "node_modules/@vitest/expect": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", + "integrity": "sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/pretty-format": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.1.9.tgz", + "integrity": "sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-2.1.9.tgz", + "integrity": "sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "2.1.9", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-2.1.9.tgz", + "integrity": "sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "magic-string": "^0.30.12", + "pathe": "^1.1.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.1.9.tgz", + "integrity": "sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^3.0.2" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", + "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "2.1.9", + "loupe": "^3.1.2", + "tinyrainbow": "^1.2.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aria-query": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.38", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.38.tgz", + "integrity": "sha512-31/02mVB4yuQU6adKk5SlY6m+mxDwUq5KZkyYgnLrrKl7TEm1+3PyDtDBz2kOv/wxZz41GHsvV1A/u6RmiyBvw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/browserslist": { + "version": "4.28.4", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz", + "integrity": "sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "baseline-browser-mapping": "^2.10.38", + "caniuse-lite": "^1.0.30001799", + "electron-to-chromium": "^1.5.376", + "node-releases": "^2.0.48", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001799", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz", + "integrity": "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true, + "license": "MIT" + }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/cssstyle": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.6.0.tgz", + "integrity": "sha512-2z+rWdzbbSZv6/rhtvzvqeZQHrBaqgogqt85sqFNbabZOuFbCVFb8kPeEtZjiKkbrm395irpNKiYeFeLiQnFPg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@asamuzakjp/css-color": "^3.2.0", + "rrweb-cssom": "^0.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cssstyle/node_modules/rrweb-cssom": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.8.0.tgz", + "integrity": "sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/data-urls": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decimal.js": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.6.0.tgz", + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dev": true, + "license": "MIT" + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/dom-accessibility-api": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.378", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.378.tgz", + "integrity": "sha512-VinvOAuuPmdD1guEgGv5f2Qp7/vlfqOrUOMYNnOD4wj3pit8kRsQHzfIf6teyUGWo15Tg5+bOJaRunvyltpVWQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expect-type": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz", + "integrity": "sha512-knvyeauYhqjOYvQ66MznSMs83wmHrCycNEN6Ao+2AeYEfxUIkuiVxdEa1qlGEPK+We3n0THiDciYSsCcgW/DoA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", + "integrity": "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.4", + "mime-types": "^2.1.35" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/html-encoding-sniffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-encoding": "^3.1.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz", + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/jsdom": { + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz", + "integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cssstyle": "^4.1.0", + "data-urls": "^5.0.0", + "decimal.js": "^10.4.3", + "form-data": "^4.0.0", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.5", + "is-potential-custom-element-name": "^1.0.1", + "nwsapi": "^2.2.12", + "parse5": "^7.1.2", + "rrweb-cssom": "^0.7.1", + "saxes": "^6.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^5.0.0", + "w3c-xmlserializer": "^5.0.0", + "webidl-conversions": "^7.0.0", + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.18.0", + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "canvas": "^2.11.2" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dev": true, + "license": "MIT", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "license": "MIT", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "license": "MIT", + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/lz-string": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "lz-string": "bin/bin.js" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", + "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/node-releases": { + "version": "2.0.49", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.49.tgz", + "integrity": "sha512-f06bl1D+8ZDkn2oOQQKAh5/otFWqVnM1Q5oerA8Pex7UfT66Tx4IPHIqVVFKqFT3FUtaDstdgkM7yT7JWhqxfw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/nwsapi": { + "version": "2.2.24", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.24.tgz", + "integrity": "sha512-7YRhZ3jS45LwmSCT4b2sVFHt/WuovaktDU07QrtOBY2PXskss5a9jfmR9jptyumwXST+rFjrmppMY1KT/yn35A==", + "dev": true, + "license": "MIT" + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/pathe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.15", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", + "integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/react": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", + "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", + "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.2" + }, + "peerDependencies": { + "react": "^18.3.1" + } + }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/react-refresh": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.17.0.tgz", + "integrity": "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rollup": { + "version": "4.62.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.62.2.tgz", + "integrity": "sha512-RFnrW4lhXA3s3eqHDZvN654g8OTjzRfqpIRJYczCGB6HzphckVAi/Qh4tbPUbRuDi7s1Llv8g/NspLkttY3gTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.62.2", + "@rollup/rollup-android-arm64": "4.62.2", + "@rollup/rollup-darwin-arm64": "4.62.2", + "@rollup/rollup-darwin-x64": "4.62.2", + "@rollup/rollup-freebsd-arm64": "4.62.2", + "@rollup/rollup-freebsd-x64": "4.62.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.62.2", + "@rollup/rollup-linux-arm-musleabihf": "4.62.2", + "@rollup/rollup-linux-arm64-gnu": "4.62.2", + "@rollup/rollup-linux-arm64-musl": "4.62.2", + "@rollup/rollup-linux-loong64-gnu": "4.62.2", + "@rollup/rollup-linux-loong64-musl": "4.62.2", + "@rollup/rollup-linux-ppc64-gnu": "4.62.2", + "@rollup/rollup-linux-ppc64-musl": "4.62.2", + "@rollup/rollup-linux-riscv64-gnu": "4.62.2", + "@rollup/rollup-linux-riscv64-musl": "4.62.2", + "@rollup/rollup-linux-s390x-gnu": "4.62.2", + "@rollup/rollup-linux-x64-gnu": "4.62.2", + "@rollup/rollup-linux-x64-musl": "4.62.2", + "@rollup/rollup-openbsd-x64": "4.62.2", + "@rollup/rollup-openharmony-arm64": "4.62.2", + "@rollup/rollup-win32-arm64-msvc": "4.62.2", + "@rollup/rollup-win32-ia32-msvc": "4.62.2", + "@rollup/rollup-win32-x64-gnu": "4.62.2", + "@rollup/rollup-win32-x64-msvc": "4.62.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/rrweb-cssom": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz", + "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==", + "dev": true, + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/saxes": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", + "dev": true, + "license": "ISC", + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=v12.22.7" + } + }, + "node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-1.2.0.tgz", + "integrity": "sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", + "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tr46": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.1.1.tgz", + "integrity": "sha512-hdF5ZgjTqgAntKkklYw0R03MG2x/bSzTtkxmIRw/sTNV8YXsCJ1tfLAX23lhxhHJlEf3CRCOCGGWw3vI3GaSPw==", + "dev": true, + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/vite": { + "version": "6.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", + "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.4.4", + "picomatch": "^4.0.2", + "postcss": "^8.5.3", + "rollup": "^4.34.9", + "tinyglobby": "^0.2.13" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "jiti": ">=1.21.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-2.1.9.tgz", + "integrity": "sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.3.7", + "es-module-lexer": "^1.5.4", + "pathe": "^1.1.2", + "vite": "^5.0.0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-2.1.9.tgz", + "integrity": "sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/expect": "2.1.9", + "@vitest/mocker": "2.1.9", + "@vitest/pretty-format": "^2.1.9", + "@vitest/runner": "2.1.9", + "@vitest/snapshot": "2.1.9", + "@vitest/spy": "2.1.9", + "@vitest/utils": "2.1.9", + "chai": "^5.1.2", + "debug": "^4.3.7", + "expect-type": "^1.1.0", + "magic-string": "^0.30.12", + "pathe": "^1.1.2", + "std-env": "^3.8.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.1", + "tinypool": "^1.0.1", + "tinyrainbow": "^1.2.0", + "vite": "^5.0.0", + "vite-node": "2.1.9", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "2.1.9", + "@vitest/ui": "2.1.9", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/vitest/node_modules/@vitest/mocker": { + "version": "2.1.9", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-2.1.9.tgz", + "integrity": "sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "2.1.9", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.12" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/w3c-xmlserializer": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "xml-name-validator": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "deprecated": "Use @exodus/bytes instead for a more spec-conformant and faster implementation", + "dev": true, + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.2.0.tgz", + "integrity": "sha512-De72GdQZzNTUBBChsXueQUnPKDkg/5A5zp7pFDuQAj5UFoENpiACU0wlCvzpAGnTkj++ihpKwKyYewn/XNUbKw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "^5.1.0", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true, + "license": "MIT" + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true, + "license": "ISC" + } + } +} diff --git a/src/problem2/package.json b/src/problem2/package.json new file mode 100644 index 0000000000..84c70b94e8 --- /dev/null +++ b/src/problem2/package.json @@ -0,0 +1,33 @@ +{ + "name": "currency-swap-form", + "private": true, + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "preview": "vite preview", + "test": "vitest", + "test:run": "vitest run", + "coverage": "vitest run --coverage" + }, + "dependencies": { + "react": "^18.3.1", + "react-dom": "^18.3.1" + }, + "devDependencies": { + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", + "@testing-library/user-event": "^14.6.1", + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.4", + "jsdom": "^25.0.1", + "typescript": "^5.6.3", + "vite": "^6.0.7", + "vitest": "^2.1.9" + }, + "overrides": { + "vite": "$vite" + } +} diff --git a/src/problem2/public/swap.svg b/src/problem2/public/swap.svg new file mode 100644 index 0000000000..551ff75cbd --- /dev/null +++ b/src/problem2/public/swap.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/problem2/script.js b/src/problem2/script.js deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/problem2/src/App.tsx b/src/problem2/src/App.tsx new file mode 100644 index 0000000000..bd9c02299e --- /dev/null +++ b/src/problem2/src/App.tsx @@ -0,0 +1,34 @@ +import { usePrices } from './hooks/usePrices'; +import { SwapForm } from './components/SwapForm'; + +export default function App() { + const { tokens, loading, error } = usePrices(); + + return ( +
+
+
+ +
+ {loading && ( +
+
+

Loading live prices…

+
+ )} + + {error && !loading && ( +
+

Couldn’t load prices: {error}

+
+ )} + + {!loading && !error && } + +
+ Prices & icons by Switcheo · Demo — no real funds move. +
+
+
+ ); +} diff --git a/src/problem2/src/components/SwapForm.test.tsx b/src/problem2/src/components/SwapForm.test.tsx new file mode 100644 index 0000000000..8a5c9bdc86 --- /dev/null +++ b/src/problem2/src/components/SwapForm.test.tsx @@ -0,0 +1,182 @@ +import { describe, it, expect } from 'vitest'; +import { render, screen } from '@testing-library/react'; +import userEvent from '@testing-library/user-event'; +import { SwapForm } from './SwapForm'; +import type { Token } from '../types'; + +// Deterministic tokens so the rate is predictable: rate = 10 / 2 = 5. +// Neither symbol is in INITIAL_BALANCES, so both start at DEFAULT_BALANCE (1,000). +const tokens: Token[] = [ + { symbol: 'AAA', price: 10, icon: 'about:blank' }, + { symbol: 'BBB', price: 2, icon: 'about:blank' }, +]; + +const payInput = () => screen.getByLabelText('You pay') as HTMLInputElement; +const receiveInput = () => + screen.getByLabelText('You receive') as HTMLInputElement; + +describe('SwapForm', () => { + it('renders with the submit button disabled until an amount is entered', () => { + render(); + const submit = screen.getByRole('button', { name: /enter an amount/i }); + expect(submit).toBeDisabled(); + }); + + it('computes the received amount from the exchange rate', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '3'); + + expect(receiveInput().value).toBe('15'); // 3 * (10 / 2) + expect( + screen.getByRole('button', { name: /confirm swap/i }), + ).toBeEnabled(); + }); + + it('shows an insufficient-balance error and blocks submit', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '999999'); // well above the 1,000 AAA balance + + expect(screen.getByText(/insufficient aaa balance/i)).toBeInTheDocument(); + expect( + screen.getByRole('button', { name: /confirm swap/i }), + ).toBeDisabled(); + }); + + it('rejects non-numeric input entirely', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), 'abc'); + + expect(payInput().value).toBe(''); // input guard strips it + }); + + it('caps the number of decimal places at 8', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '1.123456789'); // 9 decimals attempted + expect(payInput().value).toBe('1.12345678'); // 9th decimal rejected + }); + + it('caps the total input length at 20 characters', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '1'.repeat(30)); + expect(payInput().value).toHaveLength(20); + }); + + it('flips the tokens while keeping the typed amount (Binance-style)', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '3'); // paying 3 AAA -> receive 15 BBB + await user.click(screen.getByRole('button', { name: /switch direction/i })); + + // Tokens swap, but the typed amount stays as the source of truth... + expect(payInput().value).toBe('3'); + expect( + screen.getByRole('button', { name: 'Pay token: BBB' }), + ).toBeInTheDocument(); + // ...and the receive side recomputes: 3 BBB * (2 / 10) = 0.6 AAA. + expect(receiveInput().value).toBe('0.6'); + }); + + it('runs the simulated swap: loading then success', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '3'); + await user.click(screen.getByRole('button', { name: /confirm swap/i })); + + // Immediately enters the loading state... + expect(screen.getByRole('button', { name: /swapping/i })).toBeDisabled(); + + // ...then resolves to success after the simulated ~1.6s round-trip. + expect( + await screen.findByRole( + 'button', + { name: /swap complete/i }, + { timeout: 3000 }, + ), + ).toBeInTheDocument(); + + // A success toast appears with a receipt of the trade (3 AAA -> 15 BBB). + const toast = await screen.findByRole('status'); + expect(toast).toHaveTextContent('Swap complete'); + expect(toast).toHaveTextContent('3 AAA'); + expect(toast).toHaveTextContent('15 BBB'); + }); + + it('dismisses the success toast when its close button is clicked', async () => { + const user = userEvent.setup(); + render(); + + await user.type(payInput(), '3'); + await user.click(screen.getByRole('button', { name: /confirm swap/i })); + + // The toast (and its dismiss button) appears after the ~1.6s swap delay. + const dismiss = await screen.findByRole( + 'button', + { name: /dismiss/i }, + { timeout: 3000 }, + ); + await user.click(dismiss); + + expect(screen.queryByRole('status')).not.toBeInTheDocument(); + }); + + it('debits and credits the wallet after a successful swap', async () => { + const user = userEvent.setup(); + render(); + + // AAA and BBB aren't in INITIAL_BALANCES, so both start at DEFAULT_BALANCE (1,000). + expect(screen.getByText(/Balance: 1,000 AAA/)).toBeInTheDocument(); + + await user.type(payInput(), '3'); // pay 3 AAA -> receive 15 BBB + await user.click(screen.getByRole('button', { name: /confirm swap/i })); + + // After settling, AAA is debited 3 -> 997. + expect( + await screen.findByText(/Balance: 997 AAA/, undefined, { timeout: 3000 }), + ).toBeInTheDocument(); + + // Flip to view BBB, which was credited 15 -> 1,015. + await user.click(screen.getByRole('button', { name: /switch direction/i })); + expect(screen.getByText(/Balance: 1,015 BBB/)).toBeInTheDocument(); + }); + + it('fills the input with the full balance via the Max button', async () => { + const user = userEvent.setup(); + render(); + + await user.click(screen.getByRole('button', { name: /^max$/i })); + + // AAA starts at DEFAULT_BALANCE (1,000), so the input is filled with it. + expect(payInput().value).toBe('1000'); + }); + + it('shows Clear only when there is input and resets the field', async () => { + const user = userEvent.setup(); + render(); + + // Hidden while the field is empty. + expect( + screen.queryByRole('button', { name: /clear/i }), + ).not.toBeInTheDocument(); + + await user.type(payInput(), '3'); + await user.click(screen.getByRole('button', { name: /clear/i })); + + expect(payInput().value).toBe(''); + // ...and it disappears again once cleared. + expect( + screen.queryByRole('button', { name: /clear/i }), + ).not.toBeInTheDocument(); + }); +}); diff --git a/src/problem2/src/components/SwapForm.tsx b/src/problem2/src/components/SwapForm.tsx new file mode 100644 index 0000000000..0cfc35f15d --- /dev/null +++ b/src/problem2/src/components/SwapForm.tsx @@ -0,0 +1,356 @@ +import { useEffect, useMemo, useState } from 'react'; +import type { Token } from '../types'; +import { formatAmount, formatUsd } from '../lib/tokens'; +import { TokenIcon } from './TokenIcon'; +import { TokenSelect } from './TokenSelect'; +import { SwapToast, type SwapReceipt } from './SwapToast'; + +// How long the success toast stays on screen before auto-dismissing. +const TOAST_DURATION_MS = 5000; + +interface Props { + tokens: Token[]; +} + +type Side = 'from' | 'to'; +type SubmitState = 'idle' | 'swapping' | 'success'; + +// Input limits. 8 decimals matches the most `formatAmount` ever displays; a +// total length of 20 leaves ~11 integer digits — far below the 16 digits of +// Number.MAX_SAFE_INTEGER, so typed values never lose precision in whole units. +const MAX_DECIMALS = 8; +const MAX_INPUT_LENGTH = 20; +const AMOUNT_PATTERN = new RegExp(`^\\d*\\.?\\d{0,${MAX_DECIMALS}}$`); + +// Starting wallet balances, in token units. Edit these freely to change what +// the demo wallet holds. Any token not listed here starts at DEFAULT_BALANCE. +const INITIAL_BALANCES: Record = { + ETH: 12, + WBTC: 0.75, + USDC: 25000, + USD: 25000, + USDT: 25000, + ATOM: 800, + OSMO: 1500, + GMX: 60, + bNEO: 400, + BLUR: 5000, +}; + +// Fallback for any token without an explicit entry above. +const DEFAULT_BALANCE = 1000; + +/** Look up a token's starting balance from the static config. */ +function initialBalance(token: Token): number { + return INITIAL_BALANCES[token.symbol] ?? DEFAULT_BALANCE; +} + +export function SwapForm({ tokens }: Props) { + // Pick sensible defaults if available, otherwise the first two tokens. + const initialFrom = + tokens.find((t) => t.symbol === 'ETH') ?? tokens[0] ?? null; + const initialTo = + tokens.find((t) => t.symbol === 'USDC') ?? + tokens.find((t) => t !== initialFrom) ?? + null; + + const [fromToken, setFromToken] = useState(initialFrom); + const [toToken, setToToken] = useState(initialTo); + const [amount, setAmount] = useState(''); + const [picker, setPicker] = useState(null); + const [submit, setSubmit] = useState('idle'); + const [receipt, setReceipt] = useState(null); + + // Mutable wallet: holdings per token, seeded once from INITIAL_BALANCES. + // A completed swap debits the paid token and credits the received one. + const [balances, setBalances] = useState>(() => + Object.fromEntries(tokens.map((t) => [t.symbol, initialBalance(t)])), + ); + + const balance = fromToken ? (balances[fromToken.symbol] ?? 0) : 0; + const toBalance = toToken ? (balances[toToken.symbol] ?? 0) : 0; + + // Exchange rate: how many "to" units one "from" unit buys. + const rate = + fromToken && toToken ? fromToken.price / toToken.price : null; + + const parsedAmount = Number(amount); + const amountValid = + amount !== '' && Number.isFinite(parsedAmount) && parsedAmount > 0; + + const receiveAmount = + amountValid && rate !== null ? parsedAmount * rate : 0; + + // Validation ------------------------------------------------------------- + const error: string | null = useMemo(() => { + if (amount === '') return null; + if (!Number.isFinite(parsedAmount) || parsedAmount < 0) + return 'Enter a valid amount.'; + if (parsedAmount === 0) return null; + if (fromToken && parsedAmount > balance) + return `Insufficient ${fromToken.symbol} balance.`; + return null; + }, [amount, parsedAmount, balance, fromToken]); + + const canSubmit = + amountValid && !error && fromToken !== null && toToken !== null; + + // Reset the success state when the user edits the form again. + useEffect(() => { + if (submit === 'success') setSubmit('idle'); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [amount, fromToken, toToken]); + + // Auto-dismiss the success toast after a few seconds. + useEffect(() => { + if (!receipt) return; + const id = setTimeout(() => setReceipt(null), TOAST_DURATION_MS); + return () => clearTimeout(id); + }, [receipt]); + + // Handlers --------------------------------------------------------------- + function onAmountChange(value: string) { + // Allow only numbers with a single decimal point, capped decimals/length. + if (value.length > MAX_INPUT_LENGTH) return; + if (value === '' || AMOUNT_PATTERN.test(value)) { + setAmount(value); + } + } + + function flip() { + // Swap the tokens only; keep the typed amount as the source of truth and + // let the receive side recompute (like Binance Convert). Carrying the + // converted amount back into the input would round-trip with rounding drift. + setFromToken(toToken); + setToToken(fromToken); + } + + function pick(token: Token) { + if (picker === 'from') { + // Avoid selecting the same token on both sides. + if (toToken?.symbol === token.symbol) setToToken(fromToken); + setFromToken(token); + } else if (picker === 'to') { + if (fromToken?.symbol === token.symbol) setFromToken(toToken); + setToToken(token); + } + setPicker(null); + } + + async function onSubmit(e: React.FormEvent) { + e.preventDefault(); + if (!canSubmit || !fromToken || !toToken) return; + // Snapshot the trade now, before the form resets, for the success receipt. + const completed: SwapReceipt = { + fromSymbol: fromToken.symbol, + toSymbol: toToken.symbol, + fromAmount: parsedAmount, + toAmount: receiveAmount, + fromIcon: fromToken.icon, + toIcon: toToken.icon, + }; + setSubmit('swapping'); + // Simulate a backend round-trip. + await new Promise((r) => setTimeout(r, 1600)); + // Settle the trade against the wallet: debit the paid token, credit the + // received one. Clamp the debit at 0 to avoid tiny negative float dust. + setBalances((prev) => ({ + ...prev, + [completed.fromSymbol]: Math.max( + 0, + (prev[completed.fromSymbol] ?? 0) - completed.fromAmount, + ), + [completed.toSymbol]: + (prev[completed.toSymbol] ?? 0) + completed.toAmount, + })); + setSubmit('success'); + setAmount(''); + setReceipt(completed); + } + + const sendUsd = amountValid && fromToken ? parsedAmount * fromToken.price : 0; + const receiveUsd = receiveAmount && toToken ? receiveAmount * toToken.price : 0; + + return ( + <> +
+
+

Swap

+

Trade tokens in an instant

+
+ + {/* ---- You pay ---- */} +
+
+ + {fromToken && ( +
+ {amount !== '' && ( + + )} + +
+ )} +
+
+ onAmountChange(e.target.value)} + maxLength={MAX_INPUT_LENGTH} + autoComplete="off" + /> + setPicker('from')} /> +
+
+ + {sendUsd > 0 ? formatUsd(sendUsd) : ''} + + {fromToken && ( + + Balance: {formatAmount(balance)} {fromToken.symbol} + + )} +
+
+ + {/* ---- Flip ---- */} +
+ +
+ + {/* ---- You receive ---- */} +
+
+ +
+
+ 0 ? formatAmount(receiveAmount) : ''} + readOnly + tabIndex={-1} + /> + setPicker('to')} /> +
+
+ + {receiveUsd > 0 ? formatUsd(receiveUsd) : ''} + + {toToken && ( + + Balance: {formatAmount(toBalance)} {toToken.symbol} + + )} +
+
+ + {/* ---- Rate ---- */} + {rate !== null && fromToken && toToken && ( +
+ Rate + + 1 {fromToken.symbol} = {formatAmount(rate)} {toToken.symbol} + +
+ )} + + {/* ---- Error ---- */} + {error &&
{error}
} + + {/* ---- Submit ---- */} + + + setPicker(null)} + /> + + + {receipt && ( + setReceipt(null)} /> + )} + + ); +} + +/** The pill button that shows the selected token and opens the picker. */ +function TokenButton({ + token, + label, + onClick, +}: { + token: Token | null; + /** Accessible role of this selector, e.g. "Pay token". */ + label: string; + onClick: () => void; +}) { + return ( + + ); +} diff --git a/src/problem2/src/components/SwapToast.tsx b/src/problem2/src/components/SwapToast.tsx new file mode 100644 index 0000000000..3f80313b17 --- /dev/null +++ b/src/problem2/src/components/SwapToast.tsx @@ -0,0 +1,58 @@ +import { formatAmount } from '../lib/tokens'; +import { TokenIcon } from './TokenIcon'; + +/** Details of a completed swap, captured at submit time for the receipt. */ +export interface SwapReceipt { + fromSymbol: string; + toSymbol: string; + fromAmount: number; + toAmount: number; + fromIcon: string; + toIcon: string; +} + +interface Props { + receipt: SwapReceipt; + onClose: () => void; +} + +/** + * Success toast shown after a swap completes. Slides in, auto-dismisses via the + * depleting progress bar (timer owned by the parent), and can be closed manually. + */ +export function SwapToast({ receipt, onClose }: Props) { + return ( +
+ + + + + + +
+

Swap complete

+
+ + + {formatAmount(receipt.fromAmount)} {receipt.fromSymbol} + + + → + + + + {formatAmount(receipt.toAmount)} {receipt.toSymbol} + +
+
+ + + + +
+ ); +} diff --git a/src/problem2/src/components/TokenIcon.tsx b/src/problem2/src/components/TokenIcon.tsx new file mode 100644 index 0000000000..6190692cd8 --- /dev/null +++ b/src/problem2/src/components/TokenIcon.tsx @@ -0,0 +1,53 @@ +import { useState } from 'react'; + +interface Props { + symbol: string; + src: string; + size?: number; + /** Eager-load above-the-fold icons (the Pay/Receive pills); leave the + * off-screen modal list lazy. Defaults to lazy. */ + priority?: boolean; +} + +/** + * Renders a token's SVG icon, falling back to a coloured monogram bubble if the + * image is missing (not every symbol has an icon in the repo). + */ +export function TokenIcon({ symbol, src, size = 32, priority = false }: Props) { + const [failed, setFailed] = useState(false); + + if (failed) { + // Deterministic hue from the symbol so the fallback is stable per token. + const hue = [...symbol].reduce((acc, c) => acc + c.charCodeAt(0), 0) % 360; + return ( + + {symbol.slice(0, 3)} + + ); + } + + return ( + {`${symbol} setFailed(true)} + /> + ); +} diff --git a/src/problem2/src/components/TokenSelect.tsx b/src/problem2/src/components/TokenSelect.tsx new file mode 100644 index 0000000000..f393a1387c --- /dev/null +++ b/src/problem2/src/components/TokenSelect.tsx @@ -0,0 +1,107 @@ +import { useEffect, useMemo, useRef, useState } from 'react'; +import { createPortal } from 'react-dom'; +import type { Token } from '../types'; +import { formatUsd } from '../lib/tokens'; +import { TokenIcon } from './TokenIcon'; + +interface Props { + open: boolean; + tokens: Token[]; + /** Symbol to disable (already selected on the other side). */ + excludeSymbol?: string; + onSelect: (token: Token) => void; + onClose: () => void; +} + +/** Modal dialog that lets the user search and pick a token. */ +export function TokenSelect({ + open, + tokens, + excludeSymbol, + onSelect, + onClose, +}: Props) { + const [query, setQuery] = useState(''); + const inputRef = useRef(null); + + // Reset search and focus the field whenever the dialog opens. + useEffect(() => { + if (open) { + setQuery(''); + // Focus after the open transition starts. + requestAnimationFrame(() => inputRef.current?.focus()); + } + }, [open]); + + // Close on Escape. + useEffect(() => { + if (!open) return; + const onKey = (e: KeyboardEvent) => { + if (e.key === 'Escape') onClose(); + }; + window.addEventListener('keydown', onKey); + return () => window.removeEventListener('keydown', onKey); + }, [open, onClose]); + + const filtered = useMemo(() => { + const q = query.trim().toUpperCase(); + if (!q) return tokens; + return tokens.filter((t) => t.symbol.toUpperCase().includes(q)); + }, [tokens, query]); + + if (!open) return null; + + // Portal to so the fixed overlay escapes the swap-card's containing + // block (the card's backdrop-filter would otherwise clip it to the card). + return createPortal( +
+
e.stopPropagation()} + > +
+

Select a token

+ +
+ + setQuery(e.target.value)} + /> + +
    + {filtered.length === 0 && ( +
  • No tokens match “{query}”.
  • + )} + {filtered.map((token) => { + const disabled = token.symbol === excludeSymbol; + return ( +
  • + +
  • + ); + })} +
+
+
, + document.body, + ); +} diff --git a/src/problem2/src/hooks/usePrices.test.ts b/src/problem2/src/hooks/usePrices.test.ts new file mode 100644 index 0000000000..73da7e9354 --- /dev/null +++ b/src/problem2/src/hooks/usePrices.test.ts @@ -0,0 +1,57 @@ +import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +import { renderHook, waitFor } from '@testing-library/react'; +import { usePrices } from './usePrices'; +import type { PriceRecord } from '../types'; + +const feed: PriceRecord[] = [ + { currency: 'ETH', price: 1645, date: '2023-08-29T07:10:52.000Z' }, + { currency: 'USDC', price: 1, date: '2023-08-29T07:10:30.000Z' }, +]; + +function mockFetch(impl: () => Promise) { + vi.stubGlobal('fetch', vi.fn(impl)); +} + +afterEach(() => { + vi.unstubAllGlobals(); + vi.restoreAllMocks(); +}); + +describe('usePrices', () => { + beforeEach(() => vi.clearAllMocks()); + + it('starts loading, then exposes the derived token list', async () => { + mockFetch(async () => new Response(JSON.stringify(feed), { status: 200 })); + + const { result } = renderHook(() => usePrices()); + expect(result.current.loading).toBe(true); + + await waitFor(() => expect(result.current.loading).toBe(false)); + + expect(result.current.error).toBeNull(); + expect(result.current.tokens.map((t) => t.symbol)).toEqual(['ETH', 'USDC']); + expect(result.current.priceOf('ETH')).toBe(1645); + expect(result.current.priceOf('NOPE')).toBeUndefined(); + }); + + it('surfaces an error when the request fails', async () => { + mockFetch(async () => new Response('nope', { status: 500 })); + + const { result } = renderHook(() => usePrices()); + await waitFor(() => expect(result.current.loading).toBe(false)); + + expect(result.current.error).toMatch(/500/); + expect(result.current.tokens).toEqual([]); + }); + + it('surfaces an error when fetch rejects', async () => { + mockFetch(async () => { + throw new Error('network down'); + }); + + const { result } = renderHook(() => usePrices()); + await waitFor(() => expect(result.current.loading).toBe(false)); + + expect(result.current.error).toBe('network down'); + }); +}); diff --git a/src/problem2/src/hooks/usePrices.ts b/src/problem2/src/hooks/usePrices.ts new file mode 100644 index 0000000000..a9faf07283 --- /dev/null +++ b/src/problem2/src/hooks/usePrices.ts @@ -0,0 +1,46 @@ +import { useEffect, useState } from 'react'; +import type { PriceRecord, Token } from '../types'; +import { PRICES_URL, tokensFromPrices } from '../lib/tokens'; + +interface PricesState { + tokens: Token[]; + /** Quick symbol -> price lookup. */ + priceOf: (symbol: string) => number | undefined; + loading: boolean; + error: string | null; +} + +/** Fetches the price feed once and exposes the derived token list. */ +export function usePrices(): PricesState { + const [tokens, setTokens] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + useEffect(() => { + let cancelled = false; + + (async () => { + try { + const res = await fetch(PRICES_URL); + if (!res.ok) throw new Error(`Request failed (${res.status})`); + const data = (await res.json()) as PriceRecord[]; + if (cancelled) return; + setTokens(tokensFromPrices(data)); + } catch (err) { + if (cancelled) return; + setError(err instanceof Error ? err.message : 'Failed to load prices'); + } finally { + if (!cancelled) setLoading(false); + } + })(); + + return () => { + cancelled = true; + }; + }, []); + + const priceOf = (symbol: string) => + tokens.find((t) => t.symbol === symbol)?.price; + + return { tokens, priceOf, loading, error }; +} diff --git a/src/problem2/src/index.css b/src/problem2/src/index.css new file mode 100644 index 0000000000..31b37aa552 --- /dev/null +++ b/src/problem2/src/index.css @@ -0,0 +1,720 @@ +:root { + --bg: #0a0a12; + --panel: rgba(22, 22, 34, 0.72); + --panel-solid: #161622; + --field: #1c1c2b; + --field-hover: #222234; + --border: rgba(255, 255, 255, 0.07); + --border-strong: rgba(255, 255, 255, 0.14); + --text: #f4f4f8; + --muted: #8a8aa3; + --accent: #7c6cff; + --accent-2: #b06bff; + --accent-soft: rgba(124, 108, 255, 0.16); + --danger: #ff6b81; + --ok: #34d399; + --radius: 22px; + --radius-sm: 16px; + font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif; +} + +* { + box-sizing: border-box; + margin: 0; + padding: 0; + /* Kill the translucent (greenish on Android Chrome) overlay that flashes + when a button is tapped on touch devices. Desktop never shows it. */ + -webkit-tap-highlight-color: transparent; +} + +html, +body, +#root { + height: 100%; +} + +body { + background: var(--bg); + color: var(--text); + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + overflow-x: hidden; /* guard against the fixed orbs nudging horizontal scroll */ +} + +/* ---- App shell ---- */ +.app { + position: relative; + min-height: 100%; + min-height: 100dvh; /* track the mobile dynamic viewport (address bar) */ + display: grid; + place-items: center; + padding: 24px 16px; + background: + radial-gradient(1200px 600px at 50% -10%, rgba(124, 108, 255, 0.12), transparent 60%), + var(--bg); +} + +.app__inner { + position: relative; + z-index: 1; + width: 100%; + max-width: 440px; + display: flex; + flex-direction: column; + align-items: center; + gap: 18px; +} + +.app__footer { + color: var(--muted); + font-size: 12.5px; + text-align: center; +} + +/* Floating background orbs. Fixed to the viewport so they stay decorative and + never expand the scrollable area (which previously forced overflow:hidden). */ +.bg-orb { + position: fixed; + border-radius: 50%; + filter: blur(90px); + opacity: 0.5; + pointer-events: none; +} +.bg-orb--1 { + width: 420px; + height: 420px; + background: #5b3bff; + top: -120px; + left: -120px; + animation: float 14s ease-in-out infinite; +} +.bg-orb--2 { + width: 380px; + height: 380px; + background: #b06bff; + bottom: -140px; + right: -100px; + animation: float 18s ease-in-out infinite reverse; +} +@keyframes float { + 0%, 100% { transform: translate(0, 0); } + 50% { transform: translate(30px, 40px); } +} + +/* ---- Swap card ---- */ +.swap-card { + width: 100%; + background: var(--panel); + backdrop-filter: blur(20px); + -webkit-backdrop-filter: blur(20px); + border: 1px solid var(--border); + border-radius: var(--radius); + padding: 22px; + box-shadow: + 0 30px 60px -20px rgba(0, 0, 0, 0.6), + inset 0 1px 0 rgba(255, 255, 255, 0.05); + animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1); +} +@keyframes rise { + from { opacity: 0; transform: translateY(14px); } + to { opacity: 1; transform: translateY(0); } +} + +.swap-card--state { + display: flex; + flex-direction: column; + align-items: center; + gap: 14px; + padding: 48px 22px; + color: var(--muted); +} + +.swap-card__head { + margin-bottom: 16px; +} +.swap-card__head h2 { + font-size: 22px; + font-weight: 700; + letter-spacing: -0.02em; +} +.swap-card__head p { + color: var(--muted); + font-size: 13.5px; + margin-top: 2px; +} + +/* ---- Field ---- */ +.field { + background: var(--field); + border: 1px solid transparent; + border-radius: var(--radius-sm); + padding: 14px 16px; + transition: border-color 0.18s, background 0.18s; +} +.field:focus-within { + border-color: var(--border-strong); + background: var(--field-hover); +} +.field--error:focus-within, +.field--error { + border-color: rgba(255, 107, 129, 0.5); +} +.field--readonly { + background: rgba(28, 28, 43, 0.6); +} + +.field__top { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 8px; +} +.field__top label { + color: var(--muted); + font-size: 13px; + font-weight: 500; +} +/* ---- Field footer: USD value (left) + balance & Max (right) ---- */ +.field__footer { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + margin-top: 8px; + min-height: 22px; +} +.field__usd { + color: var(--muted); + font-size: 13px; +} +.field__balance-text { + color: var(--muted); + font-size: 12.5px; + white-space: nowrap; +} +.field__actions { + display: flex; + align-items: center; + gap: 6px; +} +.max-btn, +.clear-btn { + font-family: inherit; + font-size: 11px; + font-weight: 700; + letter-spacing: 0.04em; + padding: 3px 8px; + border-radius: 7px; + cursor: pointer; + transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s; +} +.max-btn:active, +.clear-btn:active { + transform: scale(0.94); +} +/* MAX: accent-tinted (primary action). */ +.max-btn { + border: 1px solid var(--accent-soft); + background: var(--accent-soft); + color: var(--accent-2); +} +.max-btn:hover { + background: rgba(124, 108, 255, 0.28); + border-color: var(--accent); +} +/* Clear: neutral grey, visually distinct from MAX. */ +.clear-btn { + border: 1px solid var(--border-strong); + background: rgba(255, 255, 255, 0.04); + color: var(--muted); +} +.clear-btn:hover { + background: rgba(255, 255, 255, 0.09); + border-color: var(--muted); + color: var(--text); +} + +.field__row { + display: flex; + align-items: center; + gap: 12px; +} +.field__input { + flex: 1; + min-width: 0; + background: none; + border: none; + outline: none; + color: var(--text); + font-size: 30px; + font-weight: 600; + letter-spacing: -0.02em; + font-family: inherit; +} +.field__input::placeholder { + color: #4a4a63; +} +.field__input:read-only { + cursor: default; +} +/* ---- Token button ---- */ +.token-btn { + display: inline-flex; + align-items: center; + gap: 7px; + flex-shrink: 0; + background: var(--panel-solid); + border: 1px solid var(--border); + color: var(--text); + padding: 7px 10px 7px 8px; + border-radius: 999px; + font-size: 15px; + font-weight: 600; + cursor: pointer; + font-family: inherit; + transition: transform 0.12s, border-color 0.15s, background 0.15s; +} +.token-btn:hover { + border-color: var(--border-strong); + background: var(--field-hover); +} +.token-btn:active { + transform: scale(0.97); +} +.token-btn__chevron { + color: var(--muted); +} + +/* ---- Token icon ---- */ +.token-icon { + border-radius: 50%; + flex-shrink: 0; + display: block; +} +.token-icon--fallback { + display: inline-flex; + align-items: center; + justify-content: center; + color: #fff; + font-weight: 700; + text-transform: uppercase; + letter-spacing: -0.03em; +} + +/* ---- Flip button ---- */ +.flip-wrap { + display: flex; + justify-content: center; + height: 0; + position: relative; + z-index: 2; +} +.flip-btn { + margin: -14px 0; + width: 40px; + height: 40px; + border-radius: 13px; + background: var(--panel-solid); + border: 4px solid var(--panel-solid); + outline: 1px solid var(--border); + color: var(--text); + display: grid; + place-items: center; + cursor: pointer; + transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s; +} +.flip-btn:hover { + color: var(--accent-2); + transform: rotate(180deg); +} +.flip-btn:active { + transform: rotate(180deg) scale(0.9); +} + +/* spacing between the two fields to make room for the flip button */ +.field + .flip-wrap + .field { + margin-top: 0; +} +.swap-card .field:first-of-type { + margin-bottom: 6px; +} +.swap-card .field--readonly { + margin-top: 6px; +} + +/* ---- Rate ---- */ +.rate { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 14px; + padding: 0 4px; + color: var(--muted); + font-size: 13px; +} +.rate span:last-child { + color: var(--text); + font-weight: 500; +} + +/* ---- Error ---- */ +.error-msg { + margin-top: 12px; + color: var(--danger); + font-size: 13.5px; + text-align: center; + animation: shake 0.3s ease; +} +@keyframes shake { + 0%, 100% { transform: translateX(0); } + 25% { transform: translateX(-4px); } + 75% { transform: translateX(4px); } +} + +/* ---- Submit ---- */ +.submit-btn { + width: 100%; + margin-top: 16px; + padding: 16px; + border: none; + border-radius: var(--radius-sm); + background: linear-gradient(135deg, var(--accent), var(--accent-2)); + color: #fff; + font-size: 16px; + font-weight: 700; + font-family: inherit; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + gap: 10px; + transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s; + box-shadow: 0 12px 28px -10px rgba(124, 108, 255, 0.7); +} +.submit-btn:hover:not(:disabled) { + box-shadow: 0 16px 34px -8px rgba(124, 108, 255, 0.85); + transform: translateY(-1px); +} +.submit-btn:active:not(:disabled) { + transform: translateY(0) scale(0.99); +} +.submit-btn:disabled { + cursor: not-allowed; + opacity: 0.5; + box-shadow: none; + background: var(--field-hover); + color: var(--muted); +} +.submit-btn--ok { + background: linear-gradient(135deg, #10b981, var(--ok)); + box-shadow: 0 12px 28px -10px rgba(52, 211, 153, 0.7); + opacity: 1 !important; + color: #fff !important; +} + +/* ---- Spinner ---- */ +.spinner { + width: 18px; + height: 18px; + border: 2.5px solid rgba(255, 255, 255, 0.35); + border-top-color: #fff; + border-radius: 50%; + animation: spin 0.7s linear infinite; +} +.spinner--lg { + width: 34px; + height: 34px; + border-width: 3px; + border-color: var(--accent-soft); + border-top-color: var(--accent); +} +@keyframes spin { + to { transform: rotate(360deg); } +} + +/* ---- Modal ---- */ +.modal-overlay { + position: fixed; + inset: 0; + background: rgba(6, 6, 12, 0.6); + backdrop-filter: blur(4px); + display: grid; + place-items: center; + padding: 20px; + z-index: 50; + animation: fade 0.18s ease; +} +@keyframes fade { + from { opacity: 0; } + to { opacity: 1; } +} +.modal { + width: 100%; + max-width: 400px; + max-height: 78vh; + display: flex; + flex-direction: column; + background: var(--panel-solid); + border: 1px solid var(--border); + border-radius: var(--radius); + box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.7); + animation: rise 0.25s cubic-bezier(0.22, 1, 0.36, 1); + overflow: hidden; +} +.modal__head { + display: flex; + justify-content: space-between; + align-items: center; + padding: 18px 18px 12px; +} +.modal__head h3 { + font-size: 17px; + font-weight: 600; +} +.icon-btn { + background: none; + border: none; + color: var(--muted); + font-size: 15px; + cursor: pointer; + width: 30px; + height: 30px; + border-radius: 8px; + transition: background 0.15s, color 0.15s; +} +.icon-btn:hover { + background: var(--field); + color: var(--text); +} +.modal__search { + margin: 0 18px 12px; + padding: 12px 14px; + background: var(--field); + border: 1px solid var(--border); + border-radius: 12px; + color: var(--text); + font-size: 14.5px; + font-family: inherit; + outline: none; +} +.modal__search:focus { + border-color: var(--accent); +} + +/* ---- Token list ---- */ +.token-list { + list-style: none; + overflow-y: auto; + padding: 4px 8px 12px; +} +.token-list__empty { + color: var(--muted); + text-align: center; + padding: 28px 12px; + font-size: 14px; +} +.token-list__item { + width: 100%; + display: flex; + align-items: center; + gap: 12px; + padding: 11px 12px; + background: none; + border: none; + border-radius: 12px; + color: var(--text); + cursor: pointer; + font-family: inherit; + transition: background 0.13s; +} +.token-list__item:hover:not(:disabled) { + background: var(--field); +} +.token-list__item:disabled { + opacity: 0.35; + cursor: not-allowed; +} +.token-list__symbol { + font-size: 15.5px; + font-weight: 600; +} +.token-list__price { + margin-left: auto; + color: var(--muted); + font-size: 13.5px; +} + +/* scrollbar */ +.token-list::-webkit-scrollbar { + width: 8px; +} +.token-list::-webkit-scrollbar-thumb { + background: var(--border-strong); + border-radius: 8px; +} + +/* ---- Success toast ---- */ +.toast { + position: fixed; + top: 24px; + left: 50%; + z-index: 60; + display: flex; + align-items: center; + gap: 14px; + width: min(380px, calc(100vw - 32px)); + padding: 14px 44px 16px 16px; + background: var(--panel-solid); + border: 1px solid var(--border); + /* border-left: 3px solid var(--ok); */ + border-radius: 16px; + box-shadow: 0 20px 50px -16px rgba(0, 0, 0, 0.7); + overflow: hidden; + /* Centered via translateX(-50%); resting transform matches the keyframe end. */ + transform: translateX(-50%); + animation: toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1); +} +@keyframes toast-in { + /* Anchored at the top; starts slightly lower and faint, then rises into + place and fades in. */ + from { opacity: 0; transform: translate(-50%, 20px) scale(0.98); } + to { opacity: 1; transform: translate(-50%, 0) scale(1); } +} + +.toast__check { + flex-shrink: 0; + width: 34px; + height: 34px; + border-radius: 50%; + display: grid; + place-items: center; + color: #fff; + background: linear-gradient(135deg, #10b981, var(--ok)); + box-shadow: 0 6px 16px -4px rgba(52, 211, 153, 0.6); + animation: pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both; +} +@keyframes pop { + from { transform: scale(0); } + to { transform: scale(1); } +} + +.toast__body { + min-width: 0; +} +.toast__title { + font-size: 14.5px; + font-weight: 600; + margin-bottom: 3px; +} +.toast__detail { + display: flex; + align-items: center; + gap: 6px; + color: var(--muted); + font-size: 13px; + white-space: nowrap; +} +.toast__detail span { + color: var(--text); + font-weight: 500; +} +.toast__arrow { + color: var(--muted) !important; + font-weight: 400 !important; +} + +.toast__close { + position: absolute; + top: 10px; + right: 10px; + width: 24px; + height: 24px; + border: none; + border-radius: 7px; + background: none; + color: var(--muted); + font-size: 12px; + cursor: pointer; + transition: background 0.15s, color 0.15s; +} +.toast__close:hover { + background: var(--field); + color: var(--text); +} + +.toast__progress { + position: absolute; + left: 0; + bottom: 0; + height: 3px; + width: 100%; + transform-origin: left; + background: linear-gradient(90deg, #10b981, var(--ok)); + animation: toast-progress 5s linear forwards; +} +@keyframes toast-progress { + from { transform: scaleX(1); } + to { transform: scaleX(0); } +} + +@media (prefers-reduced-motion: reduce) { + .toast, + .toast__check { animation: none; } +} + +@media (max-width: 480px) { + /* Full-screen, app-like form on phones: edge-to-edge, no floating card. + Switch the shell from grid-centering to a flex column so the height chain + (.app -> .app__inner -> .swap-card) reliably fills the viewport. */ + .app { + padding: 0; + display: flex; + flex-direction: column; + align-items: stretch; /* override place-items:center so children fill width */ + } + .app__inner { + max-width: none; + flex: 1; + gap: 0; + align-items: stretch; + } + .swap-card { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; /* center the content within the full height */ + border: none; + border-radius: 0; + box-shadow: none; + padding: calc(20px + env(safe-area-inset-top)) 16px + calc(18px + env(safe-area-inset-bottom)); + } + .swap-card--state { + flex: 1; + border-radius: 0; + } + .app__footer { + padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); + } + + .field__input { font-size: 26px; } + + /* Keep the footer readable when the balance string is long. */ + .field__footer { gap: 8px; } + .field__usd { flex-shrink: 0; } + .field__balance-text { + font-size: 12px; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + } + + /* Let the swap receipt wrap instead of being clipped on narrow screens. */ + .toast__detail { white-space: normal; } + .toast { padding: 14px 40px 16px 14px; } +} + +@media (max-width: 360px) { + .field__input { font-size: 23px; } + .token-btn { font-size: 14px; } +} diff --git a/src/problem2/src/lib/tokens.test.ts b/src/problem2/src/lib/tokens.test.ts new file mode 100644 index 0000000000..d5d48f0537 --- /dev/null +++ b/src/problem2/src/lib/tokens.test.ts @@ -0,0 +1,97 @@ +import { describe, it, expect } from 'vitest'; +import { + tokensFromPrices, + formatAmount, + formatUsd, + iconUrl, +} from './tokens'; +import type { PriceRecord } from '../types'; + +const rec = ( + currency: string, + price: number, + date = '2023-08-29T07:10:00.000Z', +): PriceRecord => ({ currency, price, date }); + +describe('tokensFromPrices', () => { + it('maps a clean feed into sorted tokens', () => { + const tokens = tokensFromPrices([rec('ETH', 1645), rec('ATOM', 7.2)]); + expect(tokens.map((t) => t.symbol)).toEqual(['ATOM', 'ETH']); // alphabetical + expect(tokens[1]).toMatchObject({ symbol: 'ETH', price: 1645 }); + }); + + it('keeps the most recent record when a currency is duplicated', () => { + const tokens = tokensFromPrices([ + rec('USD', 0.9, '2023-08-29T07:10:00.000Z'), + rec('USD', 1.0, '2023-08-29T07:20:00.000Z'), // newer + ]); + expect(tokens).toHaveLength(1); + expect(tokens[0].price).toBe(1.0); + }); + + it('does NOT overwrite on a timestamp tie (first record wins)', () => { + // Mirrors the real BUSD pair in the feed, which share a timestamp. + const sameDate = '2023-08-29T07:10:40.000Z'; + const tokens = tokensFromPrices([ + rec('BUSD', 0.999183113, sameDate), + rec('BUSD', 0.9998782611186441, sameDate), + ]); + expect(tokens).toHaveLength(1); + expect(tokens[0].price).toBe(0.999183113); + }); + + it('drops records priced at or below zero', () => { + const tokens = tokensFromPrices([rec('A', 0), rec('B', -5), rec('C', 3)]); + expect(tokens.map((t) => t.symbol)).toEqual(['C']); + }); + + it('ignores malformed records', () => { + const dirty = [ + null, + undefined, + { currency: 'X' }, // no price + { currency: 'Y', price: 'abc', date: '' }, + rec('OK', 2), + ] as unknown as PriceRecord[]; + const tokens = tokensFromPrices(dirty); + expect(tokens.map((t) => t.symbol)).toEqual(['OK']); + }); + + it('attaches an icon URL for each token', () => { + const [eth] = tokensFromPrices([rec('ETH', 1645)]); + expect(eth.icon).toBe(iconUrl('ETH')); + expect(eth.icon).toMatch(/\/ETH\.svg$/); + }); + + it('returns an empty array for an empty feed', () => { + expect(tokensFromPrices([])).toEqual([]); + }); +}); + +describe('formatAmount', () => { + it('returns "0" for zero and non-finite values', () => { + expect(formatAmount(0)).toBe('0'); + expect(formatAmount(NaN)).toBe('0'); + expect(formatAmount(Infinity)).toBe('0'); + }); + + it('formats integers and decimals without noise', () => { + expect(formatAmount(15)).toBe('15'); + expect(formatAmount(1234.5)).toBe('1,234.5'); + }); + + it('keeps extra precision for sub-1 values', () => { + expect(formatAmount(0.1234567)).toBe('0.1234567'); + }); +}); + +describe('formatUsd', () => { + it('formats a USD value with two decimals', () => { + expect(formatUsd(1)).toBe('$1.00'); + expect(formatUsd(1645.9337)).toBe('$1,645.93'); + }); + + it('falls back to $0.00 for non-finite values', () => { + expect(formatUsd(NaN)).toBe('$0.00'); + }); +}); diff --git a/src/problem2/src/lib/tokens.ts b/src/problem2/src/lib/tokens.ts new file mode 100644 index 0000000000..0cf57e7c4e --- /dev/null +++ b/src/problem2/src/lib/tokens.ts @@ -0,0 +1,65 @@ +import type { PriceRecord, Token } from '../types'; + +export const PRICES_URL = 'https://interview.switcheo.com/prices.json'; + +const ICON_BASE = + 'https://raw.githubusercontent.com/Switcheo/token-icons/main/tokens'; + +/** Build the SVG icon URL for a token symbol. */ +export function iconUrl(symbol: string): string { + return `${ICON_BASE}/${symbol}.svg`; +} + +/** + * Turn the raw price feed into a clean, de-duplicated token list. + * + * The feed contains duplicate currencies (and entries with no usable price); + * we keep the most recent priced record per currency, drop anything priced at + * zero or below, and sort alphabetically for a predictable picker order. + */ +export function tokensFromPrices(records: PriceRecord[]): Token[] { + const latest = new Map(); + + for (const record of records) { + if (!record || typeof record.price !== 'number' || record.price <= 0) { + continue; + } + const existing = latest.get(record.currency); + if (!existing || new Date(record.date) > new Date(existing.date)) { + latest.set(record.currency, record); + } + } + + return [...latest.values()] + .map((record) => ({ + symbol: record.currency, + price: record.price, + icon: iconUrl(record.currency), + })) + .sort((a, b) => a.symbol.localeCompare(b.symbol)); +} + +/** Format a number as a token amount, trimming noisy trailing zeros. */ +export function formatAmount(value: number, maxDecimals = 6): string { + if (!Number.isFinite(value)) return '0'; + if (value === 0) return '0'; + // Very small values: show enough significant digits to be meaningful. + const decimals = value < 1 ? Math.min(8, maxDecimals + 2) : maxDecimals; + return value + .toLocaleString('en-US', { + minimumFractionDigits: 0, + maximumFractionDigits: decimals, + }) + .replace(/,/g, value >= 1000 ? ',' : ''); +} + +/** Format a USD value. */ +export function formatUsd(value: number): string { + if (!Number.isFinite(value)) return '$0.00'; + return value.toLocaleString('en-US', { + style: 'currency', + currency: 'USD', + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }); +} diff --git a/src/problem2/src/main.tsx b/src/problem2/src/main.tsx new file mode 100644 index 0000000000..dcf08c3d0e --- /dev/null +++ b/src/problem2/src/main.tsx @@ -0,0 +1,10 @@ +import { StrictMode } from 'react'; +import { createRoot } from 'react-dom/client'; +import App from './App.tsx'; +import './index.css'; + +createRoot(document.getElementById('root')!).render( + + + , +); diff --git a/src/problem2/src/test/setup.ts b/src/problem2/src/test/setup.ts new file mode 100644 index 0000000000..a8b42eed42 --- /dev/null +++ b/src/problem2/src/test/setup.ts @@ -0,0 +1,8 @@ +import '@testing-library/jest-dom/vitest'; +import { afterEach } from 'vitest'; +import { cleanup } from '@testing-library/react'; + +// Unmount React trees after each test so they don't leak between specs. +afterEach(() => { + cleanup(); +}); diff --git a/src/problem2/src/types.ts b/src/problem2/src/types.ts new file mode 100644 index 0000000000..6f38f90a37 --- /dev/null +++ b/src/problem2/src/types.ts @@ -0,0 +1,16 @@ +/** A single price record as returned by the Switcheo prices endpoint. */ +export interface PriceRecord { + currency: string; + date: string; + price: number; +} + +/** A token usable in the swap form: a currency that has a known USD price. */ +export interface Token { + /** Ticker symbol, e.g. "ETH". */ + symbol: string; + /** USD price per unit. */ + price: number; + /** URL of the token's SVG icon. */ + icon: string; +} diff --git a/src/problem2/src/vite-env.d.ts b/src/problem2/src/vite-env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/src/problem2/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/src/problem2/style.css b/src/problem2/style.css deleted file mode 100644 index 915af91c72..0000000000 --- a/src/problem2/style.css +++ /dev/null @@ -1,8 +0,0 @@ -body { - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - min-width: 360px; - font-family: Arial, Helvetica, sans-serif; -} diff --git a/src/problem2/tsconfig.app.json b/src/problem2/tsconfig.app.json new file mode 100644 index 0000000000..c5542db3b6 --- /dev/null +++ b/src/problem2/tsconfig.app.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + "types": ["vitest/globals", "@testing-library/jest-dom"], + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/src/problem2/tsconfig.app.tsbuildinfo b/src/problem2/tsconfig.app.tsbuildinfo new file mode 100644 index 0000000000..9e100e78ca --- /dev/null +++ b/src/problem2/tsconfig.app.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./src/app.tsx","./src/main.tsx","./src/types.ts","./src/vite-env.d.ts","./src/components/swapform.test.tsx","./src/components/swapform.tsx","./src/components/swaptoast.tsx","./src/components/tokenicon.tsx","./src/components/tokenselect.tsx","./src/hooks/useprices.test.ts","./src/hooks/useprices.ts","./src/lib/tokens.test.ts","./src/lib/tokens.ts","./src/test/setup.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/src/problem2/tsconfig.json b/src/problem2/tsconfig.json new file mode 100644 index 0000000000..1ffef600d9 --- /dev/null +++ b/src/problem2/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/src/problem2/tsconfig.node.json b/src/problem2/tsconfig.node.json new file mode 100644 index 0000000000..b3fc13e547 --- /dev/null +++ b/src/problem2/tsconfig.node.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["vite.config.ts"] +} diff --git a/src/problem2/tsconfig.node.tsbuildinfo b/src/problem2/tsconfig.node.tsbuildinfo new file mode 100644 index 0000000000..62c7bf924f --- /dev/null +++ b/src/problem2/tsconfig.node.tsbuildinfo @@ -0,0 +1 @@ +{"root":["./vite.config.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/src/problem2/vite.config.ts b/src/problem2/vite.config.ts new file mode 100644 index 0000000000..3417a9f2ca --- /dev/null +++ b/src/problem2/vite.config.ts @@ -0,0 +1,13 @@ +import { defineConfig } from 'vitest/config'; +import react from '@vitejs/plugin-react'; + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [react()], + test: { + globals: true, + environment: 'jsdom', + setupFiles: './src/test/setup.ts', + css: false, + }, +}); diff --git a/src/problem3/task.md b/src/problem3/task.md new file mode 100644 index 0000000000..4422738116 --- /dev/null +++ b/src/problem3/task.md @@ -0,0 +1,220 @@ +# Task + +List out the computational inefficiencies and anti-patterns found in the code block below. + +1. This code block uses + 1. ReactJS with TypeScript. + 2. Functional components. + 3. React Hooks +2. You should also provide a refactored version of the code, but more points are awarded to accurately stating the issues and explaining correctly how to improve them. + +```tsx +interface WalletBalance { + currency: string; + amount: number; +} +interface FormattedWalletBalance { + currency: string; + amount: number; + formatted: string; +} + +interface Props extends BoxProps { + +} +const WalletPage: React.FC = (props: Props) => { + const { children, ...rest } = props; + const balances = useWalletBalances(); + const prices = usePrices(); + + const getPriority = (blockchain: any): number => { + switch (blockchain) { + case 'Osmosis': + return 100 + case 'Ethereum': + return 50 + case 'Arbitrum': + return 30 + case 'Zilliqa': + return 20 + case 'Neo': + return 20 + default: + return -99 + } + } + + const sortedBalances = useMemo(() => { + return balances.filter((balance: WalletBalance) => { + const balancePriority = getPriority(balance.blockchain); + if (lhsPriority > -99) { + if (balance.amount <= 0) { + return true; + } + } + return false + }).sort((lhs: WalletBalance, rhs: WalletBalance) => { + const leftPriority = getPriority(lhs.blockchain); + const rightPriority = getPriority(rhs.blockchain); + if (leftPriority > rightPriority) { + return -1; + } else if (rightPriority > leftPriority) { + return 1; + } + }); + }, [balances, prices]); + + const formattedBalances = sortedBalances.map((balance: WalletBalance) => { + return { + ...balance, + formatted: balance.amount.toFixed() + } + }) + + const rows = sortedBalances.map((balance: FormattedWalletBalance, index: number) => { + const usdValue = prices[balance.currency] * balance.amount; + return ( + + ) + }) + + return ( +
+ {rows} +
+ ) +} +``` + +--- + +# Solution + +## Issues found + +### Correctness bugs (these break at runtime or produce wrong output) + +1. **`lhsPriority` is undefined inside `filter`.** The variable computed is `balancePriority`, but the condition checks `lhsPriority`. `lhsPriority` doesn't exist in that scope, so this throws a `ReferenceError` (or, if it ever resolved, silently misbehaves). It should reference `balancePriority`. + +2. **The filter logic is inverted.** The intent is clearly to keep balances that belong to a known chain *and* have a positive amount. The code instead keeps balances where `amount <= 0` and drops everything else. The condition should be `balancePriority > -99 && balance.amount > 0`. + +3. **`balance.blockchain` does not exist on `WalletBalance`.** The interface declares only `currency` and `amount`, yet the code reads `balance.blockchain`. This is a type error; `blockchain` must be added to the interface (and the lookup keyed off it, or off `currency`, consistently). + +4. **`sort` comparator has no return for the equal case.** When `leftPriority === rightPriority` the function falls through and returns `undefined`. A comparator must return a number; `undefined` yields implementation-defined/unstable ordering. Add a `return 0`. + +5. **`rows` maps over `sortedBalances` but is typed as `FormattedWalletBalance` and reads `balance.formatted`.** `sortedBalances` items are `WalletBalance` (no `formatted` field), so `formattedAmount={balance.formatted}` is always `undefined`. It should map over `formattedBalances` instead. + +### Computational inefficiencies / anti-patterns + +6. **`prices` is an unnecessary `useMemo` dependency.** The memoized computation only uses `balances` and `getPriority`. Listing `prices` causes the entire filter+sort to re-run whenever prices tick (which is often, for a wallet), wasting work. Dependency array should be `[balances]`. + +7. **`formattedBalances` is computed but never used.** It maps the full list on every render and the result is discarded (`rows` uses `sortedBalances`). Either wire it into `rows` (the correct fix) or remove it — but it must not be dead work. + +8. **`getPriority` is re-created on every render.** It's a pure function with no dependency on props/state, so it's reallocated each render and can't be a stable `useMemo`/`useCallback` dependency. Move it to module scope (outside the component). + +9. **`getPriority(blockchain: any)`** — `any` defeats type checking. Use a `Blockchain` union type so invalid chains are caught at compile time. + +10. **`getPriority` is called repeatedly per element.** It runs once per item in `filter` and twice per comparison in `sort` (O(n log n) calls). Computing each balance's priority once up front avoids redundant `switch` evaluations. + +11. **`key={index}` anti-pattern.** Index keys break React's reconciliation when the list is filtered/sorted/reordered (which this list is). Use a stable, unique key such as `balance.currency`. + +12. **`prices[balance.currency]` can be `undefined`**, making `usdValue` `NaN`. Guard with a fallback (`?? 0`). + +13. **Minor:** `balance.amount.toFixed()` defaults to 0 decimals — likely unintended for currency; specify a precision. `children` is destructured but never rendered. The empty `interface Props extends BoxProps {}` adds nothing over `BoxProps` directly. `rows` could be memoized. + +## Refactored version + +```tsx +type Blockchain = 'Osmosis' | 'Ethereum' | 'Arbitrum' | 'Zilliqa' | 'Neo'; + +interface WalletBalance { + currency: string; + amount: number; + blockchain: Blockchain; // (1)(3) field the logic actually depends on +} + +interface FormattedWalletBalance extends WalletBalance { + formatted: string; +} + +// (8) Pure, no component state — define once at module scope. +// (9) Typed parameter instead of `any`. +const getPriority = (blockchain: Blockchain): number => { + switch (blockchain) { + case 'Osmosis': + return 100; + case 'Ethereum': + return 50; + case 'Arbitrum': + return 30; + case 'Zilliqa': + return 20; + case 'Neo': + return 20; + default: + return -99; + } +}; + +type Props = BoxProps; // (13) empty interface extension removed + +const WalletPage: React.FC = (props: Props) => { + const { children, ...rest } = props; + const balances = useWalletBalances(); + const prices = usePrices(); + + // (6) depends only on `balances`. (10) priority computed once per item. + const sortedBalances = useMemo(() => { + return balances + .map((balance: WalletBalance) => ({ + balance, + priority: getPriority(balance.blockchain), + })) + .filter(({ balance, priority }) => priority > -99 && balance.amount > 0) // (2) + .sort((lhs, rhs) => rhs.priority - lhs.priority) // (4) total order, incl. equality + .map(({ balance }) => balance); + }, [balances]); + + // (5)(7) actually used, and memoized so it isn't recomputed needlessly. + const formattedBalances: FormattedWalletBalance[] = useMemo( + () => + sortedBalances.map((balance) => ({ + ...balance, + formatted: balance.amount.toFixed(2), // (13) explicit precision + })), + [sortedBalances], + ); + + const rows = useMemo( + () => + formattedBalances.map((balance: FormattedWalletBalance) => { + const usdValue = (prices[balance.currency] ?? 0) * balance.amount; // (12) + return ( + + ); + }), + [formattedBalances, prices], + ); + + return
{rows}
; +}; +``` + +### Notes on the refactor + +- `filter → sort → map` over a single `{ balance, priority }` intermediate computes each priority exactly once instead of on every comparison. +- The sort is reduced to `rhs.priority - lhs.priority`, which is a correct total order (descending) and handles the equal case implicitly by returning `0`. +- Splitting the three memos (`sortedBalances`, `formattedBalances`, `rows`) keeps each one keyed to its real inputs, so a price tick only re-renders `rows`, not the sort. +- If `WalletBalance` can legitimately carry chains beyond the five above, widen `Blockchain` to `Blockchain | (string & {})` (or keep `string`) so the `default` branch stays meaningful.